You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

595 lines
16 KiB

2 years ago
<template>
1 year ago
<view class="index-page btPadding" v-if="pageShow">
2 years ago
<view class="header-wrapper flex">
<view class="left">
<view class="flex top PfScMedium">
<view class="ft50 over2">{{doctorInfo.doctor_info.doctor_name}}</view>
<view v-if="doctor_dept">
<view class="over2">{{doctor_dept}}</view>
2 years ago
</view>
2 years ago
</view>
<view class="bt over2" v-if="doctorInfo.doctor_info.doctor_desc">
{{doctorInfo.doctor_info.doctor_desc}}
2 years ago
</view>
</view>
<img class="right" :src="doctorInfo.doctor_info.avator" alt="" @click="enlargePicture(doctorInfo.doctor_info.avator)" v-if="doctorInfo.doctor_info.avator">
2 years ago
</view>
<view class="block desc-wrapper" v-if="doctorInfo.doctor_info.doctor_detail">
2 years ago
<view class="title-wrapper flex">
<view class="title">
医生简介
</view>
<img :src="cssUrl+'right_bg.png'" alt="">
</view>
4 months ago
<view class="con">
{{doctorInfo.doctor_info.doctor_detail}}
2 years ago
</view>
</view>
<view class="block hospital-wrapper" v-if="hospitals">
4 months ago
6 months ago
<view class="title-wrapper flex">
<view class="title">
出诊信息
</view>
<img :src="cssUrl+'right_bg.png'" alt="">
</view>
4 months ago
<view class="item" v-for="(item,key) in hospitals">
2 years ago
<view class="top flex">
<view class="left">
<view class="title flex">
<text class="over2 PfScMedium hospital_name">{{item.hospital_name}}</text>
2 years ago
</view>
<view class="date over2 over4" v-if="item.address">
{{item.address}}
2 years ago
</view>
</view>
<view class="right">
<view class="flex right-wrapper" style="justify-content:center;" v-if="item.hospital_pos">
6 months ago
<view class="" @click="toLocation(item)">
2 years ago
<img :src="cssUrl+'index_nav.svg'" alt="">
<view class="map-wrap">导航</view>
6 months ago
</view>
4 months ago
2 years ago
</view>
2 years ago
</view>
</view>
4 months ago
<view class="center">
出诊{{ item.workdate_desc }}
</view>
4 months ago
6 months ago
<uni-collapse ref="collapse" v-model="collapseValue[key]" @change="changeCollapse" class="notice-collapse" v-if="item.notice">
<uni-collapse-item title="就诊须知">
<view class=" content" >
<view class="text" v-html="item.notice"></view>
6 months ago
</view>
</uni-collapse-item>
</uni-collapse>
4 months ago
<view class="bot primary btn btn2" hover-class="hover" @click="toVisitors(item)" v-if="item.type==0">
6 months ago
预约看病
2 years ago
</view>
</view>
2 years ago
</view>
4 months ago
<view class="block visit-wrapper" v-if="recentAppoint && this.doctorInfo && !this.doctorInfo.is_all_card">
2 years ago
<view class="header flex">
<view class="title-wrapper flex booklist">
2 years ago
<view class="title">
6 months ago
最近就诊
2 years ago
</view>
<img :src="cssUrl+'right_bg.png'" alt="">
</view>
4 months ago
1 year ago
<view class="opt flex" @click="toPrebookList">
2 years ago
查看全部<img :src="cssUrl+'index_comback2.svg'" alt="">
</view>
</view>
2 years ago
</view>
4 months ago
<pre-book-list class="preg-books" :dataList="recentAppoint" :topnopadding="true" v-if="this.doctorInfo && !this.doctorInfo.is_all_card"></pre-book-list>
<tabbar current="1" leftButtonText="主页" v-if="!this.doctorInfo.is_all_card"></tabbar>
2 years ago
</view>
</template>
<script>
1 year ago
import tabbar from '@/components/tabbar.vue'
import preBookList from '@/components/preBookList.vue'
2 years ago
export default {
data() {
return {
6 months ago
collapseValue:[],
1 year ago
cssUrl:this.cssUrl,
code:'',
pageShow:false,
doctor_id:'',
doctorInfo:false,
doctor_dept:false,
hospitals:false,
recentAppoint:[],
10 months ago
loginToken:false,
state:'',
workdate:[],
2 years ago
}
},
components:{
1 year ago
tabbar,
preBookList,
},
1 year ago
onLoad(option) {
4 months ago
// define('DEPART_TYPE_FULL', 0); // 全功能
// define('DEPART_TYPE_COUNT', 1); // 仅计数
// define('DEPART_TYPE_CARD', 2); // 仅名片
// $GLOBALS['depart_type_list'] = array(
// DEPART_TYPE_FULL => '全功能',
// DEPART_TYPE_COUNT => '仅计数',
// DEPART_TYPE_CARD => '仅名片'
// );
10 months ago
if(option.code && option.state) {
this.code = option.code
this.state = option.state
}
1 year ago
},
1 year ago
async onShow() {
1 year ago
this.doctor_id = getApp().globalData.doctorId
if(!this.doctor_id) return
1 year ago
1 year ago
var title = '预约就诊'
1 year ago
if(this.code) title = '登录'
uni.setNavigationBarTitle({
title:title
})
var token = this.$token.getToken()
10 months ago
if(this.code && this.state && !token) {
this.login()
return
}
1 year ago
await this.getDoctorInfo()
1 year ago
},
2 years ago
methods: {
toLocation(hospital){
var that = this
uni.showActionSheet({
itemList: ['腾讯地图', '百度地图', '高德地图'],
success: function (res) {
var lngLat = hospital.hospital_pos.toString().split(',')
var lng = lngLat[0].toString()
, lat = lngLat[1].toString()
var baiduLngLat = that.qqMapTransBMap(lng, lat)
var mapList = [
'http://apis.map.qq.com/uri/v1/marker?marker=coord:'+ lat+','+lng+';addr:'+hospital.hospital_name,
// 'http://apis.map.qq.com/uri/v1/marker?marker=coord:'+ lat+','+lng+';title:'+hospital.hospital_name+ 'addr:'+hospital.address, // new 有title
'http://api.map.baidu.com/marker?location='+baiduLngLat.lat+','+baiduLngLat.lng+'&title='+hospital.hospital_name+'&content=即将前往目的地&output=html&src=webapp.baidu.openAPIdemo',
'https://m.amap.com/share/index/lnglat='+hospital.hospital_pos+'&name='+hospital.hospital_name+'&src=uriapi&innersrc=uriapi',
]
// location.href(mapList[res.tapIndex])
// 判断是否在小程序环境
if (typeof wx !== 'undefined' && wx.openLocation) {
// 小程序环境
// 跳不过去?? lat?问题?
// wx.openLocation({
// latitude: lat,
// longitude: lng,
// name: hospital.hospital_name || '目的地',
// address: hospital.address || '',
// scale: 18
// });
wx.openLocation({
latitude: baiduLngLat.lat,
longitude: baiduLngLat.lng,
name: hospital.hospital_name || '目的地',
address: hospital.address || '',
scale: 18
});
}
// 判断是否微信浏览器
else if (/MicroMessenger/i.test(navigator.userAgent)) {
location.href = mapList[res.tapIndex];
}
},
fail: function (res) {
}
});
},
copyAddress(address){
uni.setClipboardData({
data: address,
success: () => {
uni.showToast({ title: "地址已复制", icon: "none" });
}
});
},
6 months ago
changeCollapse(e) {
console.log(e);
},
10 months ago
setLoginUserInfo(info) {
this.$setuinfo.setUinfo(JSON.stringify(info))
10 months ago
},
1 year ago
login() {
10 months ago
this.$http.req('common/get_user_info', {code:this.code,state:this.state}, 'POST').then(data=>{
if(data == -1) return
this.$settoken.setToken(data.jwttoken)
4 months ago
10 months ago
this.setLoginUserInfo(data)
var stat_info = this.state.split('-');
if(stat_info.length > 2) {
uni.removeStorageSync('checkin_depart_id');
this.$nav.navToPath('/pages/visitors/visitors?type=3&depart_id='+stat_info[2])
return;
}
10 months ago
this.getDoctorInfo()
});
4 months ago
1 year ago
},
1 year ago
async getDoctorInfo() {
await this.$http.req('user/index_info', {}, 'GET').then(data=>{
1 year ago
if(data == -1) return
// var data = JSON.parse(uni.getStorageSync('doctor_info'));
var checkin_depart_id = uni.getStorageSync('checkin_depart_id');
if(checkin_depart_id){
uni.removeStorageSync('checkin_depart_id');
this.$nav.navToPath('/pages/visitors/visitors?type=3&depart_id='+checkin_depart_id)
return;
}
this.pageShow = true;
let visitFlag = true;
this.doctorInfo = data;
if(this.doctorInfo.doctor_info && this.doctorInfo.doctor_info.depart_name && this.doctorInfo.doctor_info.depart_name.length>0){
this.doctor_dept = this.doctorInfo.doctor_info.depart_name;
}
if(this.doctorInfo.hospital_departs && this.doctorInfo.hospital_departs.length>0){
this.hospitals = this.doctorInfo.hospital_departs;
this.doctor_dept = this.doctorInfo.hospital_departs[0]['depart_name'];
this.doctorInfo.doctor_info.depart_name = this.doctor_dept;
4 months ago
6 months ago
for (var index = 0; index < this.hospitals.length; index++) {
this.collapseValue[index] = []
}
}else{
visitFlag = false;
}
if(this.doctorInfo.visit_list && this.doctorInfo.visit_list.length>0){
this.recentAppoint = this.doctorInfo.visit_list;
}
if(this.doctorInfo.workdate && Object.keys(this.doctorInfo.workdate).length > 0){
this.workdate = this.doctorInfo.workdate;
}else{
visitFlag = false;
}
this.hospital_departs = this.doctorInfo.hospital_departs.map((item,index)=>{
item.workdate_desc = this.doctorInfo.workdate_desc[item.depart_id]
return item
})
1 year ago
});
},
2 years ago
enlargePicture(imgUrl) {
var list = new Array();
list[0] = imgUrl;
uni.previewImage({
loop: true,
urls: list
});
1 year ago
},
toVisitors(hospital){
uni.setStorageSync('depart_id', hospital.depart_id)
uni.setStorageSync('depart', JSON.stringify(hospital))
uni.setStorageSync('doctor_info', JSON.stringify(this.doctorInfo))
this.$nav.navToPath("/pages/visitors/visitors?type=1&is_preview=1")
1 year ago
},
toPrebookList(){
this.$nav.navToPath("/pages/prebook_list/prebook_list")
1 year ago
},
toPrebookDetail(){
this.$nav.navToPath("/pages/visit_detail/visit_detail")
},
qqMapTransBMap(lng, lat) {
let x_pi = 3.14159265358979324 * 3000.0 / 180.0;
let x = lng;
let y = lat;
let z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * x_pi);
let theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * x_pi);
let lngs = z * Math.cos(theta) + 0.0065;
let lats = z * Math.sin(theta) + 0.006;
return {
lng: lngs,
4 months ago
lat: lats
}
2 years ago
}
2 years ago
}
}
</script>
2 years ago
<style lang="scss" scoped>
.index-page{
2 years ago
.header-wrapper{
2 years ago
min-height: 208rpx;
padding: 27rpx 40rpx 24rpx;
2 years ago
box-sizing: border-box;
2 years ago
.left{
width: 510rpx;
.top{
overflow: hidden;
2 years ago
margin-top: 31rpx;
2 years ago
& view:first-of-type{
color: #333;
letter-spacing: 1.32rpx;
2 years ago
margin-right: 27rpx;
2 years ago
max-width: 250rpx;
font-weight: 500;
2 years ago
}
& view:last-of-type{
2 years ago
view{
width: auto;
padding: 0 15rpx;
min-width: 125rpx;
margin-top: 5rpx;
2 years ago
line-height: 42rpx;
text-align: center;
2 years ago
font-size: 28rpx;
background: linear-gradient( 288deg, #FFEED2 0%, #FED9A6 100%);
border-radius: 8rpx;
color: #7D501F;
}
2 years ago
}
}
.bt{
width: 480rpx;
line-height: 40rpx;
font-size: 28rpx;
color: #666666;
2 years ago
margin-top: 21rpx;
}
}
.right{
flex-grow: 1;
display: block;
border-radius: 100%;
height: 160rpx;
width: 160rpx;
}
}
.block{
background: #FFFFFF;
border-radius: 8rpx;
padding: 36rpx 24rpx;
2 years ago
box-sizing: border-box;
margin: 0 auto;
width: 714rpx;
margin-bottom: 20rpx;
}
.desc-wrapper{
box-shadow: 0rpx 2rpx 24rpx 0rpx rgba(0,0,0,0.03);
color: #949699;
font-size: 30rpx;
line-height: 50rpx;
.con{
overflow-y: auto;
max-height: 200rpx;
color: #666666;
2 years ago
}
}
2 years ago
.title-wrapper{
.title{
width: 117rpx;
height: 42rpx;
padding-left: 13rpx;
margin-bottom: 36rpx;
font-size: 26rpx;
color: #FFFFFF;
line-height: 42rpx;
text-align: center;
border-radius: 8rpx 0rpx 0rpx 8rpx;
background: linear-gradient( 98deg, #53C184 0%, #5CD378 100%);
}
&.booklist .title{
margin-bottom: 0rpx;
}
2 years ago
img{
width: 48rpx;
height: 42rpx;
}
}
2 years ago
.hospital-wrapper{
.item{
2 years ago
min-height: 207rpx;
2 years ago
width: 100%;
2 years ago
margin-bottom: 36rpx;
6 months ago
border-bottom: 2rpx solid #F1F1F1;
padding-bottom: 36rpx;
4 months ago
6 months ago
&:last-child{
margin-bottom: 0rpx;
padding-bottom: 0rpx;
border-bottom:none !important;
}
2 years ago
.top{
.left{
flex-grow: 1;
.title{
align-items: center;
6 months ago
flex-wrap: wrap;
column-gap: 20rpx;
row-gap: 12rpx;
.hospital_name{
color: #333;
font-size: 32rpx;
}
2 years ago
img{
width: 20rpx;
height: 32rpx;
}
6 months ago
.fixed_hospital{
border-radius: 6rpx;
background: #F7FCFF;
border: 1rpx solid rgba(9, 131, 208, 0.6);
box-sizing: border-box;
width: 123rpx;
height: 40rpx;
display: flex;
align-items: center;
justify-content: center;
font-size: 26rpx;
letter-spacing: 0.69rpx;
color: #0983D0;
}
2 years ago
}
.date{
line-height: 40rpx;
font-size: 28rpx;
color: #949699;
margin-top: 22rpx;
2 years ago
}
}
.right{
width: 172rpx;
flex-shrink: 0;
2 years ago
height: 100%;
color: #666666;
display: flex;
justify-content: flex-end;
.map-wrap{
font-size: 26rpx;
font-weight: normal;
line-height: normal;
letter-spacing: 0.74rpx;
color: #666666;
margin-top: 4rpx;
}
2 years ago
img{
width: 52rpx;
height: 52rpx;
}
.copy_btn{
2 years ago
display: block;
line-height: normal;
2 years ago
text-align: center;
margin-top: 4rpx;
font-size: 24rpx;
color: #30C563;
2 years ago
}
}
}
.center{
justify-content: flex-start;
align-items: center;
width: 100%;
box-sizing: border-box;
min-height: 59rpx;
padding: 10rpx;
display: flex;
z-index: 1;
background: #F8F6F9;
font-size: 28rpx;
line-height: 39rpx;
color: #666666;
margin-top: 22rpx;
margin-bottom: 24rpx;
word-break: break-all;
}
6 months ago
.notice-collapse {
margin-top: 24rpx;
4 months ago
::v-deep {
6 months ago
.uni-collapse-item__title-box{
padding: 0;
display: flex;
justify-content: flex-start;
align-items: center;
height: 40rpx;
line-height: 40rpx;
color: #303133;
font-weight: normal;
margin-top: 0rpx;
}
.uni-collapse-item__title{
border: none !important;
}
.uni-collapse-item__title-arrow{
width: 32rpx;
height: 32rpx;
margin-left: 12rpx;
}
.uni-icons{
width: 32rpx;
height: 32rpx;
}
.uni-collapse-item__title-text{
font-size: 28rpx;
letter-spacing: 0.22rpx;
color: #949699;
}
.uni-collapse-item__title-wrap{
width: auto;
flex: unset;
}
.content{
color:red !important;
}
.uni-collapse-item__wrap-content{
border: none !important;
}
.uni-collapse-item__title.is-open{
margin-bottom: 24rpx;
}
.content{
width: 100%;
height: auto;
padding: 24rpx;
box-sizing: border-box;
background: #F8F6F9;
border-radius: 12rpx;
}
.content .text{
font-size: 28rpx;
font-weight: normal;
line-height: 40rpx;
letter-spacing: 0.22rpx;
color: #666666;
}
4 months ago
6 months ago
}
}
4 months ago
.bot{
margin-top: 16rpx;
font-size: 32rpx;
}
2 years ago
}
2 years ago
}
2 years ago
.visit-wrapper{
1 year ago
margin-bottom: 0;
2 years ago
.header{
justify-content: space-between;
.opt{
1 year ago
align-items: center;
2 years ago
overflow: hidden;
1 year ago
font-size: 26rpx;
color: #949699;
2 years ago
img{
width: 20rpx;
height: 32rpx;
margin-left: 8rpx;
}
}
}
1 year ago
}
.preg-books{
width: 714rpx;
margin: 0 auto;
2 years ago
}
4 months ago
2 years ago
}
</style>