|
@@ -24,16 +24,50 @@ const status = ref<{ [key: number]: { title: string; bg: string; bgClass: string
|
|
|
6: { title: '待确认', bg: '', bgClass: 'bg-[#f04c47]' },
|
|
|
})
|
|
|
const acceptingOrders = async (item: AgentTask) => {
|
|
|
- uni.showLoading()
|
|
|
- const res = await taskReceive({ brokerId: userInfo.value.userId, taskId: item.id, orders: true })
|
|
|
- uni.hideLoading()
|
|
|
+ uni.showModal({
|
|
|
+ title: '',
|
|
|
+ content: '是否确认接受该任务?',
|
|
|
+ showCancel: true,
|
|
|
+ cancelText: '取消',
|
|
|
+ confirmText: '确认',
|
|
|
+ success: async function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.showLoading()
|
|
|
+ const res = await taskReceive({
|
|
|
+ brokerId: userInfo.value.userId,
|
|
|
+ taskId: item.id,
|
|
|
+ orders: true,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ } else if (res.cancel) {
|
|
|
+ /* empty */
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
+
|
|
|
// initData()
|
|
|
}
|
|
|
const acceptingNoOrders = async (item: AgentTask) => {
|
|
|
- uni.showLoading()
|
|
|
- const res = await taskReceive({ brokerId: userInfo.value.userId, taskId: item.id, orders: false })
|
|
|
- uni.hideLoading()
|
|
|
- // initData()
|
|
|
+ uni.showModal({
|
|
|
+ title: '',
|
|
|
+ content: '是否确认不接该任务?',
|
|
|
+ showCancel: true,
|
|
|
+ cancelText: '取消',
|
|
|
+ confirmText: '确认',
|
|
|
+ success: async function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.showLoading()
|
|
|
+ const res = await taskReceive({
|
|
|
+ brokerId: userInfo.value.userId,
|
|
|
+ taskId: item.id,
|
|
|
+ orders: false,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ } else if (res.cancel) {
|
|
|
+ /* empty */
|
|
|
+ }
|
|
|
+ },
|
|
|
+ })
|
|
|
}
|
|
|
const toDetail = () =>
|
|
|
uni.navigateTo({ url: `/pages/agent/tasks/detail/index?taskId=${props.options.id}` })
|