Commit 7cb97a8226cfad240af30bc830e0945519d9256b

Authored by yvan.ni
1 parent 2b15bd26

优化OA单

packageE/pages/cart/cart2/cart2.js
@@ -1480,7 +1480,7 @@ Page({ @@ -1480,7 +1480,7 @@ Page({
1480 if (getApp().globalData.userInfo.is_distribut 1480 if (getApp().globalData.userInfo.is_distribut
1481 && th.data.dis_config && th.data.dis_config.is_yongjin_dk) { 1481 && th.data.dis_config && th.data.dis_config.is_yongjin_dk) {
1482 1482
1483 - var c_num = getApp().get_commission(th.data.dis_config, t.data.data, gg.goods_num); 1483 + var c_num = getApp().get_commission2(th.data.dis_config, t.data.data, gg.goods_num);
1484 1484
1485 gd.use_commission = c_num; 1485 gd.use_commission = c_num;
1486 t.data.data.use_commission = c_num; 1486 t.data.data.use_commission = c_num;
@@ -1529,7 +1529,7 @@ Page({ @@ -1529,7 +1529,7 @@ Page({
1529 if (getApp().globalData.userInfo.is_distribut 1529 if (getApp().globalData.userInfo.is_distribut
1530 && th.data.dis_config && th.data.dis_config.is_yongjin_dk) { 1530 && th.data.dis_config && th.data.dis_config.is_yongjin_dk) {
1531 1531
1532 - var c_num = getApp().get_commission(th.data.dis_config, t.data.data, gg.goods_num); 1532 + var c_num = getApp().get_commission2(th.data.dis_config, t.data.data, gg.goods_num);
1533 1533
1534 gd.use_commission = c_num; 1534 gd.use_commission = c_num;
1535 t.data.data.use_commission = c_num; 1535 t.data.data.use_commission = c_num;
pages/cart/cart/cart.js
@@ -961,7 +961,7 @@ Page({ @@ -961,7 +961,7 @@ Page({
961 961
962 //如果有优惠活动,要更新活动 962 //如果有优惠活动,要更新活动
963 await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1" + "/" + getApp().globalData.user_id, {}).then(res => { 963 await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + item.goods_id + "/1" + "/" + getApp().globalData.user_id, {}).then(res => {
964 - if (res.data.code == 0) { 964 + if (res.data.code == 0 && res.data.data) {
965 var r_data = res.data.data; 965 var r_data = res.data.data;
966 if (r_data.promGoodsLists) { 966 if (r_data.promGoodsLists) {
967 var url = '/api/weshop/cart/update'; 967 var url = '/api/weshop/cart/update';
pages/cart/cart2_inte/cart2_inte.js
@@ -407,7 +407,7 @@ Page({ @@ -407,7 +407,7 @@ Page({
407 //-- 计算获得佣金的金额 -- 407 //-- 计算获得佣金的金额 --
408 if (getApp().globalData.userInfo.is_distribut 408 if (getApp().globalData.userInfo.is_distribut
409 && th.data.dis_config && th.data.dis_config.is_yongjin_dk) { 409 && th.data.dis_config && th.data.dis_config.is_yongjin_dk) {
410 - var c_num = getApp().get_commission(th.data.dis_config,inte_data, gg.goods_num); 410 + var c_num = getApp().get_commission2(th.data.dis_config,inte_data, gg.goods_num);
411 t.data.data.use_commission = c_num; 411 t.data.data.use_commission = c_num;
412 412
413 } 413 }
pages/cart/cart2_pt/cart2_pt.js
@@ -284,7 +284,7 @@ Page({ @@ -284,7 +284,7 @@ Page({
284 if (getApp().globalData.userInfo.is_distribut 284 if (getApp().globalData.userInfo.is_distribut
285 && th.data.dis_config && th.data.dis_config.is_yongjin_dk) { 285 && th.data.dis_config && th.data.dis_config.is_yongjin_dk) {
286 286
287 - var c_num = getApp().get_commission(th.data.dis_config, t.data.data, gg.goods_num); 287 + var c_num = getApp().get_commission2(th.data.dis_config, t.data.data, gg.goods_num);
288 288
289 gd.use_commission = c_num; 289 gd.use_commission = c_num;
290 t.data.data.use_commission = c_num; 290 t.data.data.use_commission = c_num;
pages/cart/cart_wk/cart_wk.js
@@ -341,17 +341,16 @@ Page({ @@ -341,17 +341,16 @@ Page({
341 var sec_num = 0; 341 var sec_num = 0;
342 var thi_num = 0; 342 var thi_num = 0;
343 if (th.data.dis_config.pattern == 1) { 343 if (th.data.dis_config.pattern == 1) {
344 - fir_num = (inte_data.fir_rate || 0) * order_goods.goods_num;  
345 - sec_num = (inte_data.sec_rate || 0) * order_goods.goods_num;  
346 - thi_num = (inte_data.thi_rate || 0) * order_goods.goods_num; 344 + fir_num = (teamlist.fir_rate || 0) * order_goods.goods_num;
  345 + sec_num = (teamlist.sec_rate || 0) * order_goods.goods_num;
  346 + thi_num = (teamlist.thi_rate || 0) * order_goods.goods_num;
347 } else { 347 } else {
348 fir_num = parseFloat((teamlist.commission || 0) * order_goods.goods_num * (th.data.dis_config.firstRate || 0) / 100).toFixed(2); 348 fir_num = parseFloat((teamlist.commission || 0) * order_goods.goods_num * (th.data.dis_config.firstRate || 0) / 100).toFixed(2);
349 sec_num = parseFloat((teamlist.commission || 0) * order_goods.goods_num * (th.data.dis_config.secondRate || 0) / 100).toFixed(2); 349 sec_num = parseFloat((teamlist.commission || 0) * order_goods.goods_num * (th.data.dis_config.secondRate || 0) / 100).toFixed(2);
350 thi_num = parseFloat((teamlist.commission || 0) * order_goods.goods_num * (th.data.dis_config.thirdRate || 0) / 100).toFixed(2); 350 thi_num = parseFloat((teamlist.commission || 0) * order_goods.goods_num * (th.data.dis_config.thirdRate || 0) / 100).toFixed(2);
351 } 351 }
352 var c_num = getApp().get_commission(fir_num, sec_num, thi_num, th); 352 var c_num = getApp().get_commission(fir_num, sec_num, thi_num, th);
353 -  
354 - goods.use_commission = c_num; 353 + goods.use_commission = parseFloat(c_num.toFixed(2));
355 354
356 } 355 }
357 356
@@ -599,10 +598,9 @@ Page({ @@ -599,10 +598,9 @@ Page({
599 598
600 //--全部金额-- 599 //--全部金额--
601 var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; 600 var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money;
602 - if(th.data.bn_use_commission){  
603 - allpice-=th.data.goods.use_commission;  
604 - }  
605 - 601 + // if(th.data.bn_use_commission){
  602 + // allpice-=th.data.goods.use_commission;
  603 + // }
606 604
607 //-----------当地址不为空,且是物流时,计算物流费用---------- 605 //-----------当地址不为空,且是物流时,计算物流费用----------
608 if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) { 606 if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) {