combination.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  1. <template>
  2. <view v-if="combinationList.length > 0" class="skeleton-rect" :style="'padding-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="`${domain}/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. v-if="index<=2"
  42. :key="index"
  43. :style="{ 'background-image': `url(${domain}/static/images/combination${index+1}.png)`}"
  44. :url="'/pages/activity/combination_details/index?id=' + item.product_group_id"
  45. hover-class="none" :class="'img-box'+conStyle">
  46. <view class="info">
  47. <view class="price-box combination-price">
  48. <view v-if="titleShow" class="name line1">{{ item.product.store_name }}</view>
  49. <text v-if="priceShow" class="price" :style="'color:'+themeColor">
  50. <text>¥</text>
  51. {{ item.price }}
  52. </text>
  53. <text v-if="bntShow" class="gocom_btn">
  54. 去拼团
  55. <text class="iconfont icon-jiantou"></text>
  56. </text>
  57. </view>
  58. </view>
  59. <view class="img-box" :class="'img-box'+conStyle">
  60. <easy-loadimage mode="widthFix" :image-src="item.product.image"></easy-loadimage>
  61. </view>
  62. </navigator>
  63. <navigator v-if="combinationList.length == 1"
  64. class="combination-item"
  65. hover-class="none"
  66. :style="{ 'background-image': `url(${domain}/static/images/combination2.png)`}"
  67. :url="'/pages/activity/combination_details/index?id=' + combinationList[0].product_group_id"
  68. :class="'img-box'+conStyle">
  69. <view class="info">
  70. <view class="price-box combination-price">
  71. <view v-if="titleShow" class="name line1">{{ combinationList[0].product.store_name }}</view>
  72. <text v-if="priceShow" class="price" :style="'color:'+themeColor">
  73. <text>¥</text>
  74. {{ combinationList[0].price }}
  75. </text>
  76. <text v-if="bntShow" class="gocom_btn">
  77. 去拼团
  78. <text class="iconfont icon-jiantou"></text>
  79. </text>
  80. </view>
  81. </view>
  82. <view class="img-box" :class="'img-box'+conStyle">
  83. <easy-loadimage mode="widthFix" :image-src="combinationList[0].product.image"></easy-loadimage>
  84. </view>
  85. </navigator>
  86. <navigator v-if="combinationList.length == 1"
  87. class="combination-item"
  88. hover-class="none"
  89. :style="{ 'background-image': `url(${domain}/static/images/combination3.png)`}"
  90. :url="'/pages/activity/combination_details/index?id=' + combinationList[0].product_group_id"
  91. :class="'img-box'+conStyle">
  92. <view class="info">
  93. <view class="price-box combination-price">
  94. <view v-if="titleShow" class="name line1">{{ combinationList[0].product.store_name }}</view>
  95. <text v-if="priceShow" class="price" :style="'color:'+themeColor">
  96. <text>¥</text>
  97. {{ combinationList[0].price }}
  98. </text>
  99. <text v-if="bntShow" class="gocom_btn">
  100. 去拼团
  101. <text class="iconfont icon-jiantou"></text>
  102. </text>
  103. </view>
  104. </view>
  105. <view class="img-box" :class="'img-box'+conStyle">
  106. <easy-loadimage mode="widthFix" :image-src="combinationList[0].product.image"></easy-loadimage>
  107. </view>
  108. </navigator>
  109. <navigator v-if="combinationList.length == 2"
  110. class="combination-item"
  111. hover-class="none"
  112. :style="{ 'background-image': `url(${domain}/static/images/combination3.png)`}"
  113. :url="'/pages/activity/combination_details/index?id=' + combinationList[1].product_group_id"
  114. :class="'img-box'+conStyle">
  115. <view class="info">
  116. <view class="price-box combination-price">
  117. <view v-if="titleShow" class="name line1">{{ combinationList[1].product.store_name }}</view>
  118. <text v-if="priceShow" class="price" :style="'color:'+themeColor">
  119. <text>¥</text>
  120. {{ combinationList[1].price }}
  121. </text>
  122. <text v-if="bntShow" class="gocom_btn">
  123. 去拼团
  124. <text class="iconfont icon-jiantou"></text>
  125. </text>
  126. </view>
  127. </view>
  128. <view class="img-box" :class="'img-box'+conStyle">
  129. <easy-loadimage mode="widthFix" :image-src="combinationList[1].product.image"></easy-loadimage>
  130. </view>
  131. </navigator>
  132. </block>
  133. </view>
  134. </view>
  135. </view>
  136. </template>
  137. <script>
  138. // +----------------------------------------------------------------------
  139. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  140. // +----------------------------------------------------------------------
  141. // | Copyright (c) 2016~2024 https://www.crmeb.com All rights reserved.
  142. // +----------------------------------------------------------------------
  143. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  144. // +----------------------------------------------------------------------
  145. // | Author: CRMEB Team <admin@crmeb.com>
  146. // +----------------------------------------------------------------------
  147. import { HTTP_REQUEST_URL } from '@/config/app';
  148. import { getCombinationData } from '@/api/api.js';
  149. export default {
  150. name: 'combination',
  151. props: {
  152. dataConfig: {
  153. type: Object,
  154. default: () => {}
  155. },
  156. merId: {
  157. type: String || Number,
  158. default: ''
  159. }
  160. },
  161. data() {
  162. return {
  163. domain: HTTP_REQUEST_URL,
  164. combinationList: [],
  165. themeColor: this.dataConfig.themeColor.color[0].item,//主题颜色
  166. styleType: this.dataConfig.tabConfig.tabVal, //单行,多行,板块
  167. mbConfig: this.dataConfig.mbConfig.val*2,
  168. bgStyle: this.dataConfig.bgStyle.type ? 20 : 0,
  169. bgColor: this.dataConfig.bgColor.color[0].item,
  170. txtColor: this.dataConfig.txtColor.color[0].item,
  171. conStyle: this.dataConfig.conStyle.type,
  172. priceShow: this.dataConfig.priceShow.val,
  173. bntShow: this.dataConfig.bntShow.val,
  174. titleShow: this.dataConfig.titleShow.val,
  175. pinkShow: this.dataConfig.pinkShow.val,
  176. diy_id: this.dataConfig.did,
  177. unique: this.dataConfig.timestamp,
  178. };
  179. },
  180. created() {},
  181. mounted() {
  182. this.getCombinationList();
  183. },
  184. methods: {
  185. // 砍价列表
  186. getCombinationList() {
  187. let that = this;
  188. getCombinationData({
  189. diy_id: that.diy_id,
  190. unique: that.unique,
  191. mer_id: that.merId,
  192. page: 1,
  193. limit: that.styleType == 2 ? 3 : 12
  194. }).then(res => {
  195. that.combinationList = res.data.list
  196. })
  197. }
  198. }
  199. }
  200. </script>
  201. <style lang="scss">
  202. @import '../style/main.scss';
  203. .seckill-count {
  204. background-color: #fff;
  205. margin: 0 20rpx;
  206. border-radius: 16rpx;
  207. padding: 24rpx 0 26rpx 20rpx;
  208. box-shadow: 4rpx 2rpx 12rpx 2rpx rgba(0, 0, 0, 0.03);
  209. &.wrapper-count2{
  210. padding: 24rpx 20rpx 26rpx;
  211. }
  212. }
  213. .comb-label{
  214. font-size: 24rpx;
  215. border-radius: 2rpx;
  216. padding: 1rpx 5rpx;
  217. }
  218. .com_btn{
  219. width: 96%;
  220. margin: 10rpx auto 0;
  221. height: 46rpx;
  222. line-height: 46rpx;
  223. background: linear-gradient(90deg, red 0%, #FF5400 100%);
  224. border-radius: 24rpx;
  225. text-align: center;
  226. color: #fff;
  227. font-size: 24rpx;
  228. }
  229. </style>