43 lines
756 B
JavaScript
43 lines
756 B
JavaScript
Page({
|
|
data: {
|
|
mode: '',
|
|
monthVisible: false,
|
|
month: '2021-09',
|
|
monthText: '',
|
|
|
|
// 指定选择区间起始值
|
|
start: '2000-01-01 00:00:00',
|
|
end: '2030-09-09 12:12:12',
|
|
},
|
|
showPicker(e) {
|
|
const { mode } = e.currentTarget.dataset;
|
|
this.setData({
|
|
mode,
|
|
[`${mode}Visible`]: true,
|
|
});
|
|
},
|
|
hidePicker() {
|
|
const { mode } = this.data;
|
|
this.setData({
|
|
[`${mode}Visible`]: false,
|
|
});
|
|
},
|
|
onConfirm(e) {
|
|
const { value } = e.detail;
|
|
const { mode } = this.data;
|
|
|
|
console.log('confirm', value);
|
|
|
|
this.setData({
|
|
[mode]: value,
|
|
[`${mode}Text`]: value,
|
|
});
|
|
|
|
this.hidePicker();
|
|
},
|
|
|
|
onColumnChange(e) {
|
|
console.log('pick', e.detail.value);
|
|
},
|
|
});
|