|
@@ -74,24 +74,48 @@ const submitTask = async () => {
|
|
|
publishState.value = false
|
|
|
}
|
|
|
const acceptingOrders = async () => {
|
|
|
- await uni.showLoading()
|
|
|
- const res = await taskReceive({
|
|
|
- brokerId: userInfo.value.userId,
|
|
|
- taskId: taskDetails.value.id,
|
|
|
- orders: true,
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否确认接受该任务?',
|
|
|
+ showCancel: true,
|
|
|
+ cancelText: '取消',
|
|
|
+ confirmText: '确定',
|
|
|
+ success: async function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ await uni.showLoading()
|
|
|
+ const res = await taskReceive({
|
|
|
+ brokerId: userInfo.value.userId,
|
|
|
+ taskId: taskDetails.value.id,
|
|
|
+ orders: true,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ await initData()
|
|
|
+ } else if (res.cancel) {
|
|
|
+ }
|
|
|
+ },
|
|
|
})
|
|
|
- uni.hideLoading()
|
|
|
- await initData()
|
|
|
}
|
|
|
const acceptingNoOrders = async () => {
|
|
|
- await uni.showLoading()
|
|
|
- const res = await taskReceive({
|
|
|
- brokerId: userInfo.value.userId,
|
|
|
- taskId: taskDetails.value.id,
|
|
|
- orders: false,
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '是否确认不接该任务?',
|
|
|
+ showCancel: true,
|
|
|
+ cancelText: '取消',
|
|
|
+ confirmText: '确定',
|
|
|
+ success: async function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ await uni.showLoading()
|
|
|
+ const res = await taskReceive({
|
|
|
+ brokerId: userInfo.value.userId,
|
|
|
+ taskId: taskDetails.value.id,
|
|
|
+ orders: false,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ await initData()
|
|
|
+ } else if (res.cancel) {
|
|
|
+ }
|
|
|
+ },
|
|
|
})
|
|
|
- uni.hideLoading()
|
|
|
- await initData()
|
|
|
}
|
|
|
onLoad(async (query?: Record<string | 'taskId', string>) => {
|
|
|
taskId.value = query?.taskId
|