Commit 107a1b31696e94f7ec1be4f4372c18f2767065f3

Authored by 后端研发-苏泰源
2 parents 1d69edcd e9dd25b7

Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev

... ... @@ -70,7 +70,7 @@ App({
70 70 room_id: null, //直播间分享的房间ID
71 71 room_goods_id: null, //直播间分享的商品ID
72 72 fail_url: new Map(),
73   - sp_scene:"1175,1176,1177"
  73 + sp_scene: null
74 74 },
75 75 auth: o,
76 76 request: a,
... ... @@ -81,6 +81,8 @@ App({
81 81 // params.login_id = wx.getStorageSync('login_id') || '' // 可将登录id缓存下来,方便下次进入小程序直接获取
82 82 // plugin.setConfig(pluginGD)
83 83 if(option) this.globalData.scene=option.scene;
  84 + console.log(option,'登陆场景');
  85 +
84 86 wx.hideTabBar();
85 87 this.initExt();
86 88 // this.overShare()
... ... @@ -205,6 +207,18 @@ App({
205 207  
206 208 //获取一下门店的基本信息
207 209 this.getConfig();
  210 +
  211 + //获取视频号场景
  212 + if(!this.globalData.sp_scene) {
  213 + var th = this;
  214 + var turl = "/api/weshop/manager/managerConfig/get";
  215 + this.promiseGet(turl, {}).then(res => {
  216 + if (res.data.code == 0) {
  217 + th.globalData.sp_scene = res.data.data.weapp_scenelist;
  218 + }
  219 + })
  220 + }
  221 +
208 222 },
209 223  
210 224 // overShare:function() {
... ... @@ -707,7 +721,6 @@ App({
707 721 th.globalData.dis_buy_obj = null; //等级卡的购买记录
708 722 th.globalData.storeFooter = null; //底部的导航
709 723 th.globalData.full_screen = null; //全屏
710   - th.globalData.scene=null
711 724 } else {
712 725 th.globalData.no_clear = 0;
713 726 }
... ...
pages/cart/cart/cart.js
... ... @@ -471,7 +471,7 @@ Page({
471 471 var isok = 1;
472 472 var is_flag = 1;
473 473 var act = null;
474   - var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item.prom_id + "/" + getApp().globalData.userInfo.user_id;
  474 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item.prom_id + "/" + getApp().globalData.user_id;
475 475 await getApp().request.promiseGet(url, {}).then(res => {
476 476 console.log(res, 1000);
477 477 if (res.data.code == 0 && res.data.data) {
... ...
pages/cart/cart/zh_calculate.js
... ... @@ -76,6 +76,9 @@ module.exports = {
76 76 for (var i in car_item.zh_map) {
77 77 var bitem = car_item.zh_map[i];
78 78 var act = bitem.act; //获取到组合购的详情
  79 + if(!act) continue;
  80 +
  81 +
79 82 var all_num = 0; //商品数量之和
80 83 var all_price = 0;
81 84 var need_to_buy = 0;
... ...
pages/cart/cart2/cart2.js
... ... @@ -2585,33 +2585,38 @@ Page({
2585 2585  
2586 2586 //--如果有赠品的时候,赠品也要提交---
2587 2587 if (th.data.buy_now_gift_goods) {
2588   - var gift_gg = th.data.buy_now_gift_goods;
2589   - var g_goods = {
2590   - 'goods_id': gift_gg.goods_id,
2591   - 'goods_name': gift_gg.goods_name,
2592   - 'goods_sn': gift_gg.goods_sn,
2593   - 'goods_num': gift_gg.buynum,
2594   - 'market_price': gift_gg.market_price,
2595   - 'goods_price': 0,
2596   - 'member_goods_price': 0,
2597   - 'store_id': oo.stoid,
2598   - 'is_gift': 1,
2599   - 'gift_id': gift_gg.gift_id,
2600   - 'prom_id': gift_gg.prom_id,
2601   - };
2602   - //-- 把导购的信息填入--
2603   - if (gg.guide_id) {
2604   - g_goods.guide_id = gg.guide_id;
2605   - g_goods.guide_type = gg.guide_type;
2606   - //调用接口判断是不是会员
2607   - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => {
2608   - if (res.data.code == 0) {
2609   - g_goods.guide_name = res.data.data.salesman;
2610   - g_goods.guide_sn = res.data.data.salesman_no;
2611   - }
2612   - })
  2588 + var gift_gg_arr = th.data.buy_now_gift_goods;
  2589 + for(let i in gift_gg_arr){
  2590 + let gift_gg=gift_gg_arr[i];
  2591 + var g_goods = {
  2592 + 'goods_id': gift_gg.goods_id,
  2593 + 'goods_name': gift_gg.goods_name,
  2594 + 'goods_sn': gift_gg.goods_sn,
  2595 + 'goods_num': gift_gg.buynum,
  2596 + 'market_price': gift_gg.market_price,
  2597 + 'goods_price': 0,
  2598 + 'member_goods_price': 0,
  2599 + 'store_id': oo.stoid,
  2600 + 'is_gift': 1,
  2601 + 'gift_id': gift_gg.gift_id,
  2602 + 'prom_id': gift_gg.prom_id,
  2603 + };
  2604 + //-- 把导购的信息填入--
  2605 + if (gg.guide_id) {
  2606 + g_goods.guide_id = gg.guide_id;
  2607 + g_goods.guide_type = gg.guide_type;
  2608 + //调用接口判断是不是会员
  2609 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => {
  2610 + if (res.data.code == 0) {
  2611 + g_goods.guide_name = res.data.data.salesman;
  2612 + g_goods.guide_sn = res.data.data.salesman_no;
  2613 + }
  2614 + })
  2615 + }
  2616 + item.order_goods.push(g_goods);
  2617 +
2613 2618 }
2614   - item.order_goods.push(g_goods);
  2619 +
2615 2620 }
2616 2621 pdata.push(item);
2617 2622 } else {
... ... @@ -4768,7 +4773,10 @@ Page({
4768 4773 if (res.confirm) {
4769 4774 func();
4770 4775 } else if (res.cancel) {
4771   - console.log('用户点击取消')
  4776 + console.log('用户点击取消');
  4777 + th.setData({
  4778 + submit:0,
  4779 + })
4772 4780 }
4773 4781 }
4774 4782 })
... ... @@ -4790,6 +4798,9 @@ Page({
4790 4798  
4791 4799 if (!is_ok) {
4792 4800 getApp().confirmBox("请选择赠品");
  4801 + th.setData({
  4802 + submit:0,
  4803 + })
4793 4804 return false;
4794 4805 }
4795 4806 func();
... ...
utils/pay.js
... ... @@ -35,6 +35,8 @@ module.exports = {
35 35 if(getApp().globalData.scene)
36 36 dd.scene=getApp().globalData.scene;
37 37  
  38 + console.log(dd,'支付场景');
  39 +
38 40 wx.showLoading();
39 41 n.post(this.url, {
40 42 data: dd,
... ...
utils/pay2.js
... ... @@ -10,6 +10,8 @@ module.exports = {
10 10 if(getApp().globalData.scene)
11 11 dd.scene=getApp().globalData.scene;
12 12  
  13 + console.log(dd,'支付场景');
  14 +
13 15 wx.showLoading();
14 16 var i = this;
15 17 n.post(this.url, {
... ...