xinelu-applet-ui/pages/homepage/homepage.vue

284 lines
6.3 KiB
Vue
Raw Normal View History

2023-09-19 14:58:40 +08:00
<template>
2023-09-27 13:50:42 +08:00
<view class="app">
<view class="content">
<image src="/static/pageC/homepage.png" mode=""></image>
2023-10-23 16:51:32 +08:00
<view class="loginmount" @tap="city">
<!-- <image src="/static/pageC/TAB.png" mode=""></image> -->
<image src="../../static/pages/address.png" mode=""></image>
<text v-if="address">
{{address}}
</text>
<text v-else>
请选择城市
</text>
2023-09-27 13:50:42 +08:00
</view>
2023-10-23 16:51:32 +08:00
<!-- <view class="address" @tap="city">
2023-10-23 13:59:25 +08:00
<image src="../../static/pages/address.png" mode=""></image>
<text v-if="address">
{{address}}
</text>
<text v-else>
请选择城市
</text>
2023-10-23 16:51:32 +08:00
</view> -->
2023-09-27 13:50:42 +08:00
</view>
<view class="contentcenter">
2023-10-07 14:23:55 +08:00
<view class="home" @tap="goonline">
2023-09-27 13:50:42 +08:00
<image src="/static/pageC/qianyue.png" mode=""></image>
2023-09-27 14:05:46 +08:00
<view class="name">
2023-09-27 13:50:42 +08:00
家医签约
</view>
</view>
2023-09-28 10:11:05 +08:00
<view class="home" @tap="goHealthrecords">
2023-09-27 13:50:42 +08:00
<image src="/static/pageC/health.png" mode=""></image>
2023-09-27 14:05:46 +08:00
<view class="name">
2023-09-27 13:50:42 +08:00
健康档案
</view>
</view>
2023-09-28 10:11:05 +08:00
<view class="home" @tap="goappoint">
2023-09-27 14:24:06 +08:00
<image src="/static/pageC/serveappoint.png" mode=""></image>
2023-09-27 14:05:46 +08:00
<view class="name">
2023-09-27 13:50:42 +08:00
服务预约
</view>
</view>
2023-10-10 13:21:23 +08:00
<view class="home" @tap="count">
2023-09-27 13:50:42 +08:00
<image src="/static/pageC/exchange.png" mode=""></image>
2023-09-27 14:05:46 +08:00
<view class="name">
2023-09-27 13:50:42 +08:00
积分兑换
</view>
</view>
2023-10-07 11:08:50 +08:00
<view class="home" @tap="myappointment">
2023-09-27 13:50:42 +08:00
<image src="/static/pageC/appointmen.png" mode=""></image>
2023-09-27 14:05:46 +08:00
<view class="name">
2023-09-27 13:50:42 +08:00
我的预约
</view>
</view>
2023-10-07 11:08:50 +08:00
<view class="home" @tap="servicerecord">
2023-09-27 13:50:42 +08:00
<image src="/static/pageC/SERVERECOD.png" mode=""></image>
2023-09-27 14:05:46 +08:00
<view class="name">
2023-09-27 13:50:42 +08:00
服务记录
</view>
</view>
</view>
<view class="contentbottom">
<view class="health">
健康管理
</view>
<view class="item">
2023-10-08 13:19:49 +08:00
<view class="signmyself" @tap="sign">
2023-09-27 13:50:42 +08:00
<image src="/static/pageC/tizheng.png" mode=""></image>
</view>
<view class="sign">
2023-10-08 17:03:35 +08:00
<image @tap="healthtest" src="/static/pageC/healthmyself.png" mode=""></image>
2023-09-28 10:11:05 +08:00
<image @tap="gorecords" src="/static/pageC/records.png" mode=""></image>
2023-09-27 13:50:42 +08:00
</view>
</view>
2023-09-19 14:58:40 +08:00
</view>
2023-10-10 15:28:21 +08:00
<u-toast ref="uToast" />
2023-09-19 14:58:40 +08:00
</view>
</template>
<script>
2023-09-28 16:55:50 +08:00
import {
getOpenId,
2023-10-10 13:21:23 +08:00
getCurrentUser,
2023-10-12 10:40:40 +08:00
detail,
checkSignApply
2023-09-28 16:55:50 +08:00
} from '@/api/pages/homepage/homepage.js'
2023-09-19 14:58:40 +08:00
export default {
data() {
return {
2023-10-10 15:28:21 +08:00
patientName: '',
2023-10-16 11:54:32 +08:00
userinfo: null,
2023-10-10 15:28:21 +08:00
region: '',
2023-10-12 10:40:40 +08:00
checkSign: null,
2023-10-23 13:59:25 +08:00
address: '',
2023-09-19 14:58:40 +08:00
}
},
onLoad() {
2023-10-10 13:21:23 +08:00
// this.login()
},
onShow() {
2023-10-23 13:59:25 +08:00
this.address = uni.getStorageSync('location')
2023-10-23 16:38:05 +08:00
console.log(this.address, '000')
2023-10-23 13:59:25 +08:00
if (this.address == '德州市') {
uni.setStorageSync("region", 1)
} else if (this.address == '东营市') {
uni.setStorageSync("region", 2)
2023-10-23 16:38:05 +08:00
} else if (this.address == '济南市') {
2023-10-23 17:10:11 +08:00
uni.setStorageSync("region", 1)
2023-10-23 13:59:25 +08:00
}
2023-10-10 15:28:21 +08:00
this.userinfo = uni.getStorageSync('userinfo');
2023-10-23 17:10:11 +08:00
if (this.userinfo) {
2023-10-18 10:56:01 +08:00
this.patientName = this.userinfo.patientName
2023-10-16 11:54:32 +08:00
checkSignApply(this.userinfo.cardNo).then(res => {
2023-10-17 09:41:12 +08:00
if (res.data.code != 0) {
2023-10-12 10:40:40 +08:00
this.checkSign = true
2023-10-12 10:46:44 +08:00
} else {
this.checkSign = false
2023-10-12 10:40:40 +08:00
}
2023-10-10 15:28:21 +08:00
})
2023-10-23 16:38:05 +08:00
} else {
this.patientName = ''
2023-10-19 15:49:55 +08:00
2023-10-10 13:21:23 +08:00
}
2023-09-19 14:58:40 +08:00
},
methods: {
2023-10-23 13:59:25 +08:00
city() {
uni.navigateTo({
url: '/pages/location/location'
})
},
2023-10-10 13:21:23 +08:00
// 登录
2023-10-10 15:28:21 +08:00
login() {
2023-10-12 10:40:40 +08:00
uni.navigateTo({
url: "/pages/login/login"
})
2023-10-10 13:21:23 +08:00
},
gologin() {
2023-10-12 10:46:44 +08:00
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
url: '/pages/login/login'
})
2023-10-07 14:23:55 +08:00
},
2023-10-12 10:46:44 +08:00
// 家医签约
goonline() {
2023-10-16 09:19:16 +08:00
if (!this.userinfo) {
this.gologin();
} else {
if (!this.checkSign) {
this.$refs.uToast.show({
title: '未签约,请先签约',
type: 'error',
duration: '1000',
url: "/pagesC/Onlinesigning/Onlinesigning"
})
} else {
uni.navigateTo({
url: "/pagesB/mysigning/mysigning"
})
}
}
2023-10-10 13:21:23 +08:00
},
// 积分兑换
2023-10-10 15:28:21 +08:00
count() {
2023-10-16 11:54:32 +08:00
if (!this.userinfo) {
this.gologin();
} else {
if (!this.checkSign) {
this.$refs.uToast.show({
title: '未签约,请先签约',
type: 'error',
duration: '1000',
url: "/pagesC/Onlinesigning/Onlinesigning"
})
} else {
uni.navigateTo({
url: '/pagesB/Behaviorpoints/Behaviorpoints'
})
}
}
2023-10-10 13:21:23 +08:00
},
// 健康档案
goHealthrecords() {
2023-10-12 10:46:44 +08:00
if (!this.userinfo) {
this.gologin();
} else {
uni.navigateTo({
url: "/pagesC/Healthrecords/Healthrecords"
})
}
2023-10-10 13:21:23 +08:00
},
// 筛查记录
2023-09-28 10:11:05 +08:00
gorecords() {
2023-10-17 16:20:03 +08:00
uni.navigateTo({
url: "/pagesC/Screeningrecords/Screeningrecords"
})
// if (!this.userinfo) {
// this.gologin();
// } else {
// uni.navigateTo({
// url: "/pagesC/Screeningrecords/Screeningrecords"
// })
// }
2023-09-28 10:11:05 +08:00
},
2023-10-07 15:14:34 +08:00
// 健康自评
healthtest() {
2023-10-12 10:46:44 +08:00
if (!this.userinfo) {
this.gologin();
} else {
uni.navigateTo({
url: "/pagesC/healthtest/healthtest"
})
}
2023-10-07 15:14:34 +08:00
},
2023-10-08 13:19:49 +08:00
// 体征检测
2023-10-08 17:03:35 +08:00
sign() {
2023-10-19 15:49:55 +08:00
uni.navigateTo({
url: "/pagesC/Physicalexamination/Physicalexamination"
})
// if (!this.userinfo) {
// this.gologin();
// } else {
// uni.navigateTo({
// url: "/pagesC/Physicalexamination/Physicalexamination"
// })
// }
2023-09-27 16:26:09 +08:00
},
2023-10-12 10:40:40 +08:00
// 服务预约
goappoint() {
2023-10-12 10:46:44 +08:00
if (!this.userinfo) {
this.gologin();
2023-10-10 15:28:21 +08:00
} else {
2023-10-12 10:46:44 +08:00
if (!this.checkSign) {
this.$refs.uToast.show({
title: '未签约,请先签约',
type: 'error',
duration: '1000',
url: "/pagesC/Onlinesigning/Onlinesigning"
})
} else {
uni.navigateTo({
url: "/pagesC/ServiceAppointment/ServiceAppointment"
})
}
2023-10-10 13:21:23 +08:00
}
2023-10-07 11:08:50 +08:00
},
2023-10-12 10:40:40 +08:00
// 服务记录
servicerecord() {
2023-10-12 10:46:44 +08:00
if (!this.userinfo) {
this.gologin();
} else {
uni.navigateTo({
url: "/pagesC/servicerecord/servicerecord"
})
}
2023-10-12 10:40:40 +08:00
},
2023-10-07 11:08:50 +08:00
// 我的预约
2023-10-08 17:03:35 +08:00
myappointment() {
2023-10-12 10:46:44 +08:00
if (!this.userinfo) {
this.gologin();
2023-10-10 15:28:21 +08:00
} else {
2023-10-12 10:46:44 +08:00
if (!this.checkSign) {
this.$refs.uToast.show({
title: '未签约,请先签约',
type: 'error',
duration: '1000',
url: "/pagesC/Onlinesigning/Onlinesigning"
})
} else {
uni.navigateTo({
url: "/pagesC/Myappointment/Myappointment"
})
}
2023-10-10 13:21:23 +08:00
}
2023-10-07 11:08:50 +08:00
},
2023-09-19 14:58:40 +08:00
}
}
</script>
2023-09-27 13:50:42 +08:00
<style lang="scss">
@import "./homepage.scss";
2023-10-23 16:38:05 +08:00
</style>