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

118 lines
2.5 KiB

  1. <template>
  2. <view class="page__view highlight">
  3. <!-- 导航栏 -->
  4. <navbar title="我的成就" leftClick @leftClick="$utils.navigateBack" />
  5. <view class="main">
  6. <view class="flex summary">
  7. <view class="info">
  8. <view class="flex title">共获得<view class="highlight">{{ total }}</view>枚成就</view>
  9. <view class="tag">新获得</view>
  10. </view>
  11. <view class="icon">
  12. <image class="img" src="@/pages_order/static/temp-49.png" mode="widthFix"></image>
  13. </view>
  14. </view>
  15. <view class="list">
  16. <recordsView :list="list" @lighted="getData"></recordsView>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import mixinsList from '@/mixins/list.js'
  23. import recordsView from './recordsView.vue'
  24. export default {
  25. mixins: [mixinsList],
  26. components: {
  27. recordsView,
  28. },
  29. data() {
  30. return {
  31. keyword: '',
  32. mixinsListApi: 'queryMedalList',
  33. }
  34. },
  35. onLoad({ search }) {
  36. if (search) {
  37. this.keyword = search
  38. this.queryParams.title = search
  39. }
  40. this.getData()
  41. },
  42. methods: {
  43. getDataThen(records) {
  44. this.list = records.map(item => {
  45. const { id, activityId_dictText, medalId, medal, createTime, isLight: _isLight } = item
  46. const { title, icon1, icon2 } = medal
  47. const isLight = _isLight == '1'
  48. return {
  49. id,
  50. name: activityId_dictText,
  51. children: [
  52. {
  53. medalId,
  54. icon: isLight ? icon1 : icon2,
  55. label: title,
  56. createTime,
  57. isLight,
  58. },
  59. ]
  60. }
  61. })
  62. },
  63. },
  64. }
  65. </script>
  66. <style scoped lang="scss">
  67. .summary {
  68. padding: 16rpx 72rpx 32rpx 64rpx;
  69. justify-content: space-between;
  70. font-family: PingFang SC;
  71. font-weight: 400;
  72. line-height: 1.4;
  73. .info {
  74. .title {
  75. font-size: 32rpx;
  76. font-weight: 600;
  77. color: #000000;
  78. .highlight {
  79. margin: 0 8rpx;
  80. color: $uni-color;
  81. }
  82. }
  83. .tag {
  84. margin-top: 4rpx;
  85. display: inline-block;
  86. padding: 4rpx 16rpx;
  87. font-size: 26rpx;
  88. color: #21607D;
  89. background: #DBF4FF;
  90. border-radius: 22rpx;
  91. }
  92. }
  93. .icon {
  94. width: 160rpx;
  95. height: auto;
  96. .img {
  97. width: 100%;
  98. height: auto;
  99. }
  100. }
  101. }
  102. </style>