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) {
if (res.data.personRoleLoginFlag == 'nursePersonRole') {
uni.setStorageSync("nursePersonId", res.data.nurseStationPersonId) 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,22 +95,27 @@
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
this.personRoleLoginFlag = uni.getStorageSync('personRoleLoginFlag');
if (this.personRoleLoginFlag == 'nursePersonRole') {
const value = uni.getStorageSync('nursePersonId'); const value = uni.getStorageSync('nursePersonId');
if (value) { if (value) {
that.nursePersonId = value that.nursePersonId = value
that.myInfo() that.myInfo()
} else {} } else {}
} else if (this.personRoleLoginFlag == 'stationRole') {}
}, },
onLoad(options) {}, onLoad(options) {},
methods: { methods: {
// //
tapstatus(item) { tapstatus(item) {
if (this.personRoleLoginFlag == 'nursePersonRole') {
const value = uni.getStorageSync('nursePersonId'); const value = uni.getStorageSync('nursePersonId');
if (value) { if (value) {
var obj = { var obj = {
@ -119,6 +130,7 @@
} else { } else {
this.gologin(); this.gologin();
} }
}
}, },
myInfo() { myInfo() {
nurseAppletPersonCenter(this.nursePersonId).then(res => { nurseAppletPersonCenter(this.nursePersonId).then(res => {
@ -147,6 +159,7 @@
}, },
// //
goMyBenefits() { goMyBenefits() {
if (this.personRoleLoginFlag == 'nursePersonRole') {
const value = uni.getStorageSync('nursePersonId'); const value = uni.getStorageSync('nursePersonId');
if (value) { if (value) {
uni.navigateTo({ uni.navigateTo({
@ -155,6 +168,7 @@
} else { } else {
this.gologin(); this.gologin();
} }
}
}, },
} }
} }