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

288 lines
7.3 KiB
Vue
Raw Normal View History

2023-09-20 10:42:44 +08:00
<template>
2023-09-22 11:30:57 +08:00
<view class="app">
2023-09-26 14:56:42 +08:00
<view class="address">
2023-11-07 13:54:06 +08:00
<!-- <image src="../../static/pages/address.png" mode=""></image>
2023-09-26 14:56:42 +08:00
<text>
2023-10-16 11:54:32 +08:00
{{location?location:''}}
2023-10-23 16:51:32 +08:00
</text> -->
2023-09-22 11:30:57 +08:00
</view>
2023-09-26 14:56:42 +08:00
<view class="topbar">
2024-01-03 17:03:57 +08:00
<image mode="" :src="require('@/pagesB/images/wenzhenpingtai.png')" @tap="goconsultationplatform"></image>
<image mode="" :src="require('@/pagesB/images/hulifuwu.png')" @tap="gosite"></image>
2023-09-22 11:30:57 +08:00
</view>
2023-09-26 15:27:19 +08:00
<view class="title">
常用服务
</view>
<view class="centerbar topbar">
2024-01-03 17:03:57 +08:00
<image mode="" :src="require('@/pagesB/images/yuyueshaicha.png')" @tap="goAppointmentscreening"></image>
<image mode="" :src="require('@/pagesB/images/shaichajieguo.png')" @tap="result"></image>
<image mode="" :src="require('@/pagesB/images/jiankangshangcheng.png')" @tap="goshopping"></image>
<image mode="" :src="require('@/pagesB/images/xinrenfuli.png')" @tap="gomaterialbenefits"></image>
2023-09-26 15:27:19 +08:00
</view>
<view class="title">
2023-11-14 10:26:10 +08:00
<text>健康资讯</text>
2023-09-26 15:39:25 +08:00
<view class="" @tap='gohealth'>
2023-09-26 15:27:19 +08:00
<text>
查看更多
</text>
<image src="../../static/huijiantou.png" mode=""></image>
</view>
</view>
<view class="list">
2023-09-26 15:39:25 +08:00
<view class="item" v-for="(item,index) in informationCategoryVOList" :key="index" @tap='gohealthitem(item)'>
2023-09-26 15:27:19 +08:00
<view class="text">
2023-09-26 15:39:25 +08:00
{{item.informationTitle}}
2023-09-26 15:27:19 +08:00
</view>
<view class="author"></view>
2023-09-26 15:39:25 +08:00
<image :src="item.leadThumbnailUrl" mode=""></image>
2023-09-26 15:27:19 +08:00
</view>
</view>
2023-11-09 15:55:25 +08:00
<u-toast ref="uToast" />
2023-09-20 10:42:44 +08:00
</view>
</template>
<script>
2023-09-26 15:39:25 +08:00
import {
mapActions
} from "vuex";
import {
2023-10-10 14:01:25 +08:00
getPoserInfoListByType,
getScreening
2023-09-26 15:39:25 +08:00
} from '@/api/pages/medicalservice/index.js'
import {
getHeathHousingList
} from '@/api/pagesB/Healthknowledge/index.js'
import baseurl from '../../api/baseurl';
2023-09-20 10:42:44 +08:00
export default {
data() {
return {
2023-09-26 15:39:25 +08:00
pageNum: 1,
pageSize: 5,
informationCategoryVOList: [], //咨询信息
2023-10-12 11:24:37 +08:00
patientId: '',
userInfo: null,
2023-10-16 11:54:32 +08:00
location: null,
2024-02-20 10:49:16 +08:00
cardNo: null,
2023-09-20 10:42:44 +08:00
};
2023-09-26 15:39:25 +08:00
},
onShow() {
this.pageNum = 1
2023-10-12 11:24:37 +08:00
this.patientId = uni.getStorageSync('patientId');
this.userInfo = uni.getStorageSync('userinfo')
2024-02-20 10:49:16 +08:00
this.cardNo = this.userInfo.cardNo
2023-10-16 11:54:32 +08:00
this.location = uni.getStorageSync('location')
2023-09-26 15:39:25 +08:00
this.getHeathHousing();
},
methods: {
2023-11-15 14:14:12 +08:00
// 第一种 直接映射
...mapActions(["openPopup"]),
2023-10-12 11:24:37 +08:00
goAppointmentscreening() {
2023-11-15 14:14:12 +08:00
this.openPopup();
setTimeout(e => {
// 筛查预约
if (!this.userInfo) {
uni.showModal({
title: "提示",
content: "您还未注册,是否去注册?",
confirmText: '是',
cancelText: '否',
success(res) {
if (res.confirm) {
uni.redirectTo({
2024-02-03 11:23:04 +08:00
url: "/pagesB/register/register"
2023-11-15 14:14:12 +08:00
})
} else {
wx.exitMiniProgram()
}
},
})
} else {
2024-02-05 11:27:19 +08:00
getScreening(this.cardNo).then(res => {
2023-11-15 14:14:12 +08:00
if (res.code == 200) {
let userinfo = JSON.stringify(this.userInfo)
if (!res.data || res.data == null) {
uni.navigateTo({
url: `/pagesB/screenorder/screenorder?userinfo=${userinfo}`
})
} else {
uni.navigateTo({
url: `/pagesB/orderlist/orderlist?userinfo=${userinfo}`
})
}
2023-11-15 10:47:50 +08:00
}
2023-11-15 14:14:12 +08:00
})
}
}, 0)
2023-10-08 16:16:18 +08:00
},
2023-09-26 15:39:25 +08:00
//跳转健康常识item
gohealthitem(item) {
2023-11-09 15:55:25 +08:00
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: `/pagesB/Healthitem/Healthitem?item=${encodeURIComponent(JSON.stringify(item))}`
})
} else {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
2024-02-03 11:23:04 +08:00
url: '/pagesB/login/login'
2023-11-09 15:55:25 +08:00
})
}
2023-09-26 15:39:25 +08:00
},
// 健康常识
getHeathHousing() {
getHeathHousingList(this.pageNum, this.pageSize).then(res => {
if (res.rows) {
res.rows.forEach(e => {
2023-10-16 11:54:32 +08:00
e.leadThumbnailUrl = baseurl + e.leadThumbnailUrl
2023-09-26 15:39:25 +08:00
})
}
this.informationCategoryVOList = res.rows
})
},
//新人福利
gomaterialbenefits() {
// 第二种引入
// this.$store.dispatch("openPopup");
2023-10-09 10:40:10 +08:00
// this.openPopup();
2023-09-26 15:39:25 +08:00
setTimeout(e => {
2023-11-09 15:55:25 +08:00
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/materialbenefits/materialbenefits'
})
} else {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
2024-02-03 11:23:04 +08:00
url: '/pagesB/login/login'
2023-11-09 15:55:25 +08:00
})
}
2023-09-26 15:39:25 +08:00
}, 0)
},
//跳转护理站页面
gosite() {
2023-10-09 10:40:10 +08:00
// this.openPopup();
2023-09-26 15:39:25 +08:00
setTimeout(e => {
2023-11-09 15:55:25 +08:00
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/site/site'
})
} else {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
2024-02-03 11:23:04 +08:00
url: '/pagesB/login/login'
2023-11-09 15:55:25 +08:00
})
}
2023-09-26 15:39:25 +08:00
}, 0)
},
//健康常识
gohealth() {
2023-11-09 15:55:25 +08:00
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/Healthknowledge/Healthknowledge'
})
} else {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
2024-02-03 11:23:04 +08:00
url: '/pagesB/login/login'
2023-11-09 15:55:25 +08:00
})
}
2023-10-08 14:48:39 +08:00
},
// 筛查结果
2023-10-12 11:24:37 +08:00
result() {
2023-11-15 14:14:12 +08:00
this.openPopup();
setTimeout(e => {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/SelectItem/SelectItem'
})
} else {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
2024-02-03 11:23:04 +08:00
url: '/pagesB/login/login'
2023-11-15 14:14:12 +08:00
})
}
}, 50)
2023-09-26 15:39:25 +08:00
},
//跳转商城
goshopping() {
setTimeout(e => {
2023-11-09 15:55:25 +08:00
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/shopping/shopping'
})
} else {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
2024-02-03 11:23:04 +08:00
url: '/pagesB/login/login'
2023-11-09 15:55:25 +08:00
})
}
2023-09-26 15:39:25 +08:00
}, 0)
},
2023-09-26 16:42:18 +08:00
//问诊平台
goconsultationplatform() {
2023-11-15 14:14:12 +08:00
this.openPopup();
setTimeout(e => {
const value = uni.getStorageSync('openid');
const value2 = uni.getStorageSync('patientId');
if (value && value2) {
uni.navigateTo({
url: '/pagesB/consultationplatform/consultationplatform',
})
} else {
this.$refs.uToast.show({
title: '您未登录,请先登录',
type: 'error',
duration: '1000',
2024-02-03 11:23:04 +08:00
url: '/pagesB/login/login'
2023-11-15 14:14:12 +08:00
})
}
}, 0)
2023-09-26 16:42:18 +08:00
},
2023-09-26 15:39:25 +08:00
},
//1.分享给朋友
onShareAppMessage(res) {
let pages = getCurrentPages();
let url = pages[pages.length - 1].$page.fullPath
return {
title: '新医路健康服务平台',
path: url,
}
},
//2.分享到朋友圈
onShareTimeline(res) {
let pages = getCurrentPages();
let url = pages[pages.length - 1].$page.fullPath
return {
title: '新医路健康服务平台',
path: url,
}
},
2023-09-20 10:42:44 +08:00
}
</script>
2023-09-26 14:56:42 +08:00
2023-09-20 10:42:44 +08:00
<style lang="scss">
2023-09-26 15:27:19 +08:00
@import "./medicalservice.scss";
2023-11-15 14:14:12 +08:00
</style>