feat: 新增pc端 商品下架功能

master
Yer 2023-05-10 13:51:24 +08:00
parent 724922dddc
commit 1c765f37cf
3 changed files with 26 additions and 5 deletions

View File

@ -7,6 +7,7 @@
alt=""
/>
<p v-if="_Title">{{ _Title }}</p>
<slot></slot>
</div>
</template>

View File

@ -12,7 +12,7 @@
{{ item.name }}
</BreadcrumbItem>
</Breadcrumb>
<div class="store-collect">
<div class="store-collect" v-if="!takeDownSale">
<span class="mr_10" v-if="goodsMsg.data">
<router-link :to="'Merchant?id=' + goodsMsg.data.storeId">{{
goodsMsg.data.storeName
@ -32,6 +32,12 @@
<!-- 商品详细展示 -->
<ShowGoodsDetail v-if="goodsMsg.data" :detail="goodsMsg"></ShowGoodsDetail>
<empty _Title='当前商品已下架' v-if="takeDownSale">
<div class="sale-btn">
<Button size="small" class="mr_10" @click="target('/')"></Button>
<Button size="small" @click="target('goodsList')"></Button>
</div>
</empty>
<Spin size="large" fix v-if="isLoading"></Spin>
<BaseFooter></BaseFooter>
</div>
@ -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
},
};
</script>
@ -209,4 +225,8 @@ export default {
}
}
}
.sale-btn{
margin:10px 0
}
</style>

View File

@ -160,7 +160,7 @@ service.interceptors.response.use(
Message.error(errorData.message || _message);
}
}
return Promise.reject(error);
return Promise.reject(errorData);
}
);