add file
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
import { API } from './../../../utils/network/api'
|
||||
const util = require('./../../../utils/util')
|
||||
let api = new API()
|
||||
const app = getApp()
|
||||
Page({
|
||||
data: {
|
||||
navbarData: {
|
||||
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
|
||||
title: '我的账户', //导航栏 中间的标题
|
||||
},
|
||||
height: app.globalData.height,
|
||||
dateVisible: false,
|
||||
dateText: "",
|
||||
dateValue: ['2023','3'],
|
||||
select_date: "",
|
||||
balance_account: "",
|
||||
amount_total_month: "",
|
||||
withdrawal_amount_month: "",
|
||||
bill: [],
|
||||
years: [
|
||||
{ label: '2023年', value: '2023' },
|
||||
{ label: '2024年', value: '2024' },
|
||||
],
|
||||
seasons: [
|
||||
{ label: '1月', value: '1' },
|
||||
{ label: '2月', value: '2' },
|
||||
{ label: '3月', value: '3' },
|
||||
{ label: '4月', value: '4' },
|
||||
{ label: '5月', value: '5' },
|
||||
{ label: '6月', value: '6' },
|
||||
{ label: '7月', value: '7' },
|
||||
{ label: '8月', value: '8' },
|
||||
{ label: '9月', value: '9' },
|
||||
{ label: '10月', value: '10' },
|
||||
{ label: '11月', value: '11' },
|
||||
{ label: '12月', value: '12' },
|
||||
]
|
||||
},
|
||||
onShow(){
|
||||
let now_date = new Date();
|
||||
let now_datearr = util.getDateArr(now_date);
|
||||
console.log(now_datearr);
|
||||
let year = now_datearr[0];
|
||||
let month = now_datearr[1];
|
||||
let mmdateValue = [''+year+'',''+month+''];
|
||||
this.setData({
|
||||
dateValue: mmdateValue,
|
||||
dateText: month+"月"
|
||||
})
|
||||
|
||||
let date = this.data.dateValue.join("-");
|
||||
this.getDoctorCenterAccount(date);
|
||||
},
|
||||
onColumnChange(e) {
|
||||
console.log('picker onColumnChange:', e);
|
||||
},
|
||||
|
||||
onPickerChange(e) {
|
||||
const { key } = e.currentTarget.dataset;
|
||||
const { value } = e.detail;
|
||||
|
||||
console.log('picker onPickerChange:', e.detail);
|
||||
this.setData({
|
||||
[`${key}Visible`]: false,
|
||||
[`${key}Value`]: value,
|
||||
[`${key}Text`]: value[1]+"月",
|
||||
});
|
||||
|
||||
let date = value.join("-");
|
||||
this.getDoctorCenterAccount(date);
|
||||
},
|
||||
|
||||
onPickerCancel(e) {
|
||||
const { key } = e.currentTarget.dataset;
|
||||
console.log(e, '取消');
|
||||
console.log('picker1 onPickerCancel:');
|
||||
this.setData({
|
||||
[`${key}Visible`]: false,
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
onSeasonPicker() {
|
||||
this.setData({ dateVisible: true });
|
||||
},
|
||||
|
||||
showPop(){
|
||||
this.setData({
|
||||
dateVisible: true
|
||||
});
|
||||
},
|
||||
|
||||
getDoctorCenterAccount(date){
|
||||
//获取医生我的账户数据
|
||||
api.getDoctorCenterAccount({date:date}).then(response => {
|
||||
console.log(response);
|
||||
this.setData({
|
||||
balance_account: response.data.balance_account,
|
||||
amount_total_month: response.data.amount_total_month,
|
||||
withdrawal_amount_month: response.data.withdrawal_amount_month,
|
||||
bill: response.data.bill,
|
||||
})
|
||||
}).catch(errors => {console.error(errors);})
|
||||
},
|
||||
goDetail(e){
|
||||
let url = e.currentTarget.dataset.url;
|
||||
let md = e.currentTarget.dataset.md;
|
||||
let date = this.data.dateValue[0]+"-"+md;
|
||||
console.log(date);
|
||||
app.go(url+"?date="+date);
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"te-nav-bar": "/commpents/te_navbar",
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-picker": "tdesign-miniprogram/picker/picker",
|
||||
"t-picker-item": "tdesign-miniprogram/picker-item/picker-item",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"van-cell": "@vant/weapp/cell/index",
|
||||
"van-cell-group": "@vant/weapp/cell-group/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
|
||||
<view class="container" style="height: calc(100vh - 96rpx - {{height}}px);">
|
||||
<view class="top">
|
||||
<view class="top_txt">
|
||||
<view style="font-size: 30rpx;">
|
||||
账户当前余额:
|
||||
</view>
|
||||
<view style="font-size: 40rpx;">
|
||||
¥{{balance_account}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="monthbox">
|
||||
<view class="month" bindtap="showPop">{{dateText}}<van-icon name="arrow-down" color="#999" size="40rpx" /></view>
|
||||
<view class="account">
|
||||
<view class="account_left">预计收入:¥{{amount_total_month}}</view>
|
||||
<view class="account_right">当月已提取:¥{{withdrawal_amount_month}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="txt_title">账单</view>
|
||||
<view class="content">
|
||||
<van-cell bindtap="goDetail" data-url="/Pages/yishi/orderdetail/index" data-md="{{item.month}}-{{item.day}}" title-style="font-size: 30rpx;" title="{{item.month}}月{{item.day}}日" value="+{{item.total_amount}}元" is-link wx:for="{{bill}}" />
|
||||
</view>
|
||||
|
||||
<t-image custom-style="position: fixed; right: 0;bottom: 262rpx;" src="https://gdxz-hospital.oss-cn-chengdu.aliyuncs.com/applet/doctor/static/images/yishi/account_rule.png" mode="heightFix" height="84rpx" aria-label="role" />
|
||||
|
||||
<t-picker
|
||||
visible="{{dateVisible}}"
|
||||
value="{{dateValue}}"
|
||||
data-key="date"
|
||||
title="选择日期"
|
||||
cancelBtn="取消"
|
||||
confirmBtn="确认"
|
||||
bindchange="onPickerChange"
|
||||
bindpick="onColumnChange"
|
||||
bindcancel="onPickerCancel"
|
||||
>
|
||||
<t-picker-item options="{{years}}"></t-picker-item>
|
||||
<t-picker-item options="{{seasons}}"></t-picker-item>
|
||||
</t-picker>
|
||||
|
||||
|
||||
</view>
|
||||
@@ -0,0 +1,66 @@
|
||||
.container{
|
||||
background-color: #F4F4F4;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
.top{
|
||||
width: 92vw;
|
||||
margin: 50rpx auto 0 auto;
|
||||
background-color: #3CC7C0;
|
||||
height: 150rpx;
|
||||
border-radius: 20rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
.top_txt{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 110rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
.monthbox{
|
||||
width: 92vw;
|
||||
margin: -40rpx auto 0 auto;
|
||||
background-color: #ffffff;
|
||||
height: 200rpx;
|
||||
border-radius: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.month{
|
||||
flex: 3;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 50rpx;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
.account{
|
||||
flex: 2;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
color: #666666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.account_left{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.account_right{
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
.txt_title{
|
||||
font-size: 30rpx;
|
||||
margin: 20rpx 0;
|
||||
position: relative;
|
||||
left: 4vw;
|
||||
}
|
||||
.content{
|
||||
width: 92vw;
|
||||
background-color: #fff;
|
||||
margin: 0 auto;
|
||||
border-radius: 20rpx;
|
||||
padding: 20rpx 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user