diff --git a/buyer/src/api/member.js b/buyer/src/api/member.js index 301b7414..eeb7de21 100644 --- a/buyer/src/api/member.js +++ b/buyer/src/api/member.js @@ -59,7 +59,7 @@ export function withdrawalApply (params) { }); } -// 收藏商品、店铺 +// 收藏商品 export function collectGoods (type, id) { return request({ url: `/buyer/member/collection/add/${type}/${id}`, @@ -68,7 +68,16 @@ export function collectGoods (type, id) { }); } -// 取消 收藏商品、店铺 +// 收藏店铺 +export function collectStore (type, id) { + return request({ + url: `/buyer/member/storeCollection/add/${type}/${id}`, + method: Method.POST, + needToken: true + }); +} + +// 取消 收藏商品 export function cancelCollect (type, id) { return request({ url: `/buyer/member/collection/delete/${type}/${id}`, @@ -77,7 +86,16 @@ export function cancelCollect (type, id) { }); } -// 查看是否收藏 +// 取消 收藏店铺 +export function cancelStoreCollect (type, id) { + return request({ + url: `/buyer/member/storeCollection/delete/${type}/${id}`, + method: Method.DELETE, + needToken: true + }); +} + +// 查看是否收藏商品 export function isCollection (type, goodsId) { return request({ url: `/buyer/member/collection/isCollection/${type}/${goodsId}`, @@ -86,7 +104,16 @@ export function isCollection (type, goodsId) { }); } -// 会员收藏列表 +// 查看是否收藏店铺 +export function isStoreCollection (type, goodsId) { + return request({ + url: `/buyer/member/storeCollection/isCollection/${type}/${goodsId}`, + method: Method.GET, + needToken: true + }); +} + +// 会员收藏商品列表 export function collectList (params) { return request({ url: `/buyer/member/collection/${params.type}`, @@ -96,6 +123,16 @@ export function collectList (params) { }); } +// 会员收藏店铺列表 +export function storeCollectList (params) { + return request({ + url: `/buyer/member/storeCollection/${params.type}`, + method: Method.GET, + needToken: true, + params + }); +} + // 单个商品评价 export function goodsComment (params) { return request({ diff --git a/buyer/src/assets/images/default.png b/buyer/src/assets/images/default.png new file mode 100644 index 00000000..4f2b94c0 Binary files /dev/null and b/buyer/src/assets/images/default.png differ diff --git a/buyer/src/config/index.js b/buyer/src/config/index.js index e3fd5c56..135fe97e 100644 --- a/buyer/src/config/index.js +++ b/buyer/src/config/index.js @@ -18,4 +18,5 @@ module.exports = { aMapKey: "7f11113750315d8543daaf5c3ba353ca", //高德web端js申请的api key enableCDN: true, //生产环境 是否启用cdn加载 vue等js port: 10000, //端口 + inputMaxLength:'140' //全局输入框默认最大输入长度字 }; diff --git a/buyer/src/main.js b/buyer/src/main.js index e6f9e700..24d8e867 100644 --- a/buyer/src/main.js +++ b/buyer/src/main.js @@ -8,10 +8,15 @@ import * as filters from "./plugins/filters"; import store from "@/vuex/store"; import storage from "@/plugins/storage"; // 全局引入封装组件 -import { InstallAll } from "@/components/global.js"; +import {InstallAll} from "@/components/global.js"; + +const {aMapSecurityJsCode, title, inputMaxLength} = require("@/config"); + +const copyViewUi = {...ViewUI} +copyViewUi.Input.props.maxlength.default = inputMaxLength // 挂载最大输入值 +Vue.use(copyViewUi); + -const { aMapSecurityJsCode, title } = require("@/config"); -Vue.use(ViewUI); Vue.use(InstallAll); Vue.config.productionTip = false; diff --git a/buyer/src/pages/GoodsDetail.vue b/buyer/src/pages/GoodsDetail.vue index 14870db6..63a421f0 100644 --- a/buyer/src/pages/GoodsDetail.vue +++ b/buyer/src/pages/GoodsDetail.vue @@ -44,9 +44,9 @@ import ShowGoods from "@/components/goodsDetail/ShowGoods"; import ShowGoodsDetail from "@/components/goodsDetail/ShowGoodsDetail"; import { goodsSkuDetail } from "@/api/goods"; import { - cancelCollect, - collectGoods, - isCollection, + cancelStoreCollect, + collectStore, + isStoreCollection, getGoodsDistribution, } from "@/api/member"; import { getDetailById } from "@/api/shopentry"; @@ -121,7 +121,7 @@ export default { this.$set(this, "goodsMsg", res.result); // 判断是否收藏 if (this.Cookies.getItem("userInfo")) { - isCollection("STORE", this.goodsMsg.data.storeId).then((res) => { + isStoreCollection("STORE", this.goodsMsg.data.storeId).then((res) => { if (res.success && res.result) { this.storeCollected = true; } @@ -159,13 +159,13 @@ export default { async collect () { // 收藏店铺 if (this.storeCollected) { - let cancel = await cancelCollect("STORE", this.goodsMsg.data.storeId); + let cancel = await cancelStoreCollect("STORE", this.goodsMsg.data.storeId); if (cancel.success) { this.$Message.success("已取消收藏"); this.storeCollected = false; } } else { - let collect = await collectGoods("STORE", this.goodsMsg.data.storeId); + let collect = await collectStore("STORE", this.goodsMsg.data.storeId); if (collect.code === 200) { this.storeCollected = true; this.$Message.success("收藏店铺成功,可以前往个人中心我的收藏查看"); diff --git a/buyer/src/pages/Merchant.vue b/buyer/src/pages/Merchant.vue index 3cf82442..773d8ac8 100644 --- a/buyer/src/pages/Merchant.vue +++ b/buyer/src/pages/Merchant.vue @@ -108,7 +108,7 @@