患者端小程序 糖组功能 8.17
This commit is contained in:
parent
833def112c
commit
97df1b4646
@ -384,7 +384,6 @@ Page({
|
||||
let userID = wx.getStorageSync('user_id_'+usertype);
|
||||
let totalUnreadCount = 0;
|
||||
let message_inquiry_type = this.data.message_inquiry_type;
|
||||
console.log("conversationList---------");
|
||||
console.log(this.data.conversationList);
|
||||
this.data.conversationList.forEach(item => {
|
||||
let conversationID = item.conversationID;
|
||||
|
||||
@ -389,7 +389,7 @@
|
||||
</view>
|
||||
<view class="content_2">问诊已结束</view>
|
||||
<view class="content_3">
|
||||
<view class="status status_end">{{ item.inquiry_type==1?'专家问诊':item.inquiry_type==2?'快速问诊':item.inquiry_type==3?'公益问诊':item.inquiry_type==4?'问诊购药':'其他' }}</view>
|
||||
<view class="status status_end">{{ item.inquiry_type==1?'专家问诊':item.inquiry_type==2?'快速问诊':item.inquiry_type==3?'公益问诊':item.inquiry_type==4?'问诊购药':item.inquiry_type==5?'糖组检测':'其他' }}</view>
|
||||
</view>
|
||||
<view class="content_4" wx:if="{{ item.inquiry_status == 3 }}">不接诊24小时后自动取消</view>
|
||||
</view>
|
||||
|
||||
@ -362,6 +362,7 @@ Component({
|
||||
const title = customMessage.title
|
||||
if(title.indexOf("问诊已结束") > -1){
|
||||
setTimeout(() => {
|
||||
console.log('aaaaaaaaaaaaaaaaaaaaaa')
|
||||
//收到横条消息去触发父组件getbase方法,演示1秒
|
||||
this.triggerEvent('getInquiryMessageBasic');
|
||||
}, 1000);
|
||||
|
||||
@ -3,6 +3,7 @@ import logger from '../../utils/logger';
|
||||
import constant from '../../utils/constant';
|
||||
import { API } from './../../../utils/network/api'
|
||||
import { rpxTopx } from './../../../utils/util'
|
||||
const dayjs = require("../../utils/dayjs.js");
|
||||
const api = new API()
|
||||
// eslint-disable-next-line no-undef
|
||||
const app = getApp();
|
||||
@ -65,6 +66,7 @@ Component({
|
||||
type: Object,
|
||||
value: {},
|
||||
observer(baseInfo) {
|
||||
this.dealBasic(baseInfo);
|
||||
this.setData({
|
||||
"navbarData.title": baseInfo.patient_family_name
|
||||
});
|
||||
@ -121,6 +123,9 @@ Component({
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
rest_time:0,
|
||||
total_rounds:0,
|
||||
timeData:{},
|
||||
conversationName: '',
|
||||
conversation: {},
|
||||
messageList: [],
|
||||
@ -170,6 +175,23 @@ Component({
|
||||
this.setData({
|
||||
message_rounds: message_rounds
|
||||
})
|
||||
let total_rounds=this.data.total_rounds;
|
||||
if(total_rounds>=0){
|
||||
if(total_rounds-message_rounds<=0 && this.data.baseInfo.inquiry_status==4){
|
||||
wx.showToast({
|
||||
title: '沟通已达到限制的'+total_rounds+'个回合',
|
||||
icon:"none"
|
||||
})
|
||||
this.finishConsult();
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
onChangeTime(e) {
|
||||
console.log(e.detail)
|
||||
this.setData({
|
||||
'timeData': e.detail,
|
||||
});
|
||||
},
|
||||
getNavbarHeight(addHeight){
|
||||
|
||||
@ -237,11 +259,7 @@ Component({
|
||||
dialog_visible: false
|
||||
})
|
||||
},
|
||||
confirmDialog(){
|
||||
let finsh_btn = this.data.finsh_btn
|
||||
if(finsh_btn){
|
||||
return
|
||||
}
|
||||
finishConsult(){
|
||||
this.setData({
|
||||
finsh_btn: true
|
||||
})
|
||||
@ -257,14 +275,69 @@ Component({
|
||||
finsh_btn: false
|
||||
})
|
||||
})
|
||||
},
|
||||
confirmDialog(){
|
||||
let finsh_btn = this.data.finsh_btn
|
||||
if(finsh_btn){
|
||||
return
|
||||
}
|
||||
this.finishConsult();
|
||||
this.setData({
|
||||
dialog_visible: false
|
||||
})
|
||||
},
|
||||
dealBasic(obj){
|
||||
let data=obj;
|
||||
console.log(data.duration)
|
||||
if(data.inquiry_status==4){
|
||||
if(data.times_number==0){
|
||||
this.setData({
|
||||
total_rounds:-1,//无线沟通
|
||||
})
|
||||
}else{
|
||||
this.setData({
|
||||
total_rounds:data.times_number,//无线沟通
|
||||
})
|
||||
}
|
||||
|
||||
if (data.duration != 0) {
|
||||
if (data.reception_time){
|
||||
let endtime = dayjs(data.reception_time).add(data.duration, 'minute').format('YYYY-MM-DD HH:mm:ss');
|
||||
let nowtime = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
||||
let countdown = dayjs(endtime).diff(nowtime, "millisecond");
|
||||
let countdownTime = countdown > 0 ? countdown : 0;
|
||||
console.log("countdownTime--------");
|
||||
console.log(countdownTime);
|
||||
this.setData({
|
||||
"rest_time": countdownTime
|
||||
});
|
||||
if(countdownTime==0){
|
||||
wx.showToast({
|
||||
title: '沟通时长已超过限制时间',
|
||||
icon:"none"
|
||||
})
|
||||
this.finishConsult();
|
||||
}
|
||||
} else {
|
||||
|
||||
this.setData({
|
||||
"rest_time": 0
|
||||
})
|
||||
}
|
||||
} else {
|
||||
console.log("wwww")
|
||||
this.setData({
|
||||
"rest_time": -1 //接诊不限时间
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
//获取问诊订单消息内页基础数据
|
||||
getInquiryMessageBasic() {
|
||||
// console.log("order_inquiry_id: ", this.data.order_inquiry_id);
|
||||
api.getInquiryMessageBasic({order_inquiry_id: this.data.order_inquiry_id}).then(response => {
|
||||
console.log("11111111111111111111111111111111111111")
|
||||
// console.log(response);
|
||||
this.setData({
|
||||
baseInfo: response.data,
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
"MessageList": "./components/MessageList/index",
|
||||
"MessageInput": "./components/MessageInput/index",
|
||||
"TUIGroup": "../TUIGroup/index",
|
||||
"van-count-down": "@vant/weapp/count-down/index",
|
||||
"te-nav-bar": "/commpents/te_navbar",
|
||||
"t-dialog": "tdesign-miniprogram/dialog/dialog"
|
||||
},
|
||||
|
||||
@ -3,12 +3,33 @@
|
||||
<view class="container">
|
||||
<view class="info" wx:if="{{ baseInfo.inquiry_status > 0 }}">
|
||||
<view class="left" >
|
||||
<view class="name">{{baseInfo.patient_family_name}}</view>
|
||||
<view class="age">{{baseInfo.patient_family_sex==1?'男':'女'}}|{{baseInfo.patient_family_age}}岁</view>
|
||||
<view class="status {{baseInfo.inquiry_status==5?'status_complete':''}}">{{baseInfo.inquiry_status==1?'待支付':baseInfo.inquiry_status==2?'待分配':baseInfo.inquiry_status==3?'待接诊':baseInfo.inquiry_status==4?'接诊中':baseInfo.inquiry_status==5?'问诊完成':baseInfo.inquiry_status==6?'已结束':baseInfo.inquiry_status==7?'已取消':'未知'}}</view>
|
||||
<view class="circle_top"></view>
|
||||
<view class="name" wx:if="{{baseInfo.inquiry_status!=4}}">{{baseInfo.patient_family_name}}</view>
|
||||
<view class="age" wx:if="{{baseInfo.inquiry_status!=4}}">{{baseInfo.patient_family_sex==1?'男':'女'}} | {{baseInfo.patient_family_age}}岁</view>
|
||||
|
||||
<view class="count_time" wx:else="{{baseInfo.inquiry_status==4}}">
|
||||
|
||||
问诊中|<text wx:if="{{rest_time==-1}}" class="time_desc">不限时间</text>
|
||||
<view wx:else="{{rest_time!=-1}}" class="time_desc">
|
||||
<text>剩余</text>
|
||||
<van-count-down class="control-count-down" use-slot time="{{rest_time}}" bind:change="onChangeTime" format="HH:mm:ss">
|
||||
|
||||
<text class="item" hidden="{{timeData.hours== 0 && timeData.days==0}}">{{(timeData.days*24)+timeData.hours }}小时</text>
|
||||
<text class="item" wx:if="{{timeData.hours==0}}">{{timeData.minutes }}分</text>
|
||||
<text class="item" wx:if="{{timeData.hours==0}}">{{ timeData.seconds }}秒</text>
|
||||
</van-count-down>
|
||||
</view>
|
||||
|
||||
<text wx:if="{{total_rounds==-1}}" class="time_desc">不限沟通次数</text>
|
||||
<text wx:else class="time_desc">
|
||||
<text wx:if="{{total_rounds-message_rounds>0}}">{{total_rounds-message_rounds}}</text>
|
||||
<text wx:else>0</text>个沟通回合
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right">
|
||||
<text class="right_txt" bindtap="putDoctorInquiryFinish" wx:if="{{baseInfo.inquiry_status==4}}">结束问诊</text>
|
||||
<view class="status {{baseInfo.inquiry_status==5?'status_complete':''}}" wx:else="{{baseInfo.inquiry_status!=4}}">{{baseInfo.inquiry_status==1?'待支付':baseInfo.inquiry_status==2?'待分配':baseInfo.inquiry_status==3?'待接诊':baseInfo.inquiry_status==4?'接诊中':baseInfo.inquiry_status==5?'问诊完成':baseInfo.inquiry_status==6?'已结束':baseInfo.inquiry_status==7?'已取消':'未知'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
@ -134,22 +134,41 @@
|
||||
height: 100rpx;
|
||||
background-color: rgb(255, 255, 255);
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding:0 20rpx;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
|
||||
}
|
||||
.left{
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
justify-content:space-between;
|
||||
align-items: center;
|
||||
flex: 3;
|
||||
|
||||
}
|
||||
.right{
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
|
||||
font-size: 28rpx;
|
||||
color: #FFFFFF;
|
||||
padding-right: 20rpx;
|
||||
/* padding-right: 20rpx; */
|
||||
}
|
||||
.time_desc{
|
||||
color:#E34D59;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.time_desc .item{
|
||||
color:#E34D59;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
.count_time{
|
||||
display: flex;
|
||||
}
|
||||
.circle_top{
|
||||
width: 10rpx;
|
||||
height: 10rpx;
|
||||
margin-right: 10rpx;
|
||||
background: #3CC7C0;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.right_txt{
|
||||
background: #3CC7C0;
|
||||
@ -162,10 +181,15 @@
|
||||
text-align: center;
|
||||
}
|
||||
.age{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 20rpx;
|
||||
font-size: 34rpx;
|
||||
color: #666666;
|
||||
}
|
||||
.status{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background: #FFF2E8;
|
||||
box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.08);
|
||||
border-radius: 10rpx;
|
||||
|
||||
@ -808,6 +808,10 @@ class API extends HTTP {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
export { API }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user