diff --git a/components/task/taskItem.vue b/components/task/taskItem.vue index b260f56..3575318 100644 --- a/components/task/taskItem.vue +++ b/components/task/taskItem.vue @@ -3,8 +3,11 @@ - 任务名称: {{ datas.title }} - 点击查看 + + 任务名称: + {{ datas.title }} + + 点击查看 @@ -67,9 +70,10 @@ {{extend.not_done_count||0}}/{{extend.total||0}} - + {{extend.done_count||0}}/{{extend.total||0}} + 进行中 进行中 @@ -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)) - 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) { - 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(''); + 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}`); + 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}`); + 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; }