优化细节
This commit is contained in:
parent
75c9d6cae2
commit
edff2d3c05
@ -3,7 +3,6 @@ import { API } from './../../utils/network/api'
|
|||||||
const api = new API()
|
const api = new API()
|
||||||
const app = getApp()
|
const app = getApp()
|
||||||
Page({
|
Page({
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
navbarData: {
|
navbarData: {
|
||||||
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
|
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
|
||||||
@ -11,6 +10,14 @@ Page({
|
|||||||
},
|
},
|
||||||
checked: false
|
checked: false
|
||||||
},
|
},
|
||||||
|
onLoad(){
|
||||||
|
let usertype = wx.getStorageSync('usertype');
|
||||||
|
if(!usertype){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: "/Pages/index/index"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
onChange(event) {
|
onChange(event) {
|
||||||
this.setData({
|
this.setData({
|
||||||
checked: event.detail,
|
checked: event.detail,
|
||||||
|
|||||||
@ -15,6 +15,14 @@ Page({
|
|||||||
login_disabled: false,
|
login_disabled: false,
|
||||||
btn_color: "#ccc"
|
btn_color: "#ccc"
|
||||||
},
|
},
|
||||||
|
onLoad(){
|
||||||
|
let usertype = wx.getStorageSync('usertype');
|
||||||
|
if(!usertype){
|
||||||
|
wx.navigateTo({
|
||||||
|
url: "/Pages/index/index"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
onChange(event) {
|
onChange(event) {
|
||||||
this.setData({
|
this.setData({
|
||||||
checked: event.detail,
|
checked: event.detail,
|
||||||
|
|||||||
@ -21,6 +21,7 @@ Page({
|
|||||||
onShow(){
|
onShow(){
|
||||||
console.log("chat onShow");
|
console.log("chat onShow");
|
||||||
this.getInquiryMessageBasic();
|
this.getInquiryMessageBasic();
|
||||||
|
console.log("app.globalData.scene from chat: ", app.globalData.scene);
|
||||||
},
|
},
|
||||||
$onMessageReceived(value) {
|
$onMessageReceived(value) {
|
||||||
const message = value.data[0];
|
const message = value.data[0];
|
||||||
|
|||||||
@ -97,7 +97,7 @@
|
|||||||
</view>
|
</view>
|
||||||
<!-- 底部按钮 -->
|
<!-- 底部按钮 -->
|
||||||
<view class="item_bottom">
|
<view class="item_bottom">
|
||||||
<view class="item_bottom_btn">问诊记录</view>
|
<view class="item_bottom_btn" bindtap="gochat" data-order_inquiry_id="{{item.order_inquiry_id}}">问诊记录</view>
|
||||||
<view class="item_bottom_btn item_bottom_btn_repeat" bindtap="go" data-url="/Pages/yishi/onlinechufang/index?order_inquiry_id={{item.order_inquiry_id}}&order_prescription_id={{item.order_prescription_id}}">
|
<view class="item_bottom_btn item_bottom_btn_repeat" bindtap="go" data-url="/Pages/yishi/onlinechufang/index?order_inquiry_id={{item.order_inquiry_id}}&order_prescription_id={{item.order_prescription_id}}">
|
||||||
重开处方
|
重开处方
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -35,7 +35,14 @@ Page({
|
|||||||
doctors_advice_focus: false,
|
doctors_advice_focus: false,
|
||||||
case_detail: {},
|
case_detail: {},
|
||||||
sub_disabled: false,
|
sub_disabled: false,
|
||||||
from: ""
|
from: "",
|
||||||
|
now_filed_focus: 'save_durg_single_use'
|
||||||
|
},
|
||||||
|
changeFocus(e){
|
||||||
|
let next_filed_focus = e.currentTarget.dataset.next_filed_focus;
|
||||||
|
this.setData({
|
||||||
|
now_filed_focus: next_filed_focus
|
||||||
|
})
|
||||||
},
|
},
|
||||||
onDoctorsAdviceFocus(){
|
onDoctorsAdviceFocus(){
|
||||||
this.setData({
|
this.setData({
|
||||||
|
|||||||
@ -33,7 +33,8 @@
|
|||||||
<view class="addzhenduan" wx:if="{{from != 'chat'}}">+添加诊断</view>
|
<view class="addzhenduan" wx:if="{{from != 'chat'}}">+添加诊断</view>
|
||||||
<view slot="label">
|
<view slot="label">
|
||||||
<view style="margin-top: 20rpx;" class="label_item" wx:for="{{zhenduan_list}}">
|
<view style="margin-top: 20rpx;" class="label_item" wx:for="{{zhenduan_list}}">
|
||||||
<van-icon name="delete" catchtap="delZhenDuan" color="red" data-disease_class_id="{{item.icd_id}}" /><text style="margin-left: 10rpx;">{{item.icd_name}}</text>
|
<van-icon name="delete" catchtap="delZhenDuan" color="red" data-disease_class_id="{{item.icd_id}}" wx:if="{{from != 'chat'}}"/>
|
||||||
|
<text style="margin-left: 10rpx;">{{item.icd_name}}</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</van-cell>
|
</van-cell>
|
||||||
@ -124,6 +125,11 @@
|
|||||||
input-align="left"
|
input-align="left"
|
||||||
placeholder="请输入用法(口服)"
|
placeholder="请输入用法(口服)"
|
||||||
custom-style="font-size: 30rpx;"
|
custom-style="font-size: 30rpx;"
|
||||||
|
clearable
|
||||||
|
confirm-type="next"
|
||||||
|
bind:confirm="changeFocus"
|
||||||
|
data-next_filed_focus="save_durg_frequency_use"
|
||||||
|
focus="{{now_filed_focus == 'save_durg_single_use'}}"
|
||||||
border="{{ true }}"
|
border="{{ true }}"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
@ -133,6 +139,11 @@
|
|||||||
input-align="left"
|
input-align="left"
|
||||||
placeholder="请输入服用次(一日1次)"
|
placeholder="请输入服用次(一日1次)"
|
||||||
custom-style="font-size: 30rpx;"
|
custom-style="font-size: 30rpx;"
|
||||||
|
clearable
|
||||||
|
confirm-type="next"
|
||||||
|
bind:confirm="changeFocus"
|
||||||
|
data-next_filed_focus="save_durg_single_unit"
|
||||||
|
focus="{{now_filed_focus == 'save_durg_frequency_use'}}"
|
||||||
border="{{ true }}"
|
border="{{ true }}"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
@ -142,6 +153,11 @@
|
|||||||
input-align="left"
|
input-align="left"
|
||||||
placeholder="请输入用量(一次3粒)"
|
placeholder="请输入用量(一次3粒)"
|
||||||
custom-style="font-size: 30rpx;"
|
custom-style="font-size: 30rpx;"
|
||||||
|
clearable
|
||||||
|
confirm-type="next"
|
||||||
|
bind:confirm="changeFocus"
|
||||||
|
data-next_filed_focus="save_durg_available_days"
|
||||||
|
focus="{{now_filed_focus == 'save_durg_single_unit'}}"
|
||||||
border="{{ true }}"
|
border="{{ true }}"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
@ -151,15 +167,25 @@
|
|||||||
input-align="left"
|
input-align="left"
|
||||||
placeholder="请输入时长"
|
placeholder="请输入时长"
|
||||||
custom-style="font-size: 30rpx;"
|
custom-style="font-size: 30rpx;"
|
||||||
|
clearable
|
||||||
|
confirm-type="next"
|
||||||
|
bind:confirm="changeFocus"
|
||||||
|
data-next_filed_focus="save_durg_prescription_product_num"
|
||||||
|
focus="{{now_filed_focus == 'save_durg_available_days'}}"
|
||||||
border="{{ true }}"
|
border="{{ true }}"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
label="药品数量"
|
label="药品数量"
|
||||||
type="text"
|
type="number"
|
||||||
model:value="{{save_durg_prescription_product_num}}"
|
model:value="{{save_durg_prescription_product_num}}"
|
||||||
input-align="left"
|
input-align="left"
|
||||||
placeholder="请输入数量"
|
placeholder="请输入数量"
|
||||||
custom-style="font-size: 30rpx;"
|
custom-style="font-size: 30rpx;"
|
||||||
|
clearable
|
||||||
|
confirm-type="next"
|
||||||
|
bind:confirm="changeFocus"
|
||||||
|
data-next_filed_focus="save_durg_packaging_unit"
|
||||||
|
focus="{{now_filed_focus == 'save_durg_prescription_product_num'}}"
|
||||||
border="{{ true }}"
|
border="{{ true }}"
|
||||||
/>
|
/>
|
||||||
<van-field
|
<van-field
|
||||||
@ -169,6 +195,8 @@
|
|||||||
input-align="left"
|
input-align="left"
|
||||||
placeholder="盒/袋"
|
placeholder="盒/袋"
|
||||||
custom-style="font-size: 30rpx;"
|
custom-style="font-size: 30rpx;"
|
||||||
|
clearable
|
||||||
|
confirm-type="done"
|
||||||
border="{{ true }}"
|
border="{{ true }}"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@ -79,9 +79,11 @@ page{
|
|||||||
border-radius: 20rpx;
|
border-radius: 20rpx;
|
||||||
}
|
}
|
||||||
.drugs_box_item{
|
.drugs_box_item{
|
||||||
border-bottom: 1px solid red;
|
|
||||||
padding: 20rpx 20rpx 20rpx 20rpx;
|
padding: 20rpx 20rpx 20rpx 20rpx;
|
||||||
}
|
}
|
||||||
|
.drugs_box_item:not(:first-child){
|
||||||
|
border-top: 1px solid #E7E7E7;
|
||||||
|
}
|
||||||
.drugs_name{
|
.drugs_name{
|
||||||
color: #333333;
|
color: #333333;
|
||||||
font-size: 32rpx;
|
font-size: 32rpx;
|
||||||
|
|||||||
@ -17,7 +17,7 @@ Page({
|
|||||||
data_list_4: [],
|
data_list_4: [],
|
||||||
data_list_5: [],
|
data_list_5: [],
|
||||||
conversationList: [],
|
conversationList: [],
|
||||||
message_inquiry_type: 1,
|
message_inquiry_type: 99999,
|
||||||
system_notice_unreadnnum: "",
|
system_notice_unreadnnum: "",
|
||||||
service_notice_unreadnnum: "",
|
service_notice_unreadnnum: "",
|
||||||
hasOnShow: false
|
hasOnShow: false
|
||||||
|
|||||||
@ -28,14 +28,14 @@
|
|||||||
|
|
||||||
<view class="tabs" wx:if="{{ has_data }}" >
|
<view class="tabs" wx:if="{{ has_data }}" >
|
||||||
<t-tabs
|
<t-tabs
|
||||||
defaultValue="{{ message_inquiry_type }}"
|
default-value="{{ message_inquiry_type }}"
|
||||||
sticky
|
sticky
|
||||||
bind:change="onTabsChange"
|
bind:change="onTabsChange"
|
||||||
bind:scroll="onStickyScroll"
|
bind:scroll="onStickyScroll"
|
||||||
t-class="custom-tabs"
|
t-class="custom-tabs"
|
||||||
theme="line"
|
theme="line"
|
||||||
|
swipeable="{{false}}"
|
||||||
custom-style="font-size: 32rpx"
|
custom-style="font-size: 32rpx"
|
||||||
|
|
||||||
>
|
>
|
||||||
<t-tab-panel label="在线问诊" value="1" wx:if="{{data_list_1.length > 0}}">
|
<t-tab-panel label="在线问诊" value="1" wx:if="{{data_list_1.length > 0}}">
|
||||||
|
|
||||||
|
|||||||
@ -127,7 +127,8 @@ line-height: 42rpx;
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: 100vw;
|
width: calc(100vw - 40rpx);
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
.gdxz_custom_message_title{
|
.gdxz_custom_message_title{
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@ -833,7 +833,7 @@ Component({
|
|||||||
displayServiceEvaluation: true,
|
displayServiceEvaluation: true,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//常用语
|
||||||
showChangYongYu(){
|
showChangYongYu(){
|
||||||
app.go("/Pages/yishi/quickreply/index?from=chat")
|
app.go("/Pages/yishi/quickreply/index?from=chat")
|
||||||
},
|
},
|
||||||
|
|||||||
@ -186,10 +186,11 @@ Component({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
checkShowAvatar(message){
|
checkShowAvatar(message){
|
||||||
|
console.log("checkShowAvatar ");
|
||||||
let type = message.type;
|
let type = message.type;
|
||||||
|
console.log("message type: ", type);
|
||||||
let show_avatar = true;
|
let show_avatar = true;
|
||||||
if(type == "TIMCustomElem"){
|
if(type === "TIMCustomElem"){
|
||||||
const customMessage = JSON.parse(message.payload.data);
|
const customMessage = JSON.parse(message.payload.data);
|
||||||
if(customMessage.message_type != GDXZ_CUSTOM_MSEEAGE.PRESCRIBE){
|
if(customMessage.message_type != GDXZ_CUSTOM_MSEEAGE.PRESCRIBE){
|
||||||
show_avatar = false;
|
show_avatar = false;
|
||||||
@ -273,6 +274,8 @@ Component({
|
|||||||
showNewMessageCount: this.data.showNewMessageCount,
|
showNewMessageCount: this.data.showNewMessageCount,
|
||||||
showDownJump: true,
|
showDownJump: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.setData({
|
this.setData({
|
||||||
@ -310,10 +313,13 @@ Component({
|
|||||||
groupOptionsNumber: this.data.messageList.slice(-1)[0].payload.operationType,
|
groupOptionsNumber: this.data.messageList.slice(-1)[0].payload.operationType,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//主动跳到 消息跳转到最新
|
||||||
|
// this.handleJumpNewMessage()
|
||||||
},
|
},
|
||||||
// 自己的消息上屏
|
// 自己的消息上屏
|
||||||
updateMessageList(message) {
|
updateMessageList(message) {
|
||||||
|
console.log("自己的消息上屏 updateMessageList: ", message);
|
||||||
//自己的消息有头像
|
//自己的消息有头像
|
||||||
message.show_avatar = this.checkShowAvatar(message);
|
message.show_avatar = this.checkShowAvatar(message);
|
||||||
if (message.conversationID !== this.data.conversation.conversationID) return;
|
if (message.conversationID !== this.data.conversation.conversationID) return;
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
<view wx:if="{{showDownJump}}" bindtap="handleJumpNewMessage">
|
<view wx:if="{{showDownJump}}" bindtap="handleJumpNewMessage">
|
||||||
<view class="new-message-item" >
|
<view class="new-message-item" >
|
||||||
<view class="new-message-box">
|
<view class="new-message-box">
|
||||||
<image class="icon-left" src="../../../static/assets/down.svg"/>
|
<image class="icon-left" src="../../../../static/assets/down.svg"/>
|
||||||
<text>{{showNewMessageCount.length}}条新消息</text>
|
<text>{{showNewMessageCount.length}}条新消息</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@ -16,8 +16,8 @@
|
|||||||
.t-message{
|
.t-message{
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: -9;
|
z-index: -9;
|
||||||
width: calc(100vw - 20rpx);
|
width: calc(100vw - 40rpx);
|
||||||
padding: 0 10rpx;
|
padding: 10rpx 20rpx 20rpx 20rpx;
|
||||||
}
|
}
|
||||||
.t-recieve-message {
|
.t-recieve-message {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
@ -103,6 +103,17 @@ Component({
|
|||||||
ready() {
|
ready() {
|
||||||
//修改为组件传值
|
//修改为组件传值
|
||||||
// this.getInquiryMessageBasic()
|
// this.getInquiryMessageBasic()
|
||||||
|
console.log("app.globalData.scene from TUIchat ready: ", app.globalData.scene);
|
||||||
|
let pages = getCurrentPages();
|
||||||
|
console.log("pages:", pages)
|
||||||
|
console.log("pages.length:", pages.length)
|
||||||
|
console.log("pages:", pages[0])
|
||||||
|
if(pages.length == 1){
|
||||||
|
console.log("navbarData.showCapsule");
|
||||||
|
this.setData({
|
||||||
|
"navbarData.showCapsule": 3
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
|||||||
4
app.js
4
app.js
@ -7,11 +7,12 @@ const api = new API()
|
|||||||
App({
|
App({
|
||||||
onLaunch: function (options) {
|
onLaunch: function (options) {
|
||||||
// 判断是否由分享进入小程序
|
// 判断是否由分享进入小程序
|
||||||
if (options.scene == 1007 || options.scene == 1008) {
|
if (options.scene != 1001) {
|
||||||
this.globalData.share = true
|
this.globalData.share = true
|
||||||
} else {
|
} else {
|
||||||
this.globalData.share = false
|
this.globalData.share = false
|
||||||
};
|
};
|
||||||
|
this.globalData.scene = options.scene
|
||||||
//获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
|
//获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
|
||||||
//这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把
|
//这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把
|
||||||
//页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙
|
//页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙
|
||||||
@ -160,6 +161,7 @@ App({
|
|||||||
globalData: {
|
globalData: {
|
||||||
share: false, // 分享默认为false
|
share: false, // 分享默认为false
|
||||||
height: 0,
|
height: 0,
|
||||||
|
scene: "",//场景值
|
||||||
login_url: "/Pages/login/index",
|
login_url: "/Pages/login/index",
|
||||||
chat_sdk_ready: false,
|
chat_sdk_ready: false,
|
||||||
jiesuan_dialog_show: false,
|
jiesuan_dialog_show: false,
|
||||||
|
|||||||
@ -43,7 +43,7 @@ class HTTP {
|
|||||||
resolve(res.data)
|
resolve(res.data)
|
||||||
} else if(code == 401 || code == 403 || code == 405 || code == 406){
|
} else if(code == 401 || code == 403 || code == 405 || code == 406){
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: app.globalData.login_url
|
url: "/Pages/login/index"
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
reject(res.data.message);//向后传递错误信息,catch会拿到
|
reject(res.data.message);//向后传递错误信息,catch会拿到
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user