From a79f1452b30f89983f153699e7183b202c18d50d Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 9 Sep 2023 14:27:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=EF=BC=9A=E5=A7=90=E5=A7=90=E7=82=B9=E5=87=BB=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=90=8E=E7=95=8C=E9=9D=A2=E7=96=AF=E7=8B=82=E9=97=AA=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Login/components/LoginForm.vue | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index ffadf8b5..e8d01721 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -230,6 +230,7 @@ const getCookie = () => { } } } +const loading = ref() // ElLoading.service 返回的实例 // 登录 const handleLogin = async (params) => { loginLoading.value = true @@ -244,7 +245,7 @@ const handleLogin = async (params) => { if (!res) { return } - ElLoading.service({ + loading.value = ElLoading.service({ lock: true, text: '正在加载系统中...', background: 'rgba(0, 0, 0, 0.7)' @@ -264,13 +265,9 @@ const handleLogin = async (params) => { } else { push({ path: redirect.value || permissionStore.addRouters[0].path }) } - } catch { - loginLoading.value = false } finally { - setTimeout(() => { - const loadingInstance = ElLoading.service() - loadingInstance.close() - }, 400) + loginLoading.value = false + loading.value.close() } } From 7e511d1e4f0b7c412245b43bd56f36074564a616 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 9 Sep 2023 20:51:33 +0800 Subject: [PATCH 2/4] =?UTF-8?q?mall-order=EF=BC=9A=E4=BF=AE=E5=A4=8D=20tod?= =?UTF-8?q?o=20=E6=8F=90=E5=88=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/trade/order/index.ts | 5 ++--- src/config/axios/service.ts | 5 ----- src/views/mall/trade/afterSale/detail/index.vue | 3 ++- src/views/mall/trade/order/detail/index.vue | 7 ++++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index 6f55b573..80669c57 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -51,11 +51,10 @@ export interface OrderVO { avatar?: string } // 订单操作日志 - logs?: logs[] + logs?: OrderLogRespVO[] } -// TODO @puhui999:OrderLogRespVO 会不会更好哈。 -export interface logs { +export interface OrderLogRespVO { content?: string createTime?: Date userType?: number diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index bc6dbe73..1a4741b6 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -191,11 +191,6 @@ service.interceptors.response.use( } return Promise.reject('error') } else { - // TODO @puhui999:这个先不用支持哈; - // 前端处理 data 为 null 的情况,进行提示 - if (data.msg !== '') { - ElNotification.error({ title: msg }) - } return data } }, diff --git a/src/views/mall/trade/afterSale/detail/index.vue b/src/views/mall/trade/afterSale/detail/index.vue index d539dbe5..a7bdf5ec 100644 --- a/src/views/mall/trade/afterSale/detail/index.vue +++ b/src/views/mall/trade/afterSale/detail/index.vue @@ -195,7 +195,8 @@ const getDetail = async () => { if (id) { const res = await AfterSaleApi.getAfterSale(id) // 没有表单信息则关闭页面返回 - if (res === null) { + if (res == null) { + message.notifyError('售后订单不存在') close() } formData.value = res diff --git a/src/views/mall/trade/order/detail/index.vue b/src/views/mall/trade/order/detail/index.vue index d329b810..40f2a664 100644 --- a/src/views/mall/trade/order/detail/index.vue +++ b/src/views/mall/trade/order/detail/index.vue @@ -245,9 +245,10 @@ const { params } = useRoute() // 查询参数 const getDetail = async () => { const id = params.orderId as unknown as number if (id) { - const res = (await TradeOrderApi.getOrder(id)) as TradeOrderApi.OrderVO + const res = (await TradeOrderApi.getOrder(66666)) as TradeOrderApi.OrderVO // 没有表单信息则关闭页面返回 - if (res === null) { + if (res == null) { + message.error('交易订单不存在') close() } formData.value = res @@ -259,7 +260,7 @@ const { delView } = useTagsViewStore() // 视图操作 const { push, currentRoute } = useRouter() // 路由 const close = () => { delView(unref(currentRoute)) - push({ name: 'TradeAfterSale' }) + push({ name: 'TradeOrder' }) } /** 复制 */ From 615763d4156d04dded8281e905433a011b063ef5 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sat, 9 Sep 2023 23:08:28 +0800 Subject: [PATCH 3/4] =?UTF-8?q?order=EF=BC=9A=E5=AE=8C=E5=96=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=81=9A=E5=90=88=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/trade/order/index.vue | 82 +++++++++++++++++----------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index dec14eaa..61037d64 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -104,13 +104,19 @@