优化
This commit is contained in:
parent
9e3cb69030
commit
e7be139b04
@ -4,6 +4,18 @@ Page({
|
||||
data: {
|
||||
loading: true
|
||||
},
|
||||
onLoad(option){
|
||||
let from = option.from;
|
||||
let usertype = wx.getStorageSync('usertype');
|
||||
console.log("index onload: ", from, usertype)
|
||||
if(from === "navbar"){
|
||||
//切换身份
|
||||
}else{
|
||||
if(usertype == 2 || usertype == 3){
|
||||
this.guideTo(usertype)
|
||||
}
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
@ -22,10 +34,16 @@ Page({
|
||||
let url = e.currentTarget.dataset.url;
|
||||
wx.setStorageSync('usertype', usertype);
|
||||
wx.setStorageSync('next_url', url);
|
||||
this.guideTo(usertype);
|
||||
},
|
||||
guideTo(usertype){
|
||||
let url;
|
||||
if(usertype == 2){
|
||||
app.imInit();
|
||||
url = "/Pages/yishi/index/index";
|
||||
}else{
|
||||
app.imLogout();
|
||||
url = "/Pages/yaoshi/home/home";
|
||||
}
|
||||
let token = wx.getStorageSync('AUTH_TOKEN_'+usertype);
|
||||
console.log(token);
|
||||
@ -37,5 +55,4 @@ Page({
|
||||
app.go(app.globalData.login_url);
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
@ -66,29 +66,24 @@ Page({
|
||||
},
|
||||
{
|
||||
case_status: 2,
|
||||
case_module: [0,1,4,5,6],
|
||||
case_module: [0,1,2,3,4,5,6,7,8],
|
||||
case_text: "请您先绑定结算银行卡"
|
||||
},
|
||||
{
|
||||
case_status: 3,
|
||||
case_module: [0,1,5,6,7],
|
||||
case_text: "请您先设置在线问诊价格"
|
||||
case_module: [7],
|
||||
case_text: "请您先进行多点执业认证"
|
||||
},
|
||||
{
|
||||
case_status: 4,
|
||||
case_module: [7],
|
||||
case_text: "请您先多点执业认证"
|
||||
case_text: "请您先进行多点执业认证"
|
||||
},
|
||||
{
|
||||
case_status: 5,
|
||||
case_module: [],
|
||||
case_text: "已全部通过"
|
||||
},
|
||||
{
|
||||
case_status: 6,
|
||||
case_module: [7],
|
||||
case_text: "请您先多点执业认证"
|
||||
},
|
||||
],
|
||||
contactKeFu: false,
|
||||
jiesuan_dialog_show: false,
|
||||
@ -126,10 +121,15 @@ Page({
|
||||
let funbox_height = wx.getSystemInfoSync().windowHeight - (this.data.stateHeight + this.data.navHeight + 10) - 55;//减去底部空白
|
||||
funbox_height = rpxTopx(funbox_height);
|
||||
// 147 userinfo的高度
|
||||
// 80 info_note
|
||||
// 155 认证部分的高度
|
||||
// 168 广告部分的高度
|
||||
// 40 自定义适配
|
||||
funbox_height = funbox_height - 147 - 20 - 30 - 20 - 155 - 30 - 168 - 20 - 30 - 30 - 30 - 30 - 40;
|
||||
// 50 info_note
|
||||
if(this.data.info.show_info_note){
|
||||
funbox_height = funbox_height - 50;
|
||||
}
|
||||
funbox_height = funbox_height / 3;
|
||||
if(funbox_height > 150) funbox_height = 150
|
||||
this.setData({
|
||||
@ -186,29 +186,7 @@ Page({
|
||||
},
|
||||
onHide(){
|
||||
console.log("index onHide() onHide() ");
|
||||
this.setData({
|
||||
swiperList: [],
|
||||
contactKeFu: false,
|
||||
info:{
|
||||
user_name: "医师姓名",
|
||||
not_accepted_inquiry_num: 0,
|
||||
accepting_inquiry_num: 0,
|
||||
info_shiming_status_txt: "未认证",
|
||||
info_shiming_status: "info_shiming_status_no",
|
||||
show_info_note: false,
|
||||
praise_rate: "100%",
|
||||
avg_response_time: 0,
|
||||
number_of_fans: 0,
|
||||
avatar: "https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/default_photo.png",
|
||||
reject_prescription_number: false,//处方管理小红点
|
||||
},
|
||||
iden_auth_status_txt: "未认证",
|
||||
multi_point_status_txt: "未认证",
|
||||
shiming_status_url: "",
|
||||
iden_auth_status_url: "/Pages/yishi/identity/index",
|
||||
multi_point_status_url: "/Pages/yishi/zhiye_identity/index",
|
||||
skeleton_loading: false
|
||||
})
|
||||
|
||||
wx.offCopyUrl(this.Copylistener) // 需传入与监听时同一个的函数对象
|
||||
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
@ -239,7 +217,7 @@ Page({
|
||||
this.getTabBar().startInterval()
|
||||
}
|
||||
this.getMenuButtonBound();
|
||||
this.getFunboxHeight();
|
||||
|
||||
api.yiShiIndex().then(response => {
|
||||
console.log(response);
|
||||
let avatar = response.data.info.avatar;
|
||||
@ -267,6 +245,10 @@ Page({
|
||||
let is_bind_bank = response.data.info.is_bind_bank;
|
||||
//是否参加专家图文接诊(0:否 1:是)
|
||||
let is_img_expert_reception = response.data.info.is_img_expert_reception;
|
||||
//是否参加专家快速接诊(0:否 1:是)
|
||||
let is_img_quick_reception = response.data.info.is_img_quick_reception;
|
||||
//是否参加专家公益接诊(0:否 1:是)
|
||||
let is_img_welfare_reception = response.data.info.is_img_welfare_reception;
|
||||
|
||||
this.setData({
|
||||
"info.idcard_status": idcard_status,
|
||||
@ -274,6 +256,8 @@ Page({
|
||||
"info.multi_point_status": multi_point_status,
|
||||
"info.is_bind_bank": is_bind_bank,
|
||||
"info.is_img_expert_reception": is_img_expert_reception,
|
||||
"info.is_img_quick_reception": is_img_quick_reception,
|
||||
"info.is_img_welfare_reception": is_img_welfare_reception,
|
||||
});
|
||||
|
||||
//iden_auth_status 0:未认证 1:认证通过 2:审核中 3:认证失败
|
||||
@ -307,6 +291,8 @@ Page({
|
||||
})
|
||||
}).then(res => {
|
||||
wx.stopPullDownRefresh()
|
||||
}).then(res =>{
|
||||
this.getFunboxHeight();
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
})
|
||||
@ -353,6 +339,7 @@ Page({
|
||||
gozhiye(e){
|
||||
let idcard_status = this.data.info.idcard_status;
|
||||
let iden_auth_status = this.data.info.iden_auth_status;
|
||||
let is_bind_bank = this.data.info.is_bind_bank;
|
||||
if(idcard_status != 1){
|
||||
this.setData({
|
||||
dialog_content: "请您先完成实名认证",
|
||||
@ -369,6 +356,14 @@ Page({
|
||||
});
|
||||
return;
|
||||
}
|
||||
if(is_bind_bank != 1){
|
||||
this.setData({
|
||||
dialog_content: "请您先绑定结算银行卡",
|
||||
shiming_status_url: "/Pages/yishi/bankcard/index",
|
||||
dialog_visible: true,
|
||||
});
|
||||
return;
|
||||
}
|
||||
app.go(e.currentTarget.dataset.url);
|
||||
},
|
||||
confirmDialog(){
|
||||
@ -390,8 +385,15 @@ Page({
|
||||
//多点执业认证
|
||||
let multi_point_status = this.data.info.multi_point_status;
|
||||
//绑定结算银行卡
|
||||
var is_bind_bank = this.data.info.is_bind_bank;
|
||||
let usertype = wx.getStorageSync('usertype');
|
||||
var is_bind_bank = this.data.info.is_bind_bank;
|
||||
//是否参加专家图文接诊(0:否 1:是)
|
||||
let is_img_expert_reception = this.data.info.is_img_expert_reception;
|
||||
//是否参加专家快速接诊(0:否 1:是)
|
||||
let is_img_quick_reception = this.data.info.is_img_quick_reception;
|
||||
//是否参加专家公益接诊(0:否 1:是)
|
||||
let is_img_welfare_reception = this.data.info.is_img_welfare_reception;
|
||||
|
||||
let usertype = wx.getStorageSync('usertype');
|
||||
let userID = wx.getStorageSync('user_id_'+usertype);
|
||||
wx.setStorageSync(userID+'_idcard_status', idcard_status);
|
||||
wx.setStorageSync(userID+'_iden_auth_status', iden_auth_status);
|
||||
@ -507,21 +509,23 @@ Page({
|
||||
});
|
||||
// return false;
|
||||
}
|
||||
|
||||
if(multi_point_status == 2){
|
||||
if(!this.data.default_dialog_show){
|
||||
this.setData({
|
||||
// dialog_visible: true,
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
"info.info_shiming_status_txt": "审核中",
|
||||
"info.info_shiming_status": "info_shiming_status_yes",
|
||||
shiming_status_url: "/Pages/yishi/zhiye_identity/index",
|
||||
dialog_content: "您的多点执业认证正在审核中",
|
||||
default_dialog_show: true
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
"info.info_shiming_status_txt": "审核中",
|
||||
"info.info_shiming_status": "info_shiming_status_yes",
|
||||
shiming_status_url: "/Pages/yishi/zhiye_identity/index",
|
||||
dialog_content: "您的多点执业认证正在审核中",
|
||||
default_dialog_show: true
|
||||
});
|
||||
// return false;
|
||||
}
|
||||
|
||||
if(multi_point_status == 3){
|
||||
if(!this.data.default_dialog_show){
|
||||
this.setData({
|
||||
@ -534,28 +538,62 @@ Page({
|
||||
shiming_status_url: "/Pages/yishi/zhiye_identity/index",
|
||||
dialog_content: "您的多点执业认证失败",
|
||||
default_dialog_show: true
|
||||
});
|
||||
});
|
||||
// return false;
|
||||
}
|
||||
|
||||
//开启在线问诊
|
||||
var is_img_expert_reception = this.data.info.is_img_expert_reception;
|
||||
if(is_img_expert_reception == 0 ){
|
||||
|
||||
if((is_img_expert_reception + is_img_quick_reception + is_img_welfare_reception) == 0){
|
||||
if(!this.data.default_dialog_show){
|
||||
this.setData({
|
||||
dialog_visible: true,
|
||||
});
|
||||
this.setData({
|
||||
// dialog_visible: true,
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
"info.info_shiming_status_txt": "开启在线问诊",
|
||||
"info.info_shiming_status": "info_shiming_status_yes",
|
||||
shiming_status_url: "/Pages/yishi/onlinesetup/index",
|
||||
dialog_content: "请您点击[在线问诊管理],开通在线问诊",
|
||||
default_dialog_show: true
|
||||
})
|
||||
dialog_content: "您的多点执业认证失败",
|
||||
// default_dialog_show: true
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if((is_img_expert_reception + is_img_quick_reception + is_img_welfare_reception) > 0){
|
||||
if(!this.data.default_dialog_show){
|
||||
this.setData({
|
||||
// dialog_visible: true,
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
"info.info_shiming_status_txt": "去接诊",
|
||||
"info.info_shiming_status": "info_shiming_status_yes",
|
||||
shiming_status_url: "/Pages/yishi/wenzhen_v2/wenzhen",
|
||||
dialog_content: "您的多点执业认证失败",
|
||||
// default_dialog_show: true
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//开启在线问诊
|
||||
// var is_img_expert_reception = this.data.info.is_img_expert_reception;
|
||||
// if(is_img_expert_reception == 0 ){
|
||||
// if(!this.data.default_dialog_show){
|
||||
// this.setData({
|
||||
// // dialog_visible: true,
|
||||
// });
|
||||
// }
|
||||
// this.setData({
|
||||
// "info.info_shiming_status_txt": "开启在线问诊",
|
||||
// "info.info_shiming_status": "info_shiming_status_yes",
|
||||
// shiming_status_url: "/Pages/yishi/onlinesetup/index",
|
||||
// dialog_content: "请您先前往在线问诊管理中,开通在线问诊",
|
||||
// default_dialog_show: true
|
||||
// })
|
||||
// return false;
|
||||
// }
|
||||
|
||||
if(!app.globalData.jiesuan_dialog_show){
|
||||
this.setData({
|
||||
jiesuan_dialog_visible: true,
|
||||
@ -600,12 +638,16 @@ Page({
|
||||
let is_bind_bank = this.data.info.is_bind_bank;
|
||||
//是否参加专家图文接诊(0:否 1:是)
|
||||
let is_img_expert_reception = this.data.info.is_img_expert_reception;
|
||||
//是否参加专家快速接诊(0:否 1:是)
|
||||
let is_img_quick_reception = this.data.info.is_img_quick_reception;
|
||||
//是否参加专家公益接诊(0:否 1:是)
|
||||
let is_img_welfare_reception = this.data.info.is_img_welfare_reception;
|
||||
let statusArr = [];
|
||||
|
||||
// 未实名认证和医师身份认证 0
|
||||
// 已实名认证,未医师身份认证 1
|
||||
// 已实名认证和医师身份认证,未绑定结算银行卡 2
|
||||
// 已实名认证和医生身份认证,已绑定结算银行卡 没开通了在线问诊3
|
||||
// 已实名认证和医生身份认证,已绑定结算银行卡 未开通多点执业认证3
|
||||
// 已实名认证和医师身份认证且绑定结算银行卡,开通了在线问诊,未开通多点执业认证 4
|
||||
// 已实名认证和医师身份认证且绑定结算银行卡,开通了在线问诊,已开通多点执业认证 5
|
||||
if(idcard_status == 0 && iden_auth_status == 0){
|
||||
@ -617,18 +659,17 @@ Page({
|
||||
if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank != 1){
|
||||
statusArr.push(2);
|
||||
}
|
||||
if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && is_img_expert_reception != 1){
|
||||
if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && multi_point_status != 1 &&
|
||||
(is_img_expert_reception + is_img_quick_reception + is_img_welfare_reception) == 0){
|
||||
statusArr.push(3);
|
||||
}
|
||||
if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && is_img_expert_reception == 1 && multi_point_status != 1){
|
||||
if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && multi_point_status != 1 &&
|
||||
(is_img_expert_reception + is_img_quick_reception + is_img_welfare_reception) > 0){
|
||||
statusArr.push(4);
|
||||
}
|
||||
if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && is_img_expert_reception == 1 && multi_point_status == 1){
|
||||
if(idcard_status == 1 && iden_auth_status == 1 && is_bind_bank == 1 && multi_point_status == 1){
|
||||
statusArr.push(5);
|
||||
}
|
||||
if(idcard_status == 1 && iden_auth_status == 1 && multi_point_status != 1){
|
||||
statusArr.push(6);
|
||||
}
|
||||
|
||||
let retult = true;
|
||||
statusArr.forEach(status => {
|
||||
|
||||
@ -105,6 +105,7 @@ page{
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
margin-left: 20rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
.info_note_txt{
|
||||
font-size: 28rpx;
|
||||
|
||||
@ -395,7 +395,7 @@ Page({
|
||||
if(payload) {
|
||||
console.log("payload: ",payload.data);
|
||||
let payloadJson = JSON.parse(payload.data);
|
||||
text = payloadJson.title.replace(/-/g, "");
|
||||
text = payloadJson.title.replaceAll(/-/g, "").replaceAll(/—/g, "");
|
||||
}
|
||||
lastMessage.messageForShow = text;
|
||||
}
|
||||
@ -428,6 +428,10 @@ Page({
|
||||
if(item.inquiry_status == 3){
|
||||
totalUnreadCount = totalUnreadCount + 1;
|
||||
session_item.message_dot = true;
|
||||
let dot_name = "dot_"+inquiry_type
|
||||
this.setData({
|
||||
[dot_name]: true
|
||||
})
|
||||
}else{
|
||||
session_item.message_dot = false;
|
||||
}
|
||||
@ -435,6 +439,7 @@ Page({
|
||||
session_list[inquiry_type - 1].push(session_item);
|
||||
})
|
||||
|
||||
|
||||
wx.setStorageSync(userID+'_wenzhen_info', totalUnreadCount);
|
||||
|
||||
|
||||
|
||||
@ -349,7 +349,7 @@
|
||||
<van-button data-from="doctorauthiden" disabled="{{iden_auth_disabled}}" color="#3CC7C0" custom-style="border-radius: 20rpx;" type="primary" block bind:click="addDoctorAuthIden">{{iden_auth_status_txt}}</van-button>
|
||||
</view>
|
||||
<view class="sub_button" wx:else>
|
||||
<van-button color="#3CC7C0" data-from="myinfo" disabled="{{iden_auth_status == 2}}" custom-style="border-radius: 20rpx;" type="primary" block bind:click="addDoctorAuthIden">{{iden_auth_status_txt}}</van-button>
|
||||
<van-button color="#3CC7C0" data-from="myinfo" disabled custom-style="border-radius: 20rpx;" type="primary" block bind:click="addDoctorAuthIden">{{iden_auth_status_txt}}</van-button>
|
||||
</view>
|
||||
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ Component({
|
||||
//返回到首页
|
||||
_backhome() {
|
||||
wx.navigateTo({
|
||||
url: '/Pages/index/index',
|
||||
url: '/Pages/index/index?from=navbar',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ Component({
|
||||
},
|
||||
onGoHome() {
|
||||
wx.reLaunch({
|
||||
url: '/Pages/index/index',
|
||||
url: '/Pages/index/index?from=navbar',
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
@ -32,7 +32,7 @@ Component({
|
||||
//返回到首页
|
||||
_backhome() {
|
||||
wx.navigateTo({
|
||||
url: '/Pages/index/index',
|
||||
url: '/Pages/index/index?from=navbar',
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user