优化页面

This commit is contained in:
haomingming
2023-03-17 10:13:35 +08:00
parent dea1555b9b
commit 589c2cf823
81 changed files with 894 additions and 524 deletions
+58 -24
View File
@@ -10,26 +10,57 @@ Page({
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '医师身份认证', //导航栏 中间的标题
},
navHeight: 0,
stateHeight: 0,
height: app.globalData.height,
//选项卡
stickyProps: {
zIndex: 2,
zIndex: 999999,
offsetTop: (app.globalData.height * 2)
},
selected_tab: 0,
panel_2_disabled: true,
next_btn_disabled: false,
next_btn_txt: "下一步",
realname: "",
idcard: ""
},
getMenuButtonBound() {
let stateHeight = 0; // 接收状态栏高度
const navHeight = wx.getMenuButtonBoundingClientRect().height; // 获取胶囊高度
let top = 0;
wx.getSystemInfo({
success(res) {
stateHeight = res.statusBarHeight;
},
});
top = wx.getMenuButtonBoundingClientRect().top - stateHeight; // 获取top值
console.log('navHeight', navHeight);
console.log('top', top);
this.setData({
// navHeight: navHeight + top * 2, // 导航栏高度
navHeight, // 导航栏高度
stateHeight: stateHeight + top, // 状态栏高度
});
this.setData({
"stickyProps.offsetTop": this.data.stateHeight + this.data.navHeight + 10
})
},
onLoad(){
let _this = this;
//获取实名认证信息
api.getDoctorAuthReal().then(response => {
console.log(response);
if(response.data){
this.setData({
realname:response.data.card_name,
idcard:response.data.card_num,
next_btn_txt: "已认证,不可修改",
next_btn_disabled: true,
});
if(response.data.length == 0){
return;
}
this.setData({
realname:response.data.card_name,
idcard:response.data.card_num,
next_btn_txt: "已认证,不可修改",
next_btn_disabled: true,
panel_2_disabled: false,
});
}).catch(errors => {
console.error(errors);
})
@@ -229,7 +260,7 @@ Page({
},
onShow(){
console.log("onshow()....");
this.getMenuButtonBound();
},
doUploadFile(event) {
console.log("index douploadFIle: ", event);
@@ -308,6 +339,7 @@ Page({
//新增实名认证信息
postDoctorAuthReal(){
let _this = this;
const realname = this.data.realname.trim();
const idcard = this.data.idcard.trim();
@@ -335,25 +367,27 @@ Page({
return false;
}
wx.requestSubscribeMessage({
tmplIds: ['kUy70xHlr7ADo4aIHiictM4Te7MSec3E5kHsYvFQu40'],
success (res) {
console.log(res)
var params = {
card_name: realname,
card_num: idcard,
}
api.postDoctorAuthReal(params).then(response => {
console.log(response);
}).catch(errors => {
console.error(errors);
})
}
var params = {
card_name: realname,
card_num: idcard,
}
api.postDoctorAuthReal(params).then(response => {
console.log(response);
_this.setData({
panel_2_disabled: false,
selected_tab: 1
})
}).catch(errors => {
console.error(errors);
})
},
onTabsChange(event) {
console.log(`Change tab, tab-panel value is ${event.detail.value}.`);
this.setData({
selected_tab: event.detail.value
})
},
onTabsClick(event) {
console.log(`Click tab, tab-panel value is ${event.detail.value}.`);
+13 -8
View File
@@ -1,10 +1,11 @@
<!-- <nav-bar navbar-data='{{navbarData}}' style="margin-bottom: {{height*2 + 20}}px;"></nav-bar> -->
<te-nav-bar navbar-data='{{navbarData}}'></te-nav-bar>
<view class="container" style="height: calc(100vh - 96rpx - {{height}}px);">
<view class="container">
<view class="tabs">
<t-tabs
defaultValue="{{0}}"
sticky
defaultValue="{{ selected_tab }}"
value="{{selected_tab}}"
sticky="{{true}}"
stickyProps="{{stickyProps}}"
bind:change="onTabsChange"
bind:click="onTabsClick"
@@ -14,7 +15,7 @@
custom-style="font-size: 32rpx"
>
<!-- 实名认证tab -->
<t-tab-panel label="实名认证" value="0" style="{{tabPanelstyle}}">
<t-tab-panel label="实名认证" value="0" style="{{tabPanelstyle}}" catchtouchmove='true'>
<van-cell-group>
<van-field
@@ -38,7 +39,6 @@
required
clearable
custom-style="font-size:30rpx;"
border="{{ false }}"
/>
</van-cell-group>
@@ -57,10 +57,15 @@
</t-tab-panel>
<!-- 医师身份认证 -->
<t-tab-panel label="医师身份认证" value="1" style="{{tabPanelstyle}}">
<myprofile />
<t-tab-panel label="医师身份认证" value="1" disabled style="{{tabPanelstyle}}" wx:if="{{panel_2_disabled}}">
<myprofile wx:if="{{selected_tab == 1}}" />
</t-tab-panel>
<t-tab-panel label="医师身份认证" value="1" style="{{tabPanelstyle}}" wx:if="{{!panel_2_disabled}}">
<myprofile wx:if="{{selected_tab == 1}}" />
</t-tab-panel>
</t-tabs>
</view>
<van-toast id="van-toast" />
+9 -1
View File
@@ -85,7 +85,7 @@
}
.bottom_next{
width: 95vw;
margin: 530rpx auto;
margin: 530rpx auto 0 auto;
}
.sub_button{
width: 95vw;
@@ -167,4 +167,12 @@
.zhuanchang_btn--confirm {
color: #3cc7c0;
}
.van-picker__columns {
height: 264px !important;
top: 40px !important;
}
.van-search {
top: -270px !important;
position: relative !important;
}