Files
xk-client-wx/subPackages/doctor/doctor-detail.vue

650 lines
13 KiB
Vue
Raw Normal View History

2024-09-19 12:51:35 +08:00
<template>
<view class="container safe-area-inset-bottom">
<!-- 名片 -->
<view class="card">
<!-- 姓名 -->
<view class="card_top">
<view class="card_top_left">
<view class="name">
{{doctorList.name}}
</view>
<text>{{doctorList.title}} &nbsp; {{doctorList.depart}}</text>
<text>{{doctorList.store}}</text>
</view>
<!-- 图片 -->
<view class="card_top_right">
<image :src="doctorList.avator || '/static/mine/avatar_1.png'" mode="医生头像"></image>
</view>
</view>
<!-- 好评率 擅长 -->
<view class="card_center">
<view class="card_center_top">
<view class="txt">问诊量 <text>{{doctorList.inquiry_num}}</text></view>
<view class="txt">接诊率<text>{{doctorList.accept_percent}}</text></view>
<!-- <view class="txt">综合评分 <text>{{doctorList.overall_score}}</text></view> -->
</view>
<view class="going">
专业擅长{{doctorList.good_at}}
</view>
</view>
<!-- 详细信息 通知栏 -->
<view class="card_bottom">
<view class="info" @click="godoctor">
查看全部 <text class="iconfont icon-jiantou1"></text>
</view>
</view>
</view>
<!-- 到店医生 预约挂号 -->
<view class="appoin">
<view class="title">预约挂号</view>
<view class="list">
<view class="yard">
<view class="stores">
<view class="times">{{registList.time}}</view>
<text class="price">{{registList.register_price}}</text>
</view>
<view class="btn" :class="registList.left_num<=0?'active':''" @click="goAdd">
{{registList.left_num>0&&'挂号' || registList.left_num<=0&&'约满'}}
</view>
</view>
<view class="yard">
<view class="num">剩余号 <text>{{registList.left_num}}</text> </view>
<view class="num">总号数{{registList.register_num}}</view>
</view>
</view>
</view>
<!-- 患者评价 -->
<!-- <view class="evaluation">
<view class="lists" @click="goevalua">
<view class="lists_left">
患者评价({{userList.length}})
</view>
<view class="lists_right">
<text>查看全部</text>
<text class="iconfont icon-jiantou1"></text>
</view>
</view>
<view class="empty" v-if="userList.length<=0">
<image src="/static/empty/orders.png" mode="aspectFit"></image>
</view>
<view class="items" v-for="(item,index) in userList" :key="item.id">
<image :src="item.avator || '/static/mine/avatar_1.png'" mode=""></image>
<view class="items_right">
<view class="item_name">
<view class="title">
<text>{{item.nickname || '微信用户'}}</text>
<u-rate :count="count" v-model="item.score" :disabled="true" active-color="#FB8C00"
inactive-color="#E2E8F0" size="20"></u-rate>
</view>
<view class="time">
{{item.created_at}}
</view>
</view>
<view class="info">
{{item.comment}}
</view>
</view>
</view>
</view> -->
<u-toast ref="uToast" />
</view>
</template>
<script>
import {
commentList,
doctorDetail,
registerList,
storeChange,
userList
} from '@/request/api/api'
2024-09-19 12:51:35 +08:00
export default {
data() {
return {
follow: true,
isshow: 1,
actived: 0,
doctorID: "", // 医生id
doctorList: {}, // 医生列表
id: "",
num: 0,
count: 5,
value: 2,
userList: [],
registList: [],
peopleList: [],
}
},
onLoad(e) {
console.log(e, 'e');
const token = uni.getStorageSync('token')
if (!token) {
uni.navigateTo({
url: '/pages/home/index'
})
return
}
// 扫码之后
if (e.scene) {
const id = uni.getStorageSync('st_id')
const doctorID = uni.getStorageSync('doctors_id')
if (e.scene && id && doctorID) {
this.toChang(id)
uni.setStorageSync('store_id', id)
}
const st_id = decodeURIComponent(e.scene).split('&')
const doctors_id = decodeURIComponent(e.scene).split('=')
uni.setStorageSync('doctors_id', st_id[0].split('su_id=')[1])
uni.setStorageSync('st_id', doctors_id[2])
// console.log(st_id, '2222');
this.doctorID = uni.getStorageSync('doctors_id')
this.getDocdetail();
this.getUser();
this.getRegist();
console.log(this.doctorID, '6666');
} else {
// 点击详情
this.doctorID = e.id
const id = e.sts_id || uni.getStorageSync('store_id')
2024-09-19 12:51:35 +08:00
if (id!='undefined' && id) {
console.log('idddd');
this.toChang(id)
uni.setStorageSync('store_id', id)
}
}
},
methods: {
// 医生信息
godoctor() {
uni.navigateTo({
url: "/subPackages/doctor/doctor-info?id=" + this.id
})
},
// 挂号
goAdd() {
if (this.num == 0) {
uni.showToast({
title: '暂无号源',
duration: 2000,
icon: "error"
});
return
}
if (this.peopleList.length <= 0) {
uni.navigateTo({
url: "/subPackages/my/myinfo-add?id=",
})
return
}
uni.navigateTo({
url: "/subPackages/doctor/doctor-userinfo?id=" + this.doctorID,
})
},
// 评价
goevalua() {
uni.navigateTo({
url: "/subPackages/doctor/doctor-evaluation?id=" + this.doctorID,
})
},
// 医生详情
getDocdetail() {
doctorDetail({
method: "post",
data: {
doctor_id: this.doctorID,
store_id: uni.getStorageSync('store_id') || '11001',
}
}).then((res) => {
// console.log(res, 'ress');
if (res.data.errcode == 0) {
this.doctorList = res.data.data
this.id = res.data.data.id
} else if (res.data.errcode != 0) {
// uni.showToast({
// title: res.data.msg,
// duration: 1500,
// mask: false,
// icon: 'error'
// })
this.$refs.uToast.show({
title: res.data.msg,
type: 'default',
icon: false
})
}
})
},
// 患者评价
getUser() {
commentList({
method: "post",
data: {
su_id: this.doctorID,
store_id: uni.getStorageSync('store_id') || '11001',
}
}).then((res) => {
// console.log(res, 'user');
if (res.data.errcode == 0) {
this.userList = (res.data.data.list).slice(0, 3)
}
})
},
// 预约挂号
getRegist() {
registerList({
method: "post",
data: {
service_user_id: this.doctorID,
store_id: uni.getStorageSync('store_id') || '11001',
}
}).then((res) => {
// console.log(res, 'reg');
if (res.data.errcode == 0) {
this.registList = res.data.data
this.num = res.data.data.left_num
}
})
},
// 就诊人列表
getPeople() {
userList({
method: "post",
data: {
store_id: uni.getStorageSync('store_id') || '11001',
}
}).then((res) => {
// console.log(res, 'reg');
if (res.data.errcode == 0) {
this.peopleList = res.data.data
}
})
},
// 切换门店
toChang(e) {
// console.log(e, 'id');
storeChange({
method: "post",
data: {
store_id: e
}
}).then((res) => {
if (res.data.errcode == 0) {
// uni.showToast({
// title: '切换成功',
// duration: 2000,
// icon: "success"
// });
2024-09-19 12:51:35 +08:00
}
})
},
},
mounted() {
this.getDocdetail();
this.getUser();
this.getRegist();
this.getPeople();
if (!this.doctorList && doctorID) {
this.getDocdetail();
this.doctorID = uni.getStorageSync('doctors_id')
setTimeout(() => {
this.getDocdetail();
}, 900)
}
},
onShow() {
this.getPeople();
},
onUnload() {
// uni.removeStorageSync('doctors_id')
}
}
</script>
<style lang="scss" scoped>
.container {
width: 100vw;
min-height: 100vh;
max-height: 100%;
background-color: #F8FAFC;
padding-bottom: env(safe-area-inset-bottom);
.card {
width: 750rpx;
padding: 20rpx 0;
background: #fff;
border-radius: 8rpx;
.card_top {
width: 686rpx;
padding-top: 20rpx;
margin: 0 auto 10rpx;
display: flex;
justify-content: space-between;
align-items: center;
.card_top_left {
display: flex;
flex-direction: column;
.name {
height: 56rpx;
font-size: 40rpx;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
color: #1E293B;
}
text {
height: 38rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #1E293B;
margin: 8rpx 0;
}
}
.card_top_right {
position: relative;
image {
width: 144rpx;
height: 144rpx;
border-radius: 50%;
}
}
}
.card_center {
width: 686rpx;
margin: 10rpx auto 0;
.card_center_top {
height: 44rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 500;
color: #94A3B8;
margin: 20rpx 0;
display: flex;
align-items: center;
.txt {
margin-right: 30rpx;
text {
font-size: 28rpx;
color: #FEA54C;
margin: 0 10rpx;
}
}
}
.going {
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #1E293B;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
overflow: hidden;
}
}
.card_bottom {
width: 686rpx;
margin: 10rpx auto;
.info {
text-align: right;
height: 40rpx;
line-height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #475569;
margin-bottom: 20rpx;
.iconfont {
font-size: 26rpx;
margin-left: 12rpx;
}
}
}
}
.appoin {
width: 710rpx;
margin: 36rpx auto 20rpx;
display: flex;
flex-direction: column;
.title {
font-size: 32rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #232323;
margin-bottom: 24rpx;
padding-left: 20rpx;
}
.list {
width: 710rpx;
margin: 8rpx auto;
padding: 24rpx 20rpx;
border-radius: 16rpx;
background: #FFFFFF;
.yard {
display: flex;
align-items: center;
justify-content: space-between;
margin: 8rpx 0;
.stores {
font-size: 28rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: 500;
color: #232323;
margin-bottom: 22rpx;
display: flex;
.price {
font-size: 26rpx;
font-weight: bold;
color: #FEA54C;
display: flex;
align-items: center;
margin-left: 18rpx;
}
.times {
color: #666666;
}
}
.num {
font-size: 27rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 500;
color: #666666;
white-space: 1rpx;
margin-top: 8rpx;
text {
color: #4175EE;
}
}
}
.btn {
width: 104rpx;
height: 42rpx;
line-height: 40rpx;
text-align: center;
background: #4175EE;
border-radius: 26rpx 26rpx 26rpx 26rpx;
font-size: 24rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #FFFFFF;
}
.active {
background: #E0E1E3;
color: #232323;
}
}
}
.evaluation {
margin: 16rpx 0;
.lists {
width: 750rpx;
height: 128rpx;
background: #FFFFFF;
padding: 32rpx;
display: flex;
justify-content: space-between;
align-items: center;
.lists_left {
height: 50rpx;
font-size: 32rpx;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
color: #0F172A;
}
.lists_right {
text {
height: 40rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #475569;
margin-left: 10rpx;
}
}
}
.empty {
width: 440rpx;
height: 393rpx;
margin: 10rpx auto;
image {
width: 100%;
height: 100%;
z-index: 10;
}
}
.items {
display: flex;
background-color: #fff;
justify-content: space-around;
padding: 10rpx 10rpx;
image {
width: 64rpx;
height: 64rpx;
border-radius: 50%;
}
.items_right {
width: 602rpx;
padding-bottom: 20rpx;
.item_name {
display: flex;
justify-content: space-between;
align-items: center;
.title {
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #475569;
text {
margin-right: 10rpx;
}
.iconfont {
color: #FB8C00;
font-size: 26rpx;
margin-left: 10rpx;
}
}
.time {
height: 34rpx;
font-size: 24rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #94A3B8;
}
}
.info {
font-size: 28rpx;
line-height: 44rpx;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
overflow: hidden;
margin: 16rpx 0 0 0;
}
}
}
}
.footer {
width: 750rpx;
height: 110rpx;
display: flex;
align-items: center;
justify-content: center;
background: #FFFFFF;
position: fixed;
left: 0;
bottom: env(safe-area-inset-bottom);
z-index: 10;
button {
width: 686rpx;
height: 86rpx;
background: #4175EE;
border-radius: 64rpx;
font-size: 32rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
}
}
}
</style>