index.vue 3.8 KB

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