combination.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <view v-if="combinationList.length > 0" class="skeleton-rect" :style="'margin-top:'+mbConfig+'rpx'">
  3. <view class="seckill-count" :class="'wrapper-count'+styleType" :style="'background:'+bgColor+';border-radius:'+bgStyle+'rpx'">
  4. <view class="spike-bd">
  5. <view class="acea-row row-middle">
  6. <image class="title-img" src="/static/images/group_title.png"></image>
  7. </view>
  8. <navigator v-if="!merId" url="/pages/activity/combination/index" class="more-btn" hover-class="none">
  9. 超值团购
  10. <text class="iconfont icon-jiantou" hover-class="none"></text>
  11. </navigator>
  12. </view>
  13. <view class="spike-wrapper" :class="'wrapper'+styleType">
  14. <scroll-view v-if="styleType != 2" :class="'colum'+styleType" :scroll-x="styleType == 0 ? true : false" show-scrollbar="false">
  15. <navigator
  16. class="spike-item"
  17. v-for="(item, index) in combinationList"
  18. :key="index"
  19. :url="'/pages/activity/combination_details/index?id=' + item.product_group_id"
  20. hover-class="none" :class="'img-box'+conStyle">
  21. <view class="img-box" :class="'img-box'+conStyle"><image :src="item.product.image" mode=""></image></view>
  22. <view class="info">
  23. <view v-if="titleShow" class="name line1">{{ item.product.store_name }}</view>
  24. <view class="price-box">
  25. <text v-if="pinkShow" class="comb-label" :style="'background:'+txtColor+';color:'+themeColor">{{item.buying_count_num}}人团</text>
  26. <text v-if="priceShow" class="price" :style="'color:'+themeColor">
  27. <text>¥</text>
  28. {{ item.price }}
  29. </text>
  30. </view>
  31. <view v-if="bntShow" class="com_btn">
  32. 去拼团
  33. </view>
  34. </view>
  35. </navigator>
  36. </scroll-view>
  37. <block v-else class="acea-row row-between-wrapper combination">
  38. <navigator
  39. class="combination-item"
  40. v-for="(item, index) in combinationList"
  41. :key="index"
  42. :url="'/pages/activity/combination_details/index?id=' + item.product_group_id"
  43. hover-class="none" :class="'img-box'+conStyle">
  44. <view class="info">
  45. <view class="price-box combination-price">
  46. <view v-if="titleShow" class="name line1">{{ item.product.store_name }}</view>
  47. <text v-if="priceShow" class="price" :style="'color:'+themeColor">
  48. <text>¥</text>
  49. {{ item.price }}
  50. </text>
  51. <text v-if="bntShow" class="gocom_btn">
  52. 去拼团
  53. <text class="iconfont icon-jiantou"></text>
  54. </text>
  55. </view>
  56. </view>
  57. <view class="img-box" :class="'img-box'+conStyle">
  58. <easy-loadimage mode="widthFix" :image-src="item.product.image"></easy-loadimage>
  59. </view>
  60. </navigator>
  61. <navigator v-if="combinationList.length == 1"
  62. class="combination-item"
  63. hover-class="none"
  64. :url="'/pages/activity/combination_details/index?id=' + combinationList[0].product_group_id"
  65. :class="'img-box'+conStyle">
  66. <view class="info">
  67. <view class="price-box combination-price">
  68. <view v-if="titleShow" class="name line1">{{ combinationList[0].product.store_name }}</view>
  69. <text v-if="priceShow" class="price" :style="'color:'+themeColor">
  70. <text>¥</text>
  71. {{ combinationList[0].price }}
  72. </text>
  73. <text v-if="bntShow" class="gocom_btn">
  74. 去拼团
  75. <text class="iconfont icon-jiantou"></text>
  76. </text>
  77. </view>
  78. </view>
  79. <view class="img-box" :class="'img-box'+conStyle">
  80. <easy-loadimage mode="widthFix" :image-src="combinationList[0].product.image"></easy-loadimage>
  81. </view>
  82. </navigator>
  83. <navigator v-if="combinationList.length == 1"
  84. class="combination-item"
  85. hover-class="none"
  86. :url="'/pages/activity/combination_details/index?id=' + combinationList[1].product_group_id"
  87. :class="'img-box'+conStyle">
  88. <view class="info">
  89. <view class="price-box combination-price">
  90. <view v-if="titleShow" class="name line1">{{ combinationList[0].product.store_name }}</view>
  91. <text v-if="priceShow" class="price" :style="'color:'+themeColor">
  92. <text>¥</text>
  93. {{ combinationList[0].price }}
  94. </text>
  95. <text v-if="bntShow" class="gocom_btn">
  96. 去拼团
  97. <text class="iconfont icon-jiantou"></text>
  98. </text>
  99. </view>
  100. </view>
  101. <view class="img-box" :class="'img-box'+conStyle">
  102. <easy-loadimage mode="widthFix" :image-src="combinationList[0].product.image"></easy-loadimage>
  103. </view>
  104. </navigator>
  105. <navigator v-if="combinationList.length == 2"
  106. class="combination-item"
  107. hover-class="none"
  108. :url="'/pages/activity/combination_details/index?id=' + combinationList[1].product_group_id"
  109. :class="'img-box'+conStyle">
  110. <view class="info">
  111. <view class="price-box combination-price">
  112. <view v-if="titleShow" class="name line1">{{ combinationList[1].product.store_name }}</view>
  113. <text v-if="priceShow" class="price" :style="'color:'+themeColor">
  114. <text>¥</text>
  115. {{ combinationList[1].price }}
  116. </text>
  117. <text v-if="bntShow" class="gocom_btn">
  118. 去拼团
  119. <text class="iconfont icon-jiantou"></text>
  120. </text>
  121. </view>
  122. </view>
  123. <view class="img-box" :class="'img-box'+conStyle">
  124. <easy-loadimage mode="widthFix" :image-src="combinationList[1].product.image"></easy-loadimage>
  125. </view>
  126. </navigator>
  127. </block>
  128. </view>
  129. </view>
  130. </view>
  131. </template>
  132. <script>
  133. import {
  134. getCombinationList
  135. } from '@/api/activity.js';
  136. export default {
  137. name: 'combination',
  138. props: {
  139. dataConfig: {
  140. type: Object,
  141. default: () => {}
  142. },
  143. merId: {
  144. type: String || Number,
  145. default: ''
  146. }
  147. },
  148. data() {
  149. return {
  150. combinationList: [],
  151. themeColor: this.dataConfig.themeColor.color[0].item,//主题颜色
  152. styleType: this.dataConfig.tabConfig.tabVal, //单行,多行,板块
  153. mbConfig: this.dataConfig.mbConfig.val*2,
  154. bgStyle: this.dataConfig.bgStyle.type ? 20 : 0,
  155. bgColor: this.dataConfig.bgColor.color[0].item,
  156. txtColor: this.dataConfig.txtColor.color[0].item,
  157. conStyle: this.dataConfig.conStyle.type,
  158. priceShow: this.dataConfig.priceShow.val,
  159. bntShow: this.dataConfig.bntShow.val,
  160. titleShow: this.dataConfig.titleShow.val,
  161. pinkShow: this.dataConfig.pinkShow.val,
  162. };
  163. },
  164. created() {},
  165. mounted() {
  166. this.getCombinationList();
  167. },
  168. methods: {
  169. // 砍价列表
  170. getCombinationList() {
  171. let that = this;
  172. getCombinationList({
  173. mer_id: that.merId,
  174. page: 1,
  175. limit: that.styleType == 2 ? 3 : 12
  176. }).then(res => {
  177. that.combinationList = res.data.list
  178. })
  179. },
  180. bargDetail(item){
  181. this.$emit('changeBarg', item);
  182. }
  183. }
  184. }
  185. </script>
  186. <style lang="scss">
  187. @import '../style/main.scss';
  188. .seckill-count {
  189. background-color: #fff;
  190. margin: 0 20rpx;
  191. border-radius: 16rpx;
  192. padding: 24rpx 0 26rpx 20rpx;
  193. box-shadow: 4rpx 2rpx 12rpx 2rpx rgba(0, 0, 0, 0.03);
  194. &.wrapper-count2{
  195. padding: 24rpx 20rpx 26rpx;
  196. }
  197. }
  198. .comb-label{
  199. font-size: 24rpx;
  200. border-radius: 2rpx;
  201. padding: 1rpx 5rpx;
  202. }
  203. .com_btn{
  204. width: 96%;
  205. margin: 10rpx auto 0;
  206. height: 46rpx;
  207. line-height: 46rpx;
  208. background: linear-gradient(90deg, red 0%, #FF5400 100%);
  209. border-radius: 24rpx;
  210. text-align: center;
  211. color: #fff;
  212. font-size: 20rpx;
  213. }
  214. </style>