index.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <!-- 商品列表 -->
  3. <view class='goodList'>
  4. <block v-for="(item,index) in bastList" :key="index">
  5. <view @click="goDetail(item)" class='item acea-row row-between-wrapper' hover-class="none">
  6. <view class='pictrue'>
  7. <!-- <image :src='item.image'></image> -->
  8. <lazyLoad :src="item.image" width="100%" height="100%"></lazyLoad>
  9. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '1'">秒杀</span>
  10. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '2'">砍价</span>
  11. <span class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '3'">拼团</span>
  12. </view>
  13. <view class='underline'>
  14. <view class='text'>
  15. <view class='line1'>{{item.store_name}}</view>
  16. <!-- #ifdef H5 || APP-PLUS -->
  17. <slot name="center" :item="item"></slot>
  18. <!-- #endif -->
  19. <!-- #ifdef MP -->
  20. <slot name="center{{index}}"></slot>
  21. <!-- #endif -->
  22. <view class='money font-color'>¥<text class='num'>{{item.price}}</text></view>
  23. <view class='vip-money acea-row row-middle' v-if="item.is_vip && item.vip_price && item.vip_price > 0">¥{{item.vip_price || 0}}
  24. <image src='../../static/images/vip.png'></image><text class='num'>已售{{item.sales}}{{item.unit_name}}</text>
  25. </view>
  26. <view class='vip-money acea-row row-middle' v-else><text class='num'>已售{{item.sales}}{{item.unit_name}}</text></view>
  27. </view>
  28. </view>
  29. <!-- <view class='iconfont icon-gouwuche cart-color acea-row row-center-wrapper'></view> -->
  30. </view>
  31. </block>
  32. </view>
  33. </template>
  34. <script>
  35. import {mapGetters} from "vuex";
  36. import { goShopDetail,goPage } from '@/libs/order.js'
  37. import lazyLoad from '@/components/muqian-lazyLoad/muqian-lazyLoad.vue'
  38. export default {
  39. computed: mapGetters(['uid']),
  40. components:{
  41. lazyLoad
  42. },
  43. props: {
  44. status: {
  45. type: Number,
  46. default: 0,
  47. },
  48. bastList: {
  49. type: Array,
  50. default: function() {
  51. return [];
  52. }
  53. }
  54. },
  55. data() {
  56. return {
  57. };
  58. },
  59. methods: {
  60. goDetail(item){
  61. goPage().then(res=>{
  62. goShopDetail(item,this.uid).then(res=>{
  63. uni.navigateTo({
  64. url:`/pages/goods_details/index?id=${item.id}`
  65. })
  66. })
  67. })
  68. }
  69. }
  70. }
  71. </script>
  72. <style scoped lang='scss'>
  73. .goodList .item {
  74. position: relative;
  75. padding-left: 30rpx;
  76. }
  77. .goodList .item .pictrue {
  78. width: 180rpx;
  79. height: 180rpx;
  80. position: relative;
  81. }
  82. .goodList .item .pictrue image {
  83. width: 100%;
  84. height: 100%;
  85. border-radius: 20rpx;
  86. }
  87. .goodList .item .pictrue .numPic {
  88. position: absolute;
  89. left: 7rpx;
  90. top: 7rpx;
  91. width: 50rpx;
  92. height: 50rpx;
  93. border-radius: 50%;
  94. }
  95. .goodList .item .underline {
  96. padding: 30rpx 30rpx 30rpx 0;
  97. border-bottom: 1px solid #f5f5f5;
  98. }
  99. .goodList .item:nth-last-child(1) .underline {
  100. border-bottom: 0;
  101. }
  102. .goodList .item .text {
  103. font-size: 30rpx;
  104. color: #222;
  105. width: 489rpx;
  106. }
  107. .goodList .item .text .money {
  108. font-size: 26rpx;
  109. font-weight: bold;
  110. margin-top: 50rpx;
  111. }
  112. .goodList .item .text .money .num {
  113. font-size: 34rpx;
  114. }
  115. .goodList .item .text .vip-money {
  116. font-size: 24rpx;
  117. color: #282828;
  118. font-weight: bold;
  119. margin-top: 15rpx;
  120. }
  121. .goodList .item .text .vip-money image {
  122. width: 56rpx;
  123. height: 20rpx;
  124. margin-right: 8rpx;
  125. margin-left: 8rpx;
  126. }
  127. .goodList .item .text .vip-money .num {
  128. font-size: 22rpx;
  129. color: #aaa;
  130. font-weight: normal;
  131. margin-top: -2rpx;
  132. ~.num {
  133. margin-left: 22rpx;
  134. }
  135. }
  136. .goodList .item .iconfont {
  137. position: absolute;
  138. right: 30rpx;
  139. width: 50rpx;
  140. height: 50rpx;
  141. border-radius: 50%;
  142. font-size: 30rpx;
  143. bottom: 38rpx;
  144. }
  145. </style>