haomingming 9a392a445b 优化
2023-03-14 18:53:05 +08:00

73 lines
1.8 KiB
JavaScript

import { API } from './../../../utils/network/api'
const api = new API()
const app = getApp()
Page({
data: {
navbarData: {
showCapsule: 1, //是否显示左上角图标 1表示显示 0表示不显示
title: '提现记录', //导航栏 中间的标题
},
height: app.globalData.height,
record_list: [],
current_page: 0,
total: 0,
per_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: this.data.select_date}).then(response => {
console.log(response);
if(response.data.total > 0){
this.setData({
record_list: response.data.data,
current_page: response.data.current_page,
total: response.data.total,
per_page: response.data.per_page,
last_page: response.data.last_page,
})
}
}).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);
}
})