index.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <template>
  2. <view class='goodList' :style="viewColor">
  3. <block v-for="(item,index) in bastList" :key="index">
  4. <view @click="goDetail(item)" class='item acea-row' hover-class="none">
  5. <view class='pictrue'>
  6. <image :src='item.image'></image>
  7. <text class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '1'">秒杀</text>
  8. <text class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '2'">砍价</text>
  9. <text class="pictrue_log pictrue_log_class" v-if="item.activity && item.activity.type === '3'">拼团</text>
  10. </view>
  11. <view class='underline'>
  12. <view class='line1'>
  13. {{item.store_name}}
  14. </view>
  15. <view class="item_line">
  16. <text v-if="item.merchant.type_name && item.product_type == 0" class="font-bg-red bt-color">{{item.merchant.type_name}}</text>
  17. <text v-else-if="item.merchant.is_trader && item.product_type == 0" class="font-bg-red bt-color">自营</text>
  18. <text v-if="item.product_type != 0" :class="'font_bg-red bt-color type'+item.product_type">{{item.product_type == 1 ? "秒杀" : item.product_type == 2 ? "预售" : item.product_type == 3 ? "助力" : item.product_type == 4 ? "拼团" : ""}}</text>
  19. <text v-if="item.issetCoupon" class="coupon">领券购买更优惠</text>
  20. </view>
  21. <view class='money font-color'>¥<text class='num'>{{item.price}}</text></view>
  22. </view>
  23. <view class='gobuy acea-row row-center-wrapper'>去购买</view>
  24. </view>
  25. </block>
  26. </view>
  27. </template>
  28. <script>
  29. // +----------------------------------------------------------------------
  30. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  31. // +----------------------------------------------------------------------
  32. // | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
  33. // +----------------------------------------------------------------------
  34. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  35. // +----------------------------------------------------------------------
  36. // | Author: CRMEB Team <admin@crmeb.com>
  37. // +----------------------------------------------------------------------
  38. import {mapGetters} from "vuex";
  39. import { goShopDetail } from '@/libs/order.js'
  40. import {initiateAssistApi} from '@/api/activity.js';
  41. import { toLogin } from '@/libs/login.js';
  42. export default {
  43. computed: mapGetters(['uid','viewColor']),
  44. props: {
  45. status: {
  46. type: Number,
  47. default: 0,
  48. },
  49. bastList: {
  50. type: Array,
  51. default: function() {
  52. return [];
  53. }
  54. },
  55. isLogin:{
  56. type: Boolean,
  57. default: false
  58. }
  59. },
  60. data() {
  61. return {
  62. };
  63. },
  64. methods: {
  65. goDetail(item){
  66. goShopDetail(item, this.uid).then(res => {
  67. if (this.isLogin) {
  68. initiateAssistApi(item.activity_id).then(res => {
  69. let id = res.data.product_assist_set_id;
  70. uni.hideLoading();
  71. // #ifndef MP
  72. uni.navigateTo({
  73. url: '/pages/activity/assist_detail/index?id=' + id
  74. });
  75. // #endif
  76. // #ifdef MP
  77. openBargainSubscribe().then(res => {
  78. uni.hideLoading();
  79. uni.navigateTo({
  80. url: '/pages/activity/assist_detail/index?id=' + id
  81. });
  82. }).catch((err) => {
  83. uni.hideLoading();
  84. });
  85. // #endif
  86. }).catch((err) => {
  87. uni.showToast({
  88. title: err,
  89. icon: 'none'
  90. })
  91. });
  92. } else {
  93. // #ifdef H5 || APP-PLUS
  94. toLogin();
  95. // #endif
  96. // #ifdef MP
  97. this.$emit('isShowAuth', true);
  98. this.$emit('isAuto', true);
  99. // #endif
  100. }
  101. })
  102. }
  103. }
  104. }
  105. </script>
  106. <style scoped lang='scss'>
  107. .bt-color {
  108. background-color: var(--view-theme);
  109. border: 1rpx solid var(--view-theme);
  110. &.type2{
  111. background-color: #FD6523;
  112. border: 1rpx solid #FD6523;
  113. }
  114. }
  115. .goodList .item {
  116. position: relative;
  117. padding: 20rpx;
  118. margin-bottom: 20rpx;
  119. background: #fff;
  120. justify-content: space-between;
  121. border-radius: 16rpx;
  122. }
  123. .goodList .item .pictrue {
  124. width: 180rpx;
  125. height: 180rpx;
  126. position: relative;
  127. }
  128. .goodList .item .pictrue image {
  129. width: 100%;
  130. height: 100%;
  131. border-radius: 6rpx;
  132. }
  133. .goodList .item .pictrue .numPic {
  134. position: absolute;
  135. left: 7rpx;
  136. top: 7rpx;
  137. width: 50rpx;
  138. height: 50rpx;
  139. border-radius: 50%;
  140. }
  141. .goodList .item .underline{
  142. width: 450rpx;
  143. font-size: 30rpx;
  144. color: #222;
  145. position: relative;
  146. }
  147. .goodList .item .item_line{
  148. margin-top: 10rpx;
  149. }
  150. .goodList .item .item_line .coupon{
  151. font-size: 22rpx;
  152. margin-left: 4rpx;
  153. }
  154. .goodList .item .money {
  155. font-size: 26rpx;
  156. font-weight: bold;
  157. position: absolute;
  158. bottom: 10rpx;
  159. left: 0;
  160. }
  161. .goodList .item .money .num {
  162. font-size: 34rpx;
  163. }
  164. .goodList .item .vip-money {
  165. font-size: 24rpx;
  166. color: #282828;
  167. font-weight: bold;
  168. margin-top: 15rpx;
  169. }
  170. .goodList .item .vip-money image {
  171. width: 46rpx;
  172. height: 21rpx;
  173. margin-left: 5rpx;
  174. }
  175. .goodList .item .vip-money .num {
  176. font-size: 22rpx;
  177. color: #aaa;
  178. font-weight: normal;
  179. margin: -2rpx 0 0 22rpx;
  180. }
  181. .goodList .item .gobuy {
  182. position: absolute;
  183. right: 30rpx;
  184. padding: 6rpx 20rpx;
  185. border-radius: 50%;
  186. font-size: 22rpx;
  187. bottom: 30rpx;
  188. color: #fff;
  189. background: var(--view-theme);
  190. border-radius: 27rpx;
  191. }
  192. </style>