Commit 72ddf8a2 by 李嘉林

直播结束

parent b30110e8
......@@ -101,7 +101,6 @@ export default {
},
watch:{
updateVal(newVal,oldVal){
console.log(this.likeInfo,'-----------101')
if(this.likeNum<this.likeInfo.likeNum){
this.getAdd();
}
......
......@@ -5,7 +5,7 @@
<p class="endTxt">直播已结束</p>
<p class="time">
<span>直播时长:</span>
<span>01:22:33</span>
<span>{{endInfo.liveTime}}</span>
</p>
<div class="data">
<div>
......@@ -39,7 +39,7 @@
<span></span>
<span>{{item.minPrice}}</span>
</p>
<div class="icon">
<div class="icon" @click="isLogin(item)">
<van-icon name="shopping-cart" />
</div>
</div>
......@@ -48,17 +48,35 @@
</div>
</div>
</div>
<!-- 选择规格弹层 -->
<livedSelectionSpe
v-if="showSpe"
:show="showSpe"
:productInfoId="itemGoods.productId"
:minSale="itemGoods.minSale"
:maxSale="itemGoods.maxSale"
:goodsImg="itemGoods.goodsImg"
:minSuggestedRetailPrice="itemGoods.minSuggestedRetailPrice"
:maxSuggestedRetailPrice="itemGoods.maxSuggestedRetailPrice"
:goodsLowerShelf="itemGoods.goodsLowerShelf"
@closeSpeDia="closeSpeDia"
></livedSelectionSpe>
</div>
</template>
<script type="text/ecmascript-6">
import livedSelectionSpe from "@/components/livedModel/livedSelectionSpe";
import { DFSImg } from "@/utils/index";
import live from "@/api/live";
export default {
props: ["updateGoods", "goodsList", "endInfo"],
name: "",
data() {
return {
list: [],
liveId: 0
liveId: 0,
itemGoods: {}, //选中商品
showSpe: false
};
},
watch: {
......@@ -66,7 +84,9 @@ export default {
this.list = this.goodsList;
}
},
components: {},
components: {
livedSelectionSpe
},
computed: {},
onLoad(options) {
let params = JSON.parse(options.params);
......@@ -87,6 +107,95 @@ export default {
query
)}`
});
},
// 是否登录
isLogin(val) {
let _this = this;
wx.getStorage({
key: "sessionid",
success(res) {
_this.showSpeDia(val);
},
fail(res) {
console.log("未登录------150");
// 跳转登录页
let backUrl = "/lived/main";
let query = {
liveId: _this.liveId,
fromType: "mini"
};
let url = `/pages/login/main?back=${backUrl}&params=${JSON.stringify(
query
)}`;
wx.navigateTo({
url: url
});
}
});
},
showSpeDia(val) {
if (val.multiSpecificationFlag != 1) {
// 不是多规格直接加入购物车
live
.addCart([{ productGoodsId: val.productGoodsId, qty: 1 }])
.then(res => {
if (res.data.code == 200) {
wx.showToast({
title: "加入成功",
icon: "success"
});
this.showSize = false;
} else {
wx.showToast({
title: res.data.msg,
icon: "none"
});
}
});
return;
}
let productId = val.productId;
this.itemGoods.productId = productId;
wx.showLoading({
title: "加载中..."
});
live.getProductInfo(productId).then(res => {
wx.hideLoading();
if (res.data.code == 200) {
this.itemGoods.maxSale = Number(
res.data.data.maxSuggestedRetailPrice
);
this.itemGoods.minSale = Number(
res.data.data.minSuggestedRetailPrice
);
this.itemGoods.maxDiscountPrice = Number(
res.data.data.maxDiscountPrice
);
this.itemGoods.minDiscountPrice = Number(
res.data.data.minDiscountPrice
);
this.itemGoods.productNature = res.data.data.productNature;
this.itemGoods.goodsLowerShelf =
res.data.data.saleStatus != 1 ? true : false; //1 上架 0下架 true 下架
if (
res.data.data.productPictures &&
res.data.data.productPictures.length > 0
) {
this.itemGoods.goodsImg = DFSImg(
res.data.data.productPictures[0].url
);
}
this.showSpe = true;
} else {
wx.showToast({
title: res.data.msg,
icon: "none"
});
}
});
},
closeSpeDia() {
this.showSpe = false;
}
}
};
......
......@@ -29,7 +29,7 @@
<notStarted v-if="liveNoticeInfo.liveBroadcastState==0" :info="liveNoticeInfo"></notStarted>
<!-- 结束展示 -->
<livedIsEnded
v-if="liveNoticeInfo.liveBroadcastState==2&&endInfo"
v-if="liveNoticeInfo.liveBroadcastState==2"
:updateGoods="updateGoods"
:endInfo="endInfo"
:goodsList="goodsList"
......@@ -399,7 +399,7 @@ export default {
}
}
.info {
margin-left: 6px;
margin: 0 8px;
color: #fff;
flex: 1;
font-size: 14px;
......
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