Files
xk-doctor-wx/pages/workbench/index.vue
2024-09-19 12:57:55 +08:00

750 lines
21 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view>
<view class="bg" :style="{height:`calc(${navbarHeight}px + ${navbarHeight}px + 394rpx)`}">
</view>
<view class="navbar" :style="{ height: statusBarHeight+navbarHeight + 'px' }">
<view class="status-bar" :style="{ height: statusBarHeight + 'px' }"></view>
<view class="text-align-cen" :style="{ height:navbarHeight + 'px' ,lineHeight: navbarHeight + 'px'}">
工作台
</view>
</view>
<view class="box" :style="{marginTop: statusBarHeight+navbarHeight + 'px'}">
<view class="store_" @click="openShow=true">
{{doctorInfo.store.store.name || '默认门店'}}
<u-icon name="map-fill" color="#fff" size="28" margin-left="12"></u-icon>
</view>
<view class="box_info">
<view class="box_info_left">
<image :src="doctorInfo.DoctorInfo.avatar" style="width: 116rpx;height:116rpx ;border-radius: 50%;"
mode="aspectFill">
</image>
<view class="flex-col flex-jus-sp" style="height: 106rpx;margin-left: 32rpx;">
<view class="flex-row flex-ali-center">
<text class="box_info_left_name">{{doctorInfo.DoctorInfo.name}}</text>
<text class="m-r-16">{{doctorInfo.DoctorInfo.title['name']}}</text>
<u-tag text="审核中" type="warning" size="mini" shape="circle" border-color="#FB8C00"
bgColor="#FB8C00" color="#fff" v-if="doctorInfo.DoctorInfo.user.status<=1" />
<u-tag text="已认证" type="warning" size="mini" shape="circle" border-color="#FB8C00"
bgColor="#FB8C00" color="#fff" v-if="doctorInfo.DoctorInfo.user.status==2" />
<u-tag v-if="doctorInfo.DoctorInfo.user.status==3" text="审核未通过" type="warning" size="mini"
border-color="#A7ABB0" bgColor="#A7ABB0" color="#fff" />
</view>
<text>
{{`${doctorInfo.store.store.name}${doctorInfo.DoctorInfo.depart['name']}`}}
</text>
</view>
</view>
<view class="box_info_right flex-col flex-jus-sp flex-ali-center"
@click="$go('../../subPackages/sub_workbench/workbench_code')">
<image src="../../static/image/mp.png"></image>
<d-text text="我的名片" className="w-c fs-2"></d-text>
</view>
</view>
<view class="box_data flex-row flex-jus-sp flex-ali-center">
<view class="flex-col flex-jus-sp flex-ali-center">
<text class="box_data_nub">{{doctorInfo.wait_accept || '0'}}</text>
<label>待接诊</label>
</view>
<view class="flex-col flex-jus-sp flex-ali-center">
<text class="box_data_nub">{{doctorInfo.accepting || '0'}}</text>
<label>已接诊</label>
</view>
</view>
</view>
<view class="content">
<view class="function p-32">
<view class="function_grid">
<view class="function_item flex-col flex-ali-center flex-jus-sp"
@click="doctorInfo.DoctorInfo.user.status==3?$go('../../subPackages/sub_workbench/workbench_upInfo/index'):$go(item.url)"
v-for="(item,i) in functions" :key="i">
<image :src="item.icon"></image>
<view>{{item.name}}</view>
<u-badge :count="i===0?doctorInfo.wait_accept:0" v-if="i===0" :offset="[-6,98]"
bgColor="#F44336"></u-badge>
</view>
<view class="function_item flex-col flex-ali-center flex-jus-sp" @click="toNext">
<image src="/static/image/xsfz.png"></image>
<view>复诊开药</view>
</view>
</view>
</view>
<block>
<view class="news b-r-8">
<view class="news_title flex-row">
<view class="m-t-32">消息通知</view>
</view>
<!-- height:calc(100vh - 282rpx) -->
<scroll-view scroll-y="true" style="padding: 20rpx 0rpx;" @scrolltolower="scrolltolower"
@refresherrefresh="page=1;status = 'loading';loading = true;infoList=[];$store.dispatch('getDocSession')"
:refresher-triggered="loading" :refresher-enabled="true" v-if="!loading">
<!-- <view class="news_item flex-row flex-jus-sp flex-ali-center" v-for="(item) in infoList"
:key="item.id"
@click="$go(`../../subPackages/sub_workbench/workbench_infoPatient?id=`+item.user_patient_id)">
<view style="width: 80rpx;position: relative;">
<u-image width="80rpx" height="80rpx" shape="circle"
:src="item.avatar||require(`../../static/image/${item.sex%2==0?'nv':'nan'}.png`)">
<u-loading slot="loading"></u-loading>
</u-image>
<u-badge :count="item.message.no_read" v-if="item.message.no_read>0" :offset="[0,0]"
bgColor="#F44336" :overflow-count="9999"></u-badge>
</view>
<view class="news_item_info flex-col flex-jus-sp">
<view class="flex-row flex-jus-sp flex-ali-center">
<view class="flex-row flex-ali-center">
<d-text :text="item.patient" className="content-c fs-32 m-r-16"></d-text>
</view>
<d-text :text="item.created_at" size="24"></d-text>
</view>
<view class="flex-row flex-jus-sp">
<view class="news_item_info_msg text-hide">
<text
style="font-size: 24rpx;margin-right: 20rpx;">{{item.sex %2 != 0 ? '男' : '女'}}</text>
<text style="font-size: 22rpx;">{{item.age + '岁'}}</text>
</view>
<d-text :text="states[item.status].name" :color="states[item.status].color"
size="24"></d-text>
</view>
</view>
</view> -->
<!-- 系统消息 评论我的 患者消息 -->
<view class="news_item flex-row flex-jus-sp flex-ali-center"
@click="$go('../../subPackages/sub_patient/patient_label?type=1')" v-if="systemList.num>0">
<view style="width: 80rpx;position: relative;">
<u-image width="80rpx" height="80rpx" shape="circle" src="/static/image/home1.png">
<u-loading slot="loading"></u-loading>
</u-image>
<u-badge :count="systemList.num" v-if="systemList.num>0" :offset="[0,0]"
bgColor="#F44336" :overflow-count="9999"></u-badge>
</view>
<view class="news_item_info flex-col flex-jus-sp">
<view class="flex-row flex-jus-sp flex-ali-center">
<view class="flex-row flex-ali-center">
<d-text text="系统消息" className="content-c fs-32 m-r-16"></d-text>
</view>
<d-text :text="systemList.time" size="24"></d-text>
</view>
<view class="flex-row flex-jus-sp">
<view class="news_item_info_msg text-hide">
<text style="font-size: 24rpx;margin-right: 20rpx;"
v-if="systemList.num>0">你有{{systemList.num}}条未读消息</text>
</view>
</view>
</view>
</view>
<view class="news_item flex-row flex-jus-sp flex-ali-center"
@click="$go('../../subPackages/sub_patient/patient_label?type=2')" v-if="infoList.num>0">
<view style="width: 80rpx;position: relative;">
<u-image width="80rpx" height="80rpx" shape="circle" :src="'/static/image/home2.png'">
<u-loading slot="loading"></u-loading>
</u-image>
<u-badge :count="infoList.num" v-if="infoList.num>0" :offset="[0,0]" bgColor="#F44336"
:overflow-count="9999"></u-badge>
</view>
<view class="news_item_info flex-col flex-jus-sp">
<view class="flex-row flex-jus-sp flex-ali-center">
<view class="flex-row flex-ali-center">
<d-text text="患者消息" className="content-c fs-32 m-r-16"></d-text>
</view>
<d-text :text="infoList.time" size="24"></d-text>
</view>
<view class="flex-row flex-jus-sp">
<view class="news_item_info_msg text-hide">
<text style="font-size: 24rpx;margin-right: 20rpx;"
v-if="infoList.num>0">你有{{infoList.num}}名患者待接诊</text>
</view>
</view>
</view>
</view>
<!-- <u-loadmore :status="status" :load-text="loadText"
v-if="loading&&infoList.length!=0||!loading" /> -->
<view class="news_item flex-row flex-jus-sp flex-ali-center"
v-if="!loading&&systemList.length==0"
@click="$go('../../subPackages/sub_patient/patient_label?type=1')">
<view style="width: 80rpx;position: relative;">
<u-image width="80rpx" height="80rpx" shape="circle" src="/static/image/home1.png">
<u-loading slot="loading"></u-loading>
</u-image>
</view>
<view class="news_item_info flex-col flex-jus-sp">
<view class="flex-row flex-jus-sp flex-ali-center">
<view class="flex-row flex-ali-center">
<d-text text="系统消息" size="34" color="#000"></d-text>
</view>
<d-text :text="systemList.time" size="24"></d-text>
</view>
<view class="flex-row flex-jus-sp">
<view class="news_item_info_msg text-hide">
<text style="font-size: 28rpx;margin-right: 20rpx;">点击查看历史消息</text>
</view>
</view>
</view>
</view>
<!-- 患者 -->
<view class="news_item flex-row flex-jus-sp flex-ali-center" v-if="!loading&&infoList.length==0"
@click="$go('../../subPackages/sub_patient/patient_label?type=2')">
<view style="width: 80rpx;position: relative;">
<u-image width="80rpx" height="80rpx" shape="circle" :src="'/static/image/home2.png'">
<u-loading slot="loading"></u-loading>
</u-image>
</view>
<view class="news_item_info flex-col flex-jus-sp">
<view class="flex-row flex-jus-sp flex-ali-center">
<view class="flex-row flex-ali-center">
<d-text text="患者消息" size="34" color="#000"></d-text>
</view>
<d-text :text="infoList.time" size="24"></d-text>
</view>
<view class="flex-row flex-jus-sp">
<view class="news_item_info_msg text-hide">
<text style="font-size: 28rpx;margin-right: 20rpx;">点击查看历史消息</text>
</view>
</view>
</view>
</view>
<!-- 处方 -->
<view v-if="noticeList.length" class="news_item flex-row flex-jus-sp flex-ali-center"
@click="$go('./prescriptionList')">
<view style="width: 80rpx;position: relative;">
<u-image width="80rpx" height="80rpx" shape="circle" src="/static/image/home1.png">
<u-loading slot="loading"></u-loading>
</u-image>
<u-badge :count="noticeList.length" :offset="[0,0]"
bgColor="#F44336" :overflow-count="9999"></u-badge>
</view>
<view class="news_item_info flex-col flex-jus-sp">
<view class="flex-row flex-jus-sp flex-ali-center">
<view class="flex-row flex-ali-center">
<d-text text="待流转处方消息" className="content-c fs-32 m-r-16"></d-text>
</view>
</view>
<view class="flex-row flex-jus-sp">
<view class="news_item_info_msg text-hide">
<text style="font-size: 24rpx;margin-right: 20rpx;">你有{{noticeList.length}}条未读消息</text>
</view>
</view>
</view>
</view>
</scroll-view>
<!-- 暂无信息 -->
<!-- <view class="flex-row flex-jus-center" v-if="!loading&&infoList.length==0&&systemList.length==0">
<d-empty text="暂无信息" mode="search"></d-empty>
</view> -->
</view>
<view @click="call" class="phone">咨询客服</view>
<view class="m-b-32 p-t-32"></view>
</block>
</view>
<!-- 切换门店 -->
<u-popup v-model="openShow" mode="bottom" border-radius="24" length="65%" :safe-area-inset-bottom="true">
<view class="content_popup">
<view class="top">
<view class="title">选择诊所</view>
<view class="search p-row-32">
<u-search placeholder="请输入诊所名称" @input="handleSearch" v-model="keyword"
:show-action="false"></u-search>
</view>
</view>
<scroll-view scroll-y="true" style="height: 600rpx;">
<view>
<view class="store_list" v-for="(item,index) in storeList" :key="item.id"
@click="changeStore(item.id)">
{{item.name}}
<u-icon size="35" color="#6ACDBB" name="checkmark-circle-fill"
v-if="store_id==item.id"></u-icon>
</view>
</view>
</scroll-view>
<view class="confrim-btn">
<view class="u-btn qx" @click="openShow=false">取消</view>
<view class="u-btn qd" @click="sure">确定</view>
</view>
</view>
</u-popup>
<d-tabbar></d-tabbar>
</view>
</template>
<script>
import {
chooseList,
hospitalList,
info,
noticeApi,
currentList,
homeSession,
getNotice
} from '@/api/all.js'
import {
registerList
} from '../../api/consult';
export default {
data() {
return {
noticeList: [],
loading: false,
status: 'loading',
loadText: {
loadmore: '轻轻上拉',
loading: '努力加载中',
nomore: '实在没有了'
},
functions: [{
name: '到店接诊',
icon: '../../static/image/zxzx.png',
url: '../../subPackages/sub_workbench/workbench_consult?type=1'
}],
states: {
1: {
name: '待接诊',
color: '#F44336'
},
2: {
name: '接诊中',
color: '#00C853'
},
3: {
name: '已结束',
color: '#C4C7CC'
},
3: {
name: '已取消',
color: '#C4C7CC'
}
},
state: true,
doctorInfo: [],
current: 0,
navbarHeight: this.$navbarHeight,
statusBarHeight: this.$statusBarHeight,
list: [],
page: 1,
totalPage: 1,
openShow: false,
keyword: "",
store: "",
storeList: [],
store_id: uni.getStorageSync('store_id') || '11001',
infoList: [],
systemList: [],
see_rate: "",
};
},
watch: {
docSession: {
deep: true,
immediate: false,
handler(e) {
this.list = e.list;
this.totalPage = e.pagination.totalPage;
if (this.page >= this.totalPage) {
this.status = 'nomore'
} else {
this.status = 'loadmore'
}
this.$nextTick(() => {
this.loading = false
})
}
}
},
computed: {
},
onLoad() {
// this.$go('../../subPackages/sub_workbench/workbench_recipe/index')
// console.log(1);
},
onShow() {
this.getNotice()
this.getInfo()
this.getStore()
this.getList()
},
methods: {
call () {
uni.makePhoneCall({
phoneNumber: '18157126670',
success: (result) => {},
fail: (error) => {}
})
},
scrolltolower() {
if (this.loading) {
this.loading = false
return
}
if (this.page >= this.totalPage) {
this.status = 'nomore'
return
}
this.loading = true
this.status = 'loading'
this.page++
},
getNotice() {
getNotice({
page_size: 9999,
store_id: uni.getStorageSync('store_id') || '11001'
}).then(res => {
if (res.errcode === 401) {
uni.clearStorageSync()
uni.reLaunch({ url: '/pages/login/index' })
}
this.noticeList = res.data.list
})
},
// 医生详情
getInfo() {
info({
store_id: uni.getStorageSync('store_id') || '11001'
}).then((res) => {
// console.log(res.data, 'work-res');
if (res.errcode == 0) {
this.doctorInfo = res.data
this.see_rate = res.data.store.store.see_rate
// console.log(this.see_rate,'sssss');
uni.setStorageSync('see_rate', this.see_rate)
uni.setStorageSync('doctorInfo', this.doctorInfo)
}
})
},
// 搜索门店
handleSearch() {
this.getStore()
},
// 门店列表
getStore() {
currentList({
store_id: uni.getStorageSync('store_id') || '11001',
keyword: this.keyword
}).then((res) => {
// console.log(res, 'store');
if (res.errcode == 0) {
this.storeList = res.data.list
}
})
},
// 切换门店
changeStore(id) {
this.store_id = id
},
sure() {
chooseList({
store_id: uni.getStorageSync('store_id') || '11001',
store: this.store_id
}).then((res) => {
// console.log(res, 'changstore');
if (res.errcode == 0) {
this.$toast(res.data[0])
uni.setStorageSync('store_id', this.store_id)
} else {
this.$toast(res.msg || res.data[0])
this.store_id = uni.getStorageSync('store_id')
}
this.openShow = false
this.getInfo()
})
},
// 消息列表
getList() {
homeSession({
store_id: uni.getStorageSync('store_id') || '11001',
}).then((res) => {
if (res.errcode == 0) {
this.systemList = (res.data.system) || []
this.infoList = (res.data.patient) || []
} else {
this.$toast(res.msg);
}
this.$nextTick(() => {
this.loading = false
})
});
},
// 跳转到小程序
toNext() {
uni.navigateToMiniProgram({
appId: 'wx8e8f04d0cf7831bf',
path: 'pages/login/index?id=',
envVersion: "release",
extraData: {
'data1': 'test'
},
success: res => {
// 打开成功
console.log("打开成功", res);
},
fail: err => {
console.log(err);
}
})
}
},
mounted() {
// this.getInfo()
// this.getStore()
// this.getList()
},
};
</script>
<style>
page {
background-color: #eeeeef;
}
</style>
<style lang="scss" scoped>
.bg {
width: 100vw;
background: linear-gradient(90deg, #6ACDBB 0%, #6ACDBB 93%);
position: fixed;
left: 0;
top: 0;
z-index: 0;
}
.navbar {
background: linear-gradient(90deg, #6ACDBB 0%, #6ACDBB 93%);
width: 100vw;
position: fixed;
left: 0;
top: 0;
font-size: 34rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
color: #FFFFFF;
z-index: 99999;
}
.content {
padding: 0 20rpx;
position: relative;
z-index: 2;
margin-top: 30rpx;
}
.content_popup {
padding: 24rpx;
.top {
height: 200rpx;
.search {
position: relative;
z-index: 982;
}
.title {
height: 54rpx;
line-height: 54rpx;
font-size: 32rpx;
text-align: center;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #000000;
margin-bottom: 20rpx;
}
}
.store_list {
padding: 0 30rpx;
height: 100rpx;
font-size: 32rpx;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #333333;
display: flex;
align-items: center;
justify-content: space-between;
}
.confrim-btn {
width: 100%;
height: 100rpx;
padding: 0 30rpx;
margin-top: 20rpx;
display: flex;
align-items: center;
justify-content: space-between;
.u-btn {
width: 300rpx;
height: 84rpx;
line-height: 80rpx;
text-align: center;
border-radius: 44rpx 44rpx 44rpx 44rpx;
}
.qx {
border: 2rpx solid #6ACDBB;
color: #6ACDBB;
}
.qd {
background: #6ACDBB;
color: #FFFFFF;
}
}
}
.box {
position: relative;
padding: 0 32rpx;
height: 318rpx;
&_info {
display: flex;
align-items: center;
flex-wrap: nowrap;
justify-content: space-between;
&_left {
display: flex;
align-items: center;
align-content: flex-start;
flex-wrap: nowrap;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #FFFFFF;
font-size: 28rpx;
&_name {
font-size: 36rpx;
font-family: PingFang SC-Medium, PingFang SC;
font-weight: 500;
margin-right: 16rpx;
}
}
&_right {
height: 106rpx;
image {
width: 72rpx;
height: 72rpx;
}
}
}
&_data {
width: 686rpx;
height: 116rpx;
font-size: 24rpx;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
color: #FFFFFF;
margin-top: 50rpx;
padding: 0 32rpx;
view {
height: 84rpx;
min-width: 120rpx;
}
&_nub {
font-size: 36rpx;
}
}
.store_ {
font-size: 28rpx;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 500;
color: #FFFFFF;
margin-bottom: 20rpx;
.u-icon {
margin-left: 30rpx;
}
}
}
.function {
background-color: #fff;
border-radius: 16rpx;
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #323233;
&_grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-column-gap: 86rpx;
}
&_item {
position: relative;
width: 292rpx;
height: 144rpx;
}
image {
width: 96rpx;
height: 96rpx;
}
}
.news {
background-color: #fff;
margin-top: 20rpx;
max-height: 100vh;
&_title {
height: 82rpx;
font-size: 32rpx;
font-family: PingFang SC-Semibold, PingFang SC;
font-weight: 600;
color: #0D111A;
padding: 0 26rpx;
box-sizing: border-box;
text {
font-size: 28rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #6C7380;
}
}
&_item {
margin-top: 12rpx;
padding: 26rpx 20rpx;
position: relative;
&_info {
height: 92rpx;
width: 562rpx;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
font-size: 32rpx;
&_msg {
font-size: 28rpx;
width: 462rpx;
color: #6C7380;
}
}
}
}
.phone {
color: #999;
text-align: center;
padding-top: 20rpx;
font-size: 24rpx;
}
</style>