Commit cedd6f6f by 李嘉林

直播商品跳转

parent 5184386f
......@@ -9,7 +9,7 @@
>
<div class="list">
<div class="item" v-for="(item,index) in goodsList" :key="index">
<div class="img">
<div class="img" @click="toGoodsInfo(item)">
<img :src="item.productImgUrl" alt />
</div>
<div class="info">
......@@ -52,6 +52,7 @@ export default {
name: "",
data() {
return {
liveId:0,
goodsList: [
{
productId: "266",
......@@ -73,7 +74,9 @@ export default {
},
computed: {},
created() {},
inLoad(){
onLoad(options){
let params = JSON.parse(options.params);
this.liveId=params.liveId;
this.goodsList.forEach((item,index)=>{
item.img=DFSImg(item.productImgUrl);
})
......@@ -108,6 +111,19 @@ export default {
},
closeSpeDia() {
this.showSpe = false;
},
// 到商品详情
toGoodsInfo(val){
let query={
fromLived:1,
liveId:this.liveId,
}
this.backPath=`/goods/${val.productId}`;
wx.reLaunch({
url: `../index/main?from=livedToGoodsInfo&backpath=${
this.backPath
}&params=${JSON.stringify(query)}`
})
}
}
};
......
......@@ -165,8 +165,9 @@ export default {
components: {},
computed: {},
created() {},
onLoad() {
console.log(this.productInfoId,'-------------167')
onLoad(options) {
let params = JSON.parse(options.params);
this.liveId=params.liveId;
this.init();
},
mounted() {},
......@@ -335,6 +336,45 @@ export default {
});
}
},
// 立即购买
onBuyClicked(){
if (
this.goodsGuige.length < this.goodsGuiges.length ||
this.checkGoodsGuigeValue()
) {
wx.showToast({
title: '请选择规格',
icon: 'none',
})
} else if (
this.product_goods_info.oversoldFlag == 0 &&
this.product_goods_info.sellMaxQty <= 0
) {
wx.showToast({
title: '商品暂无库存',
icon: 'none',
})
} else {
let query ={};
query.productGoodsMixId = this.product_goods_info.productGoodsMixId;
query.productGoodsId = this.product_goods_info.productGoodsId;
query.goodsId = this.product_goods_info.goodsId;
query.qty = this.buyQty;
query.goodsString = JSON.stringify(this.goodsString);
query.maxQty = this.product_goods_info.maxQty;
query.productMinCount = this.product_goods_info.productMinCount;
query.fromLived = 1;
query.liveId = this.liveId;
// 将规格转化为json字符串
this.backPath=`/order/orderConfirm`;
wx.reLaunch({
url: `../index/main?from=livedToOrderConfirm&backpath=${
this.backPath
}&params=${JSON.stringify(query)}`
})
}
},
// 取价格
getMixId(val) {
if(!this.isDefault){
......@@ -724,7 +764,7 @@ export default {
height: 50px;
text-align: center;
line-height: 50px;
font-size: 20px;
font-size: 14px;
}
.toPay {
background: #ff4240;
......
......@@ -91,6 +91,14 @@ export default {
} else if (options.from && options.from == "livedToIndex") {
//来自直播详情
this.page = decodeURIComponent(options.backpath);
} else if (options.from && options.from == "livedToGoodsInfo") {
//从直播详情商品列表到商城商品详情
this.page = decodeURIComponent(options.backpath);
this.params += "&" + serialize(options.params);
} else if (options.from && options.from == "livedToOrderConfirm") {
//从直播详情商品列表到商城确认订单
this.page = decodeURIComponent(options.backpath);
this.params += "&" + serialize(options.params);
} else if (options.from && options.from == "login") {
//来自小程序登录页面
this.page = decodeURIComponent(options.backpath);
......
......@@ -21,7 +21,7 @@
<span>999</span> <span>观看</span>
</p>
</div>
<!-- <div class="toShop" @click="toShop">进店</div> -->
<div class="toShop" @click="toShop">进店</div>
</div>
</div>
<!-- 未开始展示 -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment