123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239 |
- <template>
- <view v-if="presellList.length > 0" class="presell-wrapper" :style="'padding-top:'+mbConfig+'rpx;'">
- <view class="presell-count" :class="'wrapper-count'+styleType" :style="'border-radius:'+bgStyle+'rpx'">
- <view class="spike-bd title-bd" :style="'border-radius:'+bgStyle+'rpx '+bgStyle+'rpx 0 0;background-image:url('+domain+'/static/images/presell_bg.png)'">
- <view class="title line1"><image class="title-img" :src="`${domain}/static/images/presell_title.png`"></image></view>
- <navigator v-if="!merId" url="/pages/activity/presell/index" class="more-btn" hover-class="none">
- 进去逛逛
- <text class="iconfont icon-jiantou" hover-class="none"></text>
- </navigator>
- </view>
- <view class="wapper_count">
- <view class="spike-wrapper" :class="'wrapper'+styleType">
- <scroll-view v-if="styleType != 2" :class="'colum'+styleType" :scroll-x="styleType == 0 ? true : false" show-scrollbar="false">
- <navigator
- class="spike-item presell-item"
- v-for="(item, index) in presellList"
- :key="index"
- :url="'/pages/activity/presell_details/index?id=' + item.product_presell_id"
- hover-class="none"
- >
- <view class="img-box presell_imgBox" :class="'img-box'+conStyle">
- <easy-loadimage mode="widthFix" :image-src="item.product.image"></easy-loadimage>
- <view v-if="presellShow" class="box_bg" :style="'background-image: url('+domain+'/static/images/combination4.png)'">火热预定中</view>
- </view>
- <view v-if="priceShow || titleShow" class="info">
- <view class="price-box presell-price">
- <text :style="'color:'+themeColor" v-if="priceShow" class="price">
- <text>预售价:¥</text>
- {{ item.price }}
- </text>
- <view v-if="titleShow" class="name line1">{{ item.store_name }}</view>
- </view>
- </view>
- </navigator>
- </scroll-view>
- <block v-else class="acea-row row-between-wrapper combination">
- <navigator
- class="combination-item"
- v-for="(item, index) in presellList"
- v-if="index<=2"
- :key="index"
- :style="{ 'background-image': `url(${domain}/static/images/combination${index+1}.png)`,'border-radius':`${conStyle}rpx`}"
- :url="'/pages/activity/presell_details/index?id=' + item.product_presell_id"
- hover-class="none">
- <view class="info">
- <view class="price-box combination-price">
- <view v-if="titleShow" class="name line1">{{ item.store_name }}</view>
- <text :style="'color:'+themeColor" v-if="priceShow" class="price">
- <text>¥</text>
- {{ item.price }}
- </text>
- <text v-if="presellShow" class="gocom_btn">
- 去预定
- <text class="iconfont icon-jiantou"></text>
- </text>
- </view>
- </view>
- <view class="img-box" :class="'img-box'+conStyles">
- <easy-loadimage mode="widthFix" :image-src="item.product.image"></easy-loadimage>
- </view>
- </navigator>
- <navigator v-if="presellList.length == 1"
- class="combination-item"
- hover-class="none"
- :style="{ 'background-image': `url(${domain}/static/images/combination2.png)`}"
- :url="'/pages/activity/presell_details/index?id=' + presellList[0].product_presell_id"
- >
- <view class="info">
- <view class="price-box combination-price">
- <view v-if="titleShow" class="name line1">{{ presellList[0].store_name }}</view>
- <text :style="'color:'+themeColor" v-if="priceShow" class="price">
- <text>¥</text>
- {{ presellList[0].price }}
- </text>
- <text v-if="presellShow" class="gocom_btn">
- 去预定
- <text class="iconfont icon-jiantou"></text>
- </text>
- </view>
- </view>
- <view class="img-box" :class="'img-box'+conStyles">
- <easy-loadimage mode="widthFix" :image-src="presellList[0].product.image"></easy-loadimage>
- </view>
- </navigator>
- <navigator v-if="presellList.length == 1"
- class="combination-item"
- hover-class="none"
- :style="{ 'background-image': `url(${domain}/static/images/combination3.png)`}"
- :url="'/pages/activity/presell_details/index?id=' + presellList[0].product_presell_id"
- >
- <view class="info">
- <view class="price-box combination-price">
- <view v-if="titleShow" class="name line1">{{ presellList[0].store_name }}</view>
- <text :style="'color:'+themeColor" v-if="priceShow" class="price">
- <text>¥</text>
- {{ presellList[0].price }}
- </text>
- <text v-if="presellShow" class="gocom_btn">
- 去预定
- <text class="iconfont icon-jiantou"></text>
- </text>
- </view>
- </view>
- <view class="img-box" :class="'img-box'+conStyles">
- <easy-loadimage mode="widthFix" :image-src="presellList[0].product.image"></easy-loadimage>
- </view>
- </navigator>
- <navigator v-if="presellList.length == 2"
- class="combination-item"
- hover-class="none"
- :style="{ 'background-image': `url(${domain}/static/images/combination3.png)`}"
- :url="'/pages/activity/presell_details/index?id=' + presellList[1].product_presell_id"
- >
- <view class="info">
- <view class="price-box combination-price">
- <view v-if="titleShow" class="name line1">{{ presellList[1].store_name }}</view>
- <text :style="'color:'+themeColor" v-if="priceShow" class="price">
- <text>¥</text>
- {{ presellList[1].price }}
- </text>
- <text v-if="presellShow" class="gocom_btn">
- 去预定
- <text class="iconfont icon-jiantou"></text>
- </text>
- </view>
- </view>
- <view class="img-box" :class="'img-box'+conStyles">
- <easy-loadimage mode="widthFix" :image-src="presellList[1].product.image"></easy-loadimage>
- </view>
- </navigator>
- </block>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
-
- import easyLoadimage from '@/components/easy-loadimage/easy-loadimage.vue';
- import { getPresellData } from '@/api/api.js';
- import { HTTP_REQUEST_URL } from '@/config/app';
- export default {
- components:{
- easyLoadimage
- },
- name: 'presellList',
- props: {
- dataConfig: {
- type: Object,
- default: () => {}
- },
- merId: {
- type: String || Number,
- default: ''
- }
- },
- data() {
- return {
- domain: HTTP_REQUEST_URL,
- presellList: [],
- mbConfig: this.dataConfig.mbConfig.val*2,
- styleType: this.dataConfig.tabConfig.tabVal,
- bgStyle: this.dataConfig.bgStyle.type ? 20 : 0,
- conStyle: this.dataConfig.conStyle.type ? 16 : 0,
- conStyles: this.dataConfig.conStyle.type,
- titleShow: this.dataConfig.titleShow.val,
- priceShow: this.dataConfig.priceShow.val,
- themeColor: this.dataConfig.themeColor && this.dataConfig.themeColor.color[0].item,
- presellShow: this.dataConfig.presellShow.val,
- diy_id: this.dataConfig.did,
- unique: this.dataConfig.timestamp,
- };
- },
- created() {},
- mounted() {
- this.getPresellProduct()
- },
- methods: {
-
- getPresellProduct() {
- let that = this;
- getPresellData({
- diy_id: that.diy_id,
- unique: that.unique,
- mer_id: that.merId,
- limit: that.styleType == 2 ? 3 : 12
- }).then(res => {
- that.presellList = res.data.list;
- }).catch(e => {});
- },
- }
- };
- </script>
- <style scoped lang="scss">
- @import '../style/main.scss';
- .presell-wrapper{
- margin: 0 20rpx;
- }
- .spike-wrapper {
- box-sizing: border-box;
- &.wrapper2{
- padding: 0 20rpx 20rpx;
- }
- }
- .presell-count {
- background-color: #fff;
- border-radius: 16rpx;
- box-shadow: 4rpx 2rpx 12rpx 2rpx rgba(0, 0, 0, 0.03);
- }
- .title-bd {
- margin-bottom: 0;
- padding: 24rpx 30rpx 30rpx 30rpx;
- border-radius: 16rpx 16rpx 0 0;
- background-size: 100%;
- background-repeat: no-repeat;
- .more-btn {
- top: 23rpx;
- }
- }
- .wapper_count {
- padding-left: 20rpx;
- }
- .wrapper-count2{
- .wapper_count{
- padding: 0;
- }
- }
- </style>
|