index.vue 4.6 KB

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