add file
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
import { API } from './../../../utils/network/api'
|
||||
let api = new API()
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
title: "个人中心",
|
||||
navHeight: 0,
|
||||
stateHeight: 0,
|
||||
user_name: "",
|
||||
iden_auth_status: "",
|
||||
idcard_status: "",
|
||||
multi_point_status: "",
|
||||
avatar: "",
|
||||
balance_account: "",
|
||||
estimate_income: "",
|
||||
doctor_id: ""
|
||||
},
|
||||
|
||||
// 获取状态栏信息
|
||||
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, // 状态栏高度
|
||||
});
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
console.log("onshow ");
|
||||
if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
||||
this.getTabBar().setData({
|
||||
active: 2 //数字是当前页面在tabbar的索引,如我的查询页索引是2,因此这边为2,同理首页就为0,审批页面为1
|
||||
})
|
||||
}
|
||||
this.getMenuButtonBound();
|
||||
},
|
||||
onLoad(){
|
||||
//获取个人中心数据
|
||||
api.getDoctorCenter().then(response => {
|
||||
this.setData({
|
||||
user_name: response.data.user_name,
|
||||
iden_auth_status: response.data.iden_auth_status,
|
||||
idcard_status: response.data.idcard_status,
|
||||
multi_point_status: response.data.multi_point_status,
|
||||
balance_account: response.data.balance_account,
|
||||
doctor_id: response.data.doctor_id,
|
||||
estimate_income: response.data.estimate_income
|
||||
})
|
||||
|
||||
let avatar = response.data.avatar;
|
||||
if(avatar && (avatar.indexOf("http") == -1)){
|
||||
avatar = api.getStaticHost() + avatar;
|
||||
}
|
||||
this.setData({
|
||||
"avatar": avatar
|
||||
})
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
})
|
||||
},
|
||||
go(e){
|
||||
let url = e.currentTarget.dataset.url;
|
||||
app.go(url)
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-avatar": "tdesign-miniprogram/avatar/avatar",
|
||||
"van-button": "@vant/weapp/button/index",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"van-cell": "@vant/weapp/cell/index",
|
||||
"van-cell-group": "@vant/weapp/cell-group/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<view class="container">
|
||||
<view class="top"></view>
|
||||
<view class="title" style="top: {{stateHeight}}px;height: {{navHeight}}px;line-height: {{navHeight}}px;">{{ title }}</view>
|
||||
<view bindtap="go" data-url="/Pages/yishi/myinfo/index" class="info_box" style="top: {{stateHeight}}px;">
|
||||
<!-- 跳转我的信息 -->
|
||||
<view class="photo">
|
||||
<t-avatar class="avatar" size="large" image="{{avatar}}" />
|
||||
</view>
|
||||
<view class="info">
|
||||
<view class="name">{{user_name}}</view>
|
||||
<view class="renzheng">
|
||||
<view class="yishi">已医师认证></view>
|
||||
<view class="zhiye">未多点执业认证></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="icon">
|
||||
<van-icon name="arrow" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="account" style="top: {{stateHeight}}px;">
|
||||
<view class="account_top">
|
||||
<view class="account_top_left">
|
||||
<view class="account_title">
|
||||
<view>
|
||||
账户余额(元)
|
||||
</view>
|
||||
</view>
|
||||
<view class="account_num">
|
||||
<view>
|
||||
<text style="font-size: 42rpx;">¥</text>
|
||||
<text style="font-size: 64rpx;">{{balance_account}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="account_top_right">
|
||||
<navigator url="/Pages/yishi/cash/index" open-type="navigate" hover-class="other-navigator-hover">
|
||||
<van-button custom-style="text-indent: 20rpx;letter-spacing: 20rpx;text-align: center;border-radius: 10rpx;padding: 20rpx 50rpx;" color="linear-gradient(310deg, #FF931A 0%, #FF931A 0%, #FCB75D 100%);">
|
||||
提现
|
||||
</van-button>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="account_bottom">
|
||||
<view style="font-size: 30rpx;color: #666666;">当日预计收益金额:</view>
|
||||
<view style="font-size: 42rpx;color: #333333;">¥{{estimate_income}}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="content" style="top: calc(20rpx + {{stateHeight}}px);">
|
||||
<van-cell url="/Pages/yishi/myaccount/index" link-type="navigateTo" title-style="font-size: 30rpx;" title="我的账户" is-link />
|
||||
<van-cell url="/Pages/yishi/bankcard/index" link-type="navigateTo" title-style="font-size: 30rpx;" title="我的银行卡" is-link />
|
||||
<van-cell url="/Pages/yishi/mycard/index" link-type="navigateTo" title-style="font-size: 30rpx;" title="我的名片" is-link />
|
||||
<van-cell url="/Pages/yishi/appraise/index?doctor_id={{doctor_id}}" link-type="navigateTo" title-style="font-size: 30rpx;" title="患者评价" is-link />
|
||||
<van-cell url="/Pages/yishi/quickreply/index" link-type="navigateTo" title-style="font-size: 30rpx;" title="常用语" is-link border="{{ false }}"/>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,117 @@
|
||||
.container{
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
background-color: #F5F5F5;
|
||||
color: #fff;
|
||||
position: relative;
|
||||
}
|
||||
.top{
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
background-color: #3CC7C0;
|
||||
position: absolute;
|
||||
}
|
||||
.title{
|
||||
position:relative;
|
||||
text-align: center;
|
||||
}
|
||||
.info_box{
|
||||
width: 100%;
|
||||
height: 200rpx;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.info{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.name{
|
||||
height: 50rpx;
|
||||
font-size: 36rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
.renzheng{
|
||||
display: flex;
|
||||
font-size: 26rpx;
|
||||
margin-top: 15rpx;
|
||||
}
|
||||
.yishi,.zhiye{
|
||||
background-color: #00A59D;
|
||||
border-radius: 20rpx;
|
||||
height: 44rpx;
|
||||
line-height: 44rpx;
|
||||
padding: 0 20rpx;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
.photo{
|
||||
flex: 3;
|
||||
text-align: center;
|
||||
}
|
||||
.info{
|
||||
flex: 8;
|
||||
}
|
||||
.icon{
|
||||
flex: 1;
|
||||
text-align: right;
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
.account{
|
||||
background-color: rgb(255, 255, 255);
|
||||
width: 92vw;
|
||||
margin: 0 auto;
|
||||
height: 272rpx;
|
||||
position: relative;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.account_top{
|
||||
flex: 2;
|
||||
display: flex;
|
||||
}
|
||||
.account_top_left{
|
||||
flex: 3;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: black;
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.account_title{
|
||||
flex: 9;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.account_num{
|
||||
flex: 10;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.account_top_right{
|
||||
flex: 2;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.account_bottom{
|
||||
flex: 1;
|
||||
border-top: 1px solid #E5E5E5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
.content{
|
||||
width: 92vw;
|
||||
background-color: #fff;
|
||||
margin: 0 auto;
|
||||
position: relative;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user