Commit da586178944dd0989c819d86a9cf108441e4025e
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into dev
Showing
6 changed files
with
19 additions
and
10 deletions
components/diy_service/diy_service.js
packageA/pages/prom_list/prom_list.js
| @@ -627,7 +627,7 @@ Page({ | @@ -627,7 +627,7 @@ Page({ | ||
| 627 | var user_info = getApp().globalData.userInfo; | 627 | var user_info = getApp().globalData.userInfo; |
| 628 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 628 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 629 | wx.navigateTo({ | 629 | wx.navigateTo({ |
| 630 | - url: '/pages/getphone/getphone', | 630 | + url: '/pages/togoin/togoin', |
| 631 | }) | 631 | }) |
| 632 | return false; | 632 | return false; |
| 633 | } | 633 | } |
packageA/pages/quan_list/quan_list.js
| @@ -85,7 +85,7 @@ Page({ | @@ -85,7 +85,7 @@ Page({ | ||
| 85 | var user_info = getApp().globalData.userInfo; | 85 | var user_info = getApp().globalData.userInfo; |
| 86 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 86 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 87 | wx.navigateTo({ | 87 | wx.navigateTo({ |
| 88 | - url: '/pages/getphone/getphone', | 88 | + url: '/pages/togoin/togoin', |
| 89 | }) | 89 | }) |
| 90 | return false; | 90 | return false; |
| 91 | } | 91 | } |
packageA/pages/quan_pro/quan_pro.js
| @@ -80,7 +80,7 @@ Page({ | @@ -80,7 +80,7 @@ Page({ | ||
| 80 | var user_info = getApp().globalData.userInfo; | 80 | var user_info = getApp().globalData.userInfo; |
| 81 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { | 81 | if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { |
| 82 | wx.navigateTo({ | 82 | wx.navigateTo({ |
| 83 | - url: '/pages/getphone/getphone', | 83 | + url: '/pages/togoin/togoin', |
| 84 | }) | 84 | }) |
| 85 | return false; | 85 | return false; |
| 86 | } | 86 | } |
pages/cart/cart/cart.js
| @@ -1477,22 +1477,30 @@ Page({ | @@ -1477,22 +1477,30 @@ Page({ | ||
| 1477 | 1477 | ||
| 1478 | list2.goods.push(newd); | 1478 | list2.goods.push(newd); |
| 1479 | var all_num=0; | 1479 | var all_num=0; |
| 1480 | + var all_limit_num=0; | ||
| 1481 | + | ||
| 1480 | for(var i in alllist){ | 1482 | for(var i in alllist){ |
| 1481 | var list_item=alllist[i]; | 1483 | var list_item=alllist[i]; |
| 1482 | for(var j in list_item.goods){ | 1484 | for(var j in list_item.goods){ |
| 1483 | //如果赠品的ID一样,要进行统计数量 | 1485 | //如果赠品的ID一样,要进行统计数量 |
| 1484 | if(list_item.goods[j].is_gift==1 && list_item.goods[j].gift_id==newd.gift_id){ | 1486 | if(list_item.goods[j].is_gift==1 && list_item.goods[j].gift_id==newd.gift_id){ |
| 1485 | all_num+= list_item.goods[j].goods_num; | 1487 | all_num+= list_item.goods[j].goods_num; |
| 1486 | - } | 1488 | + } |
| 1489 | + if(list_item.goods[j].is_gift==1 && list_item.goods[j].gift_id==newd.gift_id && list_item.goods[j].prom_id==p_item[0]){ | ||
| 1490 | + all_limit_num+= list_item.goods[j].goods_num; | ||
| 1491 | + } | ||
| 1492 | + | ||
| 1487 | } | 1493 | } |
| 1488 | - } | ||
| 1489 | - //-- 赠品的数量超出,这里是保证所有的赠品部会超出 -- | ||
| 1490 | - if(discount.gift_storecount<all_num){ | 1494 | + } |
| 1495 | + | ||
| 1496 | + //-- 赠品的数量超出库存数量和会员的限制,这里是保证所有的赠品部会超出 -- | ||
| 1497 | + if(discount.gift_storecount<all_num || discount.limit_num<all_limit_num ){ | ||
| 1491 | no_gift_arr.push(discount.gift_id); | 1498 | no_gift_arr.push(discount.gift_id); |
| 1492 | //--进入下一个循环 -- | 1499 | //--进入下一个循环 -- |
| 1493 | continue; | 1500 | continue; |
| 1494 | } | 1501 | } |
| 1495 | - | 1502 | + |
| 1503 | + | ||
| 1496 | var url="/api/weshop/cart/delGift?store_id="+newd.store_id+"&user_id=" | 1504 | var url="/api/weshop/cart/delGift?store_id="+newd.store_id+"&user_id=" |
| 1497 | +newd.user_id+"&goods_id="+newd.goods_id+"&is_gift=1&pick_id="+newd.pick_id+"&prom_id="+newd.prom_id | 1505 | +newd.user_id+"&goods_id="+newd.goods_id+"&is_gift=1&pick_id="+newd.pick_id+"&prom_id="+newd.prom_id |
| 1498 | await getApp().request.promiseDelete(url, {}) | 1506 | await getApp().request.promiseDelete(url, {}) |
utils/auth.js
| @@ -105,7 +105,7 @@ module.exports = { | @@ -105,7 +105,7 @@ module.exports = { | ||
| 105 | 105 | ||
| 106 | app.globalData.getu = r; | 106 | app.globalData.getu = r; |
| 107 | wx.navigateTo({ | 107 | wx.navigateTo({ |
| 108 | - url: '/pages/getphone/getphone', | 108 | + url: '/pages/togoin/togoin', |
| 109 | }) | 109 | }) |
| 110 | }else{ | 110 | }else{ |
| 111 | app.globalData.user_id = e.data.data.user_id; | 111 | app.globalData.user_id = e.data.data.user_id; |
| @@ -128,6 +128,7 @@ module.exports = { | @@ -128,6 +128,7 @@ module.exports = { | ||
| 128 | get_u(t){ | 128 | get_u(t){ |
| 129 | var app_d = this.app().globalData, oo = app_d.setting; | 129 | var app_d = this.app().globalData, oo = app_d.setting; |
| 130 | var ab = this.app().request; | 130 | var ab = this.app().request; |
| 131 | + if(!app_d.user_id) return false; | ||
| 131 | ab.get("/api/weshop/users/get/" + oo.stoid + "/" + app_d.user_id, { | 132 | ab.get("/api/weshop/users/get/" + oo.stoid + "/" + app_d.user_id, { |
| 132 | data:{r:Math.random()}, | 133 | data:{r:Math.random()}, |
| 133 | success: function (e) { | 134 | success: function (e) { |