|
|
|
@ -2,13 +2,20 @@ |
|
|
|
|
<view class="page"> |
|
|
|
|
<view class="status-bar"></view> |
|
|
|
|
<image class="bg" src="https://occupationlab.com/images/preschoolEdu/person-bg.png" /> |
|
|
|
|
|
|
|
|
|
<view v-if="platformId !== 7" class="team-wrap" :style="{paddingTop: headerTop}"> |
|
|
|
|
<view class="team"> |
|
|
|
|
<uni-data-picker class="picker-input" placeholder="切换团队" popup-title="切换团队" preload :clear-icon="false" :localdata="teams" :map="{text: 'classificationName', value: 'teamId'}" v-model="teamId" @change="teamChange"></uni-data-picker> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view class="wrap"> |
|
|
|
|
<view class="info"> |
|
|
|
|
<button class="avatar-btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar"> |
|
|
|
|
<image class="avatar" :src="avatar" mode=""></image> |
|
|
|
|
</button> |
|
|
|
|
<view class="text"> |
|
|
|
|
<view class="name">{{ info.realName }}</view> |
|
|
|
|
<view class="name">{{ info.realName || userName }}</view> |
|
|
|
|
<view class="phone">1369641301</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="auth" @click="toAuth"> |
|
|
|
@ -49,14 +56,40 @@ |
|
|
|
|
</ul> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<view v-if="role" class="block" style="padding-bottom: 0;"> |
|
|
|
|
<template v-if="platformId === 7"> |
|
|
|
|
<view class="types"> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="left"> |
|
|
|
|
<view class="icon"> |
|
|
|
|
<image class="img" src="https://occupationlab.com/images/preschoolEdu/role-icon1.png" mode="widthFix" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="text">我是供应商</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="btn" @click="tips">供应商认证</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="types"> |
|
|
|
|
<view class="item item2"> |
|
|
|
|
<view class="left"> |
|
|
|
|
<view class="icon"> |
|
|
|
|
<image class="img" src="https://occupationlab.com/images/preschoolEdu/role-icon2.png" mode="widthFix" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="text">我是幼儿园</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="btn" @click="tips">幼儿园认证</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<view v-else class="block" style="padding-bottom: 0;"> |
|
|
|
|
<view class="identity"> |
|
|
|
|
<view class="title">我是供应商</view> |
|
|
|
|
<view class="badge">供应商负责人</view> |
|
|
|
|
<view class="title">我是{{ platformName }}</view> |
|
|
|
|
<view class="badge">{{ platformName }}负责人</view> |
|
|
|
|
<view class="auth" @click="toPage('/team/certified/certified')">未认证</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="identity-bg"> |
|
|
|
|
<image class="pic" src="https://occupationlab.com/images/preschoolEdu/vip.png" mode="widthFix" /> |
|
|
|
|
<image v-if="isPreschool" class="pic" src="https://occupationlab.com/images/preschoolEdu/preschool1.png" mode="widthFix" /> |
|
|
|
|
<image v-else class="pic" src="https://occupationlab.com/images/preschoolEdu/supplier1.png" mode="widthFix" /> |
|
|
|
|
<view class="open"> |
|
|
|
|
立即开通 |
|
|
|
|
<uni-icons class="icon" type="right" size="12" color="#c5530d"></uni-icons> |
|
|
|
@ -68,9 +101,9 @@ |
|
|
|
|
<ul class="func"> |
|
|
|
|
<li @click="toPage('/team/auth/auth')"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon7.png" /> |
|
|
|
|
<view class="text ell">供应商认证</view> |
|
|
|
|
<view class="text ell">{{ platformName }}认证</view> |
|
|
|
|
</li> |
|
|
|
|
<li @click="tips"> |
|
|
|
|
<li v-if="isSupplier" @click="tips"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon8.png" /> |
|
|
|
|
<view class="text ell">商品管理</view> |
|
|
|
|
</li> |
|
|
|
@ -80,9 +113,9 @@ |
|
|
|
|
</li> |
|
|
|
|
<li @click="tips"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon10.png" /> |
|
|
|
|
<view class="text ell">订单管理</view> |
|
|
|
|
<view class="text ell">{{ isSupplier ? '订单管理' : '我的订单' }}</view> |
|
|
|
|
</li> |
|
|
|
|
<li @click="tips"> |
|
|
|
|
<li v-if="isSupplier" @click="tips"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon11.png" /> |
|
|
|
|
<view class="text ell">活动管理</view> |
|
|
|
|
</li> |
|
|
|
@ -90,40 +123,27 @@ |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon12.png" /> |
|
|
|
|
<view class="text ell">信息维护</view> |
|
|
|
|
</li> |
|
|
|
|
<li v-if="isPreschool" @click="tips"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon15.png" /> |
|
|
|
|
<view class="text ell">我要采购</view> |
|
|
|
|
</li> |
|
|
|
|
<li @click="tips"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon13.png" /> |
|
|
|
|
<view class="text ell">对账管理</view> |
|
|
|
|
</li> |
|
|
|
|
<li @click="tips"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon14.png" /> |
|
|
|
|
<view class="text ell">商机线索</view> |
|
|
|
|
</li> |
|
|
|
|
<li @click="tips"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon15.png" /> |
|
|
|
|
<view class="text ell">发票管理</view> |
|
|
|
|
</li> |
|
|
|
|
<template v-if="isSupplier"> |
|
|
|
|
<li @click="tips"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon14.png" /> |
|
|
|
|
<view class="text ell">商机线索</view> |
|
|
|
|
</li> |
|
|
|
|
<li @click="tips"> |
|
|
|
|
<image src="https://occupationlab.com/images/preschoolEdu/icon15.png" /> |
|
|
|
|
<view class="text ell">发票管理</view> |
|
|
|
|
</li> |
|
|
|
|
</template> |
|
|
|
|
</ul> |
|
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
<template v-else> |
|
|
|
|
<view class="types"> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="icon"> |
|
|
|
|
<image class="img" src="https://occupationlab.com/images/preschoolEdu/role-icon1.png" mode="widthFix" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="text">我是幼儿园</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="types"> |
|
|
|
|
<view class="item item2"> |
|
|
|
|
<view class="icon"> |
|
|
|
|
<image class="img" src="https://occupationlab.com/images/preschoolEdu/role-icon2.png" mode="widthFix" /> |
|
|
|
|
</view> |
|
|
|
|
<view class="text">我是供应商</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<view class="list"> |
|
|
|
|
<view class="item" @click="toPage(`/team/setting/setting`)"> |
|
|
|
|
<view class="left"> |
|
|
|
@ -138,14 +158,15 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { my, editProvinceCity } from '@/apis/modules/parner.js' |
|
|
|
|
import { authenticationOrNot, queryProvince, queryCity, updateAvatars, getUserRolesPermissionMenu } from '@/apis/modules/user.js' |
|
|
|
|
import { getTeamsByAccountId } from '@/apis/modules/client.js' |
|
|
|
|
import { getTeamsByPlatformId } from '@/apis/modules/parner.js' |
|
|
|
|
import { authenticationOrNot, updateAvatars } from '@/apis/modules/user.js' |
|
|
|
|
import OSS from '@/libs/Oss/upload' |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
per: true, // 是否有权限 |
|
|
|
|
teamId: uni.getStorageSync('teamId') || '', |
|
|
|
|
platformId: uni.getStorageSync('platformId'), |
|
|
|
|
teams: [], |
|
|
|
|
info: {}, |
|
|
|
|
// avatar: uni.getStorageSync('avatar') || '@/static/image/avatar.png', |
|
|
|
@ -154,12 +175,28 @@ |
|
|
|
|
hasOwnTeam: 0, // 有自己的团队 |
|
|
|
|
disabled: true, |
|
|
|
|
isAuth: false, |
|
|
|
|
role: 0 |
|
|
|
|
headerTop: 0 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
// 幼儿园 |
|
|
|
|
isPreschool() { |
|
|
|
|
return this.platformId === 5 |
|
|
|
|
}, |
|
|
|
|
// 供应商 |
|
|
|
|
isSupplier() { |
|
|
|
|
return this.platformId === 6 |
|
|
|
|
}, |
|
|
|
|
// 平台名字 |
|
|
|
|
platformName() { |
|
|
|
|
return this.platformId === 6 ? '供应商' : this.platformId === 5 ? '幼儿园' : '' |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
onShow() { |
|
|
|
|
this.headerTop = uni.getMenuButtonBoundingClientRect().top + 8 + 'px' |
|
|
|
|
this.per = true |
|
|
|
|
this.getAuthOrNot() |
|
|
|
|
this.platformId === 7 || this.getTeams() |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 初始化权限 |
|
|
|
@ -178,79 +215,36 @@ |
|
|
|
|
this.info = res.authenticationInformation |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 查询当前角色权限 |
|
|
|
|
getAuth() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
// 获取团队信息 |
|
|
|
|
async getTeams() { |
|
|
|
|
const { data } = await getTeamsByPlatformId({platformId: this.platformId}) |
|
|
|
|
data.map(e => { |
|
|
|
|
const n = e.platformTeamClassificationList |
|
|
|
|
e.id = n.id |
|
|
|
|
// parnerId是商务经理id,teamId则是下面这个,其他地方要用的话直接uni.getStorageSync('team').partnerId去使用 |
|
|
|
|
e.teamId = e.isTeam === '1' ? +e.classificationId : n.id |
|
|
|
|
e.classificationName = n.classificationName |
|
|
|
|
delete e.platformTeamClassificationList |
|
|
|
|
}) |
|
|
|
|
getUserRolesPermissionMenu({ |
|
|
|
|
teamId: this.teams.find(e => e.teamId == this.teamId).partnerClassificationId, |
|
|
|
|
platformId: 4 |
|
|
|
|
}).then(({ permissionMenu }) => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
const auth = [] |
|
|
|
|
// 生成权限数组 |
|
|
|
|
const generateAuth = (list, parent) => { |
|
|
|
|
list.map(e => { |
|
|
|
|
const name = `${parent ? parent + ':' : ''}${e.name}` |
|
|
|
|
auth.push(name) |
|
|
|
|
generateAuth(e.children, name) |
|
|
|
|
}) |
|
|
|
|
if (data.length) { |
|
|
|
|
/** |
|
|
|
|
* @description 如果是第一次进,则默认选中第一个团队,并把该团队的信息存入缓存 |
|
|
|
|
* 或者团队列表里没有该id,则说明超管已经被转让,也需要重新选中团队 |
|
|
|
|
*/ |
|
|
|
|
if (!uni.getStorageSync('team') || !data.find(e => e.teamId == this.teamId)) { |
|
|
|
|
this.teamId = data[0].teamId |
|
|
|
|
uni.setStorageSync('teamId', data[0].teamId) |
|
|
|
|
uni.setStorageSync('team', data[0]) |
|
|
|
|
} |
|
|
|
|
generateAuth(permissionMenu[0].children, '') |
|
|
|
|
uni.setStorageSync('auth', auth) |
|
|
|
|
this.initRole() |
|
|
|
|
}).catch(e => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
uni.setStorageSync('auth', []) |
|
|
|
|
this.initRole() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.teams = data |
|
|
|
|
}, |
|
|
|
|
// 获取团队 |
|
|
|
|
getTeam() { |
|
|
|
|
uni.showLoading({ |
|
|
|
|
title: '加载中' |
|
|
|
|
}) |
|
|
|
|
getTeamsByAccountId().then(({ data }) => { |
|
|
|
|
let hasOwnTeam = 0 // 是否有自己的团队 |
|
|
|
|
data.map(e => { |
|
|
|
|
const n = e.partnerClassificationList |
|
|
|
|
e.id = n.id |
|
|
|
|
// parnerId是商务经理id,teamId则是下面这个,其他地方要用的话直接uni.getStorageSync('team').partnerId去使用 |
|
|
|
|
e.teamId = e.isTeam == 1 ? +e.partnerClassificationId : n.id |
|
|
|
|
e.partnerClassificationName = n.partnerClassificationName |
|
|
|
|
delete e.partnerClassificationList |
|
|
|
|
if (e.isTeam == 1) hasOwnTeam = 1 |
|
|
|
|
}) |
|
|
|
|
this.hasOwnTeam = hasOwnTeam |
|
|
|
|
const teamId = uni.getStorageSync('teamId') |
|
|
|
|
if (data.length) { |
|
|
|
|
/** |
|
|
|
|
* @description 如果是第一次进,则默认选中第一个团队,并把该团队的信息存入缓存 |
|
|
|
|
* 或者团队列表里没有该id,则说明超管已经被转让,也需要重新选中团队 |
|
|
|
|
*/ |
|
|
|
|
const curTeam = data.find(e => e.teamId == teamId) |
|
|
|
|
if (teamId && curTeam) { |
|
|
|
|
uni.setStorageSync('team', curTeam) |
|
|
|
|
} else if (!uni.getStorageSync('team') || !curTeam) { |
|
|
|
|
this.teamId = data[0].teamId |
|
|
|
|
uni.setStorageSync('teamId', data[0].teamId) |
|
|
|
|
uni.setStorageSync('team', data[0]) |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// 如果没有团队,则退出登录 |
|
|
|
|
uni.hideLoading() |
|
|
|
|
uni.clearStorageSync() |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url: '../login/login' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.disabled = uni.getStorageSync('team').isTeam == 0 // 成员不能改省份城市 |
|
|
|
|
this.teams = data |
|
|
|
|
this.getAuth() |
|
|
|
|
}).catch(e => { |
|
|
|
|
uni.hideLoading() |
|
|
|
|
}) |
|
|
|
|
// 团队选择回调 |
|
|
|
|
teamChange() { |
|
|
|
|
const { teamId } = this |
|
|
|
|
const e = this.teams.find(e => e.teamId == teamId) |
|
|
|
|
uni.setStorageSync('team', e) |
|
|
|
|
uni.setStorageSync('teamId', teamId) |
|
|
|
|
}, |
|
|
|
|
// 获取个人信息 |
|
|
|
|
getInfo() { |
|
|
|
@ -263,34 +257,30 @@ |
|
|
|
|
const avatar = my.info.userAvatars || 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png' |
|
|
|
|
this.avatar = avatar |
|
|
|
|
uni.setStorageSync('avatar', avatar) |
|
|
|
|
this.provinceId = my.teamInfo.provinceId |
|
|
|
|
this.cityId = my.teamInfo.cityId |
|
|
|
|
uni.setStorageSync('provinceId', this.provinceId) |
|
|
|
|
uni.setStorageSync('cityId', this.cityId) |
|
|
|
|
this.getProvince() |
|
|
|
|
this.provinceId && this.getCity() |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
}, |
|
|
|
|
// 上传头像回调 |
|
|
|
|
onChooseAvatar(e) { |
|
|
|
|
uni.uploadFile({ |
|
|
|
|
url: 'https://huorantech.cn/nakadai/nakadai/oss/fileUpload', |
|
|
|
|
filePath: e.detail.avatarUrl, |
|
|
|
|
name: 'file', |
|
|
|
|
header: { |
|
|
|
|
token: uni.getStorageSync('token'), |
|
|
|
|
}, |
|
|
|
|
formData: {}, |
|
|
|
|
success: ({ data }) => { |
|
|
|
|
updateAvatars(JSON.parse(data).filesResult.fileUrl).then(res => { |
|
|
|
|
this.getInfo() |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
} |
|
|
|
|
OSS(e.detail.avatarUrl, (name) => { |
|
|
|
|
updateAvatars(name).then(res => { |
|
|
|
|
// this.getInfo() |
|
|
|
|
}).catch(e => {}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
// 创建自己的团队 |
|
|
|
|
createTeam() { |
|
|
|
|
this.$util.to(`../reg/reg?openid=${uni.getStorageSync('openid')}&phone=${this.my.info.phone}&my=1`) |
|
|
|
|
|
|
|
|
|
// uni.uploadFile({ |
|
|
|
|
// url: 'https://huorantech.cn/nakadai/nakadai/oss/fileUpload', |
|
|
|
|
// filePath: e.detail.avatarUrl, |
|
|
|
|
// name: 'file', |
|
|
|
|
// header: { |
|
|
|
|
// token: uni.getStorageSync('token'), |
|
|
|
|
// }, |
|
|
|
|
// formData: {}, |
|
|
|
|
// success: ({ data }) => { |
|
|
|
|
// updateAvatars(JSON.parse(data).filesResult.fileUrl).then(res => { |
|
|
|
|
// this.getInfo() |
|
|
|
|
// }).catch(e => {}) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
}, |
|
|
|
|
toPage(href) { |
|
|
|
|
this.$util.to(href) |
|
|
|
@ -312,10 +302,21 @@ |
|
|
|
|
width: 100%; |
|
|
|
|
height: calc(var(--status-bar-height) + 500rpx); |
|
|
|
|
} |
|
|
|
|
.team-wrap { |
|
|
|
|
margin: -560rpx 30rpx 30rpx; |
|
|
|
|
} |
|
|
|
|
.team { |
|
|
|
|
position: relative; |
|
|
|
|
width: 300rpx; |
|
|
|
|
/deep/.selected-item text { |
|
|
|
|
font-size: 30rpx; |
|
|
|
|
font-weight: 600; |
|
|
|
|
color: #5f5f5f; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.wrap { |
|
|
|
|
position: relative; |
|
|
|
|
padding: 0 24rpx 24rpx; |
|
|
|
|
margin-top: -400rpx; |
|
|
|
|
} |
|
|
|
|
.block { |
|
|
|
|
padding: 24rpx; |
|
|
|
@ -433,7 +434,7 @@ |
|
|
|
|
} |
|
|
|
|
.open { |
|
|
|
|
position: absolute; |
|
|
|
|
top: 46rpx; |
|
|
|
|
top: 50rpx; |
|
|
|
|
right: 20rpx; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
@ -476,6 +477,7 @@ |
|
|
|
|
text-align: center; |
|
|
|
|
.item { |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: space-between; |
|
|
|
|
align-items: center; |
|
|
|
|
height: 150rpx; |
|
|
|
|
padding: 0 50rpx; |
|
|
|
@ -483,6 +485,10 @@ |
|
|
|
|
background: url('https://occupationlab.com/images/preschoolEdu/role-bg1.png') 0 0/100% 100% no-repeat; |
|
|
|
|
box-sizing: border-box; |
|
|
|
|
} |
|
|
|
|
.left { |
|
|
|
|
display: inline-flex; |
|
|
|
|
align-items: center; |
|
|
|
|
} |
|
|
|
|
.icon { |
|
|
|
|
display: inline-flex; |
|
|
|
|
justify-content: center; |
|
|
|
@ -508,5 +514,12 @@ |
|
|
|
|
width: 70rpx; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.btn { |
|
|
|
|
padding: 8rpx 16rpx; |
|
|
|
|
font-size: 24rpx; |
|
|
|
|
color: #c5530d; |
|
|
|
|
background-color: #f9cf9d; |
|
|
|
|
border-radius: 8px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|