添加:省公司发起人添加门店管理功能 支持省公司发起人无需登录直接管理绑定的省公司门店

This commit is contained in:
wuhui_zzw 2024-04-22 14:07:44 +08:00
parent c48eb99bb6
commit 08f5cc93ca
2 changed files with 78 additions and 2 deletions

View File

@ -549,7 +549,21 @@ export function priceRuleApi(id) {
noAuth: true
});
}
// 酒道馆登录
// 商户登录
export function storeLogin(data) {
return request.get("store/merchant/login", data);
}
// 模拟登录
export function storeLoginSimulation(merId) {
return request.get(`store/merchant/simulation_login/${merId}`);
}

View File

@ -113,6 +113,7 @@
import {mapGetters} from "vuex";
import authorize from '@/components/Authorize';
import {roleAndCorrelationRole,inviteSupplierJoinQrCode} from "@/api/agent";
import {storeLoginSimulation} from "@/api/store";
export default {
name: 'business',
@ -124,6 +125,7 @@ export default {
// 1=,2=,3=(),4=(),5=,6=,7=,8=,9=,10=
let menuList = [];
let agentType = this.agent_info.agent_type || 0;
let merId = this.agent_info.mer_id || 0;
// 广
if(['1','2','3','5','6','9','11'].includes(String(agentType))){
menuList.push({
@ -160,7 +162,15 @@ export default {
icon: 'icon-wodetuandui',
});
}
//
if(['2'].includes(String(agentType)) && merId > 0){
menuList.push({
title: '门店管理',
type: 'store_management',
url: '/pages/admin/business/index',
icon: 'icon-dianpu1',
});
}
@ -472,6 +482,18 @@ export default {
url: menu.url + '?agent_id=' + params.agent_id
})
break;
//
case 'store_management':
//
_this.$store.commit("SHOP_LOGIN", {
'token': null,
'time': null,
'shop_mer_id': null,
});
_this.storeManagement();
break;
}
},
// 广 -
@ -508,6 +530,46 @@ export default {
qrCodeClose(){
this.$refs.qrCodePopup.close();
},
// -
storeManagement(){
let _this = this;
let merId = this.agent_info.mer_id || 0;
uni.showLoading({title: '登录中...', mask: true})
storeLoginSimulation(merId).then(res => {
if (res.status == 200) {
let data = res.data || {};
//
_this.$store.commit("SHOP_LOGIN", {
'token': data.token,
'time': data.exp,
'shop_mer_id': data.mer_id,
});
//
let merchantType = data.merchant_type || 0;
let loginHistory = this.$Cache.get('MER_LOGIN_HISTORY_' + merchantType) || {};
if(typeof loginHistory === 'string') loginHistory = JSON.parse(loginHistory) || {};
loginHistory[data.mer_id] = data;
_this.$Cache.set('MER_LOGIN_HISTORY_' + merchantType, JSON.stringify(loginHistory))
// ||
// merchant_type0=1=2=3=4=5=
// is_sys0=1=2=3=4=5=
let is_sys = 0;
if(merchantType == 1) is_sys = 2;
else if(merchantType == 3) is_sys = 3;
else if(merchantType == 4) is_sys = 4;
else if(merchantType == 5) is_sys = 5;
uni.navigateTo({
url: '/pages/admin/business/index?is_sys=' + is_sys
})
}
uni.hideLoading();
}).catch(err => {
uni.hideLoading();
this.$util.Tips({ title: err });
});
}