新增任务提交

This commit is contained in:
weipengfei 2023-09-13 16:58:54 +08:00
parent 33205f116c
commit bc41409366
2 changed files with 237 additions and 254 deletions

View File

@ -11,21 +11,15 @@
<view class="" style="display: flex"> <view class="" style="display: flex">
<view>任务状态 :</view> <view>任务状态 :</view>
<view class="text" style="color: #ff7c32"> <view class="text" style="color: #ff7c32">
<text v-if="datas.status == 3" style="color: #488f00" <text v-if="datas.status == 3" style="color: #488f00">已完成</text>
>已完成</text <text v-else-if="datas.status == 5" style="color: #ccc">已关闭</text>
> <block v-else-if="
<text v-else-if="datas.status == 5" style="color: #ccc"
>已关闭</text
>
<block
v-else-if="
datas.type == 31 || datas.type == 31 ||
datas.type == 32 || datas.type == 32 ||
datas.type == 33 || datas.type == 33 ||
datas.type == 34 || datas.type == 34 ||
datas.type == 35 datas.type == 35
" ">
>
<block v-if="datas.extend && datas.extend.informationg"> <block v-if="datas.extend && datas.extend.informationg">
{{ {{
(datas.extend.informationg.update (datas.extend.informationg.update
@ -37,13 +31,11 @@
: 0) : 0)
}} }}
</block> </block>
<block <block v-else-if="
v-else-if="
datas.extend && datas.extend &&
datas.extend.transaction && datas.extend.transaction &&
datas.extend.transaction.arr datas.extend.transaction.arr
" ">
>
{{ {{
(datas.extend.transaction.arr.transaction_pool (datas.extend.transaction.arr.transaction_pool
? datas.extend.transaction.arr.transaction_pool ? datas.extend.transaction.arr.transaction_pool
@ -57,57 +49,34 @@
<!-- <text style="color: #488F00;margin-left: 26rpx;">{{(datas.extend.transaction.arr.transaction_pool?datas.extend.transaction.arr.transaction_pool:1)+'元'}}</text> --> <!-- <text style="color: #488F00;margin-left: 26rpx;">{{(datas.extend.transaction.arr.transaction_pool?datas.extend.transaction.arr.transaction_pool:1)+'元'}}</text> -->
</block> </block>
<block v-else-if="datas.extend && datas.extend.update"> <block v-else-if="datas.extend && datas.extend.update">
<text <text v-if="
v-if="
(datas.extend.update.transfer && (datas.extend.update.transfer &&
datas.extend.update.transfer.lnglat[0]) || datas.extend.update.transfer.lnglat[0]) ||
datas.status == 3 datas.status == 3
" " style="color: #488f00">抵达终点</text>
style="color: #488f00" <text v-else-if="
>抵达终点</text
>
<text
v-else-if="
datas.extend.update.terminus && datas.extend.update.terminus &&
datas.extend.update.terminus.lnglat[0] datas.extend.update.terminus.lnglat[0]
" ">抵达中转点</text>
>抵达中转点</text
>
<text v-else>进行中</text> <text v-else>进行中</text>
</block> </block>
<block v-else>进行中</block> <block v-else>进行中</block>
</block> </block>
</view> </view>
</view> </view>
<view <view style="
style="
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
" ">
>
<view> <view>
<text>完成时间 :</text> <text>完成时间 :</text>
<text>{{ datas.end_time }}</text> <text>{{ datas.end_time }}</text>
</view> </view>
<text <text v-if="datas.status == 2 || datas.status == 1" style="background-color: #ff7c32"
v-if="datas.status == 2 || datas.status == 1" class="status">进行中</text>
style="background-color: #ff7c32" <text v-if="datas.status == 3" style="background-color: #488f00" class="status">已完成</text>
class="status" <text v-if="datas.status == 5" style="background-color: #ccc" class="status">已关闭</text>
>进行中</text
>
<text
v-if="datas.status == 3"
style="background-color: #488f00"
class="status"
>已完成</text
>
<text
v-if="datas.status == 5"
style="background-color: #ccc"
class="status"
>已关闭</text
>
</view> </view>
<view class=""> <view class="">
<text>任务金额 :</text> <text>任务金额 :</text>
@ -194,13 +163,9 @@ export default {
//TODO handle the exception //TODO handle the exception
} }
}, },
computed: {
total_price () {
return this.datas?.extend?.transaction?.arr?.transaction_pool ? this.datas.extend.transaction.arr.total_price += +this.datas.extend.transaction.arr.transaction_pool : this.datas.extend.transaction.arr.total_price
}
},
methods: { methods: {
navTo(url) { navTo(url) {
if(this.isTimeInRange()) return Toast('任务正在结算中')
if (url) { if (url) {
uni.showLoading({ uni.showLoading({
title: '加载中', title: '加载中',
@ -221,7 +186,8 @@ export default {
// } // }
if (this.$props.datas.type == 31) { if (this.$props.datas.type == 31) {
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr)) // 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}`); 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 this.navTo(`/subpkg/archives/archives?task_id=${this.$props.datas?.id}`);
} else if (this.$props.datas.type == 32) { } else if (this.$props.datas.type == 32) {
// this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr)) // this.navTo('/subpkg/fileTask/fileTask?id=' + JSON.stringify(this.$props.datas?.extend?.informationg?.arr))
@ -232,8 +198,25 @@ export default {
this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`) this.navTo(`/subpkg/otherTask/otherTask?task_id=${this.$props.datas?.id}`)
} else if (this.$props.datas.type == 35) { } else if (this.$props.datas.type == 35) {
this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`) this.navTo(`/subpkg/buyShare/buyShare?task_id=${this.$props.datas?.id}`)
} } else this.navTo('');
else this.navTo(''); },
isTimeInRange() {
const now = new Date();
const startTime = new Date(now.getTime());
const endTime = new Date(now.getTime());
// 22:55:00
startTime.setHours(22);
startTime.setMinutes(55);
startTime.setSeconds(0);
// 23:59:59
endTime.setHours(23);
endTime.setMinutes(59);
endTime.setSeconds(59);
//
return now >= startTime && now <= endTime;
} }
} }
} }

View File

@ -51,9 +51,9 @@
</view> </view>
</view> --> </view> -->
<view class="item" v-for="(item, index) in list" :key="item.id"> <view class="item" v-for="(item, index) in list" :key="item.id">
<view class="top"> 账单日期{{ item.create_time }} </view> <view class="top"> 账单日期: {{ item.create_time }} </view>
<view class="t_bottom"> <view class="t_bottom">
<view class="order">订单编号{{ item.order_sn }}</view> <view class="order">订单编号: {{ item.order_sn }}</view>
<view class="price">交易额: {{ item.total_price }}</view> <view class="price">交易额: {{ item.total_price }}</view>
</view> </view>
</view> </view>