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