优化
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
// Pages/yishi/index/index.js
|
||||
import { API } from './../../../utils/network/api'
|
||||
import { rpxTopx } from './../../../utils/util'
|
||||
const api = new API()
|
||||
const app = getApp()
|
||||
Page({
|
||||
@@ -92,27 +93,44 @@ Page({
|
||||
skeleton_loading: true,
|
||||
contactKeFu: false,
|
||||
jiesuan_dialog_show: false,
|
||||
jiesuan_dialog_visible: false
|
||||
jiesuan_dialog_visible: false,
|
||||
aa: 0
|
||||
},
|
||||
// 获取状态栏信息
|
||||
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, // 状态栏高度
|
||||
});
|
||||
},
|
||||
getFunboxHeight(){
|
||||
console.log("109: ", rpxTopx(109))
|
||||
console.log("113: ", rpxTopx(113))
|
||||
const { statusBarHeight } = wx.getSystemInfoSync();
|
||||
console.log("statusBarHeight: ", rpxTopx(statusBarHeight));
|
||||
let funbox_height = wx.getSystemInfoSync().windowHeight - (this.data.stateHeight + this.data.navHeight + 10) - 55;//减去底部空白
|
||||
funbox_height = rpxTopx(funbox_height);
|
||||
// 147 userinfo的高度
|
||||
// 155 认证部分的高度
|
||||
// 150 广告部分的高度
|
||||
// 40 自定义适配
|
||||
funbox_height = funbox_height - 147 - 20 - 30 - 20 - 155 - 30 - 150 - 20 - 30 - 30 - 30 - 30 - 40;
|
||||
funbox_height = funbox_height / 3;
|
||||
if(funbox_height > 150) funbox_height = 150
|
||||
this.setData({
|
||||
funbox_height: funbox_height
|
||||
})
|
||||
},
|
||||
confirmJieSuanDialog(){
|
||||
this.setData({
|
||||
jiesuan_dialog_visible: false
|
||||
@@ -145,7 +163,7 @@ Page({
|
||||
})
|
||||
}
|
||||
this.getMenuButtonBound();
|
||||
|
||||
this.getFunboxHeight();
|
||||
api.yiShiIndex().then(response => {
|
||||
console.log(response);
|
||||
let avatar = response.data.info.avatar;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
|
||||
<view class="container">
|
||||
<view class="container" id="container">
|
||||
<!-- 顶部背景 -->
|
||||
<view class="top_bk"></view>
|
||||
<!-- 顶部标题 -->
|
||||
@@ -12,7 +12,7 @@
|
||||
<view class="info_top">
|
||||
<view class="info_photo" bindtap="go" data-url="/Pages/yishi/myinfo/index">
|
||||
<!-- 跳转我的信息 -->
|
||||
<t-avatar alt="头像" class="avatar" size="large" image="{{info.avatar}}" />
|
||||
<t-avatar alt="头像" class="avatar" size="medium" image="{{info.avatar}}" />
|
||||
</view>
|
||||
<view class="info_content">
|
||||
<view class="info_mobile">{{info.user_name}}</view>
|
||||
@@ -90,7 +90,7 @@
|
||||
</view>
|
||||
<!-- 功能模块 -->
|
||||
<view class="fun_box">
|
||||
<view bindtap="go" data-moudle="3" data-url="/Pages/yishi/myprofile/index" class="fun_box_item">
|
||||
<view bindtap="go" data-moudle="3" data-url="/Pages/yishi/myprofile/index" class="fun_box_item" style="height: {{funbox_height}}rpx;">
|
||||
<van-image class="fun_box_item_img"
|
||||
fit="heightFix"
|
||||
height="70rpx"
|
||||
@@ -98,7 +98,7 @@
|
||||
/>
|
||||
<text class="fun_box_item_txt">简介管理</text>
|
||||
</view>
|
||||
<view bindtap="go" data-moudle="4" data-url="/Pages/yishi/onlinesetup/index" class="fun_box_item">
|
||||
<view bindtap="go" data-moudle="4" data-url="/Pages/yishi/onlinesetup/index" class="fun_box_item" style="height: {{funbox_height}}rpx;">
|
||||
<van-image class="fun_box_item_img"
|
||||
fit="widthFix"
|
||||
width="70rpx"
|
||||
@@ -106,7 +106,7 @@
|
||||
/>
|
||||
<text class="fun_box_item_txt">在线问诊管理</text>
|
||||
</view>
|
||||
<view bindtap="go" data-moudle="5" data-url="/Pages/yishi/kuaisusetup/index" class="fun_box_item">
|
||||
<view bindtap="go" data-moudle="5" data-url="/Pages/yishi/kuaisusetup/index" class="fun_box_item" style="height: {{funbox_height}}rpx;">
|
||||
<van-image class="fun_box_item_img"
|
||||
fit="widthFix"
|
||||
width="70rpx"
|
||||
@@ -114,7 +114,7 @@
|
||||
/>
|
||||
<text class="fun_box_item_txt">快速问诊管理</text>
|
||||
</view>
|
||||
<view bindtap="go" data-moudle="6" data-url="/Pages/yishi/yizhensetup/index" class="fun_box_item">
|
||||
<view bindtap="go" data-moudle="6" data-url="/Pages/yishi/yizhensetup/index" class="fun_box_item" style="height: {{funbox_height}}rpx;">
|
||||
<van-image class="fun_box_item_img"
|
||||
fit="widthFix"
|
||||
width="70rpx"
|
||||
@@ -122,7 +122,7 @@
|
||||
/>
|
||||
<text class="fun_box_item_txt">公益问诊管理</text>
|
||||
</view>
|
||||
<view bindtap="go" data-moudle="7" data-url="/Pages/yishi/chufangsetup/index" class="fun_box_item">
|
||||
<view bindtap="go" data-moudle="7" data-url="/Pages/yishi/chufangsetup/index" class="fun_box_item" style="height: {{funbox_height}}rpx;">
|
||||
<van-image class="fun_box_item_img"
|
||||
fit="widthFix"
|
||||
width="70rpx"
|
||||
@@ -132,7 +132,7 @@
|
||||
<t-badge style="display: flex;align-items: center;" dot="{{info.reject_prescription_number ? true : false}}" offset="{{ ['-14rpx', '10rpx'] }}" class="wrapper" content="处方管理" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="fun_box_item" data-moudle="8" bindtap="contactKeFu">
|
||||
<view class="fun_box_item" data-moudle="8" bindtap="contactKeFu" style="height: {{funbox_height}}rpx;">
|
||||
<van-image class="fun_box_item_img"
|
||||
fit="widthFix"
|
||||
width="70rpx"
|
||||
|
||||
@@ -181,7 +181,7 @@
|
||||
}
|
||||
.fun_box_item{
|
||||
width: 40vw;
|
||||
height: 150rpx;
|
||||
height: 110rpx;
|
||||
background-color: #FAFAFA;
|
||||
border-radius: 10rpx;
|
||||
margin: 10rpx 0;
|
||||
|
||||
Reference in New Issue
Block a user