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

243 lines
5.1 KiB

1 week 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">
<image class="avatar" :src="info.avatar" mode=""></image>
1 week ago
<view class="text">
<view class="name">{{ info.userName }}</view>
<view class="dep-wrap">
<view class="dep">{{ info.schoolName }}</view>
<view class="tag">当前组织</view>
</view>
1 week ago
</view>
</view>
<view class="list">
<view class="item" @click="$util.to('/user/info/info')">
1 week ago
<view class="left">
5 days ago
<image class="icon" src="https://eduvessel.com/images/occupationlab/person.svg" mode=""></image>
<text class="name">我的资料</text>
1 week ago
</view>
<uni-icons type="right" size="15" color="#ccc"></uni-icons>
</view>
<view class="item" @click="$util.to('/user/switchAccount/switchAccount')">
1 week ago
<view class="left">
5 days ago
<image class="icon" src="https://eduvessel.com/images/occupationlab/switch.svg" mode=""></image>
<text class="name">切换账号</text>
1 week ago
</view>
<uni-icons type="right" size="15" color="#ccc"></uni-icons>
</view>
<view class="item" @click="logout">
1 week ago
<view class="left">
5 days ago
<image class="icon" src="https://eduvessel.com/images/occupationlab/logout.svg" mode=""></image>
<text class="name">退出登录</text>
1 week ago
</view>
</view>
</view>
</view>
<uni-popup ref="logout">
<view class="logout-wrap">
<view class="tips">退出当前账号</view>
<view class="user">
<image class="avatar" :src="info.avatar" mode=""></image>
<view class="text">
<view class="name">{{ info.userName }}</view>
<view class="dep">{{ info.schoolName }}</view>
</view>
</view>
<view class="btns">
<view class="btn" @click="$refs.logout.close()">取消</view>
<view class="btn" @click="logoutSubmit">确认</view>
</view>
</view>
</uni-popup>
<realName />
1 week ago
</view>
</template>
<script>
import { queryUserInfoDetails, updateAvatars } from '@/apis/modules/user.js'
1 week ago
import OSS from '@/libs/Oss/upload'
export default {
data() {
return {
info: {
avatar: '',
userName: '',
schoolName: ''
1 week ago
},
5 days ago
avatar: uni.getStorageSync('avatar') || 'https://eduvessel.com/images/occupationlab/avatar.png',
1 week ago
userName: uni.getStorageSync('userName'),
}
},
onShow() {
this.getInfo()
1 week 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 || ''
}
1 week ago
},
// 退出登录
logout() {
this.$refs.logout.open()
return
const that = this
uni.showModal({
title: '提示',
content: '确定要退出账号吗?',
success(res) {
if (res.confirm) {
that.logoutSubmit()
1 week ago
}
}
})
1 week ago
},
logoutSubmit() {
uni.clearStorageSync()
uni.reLaunch({
url: '/pages/login/login'
})
},
1 week 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 {
width: 120rpx;
height: 120rpx;
margin-right: 30rpx;
1 week ago
border: 0;
border-radius: 50%;
1 week ago
}
.text {
margin-right: 20rpx;
}
.name {
margin-bottom: 10rpx;
font-size: 40rpx;
color: #333;
}
.dep-wrap {
display: flex;
align-items: center;
}
.dep {
max-width: 350rpx;
1 week ago
font-size: 28rpx;
color: #333;
}
.tag {
padding: 8rpx 16rpx;
margin-left: 10rpx;
1 week ago
font-size: 24rpx;
color: #333;
white-space: nowrap;
1 week ago
border-radius: 20px;
border: 1px solid #ccc;
1 week 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;
}
}
.logout-wrap {
width: 520rpx;
padding-top: 30rpx;
background-color: #fff;
border-radius: 20rpx;
.user {
display: flex;
justify-content: center;
align-items: center;
padding: 30rpx 20rpx;
.avatar {
width: 60rpx;
height: 60rpx;
margin-right: 20rpx;
1 week ago
border-radius: 50%;
}
.name {
font-size: 24rpx;
}
.dep {
max-width: 500rpx;
font-size: 24rpx;
}
}
.tips {
font-size: 32rpx;
text-align: center;
}
.btns {
display: flex;
text-align: center;
border-top: 1px solid #eee;
.btn {
flex: 1;
padding: 16rpx;
font-size: 24rpx;
color: #007EFF;
&:first-child {
border-right: 1px solid #eee;
}
}
}
1 week ago
}
</style>