|
@@ -8,7 +8,7 @@ import Card from '@designer-hub/app/src/components/card.vue'
|
|
|
import SectionHeading from '@designer-hub/app/src/components/section-heading.vue'
|
|
|
import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
|
import DataForm from '@/components/data-form.vue'
|
|
|
-import { appTaskReport, getTaskDetail } from '../../../../core/libs/requests'
|
|
|
+import {appTaskReport, getTaskDetail, taskReceive} from '../../../../core/libs/requests'
|
|
|
import { useUserStore } from '../../../../store'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import dayjs from 'dayjs'
|
|
@@ -70,15 +70,26 @@ const submitTask = async (data) => {
|
|
|
uni.hideLoading()
|
|
|
publishState.value = false
|
|
|
}
|
|
|
-// {
|
|
|
-// "id": 5092,
|
|
|
-// "taskId": 24266,
|
|
|
-// "brokerId": 22306,
|
|
|
-// "reason": "不香",
|
|
|
-// "remark": "你猜",
|
|
|
-// "num": 0,
|
|
|
-// "crateTime": ""
|
|
|
-// }
|
|
|
+const acceptingOrders = async () => {
|
|
|
+ uni.showLoading()
|
|
|
+ const res = await taskReceive({
|
|
|
+ brokerId: userInfo.value.userId,
|
|
|
+ taskId: taskDetails.value.id,
|
|
|
+ orders: true,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ initData()
|
|
|
+}
|
|
|
+const acceptingNoOrders = async () => {
|
|
|
+ uni.showLoading()
|
|
|
+ const res = await taskReceive({
|
|
|
+ brokerId: userInfo.value.userId,
|
|
|
+ taskId: taskDetails.value.id,
|
|
|
+ orders: false,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ initData()
|
|
|
+}
|
|
|
onLoad(async (query: { taskId: string }) => {
|
|
|
taskId.value = query.taskId
|
|
|
await initData()
|
|
@@ -291,6 +302,7 @@ onLoad(async (query: { taskId: string }) => {
|
|
|
<template v-if="taskDetails?.finalType == 1 && taskDetails?.receive">
|
|
|
<div class="flex items-center justify-between gap-3">
|
|
|
<div
|
|
|
+ @click="acceptingNoOrders"
|
|
|
class="grow shrink basis-0 px-5 py-3 bg-[#f2f3ff] rounded-md justify-center items-center gap-1 flex"
|
|
|
>
|
|
|
<div
|
|
@@ -300,6 +312,7 @@ onLoad(async (query: { taskId: string }) => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
|
+ @click="acceptingOrders"
|
|
|
class="grow shrink basis-0 px-5 py-3 bg-[#2357e9] rounded-md justify-center items-center gap-1 flex"
|
|
|
>
|
|
|
<div
|