Commit b9b8c0c0 by 李嘉林

改bug

parent c3ebe44f
......@@ -61,4 +61,8 @@ export default {
getLiveQRCode(options) {
return requestGET(`${process.env.OLSHOP_URL}/liveBroadcastInfo/getLiveQRCode?id=${options}`);
},
// 获取直播配置
getConfigValueByConfigCode(options) {
return requestGET(`${process.env.OLSHOP_URL}/liveBroadcastInfo/getConfigValueByConfigCode`,options);
},
};
\ No newline at end of file
......@@ -156,14 +156,16 @@ export default {
this.liveId = params.liveId;
let _this=this;
wx.getStorage({
key: "sessionid",
success(res) {
_this.loadingShare=true;
},
fail(res) {
_this.loadingShare=false;
}
});
key: "sessionid",
success(res) {
_this.loadingShare=true;
},
fail(res) {
_this.loadingShare=false;
}
});
// 获取直播配置
this.getLivedConfig();
},
mounted() {},
methods: {
......@@ -294,6 +296,14 @@ export default {
this.$emit("toSendMsg", query);
}
}
},
getLivedConfig(){
let configCode="LIVE_LIKE_ICON";
live.getConfigValueByConfigCode(configCode).then(res=>{
if(res.data.code==200&&res.data.data){
this.iconList=JSON.parse(res.data.data);
}
})
}
}
};
......
......@@ -2,7 +2,12 @@
<!-- 讲解商品 -->
<div class="livedExplainingCommodities">
<div class="goods clearfix" v-if="!showFixedGoods">
<div class="goodsList" :class="{isEC:item.upperScreenState==1}" v-for="(item,index) in list" :key="index">
<div
class="goodsList"
:class="{isEC:item.upperScreenState==1}"
v-for="(item,index) in list"
:key="index"
>
<img :src="item.productImgUrl" alt />
<p class="num">{{item.number}}</p>
<div class="explain" v-if="item.upperScreenState==1">讲解中</div>
......@@ -12,8 +17,11 @@
<div class="fixedGoods" v-else-if="showFixedGoods&&fixedGoodsList&&fixedGoodsList.length>0">
<div class="goodsList" v-for="(item,index) in fixedGoodsList" :key="index">
<img :src="item.productImgUrl" alt />
<p class="num">{{item.number}}</p>
<!-- <p class="num">{{item.number}}</p> -->
<div class="explain" v-if="item.upperScreenState==1">讲解中</div>
<p class="price" v-if="item.minPrice">
<span></span> <span>{{item.minPrice}}</span>
</p>
</div>
</div>
</div>
......@@ -30,38 +38,39 @@ export default {
list: [],
// 讲解中浮动商品
fixedGoodsList: [],
firstCom:true,//首次进入
firstCom: true //首次进入
};
},
watch: {
updateGoods() {
if(this.firstCom==true){
this.list=[];
this.firstCom=false;
let arr1=[];
let arr2=[];
this.goodsList.forEach((item,index)=>{
if(item.upperScreenState==1){
console.log(this.goodsList,'---------------------------------46goodsList')
if (this.firstCom == true) {
this.list = [];
this.firstCom = false;
let arr1 = [];
let arr2 = [];
this.goodsList.forEach((item, index) => {
if (item.upperScreenState == 1) {
arr1.push(item);
}else if(item.upperScreenState==0){
} else if (item.upperScreenState == 0) {
arr2.push(item);
}
});
this.list=[...arr1,...arr2];
this.list = [...arr1, ...arr2];
setTimeout(() => {
this.fixedGoodsList = arr1 ? arr1 : [];
this.showFixedGoods = true;
}, 5000);
}else{
if(!this.equalsObj(this.list, this.goodsList)){
let newArr=[];
newArr=this.goodsList.filter((item,index)=>{
if (item.upperScreenState==1) {
} else {
if (!this.equalsObj(this.list, this.goodsList)) {
let newArr = [];
newArr = this.goodsList.filter((item, index) => {
if (item.upperScreenState == 1) {
return item;
}
});
if(newArr){
this.fixedGoodsList=newArr;
if (newArr) {
this.fixedGoodsList = newArr;
}
}
}
......@@ -212,16 +221,14 @@ img {
left: 12px;
.goodsList {
width: 22vw;
height: 22vw;
border: 1px solid #ff3334;
margin-right: 10px;
overflow: hidden;
margin-bottom: 10px;
position: relative;
padding: 2px;
img {
width: 100%;
height: 100%;
width: 22vw;
height: 22vw;
object-fit: cover;
}
.num {
......@@ -237,12 +244,19 @@ img {
.explain {
position: absolute;
top: 0;
right: 0;
left: 0;
color: #fff;
font-size: 12px;
background: #ff3334;
padding: 2px 4px;
border-bottom-left-radius: 6px;
border-bottom-right-radius: 6px;
}
.price{
width: 100%;
color: #FA7018;
background: #fff;
text-align: center;
font-size: 16px;
}
}
}
......
......@@ -232,8 +232,8 @@ export default {
color: #fff;
}
.endTxt {
font-size: 30px;
font-weight: 400;
font-size: 34px;
font-weight: bold;
}
.time {
margin-top: 10px;
......@@ -315,7 +315,7 @@ export default {
}
}
.itemBorder{
border-bottom: 1px solid #b8b8b8;
border-bottom: 0.5px solid #b8b8b8;
}
}
}
......
......@@ -130,6 +130,9 @@ export default {
},
computed: {},
onLoad(options) {
wx.setKeepScreenOn({
keepScreenOn: true
})
getNavbarInfo(res => {
console.log(res, "--------------------125");
this.navTop = res.navTop;
......@@ -560,8 +563,8 @@ img {
}
}
.toShop {
background: #fb566d;
padding: 0 4px;
background:linear-gradient(90deg,rgba(255,135,125,1),rgba(251,86,109,1));
padding: 0 8px;
color: #fff;
font-size: 14px;
display: inline-block;
......
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