鸿宇研学生前端代码
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.

121 lines
2.6 KiB

  1. <template>
  2. <view class="records__view">
  3. <uv-steps direction="column">
  4. <uv-steps-item v-for="(record, index) in list" :key="record.id">
  5. <template #icon>
  6. <view class="flex mark is-active" v-if="index === 0">
  7. <image class="icon" src="@/static/image/icon-mark-highlight.png" mode="widthFix"></image>
  8. </view>
  9. <view class="flex mark" v-else>
  10. <image class="icon" src="@/static/image/icon-mark.png" mode="widthFix"></image>
  11. </view>
  12. </template>
  13. <template #title>
  14. <view class="title">{{ record.name }}</view>
  15. </template>
  16. <template #desc>
  17. <view class="content">
  18. <view class="list">
  19. <view class="flex flex-column list-item" v-for="(child, cIdx) in record.children" :key="cIdx" @click="onLightMedal(child.medalId)">
  20. <image class="list-item-icon" :src="child.icon" mode="aspectFill"></image>
  21. <view class="list-item-title">{{ child.label }}</view>
  22. <view class="list-item-desc" v-if="child.createTime">{{ $dayjs(child.createTime).format('YYYY-MM-DD') }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. </uv-steps-item>
  28. </uv-steps>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. props: {
  34. list: {
  35. type: Array,
  36. default() {
  37. return []
  38. }
  39. }
  40. },
  41. methods: {
  42. async onLightMedal(medalId) {
  43. try {
  44. await this.$fetch('lightMedal', { medalId })
  45. this.$emit('lighted')
  46. } catch (err) {
  47. }
  48. },
  49. },
  50. }
  51. </script>
  52. <style scoped lang="scss">
  53. .records__view {
  54. padding-left: 40rpx;
  55. }
  56. .mark {
  57. margin-top: 8rpx;
  58. width: 36rpx;
  59. height: 36rpx;
  60. background: #F3F3F3;
  61. border-radius: 50%;
  62. .icon {
  63. width: 24rpx;
  64. height: auto;
  65. }
  66. &.is-active {
  67. background: linear-gradient(to right, #21FEEC, #019AF9);
  68. }
  69. }
  70. .title {
  71. font-family: PingFang SC;
  72. font-size: 30rpx;
  73. font-weight: 500;
  74. line-height: 1.4;
  75. color: #191919;
  76. }
  77. .content {
  78. width: calc(100vw - 92rpx);
  79. }
  80. .list {
  81. display: flex;
  82. flex-wrap: nowrap;
  83. overflow-x: auto;
  84. font-family: PingFang SC;
  85. line-height: 1.4;
  86. &-item {
  87. flex: none;
  88. row-gap: 4rpx;
  89. width: 206rpx;
  90. height: 226rpx;
  91. &-icon {
  92. width: 110rpx;
  93. height: 110rpx;
  94. }
  95. &-title {
  96. font-size: 28rpx;
  97. font-weight: 500;
  98. color: #080808;
  99. }
  100. &-desc {
  101. font-size: 26rpx;
  102. font-weight: 400;
  103. color: #999999;
  104. }
  105. }
  106. }
  107. </style>