Commit 72ddf8a2 by 李嘉林

直播结束

parent b30110e8
...@@ -101,7 +101,6 @@ export default { ...@@ -101,7 +101,6 @@ export default {
}, },
watch:{ watch:{
updateVal(newVal,oldVal){ updateVal(newVal,oldVal){
console.log(this.likeInfo,'-----------101')
if(this.likeNum<this.likeInfo.likeNum){ if(this.likeNum<this.likeInfo.likeNum){
this.getAdd(); this.getAdd();
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<p class="endTxt">直播已结束</p> <p class="endTxt">直播已结束</p>
<p class="time"> <p class="time">
<span>直播时长:</span> <span>直播时长:</span>
<span>01:22:33</span> <span>{{endInfo.liveTime}}</span>
</p> </p>
<div class="data"> <div class="data">
<div> <div>
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
<span></span> <span></span>
<span>{{item.minPrice}}</span> <span>{{item.minPrice}}</span>
</p> </p>
<div class="icon"> <div class="icon" @click="isLogin(item)">
<van-icon name="shopping-cart" /> <van-icon name="shopping-cart" />
</div> </div>
</div> </div>
...@@ -48,17 +48,35 @@ ...@@ -48,17 +48,35 @@
</div> </div>
</div> </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> </div>
</template> </template>
<script type="text/ecmascript-6"> <script type="text/ecmascript-6">
import livedSelectionSpe from "@/components/livedModel/livedSelectionSpe";
import { DFSImg } from "@/utils/index";
import live from "@/api/live";
export default { export default {
props: ["updateGoods", "goodsList", "endInfo"], props: ["updateGoods", "goodsList", "endInfo"],
name: "", name: "",
data() { data() {
return { return {
list: [], list: [],
liveId: 0 liveId: 0,
itemGoods: {}, //选中商品
showSpe: false
}; };
}, },
watch: { watch: {
...@@ -66,7 +84,9 @@ export default { ...@@ -66,7 +84,9 @@ export default {
this.list = this.goodsList; this.list = this.goodsList;
} }
}, },
components: {}, components: {
livedSelectionSpe
},
computed: {}, computed: {},
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params); let params = JSON.parse(options.params);
...@@ -87,6 +107,95 @@ export default { ...@@ -87,6 +107,95 @@ export default {
query 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 @@ ...@@ -29,7 +29,7 @@
<notStarted v-if="liveNoticeInfo.liveBroadcastState==0" :info="liveNoticeInfo"></notStarted> <notStarted v-if="liveNoticeInfo.liveBroadcastState==0" :info="liveNoticeInfo"></notStarted>
<!-- 结束展示 --> <!-- 结束展示 -->
<livedIsEnded <livedIsEnded
v-if="liveNoticeInfo.liveBroadcastState==2&&endInfo" v-if="liveNoticeInfo.liveBroadcastState==2"
:updateGoods="updateGoods" :updateGoods="updateGoods"
:endInfo="endInfo" :endInfo="endInfo"
:goodsList="goodsList" :goodsList="goodsList"
...@@ -399,7 +399,7 @@ export default { ...@@ -399,7 +399,7 @@ export default {
} }
} }
.info { .info {
margin-left: 6px; margin: 0 8px;
color: #fff; color: #fff;
flex: 1; flex: 1;
font-size: 14px; 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