优化
This commit is contained in:
@@ -13,11 +13,21 @@ Page({
|
||||
current_page: 0,
|
||||
total: 0,
|
||||
per_page: 0,
|
||||
last_page: 0
|
||||
last_page: 0,
|
||||
dateVisible: false,
|
||||
select_date: '2023',
|
||||
years: [
|
||||
{ label: '2022年', value: '2022' },
|
||||
{ label: '2023年', value: '2023' },
|
||||
{ label: '2024年', value: '2024' },
|
||||
],
|
||||
},
|
||||
onLoad(){
|
||||
this.getDoctorWithdrawalRecord();
|
||||
},
|
||||
getDoctorWithdrawalRecord(){
|
||||
//获取提现数据
|
||||
api.getDoctorWithdrawalRecord({year:'2023'}).then(response => {
|
||||
api.getDoctorWithdrawalRecord({year: this.data.select_date}).then(response => {
|
||||
console.log(response);
|
||||
if(response.data.total > 0){
|
||||
this.setData({
|
||||
@@ -28,8 +38,36 @@ Page({
|
||||
last_page: response.data.last_page,
|
||||
})
|
||||
}
|
||||
}).catch(errors => {
|
||||
console.error(errors);
|
||||
}).catch(errors => { console.error(errors); })
|
||||
},
|
||||
onDatePicker() {
|
||||
this.setData({ dateVisible: true });
|
||||
},
|
||||
onPickerChange(e) {
|
||||
const { key } = e.currentTarget.dataset;
|
||||
const { value } = e.detail;
|
||||
|
||||
console.log('picker change:', e.detail);
|
||||
|
||||
this.setData({
|
||||
select_date: value
|
||||
})
|
||||
|
||||
this.getDoctorWithdrawalRecord();
|
||||
|
||||
},
|
||||
onColumnChange(e) {
|
||||
const { key } = e.currentTarget.dataset;
|
||||
const { value } = e.detail;
|
||||
|
||||
console.log('Column change:', e.detail);
|
||||
|
||||
},
|
||||
onPickerCancel(e) {
|
||||
const { key } = e.currentTarget.dataset;
|
||||
const { value } = e.detail;
|
||||
|
||||
console.log('picker Cancel:', e.detail);
|
||||
|
||||
}
|
||||
})
|
||||
@@ -3,6 +3,9 @@
|
||||
"usingComponents": {
|
||||
"te-nav-bar": "/commpents/te_navbar",
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"t-image": "tdesign-miniprogram/image/image"
|
||||
"van-empty": "@vant/weapp/empty/index",
|
||||
"t-image": "tdesign-miniprogram/image/image",
|
||||
"t-picker": "tdesign-miniprogram/picker/picker",
|
||||
"t-picker-item": "tdesign-miniprogram/picker-item/picker-item"
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@
|
||||
<te-nav-bar navbar-data='{{navbarData}}' ></te-nav-bar>
|
||||
<view class="container">
|
||||
<view class="top">
|
||||
<view class="top_txt">
|
||||
<view class="month">2022年<van-icon name="arrow-down" color="#fff" size="40rpx" /></view>
|
||||
<view class="top_txt" bindtap="onDatePicker">
|
||||
<view class="month">{{select_date}}年<van-icon name="arrow-down" color="#fff" size="40rpx" /></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="data_list">
|
||||
@@ -47,25 +47,23 @@
|
||||
<view class="data_item_bottom">个人所得税:¥12.00</view>
|
||||
</view>
|
||||
|
||||
<view class="data_item">
|
||||
<view class="data_item_top">
|
||||
<view class="data_item_top_icon">
|
||||
<t-image custom-style="" src="/static/images/yishi/bankcard/js_icon.png" mode="heightFix" height="50rpx" aria-label="role" />
|
||||
</view>
|
||||
<view class="data_item_top_content">
|
||||
<view class="name">张三三<text style="margin-left:20rpx;font-size: 28rpx;corlor:#999;">(尾号9900)</text></view>
|
||||
<view class="date">12.09 13:23</view>
|
||||
</view>
|
||||
<view class="data_item_top_num">
|
||||
<view class="jine">¥123.00</view>
|
||||
<view class="status_box">
|
||||
<view class="status status_ing">结算中</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="data_item_bottom">个人所得税:¥12.00</view>
|
||||
</view>
|
||||
|
||||
|
||||
<van-empty description="暂无数据" wx:if="{{record_list.length == 0}}" />
|
||||
|
||||
</view>
|
||||
|
||||
<t-picker
|
||||
visible="{{dateVisible}}"
|
||||
value="{{[select_date]}}"
|
||||
data-key="date"
|
||||
title="选择年份"
|
||||
cancelBtn="取消"
|
||||
confirmBtn="确认"
|
||||
bindchange="onPickerChange"
|
||||
bindpick="onColumnChange"
|
||||
bindcancel="onPickerCancel"
|
||||
>
|
||||
<t-picker-item options="{{years}}" />
|
||||
</t-picker>
|
||||
|
||||
</view>
|
||||
|
||||
@@ -93,4 +93,7 @@ page{
|
||||
justify-content: flex-end;
|
||||
margin-right: 20rpx;
|
||||
color: #666;
|
||||
}
|
||||
.t-picker__confirm{
|
||||
color: #3CC7C0 !important;
|
||||
}
|
||||
Reference in New Issue
Block a user