新增任务卡片的类型,任务状态

This commit is contained in:
weipengfei 2023-09-22 10:15:25 +08:00
parent 8a6a6627aa
commit 5941c016c8

View File

@ -62,6 +62,15 @@
</block> </block>
<block v-else>进行中</block> <block v-else>进行中</block>
</block> </block>
<block
v-else-if="datas.type == 44||datas.type == 45||datas.type == 46||datas.type == 47||datas.type == 48||datas.type == 49||datas.type == 50">
<block v-if="datas.type == 44">
{{extend.not_done_count||0}}/{{extend.total||0}}
</block>
<block v-if="datas.type == 45">
{{extend.done_count||0}}/{{extend.total||0}}
</block>
</block>
<block v-else>进行中</block> <block v-else>进行中</block>
</view> </view>
</view> </view>
@ -106,19 +115,15 @@
}, },
data() { data() {
return { return {
extend: {}
}; };
}, },
created() { mounted() {
try { this.$props.datas.extend ? this.extend = this.$props.datas.extend : null;
} catch (e) {
//TODO handle the exception
}
}, },
methods: { methods: {
navTo(url) { navTo(url) {
if(this.isTimeInRange()) return Toast('任务正在结算中') if (this.isTimeInRange()) return Toast('任务正在结算中')
if (url) { if (url) {
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
@ -146,7 +151,7 @@
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`) this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`)
} else if (this.$props.datas.type == 33) { } else if (this.$props.datas.type == 33) {
let is_show = true; let is_show = true;
if(uni.$u.timeFormat(Date.now(), 'yyyy-mm-dd')!=this.$props.datas?.end_time) is_show = false; if (uni.$u.timeFormat(Date.now(), 'yyyy-mm-dd') != this.$props.datas?.end_time) is_show = false;
this.navTo(`/subpkg/blockTransaction/blockTransaction?task_id=${this.$props.datas?.id}&is_show=${is_show}`) this.navTo(`/subpkg/blockTransaction/blockTransaction?task_id=${this.$props.datas?.id}&is_show=${is_show}`)
} else if (this.$props.datas.type == 34) { } else if (this.$props.datas.type == 34) {
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`) this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`)
@ -158,17 +163,17 @@
const now = new Date(); const now = new Date();
const startTime = new Date(now.getTime()); const startTime = new Date(now.getTime());
const endTime = new Date(now.getTime()); const endTime = new Date(now.getTime());
// 22:55:00 // 22:55:00
startTime.setHours(22); startTime.setHours(22);
startTime.setMinutes(55); startTime.setMinutes(55);
startTime.setSeconds(0); startTime.setSeconds(0);
// 23:59:59 // 23:59:59
endTime.setHours(23); endTime.setHours(23);
endTime.setMinutes(59); endTime.setMinutes(59);
endTime.setSeconds(59); endTime.setSeconds(59);
// //
return now >= startTime && now <= endTime; return now >= startTime && now <= endTime;
} }