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