|
@@ -46,9 +46,32 @@
|
|
<!-- #ifdef MP || APP-PLUS -->
|
|
<!-- #ifdef MP || APP-PLUS -->
|
|
<view class="" :style="'width:100%;' + 'height:' + sysHeight + 'px'"></view>
|
|
<view class="" :style="'width:100%;' + 'height:' + sysHeight + 'px'"></view>
|
|
<!-- #endif -->
|
|
<!-- #endif -->
|
|
- <productConSwiper class="tui-skeleton-rect" :isGroup="marketingType" :imgUrls="sliderImage" :videoline="videoLink"
|
|
|
|
|
|
+ <productConSwiper v-if="!dataItem" class="tui-skeleton-rect" :isGroup="marketingType" :imgUrls="sliderImage" :videoline="videoLink"
|
|
:productType="productType" @videoPause="videoPause">
|
|
:productType="productType" @videoPause="videoPause">
|
|
</productConSwiper>
|
|
</productConSwiper>
|
|
|
|
+ <view v-if="dataItem">
|
|
|
|
+ <view class="imageBox">
|
|
|
|
+ <swiper v-if="dataItem.type ===1 && dataItem.image && dataItem.image.split(',').length>1"
|
|
|
|
+ :indicator-dots="true" indicator-active-color="#e93323" :circular="true"
|
|
|
|
+ :interval="interval" :duration="duration" style="height:430px">
|
|
|
|
+ <block v-for="(item,index) in dataItem.image.split(',')" :key='index'>
|
|
|
|
+ <swiper-item class="cover">
|
|
|
|
+ <easy-loadimage mode="heightFix" :image-src="item"
|
|
|
|
+ style="height:430px"></easy-loadimage>
|
|
|
|
+ </swiper-item>
|
|
|
|
+ </block>
|
|
|
|
+ </swiper>
|
|
|
|
+ <view
|
|
|
|
+ v-if="dataItem.type ===2 || (dataItem.type ===1 &&dataItem.image && dataItem.image.split(',').length===1)">
|
|
|
|
+ <view class="cover" @click="goVideoDetail(dataItem)" style="height:430px">
|
|
|
|
+ <easy-loadimage mode="heightFix" :image-src="dataItem.cover" style="height:430px"></easy-loadimage>
|
|
|
|
+ <view v-if="dataItem.type ===2" class="circle">
|
|
|
|
+ <text class="iconfont icon-24gf-play"></text>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
|
|
+ </view>
|
|
<!-- 秒杀card -->
|
|
<!-- 秒杀card -->
|
|
<seckill-card v-if="marketingType === ProductMarketingTypeEnum.Seckill" :seckillStatus="seckillStatus"
|
|
<seckill-card v-if="marketingType === ProductMarketingTypeEnum.Seckill" :seckillStatus="seckillStatus"
|
|
:seckillTime="seckillTime" :productInfo="productInfo" :productPrice="productPrice"></seckill-card>
|
|
:seckillTime="seckillTime" :productInfo="productInfo" :productPrice="productPrice"></seckill-card>
|
|
@@ -106,9 +129,8 @@
|
|
<view class="coupon_more" @click="couponTap">领券<text class="iconfont icon-you"></text>
|
|
<view class="coupon_more" @click="couponTap">领券<text class="iconfont icon-you"></text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="introduce tui-skeleton-rect line2 mt30">{{
|
|
|
|
- productInfo.name
|
|
|
|
- }}</view>
|
|
|
|
|
|
+ <view class="introduce tui-skeleton-rect line2 mt30" v-if="!dataItem">{{productInfo.name}}</view>
|
|
|
|
+ <view class="introduce tui-skeleton-rect line2 mt30" v-else>{{dataItem.content}}</view>
|
|
</view>
|
|
</view>
|
|
<view v-if="marketingType !== ProductMarketingTypeEnum.Normal" class="share acea-row row-between row-middle">
|
|
<view v-if="marketingType !== ProductMarketingTypeEnum.Normal" class="share acea-row row-between row-middle">
|
|
<view class="introduce tui-skeleton-rect line2 lineWidth">{{ productInfo.name }}
|
|
<view class="introduce tui-skeleton-rect line2 lineWidth">{{ productInfo.name }}
|
|
@@ -156,7 +178,7 @@
|
|
<!-- <view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view> -->
|
|
<!-- <view class="iconfont icon-fenxiang" @click="listenerActionSheet"></view> -->
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
- <view class="label acea-row row-between-wrapper">
|
|
|
|
|
|
+ <view class="label acea-row row-between-wrapper" v-if="!dataItem">
|
|
<view class="tui-skeleton-rect" v-if="
|
|
<view class="tui-skeleton-rect" v-if="
|
|
marketingType === ProductMarketingTypeEnum.Groupbuying
|
|
marketingType === ProductMarketingTypeEnum.Groupbuying
|
|
">
|
|
">
|
|
@@ -237,7 +259,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 规格、保障服务 -->
|
|
<!-- 规格、保障服务 -->
|
|
- <view class="attribute mb20 borRadius14 tui-skeleton-rect">
|
|
|
|
|
|
+ <view class="attribute mb20 borRadius14 tui-skeleton-rect" v-if="!dataItem">
|
|
<view class="acea-row row-between-wrapper" @click="selecAttr">
|
|
<view class="acea-row row-between-wrapper" @click="selecAttr">
|
|
<view class="line1 text-666">{{ attrTxt }}:
|
|
<view class="line1 text-666">{{ attrTxt }}:
|
|
<text class="atterTxt text-333">{{ attrValue }}</text>
|
|
<text class="atterTxt text-333">{{ attrValue }}</text>
|
|
@@ -321,7 +343,7 @@
|
|
</view>
|
|
</view>
|
|
</block>
|
|
</block>
|
|
<!-- 产品详情 -->
|
|
<!-- 产品详情 -->
|
|
- <view class="product-intro detailText" id="past2">
|
|
|
|
|
|
+ <view class="product-intro detailText" id="past2" v-if="!dataItem">
|
|
<view class="title">
|
|
<view class="title">
|
|
<image src="../static/images/xzuo.png"></image>
|
|
<image src="../static/images/xzuo.png"></image>
|
|
<span class="sp">产品详情</span>
|
|
<span class="sp">产品详情</span>
|
|
@@ -914,6 +936,8 @@
|
|
skuImage: [], //规格小图
|
|
skuImage: [], //规格小图
|
|
|
|
|
|
iSshop: 0, //判断是否显示店铺
|
|
iSshop: 0, //判断是否显示店铺
|
|
|
|
+ cart: null,
|
|
|
|
+ dataItem: null
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {
|
|
computed: {
|
|
@@ -983,7 +1007,13 @@
|
|
onLoad(options) {
|
|
onLoad(options) {
|
|
//获取浏览器传来的对象
|
|
//获取浏览器传来的对象
|
|
this.options = options;
|
|
this.options = options;
|
|
- console.log(this.options)
|
|
|
|
|
|
+ if (options.cart) {
|
|
|
|
+ this.cart = JSON.parse(options.cart) || []
|
|
|
|
+ }
|
|
|
|
+ if (options.dataItem) {
|
|
|
|
+ this.dataItem = JSON.parse(options.dataItem) || null
|
|
|
|
+ this.productPrice.price = this.dataItem.price;
|
|
|
|
+ }
|
|
this.iSshop = this.options.iSshop //判断显示店铺
|
|
this.iSshop = this.options.iSshop //判断显示店铺
|
|
//获取浏览器秒杀状态、秒杀时间
|
|
//获取浏览器秒杀状态、秒杀时间
|
|
if (options.status) this.seckillStatus = Number(options.status); //秒杀状态
|
|
if (options.status) this.seckillStatus = Number(options.status); //秒杀状态
|
|
@@ -1020,13 +1050,13 @@
|
|
this.$store.commit("PRODUCT_TYPE", this.marketingType);
|
|
this.$store.commit("PRODUCT_TYPE", this.marketingType);
|
|
|
|
|
|
//商品详情
|
|
//商品详情
|
|
- this.getGoodsDetails();
|
|
|
|
|
|
+ !this.dataItem ? this.getGoodsDetails() : this.showSkeleton = false;
|
|
this.indicatorBg = setThemeColor();
|
|
this.indicatorBg = setThemeColor();
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
//校验token是否有效,true为有效,false为无效
|
|
//校验token是否有效,true为有效,false为无效
|
|
this.getTokenIsExist();
|
|
this.getTokenIsExist();
|
|
- this.getGoodsDetails();
|
|
|
|
|
|
+ !this.dataItem ? this.getGoodsDetails() : this.showSkeleton = false;
|
|
},
|
|
},
|
|
onReady() {
|
|
onReady() {
|
|
this.isNodes++;
|
|
this.isNodes++;
|
|
@@ -1884,13 +1914,36 @@
|
|
types = "group";
|
|
types = "group";
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- onGetPreOrder(types, [{
|
|
|
|
|
|
+ let obj = {
|
|
attrValueId: parseFloat(this.attr.productSelect.unique),
|
|
attrValueId: parseFloat(this.attr.productSelect.unique),
|
|
productId: parseFloat(this.id),
|
|
productId: parseFloat(this.id),
|
|
productNum: parseFloat(this.attr.productSelect.cart_num),
|
|
productNum: parseFloat(this.attr.productSelect.cart_num),
|
|
groupBuyActivityId: parseFloat(this.groupActivityId),
|
|
groupBuyActivityId: parseFloat(this.groupActivityId),
|
|
groupBuyRecordId: this.groupRecordId,
|
|
groupBuyRecordId: this.groupRecordId,
|
|
- }, ]);
|
|
|
|
|
|
+ };
|
|
|
|
+ console.log(this.attr, this.id, this.cart)
|
|
|
|
+ let arr = []
|
|
|
|
+ let isProductid = false // 是否同一规格
|
|
|
|
+ if (this.cart.length) {
|
|
|
|
+ // const indexOf = this.cart.find(val => val.productid == this.attr.productSelect.unique)
|
|
|
|
+ this.cart.forEach((item) => {
|
|
|
|
+ if (this.attr.productSelect.unique == item.productid) {
|
|
|
|
+ isProductid = true
|
|
|
|
+ item.number += parseFloat(this.attr.productSelect.cart_num)
|
|
|
|
+ }
|
|
|
|
+ arr.push({
|
|
|
|
+ attrValueId: item.productid, //商品规格属性id(立即购买、活动购买必填)
|
|
|
|
+ groupBuyActivityId: null, //拼团活动id(拼团下单时必填)
|
|
|
|
+ groupBuyRecordId: 0, // 拼团记录id,营销类型2=拼团 时必填 0=开团 实际
|
|
|
|
+ productId: item.id, //商品id
|
|
|
|
+ productNum: item.number //商品数量
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ !isProductid ? arr.push(obj) : ''
|
|
|
|
+ } else {
|
|
|
|
+ arr = [obj]
|
|
|
|
+ }
|
|
|
|
+ onGetPreOrder(types, arr);
|
|
}
|
|
}
|
|
this.isOpen = false;
|
|
this.isOpen = false;
|
|
},
|
|
},
|
|
@@ -2330,6 +2383,19 @@
|
|
goProductDetail(this.productInfo.id, 0, "");
|
|
goProductDetail(this.productInfo.id, 0, "");
|
|
},
|
|
},
|
|
videoPause() {},
|
|
videoPause() {},
|
|
|
|
+ goVideoDetail(noteDetails) {
|
|
|
|
+ if (noteDetails.type === 2) {
|
|
|
|
+ uni.navigateTo({
|
|
|
|
+ //#ifdef APP
|
|
|
|
+ url: '/pages/discover/discover_video/appVideo/index?noteId=' + noteDetails.id+`&sd=${this.uid}`,
|
|
|
|
+ //#endif
|
|
|
|
+ //#ifndef APP
|
|
|
|
+ url: '/pages/discover/discover_video/routineVideo/index?noteId=' + noteDetails.id+`&sd=${this.uid}`,
|
|
|
|
+ //#endif
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -3449,4 +3515,65 @@
|
|
.groupColor {
|
|
.groupColor {
|
|
color: #e93323;
|
|
color: #e93323;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .imageBox {
|
|
|
|
+ width: 702rpx;
|
|
|
|
+ // height: 702rpx;
|
|
|
|
+ position: relative;
|
|
|
|
+
|
|
|
|
+ swiper {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .cover {
|
|
|
|
+ width: 702rpx;
|
|
|
|
+ position: relative;
|
|
|
|
+ border-radius: 10px 10px 10px 10px;
|
|
|
|
+
|
|
|
|
+ /deep/image,
|
|
|
|
+ /deep/.easy-loadimage,
|
|
|
|
+ uni-image {
|
|
|
|
+ width: 702rpx;
|
|
|
|
+ border-radius: 10px 10px 10px 10px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .circle {
|
|
|
|
+ width: 100rpx;
|
|
|
|
+ height: 100rpx;
|
|
|
|
+ border-radius: 50%;
|
|
|
|
+ background: rgba(0, 0, 0, .5);
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 50%;
|
|
|
|
+ left: 50%;
|
|
|
|
+ margin-left: -50rpx;
|
|
|
|
+ margin-top: -50rpx;
|
|
|
|
+ z-index: 10;
|
|
|
|
+ line-height: 50px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .slide-image {
|
|
|
|
+ width: 100%;
|
|
|
|
+ height: 100%;
|
|
|
|
+ border-radius: 16rpx;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .pages {
|
|
|
|
+ position: absolute;
|
|
|
|
+ background-color: #fff;
|
|
|
|
+ height: 34rpx;
|
|
|
|
+ padding: 0 10rpx;
|
|
|
|
+ border-radius: 3rpx;
|
|
|
|
+ right: 30rpx;
|
|
|
|
+ bottom: 30rpx;
|
|
|
|
+ line-height: 34rpx;
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
+ color: #050505;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
</style>
|
|
</style>
|