This commit is contained in:
曹辉 2023-04-10 16:31:11 +08:00
parent dd3cb07fc3
commit 021551d3b6
2 changed files with 44 additions and 28 deletions

View File

@ -42,7 +42,9 @@
login() { login() {
getPersonWeChatUserInfo(this.logincode, this.phonecode).then(res => { getPersonWeChatUserInfo(this.logincode, this.phonecode).then(res => {
if (res.code == 200) { if (res.code == 200) {
uni.setStorageSync("nursePersonId", res.data.nurseStationPersonId) if (res.data.personRoleLoginFlag == 'nursePersonRole') {
uni.setStorageSync("nursePersonId", res.data.nurseStationPersonId)
}
uni.setStorageSync("personRoleLoginFlag", res.data.personRoleLoginFlag) uni.setStorageSync("personRoleLoginFlag", res.data.personRoleLoginFlag)
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '登录成功', title: '登录成功',

View File

@ -1,7 +1,7 @@
<template> <template>
<view class="app"> <view class="app">
<image class="circular" :src="beijingurl" mode=""></image> <image class="circular" :src="beijingurl" mode=""></image>
<view class="user" v-if="Personallist"> <view class="user" v-if="Personallist&&personRoleLoginFlag == 'nursePersonRole'">
<image class="img" :src="baseurl+Personallist.avatar" mode=""></image> <image class="img" :src="baseurl+Personallist.avatar" mode=""></image>
<view class="phone" v-if="Personallist.nursePersonName"> <view class="phone" v-if="Personallist.nursePersonName">
{{Personallist.nursePersonName}} {{Personallist.nursePersonName}}
@ -10,14 +10,20 @@
{{Personallist.phone}} {{Personallist.phone}}
</view> </view>
<view class="nickname" v-if="Personallist.evaluateStarCount>=0"> <view class="nickname" v-if="Personallist.evaluateStarCount>=0">
<u-rate :count="5" v-model="Personallist.evaluateStarCount" disabled active-color='#F4EA2A'></u-rate> <u-rate :count="5" v-model="Personallist.evaluateStarCount" disabled active-color='#F4EA2A'>
</u-rate>
</view> </view>
<view class="modify" @tap='goModifyinformation'> <view class="modify" @tap='goModifyinformation'>
<image src="../../static/xg.png" mode="" style="padding-right: 15rpx;"></image> <image src="../../static/xg.png" mode="" style="padding-right: 15rpx;"></image>
修改信息 修改信息
</view> </view>
</view> </view>
<view class="user" v-else> <view class="user" v-if="personRoleLoginFlag == 'stationRole'">
<view class="phone">
暂无
</view>
</view>
<view class="user" v-if="!Personallist&&!personRoleLoginFlag">
<image class="img" src="../../static/user.png" mode=""></image> <image class="img" src="../../static/user.png" mode=""></image>
<view class="login" @tap='gologin'> <view class="login" @tap='gologin'>
登录 登录
@ -89,35 +95,41 @@
nursePersonId: null, //id nursePersonId: null, //id
baseurl: null, //url baseurl: null, //url
Personallist: null, // Personallist: null, //
personRoleLoginFlag: null,
} }
}, },
onShow() { onShow() {
this.beijingurl = baseurl + '/profile/nursePersonAppletPicture/person_center.png' this.beijingurl = baseurl + '/profile/nursePersonAppletPicture/person_center.png'
this.baseurl = baseurl; this.baseurl = baseurl;
let that = this let that = this
const value = uni.getStorageSync('nursePersonId'); this.personRoleLoginFlag = uni.getStorageSync('personRoleLoginFlag');
if (value) { if (this.personRoleLoginFlag == 'nursePersonRole') {
that.nursePersonId = value const value = uni.getStorageSync('nursePersonId');
that.myInfo() if (value) {
} else {} that.nursePersonId = value
that.myInfo()
} else {}
} else if (this.personRoleLoginFlag == 'stationRole') {}
}, },
onLoad(options) {}, onLoad(options) {},
methods: { methods: {
// //
tapstatus(item) { tapstatus(item) {
const value = uni.getStorageSync('nursePersonId'); if (this.personRoleLoginFlag == 'nursePersonRole') {
if (value) { const value = uni.getStorageSync('nursePersonId');
var obj = { if (value) {
id: this.nursePersonId, var obj = {
workStatus: item id: this.nursePersonId,
} workStatus: item
updateNursePersonWorkStatus(obj).then(res => {
if (res.code == 200) {
this.myInfo()
} }
}) updateNursePersonWorkStatus(obj).then(res => {
} else { if (res.code == 200) {
this.gologin(); this.myInfo()
}
})
} else {
this.gologin();
}
} }
}, },
myInfo() { myInfo() {
@ -147,13 +159,15 @@
}, },
// //
goMyBenefits() { goMyBenefits() {
const value = uni.getStorageSync('nursePersonId'); if (this.personRoleLoginFlag == 'nursePersonRole') {
if (value) { const value = uni.getStorageSync('nursePersonId');
uni.navigateTo({ if (value) {
url: '/pages/MyBenefits/MyBenefits' uni.navigateTo({
}) url: '/pages/MyBenefits/MyBenefits'
} else { })
this.gologin(); } else {
this.gologin();
}
} }
}, },
} }