index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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'>¥<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~2024 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. uni.navigateTo({
  72. url: '/pages/activity/assist_detail/index?id=' + id
  73. });
  74. }).catch((err) => {
  75. uni.showToast({
  76. title: err,
  77. icon: 'none'
  78. })
  79. });
  80. } else {
  81. toLogin();
  82. }
  83. })
  84. }
  85. }
  86. }
  87. </script>
  88. <style scoped lang='scss'>
  89. .bt-color {
  90. background-color: var(--view-theme);
  91. border: 1rpx solid var(--view-theme);
  92. &.type2{
  93. background-color: #FD6523;
  94. border: 1rpx solid #FD6523;
  95. }
  96. }
  97. .goodList .item {
  98. position: relative;
  99. padding: 20rpx;
  100. margin-bottom: 20rpx;
  101. background: #fff;
  102. justify-content: space-between;
  103. border-radius: 16rpx;
  104. }
  105. .goodList .item .pictrue {
  106. width: 180rpx;
  107. height: 180rpx;
  108. position: relative;
  109. }
  110. .goodList .item .pictrue image {
  111. width: 100%;
  112. height: 100%;
  113. border-radius: 6rpx;
  114. }
  115. .goodList .item .pictrue .numPic {
  116. position: absolute;
  117. left: 7rpx;
  118. top: 7rpx;
  119. width: 50rpx;
  120. height: 50rpx;
  121. border-radius: 50%;
  122. }
  123. .goodList .item .underline{
  124. width: 450rpx;
  125. font-size: 30rpx;
  126. color: #222;
  127. position: relative;
  128. }
  129. .goodList .item .item_line{
  130. margin-top: 10rpx;
  131. }
  132. .goodList .item .item_line .coupon{
  133. font-size: 22rpx;
  134. margin-left: 4rpx;
  135. }
  136. .goodList .item .money {
  137. font-size: 26rpx;
  138. font-weight: bold;
  139. position: absolute;
  140. bottom: 10rpx;
  141. left: 0;
  142. color: var(--view-priceColor);
  143. }
  144. .goodList .item .money .num {
  145. font-size: 34rpx;
  146. }
  147. .goodList .item .vip-money {
  148. font-size: 24rpx;
  149. color: #282828;
  150. font-weight: bold;
  151. margin-top: 15rpx;
  152. }
  153. .goodList .item .vip-money image {
  154. width: 46rpx;
  155. height: 21rpx;
  156. margin-left: 5rpx;
  157. }
  158. .goodList .item .vip-money .num {
  159. font-size: 22rpx;
  160. color: #aaa;
  161. font-weight: normal;
  162. margin: -2rpx 0 0 22rpx;
  163. }
  164. .goodList .item .gobuy {
  165. position: absolute;
  166. right: 30rpx;
  167. padding: 6rpx 20rpx;
  168. border-radius: 50%;
  169. font-size: 22rpx;
  170. bottom: 30rpx;
  171. color: #fff;
  172. background: var(--view-theme);
  173. border-radius: 27rpx;
  174. }
  175. </style>