优化页面
This commit is contained in:
@@ -17,11 +17,21 @@ Page({
|
||||
data_list_4: [],
|
||||
data_list_5: [],
|
||||
conversationList: [],
|
||||
message_inquiry_type: 2,
|
||||
message_inquiry_type: 1,
|
||||
system_notice_unreadnnum: "",
|
||||
service_notice_unreadnnum: ""
|
||||
},
|
||||
onLoad() {
|
||||
console.log("wenzhen onload");
|
||||
|
||||
let userID = wx.getStorageSync('user_id');
|
||||
setInterval(() => {
|
||||
let system_notice_unreadnnum = wx.getStorageSync(userID+"_system_notice_unreadnnum");
|
||||
let service_notice_unreadnnum = wx.getStorageSync(userID+"_service_notice_unreadnnum");
|
||||
this.setData({
|
||||
system_notice_unreadnnum: system_notice_unreadnnum,
|
||||
service_notice_unreadnnum: service_notice_unreadnnum,
|
||||
})
|
||||
}, 500);
|
||||
},
|
||||
onShow: function () {
|
||||
console.log("onShow from wenzhen V2")
|
||||
@@ -45,22 +55,10 @@ Page({
|
||||
});
|
||||
},
|
||||
go(e){
|
||||
wx.navigateTo({
|
||||
url: e.currentTarget.dataset.url,
|
||||
events: {
|
||||
// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
|
||||
acceptDataFromOpenedPage: function(data) {
|
||||
console.log(data)
|
||||
},
|
||||
someEvent: function(data) {
|
||||
console.log(data)
|
||||
}
|
||||
},
|
||||
success: function(res) {
|
||||
// 通过 eventChannel 向被打开页面传送数据
|
||||
res.eventChannel.emit('acceptDataFromOpenerPage', { data: 'test' })
|
||||
}
|
||||
})
|
||||
let url = e.currentTarget.dataset.url;
|
||||
let name = e.currentTarget.dataset.name;
|
||||
wx.setStorageSync(name, 0);
|
||||
app.go(url);
|
||||
},
|
||||
$onMessageReceived(value) {
|
||||
const message = value.data[0];
|
||||
@@ -157,10 +155,8 @@ Page({
|
||||
|
||||
},
|
||||
formatStatus(){
|
||||
|
||||
|
||||
let order_inquiry_id_list = [];
|
||||
|
||||
order_inquiry_id_list.push("a");//初始化一个,防止失败
|
||||
this.data.conversationList.forEach(item => {
|
||||
let conversationID = item.conversationID;
|
||||
if(conversationID == "C2Cadministrator") return;//如果是管理员消息直接跳过
|
||||
@@ -168,11 +164,16 @@ Page({
|
||||
if(!lastMessage) return;
|
||||
let cloudCustomData = lastMessage.cloudCustomData;
|
||||
if(!cloudCustomData) return;
|
||||
let cloudCustomDataJson = JSON.parse(cloudCustomData);
|
||||
let cloudCustomDataJson;
|
||||
try {
|
||||
cloudCustomDataJson = JSON.parse(cloudCustomData);
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return;
|
||||
}
|
||||
let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
|
||||
order_inquiry_id_list.push(order_inquiry_id);//准备去请求后端那订单状态
|
||||
})
|
||||
|
||||
let conversationList = this.data.conversationList;
|
||||
//获取医生问诊消息用户属性
|
||||
api.getDoctorInquiryMessageAttr({order_inquiry_ids: order_inquiry_id_list.join(",")}).then(response => {
|
||||
@@ -185,14 +186,24 @@ Page({
|
||||
if(!lastMessage) return;
|
||||
let cloudCustomData = lastMessage.cloudCustomData;
|
||||
if(!cloudCustomData) return;
|
||||
let cloudCustomDataJson = JSON.parse(item.lastMessage.cloudCustomData);
|
||||
let cloudCustomDataJson;
|
||||
try {
|
||||
cloudCustomDataJson = JSON.parse(item.lastMessage.cloudCustomData);
|
||||
} catch (error) {
|
||||
return;
|
||||
}
|
||||
let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
|
||||
let order = response.data.find(attr_item => {
|
||||
return attr_item.order_inquiry_id == order_inquiry_id;
|
||||
})
|
||||
if(!order) return;
|
||||
|
||||
item.inquiry_status = order.inquiry_status;
|
||||
let inquiry_status = order.inquiry_status;
|
||||
//inquiry_status 状态
|
||||
if(inquiry_status !=3 && inquiry_status != 4){
|
||||
return;
|
||||
}
|
||||
item.inquiry_status = inquiry_status;
|
||||
item.patient_age = order.patient_age;
|
||||
item.patient_name = order.patient_name;
|
||||
item.patient_sex = order.patient_sex;
|
||||
@@ -234,6 +245,7 @@ Page({
|
||||
let order_inquiry_id = cloudCustomDataJson.order_inquiry_id;
|
||||
if(!order_inquiry_id) return;
|
||||
let inquiry_type = cloudCustomDataJson.inquiry_type;
|
||||
if(!inquiry_type) return;
|
||||
let session_item = {};
|
||||
session_item.inquiry_status = item.inquiry_status;//订单状态暂无
|
||||
let txt = {};
|
||||
@@ -242,6 +254,7 @@ Page({
|
||||
session_item.message_send_time = getTimeAgo(lastMessage.lastTime);
|
||||
session_item.message_type = type;
|
||||
session_item.order_inquiry_id = order_inquiry_id;
|
||||
session_item.inquiry_type = inquiry_type;
|
||||
session_item.patient_age = item.patient_age;//暂无
|
||||
session_item.patient_name = userProfile.nick;
|
||||
session_item.from_account = userProfile.userID;
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
"usingComponents": {
|
||||
"te-nav-bar": "/commpents/te_navbar",
|
||||
"wenzhen-data": "/commpents/wenzhen_data/index",
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-tabs": "tdesign-miniprogram/tabs/tabs",
|
||||
"t-tab-panel": "tdesign-miniprogram/tab-panel/tab-panel",
|
||||
"t-badge": "tdesign-miniprogram/badge/badge",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-empty": "@vant/weapp/empty/index"
|
||||
"van-empty": "@vant/weapp/empty/index",
|
||||
"van-image": "@vant/weapp/image/index"
|
||||
}
|
||||
}
|
||||
@@ -2,23 +2,26 @@
|
||||
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
|
||||
<view class="container" style="height: calc(100vh - 96rpx - {{height}}px);">
|
||||
<view class="top">
|
||||
<view class="top_left" bindtap="go" data-url="/Pages/yishi/service_notice/index">
|
||||
<t-badge dot offset="{{ [1, 1] }}" class="wrapper">
|
||||
<t-image src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/service_notice.png" mode="heightFix" height="108rpx" aria-label="notice" />
|
||||
<view class="top_left" bindtap="go" data-name="service_notice_unreadnnum" data-url="/Pages/yishi/service_notice/index">
|
||||
<t-badge dot="{{service_notice_unreadnnum > 0}}" offset="{{ [1, 1] }}" class="wrapper">
|
||||
<van-image src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/service_notice.png" fit="heightFix" height="108rpx" aria-label="notice" />
|
||||
</t-badge>
|
||||
|
||||
服务通知
|
||||
</view>
|
||||
<view class="top_right" bindtap="go" data-url="/Pages/yishi/system_notice/index">
|
||||
<t-badge count="8" offset="{{ [1, 1] }}" class="wrapper">
|
||||
<t-image src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/system_notice.png" mode="heightFix" height="108rpx" aria-label="notice" />
|
||||
<view class="top_right" bindtap="go" data-name="system_notice_unreadnnum" data-url="/Pages/yishi/system_notice/index">
|
||||
<t-badge offset="{{ [1, 1] }}" class="wrapper" wx:if="{{system_notice_unreadnnum == ''}}">
|
||||
<van-image src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/system_notice.png" fit="heightFix" height="108rpx" aria-label="notice" />
|
||||
</t-badge>
|
||||
|
||||
<t-badge count="{{system_notice_unreadnnum}}" offset="{{ [1, 1] }}" class="wrapper" wx:else>
|
||||
<van-image src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/system_notice.png" fit="heightFix" height="108rpx" aria-label="notice" />
|
||||
</t-badge>
|
||||
系统公告
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="empty" wx:if="{{ !has_data }}" >
|
||||
<t-image src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/wnzhen_empty.png" mode="heightFix" height="108rpx" aria-label="empty" />
|
||||
<van-image src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/wnzhen_empty.png" fit="heightFix" height="108rpx" aria-label="empty" />
|
||||
<view class="empty_note">您还未设置在线问诊价格</view>
|
||||
</view>
|
||||
<van-button color="#3CC7C0" custom-style="width: 92vw;margin: 0 auto;border-radius: 10rpx;" block wx:if="{{ !has_data }}">开通图文问诊</van-button>
|
||||
@@ -34,25 +37,7 @@
|
||||
custom-style="font-size: 32rpx"
|
||||
|
||||
>
|
||||
<t-tab-panel label="快速问诊" value="1">
|
||||
<wenzhen-data
|
||||
name="李四"
|
||||
sex="女"
|
||||
age="19"
|
||||
desc="VVVVVVVV"
|
||||
status="0"
|
||||
status_text="待接诊"
|
||||
note="xxx"
|
||||
/>
|
||||
|
||||
<wenzhen-data
|
||||
name="李放四"
|
||||
sex="女"
|
||||
age="199"
|
||||
desc="VVVVVVVV"
|
||||
status="1"
|
||||
status_text="接诊中"
|
||||
/>
|
||||
<t-tab-panel label="在线问诊" value="1">
|
||||
|
||||
<wenzhen-data
|
||||
name="{{ item.patient_name }}"
|
||||
@@ -61,6 +46,9 @@
|
||||
date="{{ item.message_send_time }}"
|
||||
desc="{{ item.last_message_content.Text }}"
|
||||
status="{{ item.inquiry_status }}"
|
||||
order_inquiry_id="{{ item.order_inquiry_id }}"
|
||||
inquiry_type="{{item.inquiry_type}}"
|
||||
from_account="{{item.from_account}}"
|
||||
status_text="{{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'已接诊':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}"
|
||||
note="{{ item.inquiry_status==3?'不接诊24小时后自动取消':'' }}"
|
||||
message_dot="{{item.message_dot}}"
|
||||
@@ -70,7 +58,7 @@
|
||||
<van-empty description="暂无数据" wx:if="{{data_list_1.length == 0}}" />
|
||||
</t-tab-panel>
|
||||
|
||||
<t-tab-panel label="问诊购药" value="2">
|
||||
<t-tab-panel label="快速问诊" value="2">
|
||||
<!-- 1:待支付 2:待分配 3:待接诊 4:已接诊 5:已完成 6:已结束 7:已取消 -->
|
||||
<wenzhen-data
|
||||
name="{{ item.patient_name }}"
|
||||
@@ -80,6 +68,8 @@
|
||||
desc="{{ item.last_message_content.Text }}"
|
||||
status="{{ item.inquiry_status }}"
|
||||
order_inquiry_id="{{ item.order_inquiry_id }}"
|
||||
inquiry_type="{{item.inquiry_type}}"
|
||||
from_account="{{item.from_account}}"
|
||||
status_text="{{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'已接诊':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}"
|
||||
note="{{ item.inquiry_status==3?'不接诊24小时后自动取消':'' }}"
|
||||
message_dot="{{item.message_dot}}"
|
||||
@@ -90,7 +80,7 @@
|
||||
<van-empty description="暂无数据" wx:if="{{data_list_2.length == 0}}" />
|
||||
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="在线问诊" value="3">
|
||||
<t-tab-panel label="公益问诊" value="3">
|
||||
<!-- <wenzhen-data
|
||||
name="王五"
|
||||
sex="女"
|
||||
@@ -108,6 +98,9 @@
|
||||
date="{{ item.message_send_time }}"
|
||||
desc="{{ item.last_message_content.Text }}"
|
||||
status="{{ item.inquiry_status }}"
|
||||
order_inquiry_id="{{ item.order_inquiry_id }}"
|
||||
inquiry_type="{{item.inquiry_type}}"
|
||||
from_account="{{item.from_account}}"
|
||||
status_text="{{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'已接诊':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}"
|
||||
note="{{ item.inquiry_status==3?'不接诊24小时后自动取消':'' }}"
|
||||
message_dot="{{item.message_dot}}"
|
||||
@@ -117,16 +110,7 @@
|
||||
<van-empty description="暂无数据" wx:if="{{data_list_3.length == 0}}" />
|
||||
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="公益问诊" value="4">
|
||||
<wenzhen-data
|
||||
name="赵柳"
|
||||
sex="女"
|
||||
age="19"
|
||||
desc="VVVVVVVV"
|
||||
status="0"
|
||||
status_text="待接诊"
|
||||
note="xxx"
|
||||
/>
|
||||
<t-tab-panel label="问诊购药" value="4">
|
||||
|
||||
<wenzhen-data
|
||||
name="{{ item.patient_name }}"
|
||||
@@ -135,6 +119,9 @@
|
||||
date="{{ item.message_send_time }}"
|
||||
desc="{{ item.last_message_content.Text }}"
|
||||
status="{{ item.inquiry_status }}"
|
||||
order_inquiry_id="{{ item.order_inquiry_id }}"
|
||||
inquiry_type="{{item.inquiry_type}}"
|
||||
from_account="{{item.from_account}}"
|
||||
status_text="{{ item.inquiry_status==1?'待支付':item.inquiry_status==2?'待分配':item.inquiry_status==3?'待接诊':item.inquiry_status==4?'已接诊':item.inquiry_status==5?'已完成':item.inquiry_status==6?'已结束':item.inquiry_status==7?'已取消':'其他' }}"
|
||||
note="{{ item.inquiry_status==3?'不接诊24小时后自动取消':'' }}"
|
||||
message_dot="{{item.message_dot}}"
|
||||
@@ -144,15 +131,6 @@
|
||||
<van-empty description="暂无数据" wx:if="{{data_list_4.length == 0}}" />
|
||||
</t-tab-panel>
|
||||
<t-tab-panel label="问诊结束" value="5">
|
||||
<wenzhen-data
|
||||
name="谢广坤"
|
||||
sex="女"
|
||||
age="199"
|
||||
desc="VVVVVVVV"
|
||||
status="2"
|
||||
status_class="status_end"
|
||||
status_text="快速问诊"
|
||||
/>
|
||||
|
||||
<wenzhen-data
|
||||
name="{{ item.patient_name }}"
|
||||
|
||||
Reference in New Issue
Block a user