Commit 9f33c2c3 by 李嘉林

修改

parent 72ddf8a2
...@@ -8,9 +8,17 @@ ...@@ -8,9 +8,17 @@
<span>来了</span> <span>来了</span>
</div> </div>
<!-- 评论层 --> <!-- 评论层 -->
<livedIsMsg v-if="info.liveBroadcastState<2&&guestBookList" :guestBookList="guestBookList" :updateVal="updateVal"></livedIsMsg> <livedIsMsg
v-if="info.liveBroadcastState<2&&guestBookList"
:guestBookList="guestBookList"
:updateVal="updateVal"
></livedIsMsg>
<!-- 带货商品层 --> <!-- 带货商品层 -->
<livedExplainingCommodities v-if="info.liveBroadcastState==1&&list" :updateGoods="updateGoods" :goodsList="list"></livedExplainingCommodities> <livedExplainingCommodities
v-if="info.liveBroadcastState==1&&list"
:updateGoods="updateGoods"
:goodsList="list"
></livedExplainingCommodities>
<!-- 商品列表弹层 --> <!-- 商品列表弹层 -->
<livedGoodsDia <livedGoodsDia
:showDia="showDia" :showDia="showDia"
...@@ -35,7 +43,12 @@ ...@@ -35,7 +43,12 @@
<van-icon name="like" class="like" /> <van-icon name="like" class="like" />
<p class="heardNum" v-if="likeNum>0">{{likeNumCopy}}</p> <p class="heardNum" v-if="likeNum>0">{{likeNumCopy}}</p>
<div class="box"> <div class="box">
<div class="img" :class="{'imgAni':imgAni}" v-for="(item,index) in imgList" :key="index"> <div
class="img"
:class="{'imgAni':imgAni}"
v-for="(item,index) in imgList"
:key="index"
>
<img :src="item.img" alt /> <img :src="item.img" alt />
</div> </div>
</div> </div>
...@@ -65,27 +78,35 @@ import livedExplainingCommodities from "@/components/livedModel/livedExplainingC ...@@ -65,27 +78,35 @@ 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","likeInfo","goodsList","updateGoods"], props: [
"info",
"entryNoticeText",
"updateVal",
"guestBookList",
"likeInfo",
"goodsList",
"updateGoods"
],
name: "", name: "",
data() { data() {
return { return {
liveId: 0, liveId: 0,
imgList: [], imgList: [],
likeNum: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",
"//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",
"//img2.imgtn.bdimg.com/it/u=1354268575,1268995723&fm=26&gp=0.jpg" "//img2.imgtn.bdimg.com/it/u=1354268575,1268995723&fm=26&gp=0.jpg"
], ],
list:[], list: [],
num: 0, num: 0,
userComing: false, userComing: false,
showDia: false, //显示商品列表弹窗 showDia: false, //显示商品列表弹窗
isSend: false, //显示评论输入框 isSend: false, //显示评论输入框
sendVal: "", //输入内容 sendVal: "", //输入内容
getFocus: false, //获取焦点 getFocus: false, //获取焦点
imgAni:false,//给点赞元素加动画 imgAni: false //给点赞元素加动画
}; };
}, },
components: { components: {
...@@ -97,26 +118,26 @@ export default { ...@@ -97,26 +118,26 @@ export default {
computed: { computed: {
likeNumCopy() { likeNumCopy() {
return this.watchMan(this.likeNum); return this.watchMan(this.likeNum);
}
}, },
}, watch: {
watch:{ updateVal(newVal, oldVal) {
updateVal(newVal,oldVal){ if (this.likeNum < this.likeInfo.likeNum) {
if(this.likeNum<this.likeInfo.likeNum){
this.getAdd(); this.getAdd();
} }
this.likeNum=this.likeInfo.likeNum; this.likeNum = this.likeInfo.likeNum;
if(this.entryNoticeText){ if (this.entryNoticeText) {
this.userComing=true; this.userComing = true;
setTimeout(() => { setTimeout(() => {
this.userComing=false; this.userComing = false;
}, 4600); }, 4600);
}else{ } else {
this.userComing=false; this.userComing = false;
} }
}, },
updateGoods(){ updateGoods() {
this.list=this.goodsList; this.list = this.goodsList;
}, }
}, },
created() {}, created() {},
onLoad(options) { onLoad(options) {
...@@ -131,18 +152,18 @@ export default { ...@@ -131,18 +152,18 @@ export default {
}, },
// 点赞 // 点赞
addLike(val) { addLike(val) {
this.imgAni=true; this.imgAni = true;
if (val == 1) {
if (this.info.liveBroadcastState < 1) { if (this.info.liveBroadcastState < 1) {
this.notAgainLive(); this.notAgainLive();
return; return;
} }
if (val == 1) {
this.likeNum++; this.likeNum++;
let query={ let query = {
liveBroadcastId:(this.liveId), liveBroadcastId: this.liveId,
clickNum:1, clickNum: 1
}; };
live.addLiveLikeByUser(query).then(res=>{}); live.addLiveLikeByUser(query).then(res => {});
} }
setTimeout(() => { setTimeout(() => {
this.num++; this.num++;
...@@ -216,7 +237,7 @@ export default { ...@@ -216,7 +237,7 @@ export default {
}, },
// 失焦点 // 失焦点
onblur() { onblur() {
this.imgAni=false; this.imgAni = false;
setTimeout(() => { setTimeout(() => {
this.isSend = false; this.isSend = false;
this.sendVal = ""; this.sendVal = "";
...@@ -224,16 +245,16 @@ export default { ...@@ -224,16 +245,16 @@ export default {
}, },
// 点击发送留言 // 点击发送留言
toSend() { toSend() {
console.log("点击按钮-------------------200") console.log("点击按钮-------------------200");
if (this.sendVal == "") { if (this.sendVal == "") {
this.getFocus = true; this.getFocus = true;
} else { } else {
let query={ let query = {
guestbookType:'1', guestbookType: "1",
guestbookContent:this.sendVal, guestbookContent: this.sendVal,
liveBroadcastId:Number(this.liveId), liveBroadcastId: Number(this.liveId)
} };
this.$emit("toSendMsg",query); this.$emit("toSendMsg", query);
} }
} }
} }
...@@ -363,7 +384,7 @@ export default { ...@@ -363,7 +384,7 @@ export default {
height: 40px; height: 40px;
} }
} }
.imgAni{ .imgAni {
animation: moveImg 1.5s linear 0.1s; animation: moveImg 1.5s linear 0.1s;
} }
@keyframes moveImg { @keyframes moveImg {
......
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