吉光研途前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.2 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="info">
  3. <view class="title" v-if="data.title">{{ data.title }}</view>
  4. <view class="flex process" v-if="difficulty">
  5. <view>难度</view>
  6. <view class="flex star">
  7. <uv-icon v-for="(item, index) in new Array(difficulty).fill(1)" :key="index" name="star-fill" color="#FFFFFF" size="14rpx"></uv-icon>
  8. </view>
  9. </view>
  10. <view class="content" v-if="data.shortTitle">
  11. {{ data.shortTitle || '' }}
  12. </view>
  13. <view class="flex tag" v-if="tags.length">
  14. <view class="tag-item" v-for="(item, index) in tags" :key="index">
  15. {{ item }}
  16. </view>
  17. </view>
  18. <view class="btn">
  19. <image class="btn-img" src="@/static/image/icon-detail.png" mode="widthFix"></image>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. props: {
  26. data: {
  27. type: Object,
  28. default() {
  29. return {}
  30. }
  31. }
  32. },
  33. computed: {
  34. difficulty() {
  35. const num = parseInt(this.data?.process)
  36. return isNaN(num) ? 0 : num
  37. },
  38. tags() {
  39. return this.data?.tag?.split?.('、') || []
  40. }
  41. },
  42. }
  43. </script>
  44. <style scoped lang="scss">
  45. .info {
  46. padding: 30rpx 24rpx 24rpx 24rpx;
  47. font-size: 0;
  48. .title {
  49. font-size: 32rpx;
  50. font-weight: 700;
  51. color: #6851A7;
  52. }
  53. .process {
  54. margin-top: 7rpx;
  55. column-gap: 8rpx;
  56. display: inline-flex;
  57. padding: 3rpx 16rpx;
  58. font-size: 16rpx;
  59. font-weight: 600;
  60. color: #FFFFFF;
  61. background: #6851A7;
  62. border-radius: 13rpx;
  63. .star {
  64. column-gap: 6rpx;
  65. }
  66. }
  67. .content {
  68. margin-top: 24rpx;
  69. font-size: 20rpx;
  70. font-weight: 500;
  71. color: #3E3A39;
  72. }
  73. .tag {
  74. margin-top: 16rpx;
  75. justify-content: flex-start;
  76. flex-wrap: wrap;
  77. column-gap: 12rpx;
  78. row-gap: 8rpx;
  79. &-item {
  80. padding: 4rpx 10rpx;
  81. font-size: 16rpx;
  82. font-weight: 700;
  83. color: #FFFFFF;
  84. background: rgba($color: #6851A7, $alpha: 0.59);
  85. border-radius: 4rpx;
  86. }
  87. }
  88. .btn {
  89. margin-top: 16rpx;
  90. width: 190rpx;
  91. height: auto;
  92. &-img {
  93. width: 100%;
  94. height: auto;
  95. }
  96. }
  97. }
  98. </style>