Commit 9f33c2c3 by 李嘉林

修改

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