From 1c765f37cf5434ba6b1fa77656b882462322722e Mon Sep 17 00:00:00 2001 From: Yer <17633066053@163.com> Date: Wed, 10 May 2023 13:51:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20:sparkles:=20=E6=96=B0=E5=A2=9Epc?= =?UTF-8?q?=E7=AB=AF=20=E5=95=86=E5=93=81=E4=B8=8B=E6=9E=B6=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/components/empty/Main.vue | 3 ++- buyer/src/pages/GoodsDetail.vue | 26 +++++++++++++++++++++++--- buyer/src/plugins/request.js | 2 +- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/buyer/src/components/empty/Main.vue b/buyer/src/components/empty/Main.vue index 95bd4dd5..65ca3a37 100644 --- a/buyer/src/components/empty/Main.vue +++ b/buyer/src/components/empty/Main.vue @@ -7,6 +7,7 @@ alt="" />

{{ _Title }}

+ @@ -35,6 +36,6 @@ export default { } p { cursor: pointer; - + } diff --git a/buyer/src/pages/GoodsDetail.vue b/buyer/src/pages/GoodsDetail.vue index 63a421f0..89685d2c 100644 --- a/buyer/src/pages/GoodsDetail.vue +++ b/buyer/src/pages/GoodsDetail.vue @@ -12,7 +12,7 @@ {{ item.name }} -
+
{{ goodsMsg.data.storeName @@ -32,6 +32,12 @@ + +
+ + +
+
@@ -41,6 +47,7 @@ import Search from "@/components/Search"; import ShopHeader from "@/components/header/ShopHeader"; import ShowGoods from "@/components/goodsDetail/ShowGoods"; +import empty from "@/components/empty/Main"; import ShowGoodsDetail from "@/components/goodsDetail/ShowGoodsDetail"; import { goodsSkuDetail } from "@/api/goods"; import { @@ -68,11 +75,16 @@ export default { categoryBar: [], // 分类 storeCollected: false, // 商品收藏 storeMsg: {}, // 店铺信息 + takeDownSale:false, // 是否下架 }; }, methods: { + // 跳转首页或商品页面 + target(url){ + this.$router.push({path: url}) + }, // 点击规格 targetClickSku (val) { this.getGoodsDetail(val); @@ -139,11 +151,14 @@ export default { } } else { this.$Message.error(res.message); - this.$router.push("/"); + this.isLoading = false } }) .catch((e) => { - this.$router.push("/"); + this.isLoading = false + if(e.code === 11001){ + this.takeDownSale = true + } }); }, goGoodsList (currIndex) { @@ -179,6 +194,7 @@ export default { ShopHeader, ShowGoods, ShowGoodsDetail, + empty }, }; @@ -209,4 +225,8 @@ export default { } } } +.sale-btn{ + margin:10px 0 + +} diff --git a/buyer/src/plugins/request.js b/buyer/src/plugins/request.js index 20503d87..0fe57a84 100644 --- a/buyer/src/plugins/request.js +++ b/buyer/src/plugins/request.js @@ -160,7 +160,7 @@ service.interceptors.response.use( Message.error(errorData.message || _message); } } - return Promise.reject(error); + return Promise.reject(errorData); } );