优化:个人中心 - 运营中心权限及显示判断优化,不在每个商户类型单独判断,直接根据数组统一判断是否存在权限及是否显示
This commit is contained in:
parent
149c908352
commit
ff010d5e86
|
|
@ -162,7 +162,7 @@
|
|||
</swiper>
|
||||
</view>
|
||||
<!-- 会员菜单 -->
|
||||
<view class="user-menus" style="margin-top: 20rpx;">
|
||||
<view class="user-menus">
|
||||
<view class="title skeleton-rect">我的服务</view>
|
||||
<view class="menu-box">
|
||||
<block v-for="(item,index) in personalMenu" :key="index">
|
||||
|
|
@ -177,13 +177,7 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 运营中心 -->
|
||||
<view class="user-menus" v-if="isLogin && (identityShow
|
||||
|| userInfo.service
|
||||
|| userInfo.shopMerService
|
||||
|| userInfo.smokeMerService
|
||||
|| userInfo.supermarketService
|
||||
|| userInfo.provinceService
|
||||
|| userInfo.hallService || userInfo.HealthService)" style="margin-top: 20rpx;">
|
||||
<view class="user-menus" v-if="isLogin && (identityShow || $util.isHasCoincidence([0,1,3,4,5,6,7], userInfo.ruleService))">
|
||||
<view class="title skeleton-rect">运营中心</view>
|
||||
<view class="menu-box operation-center">
|
||||
<view class="item" @click="clickOperationCenterMenu('headquarters')" v-if="Object.keys(identity.headquarters_list).length > 0">
|
||||
|
|
@ -199,18 +193,13 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="item" @click="clickOperationCenterMenu('county')"
|
||||
v-if="Object.keys(identity.county_list).length > 0
|
||||
|| userInfo.service
|
||||
|| userInfo.shopMerService
|
||||
|| userInfo.supermarketService
|
||||
|| userInfo.provinceService
|
||||
|| userInfo.hallService || userInfo.HealthService">
|
||||
v-if="Object.keys(identity.county_list).length > 0 || $util.isHasCoincidence([0,1,3,4,5,6,7], userInfo.ruleService)">
|
||||
<view class="item-count">
|
||||
<image :src="operation_center.county_image"></image>
|
||||
<text>{{ operation_center.county_title }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item" @click="clickOperationCenterMenu('wine')" v-if="Object.keys(identity.wine_list).length > 0 || userInfo.smokeMerService">
|
||||
<view class="item" @click="clickOperationCenterMenu('wine')" v-if="Object.keys(identity.wine_list).length > 0 || $util.isHasCoincidence([3], userInfo.ruleService)">
|
||||
<view class="item-count">
|
||||
<image :src="operation_center.wine_image"></image>
|
||||
<text>{{ operation_center.wine_title || '烟酒馆运营商' }}</text>
|
||||
|
|
@ -218,16 +207,6 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!--商户员工端、平台客服端、酒道馆员工端入口-->
|
||||
<!--<view class="menus-list-item" v-if="userInfo.service" @click="toService(0)">-->
|
||||
<!-- <view class="item-text">-->
|
||||
<!-- <view class="title">-->
|
||||
<!-- <text class="merchant">商家</text>管理-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="info">进入商家管理中心</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="image merchant-image"></view>-->
|
||||
<!--</view>-->
|
||||
<view class="menus-list-item" v-if="userInfo.topService" @click="toService(1)">
|
||||
<view class="item-text">
|
||||
<view class="title">
|
||||
|
|
@ -237,35 +216,6 @@
|
|||
</view>
|
||||
<view class="image plantform-image"></view>
|
||||
</view>
|
||||
<!--<view class="menus-list-item" v-if="userInfo.shopMerService" @click="toService(2)">-->
|
||||
<!-- <view class="item-text">-->
|
||||
<!-- <view class="title">-->
|
||||
<!-- <text class="plantform">酒道馆</text>管理-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="info">进入酒道馆管理中心</view>-->
|
||||
<!-- </view>-->
|
||||
<!-- <view class="image plantform-image"></view>-->
|
||||
<!--</view>-->
|
||||
<!--<view class="menu-list-count" v-if="userInfo.topService && userInfo.service">
|
||||
<view class="menu-item" @click="toService(0)">
|
||||
<view class="image merchant-image"></view>
|
||||
<view class="menu-text">
|
||||
<view class="title">
|
||||
<text class="merchant">商家</text>管理
|
||||
</view>
|
||||
<view class="info">进入商家管理中心</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="menu-item" @click="toService(1)">
|
||||
<view class="menu-text">
|
||||
<view class="title">
|
||||
<text class="plantform">平台</text>管理
|
||||
</view>
|
||||
<view class="info">进入平台客服中心</view>
|
||||
</view>
|
||||
<view class="image plantform-image"></view>
|
||||
</view>
|
||||
</view>-->
|
||||
</view>
|
||||
<view v-if="copyright.status !== -1" class="copy-right">
|
||||
<image class="img-copyright" :src="copyright.image" mode="widthFix"></image>
|
||||
|
|
@ -293,37 +243,37 @@
|
|||
<scroll-view :scroll-y="true" style="height: 100%; overflow: hidden;" >
|
||||
<!--固定菜单-->
|
||||
<template v-if="identityCurrentName == 'county'">
|
||||
<view class="_list-item" v-if="userInfo.service" @click="toService(0)">
|
||||
<view class="_list-item" v-if="$util.isHasCoincidence([0], userInfo.ruleService)" @click="toService(0)">
|
||||
<view class="top">门店商家管理</view>
|
||||
<view class="tag-list">
|
||||
<view class="tag-list-item">门店商家管理中心</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="_list-item" v-if="userInfo.shopMerService" @click="toService(2)">
|
||||
<view class="_list-item" v-if="$util.isHasCoincidence([1], userInfo.ruleService)" @click="toService(2)">
|
||||
<view class="top">酒道馆管理</view>
|
||||
<view class="tag-list">
|
||||
<view class="tag-list-item">酒道馆管理中心</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="_list-item" v-if="userInfo.supermarketService" @click="toService(4)">
|
||||
<view class="_list-item" v-if="$util.isHasCoincidence([4], userInfo.ruleService)" @click="toService(4)">
|
||||
<view class="top">超市管理</view>
|
||||
<view class="tag-list">
|
||||
<view class="tag-list-item">超市管理中心</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="_list-item" v-if="userInfo.provinceService" @click="toService(5)">
|
||||
<view class="_list-item" v-if="$util.isHasCoincidence([5], userInfo.ruleService)" @click="toService(5)">
|
||||
<view class="top">省公司门店管理</view>
|
||||
<view class="tag-list">
|
||||
<view class="tag-list-item">省公司门店管理中心</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="_list-item" v-if="userInfo.hallService" @click="toService(6)">
|
||||
<view class="_list-item" v-if="$util.isHasCoincidence([6], userInfo.ruleService)" @click="toService(6)">
|
||||
<view class="top">城市会客厅管理</view>
|
||||
<view class="tag-list">
|
||||
<view class="tag-list-item">城市会客厅管理中心</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="_list-item" v-if="userInfo.HealthService" @click="toService(7)">
|
||||
<view class="_list-item" v-if="$util.isHasCoincidence([7], userInfo.ruleService)" @click="toService(7)">
|
||||
<view class="top">惠民健康体检馆管理</view>
|
||||
<view class="tag-list">
|
||||
<view class="tag-list-item">惠民健康体检馆管理中心</view>
|
||||
|
|
@ -331,7 +281,7 @@
|
|||
</view>
|
||||
</template>
|
||||
<template v-if="identityCurrentName == 'wine'">
|
||||
<view class="_list-item" v-if="userInfo.smokeMerService" @click="toService(3)">
|
||||
<view class="_list-item" v-if="$util.isHasCoincidence([3], userInfo.ruleService)" @click="toService(3)">
|
||||
<view class="top">烟酒店管理</view>
|
||||
<view class="tag-list">
|
||||
<view class="tag-list-item">烟酒店管理中心</view>
|
||||
|
|
@ -654,7 +604,7 @@
|
|||
},
|
||||
// 去聊天列表
|
||||
goChat() {
|
||||
let type = this.userInfo.service ? 1 : 0
|
||||
let type = this.$util.isHasCoincidence([0], this.userInfo.ruleService) ? 1 : 0
|
||||
uni.navigateTo({
|
||||
url: `/pages/chat/customer_list/index?type=${type}`
|
||||
})
|
||||
|
|
@ -841,28 +791,34 @@
|
|||
},
|
||||
// 运营中心 - 点击菜单
|
||||
clickOperationCenterMenu(type){
|
||||
console.log("当前类型", type)
|
||||
this.identityCurrentName = type || '';
|
||||
let keyName = type + '_list';
|
||||
this.identityCurrent = this.identity[keyName] || {};
|
||||
let len = Object.keys(this.identityCurrent).length || 0;
|
||||
// 根据数据进行对应的操作
|
||||
if((len == 1 && !this.userInfo.service && !this.userInfo.shopMerService && !this.userInfo.supermarketService && !this.userInfo.provinceService && !this.userInfo.hallService && !this.userInfo.HealthService && !this.userInfo.smokeMerService) || type == 'headquarters') {
|
||||
this.goToAgentCenter(this.identityCurrent[0]);
|
||||
}else{
|
||||
if(type == 'county' && (this.userInfo.service || this.userInfo.shopMerService || this.userInfo.supermarketService || this.userInfo.provinceService || this.userInfo.hallService || this.userInfo.HealthService)) this.$refs.agentIdentitySelect.open('bottom');
|
||||
else if(type == 'wine' && this.userInfo.smokeMerService) this.$refs.agentIdentitySelect.open('bottom');
|
||||
// 根据数据进行对应的操作 商户类别:0=普通商户,1=酒道馆,2=供应商,3=烟酒店,4=超市,5=省公司门店,6=城市会客厅,7=惠民健康体检馆
|
||||
switch (type) {
|
||||
// 总部
|
||||
case 'headquarters':
|
||||
this.goToAgentCenter(this.identityCurrent[0]);
|
||||
break;
|
||||
// 省公司
|
||||
case 'province':
|
||||
if(len == 1) this.goToAgentCenter(this.identityCurrent[0]);
|
||||
else this.$refs.agentIdentitySelect.open('bottom');
|
||||
break;
|
||||
// 区县运营商
|
||||
case 'county':
|
||||
if(len == 1 && !this.$util.isHasCoincidence([0,1,4,5,6,7], this.userInfo.ruleService)) this.goToAgentCenter(this.identityCurrent[0]);
|
||||
else this.$refs.agentIdentitySelect.open('bottom');
|
||||
break;
|
||||
// 烟酒店
|
||||
case 'wine':
|
||||
if(len == 1 && !this.$util.isHasCoincidence([3], this.userInfo.ruleService)) this.goToAgentCenter(this.identityCurrent[0]);
|
||||
else this.$refs.agentIdentitySelect.open('bottom');
|
||||
break;
|
||||
}
|
||||
|
||||
// if(len <= 0){
|
||||
// // 不存在列表
|
||||
// if(type == 'county' && (this.userInfo.service || this.userInfo.shopMerService || this.userInfo.supermarketService || this.userInfo.provinceService || this.userInfo.hallService)) this.$refs.agentIdentitySelect.open('bottom');
|
||||
// else if(type == 'wine' && this.userInfo.smokeMerService) this.$refs.agentIdentitySelect.open('bottom');
|
||||
// }else{
|
||||
// // 存在列表
|
||||
// if(len == 1 || type == 'headquarters') this.goToAgentCenter(this.identityCurrent[0]);
|
||||
// else this.$refs.agentIdentitySelect.open('bottom');
|
||||
// }
|
||||
|
||||
return false;
|
||||
},
|
||||
// 运营中心 - 关闭弹框
|
||||
|
|
@ -1406,6 +1362,7 @@
|
|||
padding-bottom: 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
margin-top: 20rpx;
|
||||
|
||||
.title {
|
||||
height: 80rpx;
|
||||
|
|
|
|||
|
|
@ -1009,11 +1009,22 @@ export default {
|
|||
showmenu: false,
|
||||
});
|
||||
},
|
||||
// 判断:两个对象是否存在重合数据
|
||||
isHasCoincidence(arrOne, arrTwo){
|
||||
let one = Object.values(arrOne ? Object.values(arrOne) : {});
|
||||
let two = Object.values(arrTwo ? Object.values(arrTwo) : {});
|
||||
// 只要两个 对象中有一个为空 则返回false
|
||||
if(one.length <= 0 || two.length <= 0) return false;
|
||||
// 循环:判断两个对象是否存在重合数据
|
||||
let isHasCoincidence = false;
|
||||
for (let value of two) {
|
||||
if (one.includes(Number(value)) || one.includes(String(value)) ) {
|
||||
isHasCoincidence = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return isHasCoincidence;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue