任务明细页面

This commit is contained in:
limqhz
2022-11-24 17:07:38 +08:00
parent 0a8e99c94c
commit ec41ce736d
106 changed files with 4892 additions and 48 deletions

52
pages/taskDetail/index.js Normal file
View File

@@ -0,0 +1,52 @@
let taskId = '';
Page({
data: {
mode: '',
dateVisible: false,
date: new Date('2021-12-23').getTime(), // 支持时间戳传入
dateText: '',
// 指定选择区间起始值
start: '2008-01-01 00:00:00',
end: '2040-12-31 23:59:59',
},
onLoad: function (options) {
taskId = options.id;
},
onShow() {
},
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('confim', value);
this.setData({
[mode]: value,
[`${mode}Text`]: value,
});
this.hidePicker();
},
onColumnChange(e) {
console.log('pick', e?.detail?.value);
},
});

View File

@@ -0,0 +1,5 @@
{
"usingComponents": {
"t-date-time-picker": "../../components/date-time-picker/date-time-picker"
}
}

View File

@@ -0,0 +1,25 @@
<t-input label="任务名" value="{{'任务的农安我i吗哇哦i对面'}}" placeholder="请输入任务名称" maxlength="{{10}}" clearable />
<t-cell
title="完成日期"
hover
note="{{dateText || '年 月 日'}}"
arrow
data-mode="date"
bindtap="showPicker"
class="test"
t-class="pannel-item"
t-class-note="{{dateText ? 'sub-text' : 'empty'}}"
/>
<t-date-time-picker
title="选择日期"
visible="{{dateVisible}}"
mode="date"
defaultValue="{{date}}"
format="YYYY-MM-DD"
bindchange="onConfirm"
bindpick="onColumnChange"
bindcancel="hidePicker"
start="{{start}}"
end="{{end}}"
></t-date-time-picker>
<t-input placeholder="最大输入10个字符" maxlength="{{10}}" clearable />

View File

@@ -0,0 +1,18 @@
.pannel-item {
font-size: 32rpx;
margin-bottom: 32rpx;
}
.pannel-item::after {
border: 0;
}
.sub-text {
color: #000;
opacity: 0.9;
}
.empty {
color: #000;
opacity: 0.32;
}