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 @@
+
+
+
+
+ 活动优惠券
+
+
+
+
+
+ ¥{{item.price | unitPrice}}
+ {{item.discount}}折
+ 满{{item.consumeThreshold}}元可用
+ 使用范围:{{useScope(item.scopeType, item.storeName)}}
+ 有效期:{{item.endTime}}
+
+
+
+
+
+
+
@@ -22,8 +44,8 @@
import Search from '@/components/Search';
import ModelForm from '@/components/indexDecorate/ModelForm';
import HoverSearch from '@/components/header/hoverSearch';
-import storage from '@/plugins/storage';
-import { indexData } from '@/api/index.js';
+import storage from "@/plugins/storage";
+import { indexData,getAutoCoup } from '@/api/index.js';
import {seckillByDay} from '@/api/promotion'
export default {
name: 'Index',
@@ -38,9 +60,14 @@ export default {
that.topSearchShow = false;
}
};
+ if(storage.getItem('userInfo')){
+ this.getAutoCoup()
+ }
},
data () {
return {
+ autoCoupList:[],
+ showCpmodel:false,
modelForm: { list: [] }, // 楼层装修数据
topAdvert: {}, // 顶部广告
showNav: false, // 是否展示分类栏
@@ -49,7 +76,73 @@ export default {
carouselOpacity: false // 不同轮播分类样式
};
},
+ // created(){
+
+ // },
methods: {
+ // 优惠券可用范围
+ useScope (type, storeName) {
+ let shop = '平台';
+ let goods = '全部商品'
+ if (storeName !== 'platform') shop = storeName
+ switch (type) {
+ case 'ALL':
+ goods = '全部商品'
+ break;
+ case 'PORTION_GOODS':
+ goods = '部分商品'
+ break;
+ case 'PORTION_GOODS_CATEGORY':
+ goods = '部分分类商品'
+ break;
+ }
+ return `${shop}${goods}可用`
+ },
+ getAutoCoup(){
+ let data = new Date()
+ let datas = data.getDate()
+ let hours = data.getHours()
+ let flagCoup = storage.getItem('getTimes') //缓存
+ if(flagCoup && flagCoup != undefined && flagCoup != null){ //判断当前是否有缓存
+ if(Number(datas) > Number(flagCoup)){ //判断缓存是否小于当前天数
+ if(Number(hours) >= 6){//超过或等于6时清楚缓存
+ storage.setItem('getTimes',datas)//存储缓存
+ this.getcps()
+ }
+ }
+ }else{
+ // window.localStorage.setItem('getTimes',datas)//存储缓存
+ this.getcps()
+ }
+ },
+ getcps(){
+ console.log(123123)
+ let data = new Date()
+ let datas = data.getDate()
+ getAutoCoup().then(res=>{ //调用自动发券
+ if(res.success){
+ this.autoCoupList.push(...res.result);
+ let objs = {};
+ this.autoCoupList = this.autoCoupList.reduce((cur, next) => {
+ //对象去重
+ if (next.id != undefined) {
+ objs[next.id]
+ ? ""
+ : (objs[next.id] = true && cur.push(next));
+ }
+ return cur;
+ }, []);
+ if(this.autoCoupList != '' && this.autoCoupList.length > 0){
+ console.log(1231232132)
+ this.showCpmodel = true;
+ }
+ storage.setItem('getTimes',datas)//存储缓存
+ }
+ })
+ },
+ handleReachBottom(){
+ console.log(111)
+ } ,
getIndexData () {
// 获取首页装修数据
indexData({ clientType: 'PC' }).then(async (res) => {
@@ -94,6 +187,7 @@ export default {
+
+ <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
+
+ <% } %>
+
+
+
+
+
+
+
+ <% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.js) { %>
+
+ <% } %>
+
+
+