index.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view>
  3. <view class="list">
  4. <view class="product-box">
  5. <view class="product-list" v-for="(item, i1) in tmp_data" :key="i1" @click="goGoodsDetail(item)">
  6. <view class="product-item">
  7. <easy-loadimage mode="widthFix" :image-src="item.image"></easy-loadimage>
  8. <view class="info">
  9. <view class="title line2">
  10. <text class="tag" v-if="item.activity && item.activity.type === '1'">{{$t(`秒杀`)}}</text>
  11. <text class="tag" v-if="item.activity && item.activity.type === '2'">{{$t(`砍价`)}}</text>
  12. <text class="tag" v-if="item.activity && item.activity.type === '3'">{{$t(`拼团`)}}</text>
  13. <text class="tag" v-if="item.checkCoupon">{{$t(`券`)}}</text>
  14. {{ item.store_name }}
  15. </view>
  16. <view class="price-box">
  17. <view>
  18. <text>{{$t(`¥`)}}</text>
  19. {{ item.price }}
  20. </view>
  21. <view class="sales">
  22. {{$t(`已售`)}} {{item.sales}}
  23. </view>
  24. </view>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. goShopDetail,
  35. goPage
  36. } from '@/libs/order.js'
  37. export default {
  38. name: 'goodsWaterfall',
  39. props: {
  40. dataLists: {
  41. default: []
  42. }
  43. },
  44. data() {
  45. return {
  46. lists: [],
  47. showLoad: false,
  48. tmp_data: []
  49. };
  50. },
  51. methods: {
  52. goGoodsDetail(item) {
  53. goPage().then(res => {
  54. goShopDetail(item, this.uid).then(res => {
  55. uni.navigateTo({
  56. url: `/pages/goods_details/index?id=${item.id}`
  57. })
  58. })
  59. })
  60. },
  61. },
  62. mounted() {
  63. const that = this
  64. that.tmp_data = that.dataLists
  65. // that.showLoadFlag()
  66. },
  67. watch: {
  68. dataLists() {
  69. this.loaded = []
  70. this.loadErr = []
  71. this.tmp_data = this.dataLists
  72. },
  73. },
  74. };
  75. </script>
  76. <style lang="scss" scoped>
  77. .list {
  78. display: flex;
  79. margin: 0 30rpx;
  80. }
  81. .product-box {
  82. display: flex;
  83. flex: 1;
  84. flex-wrap: wrap;
  85. width: 100%;
  86. }
  87. .flow_item {
  88. margin: 15upx;
  89. border-radius: 20upx;
  90. background: #f4f4f4;
  91. overflow: hidden;
  92. }
  93. .flow_item_con {
  94. padding: 10upx 20upx 20upx;
  95. }
  96. .flow_item_title {
  97. position: relative;
  98. font-size: 32upx;
  99. font-weight: 700;
  100. margin-bottom: 5upx;
  101. }
  102. .flow_item_des {
  103. font-size: 24upx;
  104. }
  105. .pl10 {
  106. padding-left: 10rpx;
  107. }
  108. .product-list {
  109. display: flex;
  110. width: calc(50% - 16rpx);
  111. margin: 2rpx 8rpx;
  112. .product-item {
  113. position: relative;
  114. width: 100%;
  115. background: #fff;
  116. border-radius: 10rpx;
  117. margin-bottom: 8rpx;
  118. display: flex;
  119. flex-direction: column;
  120. justify-content: space-between;
  121. /deep/image,
  122. /deep/.easy-loadimage,
  123. /deep/uni-image {
  124. width: 100%;
  125. height: 330rpx;
  126. border-radius: 10rpx 10rpx 0 0;
  127. }
  128. .info {
  129. flex: 1;
  130. padding: 14rpx 16rpx;
  131. display: flex;
  132. flex-direction: column;
  133. justify-content: space-between;
  134. .title {
  135. font-size: 28rpx;
  136. height: 76rpx;
  137. line-height: 38rpx;
  138. }
  139. .tag {
  140. border-radius: 4rpx;
  141. border: 1px solid var(--view-theme);
  142. color: var(--view-theme);
  143. font-size: 20rpx;
  144. padding: 0rpx 4rpx;
  145. margin: 10rpx 0;
  146. margin-right: 10rpx;
  147. width: max-content;
  148. }
  149. .price-box {
  150. font-size: 34rpx;
  151. font-weight: 700;
  152. margin-top: 8px;
  153. color: var(--view-priceColor);
  154. display: flex;
  155. justify-content: space-between;
  156. // align-items: flex-end;
  157. align-items: center;
  158. text {
  159. font-size: 28rpx;
  160. }
  161. .sales {
  162. color: #999999;
  163. font-size: 24rpx;
  164. font-weight: 400;
  165. }
  166. }
  167. }
  168. }
  169. }
  170. </style>