Commit 310d5a9a by 李嘉林

点赞

parent 594b40f9
...@@ -37,4 +37,8 @@ export default { ...@@ -37,4 +37,8 @@ export default {
addGuestbook(options) { addGuestbook(options) {
return requestPOST(`${process.env.OLSHOP_URL}/liveBroadcastInfo/addGuestbook`, options); return requestPOST(`${process.env.OLSHOP_URL}/liveBroadcastInfo/addGuestbook`, options);
}, },
// 直播间点赞接口
addLiveLikeByUser(options) {
return requestPOST(`${process.env.OLSHOP_URL}liveBroadcastInfo/addLiveLikeByUser`, options);
},
}; };
\ No newline at end of file
...@@ -63,13 +63,13 @@ import livedExplainingCommodities from "@/components/livedModel/livedExplainingC ...@@ -63,13 +63,13 @@ import livedExplainingCommodities from "@/components/livedModel/livedExplainingC
import livedGoodsDia from "@/components/livedModel/livedGoodsDia"; import livedGoodsDia from "@/components/livedModel/livedGoodsDia";
import live from "@/api/live"; import live from "@/api/live";
export default { export default {
props: ["info","entryNoticeText","updateVal","guestBookList"], props: ["info","entryNoticeText","updateVal","guestBookList","likeInfo"],
name: "", name: "",
data() { data() {
return { return {
liveId: 0, liveId: 0,
imgList: [], imgList: [],
watchNum:0, likeNum:0,
iconList: [ iconList: [
"//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg", "//img3.imgtn.bdimg.com/it/u=3743111107,1940472030&fm=11&gp=0.jpg",
"//img0.imgtn.bdimg.com/it/u=216605226,3652567530&fm=11&gp=0.jpg", "//img0.imgtn.bdimg.com/it/u=216605226,3652567530&fm=11&gp=0.jpg",
...@@ -81,7 +81,7 @@ export default { ...@@ -81,7 +81,7 @@ export default {
showDia: false, //显示商品列表弹窗 showDia: false, //显示商品列表弹窗
isSend: false, //显示评论输入框 isSend: false, //显示评论输入框
sendVal: "", //输入内容 sendVal: "", //输入内容
getFocus: false //获取焦点 getFocus: false, //获取焦点
}; };
}, },
components: { components: {
...@@ -92,12 +92,16 @@ export default { ...@@ -92,12 +92,16 @@ export default {
}, },
computed: { computed: {
likeNumCopy() { likeNumCopy() {
return this.watchMan(this.watchNum); return this.watchMan(this.likeNum);
}, },
}, },
watch:{ watch:{
updateVal(newVal,oldVal){ updateVal(newVal,oldVal){
this.watchNum=this.info.watchNum; console.log(this.likeInfo,'-----------101')
if(this.likeNum<this.likeInfo.likeNum){
this.getAdd();
}
this.likeNum=this.likeInfo.likeNum;
if(this.entryNoticeText){ if(this.entryNoticeText){
this.userComing=true; this.userComing=true;
setTimeout(() => { setTimeout(() => {
...@@ -126,7 +130,12 @@ export default { ...@@ -126,7 +130,12 @@ export default {
return; return;
} }
if (val == 1) { if (val == 1) {
this.watchNum++; this.likeNum++;
let query={
liveBroadcastId:(this.liveId),
clickNum:1,
};
live.addLiveLikeByUser(query).then(res=>{});
} }
setTimeout(() => { setTimeout(() => {
this.num++; this.num++;
...@@ -207,7 +216,7 @@ export default { ...@@ -207,7 +216,7 @@ export default {
setTimeout(() => { setTimeout(() => {
this.isSend = false; this.isSend = false;
this.sendVal = ""; this.sendVal = "";
}, 220); }, 500);
}, },
// 点击发送留言 // 点击发送留言
toSend() { toSend() {
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<!-- <p class="del"> <!-- <p class="del">
<span></span> <span></span>
<span>{{999}}</span> <span>{{999}}</span>
</p> --> </p>-->
</div> </div>
<div class="icon" @click="isLogin(item)"> <div class="icon" @click="isLogin(item)">
<van-icon name="shopping-cart" /> <van-icon name="shopping-cart" />
...@@ -57,7 +57,7 @@ import live from "@/api/live"; ...@@ -57,7 +57,7 @@ import live from "@/api/live";
export default { export default {
props: { props: {
showDia: Boolean, showDia: Boolean,
info: Object, info: Object
}, },
name: "", name: "",
data() { data() {
...@@ -76,10 +76,10 @@ export default { ...@@ -76,10 +76,10 @@ export default {
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params); let params = JSON.parse(options.params);
this.liveId = params.liveId; this.liveId = params.liveId;
this.goodsList=this.info.goodsRespDTOs; this.goodsList = this.info.goodsRespDTOs;
this.goodsList.forEach((item, index) => { this.goodsList.forEach((item, index) => {
item.goodsPrice=Number(item.goodsPrice); item.goodsPrice = Number(item.goodsPrice);
if(item.goodsImageUrl){ if (item.goodsImageUrl) {
item.goodsImageUrl = DFSImg(item.goodsImageUrl); item.goodsImageUrl = DFSImg(item.goodsImageUrl);
} }
}); });
...@@ -116,6 +116,26 @@ export default { ...@@ -116,6 +116,26 @@ export default {
}); });
}, },
showSpeDia(val) { 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; let productId = val.productId;
this.itemGoods.productId = productId; this.itemGoods.productId = productId;
wx.showLoading({ wx.showLoading({
...@@ -148,11 +168,11 @@ export default { ...@@ -148,11 +168,11 @@ export default {
); );
} }
this.showSpe = true; this.showSpe = true;
}else{ } else {
wx.showToast({ wx.showToast({
title: res.data.msg, title: res.data.msg,
icon: 'none', icon: "none"
}) });
} }
}); });
}, },
......
...@@ -168,6 +168,7 @@ export default { ...@@ -168,6 +168,7 @@ export default {
onLoad(options) { onLoad(options) {
let params = JSON.parse(options.params); let params = JSON.parse(options.params);
this.liveId=params.liveId; this.liveId=params.liveId;
this.product_goods_info.goodsImgUrl=this.goodsImg;
this.init(); this.init();
}, },
mounted() {}, mounted() {},
...@@ -249,9 +250,9 @@ export default { ...@@ -249,9 +250,9 @@ export default {
this.getProductInfos[i].specifications this.getProductInfos[i].specifications
] = this.getProductInfos[i]; //修改数据结构格式,改成键值对的方式,以方便和选中之后的值进行匹配 ] = this.getProductInfos[i]; //修改数据结构格式,改成键值对的方式,以方便和选中之后的值进行匹配
} }
let defaultnoSellOut=this.getProductInfos.filter((item,index)=>{return !((item.oversoldFlag==0&&item.saleQty-0<=0)||item.saleStatus=='0')}); // let defaultnoSellOut=this.getProductInfos.filter((item,index)=>{return !((item.oversoldFlag==0&&item.saleQty-0<=0)||item.saleStatus=='0')});
// 默认选中一个只有一个未售罄的规格 // 默认选中一个只有一个未售罄的规格
this.defaultSelection(defaultnoSellOut[0].twoSpecifications,this.goodsGuiges); // this.defaultSelection(defaultnoSellOut[0].twoSpecifications,this.goodsGuiges);
if (this.goodsGuiges.length == 1) { if (this.goodsGuiges.length == 1) {
this.goodsGuiges[0].specificationValue.forEach((item, index) => { this.goodsGuiges[0].specificationValue.forEach((item, index) => {
for (var i in this.shopItemInfo) { for (var i in this.shopItemInfo) {
......
...@@ -36,18 +36,18 @@ ...@@ -36,18 +36,18 @@
:entryNoticeText="entryNoticeText" :entryNoticeText="entryNoticeText"
:guestBookList="guestBookList" :guestBookList="guestBookList"
:updateVal="updateVal" :updateVal="updateVal"
:likeInfo="likeInfo"
@toSendMsg="toSendMsg" @toSendMsg="toSendMsg"
></livedControls> ></livedControls>
</div> </div>
<!-- 直播 --> <!-- 直播 -->
<live-player <live-player
v-if="liveNoticeInfo.liveBroadcastState==1" v-if="liveNoticeInfo.liveBroadcastState==1&&liveNoticeInfo.boStreamRTMP"
class="livePlayer" class="livePlayer"
:src="liveNoticeInfo.boStreamM3U8" :src="liveNoticeInfo.boStreamRTMP"
mode="RTC" mode="RTC"
autoplay autoplay
bindstatechange="statechange" @error="error"
binderror="error"
/> />
</div> </div>
</template> </template>
...@@ -146,12 +146,6 @@ export default { ...@@ -146,12 +146,6 @@ export default {
} }
}); });
}, },
statechange(res) {
console.log(res, "-------19");
},
error(err) {
console.log(err, "----22");
},
back() { back() {
wx.navigateBack({ wx.navigateBack({
delta: 1 delta: 1
...@@ -205,6 +199,7 @@ export default { ...@@ -205,6 +199,7 @@ export default {
} }
} }
this.guestBookList=resData.guestBookList;//评论列表 this.guestBookList=resData.guestBookList;//评论列表
this.likeInfo=resData.likeInfo;
} else if ( } else if (
this.liveNoticeInfo.liveBroadcastState == 1 && this.liveNoticeInfo.liveBroadcastState == 1 &&
resData.liveState == "END_LIVE" resData.liveState == "END_LIVE"
...@@ -237,6 +232,9 @@ export default { ...@@ -237,6 +232,9 @@ export default {
}); });
} }
}); });
},
error(res){
console.log(res,'------------------237')
} }
} }
}; };
......
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