优化细节

This commit is contained in:
haomingming 2023-03-30 17:14:12 +08:00
parent 75c9d6cae2
commit edff2d3c05
17 changed files with 92 additions and 19 deletions

View File

@ -3,7 +3,6 @@ import { API } from './../../utils/network/api'
const api = new API()
const app = getApp()
Page({
data: {
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
@ -11,6 +10,14 @@ Page({
},
checked: false
},
onLoad(){
let usertype = wx.getStorageSync('usertype');
if(!usertype){
wx.navigateTo({
url: "/Pages/index/index"
})
}
},
onChange(event) {
this.setData({
checked: event.detail,

View File

@ -15,6 +15,14 @@ Page({
login_disabled: false,
btn_color: "#ccc"
},
onLoad(){
let usertype = wx.getStorageSync('usertype');
if(!usertype){
wx.navigateTo({
url: "/Pages/index/index"
})
}
},
onChange(event) {
this.setData({
checked: event.detail,

View File

@ -21,6 +21,7 @@ Page({
onShow(){
console.log("chat onShow");
this.getInquiryMessageBasic();
console.log("app.globalData.scene from chat: ", app.globalData.scene);
},
$onMessageReceived(value) {
const message = value.data[0];

View File

@ -97,7 +97,7 @@
</view>
<!-- 底部按钮 -->
<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>

View File

@ -35,7 +35,14 @@ Page({
doctors_advice_focus: false,
case_detail: {},
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(){
this.setData({

View File

@ -33,7 +33,8 @@
<view class="addzhenduan" wx:if="{{from != 'chat'}}">+添加诊断</view>
<view slot="label">
<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>
</van-cell>
@ -124,6 +125,11 @@
input-align="left"
placeholder="请输入用法(口服)"
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 }}"
/>
<van-field
@ -133,6 +139,11 @@
input-align="left"
placeholder="请输入服用次一日1次"
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 }}"
/>
<van-field
@ -142,6 +153,11 @@
input-align="left"
placeholder="请输入用量一次3粒"
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 }}"
/>
<van-field
@ -151,15 +167,25 @@
input-align="left"
placeholder="请输入时长"
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 }}"
/>
<van-field
label="药品数量"
type="text"
type="number"
model:value="{{save_durg_prescription_product_num}}"
input-align="left"
placeholder="请输入数量"
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 }}"
/>
<van-field
@ -169,6 +195,8 @@
input-align="left"
placeholder="盒/袋"
custom-style="font-size: 30rpx;"
clearable
confirm-type="done"
border="{{ true }}"
/>

View File

@ -79,9 +79,11 @@ page{
border-radius: 20rpx;
}
.drugs_box_item{
border-bottom: 1px solid red;
padding: 20rpx 20rpx 20rpx 20rpx;
}
.drugs_box_item:not(:first-child){
border-top: 1px solid #E7E7E7;
}
.drugs_name{
color: #333333;
font-size: 32rpx;

View File

@ -17,7 +17,7 @@ Page({
data_list_4: [],
data_list_5: [],
conversationList: [],
message_inquiry_type: 1,
message_inquiry_type: 99999,
system_notice_unreadnnum: "",
service_notice_unreadnnum: "",
hasOnShow: false

View File

@ -28,14 +28,14 @@
<view class="tabs" wx:if="{{ has_data }}" >
<t-tabs
defaultValue="{{ message_inquiry_type }}"
default-value="{{ message_inquiry_type }}"
sticky
bind:change="onTabsChange"
bind:scroll="onStickyScroll"
t-class="custom-tabs"
theme="line"
swipeable="{{false}}"
custom-style="font-size: 32rpx"
>
<t-tab-panel label="在线问诊" value="1" wx:if="{{data_list_1.length > 0}}">

View File

@ -127,7 +127,8 @@ line-height: 42rpx;
display: flex;
flex-direction: column;
align-items: center;
width: 100vw;
width: calc(100vw - 40rpx);
text-align: center;
}
.gdxz_custom_message_title{
flex: 1;

View File

@ -833,7 +833,7 @@ Component({
displayServiceEvaluation: true,
});
},
//常用语
showChangYongYu(){
app.go("/Pages/yishi/quickreply/index?from=chat")
},

View File

@ -186,10 +186,11 @@ Component({
}
},
checkShowAvatar(message){
console.log("checkShowAvatar ");
let type = message.type;
console.log("message type: ", type);
let show_avatar = true;
if(type == "TIMCustomElem"){
if(type === "TIMCustomElem"){
const customMessage = JSON.parse(message.payload.data);
if(customMessage.message_type != GDXZ_CUSTOM_MSEEAGE.PRESCRIBE){
show_avatar = false;
@ -273,6 +274,8 @@ Component({
showNewMessageCount: this.data.showNewMessageCount,
showDownJump: true,
});
}
} else {
this.setData({
@ -310,10 +313,13 @@ Component({
groupOptionsNumber: this.data.messageList.slice(-1)[0].payload.operationType,
});
}
//主动跳到 消息跳转到最新
// this.handleJumpNewMessage()
},
// 自己的消息上屏
updateMessageList(message) {
console.log("自己的消息上屏 updateMessageList: ", message);
//自己的消息有头像
message.show_avatar = this.checkShowAvatar(message);
if (message.conversationID !== this.data.conversation.conversationID) return;

View File

@ -64,7 +64,7 @@
<view wx:if="{{showDownJump}}" bindtap="handleJumpNewMessage">
<view class="new-message-item" >
<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>
</view>
</view>

View File

@ -16,8 +16,8 @@
.t-message{
position: relative;
z-index: -9;
width: calc(100vw - 20rpx);
padding: 0 10rpx;
width: calc(100vw - 40rpx);
padding: 10rpx 20rpx 20rpx 20rpx;
}
.t-recieve-message {
display: flex;

View File

@ -103,6 +103,17 @@ Component({
ready() {
//修改为组件传值
// 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
View File

@ -7,11 +7,12 @@ const api = new API()
App({
onLaunch: function (options) {
// 判断是否由分享进入小程序
if (options.scene == 1007 || options.scene == 1008) {
if (options.scene != 1001) {
this.globalData.share = true
} else {
this.globalData.share = false
};
this.globalData.scene = options.scene
//获取设备顶部窗口的高度(不同设备窗口高度不一样,根据这个来设置自定义导航栏的高度)
//这个最初我是在组件中获取,但是出现了一个问题,当第一次进入小程序时导航栏会把
//页面内容盖住一部分,当打开调试重新进入时就没有问题,这个问题弄得我是莫名其妙
@ -160,6 +161,7 @@ App({
globalData: {
share: false, // 分享默认为false
height: 0,
scene: "",//场景值
login_url: "/Pages/login/index",
chat_sdk_ready: false,
jiesuan_dialog_show: false,

View File

@ -43,7 +43,7 @@ class HTTP {
resolve(res.data)
} else if(code == 401 || code == 403 || code == 405 || code == 406){
wx.navigateTo({
url: app.globalData.login_url
url: "/Pages/login/index"
})
} else {
reject(res.data.message);//向后传递错误信息catch会拿到