index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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. <image :src="item.image" mode="scaleToFill" fade-show style="width: 100%;"></image>
  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. image {
  122. width: 100%;
  123. height: 330rpx;
  124. border-radius: 10rpx 10rpx 0 0;
  125. }
  126. .info {
  127. flex: 1;
  128. padding: 14rpx 16rpx;
  129. display: flex;
  130. flex-direction: column;
  131. justify-content: space-between;
  132. .title {
  133. font-size: 28rpx;
  134. height: 76rpx;
  135. }
  136. .tag {
  137. border-radius: 4rpx;
  138. border: 1px solid var(--view-theme);
  139. color: var(--view-theme);
  140. font-size: 20rpx;
  141. padding: 0rpx 4rpx;
  142. margin: 10rpx 0;
  143. margin-right: 10rpx;
  144. width: max-content;
  145. }
  146. .price-box {
  147. font-size: 34rpx;
  148. font-weight: 700;
  149. margin-top: 8px;
  150. color: var(--view-priceColor);
  151. display: flex;
  152. justify-content: space-between;
  153. // align-items: flex-end;
  154. align-items: center;
  155. text {
  156. font-size: 28rpx;
  157. }
  158. .sales {
  159. color: #999999;
  160. font-size: 24rpx;
  161. font-weight: 400;
  162. }
  163. }
  164. }
  165. }
  166. }
  167. </style>