Commit 97ea2de7d96df8a388e55b05bc6260b7c2bd86d8

Authored by 后端研发-苏明海
2 parents 0b82e0fd b8b0fc6a

Merge branch 'dev' into 'test'

Dev

See merge request !1032
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... ... @@ -537,11 +537,12 @@ Page({
537 537 var cut_good_weight = 0;
538 538 for (let i in gd_arr_list) {
539 539 let item = gd_arr_list[i];
540   - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) {
541   - continue;
542   - }
543   - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) {
544   - if (item['exp_sum_type'] == 2) {
  540 +
  541 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
  542 +
  543 +
  544 + if (item['exp_sum_type'] == 2) {
  545 + goods_weight += item['weight'] * item['buynum'];
545 546 cut_good_weight += item['weight'] * item['buynum'];
546 547 }
547 548 if (back_data.weight_free > 0) {
... ...
packageC/pages/presell/cart/cart.js
... ... @@ -1821,12 +1821,11 @@ Page({
1821 1821 var cut_good_weight = 0;
1822 1822 for (let i in gd_arr_list) {
1823 1823 let item = gd_arr_list[i];
1824   - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) {
1825   - continue;
1826   - }
1827   - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) {
  1824 +
  1825 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
1828 1826 if (item['exp_sum_type'] == 2) {
1829   - cut_good_weight += item['weight'] * item['buynum'];
  1827 + goods_weight += item['weight'] * item['buynum'];
  1828 + cut_good_weight += item['weight'] * item['buynum'];
1830 1829 }
1831 1830 if (back_data.weight_free > 0) {
1832 1831 out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
... ...
packageC/pages/presell/cart/cart2.js
... ... @@ -697,10 +697,8 @@ Page({
697 697 var cut_good_weight = 0;
698 698 for (let i in gd_arr_list) {
699 699 let item = gd_arr_list[i];
700   - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) {
701   - continue;
702   - }
703   - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) {
  700 +
  701 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
704 702 if (item['exp_sum_type'] == 2) {
705 703 cut_good_weight += item['weight'] * item['buynum'];
706 704 }
... ...
packageC/pages/presell/cart/cart2_pre.js
... ... @@ -366,17 +366,17 @@ Page({
366 366 var cut_good_weight = 0;
367 367 for (let i in gd_arr_list) {
368 368 let item = data[i];
369   - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) {
370   - continue;
371   - }
372   - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) {
  369 +
  370 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
373 371 if (item['exp_sum_type'] == 2) {
374   - cut_good_weight += item['weight'] * item['buynum'];
375   - }
376   - if (back_data.weight_free > 0) {
377   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  372 + goods_weight += item['weight'] * item['buynum'];
  373 + cut_good_weight += item['weight'] * item['buynum'];
378 374 }
379   - continue;
  375 + if (back_data.weight_free > 0) {
  376 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  377 + }
  378 + continue;
  379 +
380 380 }
381 381  
382 382 switch (item['exp_sum_type']) {
... ...
pages/cart/cart2/cart2.js
... ... @@ -1737,17 +1737,18 @@ Page({
1737 1737 if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && th.data.is_quan_by[pickid]) {
1738 1738 continue;
1739 1739 }
1740   - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) {
1741   - continue;
1742   - }
1743   - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item[j].goods_id) == -1) {
1744   - if (item[j]['exp_sum_type'] == 2) {
  1740 +
  1741 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item[j].goods_id) == -1)) {
  1742 +
  1743 + if (item[j]['exp_sum_type'] == 2) {
1745 1744 cut_good_weight += item[j]['weight'] * item[j]['goods_num'];
  1745 + goods_weight += item[j]['weight'] * item[j]['goods_num'];
1746 1746 }
1747   - if (back_data.weight_free > 0) {
1748   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
1749   - }
1750   - continue;
  1747 + if (back_data.weight_free > 0) {
  1748 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  1749 + }
  1750 + continue;
  1751 +
1751 1752 }
1752 1753  
1753 1754 switch (item[j]['exp_sum_type']) {
... ... @@ -2128,17 +2129,17 @@ Page({
2128 2129 var cut_good_weight = 0;
2129 2130 for (let i in gd_arr_list) {
2130 2131 let item = gd_arr_list[i];
2131   - if (back_data && back_data['is_by_all']) {
2132   - if(!back_data.no_free_goods || !back_data.no_free_goods.length) continue;
2133   - }
2134   - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) {
  2132 +
  2133 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
2135 2134 if (item['exp_sum_type'] == 2) {
2136   - cut_good_weight += item['weight'] * item['buynum'];
2137   - }
2138   - if (back_data.weight_free > 0) {
2139   - out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  2135 + goods_weight += item['weight'] * item['buynum'];
  2136 + cut_good_weight += item['weight'] * item['buynum'];
2140 2137 }
2141   - continue;
  2138 + if (back_data.weight_free > 0) {
  2139 + out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
  2140 + }
  2141 + continue;
  2142 +
2142 2143 }
2143 2144  
2144 2145 switch (item['exp_sum_type']) {
... ...
pages/cart/cart2_inte/cart2_inte.js
... ... @@ -451,12 +451,10 @@ Page({
451 451 var cut_good_weight = 0;
452 452 for (let i in gd_arr_list) {
453 453 let item = gd_arr_list[i];
454   - if (back_data && back_data['is_by_all']) {
455   - if(!back_data.no_free_goods || !back_data.no_free_goods.length) continue;
456   - }
457   -
458   - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) {
  454 +
  455 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1) ) {
459 456 if (item['exp_sum_type'] == 2) {
  457 + goods_weight += item['weight'] * item['buynum'];
460 458 cut_good_weight += item['weight'] * item['buynum'];
461 459 }
462 460 if (back_data.weight_free > 0) {
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -428,10 +428,8 @@ Page({
428 428 var cut_good_weight = 0;
429 429 for (let i in gd_arr_list) {
430 430 let item = gd_arr_list[i];
431   - if (back_data && back_data['is_by_all'] && !back_data.no_free_goods) {
432   - continue;
433   - }
434   - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) {
  431 +
  432 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
435 433 if (item['exp_sum_type'] == 2) {
436 434 cut_good_weight += item['weight'] * item['buynum'];
437 435 }
... ...
pages/cart/cart_wk/cart_wk.js
... ... @@ -491,12 +491,11 @@ Page({
491 491 var cut_good_weight = 0;
492 492 for (let i in gd_arr_list) {
493 493 let item = gd_arr_list[i];
494   - if (back_data && back_data['is_by_all']) {
495   - if(!back_data.no_free_goods || !back_data.no_free_goods.length) continue;
496   - }
497   - if (back_data && back_data['is_by_all'] && back_data.no_free_goods.indexOf(item.goods_id) == -1) {
  494 +
  495 + if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) {
498 496 if (item['exp_sum_type'] == 2) {
499   - cut_good_weight += item['weight'] * item['buynum'];
  497 + goods_weight += item['weight'] * item['buynum'];
  498 + cut_good_weight += item['weight'] * item['buynum'];
500 499 }
501 500 if (back_data.weight_free > 0) {
502 501 out_of_weight = (back_data.weight_free * 1000) - cut_good_weight;
... ...
pages/giftpack/giftpacklist/giftpacklist.js
... ... @@ -228,6 +228,11 @@ Page({
228 228 giftTitle: res.data.data.giftTitle,
229 229 default_color: res.data.data.bgcolor
230 230 })
  231 +
  232 + if(res.data.data.iswarelbtype==1) {
  233 + th.setData({iswarelbtype:1})
  234 + }
  235 +
231 236 if (!res.data.data.giftRemark || res.data.data.giftRemark == '') {
232 237 th.setData({
233 238 giftRemark: '暂无详情......'
... ...
pages/giftpack/giftpacklist/giftpacklist.wxml
... ... @@ -18,13 +18,13 @@
18 18 </text>
19 19 </block>
20 20 <block wx:else>
21   - <text class="data-v-3a5b7e36" wx:if="{{isBuy==0}}">{{"兑换结束时间:"+giftDate}}</text>
  21 + <text class="data-v-3a5b7e36" wx:if="{{isBuy==0 && iswarelbtype}}">{{"兑换结束时间:"+giftDate}}</text>
22 22 <text class="data-v-3a5b7e36" wx:else>
23 23 {{"活动结束时间:"+giftDate}}
24 24 </text>
25 25 </block>
26 26 </view>
27   - <view class="top_time data-v-3a5b7e36" wx:if="{{flag == 1}}">
  27 + <view class="top_time data-v-3a5b7e36" wx:if="{{flag == 1 && iswarelbtype}}">
28 28 <text class="data-v-3a5b7e36" wx:if="{{exchangeType == 1}}">
29 29 {{"兑换时间:领取后"+exchangeDay+"天内兑换"}}
30 30 </text>
... ...
pages/giftpack/mygiftpack/mygiftpack.wxml
... ... @@ -81,7 +81,8 @@
81 81 <view class="content_ware_price">
82 82 <text>{{"零售价:¥"+item.giftPosPrice}}</text>
83 83 </view>
84   - <view class="content_ware_time">
  84 +
  85 + <view class="content_ware_time" wx:if="{{item.iswarelbtype==1}}">
85 86 <block wx:if="{{getDate>item.endTime}}">
86 87 <text>{{"兑换截至日期:"+item.endTime}}</text>
87 88 </block>
... ... @@ -89,6 +90,7 @@
89 90 <text>{{"距兑换开始时间: "+item.starTime}}</text>
90 91 </block>
91 92 </view>
  93 +
92 94 </view>
93 95 </view>
94 96 <view class="content_box_button" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&orderSn={{item.orderSn}}">
... ...
pages/team/team_success/team_success.wxml
... ... @@ -96,7 +96,8 @@
96 96 <span wx:if="{{item.is_pt_tz==1}}">团长</span>
97 97 </view>
98 98 <view class='d' wx:for="{{sf_arr}}">
99   - <image src='{{iurl}}/miniapp/images/anonymous/anonymous{{item}}.png'></image>
  99 + <image wx:if="{{teamgroup.is_xuni_ct}}" src='{{iurl}}/miniapp/images/anonymous/anonymous{{item}}.png'></image>
  100 + <image wx:else src='{{iurl}}/miniapp/images/shafa.png'></image>
100 101 </view>
101 102  
102 103 <view class='xc-ellipsis-img flex-vertical' wx:if="{{ordertx.length>5}}">
... ...
utils/util.js
... ... @@ -514,6 +514,83 @@ function wx_back() {
514 514 }
515 515 }
516 516  
  517 +
  518 +//-------------------计算物流---------------
  519 +function calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  520 + goods_piece, user_addr, back_data,rs) {
  521 + var price = 0;
  522 + price += parseFloat(o_shipping_price);
  523 + if (user_addr == null) {
  524 + return 0;
  525 + }
  526 + //如果是包邮
  527 + if (back_data && back_data.is_by_all && !back_data.no_free_goods && out_of_weight >= 0) {
  528 + return 0;
  529 + }
  530 + //计算物流的config item;
  531 + var item = null;
  532 +
  533 + //------------循环获取config-----------
  534 + function get_wuliu_config(region_id, code, rs) {
  535 + var item = null, rslist = rs.pageData;
  536 + for (var i = 0; i < rslist.length; i++) {
  537 + if (rslist[i].code == code && rslist[i].region_id == region_id) {
  538 + item = rslist[i];
  539 + }
  540 + }
  541 + return item;
  542 + }
  543 + //-------循环获取config,code default-------
  544 + function get_wuliu_default(code, rs) {
  545 + var item = null, rslist = rs.pageData;
  546 + for (var i = 0; i < rslist.length; i++) {
  547 + if (rslist[i].shipping_code == code && rslist[i].is_default == 1) {
  548 + item = rslist[i];
  549 + }
  550 + }
  551 + return item;
  552 + }
  553 +
  554 + //先根据 镇 县 区找计算的config
  555 + item = get_wuliu_config(user_addr.district, code, rs);
  556 + if (item == null) item = get_wuliu_config(user_addr.city, code, rs);
  557 + if (item == null) item = get_wuliu_config(user_addr.province, code, rs);
  558 + if (item == null) item = get_wuliu_default(code, rs);
  559 + if (item == null) return o_shipping_price;
  560 + var fw_price = 0, fp_price = 0;
  561 + item = item.config;
  562 + if (item == null) return o_shipping_price;
  563 +
  564 + //------超出重量----------
  565 + if (back_data && back_data.is_by_all && out_of_weight<0){
  566 + goods_weight+=out_of_weight;
  567 + if(goods_weight<=0) goods_weight=-1;
  568 + }
  569 +
  570 + //------按重量----------
  571 + if (goods_weight >= 0 && item['money']) {
  572 + fw_price = parseFloat(item['money']);
  573 + if (goods_weight > item['first_weight']) {
  574 + var fw = goods_weight - item['first_weight'];
  575 + var n = Math.ceil(fw / item['second_weight'])
  576 + fw_price = fw_price + n * parseFloat(item['add_money']);
  577 + }
  578 + }
  579 +
  580 + //------按件数----------
  581 + if (goods_piece > 0 && item['piecemoney']) {
  582 + fp_price = parseFloat(item['piecemoney']);
  583 + if (goods_piece > item['first_piece']) {
  584 + var fp = goods_piece - item['first_piece'];
  585 + var m = Math.ceil(fp / item['second_piece'])
  586 + fp_price = fp_price + m * parseFloat(item['add_piecemoney']);
  587 + }
  588 + }
  589 +
  590 + var rspice = parseFloat(price + fw_price + fp_price);
  591 + return rspice;
  592 +}
  593 +
517 594 module.exports = {
518 595 formatTime: function(e, r) {
519 596 var t = e ? new Date(1e3 * e) : new Date(), n = t.getFullYear(), o = t.getMonth() + 1, a = t.getDate(), u = t.getHours(), i = t.getMinutes(), f = t.getSeconds(), s = function(e) {
... ... @@ -627,4 +704,5 @@ module.exports = {
627 704 ajax_ok2:ajax_ok2, //将JS数组对象按其某个键值重组成Map对象
628 705 wx_back:wx_back,
629 706 _debounce,
  707 + calculatewuliu:calculatewuliu, //计算物流的函数进行抽象
630 708 };
... ...