diff --git a/buyer/public/config.js b/buyer/public/config.js index d7556570..39fb8a71 100644 --- a/buyer/public/config.js +++ b/buyer/public/config.js @@ -7,6 +7,10 @@ var BASE = { buyer: "https://buyer-api.pickmall.cn", seller: "https://store-api.pickmall.cn", manager: "https://admin-api.pickmall.cn" + // common: "http://192.168.0.105:8890", + // buyer: "http://192.168.0.105:8888", + // seller: "http://192.168.0.105:8889", + // manager: "http://192.168.0.105:8887" }, API_PROD: { common: "https://common-api.pickmall.cn", diff --git a/buyer/src/api/cart.js b/buyer/src/api/cart.js index 57d99878..c8d13461 100644 --- a/buyer/src/api/cart.js +++ b/buyer/src/api/cart.js @@ -212,3 +212,52 @@ export function receiptSelect (params) { params }); } + +/** + * 获取全部配送方式 + */ + export function shippingMethodList(params) { + return request({ + url: `/buyer/trade/carts/shippingMethodList`, + method: Method.GET, + needToken: true, + params: params, + }); +} + +/** + * 获取全部配送方式 + */ + export function storeAddressList(params) { + return request({ + url: `/buyer/store/address/shippingMethodList`, + method: Method.GET, + needToken: true, + params: params, + }); +} + +/** + * 设置自提地址ID + * @param addressId + */ + export function setStoreAddressId(storeAddressId,way) { + return request({ + url: `/buyer/trade/carts/storeAddress?storeAddressId=${storeAddressId}&way=${way}`, + method: Method.GET, + needToken: true, + }); +} + +/** + * 提交配送方式 + * @param params + */ + export function setShipMethod(params) { + return request({ + url: "/buyer/trade/carts/shippingMethod", + method: Method.PUT, + needToken: true, + params, + }); +} diff --git a/buyer/src/api/index.js b/buyer/src/api/index.js index 083631d2..3fe612ff 100644 --- a/buyer/src/api/index.js +++ b/buyer/src/api/index.js @@ -10,6 +10,15 @@ export function indexData(params) { }); } +// 获取自动发券 +export function getAutoCoup(){ + return request({ + url: "/buyer/promotion/coupon/activity", + method: Method.GET, + needToken: true, + }); +} + /** * 获取店铺楼层数据 */ diff --git a/buyer/src/api/shopentry.js b/buyer/src/api/shopentry.js index 96aa08f8..b1d178ae 100644 --- a/buyer/src/api/shopentry.js +++ b/buyer/src/api/shopentry.js @@ -75,3 +75,15 @@ export function applyStatus () { method: Method.GET }) } + +/** + * 获取自提点信息 + * @param storeId + */ + export function getStoreAddress(storeId,params) { + return request({ + url: `/buyer/store/address/page/${storeId}`, + method: Method.GET, + params + }); +} diff --git a/buyer/src/pages/GoodsDetail.vue b/buyer/src/pages/GoodsDetail.vue index da752845..14fdb13c 100644 --- a/buyer/src/pages/GoodsDetail.vue +++ b/buyer/src/pages/GoodsDetail.vue @@ -8,26 +8,18 @@
首页 - + {{ item.name }}
{{ - goodsMsg.data.storeName - }} + goodsMsg.data.storeName +}} - + {{ storeCollected ? "已收藏店铺" : "收藏店铺" }} 联系客服 @@ -36,11 +28,7 @@
- + @@ -66,14 +54,14 @@ import { getIMDetail } from "@/api/common"; import Storage from "../plugins/storage"; export default { name: "GoodsDetail", - beforeRouteEnter(to, from, next) { + beforeRouteEnter (to, from, next) { window.scrollTo(0, 0); next(); }, - created() { + created () { this.getGoodsDetail(); }, - data() { + data () { return { goodsMsg: {}, // 商品信息 isLoading: false, // 加载状态 @@ -85,7 +73,7 @@ export default { }, methods: { // 跳转im客服 - async IMService() { + async IMService () { // 获取访问Token let accessToken = Storage.getItem("accessToken"); await this.getIMDetailMethods(); @@ -95,25 +83,29 @@ export default { } window.open( this.IMLink + - "?token=" + - accessToken + - "&id=" + - this.goodsMsg.data.storeId + "?token=" + + accessToken + + "&id=" + + this.goodsMsg.data.storeId + + "&goodsId=" + + this.goodsMsg.data.goodsId + + "&skuId=" + + this.goodsMsg.data.id ); }, // 获取im信息 - async getIMDetailMethods() { + async getIMDetailMethods () { let res = await getIMDetail(); if (res.success) { this.IMLink = res.result; } }, // 点击规格 - targetClickSku(val) { + targetClickSku (val) { this.getGoodsDetail(val); }, // 获取商品详情 - getGoodsDetail(val) { + getGoodsDetail (val) { this.isLoading = true; const params = val || this.$route.query; @@ -179,7 +171,7 @@ export default { this.$router.push("/"); }); }, - goGoodsList(currIndex) { + goGoodsList (currIndex) { // 跳转商品列表 const arr = []; this.categoryBar.forEach((e, index) => { @@ -189,7 +181,7 @@ export default { }); return location.origin + "/goodsList?categoryId=" + arr.toString(); }, - async collect() { + async collect () { // 收藏店铺 if (this.storeCollected) { let cancel = await cancelCollect("STORE", this.goodsMsg.data.storeId); diff --git a/buyer/src/pages/Index.vue b/buyer/src/pages/Index.vue index 0cba5835..0a8b1c5a 100644 --- a/buyer/src/pages/Index.vue +++ b/buyer/src/pages/Index.vue @@ -1,5 +1,27 @@