From d2ba7af3405a679628ff637395ac858b8d62f2ba Mon Sep 17 00:00:00 2001 From: YeMingfei666 <1619116647@qq.com> Date: Mon, 1 Dec 2025 10:50:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commons/utils/hasPermission.js | 1 + commons/utils/infoBox.js | 2 +- http/yskApi/http.js | 17 +- pagesCreateOrder/index/components/car.vue | 16 +- .../index/components/cart-goods-item.vue | 38 +++- pagesCreateOrder/index/index.vue | 198 ++++++++---------- .../table-order/components/choose-tables.vue | 14 +- .../table-order/components/controls.vue | 36 +++- .../table-order/components/goods-list.vue | 54 ++++- pagesCreateOrder/table-order/index.vue | 145 +++++++++---- pagesCreateOrder/util.js | 2 +- pagesOrder/detail/detail.vue | 2 +- pagesOrder/pay-order/pay-order.vue | 4 + stores/cart.js | 18 +- 14 files changed, 346 insertions(+), 201 deletions(-) diff --git a/commons/utils/hasPermission.js b/commons/utils/hasPermission.js index 8372d7c..9277ffe 100644 --- a/commons/utils/hasPermission.js +++ b/commons/utils/hasPermission.js @@ -143,6 +143,7 @@ export async function hasPermission(params) { if(loginType=='0'){ return true } + return true; params = returnFormatParams(params) if (!params) { return infoBox.showToast('未找到相关权限,请检查代码或在权限配置文件commons/utils/hasPermission.js文件进行修改或增加') diff --git a/commons/utils/infoBox.js b/commons/utils/infoBox.js index 6b57f3f..b3ab4ed 100644 --- a/commons/utils/infoBox.js +++ b/commons/utils/infoBox.js @@ -25,7 +25,7 @@ const model = { // error类型的提示 showErrorToast: (title, duration) => { - return model.showToast(title, duration, {icon: 'error'}) + return model.showToast(title, duration, {icon: 'none'}) }, showLoading: (title = '请稍后' ) => { diff --git a/http/yskApi/http.js b/http/yskApi/http.js index 99e8cac..cc84443 100644 --- a/http/yskApi/http.js +++ b/http/yskApi/http.js @@ -92,7 +92,6 @@ function commonsProcess(showLoading, httpReqCallback) { return Promise.reject(bodyData); // 跳转到catch函数 } - // http响应码不正确 if (statusCode != 200 && statusCode != 204 && statusCode != 201) { isShowErrorToast = true; @@ -101,19 +100,25 @@ function commonsProcess(showLoading, httpReqCallback) { infoBox.showToast(data.message || "服务器异常"); return Promise.reject(bodyData); // 跳转到catch函数 } + // 构造请求成功的响应数据 if (bodyData.code == 501) { return Promise.reject(bodyData); // 跳转到catch函数 } + if(data.code!==200){ + return Promise.reject(bodyData); // 跳转到catch函数 + } if (data.code == 200 && data.data === null) { return Promise.resolve(true); } + return Promise.resolve(bodyData.data); }) .catch((res) => { + console.log('res', res); if (res.code == 401 || res.code == 501) { storageManage.token(null, true); - infoBox.showErrorToast(res.message || "请登录").then(() => { + infoBox.showErrorToast(res.message || res.msg || "请登录").then(() => { uni.redirectTo({ url: "/pages/login/index", }); @@ -122,16 +127,12 @@ function commonsProcess(showLoading, httpReqCallback) { } if (res.status == 500) { - infoBox.showErrorToast(res.message || "服务器异常").then(() => {}); + infoBox.showErrorToast(res.message ||res.msg || "服务器异常").then(() => {}); } + infoBox.showErrorToast(res.message||res.msg || "服务器异常").then(() => {}); reqFinishFunc(); // 请求完毕的动作 - // 如果没有提示错误, 那么此处提示 异常。 - if (!isShowErrorToast) { - infoBox.showErrorToast(`请求网络异常`); - } - return Promise.reject(res); }) .finally(() => { diff --git a/pagesCreateOrder/index/components/car.vue b/pagesCreateOrder/index/components/car.vue index 037c98f..dbcdb1c 100644 --- a/pagesCreateOrder/index/components/car.vue +++ b/pagesCreateOrder/index/components/car.vue @@ -94,7 +94,7 @@ {{ item.number }} -