楼层 选择链接模板修改

master
夜良king 2022-12-23 15:31:59 +08:00
parent d9e1a4a491
commit 3afad96b8f
3 changed files with 65 additions and 3 deletions

View File

@ -51,7 +51,42 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs["lili-component"][0].type = "single"; // 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) => { this.wap.forEach((item) => {
if (item) { if (item) {
item.selected = false; item.selected = false;

View File

@ -22,6 +22,7 @@
<!-- 外部链接只有pc端跳转 --> <!-- 外部链接只有pc端跳转 -->
<Col span="4"> <Col span="4">
<div <div
v-if="linkVisible"
class="card" class="card"
:class="{ active: selectedIndex == linkList.length }" :class="{ active: selectedIndex == linkList.length }"
@click="handleLink(linkItem, linkList.length)" @click="handleLink(linkItem, linkList.length)"
@ -106,10 +107,36 @@ export default {
___type: "link", ___type: "link",
url: "", url: "",
}, },
linkVisible: false, // linkVisible: true, //
selectedIndex: 9999999, // index 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: { methods: {
handleLink(val, index) { handleLink(val, index) {
val = { ...val, ___type: "other" }; val = { ...val, ___type: "other" };

View File

@ -21,7 +21,7 @@ export default [
name: "marketing" name: "marketing"
}, },
{ {
title: "页面", title: "文章",
url: "3", url: "3",
name: "pages" name: "pages"
}, },