presellList.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view v-if="presellList.length > 0" class="presell-wrapper" :style="'padding-top:'+mbConfig+'rpx;'">
  3. <view class="presell-count" :class="'wrapper-count'+styleType" :style="'border-radius:'+bgStyle+'rpx'">
  4. <view class="spike-bd title-bd" :style="'border-radius:'+bgStyle+'rpx '+bgStyle+'rpx 0 0;background-image:url('+domain+'/static/images/presell_bg.png)'">
  5. <view class="title line1"><image class="title-img" :src="`${domain}/static/images/presell_title.png`"></image></view>
  6. <navigator v-if="!merId" url="/pages/activity/presell/index" class="more-btn" hover-class="none">
  7. 进去逛逛
  8. <text class="iconfont icon-jiantou" hover-class="none"></text>
  9. </navigator>
  10. </view>
  11. <view class="wapper_count">
  12. <view class="spike-wrapper" :class="'wrapper'+styleType">
  13. <scroll-view v-if="styleType != 2" :class="'colum'+styleType" :scroll-x="styleType == 0 ? true : false" show-scrollbar="false">
  14. <navigator
  15. class="spike-item presell-item"
  16. v-for="(item, index) in presellList"
  17. :key="index"
  18. :url="'/pages/activity/presell_details/index?id=' + item.product_presell_id"
  19. hover-class="none"
  20. >
  21. <view class="img-box presell_imgBox" :class="'img-box'+conStyle">
  22. <easy-loadimage mode="widthFix" :image-src="item.product.image"></easy-loadimage>
  23. <view v-if="presellShow" class="box_bg" :style="'background-image: url('+domain+'/static/images/combination4.png)'">火热预定中</view>
  24. </view>
  25. <view v-if="priceShow || titleShow" class="info">
  26. <view class="price-box presell-price">
  27. <text :style="'color:'+themeColor" v-if="priceShow" class="price">
  28. <text>预售价:¥</text>
  29. {{ item.price }}
  30. </text>
  31. <view v-if="titleShow" class="name line1">{{ item.store_name }}</view>
  32. </view>
  33. </view>
  34. </navigator>
  35. </scroll-view>
  36. <block v-else class="acea-row row-between-wrapper combination">
  37. <navigator
  38. class="combination-item"
  39. v-for="(item, index) in presellList"
  40. v-if="index<=2"
  41. :key="index"
  42. :style="{ 'background-image': `url(${domain}/static/images/combination${index+1}.png)`,'border-radius':`${conStyle}rpx`}"
  43. :url="'/pages/activity/presell_details/index?id=' + item.product_presell_id"
  44. hover-class="none">
  45. <view class="info">
  46. <view class="price-box combination-price">
  47. <view v-if="titleShow" class="name line1">{{ item.store_name }}</view>
  48. <text :style="'color:'+themeColor" v-if="priceShow" class="price">
  49. <text></text>
  50. {{ item.price }}
  51. </text>
  52. <text v-if="presellShow" class="gocom_btn">
  53. 去预定
  54. <text class="iconfont icon-jiantou"></text>
  55. </text>
  56. </view>
  57. </view>
  58. <view class="img-box" :class="'img-box'+conStyles">
  59. <easy-loadimage mode="widthFix" :image-src="item.product.image"></easy-loadimage>
  60. </view>
  61. </navigator>
  62. <navigator v-if="presellList.length == 1"
  63. class="combination-item"
  64. hover-class="none"
  65. :style="{ 'background-image': `url(${domain}/static/images/combination2.png)`}"
  66. :url="'/pages/activity/presell_details/index?id=' + presellList[0].product_presell_id"
  67. >
  68. <view class="info">
  69. <view class="price-box combination-price">
  70. <view v-if="titleShow" class="name line1">{{ presellList[0].store_name }}</view>
  71. <text :style="'color:'+themeColor" v-if="priceShow" class="price">
  72. <text></text>
  73. {{ presellList[0].price }}
  74. </text>
  75. <text v-if="presellShow" class="gocom_btn">
  76. 去预定
  77. <text class="iconfont icon-jiantou"></text>
  78. </text>
  79. </view>
  80. </view>
  81. <view class="img-box" :class="'img-box'+conStyles">
  82. <easy-loadimage mode="widthFix" :image-src="presellList[0].product.image"></easy-loadimage>
  83. </view>
  84. </navigator>
  85. <navigator v-if="presellList.length == 1"
  86. class="combination-item"
  87. hover-class="none"
  88. :style="{ 'background-image': `url(${domain}/static/images/combination3.png)`}"
  89. :url="'/pages/activity/presell_details/index?id=' + presellList[0].product_presell_id"
  90. >
  91. <view class="info">
  92. <view class="price-box combination-price">
  93. <view v-if="titleShow" class="name line1">{{ presellList[0].store_name }}</view>
  94. <text :style="'color:'+themeColor" v-if="priceShow" class="price">
  95. <text></text>
  96. {{ presellList[0].price }}
  97. </text>
  98. <text v-if="presellShow" class="gocom_btn">
  99. 去预定
  100. <text class="iconfont icon-jiantou"></text>
  101. </text>
  102. </view>
  103. </view>
  104. <view class="img-box" :class="'img-box'+conStyles">
  105. <easy-loadimage mode="widthFix" :image-src="presellList[0].product.image"></easy-loadimage>
  106. </view>
  107. </navigator>
  108. <navigator v-if="presellList.length == 2"
  109. class="combination-item"
  110. hover-class="none"
  111. :style="{ 'background-image': `url(${domain}/static/images/combination3.png)`}"
  112. :url="'/pages/activity/presell_details/index?id=' + presellList[1].product_presell_id"
  113. >
  114. <view class="info">
  115. <view class="price-box combination-price">
  116. <view v-if="titleShow" class="name line1">{{ presellList[1].store_name }}</view>
  117. <text :style="'color:'+themeColor" v-if="priceShow" class="price">
  118. <text></text>
  119. {{ presellList[1].price }}
  120. </text>
  121. <text v-if="presellShow" class="gocom_btn">
  122. 去预定
  123. <text class="iconfont icon-jiantou"></text>
  124. </text>
  125. </view>
  126. </view>
  127. <view class="img-box" :class="'img-box'+conStyles">
  128. <easy-loadimage mode="widthFix" :image-src="presellList[1].product.image"></easy-loadimage>
  129. </view>
  130. </navigator>
  131. </block>
  132. </view>
  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 easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
  148. import { getPresellData } from '@/api/api.js';
  149. import { HTTP_REQUEST_URL } from '@/config/app';
  150. export default {
  151. components:{
  152. easyLoadimage
  153. },
  154. name: 'presellList',
  155. props: {
  156. dataConfig: {
  157. type: Object,
  158. default: () => {}
  159. },
  160. merId: {
  161. type: String || Number,
  162. default: ''
  163. }
  164. },
  165. data() {
  166. return {
  167. domain: HTTP_REQUEST_URL,
  168. presellList: [],
  169. mbConfig: this.dataConfig.mbConfig.val*2, //页面间距
  170. styleType: this.dataConfig.tabConfig.tabVal, //单行,多行,板块
  171. bgStyle: this.dataConfig.bgStyle.type ? 20 : 0,
  172. conStyle: this.dataConfig.conStyle.type ? 16 : 0,
  173. conStyles: this.dataConfig.conStyle.type,
  174. titleShow: this.dataConfig.titleShow.val,
  175. priceShow: this.dataConfig.priceShow.val,
  176. themeColor: this.dataConfig.themeColor && this.dataConfig.themeColor.color[0].item,
  177. presellShow: this.dataConfig.presellShow.val,
  178. diy_id: this.dataConfig.did,
  179. unique: this.dataConfig.timestamp,
  180. };
  181. },
  182. created() {},
  183. mounted() {
  184. this.getPresellProduct()
  185. },
  186. methods: {
  187. // 预售
  188. getPresellProduct() {
  189. let that = this;
  190. getPresellData({
  191. diy_id: that.diy_id,
  192. unique: that.unique,
  193. mer_id: that.merId,
  194. limit: that.styleType == 2 ? 3 : 12
  195. }).then(res => {
  196. that.presellList = res.data.list;
  197. }).catch(e => {});
  198. },
  199. }
  200. };
  201. </script>
  202. <style scoped lang="scss">
  203. @import '../style/main.scss';
  204. .presell-wrapper{
  205. margin: 0 20rpx;
  206. }
  207. .spike-wrapper {
  208. box-sizing: border-box;
  209. &.wrapper2{
  210. padding: 0 20rpx 20rpx;
  211. }
  212. }
  213. .presell-count {
  214. background-color: #fff;
  215. border-radius: 16rpx;
  216. box-shadow: 4rpx 2rpx 12rpx 2rpx rgba(0, 0, 0, 0.03);
  217. }
  218. .title-bd {
  219. margin-bottom: 0;
  220. padding: 24rpx 30rpx 30rpx 30rpx;
  221. border-radius: 16rpx 16rpx 0 0;
  222. background-size: 100%;
  223. background-repeat: no-repeat;
  224. .more-btn {
  225. top: 23rpx;
  226. }
  227. }
  228. .wapper_count {
  229. padding-left: 20rpx;
  230. }
  231. .wrapper-count2{
  232. .wapper_count{
  233. padding: 0;
  234. }
  235. }
  236. </style>