Commit 02d25a01 authored by 黄奎's avatar 黄奎

页面修改

parent 20a108df
......@@ -607,11 +607,13 @@
<div class="LastMenu_Second">{{item.MenuName}}</div>
<div class="LastMenu_Third">
<el-tooltip class="item" effect="dark" content="编辑" placement="top-start">
<el-button circle type="primary" size="mini" icon="el-icon-edit" @click="upDateMsg(item,4),comCheckIndex=index">
<el-button circle type="primary" size="mini" icon="el-icon-edit"
@click="upDateMsg(item,4),comCheckIndex=index">
</el-button>
</el-tooltip>
<el-tooltip class="item" effect="dark" content="删除" placement="top-start">
<el-button circle type="danger" size="mini" icon="el-icon-delete" @click="deleteItem(index,item)">
<el-button circle type="danger" size="mini" icon="el-icon-delete"
@click="deleteItem(index,item)">
</el-button>
</el-tooltip>
</div>
......@@ -622,7 +624,7 @@
</el-form>
</div>
<el-button size="small" type="primary" @click="SetMiniUserCenterConfig()">保存</el-button>
<el-button size="small" @click="resetInfo()">恢复默认</el-button>
<el-button size="small" @click="RestoreDefault()">恢复默认</el-button>
</div>
</div>
......@@ -672,10 +674,10 @@
export default {
data() {
return {
comCheckIndex:-1,
imgType:-1,
comCheckIndex: -1,
imgType: -1,
//图片选择弹窗
choicImg:false,
choicImg: false,
//是否显示链接弹窗
isShowLink: false,
commonEditTitle: '',
......@@ -783,14 +785,14 @@
methods: {
//选择图片
SelectId(msg) {
if(this.imgType==1){
this.postMsg.DefaultBgImg=this.getIconLink(msg.url);
}else if(this.imgType==2){
this.postMsg.MemberBgImg=this.getIconLink(msg.url);
}else if(this.imgType==3){
this.postMsg.VipBgImg=this.getIconLink(msg.url);
}else if(this.imgType==4){
this.modifyMsg.image=this.getIconLink(msg.url);
if (this.imgType == 1) {
this.postMsg.DefaultBgImg = this.getIconLink(msg.url);
} else if (this.imgType == 2) {
this.postMsg.MemberBgImg = this.getIconLink(msg.url);
} else if (this.imgType == 3) {
this.postMsg.VipBgImg = this.getIconLink(msg.url);
} else if (this.imgType == 4) {
this.modifyMsg.image = this.getIconLink(msg.url);
}
this.choicImg = false;
},
......@@ -809,22 +811,22 @@
},
//修改确定
updateInfo() {
switch(this.EditIndex){
switch (this.EditIndex) {
case 1:
this.postMsg.FavoriteFootMenuList[this.comCheckIndex].MenuName=this.modifyMsg.name;
this.postMsg.FavoriteFootMenuList[this.comCheckIndex].MenuIcon=this.modifyMsg.image;
this.postMsg.FavoriteFootMenuList[this.comCheckIndex].MenuName = this.modifyMsg.name;
this.postMsg.FavoriteFootMenuList[this.comCheckIndex].MenuIcon = this.modifyMsg.image;
break;
case 2:
this.postMsg.OrderMenuList[this.comCheckIndex].MenuName=this.modifyMsg.name;
this.postMsg.OrderMenuList[this.comCheckIndex].MenuIcon=this.modifyMsg.image;
this.postMsg.OrderMenuList[this.comCheckIndex].MenuName = this.modifyMsg.name;
this.postMsg.OrderMenuList[this.comCheckIndex].MenuIcon = this.modifyMsg.image;
break;
case 3:
this.postMsg.AccountMenuList[this.comCheckIndex].MenuName=this.modifyMsg.name;
this.postMsg.AccountMenuList[this.comCheckIndex].MenuIcon=this.modifyMsg.image;
this.postMsg.AccountMenuList[this.comCheckIndex].MenuName = this.modifyMsg.name;
this.postMsg.AccountMenuList[this.comCheckIndex].MenuIcon = this.modifyMsg.image;
break;
case 4:
this.postMsg.SelfMenuList[this.comCheckIndex].MenuName=this.modifyMsg.name;
this.postMsg.SelfMenuList[this.comCheckIndex].MenuIcon=this.modifyMsg.image;
this.postMsg.SelfMenuList[this.comCheckIndex].MenuName = this.modifyMsg.name;
this.postMsg.SelfMenuList[this.comCheckIndex].MenuIcon = this.modifyMsg.image;
break;
}
this.isShowDialog = false;
......@@ -833,7 +835,7 @@
upDateMsg(item, index) {
this.isShowDialog = true;
this.EditIndex = index;
this.imgType=4;
this.imgType = 4;
switch (index) {
case 1:
this.commonEditTitle = '收藏栏编辑';
......@@ -914,6 +916,70 @@
if (jsonData.FavoriteFootMenuList) {
this.postMsg.FavoriteFootMenuList = jsonData.FavoriteFootMenuList;
} else {
this.restoreFavoriteAndFoot(false);
}
//订单栏
if (jsonData.OrderMenuList) {
this.postMsg.OrderMenuList = jsonData.OrderMenuList;
} else {
this.RestoreDefault(false);
}
//账户栏
if (jsonData.AccountMenuList) {
this.postMsg.AccountMenuList = jsonData.AccountMenuList;
} else {
this.restoreAccount(false);
}
//其它菜单栏
if (jsonData.SelfMenuList) {
this.postMsg.SelfMenuList = jsonData.SelfMenuList;
} else {
this.restoreSelfMenu(false);
}
} else {
this.Info(res.data.message);
}
})
},
getMenuList() {
this.apipost("/api/Tenant/GetMiniprogramPageListExt", {}, res => {
if (res.data.resultCode == 1) {
this.userCenterMsg.MenuList = res.data.data;
} else {
this.Info(res.data.message);
}
})
},
SetMiniUserCenterConfig() {
this.apipost("/api/Tenant/SetMiniUserCenterConfig", this.postMsg, res => {
if (res.data.resultCode == 1) {
this.getUserCenterConfig();
this.Success(res.data.message);
} else {
this.Info(res.data.message);
}
})
},
deleteItem(index, item) {
var that = this;
that.Confirm("是否删除此菜单?", function () {
if (item.DetailId > 0) {
that.apipost("/api/Tenant/RemoveMiniUserCenterMenu", {
DetailId: item.DetailId
}, res => {
if (res.data.resultCode == 1) {} else {
that.Info(res.data.message);
}
})
}
that.postMsg.SelfMenuList.splice(index, 1);
});
},
//重置"收藏"和"足迹"
restoreFavoriteAndFoot(isclear) {
if (isclear) {
this.postMsg.FavoriteFootMenuList = [];
}
this.userCenterMsg.MenuList.forEach(item => {
if (item.PageTypeId == 1) {
item.SubMenuList.forEach(subItem => {
......@@ -937,11 +1003,12 @@
})
}
})
},
//重置"订单栏"
restoreOrder(isclear) {
if (isclear) {
this.postMsg.OrderMenuList = [];
}
//订单栏
if (jsonData.OrderMenuList) {
this.postMsg.OrderMenuList = jsonData.OrderMenuList;
} else {
this.userCenterMsg.MenuList.forEach(item => {
if (item.PageTypeId == 3) {
item.SubMenuList.forEach(subItem => {
......@@ -977,11 +1044,12 @@
})
}
})
},
//重置"账号栏"
restoreAccount(isclear) {
if (isclear) {
this.postMsg.AccountMenuList = [];
}
//账户栏
if (jsonData.AccountMenuList) {
this.postMsg.AccountMenuList = jsonData.AccountMenuList;
} else {
this.userCenterMsg.MenuList.forEach(item => {
if (item.PageTypeId == 2) {
item.SubMenuList.forEach(subItem => {
......@@ -1014,12 +1082,12 @@
})
}
})
},
//重置"自定义菜单栏"
restoreSelfMenu(isclear) {
if (isclear) {
this.postMsg.SelfMenuList = [];
}
//其它菜单栏
if (jsonData.SelfMenuList) {
this.postMsg.SelfMenuList = jsonData.SelfMenuList;
} else {
this.userCenterMsg.MenuList.forEach(item => {
if (item.PageTypeId > 0) {
item.SubMenuList.forEach(subItem => {
......@@ -1075,48 +1143,36 @@
})
}
})
}
} else {
this.Info(res.data.message);
}
})
},
getMenuList() {
this.apipost("/api/Tenant/GetMiniprogramPageListExt", {}, res => {
if (res.data.resultCode == 1) {
this.userCenterMsg.MenuList = res.data.data;
} else {
this.Info(res.data.message);
}
})
},
SetMiniUserCenterConfig() {
this.apipost("/api/Tenant/SetMiniUserCenterConfig", this.postMsg, res => {
if (res.data.resultCode == 1) {
this.getUserCenterConfig();
this.Success(res.data.message);
} else {
this.Info(res.data.message);
}
})
//重置基本信息
restoreBasic() {
this.postMsg.DefaultBgImg = this.defaultMsg.defaultImg;
this.postMsg.MemberBgImg = this.defaultMsg.MemberBgImg;
this.postMsg.VipBgImg = this.defaultMsg.VipBgImg;
this.postMsg.HeadStyle = this.defaultMsg.HeadStyle;
this.postMsg.IsShowFavorite = this.defaultMsg.IsShowFavorite;
this.postMsg.IsShowOrderNav = this.defaultMsg.IsShowOrderNav;
this.postMsg.IsShowAccountNav = this.defaultMsg.IsShowAccountNav;
this.postMsg.IsShowMenuNav = this.defaultMsg.IsShowMenuNav;
this.postMsg.MenuNavTitle = this.defaultMsg.MenuNavTitle;
this.postMsg.MenuNavStyle = this.defaultMsg.MenuNavStyle;
},
deleteItem(index, item) {
var that = this;
that.Confirm("是否删除此菜单?", function () {
if (item.DetailId > 0) {
that.apipost("/api/Tenant/RemoveMiniUserCenterMenu", {
DetailId: item.DetailId
//恢复默认
RestoreDefault() {
let that = this;
that.Confirm("是否要恢复默认?", function () {
that.restoreFavoriteAndFoot(true);
that.restoreOrder(true);
that.restoreAccount(true);
that.restoreSelfMenu(true);
that.restoreBasic();
that.apipost("/api/Tenant/RemoveMiniUserCenterMenuByMallId", {
}, res => {
if (res.data.resultCode == 1) {} else {
that.Info(res.data.message);
}
})
}
that.postMsg.SelfMenuList.splice(index, 1);
});
},
resetInfo() {
});
}
},
......
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