分包医生

This commit is contained in:
zoujiandong
2024-01-16 14:59:06 +08:00
parent 562d4e9691
commit d5a9339ddd
1060 changed files with 3177 additions and 44707 deletions
+177
View File
@@ -0,0 +1,177 @@
import { API } from '../../../../utils/network/api'
const api = new API()
const app = getApp()
Page({
data: {
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '服务通知', //导航栏 中间的标题
},
height: app.globalData.height,
visible: false,
list: [],
current_page: 0,
total: 0,
per_page: 0,
last_page: 0,
contactKeFu: false,
confirmBtn: {
"openType": "contact",
"content": "确认",
},
static_host: api.getStaticHost()
},
onShow(){
this.getList();
},
onHide(){
console.log("onHideonHide")
this.setData({
list: [],
current_page: 0,
total: 0,
per_page: 0,
last_page: 0,
})
},
getList(){
let current_page = this.data.current_page;
current_page = current_page + 1;
this.setData({
current_page: current_page
})
let list = this.data.list;
api.getDoctorMessageService({page: current_page}).then(response => {
console.log(response);
this.setData({
list: list.concat(response.data.data),
current_page: response.data.current_page,
total: response.data.total,
per_page: response.data.per_page,
last_page: response.data.last_page,
})
}).catch(errors => {console.error(errors);})
},
onReachBottom() {
console.log('===触底了!!===');
if(this.data.current_page < this.data.last_page){//最后一页时停止分页
this.getList()
}
},
putMessageReadNoticeAll(){
api.putMessageReadNoticeAll({notice_type: 1}).then(response => {
console.log(response);
let new_list = [];
this.data.list.forEach(item => {
item.read_status = 1;
new_list.push(item)
})
this.setData({
list: new_list
})
let usertype = wx.getStorageSync('usertype');
let userID = wx.getStorageSync('user_id_'+usertype);
wx.setStorageSync( userID+"_service_notice_unreadnnum", "");
wx.showToast({
title: '操作成功',
icon: "success"
})
}).catch(errors => {console.error(errors);})
},
putMessageReadNotice(notice_id,index){
api.putMessageReadNotice({notice_id: notice_id}).then(response => {
if(response.code==200){
let currentItem=`list[${index}].read_status`
this.setData({
[currentItem]:1
})
}
console.log(response);
}).catch(errors => {console.error(errors);})
},
go(e){
let item = e.currentTarget.dataset.item;
let index=e.currentTarget.dataset.index;
this.putMessageReadNotice(item.notice_id,index);
let link_type = item.link_type;
link_type = Number(link_type);
// 跳转页面类型(1:聊天详情页 2:问诊结束列表页 3:问诊消息列表页 4:我的名片 5:我的简介 6:我的账户 7:我的福利 8:药品订单详情页 9:物流详情 10:问诊订单详情 11:联系客服 12:协议详情 13:处方详情)
switch (link_type) {
case 1:
let from_account = item.link_params.from_account;
let order_inquiry_id = item.link_params.order_inquiry_id;
let inquiry_type = item.link_params.inquiry_type;
let url = "/TUIChatService/pages/index?from_account="+from_account+"&order_inquiry_id="+order_inquiry_id+"&inquiry_type="+inquiry_type;
app.go(url);
break;
case 2:
wx.showToast({
title: '暂无页面',
icon: 'error'
})
break;
case 3:
wx.switchTab({
url: "/Pages/yishi/wenzhen_v2/wenzhen",
})
break;
case 4:
app.go("/user/pages/yishi/mycard/index")
break;
case 5:
app.go("/user/pages/yishi/myprofile/index")
break;
case 6:
app.go("/user/pages/yishi/myaccount/index")
break;
case 7:
wx.showToast({
title: '暂无页面',
icon: 'error'
})
break;
case 8:
wx.showToast({
title: '暂无页面',
icon: 'error'
})
break;
case 9:
wx.showToast({
title: '暂无页面',
icon: 'error'
})
break;
case 10:
wx.showToast({
title: '暂无页面',
icon: 'error'
})
break;
case 11:
this.setData({
contactKeFu: true
})
break;
case 12:
wx.showToast({
title: '暂无页面',
icon: 'error'
})
break;
case 13:
let url1 = "/user/pages/yishi/onlinechufang/index?order_inquiry_id="+item.link_params.order_inquiry_id+"&order_prescription_id="+item.link_params.order_prescription_id+"&from=chat";
app.go(url1);
break;
default:
break;
}
},
cancelContactDialog(){
console.log("cancelContactDialogcancelContactDialogcancelContactDialog");
this.setData({
contactKeFu: false
})
},
})
@@ -0,0 +1,12 @@
{
"component": true,
"usingComponents": {
"te-nav-bar": "../../../../commpents/te_navbar/index",
"van-image": "@vant/weapp/image/index",
"van-divider": "@vant/weapp/divider/index",
"van-empty": "@vant/weapp/empty/index",
"t-dialog": "tdesign-miniprogram/dialog/dialog"
},
"enablePullDownRefresh": false,
"onReachBottomDistance": 50
}
@@ -0,0 +1,56 @@
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
<view class="container">
<view class="list">
<view class="item" wx:for="{{list}}" bindtap="go" data-index="{{index}}" data-item="{{item}}" >
<view class="item_top">
<view class="item_img" wx:if="{{item.inquiry_type == 1}}">
<text style="margin-left: 10rpx;">在线问诊</text>
<van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/online.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view>
<view class="item_img" wx:if="{{item.inquiry_type == 2}}">
<text style="margin-left: 10rpx;">快速问诊</text>
<van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/kuaisu.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view>
<view class="item_img" wx:if="{{item.inquiry_type == 3}}">
<text style="margin-left: 10rpx;">公益问诊</text>
<van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/yizhen.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view>
<view class="item_img" wx:if="{{item.inquiry_type == 4}}">
<text style="margin-left: 10rpx;">问诊购药</text>
<van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/drug.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view>
<view class="item_img" wx:if="{{item.inquiry_type == 5}}">
<text style="margin-left: 10rpx;">糖组检测</text>
<van-image class="van_img" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/check_sugar.png" fit="heightFix" height="54rpx" aria-label="qrcode" />
</view>
<view class="item_date">{{item.notice_send_time}}</view>
</view>
<view class="item_content">
{{item.notice_brief_title}}
<view class="hongdian" wx:if="{{item.read_status == 0}}">
<van-image src="{{static_host}}/applet/doctor/static/images/yishi/honhdian.png" fit="heightFix" height="20rpx" aria-label="qrcode" />
</view>
</view>
</view>
</view>
<van-empty description="暂无数据" wx:if="{{list.length == 0}}" />
<van-divider contentPosition="center" wx:if="{{list.length > 0 && current_page == last_page}}">到底了~</van-divider>
<van-image bind:click="putMessageReadNoticeAll" style="position: fixed; right: 0;bottom: 262rpx;" src="{{static_host}}/applet/doctor/static/images/yishi/service_notice/readall.png" fit="heightFix" height="84rpx" aria-label="role" />
<view style="height: 50rpx;"></view>
<t-dialog
visible="{{ contactKeFu }}"
title="立即联系客服"
confirm-btn="{{confirmBtn}}"
close-on-overlay-click="{{true}}"
close="cancelContactDialog"
overlay-click="cancelContactDialog"
>
<view slot="cancel-btn" class="dialog dialog_cancel_btn" bindtap="cancelContactDialog">
取消
</view>
<!-- <view slot="confirm-btn" class="dialog dialog_confirm_btn" open-type="contact">
<t-button theme="primary" size="large" open-type="contact">确认</t-button>
</view> -->
</t-dialog>
</view>
@@ -0,0 +1,71 @@
page{
background-color: #F4F4F4;
}
.container{
width: 100vw;
padding-top: 20rpx;
}
.list{
width: 92vw;
margin: 0 auto;
}
.item{
display: flex;
flex-direction: column;
background-color: #fff;
padding: 20rpx;
border-radius: 10rpx;
margin-bottom: 20rpx;
}
.item_top{
display: flex;
justify-content: space-between;
align-items: center;
}
.item_img{
display: flex;
flex-direction: row-reverse;
align-items: center;
font-size: 34rpx;
color: #333333;
}
.item_date{
font-size: 26rpx;
color: #999999;
}
.item_content{
margin-top: 20rpx;
font-size: 30rpx;
color: #666666;
display: flex;
align-items: center;
}
.van_img{
display: flex;
justify-content: center;
}
.hongdian{
height: 50rpx;
display: flex;
align-items: center;
flex: 1;
display: flex;
justify-content: flex-end;
}
.dialog{
width: 50%;
text-align: center;
height: 100rpx;
line-height: 100rpx;
}
.dialog_cancel_btn{
border-top: 1px solid #E9E9E9;
border-right: 1px solid #E9E9E9;
}
.dialog_confirm_btn{
border-top: 1px solid #E9E9E9;
color: #3CC7C0;
}
.t-button__content{
color: #3CC7C0 !important;
}