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

页面修改

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