职站学生端小程序版
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.0 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">
<image class="avatar" :src="info.avatar" mode=""></image>
5 days 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>
5 days ago
</view>
</view>
<view class="list">
<view class="item" @click="$util.to('/user/info/info')">
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>
<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 />
5 days ago
</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
},
// 退出登录
logout() {
this.$refs.logout.open()
return
const that = this
uni.showModal({
title: '提示',
content: '确定要退出账号吗?',
success(res) {
if (res.confirm) {
that.logoutSubmit()
5 days ago
}
}
})
5 days ago
},
logoutSubmit() {
uni.clearStorageSync()
uni.reLaunch({
url: '/pages/login/login'
})
},
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 {
width: 120rpx;
height: 120rpx;
margin-right: 30rpx;
5 days ago
border: 0;
border-radius: 50%;
5 days 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;
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;
}
}
.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;
3 days 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;
}
}
}
5 days ago
}
</style>