diff --git a/api/promotions.js b/api/promotions.js index c780ef5..565e859 100644 --- a/api/promotions.js +++ b/api/promotions.js @@ -51,13 +51,25 @@ export function getPointsCategory() { * 获取积分商城商品 * @param params */ -export function getPointsGoods(params) { + export function getPointsGoods(params) { return http.request({ url: "/promotion/pointsGoods", method: Method.GET, params, }); } +/** + * 获取积分商城商品详情 + * @param params + */ +export function getPointsGoodsDetail(id) { + return http.request({ + url: "/promotion/pointsGoods/"+id, + method: Method.GET, + }); +} + + /** * 获取限时抢购时间线 当天限时抢购信息 diff --git a/config/api.js b/config/api.js index 995d1d5..c390038 100644 --- a/config/api.js +++ b/config/api.js @@ -4,23 +4,27 @@ */ // 开发环境 const dev = { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", - + // common: "https://common-api.pickmall.cn", + // buyer: "https://buyer-api.pickmall.cn", + common: 'http://192.168.0.101:8890', + buyer: 'http://192.168.0.101:8888', + seller: 'http://192.168.0.101:8889', + manager: 'http://192.168.0.101:8887' + }; // 生产环境 const prod = { - common: "https://common-api.pickmall.cn", - buyer: "https://buyer-api.pickmall.cn", + common: "https://common-api.pickmall.cn", + buyer: "https://buyer-api.pickmall.cn", }; //默认生产环境 let api = dev; //如果是开发环境 if (process.env.NODE_ENV == "development") { - api = dev; + api = dev; } else { - api = prod; + api = prod; } //微信小程序,app的打包方式建议为生产环境,所以这块直接条件编译赋值 // #ifdef MP-WEIXIN || APP-PLUS @@ -30,5 +34,5 @@ api = prod; api.buyer += "/buyer"; api.common += "/common"; export default { - ...api, + ...api, }; diff --git a/pages.json b/pages.json index b32731e..dc811b9 100644 --- a/pages.json +++ b/pages.json @@ -497,6 +497,13 @@ "navigationStyle": "custom", "navigationBarTextStyle": "white" + } + },{ + "path": "point/detail", + "style": { + "navigationStyle": "custom", + "navigationBarTextStyle": "white" + } } @@ -745,7 +752,6 @@ "selectedIconPath": "static/tabbar/category-s.png", "text": "分类" }, - // { // "pagePath": "pages/navigation/point/point-mall", // "iconPath": "static/tabbar/point-mall.png", diff --git a/pages/cart/payment/popup/goods.vue b/pages/cart/payment/popup/goods.vue index 1dcbd52..36716e7 100644 --- a/pages/cart/payment/popup/goods.vue +++ b/pages/cart/payment/popup/goods.vue @@ -162,13 +162,12 @@ export default { * 直接购买 */ buy(data) { - API_trade.addToCart(data).then((res) => { if (res.data.code == 200) { uni.navigateTo({ - url: `/pages/order/fillorder?way=${data.cartType}&addr=${ - this.addr.id || "" - }&parentOrder=${encodeURIComponent( + url: `/pages/order/fillorder?way=${ + data.cartType + }&addr=${""}&parentOrder=${encodeURIComponent( JSON.stringify(this.parentOrder) )}`, }); @@ -213,8 +212,10 @@ export default { }); } else { // 判断是否拼团商品 - if (this.buyType) { + if (this.buyType == "PINTUAN") { data.cartType = "PINTUAN"; + } else if (this.buyType == "POINTS") { + data.cartType = "POINTS"; } else { data.cartType = "BUY_NOW"; } @@ -224,7 +225,7 @@ export default { }, formatSku(list) { // 格式化数据 - + if (typeof list != Array) return false; let arr = [{}]; list.forEach((item, index) => { item.specValues.forEach((spec, specIndex) => { diff --git a/pages/navigation/point/point-mall.vue b/pages/navigation/point/point-mall.vue index 0fcfe64..73912c7 100644 --- a/pages/navigation/point/point-mall.vue +++ b/pages/navigation/point/point-mall.vue @@ -100,6 +100,7 @@ export default { async onShow() { //获取顶级分类 let response = await getPointsCategory(); + if (response.data.success) { let navData = response.data.result.records; navData.forEach((item) => { @@ -130,7 +131,7 @@ export default { toGoods(item) { //跳转详情 uni.navigateTo({ - url: `/pages/product/goods?id=${item.skuId}&goodsId=${item.id}&whetherPoint=1`, + url: `/pages/promotion/point/detail?id=${item.id}`, }); }, diff --git a/pages/order/fillorder.vue b/pages/order/fillorder.vue index 0c6d494..3bac509 100644 --- a/pages/order/fillorder.vue +++ b/pages/order/fillorder.vue @@ -91,6 +91,7 @@

¥{{ val.goodsSku.price | unitPrice }}

+ diff --git a/pages/product/goods.vue b/pages/product/goods.vue index bb8b448..c686628 100644 --- a/pages/product/goods.vue +++ b/pages/product/goods.vue @@ -476,7 +476,6 @@ export default { this.routerVal.id, this.routerVal.goodsId, this.routerVal.distributionId, - this.routerVal.whetherPoint ); } }, diff --git a/pages/promotion/bargain/detail.vue b/pages/promotion/bargain/detail.vue index f507e34..e75862e 100644 --- a/pages/promotion/bargain/detail.vue +++ b/pages/promotion/bargain/detail.vue @@ -93,7 +93,7 @@ - @@ -218,22 +218,11 @@ export default { title: "加载中", mask: true, }); - this.$refs.popupGoods.buy({ skuId: this.bargainDetail.id, num: 1, cartType: "KANJIA", }); - // getGoods(this.bargainDetail.id, this.bargainDetail.goodsId).then( - // (response) => { - // this.goodsDetail = response.data.result.data; - // this.selectedGoods = response.data.result.data; - // this.goodsSpec = response.data.result.specs; - // uni.hideLoading(); - - // // this.maskFlag = true; - // } - // ); }, // 初始化商品以及砍价活动 @@ -257,7 +246,7 @@ export default { let res = await getBargainActivity(this.params); // 判断当前是否是第一次进入,如果是第一次进入默认砍一刀 res.data.success - ? res.data.result + ? res.data.result.launch ? (this.activityData = res.data.result) : this.openActivity() : ""; diff --git a/pages/promotion/bargain/list.vue b/pages/promotion/bargain/list.vue index 4fec557..a902ec8 100644 --- a/pages/promotion/bargain/list.vue +++ b/pages/promotion/bargain/list.vue @@ -1,6 +1,6 @@