优化任务卡片逻辑,提升性能
This commit is contained in:
parent
23e616a1a4
commit
19af0b6fda
@ -3,8 +3,11 @@
|
||||
<view class="personnel_list">
|
||||
<view class="cards">
|
||||
<view class="cards_head">
|
||||
<text style="font-size: 32rpx">任务名称: {{ datas.title }}</text>
|
||||
<text>点击查看</text>
|
||||
<view style="font-size: 32rpx; display: flex;padding-right: 16rpx;">
|
||||
<view style="flex-shrink: 0;margin-right: 10rpx;">任务名称: </view>
|
||||
<view>{{ datas.title }}</view>
|
||||
</view>
|
||||
<view style="flex-shrink: 0;">点击查看</view>
|
||||
</view>
|
||||
<view class="cards_content">
|
||||
<view class="right" style="width: 100%">
|
||||
@ -67,9 +70,10 @@
|
||||
<block v-if="datas.type == 44">
|
||||
{{extend.not_done_count||0}}/{{extend.total||0}}
|
||||
</block>
|
||||
<block v-if="datas.type == 45">
|
||||
<block v-else-if="datas.type == 45">
|
||||
{{extend.done_count||0}}/{{extend.total||0}}
|
||||
</block>
|
||||
<block v-else>进行中</block>
|
||||
</block>
|
||||
<block v-else>进行中</block>
|
||||
</view>
|
||||
@ -123,7 +127,6 @@
|
||||
},
|
||||
methods: {
|
||||
navTo(url) {
|
||||
if (this.isTimeInRange()) return Toast('任务正在结算中')
|
||||
if (url) {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
@ -138,26 +141,34 @@
|
||||
} else Toast('暂未开放')
|
||||
},
|
||||
clickTask() {
|
||||
if (this.isTimeInRange()) return Toast('任务正在结算中');
|
||||
// if ((this.$props.datas.type != 31) && this.$props.datas.status !== 2 && this.$props.datas.status !== 1) {
|
||||
// return this.$props.datas.status == 3 ? Toast('任务已完成!') : Toast('任务已结束!');
|
||||
// }
|
||||
if (this.$props.datas.type == 31) {
|
||||
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
|
||||
switch (this.$props.datas.type) {
|
||||
case 31:
|
||||
if (this.$store.state.app.userInfo.admin_id) this.navTo(
|
||||
`/subpkg/captain/captain?task_id=${this.$props.datas?.id}`);
|
||||
else this.navTo(`/subpkg/archives/archives?task_id=${this.$props.datas?.id}`);
|
||||
} else if (this.$props.datas.type == 32) {
|
||||
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
|
||||
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`)
|
||||
} else if (this.$props.datas.type == 33) {
|
||||
break;
|
||||
case 32:
|
||||
this.navTo(`/subpkg/property/vehicle?task_id=${this.$props.datas?.id}`);
|
||||
break;
|
||||
case 33:
|
||||
let is_show = true;
|
||||
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}`)
|
||||
} else if (this.$props.datas.type == 34) {
|
||||
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`)
|
||||
} else if (this.$props.datas.type == 35) {
|
||||
this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`)
|
||||
} else this.navTo('');
|
||||
this.navTo(`/subpkg/blockTransaction/blockTransaction?task_id=${this.$props.datas?.id}&is_show=${is_show}`);
|
||||
break;
|
||||
case 34:
|
||||
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`);
|
||||
break;
|
||||
case 35:
|
||||
this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`);
|
||||
break;
|
||||
default:
|
||||
this.navTo('');
|
||||
break;
|
||||
}
|
||||
},
|
||||
isTimeInRange() {
|
||||
const now = new Date();
|
||||
@ -284,7 +295,7 @@
|
||||
padding: 28rpx;
|
||||
background-color: $theme-oa-color;
|
||||
color: white;
|
||||
height: 100rpx;
|
||||
min-height: 100rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user