楼层 选择链接模板修改
parent
d9e1a4a491
commit
3afad96b8f
|
@ -51,7 +51,42 @@ export default {
|
|||
this.$nextTick(() => {
|
||||
this.$refs["lili-component"][0].type = "single"; //商品页面设置成为单选
|
||||
});
|
||||
|
||||
let url = window.location.href
|
||||
if(url.indexOf('/floorList/renovation') != -1){
|
||||
//此处去重防止移动楼层多次点击push 太多数据
|
||||
let obj = {};
|
||||
this.wap = this.wap.reduce((cur, next) => {
|
||||
//对象去重
|
||||
if (next.title != undefined) {
|
||||
obj[next.title]
|
||||
? ""
|
||||
: (obj[next.title] = true && cur.push(next));
|
||||
}
|
||||
return cur;
|
||||
}, []);
|
||||
this.wap.forEach((items,indexs) => {
|
||||
if(items.title == '活动'){
|
||||
console.log(32323232323232)
|
||||
this.wap.splice(indexs,1)
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.wap.push( {
|
||||
title: "活动",
|
||||
url: "3",
|
||||
name: "marketing"
|
||||
})
|
||||
let obj = {};
|
||||
this.wap = this.wap.reduce((cur, next) => {
|
||||
//对象去重
|
||||
if (next.title != undefined) {
|
||||
obj[next.title]
|
||||
? ""
|
||||
: (obj[next.title] = true && cur.push(next));
|
||||
}
|
||||
return cur;
|
||||
}, []);
|
||||
}
|
||||
this.wap.forEach((item) => {
|
||||
if (item) {
|
||||
item.selected = false;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
<!-- 外部链接,只有pc端跳转 -->
|
||||
<Col span="4">
|
||||
<div
|
||||
v-if="linkVisible"
|
||||
class="card"
|
||||
:class="{ active: selectedIndex == linkList.length }"
|
||||
@click="handleLink(linkItem, linkList.length)"
|
||||
|
@ -106,10 +107,36 @@ export default {
|
|||
___type: "link",
|
||||
url: "",
|
||||
},
|
||||
linkVisible: false, // 是否显示外部链接
|
||||
linkVisible: true, // 是否显示外部链接
|
||||
selectedIndex: 9999999, // 已选index
|
||||
};
|
||||
},
|
||||
created(){
|
||||
// console.log(window.location.href)
|
||||
let urls = window.location.href
|
||||
if(urls.indexOf('/floorList/renovation') != -1){
|
||||
this.linkList.forEach((items,indexs)=>{
|
||||
if(items.title == '砍价'){
|
||||
console.log(12321322,indexs)
|
||||
this.linkList.splice(indexs,1)
|
||||
}
|
||||
})
|
||||
this.linkList.forEach((item,index)=>{
|
||||
if(item.title == '小程序直播'){
|
||||
this.linkList.splice(index,1)
|
||||
}
|
||||
})
|
||||
this.linkList.forEach((itemss,indexss)=>{
|
||||
if(itemss.title == '积分商城'){
|
||||
this.linkList.splice(indexss,1)
|
||||
}
|
||||
})
|
||||
this.linkVisible = true
|
||||
}else{
|
||||
this.linkVisible = false
|
||||
}
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleLink(val, index) {
|
||||
val = { ...val, ___type: "other" };
|
||||
|
|
|
@ -21,7 +21,7 @@ export default [
|
|||
name: "marketing"
|
||||
},
|
||||
{
|
||||
title: "页面",
|
||||
title: "文章",
|
||||
url: "3",
|
||||
name: "pages"
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue