木邻有你前端代码仓库
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.

152 lines
2.8 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. <template>
  2. <view class="page">
  3. <!-- 收藏列表 -->
  4. <view class="content" v-if="list.length > 0">
  5. <view v class="list">
  6. <view v-for="item in list" :key="item.id" class="record-item" @click="viewGoodsDetail(item)">
  7. <image class="record-image" :src="item.communityGoods.image" mode="aspectFit"></image>
  8. <view class="record-content">
  9. <view class="record-info">
  10. <view class="title-row">
  11. <text class="record-title">{{ item.communityGoods.title }}</text>
  12. </view>
  13. <view class="record-points">
  14. <uv-icon name="integral" size="16" color="#218cdd"></uv-icon>
  15. <text class="points-text">{{ item.communityGoods.price }}积分</text>
  16. </view>
  17. <view class="record-time">
  18. <uv-icon name="heart-fill" size="14" color="#ff6b6b"></uv-icon>
  19. <text class="time-text">收藏时间{{ item.createTime }}</text>
  20. </view>
  21. </view>
  22. <view class="record-action">
  23. <uv-button
  24. type="primary"
  25. size="small"
  26. text="查看详情"
  27. shape="circle"
  28. ></uv-button>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </view>
  34. <view v-else class="empty">
  35. <uv-empty icon="/static/暂无收藏.png" text="暂无收藏商品"></uv-empty>
  36. </view>
  37. </view>
  38. </template>
  39. <script>
  40. import MixinList from '@/mixins/list'
  41. export default {
  42. mixins: [MixinList],
  43. data() {
  44. return {
  45. list: [],
  46. mixinListApi: 'shop.queryGoodsCollectionList'
  47. }
  48. },
  49. methods: {
  50. // 查看商品详情
  51. viewGoodsDetail(item) {
  52. uni.navigateTo({
  53. url: `/subPages/shop/goodsDetail?id=${item.goodsId}`
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .page {
  61. background-color: #f5f5f5;
  62. min-height: 100vh;
  63. }
  64. .content {
  65. padding: 0;
  66. }
  67. .list {
  68. padding: 20rpx;
  69. }
  70. .record-item {
  71. display: flex;
  72. align-items: flex-start;
  73. margin-bottom: 30rpx;
  74. background: #fff;
  75. border-radius: 12rpx;
  76. padding: 20rpx;
  77. }
  78. .record-image {
  79. width: 215rpx;
  80. height: 215rpx;
  81. border-radius: 8rpx;
  82. margin-right: 20rpx;
  83. flex-shrink: 0;
  84. }
  85. .record-content {
  86. flex: 1;
  87. display: flex;
  88. flex-direction: column;
  89. }
  90. .record-info {
  91. display: flex;
  92. flex-direction: column;
  93. margin-bottom: 20rpx;
  94. }
  95. .title-row {
  96. margin-bottom: 10rpx;
  97. }
  98. .record-title {
  99. font-size: 22rpx;
  100. color: #000;
  101. line-height: 1.4;
  102. display: -webkit-box;
  103. -webkit-box-orient: vertical;
  104. -webkit-line-clamp: 2;
  105. overflow: hidden;
  106. }
  107. .record-points {
  108. display: flex;
  109. align-items: center;
  110. margin-bottom: 8rpx;
  111. }
  112. .points-text {
  113. font-size: 26rpx;
  114. color: #218cdd;
  115. font-weight: bold;
  116. margin-left: 6rpx;
  117. }
  118. .record-time {
  119. display: flex;
  120. align-items: center;
  121. }
  122. .time-text {
  123. font-size: 22rpx;
  124. color: #999;
  125. margin-left: 6rpx;
  126. }
  127. .record-action {
  128. display: flex;
  129. justify-content: flex-end;
  130. border-top: 1rpx solid #f0f0f0;
  131. }
  132. .empty {
  133. padding-top: 200rpx;
  134. }
  135. </style>