职站学生端小程序版
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.

208 lines
4.4 KiB

5 days ago
<template>
<view class="page">
<view class="status-bar"></view>
<image class="bg" src="@/static/image/person-bg.png"></image>
<view class="wrap">
<view class="info">
<button class="avatar-btn" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
<image class="avatar" :src="info.avatar" mode=""></image>
5 days ago
</button>
<view class="text">
<view class="name">{{ info.userName }}</view>
<view class="dep-wrap">
<view class="dep">{{ info.schoolName }}</view>
<view class="tag">当前组织</view>
</view>
5 days ago
</view>
</view>
<view class="list">
<view class="item" @click="$util.to('/team/teams/teams')">
5 days ago
<view class="left">
<image class="icon" src="@/static/image/person4.png" mode=""></image>
<text class="name">我的资料</text>
5 days ago
</view>
<uni-icons type="right" size="15" color="#ccc"></uni-icons>
</view>
<view class="item" @click="$util.to('/user/switchAccount/switchAccount')">
5 days ago
<view class="left">
<image class="icon" src="@/static/image/person4.png" mode=""></image>
<text class="name">切换账号</text>
5 days ago
</view>
<uni-icons type="right" size="15" color="#ccc"></uni-icons>
</view>
<view class="item" @click="logout">
5 days ago
<view class="left">
<image class="icon" src="@/static/image/person3.png" mode=""></image>
<text class="name">退出登录</text>
5 days ago
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { queryUserInfoDetails, updateAvatars } from '@/apis/modules/user.js'
5 days ago
import OSS from '@/libs/Oss/upload'
export default {
data() {
return {
info: {
avatar: '',
userName: '',
schoolName: ''
5 days ago
},
avatar: uni.getStorageSync('avatar') || '@/static/image/avatar.png',
userName: uni.getStorageSync('userName'),
}
},
onShow() {
this.getInfo()
5 days ago
},
methods: {
// 获取个人信息
async getInfo() {
const res = await queryUserInfoDetails()
const r = res.result.hrUserInfo
this.info = {
avatar: r.userAvatars || 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
userName: r.userName || 'tourist',
schoolName: r.schoolName || ''
}
5 days ago
},
// 上传头像回调
onChooseAvatar(e) {
OSS(e.detail.avatarUrl, ({ url }) => {
updateAvatars(url).then(res => {
this.getInfo()
}).catch(e => {})
})
},
// 创建自己的团队
createTeam() {
this.$util.to(`../reg/reg?openid=${uni.getStorageSync('openid')}&phone=${this.my.info.phone}&my=1`)
},
// 进入设置
toSet() {
this.$util.to(`/team/setting/setting`)
},
// 退出登录
logout() {
const that = this
uni.showModal({
title: '提示',
content: '确定要退出账号吗?',
success(res) {
if (res.confirm) {
uni.clearStorageSync()
uni.reLaunch({
url: '/pages/login/login'
})
5 days ago
}
}
})
5 days ago
},
}
}
</script>
<style scoped lang="scss">
.status-bar {
// width: 100%;
// height: calc(var(--status-bar-height) + 120rpx);
}
.bg {
width: 100%;
height: calc(var(--status-bar-height) + 250rpx);
// #ifdef MP-WEIXIN
height: calc(var(--status-bar-height) + 317rpx);
// #endif
}
.wrap {
position: relative;
padding: 0 24rpx;
margin-top: -150rpx;
}
.info {
display: flex;
align-items: center;
padding: 26rpx 34rpx;
background-color: #fff;
border-radius: 16rpx;
.avatar-btn {
padding: 0;
margin: 0 28rpx 0 0;
line-height: 0;
border: 0 !important;
background-color: transparent;
outline: none;
border-radius: 50%;
}
.avatar {
width: 120rpx;
height: 120rpx;
border: 0;
}
.text {
margin-right: 20rpx;
}
.name {
margin-bottom: 10rpx;
font-size: 40rpx;
color: #333;
}
.dep-wrap {
display: flex;
align-items: center;
}
.dep {
max-width: 350rpx;
5 days ago
font-size: 28rpx;
color: #333;
}
.tag {
padding: 8rpx 16rpx;
margin-left: 10rpx;
5 days ago
font-size: 24rpx;
color: #333;
white-space: nowrap;
5 days ago
border-radius: 20px;
border: 1px solid #ccc;
5 days 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;
}
}
.location {
margin-top: 30rpx;
}
.picker-wrap {
margin-top: 4px;
}
.name {
font-size: 24rpx;
}
</style>