index.vue 3.5 KB

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