幼教产品B2B生态平台小程序端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

566 lines
15 KiB

12 months ago
<template>
<view class="page">
<view class="status-bar"></view>
12 months ago
<image class="bg" src="https://occupationlab.com/images/preschoolEdu/person-bg.png" />
12 months ago
11 months ago
<view class="team-wrap" :style="{paddingTop: headerTop}">
11 months ago
<view v-if="platformId !== 7 && teams.length" class="team">
12 months ago
<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>
12 months ago
<view class="wrap">
<view class="info">
<button class="avatar-btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
11 months ago
<image class="avatar" :src="info.userAvatars" mode=""></image>
12 months ago
</button>
11 months ago
<view>
<view class="person">
<view class="name">{{ info.userName || userName }}</view>
<view class="auth" @click="toAuth">
{{ info.authentication }}
<uni-icons class="icon" type="right" size="16" color="#4876f9"></uni-icons>
</view>
</view>
11 months ago
<view class="phone">{{ curAccount.account || info.phone }}</view>
12 months ago
</view>
11 months ago
12 months ago
</view>
12 months ago
<view class="block" style="padding-bottom: 0;">
12 months ago
<view class="title">基础功能</view>
<ul class="func">
12 months ago
<li @click="tips">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon1.png" />
12 months ago
<view class="text ell">我的电子券</view>
</li>
<li @click="tips">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon2.png" />
12 months ago
<view class="text ell">我的关注</view>
</li>
12 months ago
<li @click="toPage('/other/registeredActivity/registeredActivity')">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon3.png" />
12 months ago
<view class="text ell">已报名活动</view>
</li>
11 months ago
<!-- <li @click="tips">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon4.png" />
12 months ago
<view class="text ell">我的发票</view>
11 months ago
</li> -->
<!-- <li @click="tips">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon5.png" />
12 months ago
<view class="text ell">我的订单</view>
11 months ago
</li> -->
12 months ago
<li @click="tips">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon6.png" />
12 months ago
<view class="text ell">发布采购</view>
12 months ago
</li>
</ul>
</view>
12 months ago
<template v-if="platformId === 7">
11 months ago
<view class="types" @click="toEnterAuth(6)">
12 months ago
<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>
11 months ago
<view class="btn">供应商认证</view>
12 months ago
</view>
</view>
11 months ago
<view class="types" @click="toEnterAuth(5)">
12 months ago
<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>
11 months ago
<view class="btn">幼儿园认证</view>
12 months ago
</view>
</view>
</template>
<view v-else class="block" style="padding-bottom: 0;">
12 months ago
<view class="identity">
11 months ago
<view class="left">
<view class="title">我是{{ platformName }}</view>
<view v-if="!isMember" class="badge">{{ platformName }}负责人</view>
</view>
11 months ago
<view class="auth">{{ auditStatus }}</view>
12 months ago
</view>
12 months ago
<view class="identity-bg">
12 months ago
<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" />
12 months ago
<view class="open">
立即开通
<uni-icons class="icon" type="right" size="12" color="#c5530d"></uni-icons>
</view>
</view>
12 months ago
<view class="title">工作台</view>
<ul class="func">
11 months ago
<li @click="toEnterAuth(platformId)">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon7.png" />
12 months ago
<view class="text ell">{{ platformName }}认证</view>
12 months ago
</li>
12 months ago
<li v-if="isSupplier" @click="tips">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon8.png" />
12 months ago
<view class="text ell">商品管理</view>
</li>
<li @click="toPage('/team/teams/teams')">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon9.png" />
12 months ago
<view class="text ell">团队管理</view>
</li>
11 months ago
<!-- <li @click="tips">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon10.png" />
12 months ago
<view class="text ell">{{ isSupplier ? '订单管理' : '我的订单' }}</view>
11 months ago
</li> -->
12 months ago
<li v-if="isSupplier" @click="tips">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon11.png" />
12 months ago
<view class="text ell">活动管理</view>
</li>
<li @click="toPage('/team/info/info')">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon12.png" />
12 months ago
<view class="text ell">信息维护</view>
</li>
12 months ago
<li v-if="isPreschool" @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>
11 months ago
<!-- <li @click="tips">
12 months ago
<image src="https://occupationlab.com/images/preschoolEdu/icon15.png" />
<view class="text ell">发票管理</view>
11 months ago
</li> -->
12 months ago
</template>
12 months ago
</ul>
</view>
<view class="list">
12 months ago
<view class="item" @click="toPage(`/team/setting/setting`)">
12 months ago
<view class="left">
12 months ago
<image class="icon" src="https://occupationlab.com/images/preschoolEdu/setting.png" mode=""></image>
12 months ago
<text class="name">设置</text>
</view>
</view>
</view>
</view>
<view v-if="!per" class="per-mask">功能升级中敬请期待...</view>
</view>
</template>
<script>
12 months ago
import { getTeamsByPlatformId } from '@/apis/modules/parner.js'
11 months ago
import { viewUserDetails, enterpriseCertificationStatus, updateAvatars } from '@/apis/modules/user.js'
12 months ago
import OSS from '@/libs/Oss/upload'
11 months ago
import Common from '@/config/common'
12 months ago
export default {
data() {
return {
per: true, // 是否有权限
teamId: uni.getStorageSync('teamId') || '',
12 months ago
platformId: uni.getStorageSync('platformId'),
11 months ago
openId: uni.getStorageSync('openId'),
userName: uni.getStorageSync('userName'),
12 months ago
teams: [],
11 months ago
info: {
authentication: ''
},
11 months ago
enterInfo: {},
headerTop: 0,
auditStatus: '',
isMember: true, // 成员标识
organizationName: '',
11 months ago
curAccount: {
account: ''
}
12 months ago
}
},
12 months ago
computed: {
// 幼儿园
isPreschool() {
return this.platformId === 5
},
// 供应商
isSupplier() {
return this.platformId === 6
},
// 平台名字
platformName() {
return this.platformId === 6 ? '供应商' : this.platformId === 5 ? '幼儿园' : ''
},
},
12 months ago
onShow() {
11 months ago
// #ifdef MP-WEIXIN
12 months ago
this.headerTop = uni.getMenuButtonBoundingClientRect().top + 8 + 'px'
11 months ago
// #endif
12 months ago
this.per = true
11 months ago
this.getInfo()
if (this.platformId !== 7) {
this.getTeams()
}
this.getEnterInfo()
12 months ago
},
methods: {
11 months ago
// 个人信息
async getInfo() {
const { result } = await viewUserDetails({
openId: this.openId
})
11 months ago
// status为false,说明用户被删除了,则退出登录
11 months ago
// if (result.status === false) {
// this.$util.errMsg(result.message)
// setTimeout(() => {
// uni.clearStorageSync()
// this.$util.to('/pages/login/login')
// }, 1500)
// return false
// }
11 months ago
11 months ago
if (result.hrUserInfo) {
if (!result.hrUserInfo.userAvatars) result.hrUserInfo.userAvatars = Common.avatar // 没有头像则显示默认头像
this.info = result.hrUserInfo
}
const org = result.organizationInfoList
if (org && org.length) this.organizationName = org[0].organizationName
// userAccountList里有两个身份,则显示企业的名字,否则显示个人姓名
const accountList = result.userAccountList
if (accountList && accountList.length) {
const enter = accountList.find(e => e.platformId !== '7')
this.curAccount = enter || accountList[0]
11 months ago
// 如果没有企业的身份,则重置身份为个人
if (!enter) {
uni.setStorageSync('platformId', 7)
this.platformId = 7
}
12 months ago
}
},
11 months ago
// 企业认证信息
async getEnterInfo() {
const { data } = await enterpriseCertificationStatus(this.openId)
if (data) {
11 months ago
this.auditStatus = Common.authenticationStatus.find(e => e.id === data.authenticationStatus).name
11 months ago
this.enterInfo = data
12 months ago
}
},
12 months ago
// 获取团队信息
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
12 months ago
})
12 months ago
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])
12 months ago
}
12 months ago
}
11 months ago
this.isMember = uni.getStorageSync('team').isTeam == 0 // 成员
12 months ago
this.teams = data
12 months ago
},
12 months ago
// 团队选择回调
teamChange() {
const { teamId } = this
const e = this.teams.find(e => e.teamId == teamId)
uni.setStorageSync('team', e)
uni.setStorageSync('teamId', teamId)
12 months ago
},
// 上传头像回调
onChooseAvatar(e) {
11 months ago
OSS(e.detail.avatarUrl, ({ url }) => {
updateAvatars({
url,
userName: '',
11 months ago
openId: this.openId,
platformId: this.platformId,
11 months ago
}).then(res => {
this.getInfo()
12 months ago
}).catch(e => {})
12 months ago
})
},
12 months ago
toPage(href) {
this.$util.to(href)
12 months ago
},
12 months ago
// 跳转实名认证
toAuth() {
11 months ago
this.toPage(this.info.authentication === '已认证' ? '/team/rePersonAuth/rePersonAuth' : '/team/personAuth/personAuth')
},
// 跳转企业认证
toEnterAuth(platformId) {
11 months ago
const { authenticationStatus, platformSource } = this.enterInfo
11 months ago
// 审核状态(0默认未提交 1.待审核,2.已通过,3.已驳回)
11 months ago
if (authenticationStatus === 1) {
11 months ago
if (platformSource != platformId) {
// 如果组织认证已经在审核中的,点击另外一个认证的,弹窗提示“您已提交我是供应商的认证,无法再提交幼儿园认证。
this.$util.errMsg(`您已提交我是${platformId === 5 ? '供应商' : '幼儿园'}的认证,无法再提交${platformId === 5 ? '幼儿园' : '供应商'}认证。`)
} else {
this.$util.errMsg('您已提交认证,请等待审核。')
}
} else {
11 months ago
this.$util.to(authenticationStatus === 2 ? '/team/certified/certified' : '/team/auth/auth?platformId=' + platformId)
11 months ago
}
12 months ago
},
12 months ago
// 提示暂未开放
tips() {
this.$util.errMsg('功能暂未开放!')
12 months ago
}
}
}
</script>
<style scoped lang="scss">
.bg {
width: 100%;
12 months ago
height: calc(var(--status-bar-height) + 500rpx);
12 months ago
}
12 months ago
.team-wrap {
margin: -560rpx 30rpx 30rpx;
}
.team {
position: relative;
11 months ago
max-width: 70%;
12 months ago
/deep/.selected-item text {
font-size: 30rpx;
font-weight: 600;
color: #5f5f5f;
}
}
12 months ago
.wrap {
position: relative;
12 months ago
padding: 0 24rpx 24rpx;
12 months ago
}
.block {
padding: 24rpx;
margin-left: 0;
margin-right: 0;
.title {
margin-bottom: 20rpx;
font-size: 28rpx;
font-weight: 600;
}
}
.info {
display: flex;
11 months ago
align-items: center;
12 months ago
padding: 26rpx 0;
12 months ago
.avatar-btn {
padding: 0;
margin: 0 28rpx 0 0;
line-height: 0;
border: 0 !important;
background-color: transparent;
outline: none;
border-radius: 50%;
}
.avatar {
12 months ago
width: 100rpx;
height: 100rpx;
12 months ago
border: 0;
}
11 months ago
.person {
display: flex;
align-items: center;
margin-bottom: 10rpx;
12 months ago
}
.name {
11 months ago
max-width: 49vw;
12 months ago
font-size: 32rpx;
12 months ago
font-weight: 600;
12 months ago
color: #333;
}
.phone {
12 months ago
font-size: 26rpx;
12 months ago
color: #5d5d5d;
}
.auth {
display: inline-flex;
align-items: center;
padding: 4rpx 16rpx;
11 months ago
margin-left: 20rpx;
12 months ago
font-size: 24rpx;
color: $uni-primary;
11 months ago
white-space: nowrap;
12 months ago
border: 1px solid #8ca5eb;
border-radius: 20px;
.icon {
color: $uni-primary;
}
12 months ago
}
.tag {
padding: 8rpx 16rpx;
margin-top: -50rpx;
font-size: 24rpx;
color: #fff;
12 months ago
background-color: $uni-primary;
12 months ago
border-radius: 20px;
}
}
.func {
display: flex;
flex-wrap: wrap;
12 months ago
margin-top: 15rpx;
12 months ago
li {
width: 25%;
12 months ago
margin-bottom: 30rpx;
12 months ago
text-align: center;
}
image {
width: 60rpx;
height: 60rpx;
}
.text {
width: 165rpx;
margin: 0 auto;
font-size: 24rpx;
color: #333;
}
}
12 months ago
.identity {
12 months ago
display: flex;
justify-content: space-between;
align-items: center;
11 months ago
.left {
display: inline-flex;
align-items: center;
}
12 months ago
.title {
margin-bottom: 0;
}
.badge {
padding: 8rpx 16rpx;
11 months ago
margin-left: 20rpx;
12 months ago
font-size: 24rpx;
color: #fff;
background-color: #37cc07;
border-radius: 10px;
}
.auth {
font-size: 24rpx;
color: #9c9c9c;
}
}
11 months ago
.company-name {
margin-top: 20rpx;
font-size: 24rpx;
color: #333;
}
12 months ago
.identity-bg {
position: relative;
margin: 20rpx 0 50rpx;
.pic {
width: 100%;
}
.open {
position: absolute;
12 months ago
top: 50rpx;
12 months ago
right: 20rpx;
display: flex;
align-items: center;
padding: 8rpx 14rpx;
font-size: 22rpx;
color: #c5530d;
background-color: #f9cf9d;
border-radius: 20px;
}
}
12 months ago
.list {
margin-top: 16rpx;
.item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 26rpx 28rpx;
margin-bottom: 16rpx;
background-color: #fff;
border-radius: 16rpx;
}
.left {
display: inline-flex;
align-items: center;
}
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
text {
font-size: 28rpx;
color: #333;
}
}
12 months ago
.types {
margin: 30rpx 0;
12 months ago
font-size: 24rpx;
12 months ago
color: #fff;
text-align: center;
.item {
display: flex;
12 months ago
justify-content: space-between;
12 months ago
align-items: center;
height: 150rpx;
padding: 0 50rpx;
border-radius: 12px;
background: url('https://occupationlab.com/images/preschoolEdu/role-bg1.png') 0 0/100% 100% no-repeat;
box-sizing: border-box;
}
12 months ago
.left {
display: inline-flex;
align-items: center;
}
12 months ago
.icon {
display: inline-flex;
justify-content: center;
align-items: center;
padding: 10rpx;
margin-right: 20rpx;
background-color: #fff7f1;
border-radius: 50%;
}
.img {
width: 80rpx;
}
.text {
font-size: 24rpx;
color: #fff;
}
.item2 {
background-image: url('https://occupationlab.com/images/preschoolEdu/role-bg2.png');
}
.item3 {
background: #ffb150;
.img {
width: 70rpx;
}
}
12 months ago
.btn {
padding: 8rpx 16rpx;
font-size: 24rpx;
color: #c5530d;
background-color: #f9cf9d;
border-radius: 8px;
}
12 months ago
}
</style>