Commit cc556a5850563208d576f157ed86489285570936

Authored by yvan.ni
1 parent 70939314

1. 日志报警的修复

2.   立即购买的赠品的运费计算优化
... ... @@ -209,8 +209,13 @@ App({
209 209 }
210 210 },
211 211 //----------------获取配置参数--------------------
212   - getConfig: function(t, o) {
213   - var e = this; if(this.globalData.config==undefined) this.globalData.config=null;
  212 + getConfig: function(t, o) {
  213 + var e = this;
  214 + if(!e.globalData.setting.stoid){
  215 + t(null);
  216 + return false;
  217 + }
  218 + if(this.globalData.config==undefined) this.globalData.config=null;
214 219 this.globalData.config ? "function" == typeof t && t(this.globalData.config) : e.request.get("/api/weshop/store/get/" + e.globalData.setting.stoid, {
215 220 success: function(o) {
216 221 console.log('getConfig');
... ... @@ -220,10 +225,13 @@ App({
220 225 }
221 226 });
222 227 },
223   -
224 228 //----------------获取配置参数--------------------
225   - getConfig2: function (t, o) {
  229 + getConfig2: function (t, o) {
226 230 var e = this;
  231 + if(!e.globalData.setting.stoid) {
  232 + t(null);
  233 + return false;
  234 + }
227 235 this.globalData.config2 && !o ?
228 236 "function" == typeof t && t(this.globalData.config2) : a.get("/api/weshop/storeconfig/get/" + e.globalData.setting.stoid, {
229 237 success: function (o) {
... ...
pages/cart/cart/cart.js
... ... @@ -783,7 +783,7 @@ Page({
783 783 isShowLoading: 0,
784 784 success: function(res_d) {
785 785  
786   - if(res_d.data.code==0){
  786 + if(res_d.data.code==0 && res_d.data.data){
787 787 if (t.goods_num > store_count) {
788 788 wx.showModal({
789 789 title: '提示',
... ...
pages/cart/cart2/cart2.js
... ... @@ -671,7 +671,7 @@ Page({
671 671 ob.buynum=num;
672 672 ob.weight=data.gift_weight; //商品的重量
673 673 ob.exp_sum_type=data.gift_exp_sum_type; //商品的物流计算方式
674   - ob.uniform_exp_sum=data.uniform_exp_sum //统一运费的金额
  674 + ob.uniform_exp_sum=data.gift_uniform_exp_sum //统一运费的金额
675 675  
676 676 th.setData({buy_now_gift_goods:ob});
677 677 }
... ... @@ -1541,7 +1541,8 @@ Page({
1541 1541  
1542 1542 //如果有赠品的时候,也要计算赠品的物流费用
1543 1543 if(th.data.buy_now_gift_goods){
1544   - shipping_price=th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free, parseFloat(allpice)-cut_price-quan_price, rs,shipping_price,no_by_data);
  1544 + shipping_price=th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free,
  1545 + parseFloat(allpice)-cut_price-quan_price, rs,shipping_price,no_by_data,goods_weight,goods_piece);
1545 1546 }
1546 1547  
1547 1548 if(shipping_price<=0){
... ... @@ -3161,7 +3162,7 @@ Page({
3161 3162 arr.gift_original_img = get_data.goodsinfo.original_img;
3162 3163 arr.gift_weight = get_data.goodsinfo.weight;
3163 3164 arr.gift_exp_sum_type = get_data.goodsinfo.exp_sum_type;
3164   - arr.uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
  3165 + arr.gift_uniform_exp_sum = get_data.goodsinfo.uniform_exp_sum;
3165 3166 arr.gift_limit_num = get_data.limit_num;
3166 3167 arr.gift_storecount = get_data.gift_storecount;
3167 3168 }
... ... @@ -3239,7 +3240,7 @@ Page({
3239 3240 },
3240 3241  
3241 3242 //计算立即购买赠品的物流费用
3242   - get_now_gift_goods_wuliu:function (code, o_shipping_price, user_addr, gift_freight_free,allpice, rs,shipping_price,no_by_data) {
  3243 + get_now_gift_goods_wuliu:function (code, o_shipping_price, user_addr, gift_freight_free,allpice, rs,shipping_price,no_by_data,goods_weight1,goods_piece1) {
3243 3244 var good=this.data.buy_now_gift_goods;
3244 3245 var goods_weight=-1, goods_piece=-1;
3245 3246 var gift_shipping_price=0;
... ... @@ -3247,17 +3248,28 @@ Page({
3247 3248 switch (good['exp_sum_type']) {
3248 3249 case 1:
3249 3250 //统一运费
3250   - gift_shipping_price += good['uniform_exp_sum']; break;
  3251 + gift_shipping_price += good['uniform_exp_sum'];
  3252 + gift_shipping_price+=o_shipping_price;
  3253 + break;
3251 3254 case 2:
3252 3255 if (goods_weight < 0) goods_weight = 0;
3253 3256 //累积商品重量 每种商品的重量 * 数量
3254   - goods_weight += good['weight'] * good['buynum'];break;
  3257 + goods_weight += good['weight'] * good['buynum'];
  3258 + if(goods_weight1>0){
  3259 + goods_weight+=goods_weight1;
  3260 + }
  3261 + break;
3255 3262 case 3:
3256 3263 if (goods_piece < 0) goods_piece = 0;
3257 3264 //累积商品数量
3258   - goods_piece += good['buynum']; break;
  3265 + goods_piece += good['buynum'];
  3266 + if(goods_piece1){
  3267 + goods_piece+=goods_piece1;
  3268 + }
  3269 + break;
3259 3270 }
3260   -
  3271 +
  3272 +
3261 3273 //如果有设置不包邮区域的时候
3262 3274 if(no_by_data && no_by_data.region_list){
3263 3275 if(th.check_by_area(no_by_data.region_list)){
... ... @@ -3272,10 +3284,11 @@ Page({
3272 3284 //th.data.is_no_by[th.data.bn_pick]=1;
3273 3285 }
3274 3286 }
  3287 +
3275 3288 var t_shipping_price=
3276 3289 this.calculatewuliu(code, gift_shipping_price, goods_weight,
3277 3290 goods_piece, user_addr, gift_freight_free, allpice, rs);
3278   - return t_shipping_price+shipping_price;
  3291 + return t_shipping_price;
3279 3292  
3280 3293 },
3281 3294  
... ...