NurseStationPersonAppletUl/pages/personal/personal.vue

368 lines
8.5 KiB
Vue
Raw Permalink Normal View History

2023-03-28 10:02:47 +08:00
<template>
<view class="app">
2023-04-03 14:55:17 +08:00
<image class="circular" :src="beijingurl" mode=""></image>
2023-04-11 15:16:06 +08:00
<view class="user" v-if="personRoleLoginFlag == 'nursePersonRole'||personRoleLoginFlag == 'wholeRole'">
2023-04-10 16:40:18 +08:00
<image class="img" :src="baseurl+Personallist.avatar" mode="" v-if="Personallist.avatar"></image>
2023-04-11 17:12:18 +08:00
<image class="img" src="../../static/user2.png" mode="" v-else></image>
2023-04-03 14:55:17 +08:00
<view class="phone" v-if="Personallist.nursePersonName">
{{Personallist.nursePersonName}}
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<view class="nickname" style="top:245rpx" v-if="Personallist.phone">
{{Personallist.phone}}
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<view class="nickname" v-if="Personallist.evaluateStarCount>=0">
2023-04-10 16:31:11 +08:00
<u-rate :count="5" v-model="Personallist.evaluateStarCount" disabled active-color='#F4EA2A'>
</u-rate>
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<view class="modify" @tap='goModifyinformation'>
<image src="../../static/xg.png" mode="" style="padding-right: 15rpx;"></image>
2023-03-28 10:02:47 +08:00
修改信息
</view>
</view>
2023-04-11 15:16:06 +08:00
<view class="user" v-if="personRoleLoginFlag == 'stationRole'||personRoleLoginFlag =='notRoleName'">
2023-04-11 17:12:18 +08:00
<image class="img" src="../../static/user2.png" mode=""></image>
2023-04-10 16:48:17 +08:00
<view class="phone" style="top:245rpx" v-if="phone">
2023-04-10 16:40:18 +08:00
{{phone}}
2023-04-10 16:31:11 +08:00
</view>
</view>
2023-04-11 15:16:06 +08:00
<view class="user" v-if="!personRoleLoginFlag">
2023-04-11 17:12:18 +08:00
<image class="img" src="../../static/user2.png" mode=""></image>
2023-04-03 14:55:17 +08:00
<view class="login" @tap='gologin'>
登录
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
</view>
<view class="topitems">
<view class="topitem" @tap="tapstatus('ONLINE')">
<image src="../../static/kaishi2.png" mode="" v-if="Personallist.workStatus=='ONLINE'"></image>
<image src="../../static/kaishi.png" mode="" v-else></image>
<view class="">
在线
</view>
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<view class="topitem" @tap="tapstatus('BE_BUSY')">
<image src="../../static/manglu2.png" mode="" v-if="Personallist.workStatus=='BE_BUSY'"></image>
<image src="../../static/manglu.png" mode="" v-else></image>
<view class="">
忙碌
</view>
2023-03-28 10:02:47 +08:00
</view>
2023-04-03 14:55:17 +08:00
<view class="topitem" @tap="tapstatus('OFFLINE')">
<image src="../../static/lixian2.png" mode="" v-if="Personallist.workStatus=='OFFLINE'"></image>
<image src="../../static/lixian.png" mode="" v-else></image>
<view class="">
离线
</view>
2023-03-28 10:02:47 +08:00
</view>
</view>
2023-04-03 14:55:17 +08:00
<view class="bottomitems">
<view class="bottomitem" @tap='goMyBenefits'>
<image src="../../static/shouyi.png" mode=""></image>
<view class="">
我的收益
</view>
</view>
2023-04-24 14:06:37 +08:00
<view class="bottomitem" @tap='goOrderlist'>
2023-04-03 14:55:17 +08:00
<image src="../../static/xuexi.png" mode=""></image>
<view class="">
我的学习
</view>
2023-03-28 10:02:47 +08:00
</view>
2023-04-10 16:48:17 +08:00
<view class="bottomitem" @tap='gostudy'>
2023-04-03 14:55:17 +08:00
<image src="../../static/kaoshi.png" mode=""></image>
<view class="">
我的考试
</view>
2023-03-28 10:02:47 +08:00
</view>
2023-04-11 10:44:37 +08:00
<view class="bottomitem" @tap='goremove'>
2023-04-03 14:55:17 +08:00
<image src="../../static/shezhi.png" mode=""></image>
<view class="">
2023-04-11 10:44:37 +08:00
退出账号
2023-04-03 14:55:17 +08:00
</view>
</view>
</view>
2023-03-28 10:02:47 +08:00
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
2023-04-03 14:55:17 +08:00
nurseAppletPersonCenter,
updateNursePersonWorkStatus
2023-03-28 10:02:47 +08:00
} from '@/api/personnal/personal.js';
import baseurl from '@/api/baseurl.js'
export default {
data() {
return {
2023-04-10 16:40:18 +08:00
phone: null,
2023-04-03 14:55:17 +08:00
beijingurl: null, //背景
2023-04-04 17:14:06 +08:00
nursePersonId: null, //护理员id
2023-04-03 14:55:17 +08:00
baseurl: null, //url
Personallist: null, //获取个人信息
2023-04-10 16:31:11 +08:00
personRoleLoginFlag: null,
2023-03-28 10:02:47 +08:00
}
},
onShow() {
2023-04-11 14:04:50 +08:00
this.Personallist = null
2023-04-03 14:55:17 +08:00
this.beijingurl = baseurl + '/profile/nursePersonAppletPicture/person_center.png'
2023-03-28 10:02:47 +08:00
this.baseurl = baseurl;
let that = this
2023-04-10 16:31:11 +08:00
this.personRoleLoginFlag = uni.getStorageSync('personRoleLoginFlag');
2023-04-11 14:25:57 +08:00
if (this.personRoleLoginFlag == 'nursePersonRole' || this.personRoleLoginFlag == 'wholeRole') {
2023-04-10 16:31:11 +08:00
const value = uni.getStorageSync('nursePersonId');
if (value) {
that.nursePersonId = value
that.myInfo()
} else {}
2023-04-10 16:40:18 +08:00
}
const phone = uni.getStorageSync('phone');
if (phone) {
that.phone = phone
} else {}
2023-03-28 10:02:47 +08:00
},
onLoad(options) {},
methods: {
2023-04-03 14:55:17 +08:00
//点击状态
tapstatus(item) {
2023-04-11 14:25:57 +08:00
if (this.personRoleLoginFlag == 'nursePersonRole' || this.personRoleLoginFlag == 'wholeRole') {
2023-04-10 16:31:11 +08:00
const value = uni.getStorageSync('nursePersonId');
if (value) {
var obj = {
id: this.nursePersonId,
workStatus: item
2023-04-04 17:14:06 +08:00
}
2023-04-10 16:31:11 +08:00
updateNursePersonWorkStatus(obj).then(res => {
if (res.code == 200) {
this.myInfo()
}
})
} else {
this.gologin();
}
2023-04-04 17:14:06 +08:00
}
2023-03-28 10:02:47 +08:00
},
myInfo() {
2023-04-03 14:55:17 +08:00
nurseAppletPersonCenter(this.nursePersonId).then(res => {
2023-03-28 10:02:47 +08:00
if (res.code == 200) {
2023-04-03 14:55:17 +08:00
this.Personallist = res.data
2023-03-28 10:02:47 +08:00
}
})
},
2023-04-03 14:55:17 +08:00
//跳登录
gologin() {
uni.navigateTo({
url: '/pages/login/login'
})
},
//跳修改
goModifyinformation() {
uni.navigateTo({
url: '/pages/Modifyinformation/Modifyinformation'
})
},
2023-04-10 16:48:17 +08:00
//我的学习
2023-04-24 14:06:37 +08:00
goOrderlist() {
2023-04-26 14:38:43 +08:00
const personRoleLoginFlag = uni.getStorageSync('personRoleLoginFlag');
if (personRoleLoginFlag) {
uni.navigateTo({
url: '/pages/Orderlist/Orderlist'
})
} else {
this.gologin();
}
2023-04-21 17:08:47 +08:00
},
//敬请期待
2023-04-10 16:48:17 +08:00
gostudy() {
uni.navigateTo({
url: '/pages/study/study'
})
},
2023-04-03 14:55:17 +08:00
//我的收益
goMyBenefits() {
2023-04-11 10:47:03 +08:00
const personRoleLoginFlag = uni.getStorageSync('personRoleLoginFlag');
if (personRoleLoginFlag) {
uni.navigateTo({
url: '/pages/MyBenefits/MyBenefits'
})
} else {
this.gologin();
2023-04-04 17:14:06 +08:00
}
},
2023-04-11 10:44:37 +08:00
//退出账号
goremove() {
let that = this
2023-04-11 16:15:14 +08:00
const value = uni.getStorageSync('personRoleLoginFlag');
2023-04-11 10:44:37 +08:00
if (value) {
uni.showModal({
title: '提示',
content: '确认要退出此账号吗',
success: function(res) {
if (res.confirm) {
uni.removeStorageSync('nursePersonId');
uni.removeStorageSync('personRoleLoginFlag');
2023-04-11 14:27:44 +08:00
uni.removeStorageSync('phone');
2023-04-27 11:09:27 +08:00
uni.removeStorageSync('openid');
uni.removeStorageSync('nursePersonName');
uni.removeStorageSync('nurseStationId');
2023-04-11 14:33:39 +08:00
that.Personallist = null
2023-04-13 15:46:26 +08:00
that.nursePersonId = null
2023-04-11 14:37:15 +08:00
that.personRoleLoginFlag = null
2023-04-11 10:44:37 +08:00
that.$refs.uToast.show({
title: '退出账号成功',
type: 'success',
duration: '1000'
})
if (that.timer) {
clearTimeout(that.timer)
}
2023-04-13 11:23:41 +08:00
that.timer = setTimeout(e => {
uni.switchTab({
url: '/pages/homepage/homepage'
})
}, 1000)
2023-04-11 10:44:37 +08:00
}
}
});
} else {
that.$refs.uToast.show({
title: '您未登录',
type: 'error',
duration: '1000'
})
}
},
2023-03-28 10:02:47 +08:00
}
}
</script>
<style lang="scss">
2023-04-03 14:55:17 +08:00
page {
background-color: #fff;
}
2023-03-28 10:02:47 +08:00
.app {
padding: 0;
font-size: 32rpx;
height: 100vh;
2023-04-03 14:55:17 +08:00
.bottomitems {
width: 100%;
margin-top: 30rpx;
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.bottomitem {
width: 85%;
margin: 0 auto;
height: 120rpx;
position: relative;
border-bottom: 1rpx solid #F3F3F3;
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
view {
display: inline-block;
font-size: 35rpx;
color: #333333;
line-height: 120rpx;
margin-left: 80rpx;
}
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
image {
position: absolute;
top: 50%;
transform: translateY(-50%);
display: inline-block;
width: 50rpx;
height: 50rpx;
}
2023-03-28 10:02:47 +08:00
}
}
2023-04-03 14:55:17 +08:00
.topitems {
z-index: 999;
padding: 45rpx 0 35rpx;
width: 94%;
margin: 0 auto;
display: flex;
background: #FFFFFF;
box-shadow: 0rpx 3rpx 18rpx 0rpx rgba(79, 108, 254, 0.43);
border-radius: 5rpx;
justify-content: space-around;
text-align: center;
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
.topitem {
view {
font-size: 32rpx;
margin-top: 10rpx;
}
2023-03-28 10:02:47 +08:00
2023-04-03 14:55:17 +08:00
image {
width: 90rpx;
height: 90rpx;
2023-03-28 10:02:47 +08:00
}
}
}
.user {
width: 100%;
2023-04-03 14:55:17 +08:00
height: 400rpx;
2023-03-28 10:02:47 +08:00
position: relative;
color: #FFFFFF;
2023-04-03 14:55:17 +08:00
font-size: 38rpx;
2023-03-28 10:02:47 +08:00
.modify {
position: absolute;
right: 3%;
2023-04-03 14:55:17 +08:00
top: 250rpx;
font-size: 28rpx;
image {
width: 23rpx;
height: 23rpx;
padding-left: 10rpx;
}
}
.login {
text-align: center;
position: absolute;
top: 220rpx;
left: 35%;
font-size: 36rpx;
width: 180rpx;
line-height: 70rpx;
border: 1rpx solid #fff;
height: 70rpx;
border-radius: 20rpx;
2023-03-28 10:02:47 +08:00
}
.nickname {
position: absolute;
2023-04-03 14:55:17 +08:00
top: 300rpx;
left: 35%;
font-size: 28rpx;
2023-03-28 10:02:47 +08:00
}
.phone {
position: absolute;
2023-04-03 14:55:17 +08:00
top: 180rpx;
left: 35%;
2023-03-28 10:02:47 +08:00
}
.img {
2023-04-03 14:55:17 +08:00
width: 160rpx;
height: 160rpx;
border-radius: 50%;
background: #F6F6F6;
2023-03-28 10:02:47 +08:00
position: absolute;
2023-04-03 14:55:17 +08:00
top: 170rpx;
left: 8%;
2023-04-11 17:12:18 +08:00
// border: 4rpx solid #6DD8FC;
2023-03-28 10:02:47 +08:00
}
}
2023-04-03 14:55:17 +08:00
.circular {
z-index: -1;
width: 100%;
height: 500rpx;
position: absolute;
top: 0;
}
2023-03-28 10:02:47 +08:00
}
</style>