NurseStationApp/pages/Personal/Personal.vue

145 lines
2.9 KiB
Vue
Raw Normal View History

2022-10-12 16:54:34 +08:00
<template>
2022-10-13 16:02:25 +08:00
<view class="app">
<view class="cards">
2022-10-31 09:04:45 +08:00
<view class="item" style="background-color: #9E4DD0;" @tap='gouser'>
2022-10-13 16:02:25 +08:00
<image src="../../static/user.png" mode=""></image>
<view class="title">
个人信息
</view>
</view>
2022-11-01 16:26:34 +08:00
<view class=" item" style="background-color: #E1AE3C ;" @tap='goorder'>
2022-10-13 16:02:25 +08:00
<image src="../../static/dingdan.png" mode=""></image>
<view class="title">
我的订单
</view>
</view>
<view class="item">
</view>
2022-11-11 14:19:07 +08:00
<view class="item">
</view>
<view class="item">
</view>
2022-10-13 16:02:25 +08:00
</view>
2022-11-23 16:41:09 +08:00
<u-toast ref="uToast" />
2022-10-12 16:54:34 +08:00
</view>
</template>
<script>
2022-11-23 16:41:09 +08:00
import {
getExistPatientByPatientId
} from '@/api/startup/index.js'
2022-10-12 16:54:34 +08:00
export default {
data() {
2022-11-23 16:41:09 +08:00
return {
timer: null,
};
2022-10-13 16:02:25 +08:00
},
2022-10-31 09:04:45 +08:00
methods: {
2022-11-01 16:26:34 +08:00
goorder() {
2022-11-23 16:41:09 +08:00
const value = uni.getStorageSync('patientId');
var that = this
if (value) {
getExistPatientByPatientId(value).then(res => {
if (res.code == 200) {
if (res.msg == 'LOGIN') {
uni.navigateTo({
url: '/pages/order/order'
})
} else {
that.$refs.uToast.show({
title: '当前用户信息不存在,请重新登录',
type: 'error',
duration: '1500'
})
that.remove();
}
} else {
that.$refs.uToast.show({
title: '登录异常,请重新登录',
type: 'error',
duration: '1500'
})
that.remove();
}
})
} else {
that.remove();
that.$refs.uToast.show({
title: '请重新登录',
type: 'error',
duration: '1500'
})
}
},
remove() {
var that = this
uni.removeStorageSync('patientId');
uni.removeStorageSync('phone');
uni.removeStorageSync('password');
if (that.timer) {
clearTimeout(that.timer)
}
that.timer = setTimeout(e => {
uni.reLaunch({
url: '/pages/login/login'
})
}, 1500)
2022-11-01 16:26:34 +08:00
},
2022-10-31 09:04:45 +08:00
//跳转个人信息页面
2022-11-01 16:26:34 +08:00
gouser() {
2022-11-23 16:41:09 +08:00
const value = uni.getStorageSync('patientId');
var that = this
if (value) {
getExistPatientByPatientId(value).then(res => {
if (res.code == 200) {
if (res.msg == 'LOGIN') {
uni.navigateTo({
url: '/pages/user/user'
})
} else {
that.$refs.uToast.show({
title: '当前用户信息不存在,请重新登录',
type: 'error',
duration: '1500'
})
that.remove();
}
} else {
that.$refs.uToast.show({
title: '登录异常,请重新登录',
type: 'error',
duration: '1500'
})
that.remove();
}
})
} else {
that.$refs.uToast.show({
title: '请重新登录',
type: 'error',
duration: '1500'
})
that.remove();
}
2022-10-31 09:04:45 +08:00
},
},
2022-10-12 16:54:34 +08:00
}
</script>
<style lang="scss">
2022-10-13 16:02:25 +08:00
.app {
2022-11-01 16:26:34 +08:00
2022-10-13 16:02:25 +08:00
.cards {
2022-11-11 14:19:07 +08:00
padding: 22px 0 20px 0;
2022-10-13 16:02:25 +08:00
.item {
2022-11-01 16:26:34 +08:00
2022-10-13 16:02:25 +08:00
.title {
width: 80%;
top: 60%;
}
}
}
}
2022-10-12 16:54:34 +08:00
</style>