diff --git a/src/tools/apiTools.js b/src/tools/apiTools.js index 3695b420..5ede10d4 100644 --- a/src/tools/apiTools.js +++ b/src/tools/apiTools.js @@ -1,9 +1,9 @@ import { searchPendingOrderByObject, searchPendingOrderByHash, - searchPendingOrderByKeys, -} from "@/assets/api.js"; -import { Sweetalert } from "zent"; + searchPendingOrderByKeys +} from "@/assets/api.js" +import { Sweetalert } from "zent" // === 公用接口函数 === /** @@ -17,13 +17,13 @@ import { Sweetalert } from "zent"; */ const commonSearchOrder = (data, apiType = 3) => { return new Promise(async (res, rej) => { - let searchRes = null; + let searchRes = null if (apiType === 1) { - searchRes = await searchPendingOrderByHash(data); + searchRes = await searchPendingOrderByHash(data) } else if (apiType === 2) { - searchRes = await searchPendingOrderByKeys(data); + searchRes = await searchPendingOrderByKeys(data) } else { - searchRes = await searchPendingOrderByObject(data); + searchRes = await searchPendingOrderByObject(data) } if (searchRes.code === 200) { if (searchRes.data.have === true) { @@ -32,24 +32,26 @@ const commonSearchOrder = (data, apiType = 3) => { closeBtn: true, title: "确认操作", content: ( -

该key批次(key、兑换码),下面有待领取订单,是否继续作废 ?

+

+ 该key批次(key、兑换码),下面有{searchRes.data.order.status_text}订单,是否继续作废 ? +

), onConfirm() { - res(2); + res(2) }, onCancel() { - res(0); + res(0) }, className: "questModal", - parentComponent: this, - }); + parentComponent: this + }) } else { - res(1); + res(1) } } else { - rej(searchRes); + rej(searchRes) } - }); -}; + }) +} -export { commonSearchOrder }; +export { commonSearchOrder }