NurseStationApp/pages/user/user.vue

190 lines
4.7 KiB
Vue
Raw Normal View History

2022-10-24 16:30:14 +08:00
<template>
<view class="app">
<view class="user">
2022-11-09 16:38:05 +08:00
<view v-if="appPersonallist.headPictureUrl">
<image class="img" :src="baseurl+appPersonallist.headPictureUrl" mode=""></image>
2022-11-03 17:26:15 +08:00
</view>
<view class="img" v-else>
2022-10-24 16:30:14 +08:00
<image src="../../static/users.png" mode=""></image>
</view>
2022-11-03 17:26:15 +08:00
<view class="phone" v-if="appPersonallist.patientName!=null">
{{appPersonallist.patientName}}
2022-10-24 16:30:14 +08:00
</view>
<view class="nickname">
2022-11-03 17:26:15 +08:00
<!-- {{appPersonallist.phone}} -->
2022-10-24 16:30:14 +08:00
</view>
2022-11-01 14:54:09 +08:00
<view class="modify" @tap='updatainfo()'>
2022-10-24 16:30:14 +08:00
修改信息
<u-icon name="arrow-right" color="#ffffff" size="32"></u-icon>
</view>
</view>
<view class="information">
2022-11-03 17:26:15 +08:00
<view class="item" v-if="appPersonallist.patientName!=null">
2022-11-01 14:54:09 +08:00
姓名{{appPersonallist.patientName}}
2022-10-24 16:30:14 +08:00
</view>
2022-11-03 17:26:15 +08:00
<view class="item" v-else>
姓名
</view>
<view class="item" v-if="appPersonallist.phone!=null">
2022-11-01 14:54:09 +08:00
电话{{appPersonallist.phone}}
2022-10-24 16:30:14 +08:00
</view>
2022-11-03 17:26:15 +08:00
<view class="item" v-else>
电话
</view>
<view class="item" v-if="appPersonallist.cardNo!=null">
身份证{{appPersonallist.cardNo}}
</view>
<view class="item" v-else>
身份证
</view>
<view class="item" v-if="appPersonallist.streetName">
区域{{appPersonallist.regionName}}-{{appPersonallist.streetName}}
</view>
<view class="item" v-else>
区域
</view>
2022-11-14 11:24:55 +08:00
<view class="item" style="height:100%" v-if="appPersonallist.address">
2022-11-11 14:19:07 +08:00
地址:
{{appPersonallist.address}}
2022-10-24 16:30:14 +08:00
</view>
2022-11-14 11:24:55 +08:00
<view class="item" style="height:100%" v-else>
地址:
</view>
2022-11-11 14:19:07 +08:00
<!-- <view class="item" style="height:100%">
2022-11-03 17:26:15 +08:00
<view class="" style="display: inline-block;">
位置:
</view>
<view class="address" v-if="appPersonallist.homeLatitude&&appPersonallist.homeLongitude">
2022-11-09 16:38:05 +08:00
东经:{{appPersonallist.homeLongitude}}--北纬:{{ appPersonallist.homeLatitude}}
2022-11-03 17:26:15 +08:00
</view>
2022-11-11 14:19:07 +08:00
</view> -->
2022-11-03 17:26:15 +08:00
<view class="disease" style="border:none;">
<view class="" style="line-height: 110rpx;">
疾病类型:
</view>
<span style="padding-right: 15rpx;font-size: 32rpx;"
2022-11-01 14:54:09 +08:00
v-for="(item,index) in appPersonallist.patientDiseaseInfoList"
:key="index">{{item.diseaseName}}</span>
2022-10-24 16:30:14 +08:00
</view>
2022-11-11 14:19:07 +08:00
<view class="signout" @tap='remove'>
退出账号
</view>
2022-10-24 16:30:14 +08:00
</view>
2022-11-03 17:26:15 +08:00
<!-- <view class="External" style="margin: 200rpx auto 0;">
2022-10-24 16:30:14 +08:00
<view class="lefttext">
积分:
</view>
<view class="righttext">
2022-11-01 14:54:09 +08:00
{{appPersonallist.integral}}
2022-10-24 16:30:14 +08:00
</view>
<image src="../../static/jiantou.png" mode=""></image>
</view>
<view class="External">
<view class="lefttext">
健康档案
</view>
<view class="righttext">
</view>
<image src="../../static/jiantou.png" mode=""></image>
</view>
<view class="External">
<view class="lefttext">
我的设备
</view>
<view class="righttext">
</view>
<image src="../../static/jiantou.png" mode=""></image>
2022-11-03 17:26:15 +08:00
</view> -->
2022-11-11 17:23:23 +08:00
<u-toast ref="uToast" />
2022-10-24 16:30:14 +08:00
</view>
</template>
<script>
2022-11-01 14:54:09 +08:00
import {
appPersonal,
} from '@/api/user/user.js';
import baseurl from '@/api/baseurl.js'
2022-10-24 16:30:14 +08:00
export default {
data() {
return {
2022-11-03 17:26:15 +08:00
baseurl: '',
2022-11-01 14:54:09 +08:00
appPersonallist: [], //获取个人信息
2022-10-24 16:30:14 +08:00
}
2022-11-01 14:54:09 +08:00
},
2022-11-11 14:19:07 +08:00
onShow() {
2022-11-03 17:26:15 +08:00
this.baseurl = baseurl
2022-11-01 14:54:09 +08:00
this.myInfo()
},
2022-11-11 17:23:23 +08:00
onLoad(options) {}, //获取传值
2022-11-01 14:54:09 +08:00
methods: {
2022-11-11 14:19:07 +08:00
//退出
remove() {
2022-11-11 17:23:23 +08:00
let that = this
uni.showModal({
title: '提示',
content: '确认要退出此账号吗',
success: function(res) {
if (res.confirm) {
2022-11-14 11:24:55 +08:00
uni.removeStorageSync('patientId');
that.$refs.uToast.show({
title: '退出账号成功',
type: 'success',
duration: '1000'
})
setTimeout(e => {
uni.reLaunch({
url: '/pages/login/login'
})
}, 1000)
} else if (res.cancel) {
that.$refs.uToast.show({
title: '退出账号失败',
type: 'error',
duration: '1000'
})
}
2022-11-11 17:23:23 +08:00
}
});
2022-11-11 14:19:07 +08:00
},
2022-11-01 14:54:09 +08:00
//获取个人信息
myInfo() {
2022-11-03 17:26:15 +08:00
var that = this
2022-11-09 16:38:05 +08:00
try {
const value = uni.getStorageSync('patientId');
if (value) {
appPersonal(value).then(res => {
2022-11-03 17:26:15 +08:00
that.appPersonallist = res.data
})
}
2022-11-09 16:38:05 +08:00
} catch (e) {
// error
}
// uni.getStorage({
// key: 'patientId',
// success: function(res) {
// appPersonal(res.data).then(res => {
// that.appPersonallist = res.data
// })
// }
// });
2022-11-01 14:54:09 +08:00
},
updatainfo() {
2022-11-03 17:26:15 +08:00
uni.navigateTo({
url: `/pages/modify/modify?appPersonallist=${JSON.stringify(this.appPersonallist)}`
})
2022-10-24 16:30:14 +08:00
}
2022-11-09 16:38:05 +08:00
},
onBackPress(options) {
console.log(options)
// if (options.from === 'navigateBack') {
// return false;
// }
// this.back();
// return true;
},
2022-10-24 16:30:14 +08:00
}
2022-11-01 14:54:09 +08:00
</script>
<style lang="scss">
@import "./user.scss";
2022-10-24 16:30:14 +08:00
</style>