修改:个人中心 - 运营中心内容修改,省公司相关和区县相关角色根据公司名称显示,同一个公司存在多个角色时仅显示一个

添加:运营中心部分数据对接、角色切换功能、推广二维码选择及生成
修改:商户管理和酒道馆管理移动至区县运营中心,不在单独显示
This commit is contained in:
wuhui_zzw 2024-02-26 16:57:14 +08:00
parent 954be94aa2
commit d9fd5e833b
4 changed files with 567 additions and 69 deletions

View File

@ -36,5 +36,8 @@ export function commissionList(data) {
export function identityList() {
return request.get(`agent/identity_list`);
}
// 获取代理角色及相关角色
export function roleAndCorrelationRole(data) {
return request.get(`agent/role_and_correlation_role`, data);
}

View File

@ -1340,7 +1340,7 @@
"path": "centerV2",
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "代理中心",
"navigationBarTitleText": "运营中心",
"navigationBarBackgroundColor": "#82201d",
"navigationBarTextStyle": "white"
}

View File

@ -4,14 +4,14 @@
<view class="main-content">
<!--顶部信息-->
<view class="top">
<view class="title">四川金牛区代理-万马奔鸿实业D</view>
<view class="title">{{ corporate_name || '' }}</view>
<view class="identity-info">
<view class="identity">省公司发起人</view>
<view class="change-btn">切换</view>
<view class="identity">{{ agent_info.agent_type_text || '' }}</view>
<view class="change-btn" @click="identityChangeShow" v-if="Object.values(children).length > 1">切换</view>
</view>
</view>
<!--下级订单中心-->
<view class="block-content order">
<!--<view class="block-content order">
<view class="title">
<view class="left">下级订单中心</view>
<view class="right">
@ -24,9 +24,9 @@
<view class="item-title">{{ item.title }}</view>
</view>
</view>
</view>
</view>-->
<!--数据统计-->
<view class="block-content statistics">
<!--<view class="block-content statistics">
<view class="title">
<view class="left">数据统计</view>
<view class="right"></view>
@ -37,34 +37,77 @@
<view class="item-title">{{ item.title }}</view>
</view>
</view>
</view>
</view>-->
<!--工作台-->
<view class="block-content staging">
<view class="title">
<view class="left">工作台</view>
<view class="right">
<view class="see-btn">查看补货申请</view>
<!--<view class="see-btn">查看补货申请</view>-->
</view>
</view>
<view class="info-list">
<view v-for="(item,index) in staging_list" :key="index" class="info-list-item">
<view class="item-icon">
<text :class="['iconfont', item.icon ]"></text>
<template v-if="Object.keys(staging_list).length > 0">
<view v-for="(item,index) in staging_list" :key="index" class="info-list-item" @click="clickStaging(item)" >
<view class="item-icon">
<text :class="['iconfont', item.icon ]"></text>
</view>
<view class="item-title">{{ item.title }}</view>
</view>
<view class="item-title">{{ item.title }}</view>
</view>
</template>
<view v-else class="empty-tips">暂无任何操作权限~</view>
</view>
</view>
</view>
<!--授权登录-->
<!-- 授权登录 -->
<authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authClose"></authorize>
</view>
<!-- 身份切换 -->
<uni-popup ref="identityChange" type="bottom" :is-mask-click="false">
<view class="identity-change-content">
<view class="_list">
<view class="_list-item" v-for="(item,index) in children" :key="index" @click="identityChangeSelected(item)">
<view class="top">
{{ item.agent_type_text || '' }}
<view class="top-tag" v-if="item.id == agent_info.id">使用中</view>
</view>
<view class="tag-list">
<view class="tag-list-item tag-list-id">ID{{ item.id }}</view>
<view class="tag-list-item">{{ item.contact_name }}</view>
</view>
</view>
</view>
<view class='close-btn' @click="identityChangeClose">取消</view>
</view>
</uni-popup>
<!-- 推广二维码类型选择 -->
<uni-popup ref="promotionQrCode" type="bottom" :is-mask-click="false">
<view class="identity-change-content promotion-qr-code">
<view class="_list">
<view class="_list-item" v-for="(item,index) in qrcode_list" :key="index" @click="qrCodeTypeSelected(item)">
<view class="top">{{ item.title || '' }}</view>
</view>
</view>
<view class='close-btn' @click="qrCodeTypeClose">取消</view>
</view>
</uni-popup>
<!-- 二维码弹框 -->
<uni-popup ref="qrCodePopup" type="center">
<view class="qr-code-content">
<image class="image" :src="promotion_qr_code"></image>
<view class="close-qr-code" @click="qrCodeClose()">关闭</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {mapGetters} from "vuex";
import authorize from '@/components/Authorize';
import {roleAndCorrelationRole,inviteSupplierJoinQrCode} from "@/api/agent";
export default {
name: 'business',
@ -72,10 +115,176 @@ export default {
authorize,
},
computed: {
staging_list() {
// 1=,2=,3=(),4=(),5=,6=,7=,8=,9=,10=
let menuList = [];
let agentType = this.agent_info.agent_type || 0;
// 广
if(['1','2','3','5','6','9'].includes(String(agentType))){
menuList.push({
title: '推广二维码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
});
}
//
if(!['4','7','8','10'].includes(String(agentType))){
menuList.push({
title: '下级管理',
type: 'link',
url: '/pages/agent/user/list',
icon: 'icon-yonghu1',
});
}
//
// staging_list:[
// {title: '', icon: 'icon-dingdan1'},
// {title: '', icon: 'icon-daifahuo1'},
// {title: '', icon: 'icon-jinbi_o'},
// {title: '', icon: 'icon-dianpu1'},
// {title: '', icon: 'icon-jiaoyidingdan'},
// {title: '广', icon: 'icon-hexiaoma'},
// {title: '', icon: 'icon-fenxiaodingdan'},
// {title: '', icon: 'icon-gerentouxiang_o'},
// {title: '', icon: 'icon-baoguo_shouna_o'},
// {title: '', icon: 'icon-saoma'},
// {title: '', icon: 'icon-quanbudingdan-3'},
// {title: '', icon: 'icon-wodetuandui'},
// ],
//
return menuList;
},
qrcode_list(){
let menuList = [];
let agentType = this.agent_info.agent_type || 0;
// 1=,2=,3=(),4=(),5=,6=,7=,8=,9=,10=
if(Number(agentType) <= 5){
menuList.push({
title: '供应商邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'supplier'
}
});
}
if(Number(agentType) === 1){
menuList.push({
title: '总部外勤邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'subordinate',
level: 9,
}
});
menuList.push({
title: '总部内勤邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'subordinate',
level: 10,
}
});
}
if(Number(agentType) === 9){
menuList.push({
title: '省公司邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'subordinate',
level: 2,
}
});
}
if(Number(agentType) === 2){
menuList.push({
title: '外勤合伙人邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'subordinate',
level: 3,
}
});
menuList.push({
title: '内勤合伙人邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'subordinate',
level: 4,
}
});
}
if(Number(agentType) === 3){
menuList.push({
title: '运营商邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'subordinate',
level: 5,
}
});
}
if(Number(agentType) === 5){
menuList.push({
title: '合伙人邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'subordinate',
level: 6,
}
});
}
if(Number(agentType) === 6){
menuList.push({
title: '餐厅邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'subordinate',
level: 7,
}
});
menuList.push({
title: '配送商邀请码',
type: 'invite_qr_code',
url: '',
icon: 'icon-erweima1',
params: {
type: 'subordinate',
level: 8,
}
});
}
return menuList;
},
...mapGetters(['isLogin', 'uid', 'userInfo', 'viewColor'])
},
data() {
return {
//
agent_id: 0,
//
isAuto: false, //
isShowAuth: false,//
@ -95,28 +304,26 @@ export default {
'orderCountYesterday': {title: '昨日订单数', num: 0},
'orderCountThisMonth': {title: '本月订单数', num: 0},
},
//
staging_list:[
{title: '库存管理', icon: 'icon-dingdan1'},
{title: '立即进货', icon: 'icon-daifahuo1'},
{title: '收入管理', icon: 'icon-jinbi_o'},
{title: '管辖门店', icon: 'icon-dianpu1'},
{title: '代理资料', icon: 'icon-jiaoyidingdan'},
{title: '推广二维码', icon: 'icon-hexiaoma'},
{title: '我的进货', icon: 'icon-fenxiaodingdan'},
{title: '省分公司', icon: 'icon-gerentouxiang_o'},
{title: '下载物料', icon: 'icon-baoguo_shouna_o'},
{title: '扫码核销', icon: 'icon-saoma'},
{title: '我的申报', icon: 'icon-quanbudingdan-3'},
{title: '业务员管理', icon: 'icon-wodetuandui'},
]
//
use_agent_id: 0,
corporate_name: '',
agent_info: {},
children: {},
promotion_qr_code: '',
}
},
onLoad(options) {
//
this.agent_id = options.agent_id || 0;
if(this.agent_id <= 0){
uni.showModal({
title: '提示',
content: '非法访问,参数错误!',
success: function success(res) {
uni.navigateBack();
}
});
}
//
if (!this.isLogin) {
//
@ -140,10 +347,91 @@ export default {
this.isShowAuth = e
},
//
init () {},
init () {
this.getAgentRoleInfo()
},
//
getAgentRoleInfo(){
let _this = this;
let params = {
agent_id: _this.agent_id > 0 ? _this.agent_id : _this.use_agent_id,
};
roleAndCorrelationRole(params).then(res => {
if(res.status == 200){
let data = res.data || {};
_this.corporate_name = data.corporate_name || '';
_this.agent_info = data.agent_info || {};
_this.children = data.children || {};
}
}).catch(err => {
console.log(err);
});
},
// -
identityChangeShow(){
this.$refs.identityChange.open('bottom');
},
// -
identityChangeClose(){
this.$refs.identityChange.close();
},
// -
identityChangeSelected(info){
this.agent_info = info;
this.identityChangeClose();
},
//
clickStaging(menu){
let _this = this;
let params = menu.params || {};
params.agent_id = _this.agent_info.id || 0;
switch (menu.type) {
// 广
case 'invite_qr_code':
_this.qrCodeTypeShow();
break;
//
case 'link':
uni.navigateTo({
url: menu.url + '?agent_id=' + params.agent_id
})
break;
}
},
// 广 -
qrCodeTypeShow(){
this.$refs.promotionQrCode.open('bottom');
},
// 广 -
qrCodeTypeClose(){
this.$refs.promotionQrCode.close();
},
// 广 -
qrCodeTypeSelected(menu){
let _this = this;
_this.qrCodeTypeClose();
_this.promotion_qr_code = '';
let params = menu.params || {};
params.agent_id = _this.agent_info.id || 0;
// 广
inviteSupplierJoinQrCode(params).then(res => {
if (res.status == 200) {
_this.promotion_qr_code = res.data.qr_code || '';
_this.qrCodeShow();
}
}).catch(err => {
this.$util.Tips({title: err});
});
},
// 广 -
qrCodeShow(){
this.$refs.qrCodePopup.open('center');
},
// 广 -
qrCodeClose(){
this.$refs.qrCodePopup.close();
},
@ -275,14 +563,149 @@ export default {
}
}
.info-list{
width: 100%;
--info-list-item-size-: calc(var(--info-list-content-width-) / 4);
.item-icon{
.iconfont{
font-size: 50rpx;
}
}
.empty-tips{
width: 100%;
text-align: center;
font-size: 30rpx;
height: 150rpx;
line-height: 150rpx;
}
}
}
}
//
.identity-change-content{
--list-padding-: 30rpx;
background: #f6f6f6;
width: 100vw;
height: 80vh;
padding: var(--list-padding-);
position: relative;
._list{
height: calc(100% - 160rpx);
width: calc(100% - (var(--list-padding-) * 2));
position: fixed;
top: var(--list-padding-);
left: var(--list-padding-);
overflow-y: auto;
._list-item{
width: 100%;
background: #FFFFFF;
border-radius: 15rpx;
padding: 20rpx;
.top{
width: 100%;
height: 50rpx;
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
font-size: 30rpx;
font-weight: bold;
.top-tag{
//background-color: #f3e6e8;
//color: #926c6b;
margin-left: 15rpx;
height: 35rpx;
line-height: 35rpx;
font-size: 24rpx;
padding: 0 10rpx;
border-radius: 5rpx;
font-weight: normal;
color: #fff;
background-color: #67c23a;
border-color: #67c23a;
}
}
.address{
height: 35rpx;
line-height: 35rpx;
font-size: 25rpx;
}
.tag-list{
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
.tag-list-item{
background-color: #f3e6e8;
color: #926c6b;
height: 35rpx;
line-height: 35rpx;
font-size: 24rpx;
padding: 0 10rpx;
border-radius: 5rpx;
font-weight: normal;
margin-right: 15rpx;
max-width: 100%;
}
.tag-list-id{
color: #fff;
background-color: #e6a23c;
border-color: #e6a23c;
}
.tag-list-item:last-child{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
._list-item:not(:last-child){
margin-bottom: 20rpx;
}
}
.close-btn{
width: calc(100% - (var(--list-padding-) * 2));
height: 70rpx;
line-height: 70rpx;
text-align: center;
font-size: 35rpx;
border-radius: 100rpx;
position: fixed;
bottom: var(--list-padding-);
left: var(--list-padding-);
color: #fff;
background-color: #f56c6c;
border-color: #f56c6c;
}
}
//
.promotion-qr-code{
height: 500rpx!important;
}
//
.qr-code-content{
width: 80vw;
.image{
width: 80vw;
height: 80vw;
}
.close-qr-code{
position: fixed;
top: 35rpx;
right: 70rpx;
color: #FFFFFF;
border: 2rpx solid #FFFFFF;
height: 40rpx;
line-height: 36rpx;
padding: 0 20rpx;
border-radius: 50rpx;
}
}
}
</style>

View File

@ -192,15 +192,15 @@
</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.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">
@ -210,15 +210,15 @@
</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="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>
@ -263,12 +263,43 @@
<uni-popup ref="agentIdentitySelect" type="bottom" :is-mask-click="false">
<view class="agent-identity-list">
<view class="_list">
<view class="_list-item" v-for="(item,index) in identityCurrent" :key="index" @click="goToAgentCenter(item)">
<view class="top">
{{ item.contact_name || item.user.nickname }}
<view class="top-tag">{{ item.agent_type_text }}</view>
<!--固定菜单-->
<view class="_list-item" v-if="userInfo.service" @click="toService(0)">
<view class="top">商家管理</view>
<view class="tag-list">
<view class="tag-list-item">进入商家管理中心</view>
</view>
<view class="address">{{item.province_name || ''}} {{item.city_name || ''}} {{item.area_name || ''}}</view>
</view>
<view class="_list-item" v-if="userInfo.shopMerService" @click="toService(2)">
<view class="top">酒道馆管理</view>
<view class="tag-list">
<view class="tag-list-item">进入酒道馆管理中心</view>
</view>
</view>
<!--类型1=总部发起人,2=省公司发起人,3=省合伙人(外勤),4=省合伙人(内勤),5=区县运营商,6=区县合伙人,7=餐厅,8=配送商,9=总部外勤,10=总部内勤-->
<view class="_list-item" v-for="(item,index) in identityCurrent" :key="index" @click="goToAgentCenter(item)">
<!--餐厅-->
<template v-if="item.agent_type == 7">
<view class="top">{{ item.mer ? item.mer.mer_name : '' }}</view>
<view class="tag-list">
<view class="tag-list-item">{{ item.agent_type_text }}</view>
<!--<view class="tag-list-item">{{ item.address }}</view>-->
</view>
</template>
<!--配送商-->
<template v-else-if="item.agent_type == 8">
<view class="top">{{ item.agent_type_text }}</view>
<view class="tag-list delivery-tag">
<view class="tag-list-item" v-for="(merItem,merIndex) in item.merList" :key="merIndex">{{ merItem.mer_name || '' }}</view>
</view>
</template>
<!--其他角色-->
<template v-else>
<view class="top">{{ item.corporate_name || '' }}</view>
<view class="tag-list">
<view class="tag-list-item" v-for="(tagItem,tagIndex) in Object.values(item.agent_type_list)" :key="tagIndex">{{ tagItem || '' }}</view>
</view>
</template>
</view>
</view>
<view class='close-btn' @click="closeAgentIdentitySelect">取消</view>
@ -411,14 +442,13 @@
province_list: 0
},
identityCurrent:{},
identityCurrentName: '',
}
},
onLoad(options) {
this.$nextTick(() => {
this.setSwiperHeight(); // swiper
});
//
if(options.spread) spread(options.spread, this.isLogin)
},
@ -427,7 +457,6 @@
},
mounted: function() {
this.getVersion()
this.getIdentityList();
},
onShow: function() {
let that = this;
@ -438,6 +467,7 @@
if (that.isLogin) {
this.getUserInfo();
this.orderNum();
this.getIdentityList();
} else {
// this.userInfo = {
// is_svip: 0
@ -563,6 +593,7 @@
this.getUserInfo();
this.getMyMenus();
this.orderNum();
this.getIdentityList();
this.isShowAuth = false;
},
Setting: function() {
@ -727,12 +758,13 @@
},
// -
clickOperationCenterMenu(type){
this.identityCurrentName = type || '';
let keyName = type + '_list';
this.identityCurrent = this.identity[keyName] || {};
let len = Object.keys(this.identityCurrent).length || 0;
//
if(len <= 0) return false;
else if(len == 1) this.goToAgentCenter(this.identityCurrent[0]);
else if(len == 1 || type == 'headquarters') this.goToAgentCenter(this.identityCurrent[0]);
else this.$refs.agentIdentitySelect.open('bottom');
},
// -
@ -741,8 +773,12 @@
},
// -
goToAgentCenter(agentInfo){
let path = `/pages/agent/centerV2?agent_id=${agentInfo.id}`; //
if(agentInfo.agent_type == 7) path = `/pages/admin/business/index?is_sys=0&mer_id=${agentInfo.mer_id}`; //
//
uni.navigateTo({
url: `/pages/agent/center?agent_id=${agentInfo.id}`
// url: `/pages/agent/center?agent_id=${agentInfo.id}`
url: path
})
}
@ -801,7 +837,7 @@
position: relative;
._list{
height: calc(100 - 90rpx);
height: calc(100% - 160rpx);
width: calc(100% - (var(--list-padding-) * 2));
position: fixed;
top: var(--list-padding-);
@ -813,6 +849,7 @@
border-radius: 15rpx;
padding: 20rpx;
.top{
width: 100%;
height: 50rpx;
display: inline-flex;
flex-direction: row;
@ -838,6 +875,41 @@
line-height: 35rpx;
font-size: 25rpx;
}
.tag-list{
display: inline-flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
.tag-list-item{
background-color: #f3e6e8;
color: #926c6b;
height: 35rpx;
line-height: 35rpx;
font-size: 24rpx;
padding: 0 10rpx;
border-radius: 5rpx;
font-weight: normal;
margin-right: 15rpx;
max-width: 100%;
}
.tag-list-item:last-child{
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.delivery-tag{
.tag-list-item{
color: #fff;
background-color: #e6a23c;
border-color: #e6a23c;
}
}
}
._list-item:not(:last-child){
margin-bottom: 20rpx;