diff --git a/app.js b/app.js index 976151b..fd71b47 100644 --- a/app.js +++ b/app.js @@ -70,7 +70,7 @@ App({ room_id: null, //直播间分享的房间ID room_goods_id: null, //直播间分享的商品ID fail_url: new Map(), - sp_scene:"1175,1176,1177" + sp_scene: null }, auth: o, request: a, @@ -81,6 +81,8 @@ App({ // params.login_id = wx.getStorageSync('login_id') || '' // 可将登录id缓存下来,方便下次进入小程序直接获取 // plugin.setConfig(pluginGD) if(option) this.globalData.scene=option.scene; + console.log(option,'登陆场景'); + wx.hideTabBar(); this.initExt(); // this.overShare() @@ -205,6 +207,18 @@ App({ //获取一下门店的基本信息 this.getConfig(); + + //获取视频号场景 + if(!this.globalData.sp_scene) { + var th = this; + var turl = "/api/weshop/manager/managerConfig/get"; + this.promiseGet(turl, {}).then(res => { + if (res.data.code == 0) { + th.globalData.sp_scene = res.data.data.weapp_scenelist; + } + }) + } + }, // overShare:function() { @@ -707,7 +721,6 @@ App({ th.globalData.dis_buy_obj = null; //等级卡的购买记录 th.globalData.storeFooter = null; //底部的导航 th.globalData.full_screen = null; //全屏 - th.globalData.scene=null } else { th.globalData.no_clear = 0; } diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index 0ecd251..9ad10ab 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -471,7 +471,7 @@ Page({ var isok = 1; var is_flag = 1; var act = null; - var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item.prom_id + "/" + getApp().globalData.userInfo.user_id; + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item.prom_id + "/" + getApp().globalData.user_id; await getApp().request.promiseGet(url, {}).then(res => { console.log(res, 1000); if (res.data.code == 0 && res.data.data) { diff --git a/pages/cart/cart/zh_calculate.js b/pages/cart/cart/zh_calculate.js index e68c1b0..83c6b2b 100644 --- a/pages/cart/cart/zh_calculate.js +++ b/pages/cart/cart/zh_calculate.js @@ -76,6 +76,9 @@ module.exports = { for (var i in car_item.zh_map) { var bitem = car_item.zh_map[i]; var act = bitem.act; //获取到组合购的详情 + if(!act) continue; + + var all_num = 0; //商品数量之和 var all_price = 0; var need_to_buy = 0; diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 9d06804..4d8099c 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -2585,33 +2585,38 @@ Page({ //--如果有赠品的时候,赠品也要提交--- if (th.data.buy_now_gift_goods) { - var gift_gg = th.data.buy_now_gift_goods; - var g_goods = { - 'goods_id': gift_gg.goods_id, - 'goods_name': gift_gg.goods_name, - 'goods_sn': gift_gg.goods_sn, - 'goods_num': gift_gg.buynum, - 'market_price': gift_gg.market_price, - 'goods_price': 0, - 'member_goods_price': 0, - 'store_id': oo.stoid, - 'is_gift': 1, - 'gift_id': gift_gg.gift_id, - 'prom_id': gift_gg.prom_id, - }; - //-- 把导购的信息填入-- - if (gg.guide_id) { - g_goods.guide_id = gg.guide_id; - g_goods.guide_type = gg.guide_type; - //调用接口判断是不是会员 - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => { - if (res.data.code == 0) { - g_goods.guide_name = res.data.data.salesman; - g_goods.guide_sn = res.data.data.salesman_no; - } - }) + var gift_gg_arr = th.data.buy_now_gift_goods; + for(let i in gift_gg_arr){ + let gift_gg=gift_gg_arr[i]; + var g_goods = { + 'goods_id': gift_gg.goods_id, + 'goods_name': gift_gg.goods_name, + 'goods_sn': gift_gg.goods_sn, + 'goods_num': gift_gg.buynum, + 'market_price': gift_gg.market_price, + 'goods_price': 0, + 'member_goods_price': 0, + 'store_id': oo.stoid, + 'is_gift': 1, + 'gift_id': gift_gg.gift_id, + 'prom_id': gift_gg.prom_id, + }; + //-- 把导购的信息填入-- + if (gg.guide_id) { + g_goods.guide_id = gg.guide_id; + g_goods.guide_type = gg.guide_type; + //调用接口判断是不是会员 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => { + if (res.data.code == 0) { + g_goods.guide_name = res.data.data.salesman; + g_goods.guide_sn = res.data.data.salesman_no; + } + }) + } + item.order_goods.push(g_goods); + } - item.order_goods.push(g_goods); + } pdata.push(item); } else { @@ -4768,7 +4773,10 @@ Page({ if (res.confirm) { func(); } else if (res.cancel) { - console.log('用户点击取消') + console.log('用户点击取消'); + th.setData({ + submit:0, + }) } } }) @@ -4790,6 +4798,9 @@ Page({ if (!is_ok) { getApp().confirmBox("请选择赠品"); + th.setData({ + submit:0, + }) return false; } func(); diff --git a/utils/pay.js b/utils/pay.js index 2c66988..114e7d5 100644 --- a/utils/pay.js +++ b/utils/pay.js @@ -35,6 +35,8 @@ module.exports = { if(getApp().globalData.scene) dd.scene=getApp().globalData.scene; + console.log(dd,'支付场景'); + wx.showLoading(); n.post(this.url, { data: dd, diff --git a/utils/pay2.js b/utils/pay2.js index 1d753b9..cf7f027 100644 --- a/utils/pay2.js +++ b/utils/pay2.js @@ -10,6 +10,8 @@ module.exports = { if(getApp().globalData.scene) dd.scene=getApp().globalData.scene; + console.log(dd,'支付场景'); + wx.showLoading(); var i = this; n.post(this.url, {