Commit cedd6f6f by 李嘉林

直播商品跳转

parent 5184386f
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
> >
<div class="list"> <div class="list">
<div class="item" v-for="(item,index) in goodsList" :key="index"> <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 /> <img :src="item.productImgUrl" alt />
</div> </div>
<div class="info"> <div class="info">
...@@ -52,6 +52,7 @@ export default { ...@@ -52,6 +52,7 @@ export default {
name: "", name: "",
data() { data() {
return { return {
liveId:0,
goodsList: [ goodsList: [
{ {
productId: "266", productId: "266",
...@@ -73,7 +74,9 @@ export default { ...@@ -73,7 +74,9 @@ export default {
}, },
computed: {}, computed: {},
created() {}, created() {},
inLoad(){ onLoad(options){
let params = JSON.parse(options.params);
this.liveId=params.liveId;
this.goodsList.forEach((item,index)=>{ this.goodsList.forEach((item,index)=>{
item.img=DFSImg(item.productImgUrl); item.img=DFSImg(item.productImgUrl);
}) })
...@@ -108,6 +111,19 @@ export default { ...@@ -108,6 +111,19 @@ export default {
}, },
closeSpeDia() { closeSpeDia() {
this.showSpe = false; 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 { ...@@ -165,8 +165,9 @@ export default {
components: {}, components: {},
computed: {}, computed: {},
created() {}, created() {},
onLoad() { onLoad(options) {
console.log(this.productInfoId,'-------------167') let params = JSON.parse(options.params);
this.liveId=params.liveId;
this.init(); this.init();
}, },
mounted() {}, mounted() {},
...@@ -335,6 +336,45 @@ export default { ...@@ -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) { getMixId(val) {
if(!this.isDefault){ if(!this.isDefault){
...@@ -724,7 +764,7 @@ export default { ...@@ -724,7 +764,7 @@ export default {
height: 50px; height: 50px;
text-align: center; text-align: center;
line-height: 50px; line-height: 50px;
font-size: 20px; font-size: 14px;
} }
.toPay { .toPay {
background: #ff4240; background: #ff4240;
......
...@@ -91,6 +91,14 @@ export default { ...@@ -91,6 +91,14 @@ export default {
} else if (options.from && options.from == "livedToIndex") { } else if (options.from && options.from == "livedToIndex") {
//来自直播详情 //来自直播详情
this.page = decodeURIComponent(options.backpath); 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") { } else if (options.from && options.from == "login") {
//来自小程序登录页面 //来自小程序登录页面
this.page = decodeURIComponent(options.backpath); this.page = decodeURIComponent(options.backpath);
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<span>999</span> <span>观看</span> <span>999</span> <span>观看</span>
</p> </p>
</div> </div>
<!-- <div class="toShop" @click="toShop">进店</div> --> <div class="toShop" @click="toShop">进店</div>
</div> </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