Merged
Merge Request #941 · created by 后端研发-苏明海


Test


From test into qa

Merged by 后端研发-苏明海

1 participants



components/diy_pingd_buy/diy_pingd_buy.js
@@ -104,7 +104,11 @@ Component({ @@ -104,7 +104,11 @@ Component({
104 var url= "/api/weshop/teamlist/pageteam/2?page=1&pageSize=9"; 104 var url= "/api/weshop/teamlist/pageteam/2?page=1&pageSize=9";
105 getApp().request.promiseGet(url, { 105 getApp().request.promiseGet(url, {
106 data: { 106 data: {
107 - store_id: os.stoid,is_end: 0,is_show: 1, 107 + store_id:
  108 + os.stoid,
  109 + is_end: 0,
  110 + is_show: 1,
  111 + user_id: getApp().globalData.user_id,
108 } 112 }
109 }).then(res => { 113 }).then(res => {
110 if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){ 114 if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
@@ -139,7 +143,7 @@ Component({ @@ -139,7 +143,7 @@ Component({
139 //--三个三个一组--- 143 //--三个三个一组---
140 for(var i=0;i< all_array.length;i+=3){ 144 for(var i=0;i< all_array.length;i+=3){
141 arr.push(all_array.slice(i,i+3)); 145 arr.push(all_array.slice(i,i+3));
142 - } 146 + }
143 /*--熏染到前台--*/ 147 /*--熏染到前台--*/
144 th.setData({goods_array:arr}); 148 th.setData({goods_array:arr});
145 var newTime = ut.gettimestamp(); 149 var newTime = ut.gettimestamp();
packageA/pages/distribution/myteam/myteam.wxml
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <view> 12 <view>
13 {{item.nickname}} 13 {{item.nickname}}
14 <view style="color: #FF6768;display:block;font-size:26rpx" wx:if="{{item.is_distribut == 1}}">分销会员</view> 14 <view style="color: #FF6768;display:block;font-size:26rpx" wx:if="{{item.is_distribut == 1}}">分销会员</view>
15 - <view style="color: #FF6768;display:block;" wx:else>普通会员</view> 15 + <view style="color: #FF6768;display:block;font-size:26rpx" wx:else>普通会员</view>
16 </view> 16 </view>
17 <view class="fs24 c-a">{{filter.format_time(item.reg_time)}}</view> 17 <view class="fs24 c-a">{{filter.format_time(item.reg_time)}}</view>
18 </view> 18 </view>
packageB/pages/zuhegou/index/index.js
@@ -1972,15 +1972,8 @@ Page({ @@ -1972,15 +1972,8 @@ Page({
1972 if (this.data.act.is_bzyh && zhqty_bz.length > 0) { 1972 if (this.data.act.is_bzyh && zhqty_bz.length > 0) {
1973 if (zhqty_bz.length > 1) { 1973 if (zhqty_bz.length > 1) {
1974 let zhqty_bz_arr = []; 1974 let zhqty_bz_arr = [];
1975 - let zhqty_bz_flag = zhqty_bz.every((item1, i) => {  
1976 - var bz_num = be * item1['zhqty']; //超量倍增  
1977 - var num = item1['num'] - item1['zhqty']; //购买数量减去超量  
1978 - if (bz_num > num) {  
1979 - zhqty_bz_arr.push(item1);  
1980 - zhqty_bz.splice(i, 1)  
1981 - }  
1982 - return bz_num <= num;  
1983 - }) 1975 + let zhqty_bz_flag=this.zhqty_bz_fun(zhqty_bz,be,zhqty_bz_arr);
  1976 +
1984 if (zhqty_bz_flag) { 1977 if (zhqty_bz_flag) {
1985 for (let i = 0; i < zhqty_bz.length; i++) { 1978 for (let i = 0; i < zhqty_bz.length; i++) {
1986 var vv = zhqty_bz[i]; 1979 var vv = zhqty_bz[i];
@@ -1995,11 +1988,12 @@ Page({ @@ -1995,11 +1988,12 @@ Page({
1995 } 1988 }
1996 } 1989 }
1997 } else { 1990 } else {
  1991 + zhqty_len=1;
1998 let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) { 1992 let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) {
1999 - return o['num'] 1993 + return o['num'];
2000 })); 1994 }));
2001 let new_arr = zhqty_bz_arr.filter(ii => { 1995 let new_arr = zhqty_bz_arr.filter(ii => {
2002 - return ii['num'] == min_bz_num 1996 + return ii['num'] == min_bz_num;
2003 }) 1997 })
2004 var vv = new_arr[0]; 1998 var vv = new_arr[0];
2005 var bz_num = be * new_arr[0].zhqty; //超量倍增 1999 var bz_num = be * new_arr[0].zhqty; //超量倍增
@@ -2018,16 +2012,20 @@ Page({ @@ -2018,16 +2012,20 @@ Page({
2018 } 2012 }
2019 bz_num_ok = be * vv.zhqty; 2013 bz_num_ok = be * vv.zhqty;
2020 } 2014 }
2021 -  
2022 - for (let j = 0; j < bz_num_ok; j++) {  
2023 - let index = no_in_arr.findIndex(i => {  
2024 - return vv.goods_id === i.goods_id  
2025 - })  
2026 - if (index > -1) {  
2027 - delete_num++  
2028 - no_in_arr.splice(index, 1) 2015 +
  2016 + for(let i = 0; i < zhqty_bz.length; i++){
  2017 + let item1=zhqty_bz[i];
  2018 + for (let j = 0; j < be * item1['zhqty']; j++) {
  2019 + let index = no_in_arr.findIndex(i => {
  2020 + return item1.goods_id === i.goods_id
  2021 + })
  2022 + if (index > -1) {
  2023 + // delete_num++
  2024 + no_in_arr.splice(index, 1)
  2025 + }
2029 } 2026 }
2030 } 2027 }
  2028 + aprice += be * aprice;
2031 } 2029 }
2032 } else { 2030 } else {
2033 var vv = zhqty_bz[0]; 2031 var vv = zhqty_bz[0];
@@ -2258,6 +2256,20 @@ Page({ @@ -2258,6 +2256,20 @@ Page({
2258 } 2256 }
2259 if (func) func(list) 2257 if (func) func(list)
2260 2258
2261 - } 2259 + },
2262 2260
  2261 + zhqty_bz_fun(zhqty_bz,be,zhqty_bz_arr){
  2262 + let zhqty_bz_flag =true;
  2263 + for(let i=0;i<zhqty_bz.length;i++){
  2264 + let item=zhqty_bz[i];
  2265 + let bz_num = be * item['zhqty']; //超量倍增
  2266 + let num = item['num'] - item['zhqty']; //购买数量减去超量
  2267 + if (bz_num > num) {
  2268 + zhqty_bz_flag=false;
  2269 + zhqty_bz_arr.push(item);
  2270 + // zhqty_bz.splice(i,1)
  2271 + }
  2272 + }
  2273 + return zhqty_bz_flag;
  2274 + }
2263 }) 2275 })
2264 \ No newline at end of file 2276 \ No newline at end of file
packageB/pages/zuhegou/list/list.wxml
@@ -63,7 +63,7 @@ @@ -63,7 +63,7 @@
63 </view> 63 </view>
64 64
65 <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view> 65 <view class="no-more" wx:if="{{goodlist.length==0}}">没有相关内容</view>
66 - 66 +<!--
67 <view class="kill-time xc-seckill-bottom"> 67 <view class="kill-time xc-seckill-bottom">
68 <view class="theader" > 68 <view class="theader" >
69 <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}"> 69 <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}">
@@ -76,7 +76,7 @@ @@ -76,7 +76,7 @@
76 即将开始</view> 76 即将开始</view>
77 </view> 77 </view>
78 </view> 78 </view>
79 - 79 +-->
80 80
81 81
82 </view> 82 </view>
packageC/pages/group_list/group_list.wxml
@@ -44,7 +44,7 @@ @@ -44,7 +44,7 @@
44 <nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata> 44 <nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>
45 45
46 46
47 - 47 +<!--
48 <view class="kill-time xc-seckill-bottom"> 48 <view class="kill-time xc-seckill-bottom">
49 <view class="theader" > 49 <view class="theader" >
50 <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}"> 50 <view bindtap='tip' data-ty="1" class="xc-border-right flex-center timeac left {{type==1?'active':''}}">
@@ -54,4 +54,5 @@ @@ -54,4 +54,5 @@
54 <image class="xc-bottom" src="{{url}}{{type==0?'/miniapp/images/clock-rad.png':'/miniapp/images/clock-black.png'}}"></image> 54 <image class="xc-bottom" src="{{url}}{{type==0?'/miniapp/images/clock-rad.png':'/miniapp/images/clock-black.png'}}"></image>
55 即将开始</view> 55 即将开始</view>
56 </view> 56 </view>
57 -</view>  
58 \ No newline at end of file 57 \ No newline at end of file
  58 +</view>
  59 +-->
59 \ No newline at end of file 60 \ No newline at end of file
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
@@ -1374,13 +1374,11 @@ Page({ @@ -1374,13 +1374,11 @@ Page({
1374 o_price += item[j].goods_price * item[j].goods_num; 1374 o_price += item[j].goods_price * item[j].goods_num;
1375 1375
1376 //判断是否有设置限制重量包邮 1376 //判断是否有设置限制重量包邮
1377 - if(weight_free){  
1378 - if( item[j]['exp_sum_type']==2 ){  
1379 - if (goods_weight < 0) goods_weight = 0;  
1380 - //累积商品重量 每种商品的重量 * 数量  
1381 - goods_weight += item[j]['weight'] * item[j]['goods_num'];  
1382 - out_of_weight = (weight_free*1000) - goods_weight;  
1383 - } 1377 + if(item[j]['is_past']!==1 && item[j]['exp_sum_type']==2 && weight_free>0){
  1378 + if (goods_weight < 0) goods_weight = 0;
  1379 + //累积商品重量 每种商品的重量 * 数量
  1380 + goods_weight += item[j]['weight'] * item[j]['goods_num'];
  1381 + out_of_weight = (weight_free*1000) - goods_weight;
1384 } 1382 }
1385 } 1383 }
1386 //判断是不是有组合购的金额 1384 //判断是不是有组合购的金额
@@ -1560,9 +1558,11 @@ Page({ @@ -1560,9 +1558,11 @@ Page({
1560 } 1558 }
1561 1559
1562 }else{ 1560 }else{
1563 - if(goods_weight && out_of_weight !== 0){  
1564 - goods_weight=-1;  
1565 - out_of_weight=0; 1561 + if(item[j]['exp_sum_type']==2){
  1562 + if(out_of_weight !==0){
  1563 + goods_weight=-1;
  1564 + out_of_weight=0;
  1565 + }
1566 } 1566 }
1567 } 1567 }
1568 } 1568 }
@@ -1866,7 +1866,9 @@ Page({ @@ -1866,7 +1866,9 @@ Page({
1866 if (goods_weight < 0) goods_weight = 0; 1866 if (goods_weight < 0) goods_weight = 0;
1867 //累积商品重量 每种商品的重量 * 数量 1867 //累积商品重量 每种商品的重量 * 数量
1868 goods_weight += good['weight'] * good['buynum']; 1868 goods_weight += good['weight'] * good['buynum'];
1869 - out_of_weight = (weight_free * 1000 ) - goods_weight; 1869 + if(weight_free > 0){
  1870 + out_of_weight = (weight_free * 1000 ) - goods_weight;
  1871 + }
1870 break; 1872 break;
1871 case 3: 1873 case 3:
1872 if (goods_piece < 0) goods_piece = 0; 1874 if (goods_piece < 0) goods_piece = 0;
@@ -2863,7 +2865,7 @@ Page({ @@ -2863,7 +2865,7 @@ Page({
2863 var price = 0, th = this; 2865 var price = 0, th = this;
2864 price += parseFloat(o_shipping_price); 2866 price += parseFloat(o_shipping_price);
2865 //如果是包邮 2867 //如果是包邮
2866 - if (freight_free > 0 && o_price >= freight_free && out_of_weight > 0) { 2868 + if (freight_free > 0 && o_price >= freight_free && out_of_weight >= 0) {
2867 return 0; 2869 return 0;
2868 } 2870 }
2869 if (user_addr == null) { 2871 if (user_addr == null) {
@@ -2881,7 +2883,7 @@ Page({ @@ -2881,7 +2883,7 @@ Page({
2881 item = item.config; 2883 item = item.config;
2882 if (item == null) return o_shipping_price; 2884 if (item == null) return o_shipping_price;
2883 //------按重量---------- 2885 //------按重量----------
2884 - if (goods_weight >= 0 && item['money'] && out_of_weight > 0) { 2886 + if (goods_weight >= 0 && item['money']) {
2885 fw_price = parseFloat(item['money']); 2887 fw_price = parseFloat(item['money']);
2886 if (goods_weight > item['first_weight']) { 2888 if (goods_weight > item['first_weight']) {
2887 var fw = goods_weight - item['first_weight']; 2889 var fw = goods_weight - item['first_weight'];
@@ -2890,11 +2892,14 @@ Page({ @@ -2890,11 +2892,14 @@ Page({
2890 } 2892 }
2891 } 2893 }
2892 //------超出重量---------- 2894 //------超出重量----------
2893 - if(out_of_weight < 0){ 2895 + if(out_of_weight < 0 && o_price >= freight_free){
2894 fw_price = parseFloat(item['money']); 2896 fw_price = parseFloat(item['money']);
2895 var out_of_weight = Math.abs(out_of_weight); 2897 var out_of_weight = Math.abs(out_of_weight);
2896 - var n = Math.ceil(out_of_weight / item['second_weight'])  
2897 - fw_price = fw_price + n * parseFloat(item['add_money']); 2898 + if (out_of_weight > item['first_weight']) {
  2899 + var fw = out_of_weight - item['first_weight'];
  2900 + var n = Math.ceil(fw / item['second_weight'])
  2901 + fw_price = fw_price + n * parseFloat(item['add_money']);
  2902 + }
2898 } 2903 }
2899 //------按件数---------- 2904 //------按件数----------
2900 if (goods_piece > 0 && item['piecemoney']) { 2905 if (goods_piece > 0 && item['piecemoney']) {
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
@@ -513,6 +513,10 @@ Page({ @@ -513,6 +513,10 @@ Page({
513 var o_shipping_price = 0, 513 var o_shipping_price = 0,
514 goods_weight = -1, 514 goods_weight = -1,
515 goods_piece = -1; 515 goods_piece = -1;
  516 + var out_of_weight=null; //超出多少重量
  517 + var freight_free = ee.freight_free; //全场满多少包邮
  518 + var weight_free = ee.weight_free; //多少kg内包邮
  519 + var no_ex_id = ee.no_ex_id;
516 //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- 520 //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格----------
517 if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && (th.data.kt_type != 521 if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && (th.data.kt_type !=
518 3 || th.data.bn_goods.is_normal == 1)) { 522 3 || th.data.bn_goods.is_normal == 1)) {
@@ -525,6 +529,9 @@ Page({ @@ -525,6 +529,9 @@ Page({
525 if (goods_weight < 0) goods_weight = 0; 529 if (goods_weight < 0) goods_weight = 0;
526 //累积商品重量 每种商品的重量 * 数量 530 //累积商品重量 每种商品的重量 * 数量
527 goods_weight += good['weight'] * good['buynum']; 531 goods_weight += good['weight'] * good['buynum'];
  532 + if(weight_free > 0){
  533 + out_of_weight = (weight_free * 1000 ) - goods_weight;
  534 + }
528 break; 535 break;
529 case 3: 536 case 3:
530 if (goods_piece < 0) goods_piece = 0; 537 if (goods_piece < 0) goods_piece = 0;
@@ -1042,7 +1049,7 @@ Page({ @@ -1042,7 +1049,7 @@ Page({
1042 th = this; 1049 th = this;
1043 price += parseFloat(o_shipping_price); 1050 price += parseFloat(o_shipping_price);
1044 //如果是包邮 1051 //如果是包邮
1045 - if (freight_free > 0 && o_price >= freight_free) { 1052 + if (freight_free > 0 && o_price >= freight_free && out_of_weight >= 0) {
1046 return 0; 1053 return 0;
1047 } 1054 }
1048 if (user_addr == null) { 1055 if (user_addr == null) {
@@ -1061,7 +1068,7 @@ Page({ @@ -1061,7 +1068,7 @@ Page({
1061 item = item.config; 1068 item = item.config;
1062 if (item == null) return o_shipping_price; 1069 if (item == null) return o_shipping_price;
1063 //------按重量---------- 1070 //------按重量----------
1064 - if (goods_weight > 0) { 1071 + if (goods_weight > 0 && item['money']) {
1065 fw_price = parseFloat(item['money']); 1072 fw_price = parseFloat(item['money']);
1066 if (goods_weight > item['first_weight']) { 1073 if (goods_weight > item['first_weight']) {
1067 var fw = goods_weight - item['first_weight']; 1074 var fw = goods_weight - item['first_weight'];
@@ -1069,6 +1076,16 @@ Page({ @@ -1069,6 +1076,16 @@ Page({
1069 fw_price = fw_price + n * parseFloat(item['add_money']); 1076 fw_price = fw_price + n * parseFloat(item['add_money']);
1070 } 1077 }
1071 } 1078 }
  1079 + //------超出重量----------
  1080 + if(out_of_weight < 0 && o_price >= freight_free){
  1081 + fw_price = parseFloat(item['money']);
  1082 + var out_of_weight = Math.abs(out_of_weight);
  1083 + if (out_of_weight > item['first_weight']) {
  1084 + var fw = out_of_weight - item['first_weight'];
  1085 + var n = Math.ceil(fw / item['second_weight'])
  1086 + fw_price = fw_price + n * parseFloat(item['add_money']);
  1087 + }
  1088 + }
1072 //------按件数---------- 1089 //------按件数----------
1073 if (goods_piece > 0) { 1090 if (goods_piece > 0) {
1074 fp_price = parseFloat(item['piecemoney']); 1091 fp_price = parseFloat(item['piecemoney']);
packageC/pages/presell/cart/cart.js
@@ -852,12 +852,12 @@ Page({ @@ -852,12 +852,12 @@ Page({
852 th.calculatePrice2(); 852 th.calculatePrice2();
853 }, 853 },
854 //-------------------计算物流--------------- 854 //-------------------计算物流---------------
855 - calculatewuliu: function (code, o_shipping_price, goods_weight, 855 + calculatewuliu: function (code, o_shipping_price, goods_weight,out_of_weight,
856 goods_piece, user_addr, freight_free, o_price, rs) { 856 goods_piece, user_addr, freight_free, o_price, rs) {
857 var price = 0, th = this; 857 var price = 0, th = this;
858 price += parseFloat(o_shipping_price); 858 price += parseFloat(o_shipping_price);
859 //如果是包邮 859 //如果是包邮
860 - if (freight_free > 0 && o_price >= freight_free) { 860 + if (freight_free > 0 && o_price >= freight_free && out_of_weight>=0) {
861 return 0; 861 return 0;
862 } 862 }
863 if (user_addr == null) { 863 if (user_addr == null) {
@@ -883,6 +883,16 @@ Page({ @@ -883,6 +883,16 @@ Page({
883 fw_price = fw_price + n * parseFloat(item['add_money']); 883 fw_price = fw_price + n * parseFloat(item['add_money']);
884 } 884 }
885 } 885 }
  886 + //------超出重量----------
  887 + if(out_of_weight < 0 && o_price >= freight_free){
  888 + fw_price = parseFloat(item['money']);
  889 + var out_of_weight = Math.abs(out_of_weight);
  890 + if (out_of_weight > item['first_weight']) {
  891 + var fw = out_of_weight - item['first_weight'];
  892 + var n = Math.ceil(fw / item['second_weight'])
  893 + fw_price = fw_price + n * parseFloat(item['add_money']);
  894 + }
  895 + }
886 //------按件数---------- 896 //------按件数----------
887 if (goods_piece > 0 && item['piecemoney']) { 897 if (goods_piece > 0 && item['piecemoney']) {
888 fp_price = parseFloat(item['piecemoney']); 898 fp_price = parseFloat(item['piecemoney']);
@@ -1713,6 +1723,9 @@ Page({ @@ -1713,6 +1723,9 @@ Page({
1713 var quan_no = null; 1723 var quan_no = null;
1714 var bn_pick=th.data.pickup.pickup_id; 1724 var bn_pick=th.data.pickup.pickup_id;
1715 var allpice =th.data.all_price; 1725 var allpice =th.data.all_price;
  1726 + var out_of_weight=null; //超出多少重量
  1727 + var freight_free = ee.freight_free; //全场满多少包邮
  1728 + var weight_free = ee.weight_free; //多少kg内包邮
1716 1729
1717 if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined) 1730 if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined)
1718 quan_no = th.data.using_quan[bn_pick].coupon_no; 1731 quan_no = th.data.using_quan[bn_pick].coupon_no;
@@ -1793,6 +1806,9 @@ Page({ @@ -1793,6 +1806,9 @@ Page({
1793 if (goods_weight < 0) goods_weight = 0; 1806 if (goods_weight < 0) goods_weight = 0;
1794 //累积商品重量 每种商品的重量 * 数量 1807 //累积商品重量 每种商品的重量 * 数量
1795 goods_weight += good['weight'] * th.data.order.order_goods['goods_num']; 1808 goods_weight += good['weight'] * th.data.order.order_goods['goods_num'];
  1809 + if(weight_free > 0){
  1810 + out_of_weight = (weight_free * 1000 ) - goods_weight;
  1811 + }
1796 break; 1812 break;
1797 case 3: 1813 case 3:
1798 if (goods_piece < 0) goods_piece = 0; 1814 if (goods_piece < 0) goods_piece = 0;
@@ -1802,7 +1818,6 @@ Page({ @@ -1802,7 +1818,6 @@ Page({
1802 } 1818 }
1803 1819
1804 var code = th.data.wu_arr[th.data.index].code; 1820 var code = th.data.wu_arr[th.data.index].code;
1805 - var freight_free = ee.freight_free; //全场满多少包邮  
1806 var shipping_price = 1821 var shipping_price =
1807 th.calculatewuliu(code, o_shipping_price, goods_weight, 1822 th.calculatewuliu(code, o_shipping_price, goods_weight,
1808 goods_piece, th.data.user_addr, freight_free, allpice, rs); 1823 goods_piece, th.data.user_addr, freight_free, allpice, rs);
packageC/pages/presell/cart/cart2.js
@@ -734,7 +734,7 @@ Page({ @@ -734,7 +734,7 @@ Page({
734 734
735 //如果有赠品的时候,也要计算赠品的物流费用 735 //如果有赠品的时候,也要计算赠品的物流费用
736 if (th.data.buy_now_gift_goods) { 736 if (th.data.buy_now_gift_goods) {
737 - shipping_price = th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free,gift_weight_free, 737 + shipping_price = th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free,out_of_weight,gift_weight_free,
738 parseFloat(allpice) - cut_price - quan_price, rs, shipping_price, no_by_data, goods_weight, goods_piece); 738 parseFloat(allpice) - cut_price - quan_price, rs, shipping_price, no_by_data, goods_weight, goods_piece);
739 } 739 }
740 740
@@ -1693,7 +1693,7 @@ Page({ @@ -1693,7 +1693,7 @@ Page({
1693 item = item.config; 1693 item = item.config;
1694 if (item == null) return o_shipping_price; 1694 if (item == null) return o_shipping_price;
1695 //------按重量---------- 1695 //------按重量----------
1696 - if (goods_weight >= 0 && item['money'] && out_of_weight > 0) { 1696 + if (goods_weight >= 0 && item['money']) {
1697 fw_price = parseFloat(item['money']); 1697 fw_price = parseFloat(item['money']);
1698 if (goods_weight > item['first_weight']) { 1698 if (goods_weight > item['first_weight']) {
1699 var fw = goods_weight - item['first_weight']; 1699 var fw = goods_weight - item['first_weight'];
@@ -1703,7 +1703,7 @@ Page({ @@ -1703,7 +1703,7 @@ Page({
1703 } 1703 }
1704 1704
1705 //------超出重量---------- 1705 //------超出重量----------
1706 - if(out_of_weight < 0){ 1706 + if(out_of_weight < 0 && o_price >= freight_free){
1707 fw_price = parseFloat(item['money']); 1707 fw_price = parseFloat(item['money']);
1708 var out_of_weight = Math.abs(out_of_weight); 1708 var out_of_weight = Math.abs(out_of_weight);
1709 var n = Math.ceil(out_of_weight / item['second_weight']) 1709 var n = Math.ceil(out_of_weight / item['second_weight'])
@@ -2540,7 +2540,7 @@ Page({ @@ -2540,7 +2540,7 @@ Page({
2540 }, 2540 },
2541 2541
2542 //计算立即购买赠品的物流费用 2542 //计算立即购买赠品的物流费用
2543 - get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free,gift_weight_free, allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) { 2543 + get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free,gift_weight_free,out_of_weight,allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) {
2544 var good = this.data.buy_now_gift_goods; 2544 var good = this.data.buy_now_gift_goods;
2545 var goods_weight = -1, goods_piece = -1; 2545 var goods_weight = -1, goods_piece = -1;
2546 var gift_shipping_price = 0; 2546 var gift_shipping_price = 0;
@@ -2556,8 +2556,9 @@ Page({ @@ -2556,8 +2556,9 @@ Page({
2556 //累积商品重量 每种商品的重量 * 数量 2556 //累积商品重量 每种商品的重量 * 数量
2557 goods_weight += good['weight'] * good['buynum']; 2557 goods_weight += good['weight'] * good['buynum'];
2558 if (goods_weight1 > 0) { 2558 if (goods_weight1 > 0) {
  2559 + out_of_weight = gift_weight_free - goods_weight;
  2560 + //不能调换位置 下面goods_weight会变大
2559 goods_weight += goods_weight1; 2561 goods_weight += goods_weight1;
2560 - out_of_weight = (gift_weight_free*1000) - goods_weight;  
2561 } 2562 }
2562 break; 2563 break;
2563 case 3: 2564 case 3:
packageC/pages/presell/cart/cart2_pre.js
@@ -342,7 +342,11 @@ Page({ @@ -342,7 +342,11 @@ Page({
342 342
343 app.getConfig2(function (ee) { 343 app.getConfig2(function (ee) {
344 app.getwuliuprice(function (rs) { 344 app.getwuliuprice(function (rs) {
345 - var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; 345 + var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
  346 + var out_of_weight=null; //超出多少重量
  347 + var freight_free = ee.freight_free; //全场满多少包邮
  348 + var weight_free = ee.weight_free; //多少kg内包邮
  349 + var no_ex_id = ee.no_ex_id;
346 //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- 350 //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格----------
347 if (th.data.user_addr != null && th.data.bn_exp_type == 0 351 if (th.data.user_addr != null && th.data.bn_exp_type == 0
348 && good.is_free_shipping == 0 && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1) ){ 352 && good.is_free_shipping == 0 && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1) ){
@@ -353,7 +357,11 @@ Page({ @@ -353,7 +357,11 @@ Page({
353 case 2: 357 case 2:
354 if (goods_weight < 0) goods_weight = 0; 358 if (goods_weight < 0) goods_weight = 0;
355 //累积商品重量 每种商品的重量 * 数量 359 //累积商品重量 每种商品的重量 * 数量
356 - goods_weight += good['weight'] * good['buynum'];break; 360 + goods_weight += good['weight'] * good['buynum'];
  361 + if(weight_free > 0){
  362 + out_of_weight = (weight_free * 1000 ) - goods_weight;
  363 + }
  364 + break;
357 case 3: 365 case 3:
358 if (goods_piece < 0) goods_piece = 0; 366 if (goods_piece < 0) goods_piece = 0;
359 //累积商品数量 367 //累积商品数量
@@ -361,9 +369,8 @@ Page({ @@ -361,9 +369,8 @@ Page({
361 } 369 }
362 370
363 var code = th.data.wu_arr[th.data.index].code; 371 var code = th.data.wu_arr[th.data.index].code;
364 - var freight_free = ee.freight_free; //全场满多少包邮  
365 var shipping_price= 372 var shipping_price=
366 - th.calculatewuliu(code, o_shipping_price, goods_weight, 373 + th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight,
367 goods_piece, th.data.user_addr, freight_free, allpice, rs); 374 goods_piece, th.data.user_addr, freight_free, allpice, rs);
368 375
369 shipping_price = parseFloat(shipping_price).toFixed(2); 376 shipping_price = parseFloat(shipping_price).toFixed(2);
@@ -701,12 +708,12 @@ Page({ @@ -701,12 +708,12 @@ Page({
701 }, 708 },
702 709
703 //-------------------计算物流--------------- 710 //-------------------计算物流---------------
704 - calculatewuliu:function(code, o_shipping_price, goods_weight, 711 + calculatewuliu:function(code, o_shipping_price, goods_weight,out_of_weight,
705 goods_piece,user_addr, freight_free, o_price, rs){ 712 goods_piece,user_addr, freight_free, o_price, rs){
706 var price =0,th=this; 713 var price =0,th=this;
707 price +=parseFloat(o_shipping_price); 714 price +=parseFloat(o_shipping_price);
708 //如果是包邮 715 //如果是包邮
709 - if (freight_free > 0 && o_price >= freight_free){ return 0;} 716 + if (freight_free > 0 && o_price >= freight_free && out_of_weight>=0){ return 0;}
710 if (user_addr==null) { return 0; } 717 if (user_addr==null) { return 0; }
711 //计算物流的config item; 718 //计算物流的config item;
712 var item=null; 719 var item=null;
@@ -720,7 +727,7 @@ Page({ @@ -720,7 +727,7 @@ Page({
720 item=item.config; 727 item=item.config;
721 if (item == null) return o_shipping_price; 728 if (item == null) return o_shipping_price;
722 //------按重量---------- 729 //------按重量----------
723 - if (goods_weight>0) { 730 + if (goods_weight >= 0 && item['money']) {
724 fw_price =parseFloat(item['money']); 731 fw_price =parseFloat(item['money']);
725 if (goods_weight > item['first_weight']){ 732 if (goods_weight > item['first_weight']){
726 var fw = goods_weight - item['first_weight']; 733 var fw = goods_weight - item['first_weight'];
@@ -728,6 +735,16 @@ Page({ @@ -728,6 +735,16 @@ Page({
728 fw_price = fw_price + n * parseFloat(item['add_money']); 735 fw_price = fw_price + n * parseFloat(item['add_money']);
729 } 736 }
730 } 737 }
  738 + //------超出重量----------
  739 + if(out_of_weight < 0 && o_price >= freight_free){
  740 + fw_price = parseFloat(item['money']);
  741 + var out_of_weight = Math.abs(out_of_weight);
  742 + if (out_of_weight > item['first_weight']) {
  743 + var fw = out_of_weight - item['first_weight'];
  744 + var n = Math.ceil(fw / item['second_weight'])
  745 + fw_price = fw_price + n * parseFloat(item['add_money']);
  746 + }
  747 + }
731 //------按件数---------- 748 //------按件数----------
732 if (goods_piece > 0) { 749 if (goods_piece > 0) {
733 fp_price = parseFloat(item['piecemoney']); 750 fp_price = parseFloat(item['piecemoney']);
pages/cart/cart/zh_calculate.js
@@ -239,15 +239,8 @@ module.exports = { @@ -239,15 +239,8 @@ module.exports = {
239 if (act.is_bzyh && zhqty_bz.length > 0) { 239 if (act.is_bzyh && zhqty_bz.length > 0) {
240 if (zhqty_bz.length > 1) { 240 if (zhqty_bz.length > 1) {
241 let zhqty_bz_arr = []; 241 let zhqty_bz_arr = [];
242 - let zhqty_bz_flag = zhqty_bz.every((item1, i) => {  
243 - var bz_num = be * item1['zhqty']; //超量倍增  
244 - var num = item1['num'] - item1['zhqty']; //购买数量减去超量  
245 - if (bz_num > num) {  
246 - zhqty_bz_arr.push(item1);  
247 - zhqty_bz.splice(i, 1)  
248 - }  
249 - return bz_num <= num;  
250 - }) 242 + let zhqty_bz_flag=this.zhqty_bz_fun(zhqty_bz,be,zhqty_bz_arr);
  243 +
251 if (zhqty_bz_flag) { 244 if (zhqty_bz_flag) {
252 for (let i = 0; i < zhqty_bz.length; i++) { 245 for (let i = 0; i < zhqty_bz.length; i++) {
253 var vv = zhqty_bz[i]; 246 var vv = zhqty_bz[i];
@@ -262,11 +255,12 @@ module.exports = { @@ -262,11 +255,12 @@ module.exports = {
262 } 255 }
263 } 256 }
264 } else { 257 } else {
  258 + zhqty_len=1;
265 let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) { 259 let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) {
266 - return o['num'] 260 + return o['num'];
267 })); 261 }));
268 let new_arr = zhqty_bz_arr.filter(ii => { 262 let new_arr = zhqty_bz_arr.filter(ii => {
269 - return ii['num'] == min_bz_num 263 + return ii['num'] == min_bz_num;
270 }) 264 })
271 var vv = new_arr[0]; 265 var vv = new_arr[0];
272 var bz_num = be * new_arr[0].zhqty; //超量倍增 266 var bz_num = be * new_arr[0].zhqty; //超量倍增
@@ -285,18 +279,22 @@ module.exports = { @@ -285,18 +279,22 @@ module.exports = {
285 } 279 }
286 bz_num_ok = be * vv.zhqty; 280 bz_num_ok = be * vv.zhqty;
287 } 281 }
288 -  
289 - for (let j = 0; j < bz_num_ok; j++) {  
290 - let index = no_in_arr.findIndex(i => {  
291 - return vv.goods_id === i.goods_id  
292 - })  
293 - if (index > -1) {  
294 - delete_num++  
295 - no_in_arr.splice(index, 1) 282 +
  283 + for(let i = 0; i < zhqty_bz.length; i++){
  284 + let item1=zhqty_bz[i];
  285 + for (let j = 0; j < be * item1['zhqty']; j++) {
  286 + let index = no_in_arr.findIndex(i => {
  287 + return item1.goods_id === i.goods_id
  288 + })
  289 + if (index > -1) {
  290 + // delete_num++
  291 + no_in_arr.splice(index, 1)
  292 + }
296 } 293 }
297 } 294 }
  295 + aprice += be * aprice;
298 } 296 }
299 - } else { 297 + } else {
300 var vv = zhqty_bz[0]; 298 var vv = zhqty_bz[0];
301 var bz_num = be * vv.zhqty; //超量倍增 299 var bz_num = be * vv.zhqty; //超量倍增
302 var num = vv['num'] - vv.zhqty; //购买数量减去超量 300 var num = vv['num'] - vv.zhqty; //购买数量减去超量
@@ -310,14 +308,11 @@ module.exports = { @@ -310,14 +308,11 @@ module.exports = {
310 // be=be-bz_num_ok; 308 // be=be-bz_num_ok;
311 if (num % vv.zhqty == 0) { 309 if (num % vv.zhqty == 0) {
312 be = num / vv.zhqty; 310 be = num / vv.zhqty;
313 - // bz_num_ok = num;  
314 } else { 311 } else {
315 be = Math.floor(num / vv.zhqty) 312 be = Math.floor(num / vv.zhqty)
316 - // bz_num_ok = num - (be * vv.zhqty);  
317 } 313 }
318 bz_num_ok = be * vv.zhqty; 314 bz_num_ok = be * vv.zhqty;
319 } 315 }
320 - // be=vv.num;  
321 for (let j = 0; j < bz_num_ok; j++) { 316 for (let j = 0; j < bz_num_ok; j++) {
322 let index = no_in_arr.findIndex(i => { 317 let index = no_in_arr.findIndex(i => {
323 return vv.goods_id === i.goods_id 318 return vv.goods_id === i.goods_id
@@ -496,7 +491,22 @@ module.exports = { @@ -496,7 +491,22 @@ module.exports = {
496 } 491 }
497 } 492 }
498 return dest; 493 return dest;
499 - } 494 + },
  495 +
  496 + zhqty_bz_fun(zhqty_bz,be,zhqty_bz_arr){
  497 + let zhqty_bz_flag =true;
  498 + for(let i=0;i<zhqty_bz.length;i++){
  499 + let item=zhqty_bz[i];
  500 + let bz_num = be * item['zhqty']; //超量倍增
  501 + let num = item['num'] - item['zhqty']; //购买数量减去超量
  502 + if (bz_num > num) {
  503 + zhqty_bz_flag=false;
  504 + zhqty_bz_arr.push(item);
  505 + // zhqty_bz.splice(i,1)
  506 + }
  507 + }
  508 + return zhqty_bz_flag;
  509 + }
500 510
501 511
502 } 512 }
503 \ No newline at end of file 513 \ No newline at end of file
pages/cart/cart2/cart2.js
@@ -1001,9 +1001,9 @@ Page({ @@ -1001,9 +1001,9 @@ Page({
1001 1001
1002 //-- 搭配促销的门店配送方式的修复 -- 1002 //-- 搭配促销的门店配送方式的修复 --
1003 et = 1; 1003 et = 1;
1004 - distr_t = 0; 1004 + distr_t = 0; // 配送方式 0=用户自选 1=自提 2=物流
1005 for (var hi in narr) { 1005 for (var hi in narr) {
1006 - var dis_t = narr[hi].distr_type; 1006 + var dis_t = narr[hi].distr_type;
1007 if (dis_t == 2) { 1007 if (dis_t == 2) {
1008 th.setData({is_all_zt: 0}); 1008 th.setData({is_all_zt: 0});
1009 et = 0; 1009 et = 0;
@@ -1012,10 +1012,9 @@ Page({ @@ -1012,10 +1012,9 @@ Page({
1012 distr_t = dis_t; 1012 distr_t = dis_t;
1013 } 1013 }
1014 } 1014 }
1015 -  
1016 //自选的时候,系统配置了默认的配送方式是物流的时候 1015 //自选的时候,系统配置了默认的配送方式是物流的时候
1017 if (distr_t == 0 && th.data.json_d.pickupway && th.data.json_d.pickupway == 1) { 1016 if (distr_t == 0 && th.data.json_d.pickupway && th.data.json_d.pickupway == 1) {
1018 - et = 0; 1017 + et = 2;
1019 } 1018 }
1020 1019
1021 1020
@@ -1484,13 +1483,11 @@ Page({ @@ -1484,13 +1483,11 @@ Page({
1484 o_price += item[j].goods_price * item[j].goods_num; 1483 o_price += item[j].goods_price * item[j].goods_num;
1485 1484
1486 //判断是否有设置限制重量包邮,先看商品有没有包邮 1485 //判断是否有设置限制重量包邮,先看商品有没有包邮
1487 - if(item[j]['is_past']!==1 && weight_free){  
1488 - if( item[j]['exp_sum_type']==2 ){  
1489 - if (goods_weight < 0) goods_weight = 0;  
1490 - //累积商品重量 每种商品的重量 * 数量  
1491 - goods_weight += item[j]['weight'] * item[j]['goods_num'];  
1492 - out_of_weight = (weight_free*1000) - goods_weight;  
1493 - } 1486 + if(item[j]['is_past']!==1 && item[j]['exp_sum_type']==2 && weight_free>0){
  1487 + if (goods_weight < 0) goods_weight = 0;
  1488 + //累积商品重量 每种商品的重量 * 数量
  1489 + goods_weight += item[j]['weight'] * item[j]['goods_num'];
  1490 + out_of_weight = (weight_free*1000) - goods_weight;
1494 } 1491 }
1495 } 1492 }
1496 //判断是不是有组合购的金额 1493 //判断是不是有组合购的金额
@@ -1666,7 +1663,7 @@ Page({ @@ -1666,7 +1663,7 @@ Page({
1666 o_shipping_price += item[j]['uniform_exp_sum']; 1663 o_shipping_price += item[j]['uniform_exp_sum'];
1667 break; 1664 break;
1668 // case 2: //1464行已计算 不必重复计算 注释为:判断是否有设置限制重量包邮 1665 // case 2: //1464行已计算 不必重复计算 注释为:判断是否有设置限制重量包邮
1669 - // +'' 1666 + // +''
1670 // if (goods_weight < 0) goods_weight = 0; 1667 // if (goods_weight < 0) goods_weight = 0;
1671 // //累积商品重量 每种商品的重量 * 数量 1668 // //累积商品重量 每种商品的重量 * 数量
1672 // goods_weight += item[j]['weight'] * item[j]['goods_num']; 1669 // goods_weight += item[j]['weight'] * item[j]['goods_num'];
@@ -1679,12 +1676,14 @@ Page({ @@ -1679,12 +1676,14 @@ Page({
1679 break; 1676 break;
1680 } 1677 }
1681 } 1678 }
1682 -  
1683 }else{ 1679 }else{
1684 - if(goods_weight && out_of_weight !==0){  
1685 - goods_weight=-1;  
1686 - out_of_weight=0; 1680 + if(item[j]['exp_sum_type']==2){
  1681 + if(out_of_weight !==0){
  1682 + goods_weight=-1;
  1683 + out_of_weight=0;
  1684 + }
1687 } 1685 }
  1686 +
1688 } 1687 }
1689 } 1688 }
1690 1689
@@ -1999,7 +1998,9 @@ Page({ @@ -1999,7 +1998,9 @@ Page({
1999 //dw 1998 //dw
2000 //累积商品重量 每种商品的重量 * 数量 1999 //累积商品重量 每种商品的重量 * 数量
2001 goods_weight += good['weight'] * good['buynum']; 2000 goods_weight += good['weight'] * good['buynum'];
2002 - out_of_weight = (weight_free * 1000 ) - goods_weight; 2001 + if(weight_free > 0){
  2002 + out_of_weight = (weight_free * 1000 ) - goods_weight;
  2003 + }
2003 break; 2004 break;
2004 case 3: 2005 case 3:
2005 if (goods_piece < 0) goods_piece = 0; 2006 if (goods_piece < 0) goods_piece = 0;
@@ -2253,6 +2254,7 @@ Page({ @@ -2253,6 +2254,7 @@ Page({
2253 this.data.is_summit_ing = 1; 2254 this.data.is_summit_ing = 1;
2254 var th = this, pdata = new Array(); 2255 var th = this, pdata = new Array();
2255 var ff = true; 2256 var ff = true;
  2257 +
2256 //------------立即购买------------- 2258 //------------立即购买-------------
2257 if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) { 2259 if (th.data.is_b_now == 1 && th.data.bn_goods.prom_type != 5) {
2258 if (th.data.bn_exp_type == 0 && th.data.user_addr == null) { 2260 if (th.data.bn_exp_type == 0 && th.data.user_addr == null) {
@@ -2263,14 +2265,13 @@ Page({ @@ -2263,14 +2265,13 @@ Page({
2263 if (!ff) return false; 2265 if (!ff) return false;
2264 var addr = th.data.user_addr; 2266 var addr = th.data.user_addr;
2265 if (th.data.bn_exp_type == 1) addr = null; 2267 if (th.data.bn_exp_type == 1) addr = null;
2266 -  
2267 if (th.data.bn_exp_type == 0) 2268 if (th.data.bn_exp_type == 0)
2268 if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) { 2269 if (th.data.wu_arr == null || th.data.wu_arr.length <= 0) {
2269 getApp().my_warnning("读取物流失败", 0, th); 2270 getApp().my_warnning("读取物流失败", 0, th);
2270 th.data.is_summit_ing = 0; 2271 th.data.is_summit_ing = 0;
2271 return false; 2272 return false;
2272 } 2273 }
2273 - 2274 +
2274 var item = { 2275 var item = {
2275 'user_id': to.globalData.user_id, 2276 'user_id': to.globalData.user_id,
2276 'consignee': addr == null ? "" : addr.consignee, 2277 'consignee': addr == null ? "" : addr.consignee,
@@ -2490,6 +2491,7 @@ Page({ @@ -2490,6 +2491,7 @@ Page({
2490 } 2491 }
2491 pdata.push(item); 2492 pdata.push(item);
2492 } else { 2493 } else {
  2494 +
2493 //---------购物车的结算--------- 2495 //---------购物车的结算---------
2494 if (th.data.is_all_zt == 0 && th.data.user_addr == null) { 2496 if (th.data.is_all_zt == 0 && th.data.user_addr == null) {
2495 th.data.is_summit_ing = 0; 2497 th.data.is_summit_ing = 0;
@@ -2499,6 +2501,7 @@ Page({ @@ -2499,6 +2501,7 @@ Page({
2499 if (!ff) return false; 2501 if (!ff) return false;
2500 2502
2501 var addr = th.data.user_addr; 2503 var addr = th.data.user_addr;
  2504 + // 自提,地址数据清空 exp_type设置为1
2502 if (th.data.is_all_zt == 1) addr = null; 2505 if (th.data.is_all_zt == 1) addr = null;
2503 var val_arr = th.data.user_note; 2506 var val_arr = th.data.user_note;
2504 2507
@@ -2509,8 +2512,8 @@ Page({ @@ -2509,8 +2512,8 @@ Page({
2509 return false; 2512 return false;
2510 } 2513 }
2511 2514
2512 - var order_prom_list_cart = th.data.order_prom_list_cart;  
2513 - 2515 + var order_prom_list_cart =  th.data.order_prom_list_cart;;
  2516 + console.log('xxxxxxxxxxxxxxxx', order_prom_list_cart)
2514 //--组装推送数据-- 2517 //--组装推送数据--
2515 for (var i = 0; i < order_prom_list_cart.length; i++) { 2518 for (var i = 0; i < order_prom_list_cart.length; i++) {
2516 var t_item = order_prom_list_cart[i]; 2519 var t_item = order_prom_list_cart[i];
@@ -2738,7 +2741,7 @@ Page({ @@ -2738,7 +2741,7 @@ Page({
2738 2741
2739 2742
2740 } 2743 }
2741 - 2744 +
2742 if (pdata.length == 0) return; 2745 if (pdata.length == 0) return;
2743 var str = JSON.stringify(pdata); 2746 var str = JSON.stringify(pdata);
2744 2747
@@ -3055,7 +3058,7 @@ Page({ @@ -3055,7 +3058,7 @@ Page({
3055 item = item.config; 3058 item = item.config;
3056 if (item == null) return o_shipping_price; 3059 if (item == null) return o_shipping_price;
3057 //------按重量---------- 3060 //------按重量----------
3058 - if (goods_weight >= 0 && item['money'] && out_of_weight > 0) { 3061 + if (goods_weight >= 0 && item['money']) {
3059 fw_price = parseFloat(item['money']); 3062 fw_price = parseFloat(item['money']);
3060 if (goods_weight > item['first_weight']) { 3063 if (goods_weight > item['first_weight']) {
3061 var fw = goods_weight - item['first_weight']; 3064 var fw = goods_weight - item['first_weight'];
@@ -3064,11 +3067,9 @@ Page({ @@ -3064,11 +3067,9 @@ Page({
3064 } 3067 }
3065 } 3068 }
3066 //------超出重量---------- 3069 //------超出重量----------
3067 - if(out_of_weight < 0){ 3070 + if(out_of_weight < 0 && o_price >= freight_free){
3068 fw_price = parseFloat(item['money']); 3071 fw_price = parseFloat(item['money']);
3069 var out_of_weight = Math.abs(out_of_weight); 3072 var out_of_weight = Math.abs(out_of_weight);
3070 - // var n = Math.ceil(out_of_weight / item['second_weight'])  
3071 - // fw_price = fw_price + n * parseFloat(item['add_money']);  
3072 if (out_of_weight > item['first_weight']) { 3073 if (out_of_weight > item['first_weight']) {
3073 var fw = out_of_weight - item['first_weight']; 3074 var fw = out_of_weight - item['first_weight'];
3074 var n = Math.ceil(fw / item['second_weight']) 3075 var n = Math.ceil(fw / item['second_weight'])
@@ -3985,7 +3986,7 @@ Page({ @@ -3985,7 +3986,7 @@ Page({
3985 }, 3986 },
3986 3987
3987 //计算立即购买赠品的物流费用 3988 //计算立即购买赠品的物流费用
3988 - get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free,gift_weight_free, allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) { 3989 + get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free,out_of_weight, allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) {
3989 var good = this.data.buy_now_gift_goods; 3990 var good = this.data.buy_now_gift_goods;
3990 var goods_weight = -1, goods_piece = -1; 3991 var goods_weight = -1, goods_piece = -1;
3991 var gift_shipping_price = 0; 3992 var gift_shipping_price = 0;
pages/cart/cart2/zh_calculate.js
@@ -152,15 +152,7 @@ module.exports = { @@ -152,15 +152,7 @@ module.exports = {
152 if (act.is_bzyh && zhqty_bz.length > 0) { 152 if (act.is_bzyh && zhqty_bz.length > 0) {
153 if (zhqty_bz.length > 1) { 153 if (zhqty_bz.length > 1) {
154 let zhqty_bz_arr = []; 154 let zhqty_bz_arr = [];
155 - let zhqty_bz_flag = zhqty_bz.every((item1, i) => {  
156 - var bz_num = be * item1['zhqty']; //超量倍增  
157 - var num = item1['num'] - item1['zhqty']; //购买数量减去超量  
158 - if (bz_num > num) {  
159 - zhqty_bz_arr.push(item1);  
160 - zhqty_bz.splice(i, 1)  
161 - }  
162 - return bz_num <= num;  
163 - }) 155 + let zhqty_bz_flag=this.zhqty_bz_fun(zhqty_bz,be,zhqty_bz_arr);
164 if (zhqty_bz_flag) { 156 if (zhqty_bz_flag) {
165 for (let i = 0; i < zhqty_bz.length; i++) { 157 for (let i = 0; i < zhqty_bz.length; i++) {
166 var vv = zhqty_bz[i]; 158 var vv = zhqty_bz[i];
@@ -175,11 +167,12 @@ module.exports = { @@ -175,11 +167,12 @@ module.exports = {
175 } 167 }
176 } 168 }
177 } else { 169 } else {
  170 + zhqty_len=1;
178 let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) { 171 let min_bz_num = Math.min.apply(Math, zhqty_bz_arr.map(function (o) {
179 - return o['num'] 172 + return o['num'];
180 })); 173 }));
181 let new_arr = zhqty_bz_arr.filter(ii => { 174 let new_arr = zhqty_bz_arr.filter(ii => {
182 - return ii['num'] == min_bz_num 175 + return ii['num'] == min_bz_num;
183 }) 176 })
184 var vv = new_arr[0]; 177 var vv = new_arr[0];
185 var bz_num = be * new_arr[0].zhqty; //超量倍增 178 var bz_num = be * new_arr[0].zhqty; //超量倍增
@@ -198,18 +191,22 @@ module.exports = { @@ -198,18 +191,22 @@ module.exports = {
198 } 191 }
199 bz_num_ok = be * vv.zhqty; 192 bz_num_ok = be * vv.zhqty;
200 } 193 }
201 -  
202 - for (let j = 0; j < bz_num_ok; j++) {  
203 - let index = no_in_arr.findIndex(i => {  
204 - return vv.goods_id === i.goods_id  
205 - })  
206 - if (index > -1) {  
207 - delete_num++  
208 - no_in_arr.splice(index, 1) 194 +
  195 + for(let i = 0; i < zhqty_bz.length; i++){
  196 + let item1=zhqty_bz[i];
  197 + for (let j = 0; j < be * item1['zhqty']; j++) {
  198 + let index = no_in_arr.findIndex(i => {
  199 + return item1.goods_id === i.goods_id
  200 + })
  201 + if (index > -1) {
  202 + // delete_num++
  203 + no_in_arr.splice(index, 1)
  204 + }
209 } 205 }
210 } 206 }
  207 + aprice += be * aprice;
211 } 208 }
212 - } else { 209 + } else {
213 var vv = zhqty_bz[0]; 210 var vv = zhqty_bz[0];
214 var bz_num = be * vv.zhqty; //超量倍增 211 var bz_num = be * vv.zhqty; //超量倍增
215 var num = vv['num'] - vv.zhqty; //购买数量减去超量 212 var num = vv['num'] - vv.zhqty; //购买数量减去超量
@@ -223,19 +220,16 @@ module.exports = { @@ -223,19 +220,16 @@ module.exports = {
223 // be=be-bz_num_ok; 220 // be=be-bz_num_ok;
224 if (num % vv.zhqty == 0) { 221 if (num % vv.zhqty == 0) {
225 be = num / vv.zhqty; 222 be = num / vv.zhqty;
226 - // bz_num_ok = num;  
227 } else { 223 } else {
228 be = Math.floor(num / vv.zhqty) 224 be = Math.floor(num / vv.zhqty)
229 - // bz_num_ok = num - (be * vv.zhqty);  
230 } 225 }
231 bz_num_ok = be * vv.zhqty; 226 bz_num_ok = be * vv.zhqty;
232 } 227 }
233 - // be=vv.num;  
234 for (let j = 0; j < bz_num_ok; j++) { 228 for (let j = 0; j < bz_num_ok; j++) {
235 let index = no_in_arr.findIndex(i => { 229 let index = no_in_arr.findIndex(i => {
236 return vv.goods_id === i.goods_id 230 return vv.goods_id === i.goods_id
237 }) 231 })
238 - if(index > -1){ 232 + if (index > -1) {
239 delete_num++ 233 delete_num++
240 no_in_arr.splice(index, 1) 234 no_in_arr.splice(index, 1)
241 } 235 }
@@ -515,6 +509,20 @@ module.exports = { @@ -515,6 +509,20 @@ module.exports = {
515 } 509 }
516 510
517 511
  512 + },
  513 + zhqty_bz_fun(zhqty_bz,be,zhqty_bz_arr){
  514 + let zhqty_bz_flag =true;
  515 + for(let i=0;i<zhqty_bz.length;i++){
  516 + let item=zhqty_bz[i];
  517 + let bz_num = be * item['zhqty']; //超量倍增
  518 + let num = item['num'] - item['zhqty']; //购买数量减去超量
  519 + if (bz_num > num) {
  520 + zhqty_bz_flag=false;
  521 + zhqty_bz_arr.push(item);
  522 + // zhqty_bz.splice(i,1)
  523 + }
  524 + }
  525 + return zhqty_bz_flag;
518 } 526 }
519 527
520 528
pages/cart/cart2_inte/cart2_inte.js
@@ -442,6 +442,9 @@ Page({ @@ -442,6 +442,9 @@ Page({
442 to.getwuliuprice(async function (rs) { 442 to.getwuliuprice(async function (rs) {
443 443
444 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; 444 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
  445 + var out_of_weight=null; //超出多少重量
  446 + var freight_free = ee.freight_free; //全场满多少包邮
  447 + var weight_free = ee.weight_free; //多少kg内包邮
445 //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮---------- 448 //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
446 if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past!=1 ){ 449 if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past!=1 ){
447 450
@@ -452,7 +455,11 @@ Page({ @@ -452,7 +455,11 @@ Page({
452 case 2: 455 case 2:
453 if (goods_weight < 0) goods_weight = 0; 456 if (goods_weight < 0) goods_weight = 0;
454 //累积商品重量 每种商品的重量 * 数量 457 //累积商品重量 每种商品的重量 * 数量
455 - goods_weight += good['weight'] * good['buynum'];break; 458 + goods_weight += good['weight'] * good['buynum'];
  459 + if(weight_free > 0){
  460 + out_of_weight = (weight_free * 1000 ) - goods_weight;
  461 + }
  462 + break;
456 case 3: 463 case 3:
457 if (goods_piece < 0) goods_piece = 0; 464 if (goods_piece < 0) goods_piece = 0;
458 //累积商品数量 465 //累积商品数量
@@ -461,8 +468,7 @@ Page({ @@ -461,8 +468,7 @@ Page({
461 468
462 var code =""; 469 var code ="";
463 if(th.data.wu_arr && th.data.wu_arr[th.data.index]) code=th.data.wu_arr[th.data.index].code; 470 if(th.data.wu_arr && th.data.wu_arr[th.data.index]) code=th.data.wu_arr[th.data.index].code;
464 - var freight_free = ee.freight_free; //全场满多少包邮  
465 - var no_ex_id=ee.no_ex_id; 471 + var no_ex_id=ee.no_ex_id;
466 th.data.is_no_by[th.data.bn_pick]=0; 472 th.data.is_no_by[th.data.bn_pick]=0;
467 473
468 var no_by_data=null; 474 var no_by_data=null;
@@ -496,7 +502,7 @@ Page({ @@ -496,7 +502,7 @@ Page({
496 th.data.is_by[th.data.bn_pick]=0; 502 th.data.is_by[th.data.bn_pick]=0;
497 //--------------开始计算物流------------------ 503 //--------------开始计算物流------------------
498 var shipping_price= 504 var shipping_price=
499 - th.calculatewuliu(code, o_shipping_price, goods_weight, 505 + th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight,
500 goods_piece, th.data.user_addr, freight_free, allpice-cut_price, rs); 506 goods_piece, th.data.user_addr, freight_free, allpice-cut_price, rs);
501 if(shipping_price<=0){ 507 if(shipping_price<=0){
502 th.data.is_by[th.data.bn_pick]=1; //已经是包邮了,就不要选择包邮券 508 th.data.is_by[th.data.bn_pick]=1; //已经是包邮了,就不要选择包邮券
@@ -919,12 +925,12 @@ Page({ @@ -919,12 +925,12 @@ Page({
919 th.calculatePrice(); 925 th.calculatePrice();
920 }, 926 },
921 //-------------------计算物流--------------- 927 //-------------------计算物流---------------
922 - calculatewuliu:function(code, o_shipping_price, goods_weight, 928 + calculatewuliu:function(code, o_shipping_price, goods_weight,out_of_weight,
923 goods_piece,user_addr, freight_free, o_price, rs){ 929 goods_piece,user_addr, freight_free, o_price, rs){
924 var price =0,th=this; 930 var price =0,th=this;
925 price +=parseFloat(o_shipping_price); 931 price +=parseFloat(o_shipping_price);
926 //如果是包邮 932 //如果是包邮
927 - if (freight_free > 0 && o_price >= freight_free){ return 0;} 933 + if (freight_free > 0 && o_price >= freight_free && out_of_weight>=0){ return 0;}
928 if (user_addr==null) { return 0; } 934 if (user_addr==null) { return 0; }
929 //计算物流的config item; 935 //计算物流的config item;
930 var item=null; 936 var item=null;
@@ -938,7 +944,7 @@ Page({ @@ -938,7 +944,7 @@ Page({
938 item=item.config; 944 item=item.config;
939 if (item == null) return o_shipping_price; 945 if (item == null) return o_shipping_price;
940 //------按重量---------- 946 //------按重量----------
941 - if (goods_weight>=0 && item['money']) { 947 + if (goods_weight >= 0 && item['money']) {
942 fw_price =parseFloat(item['money']); 948 fw_price =parseFloat(item['money']);
943 if (goods_weight > item['first_weight']){ 949 if (goods_weight > item['first_weight']){
944 var fw = goods_weight - item['first_weight']; 950 var fw = goods_weight - item['first_weight'];
@@ -946,6 +952,16 @@ Page({ @@ -946,6 +952,16 @@ Page({
946 fw_price = fw_price + n * parseFloat(item['add_money']); 952 fw_price = fw_price + n * parseFloat(item['add_money']);
947 } 953 }
948 } 954 }
  955 + //------超出重量----------
  956 + if(out_of_weight < 0 && o_price >= freight_free){
  957 + fw_price = parseFloat(item['money']);
  958 + var out_of_weight = Math.abs(out_of_weight);
  959 + if (out_of_weight > item['first_weight']) {
  960 + var fw = out_of_weight - item['first_weight'];
  961 + var n = Math.ceil(fw / item['second_weight'])
  962 + fw_price = fw_price + n * parseFloat(item['add_money']);
  963 + }
  964 + }
949 //------按件数---------- 965 //------按件数----------
950 if (goods_piece > 0 && item['piecemoney']) { 966 if (goods_piece > 0 && item['piecemoney']) {
951 fp_price = parseFloat(item['piecemoney']); 967 fp_price = parseFloat(item['piecemoney']);
pages/cart/cart2_pt/cart2_pt.js
@@ -395,7 +395,6 @@ Page({ @@ -395,7 +395,6 @@ Page({
395 }, 395 },
396 //---------计算立即购买---------- 396 //---------计算立即购买----------
397 calculatePrice2: function () { 397 calculatePrice2: function () {
398 - console.log('calculatePrice2');  
399 var th = this, good = this.data.bn_goods; 398 var th = this, good = this.data.bn_goods;
400 //-----------计算商品总价-------------- 399 //-----------计算商品总价--------------
401 var allpice = good.shop_price * good.buynum; 400 var allpice = good.shop_price * good.buynum;
@@ -408,7 +407,10 @@ Page({ @@ -408,7 +407,10 @@ Page({
408 to.getwuliuprice(function (rs) { 407 to.getwuliuprice(function (rs) {
409 console.log('calculatePrice2222'); 408 console.log('calculatePrice2222');
410 console.log(rs); 409 console.log(rs);
411 - var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; 410 + var o_shipping_price = 0,goods_weight = -1,goods_piece = -1;
  411 + var out_of_weight=null; //超出多少重量
  412 + var freight_free = ee.freight_free; //全场满多少包邮
  413 + var weight_free = ee.weight_free; //多少kg内包邮
412 //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格---------- 414 //-----------当地址不为空,且是物流时,计算物流费用,同时阶梯团不计算拼团价格----------
413 if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1) ){ 415 if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && (th.data.kt_type!=3 || th.data.bn_goods.is_normal==1) ){
414 switch (good['exp_sum_type']) { 416 switch (good['exp_sum_type']) {
@@ -418,7 +420,12 @@ Page({ @@ -418,7 +420,12 @@ Page({
418 case 2: 420 case 2:
419 if (goods_weight < 0) goods_weight = 0; 421 if (goods_weight < 0) goods_weight = 0;
420 //累积商品重量 每种商品的重量 * 数量 422 //累积商品重量 每种商品的重量 * 数量
421 - goods_weight += good['weight'] * good['buynum'];break; 423 + goods_weight += good['weight'] * good['buynum'];
  424 + if(weight_free > 0){
  425 + out_of_weight = (weight_free * 1000 ) - goods_weight;
  426 + }
  427 + break;
  428 + // goods_weight += good['weight'] * good['buynum'];break;
422 case 3: 429 case 3:
423 if (goods_piece < 0) goods_piece = 0; 430 if (goods_piece < 0) goods_piece = 0;
424 //累积商品数量 431 //累积商品数量
@@ -430,7 +437,7 @@ Page({ @@ -430,7 +437,7 @@ Page({
430 var code = th.data.wu_arr[th.data.index].code; 437 var code = th.data.wu_arr[th.data.index].code;
431 var freight_free = ee.freight_free; //全场满多少包邮 438 var freight_free = ee.freight_free; //全场满多少包邮
432 var shipping_price= 439 var shipping_price=
433 - th.calculatewuliu(code, o_shipping_price, goods_weight, 440 + th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight,
434 goods_piece, th.data.user_addr, freight_free, allpice, rs); 441 goods_piece, th.data.user_addr, freight_free, allpice, rs);
435 442
436 shipping_price = parseFloat(shipping_price).toFixed(2); 443 shipping_price = parseFloat(shipping_price).toFixed(2);
@@ -586,6 +593,7 @@ Page({ @@ -586,6 +593,7 @@ Page({
586 }) 593 })
587 } 594 }
588 595
  596 +
589 //--商品的房间号-- 597 //--商品的房间号--
590 if(gg.room_id && gg.room_id>0){ 598 if(gg.room_id && gg.room_id>0){
591 item.room_ids=gg.room_id; 599 item.room_ids=gg.room_id;
@@ -774,12 +782,12 @@ Page({ @@ -774,12 +782,12 @@ Page({
774 }, 782 },
775 783
776 //-------------------计算物流--------------- 784 //-------------------计算物流---------------
777 - calculatewuliu:function(code, o_shipping_price, goods_weight, 785 + calculatewuliu:function(code, o_shipping_price, goods_weight,out_of_weight,
778 goods_piece,user_addr, freight_free, o_price, rs){ 786 goods_piece,user_addr, freight_free, o_price, rs){
779 var price =0,th=this; 787 var price =0,th=this;
780 price +=parseFloat(o_shipping_price); 788 price +=parseFloat(o_shipping_price);
781 //如果是包邮 789 //如果是包邮
782 - if (freight_free > 0 && o_price >= freight_free){ return 0;} 790 + if (freight_free > 0 && o_price >= freight_free && out_of_weight>=0){ return 0;}
783 if (user_addr==null) { return 0; } 791 if (user_addr==null) { return 0; }
784 //计算物流的config item; 792 //计算物流的config item;
785 var item=null; 793 var item=null;
@@ -793,7 +801,7 @@ Page({ @@ -793,7 +801,7 @@ Page({
793 item=item.config; 801 item=item.config;
794 if (item == null) return o_shipping_price; 802 if (item == null) return o_shipping_price;
795 //------按重量---------- 803 //------按重量----------
796 - if (goods_weight>=0) { 804 + if (goods_weight >= 0 && item['money']) {
797 fw_price =parseFloat(item['money']); 805 fw_price =parseFloat(item['money']);
798 if (goods_weight > item['first_weight']){ 806 if (goods_weight > item['first_weight']){
799 var fw = goods_weight - item['first_weight']; 807 var fw = goods_weight - item['first_weight'];
@@ -801,8 +809,18 @@ Page({ @@ -801,8 +809,18 @@ Page({
801 fw_price = fw_price + n * parseFloat(item['add_money']); 809 fw_price = fw_price + n * parseFloat(item['add_money']);
802 } 810 }
803 } 811 }
  812 + //------超出重量----------
  813 + if(out_of_weight < 0 && o_price >= freight_free){
  814 + fw_price = parseFloat(item['money']);
  815 + var out_of_weight = Math.abs(out_of_weight);
  816 + if (out_of_weight > item['first_weight']) {
  817 + var fw = out_of_weight - item['first_weight'];
  818 + var n = Math.ceil(fw / item['second_weight'])
  819 + fw_price = fw_price + n * parseFloat(item['add_money']);
  820 + }
  821 + }
804 //------按件数---------- 822 //------按件数----------
805 - if (goods_piece > 0) { 823 + if (goods_piece > 0 ) {
806 fp_price = parseFloat(item['piecemoney']); 824 fp_price = parseFloat(item['piecemoney']);
807 if (goods_piece > item['first_piece']) { 825 if (goods_piece > item['first_piece']) {
808 var fp = goods_piece - item['first_piece']; 826 var fp = goods_piece - item['first_piece'];
pages/cart/cart_wk/cart_wk.js
@@ -420,10 +420,10 @@ Page({ @@ -420,10 +420,10 @@ Page({
420 var to = getApp(), th = this; 420 var to = getApp(), th = this;
421 to.getConfig2(function (ee) { 421 to.getConfig2(function (ee) {
422 to.getwuliuprice(function (rs) { 422 to.getwuliuprice(function (rs) {
423 - var o_shipping_price = 0,  
424 - goods_weight = -1,  
425 - goods_piece = -1,  
426 - good = th.data.goods; 423 + var o_shipping_price = 0,goods_weight = -1,goods_piece = -1,good=th.data.goods;
  424 + var out_of_weight=null; //超出多少重量
  425 + var freight_free = ee.freight_free; //全场满多少包邮
  426 + var weight_free = ee.weight_free; //多少kg内包邮
427 //-----------当地址不为空,且是物流时,计算物流费用---------- 427 //-----------当地址不为空,且是物流时,计算物流费用----------
428 if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) { 428 if (th.data.user_addr != null && th.data.exp_type == 0 && good.is_free_shipping == 0) {
429 switch (good['exp_sum_type']) { 429 switch (good['exp_sum_type']) {
@@ -435,6 +435,9 @@ Page({ @@ -435,6 +435,9 @@ Page({
435 if (goods_weight < 0) goods_weight = 0; 435 if (goods_weight < 0) goods_weight = 0;
436 //累积商品重量 每种商品的重量 * 数量 436 //累积商品重量 每种商品的重量 * 数量
437 goods_weight += good['weight'] * th.data.order.order_goods['goods_num']; 437 goods_weight += good['weight'] * th.data.order.order_goods['goods_num'];
  438 + if(weight_free > 0){
  439 + out_of_weight = (weight_free * 1000 ) - goods_weight;
  440 + }
438 break; 441 break;
439 case 3: 442 case 3:
440 if (goods_piece < 0) goods_piece = 0; 443 if (goods_piece < 0) goods_piece = 0;
@@ -443,7 +446,6 @@ Page({ @@ -443,7 +446,6 @@ Page({
443 break; 446 break;
444 } 447 }
445 var code = th.data.wu_arr[th.data.index].code; 448 var code = th.data.wu_arr[th.data.index].code;
446 - var freight_free = ee.freight_free; //全场满多少包邮  
447 //--全部金额-- 449 //--全部金额--
448 var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; 450 var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money;
449 var shipping_price = 451 var shipping_price =
@@ -470,7 +472,7 @@ Page({ @@ -470,7 +472,7 @@ Page({
470 var price = 0, th = this; 472 var price = 0, th = this;
471 price += parseFloat(o_shipping_price); 473 price += parseFloat(o_shipping_price);
472 //如果是包邮 474 //如果是包邮
473 - if (freight_free > 0 && o_price >= freight_free) { return 0; } 475 + if (freight_free > 0 && o_price >= freight_free && out_of_weight>=0) { return 0; }
474 if (user_addr == null) { return 0; } 476 if (user_addr == null) { return 0; }
475 //计算物流的config item; 477 //计算物流的config item;
476 var item = null; 478 var item = null;
@@ -484,7 +486,7 @@ Page({ @@ -484,7 +486,7 @@ Page({
484 item = item.config; 486 item = item.config;
485 if (item == null) return o_shipping_price; 487 if (item == null) return o_shipping_price;
486 //------按重量---------- 488 //------按重量----------
487 - if (goods_weight > 0) { 489 + if (goods_weight >= 0 && item['money']) {
488 fw_price = parseFloat(item['money']); 490 fw_price = parseFloat(item['money']);
489 if (goods_weight > item['first_weight']) { 491 if (goods_weight > item['first_weight']) {
490 var fw = goods_weight - item['first_weight']; 492 var fw = goods_weight - item['first_weight'];
@@ -492,6 +494,16 @@ Page({ @@ -492,6 +494,16 @@ Page({
492 fw_price = fw_price + n * parseFloat(item['add_money']); 494 fw_price = fw_price + n * parseFloat(item['add_money']);
493 } 495 }
494 } 496 }
  497 + //------超出重量----------
  498 + if(out_of_weight < 0 && o_price >= freight_free){
  499 + fw_price = parseFloat(item['money']);
  500 + var out_of_weight = Math.abs(out_of_weight);
  501 + if (out_of_weight > item['first_weight']) {
  502 + var fw = out_of_weight - item['first_weight'];
  503 + var n = Math.ceil(fw / item['second_weight'])
  504 + fw_price = fw_price + n * parseFloat(item['add_money']);
  505 + }
  506 + }
495 //------按件数---------- 507 //------按件数----------
496 if (goods_piece > 0) { 508 if (goods_piece > 0) {
497 fp_price = parseFloat(item['piecemoney']); 509 fp_price = parseFloat(item['piecemoney']);
pages/team/team_show/team_show.js
@@ -94,18 +94,29 @@ Page({ @@ -94,18 +94,29 @@ Page({
94 94
95 }, 95 },
96 onLoad: function(options) { 96 onLoad: function(options) {
97 -  
98 wx.setNavigationBarTitle({ title: "拼团订单",}) 97 wx.setNavigationBarTitle({ title: "拼团订单",})
99 //var postdata=getApp().globalData.to_group; 98 //var postdata=getApp().globalData.to_group;
100 var postdata=options; 99 var postdata=options;
101 - var tg_id = postdata.tg_id, first_leader=options.first_leader; 100 + var tg_id = postdata.tg_id, first_leader=options.first_leader,goods_id=options.goods_id;
102 //如果tg_id是空的话 101 //如果tg_id是空的话
103 - if(tg_id==undefined || tg_id==null || tg_id==""){ 102 + if(tg_id==null ||goods_id==null){
104 var tg_id_str=decodeURIComponent(postdata.scene); 103 var tg_id_str=decodeURIComponent(postdata.scene);
105 tg_id_str=tg_id_str.split("_"); 104 tg_id_str=tg_id_str.split("_");
106 - tg_id=tg_id_str[0];  
107 - if(tg_id_str.length>1){  
108 - first_leader=tg_id_str[1]; 105 + console.log(tg_id_str.length);
  106 + //tg_id_str[0] teamgroup.id tg_id_str[1] user_id tg_id_str[2] goods_id
  107 + switch(tg_id_str.length){
  108 + case 1:
  109 + tg_id=tg_id_str[0];
  110 + break;
  111 + case 2:
  112 + tg_id=tg_id_str[0];
  113 + first_leader=tg_id_str[1];
  114 + break;
  115 + case 3:
  116 + tg_id=tg_id_str[0];
  117 + first_leader=tg_id_str[1];
  118 + goods_id=tg_id_str[2];
  119 + break;
109 } 120 }
110 } 121 }
111 //--判断一下是不是导购-- 122 //--判断一下是不是导购--
@@ -118,14 +129,13 @@ Page({ @@ -118,14 +129,13 @@ Page({
118 } 129 }
119 }) 130 })
120 } 131 }
121 -  
122 - this.setData({tg_id: tg_id }); 132 + this.setData({tg_id: tg_id,goods_id});
123 getApp().globalData.to_group=null; 133 getApp().globalData.to_group=null;
124 134
125 - var th=this;  
126 - getApp().getConfig2(function(e) {  
127 - th.setData({ bconfig: e,});  
128 - th.wait_for_store_config(); //获取默认的门店 135 + var th=this;
  136 + getApp().getConfig2(function(e) {
  137 + th.setData({ bconfig: e,});
  138 + th.wait_for_store_config(); //获取默认的门店
129 }) 139 })
130 140
131 }, 141 },
@@ -358,17 +368,47 @@ Page({ @@ -358,17 +368,47 @@ Page({
358 max_num = 0, 368 max_num = 0,
359 min_price = 0, 369 min_price = 0,
360 th=this, 370 th=this,
361 - that=th; 371 + that=th,
  372 + flag=null;
  373 + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/2",{
  374 + data:{
  375 + store_id: os.stoid,
  376 + is_end: 0,
  377 + is_show: 1,
  378 + user_id: getApp().globalData.user_id,
  379 + pageSize:1000
  380 + }
  381 + }).then(res=>{
  382 + let pd_list=res.data.data.pageData;
  383 + if(res.data.code==0 && pd_list.length>0){
  384 + flag =pd_list.some(pd=>{
  385 + // if(th.data.goods_id){
  386 + return pd.goods_id==th.data.goods_id;
  387 + // }
  388 + })
  389 + }
  390 + })
  391 + if(!flag){
  392 + wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000});
  393 + setTimeout(function () {
  394 + ut.wx_back();
  395 + }, 1000)
  396 + return false;
  397 + }
362 398
363 //获取活动从表信息team_id,listno团编号(券号) 399 //获取活动从表信息team_id,listno团编号(券号)
364 await getApp().request.promiseGet("/api/weshop/teamgroup/get/"+os.stoid+"/"+tg_id, { 400 await getApp().request.promiseGet("/api/weshop/teamgroup/get/"+os.stoid+"/"+tg_id, {
365 }).then(res => { 401 }).then(res => {
  402 +
  403 + if(res.data.code !=0 ){
  404 + getApp().showWarning(res.data.msg);
  405 + th.go_back();
  406 + return false;
  407 + }
366 408
367 -  
368 - if(res.data.code==0 && res.data && res.data.data ) { 409 + if(res.data && res.data.data ) {
369 410
370 teamgroup = res.data.data; 411 teamgroup = res.data.data;
371 -  
372 //获取当前时间,并且判断剩余时间 412 //获取当前时间,并且判断剩余时间
373 var nt = ut.gettimestamp(); 413 var nt = ut.gettimestamp();
374 var buy_start_date = ut.formatTime(teamgroup.buy_start_date, "yyyy-MM-dd hh:mm:ss"); 414 var buy_start_date = ut.formatTime(teamgroup.buy_start_date, "yyyy-MM-dd hh:mm:ss");
@@ -388,7 +428,6 @@ Page({ @@ -388,7 +428,6 @@ Page({
388 } 428 }
389 429
390 } 430 }
391 -  
392 }) 431 })
393 432
394 //判断是不是要继续的开关 433 //判断是不是要继续的开关
@@ -433,36 +472,10 @@ Page({ @@ -433,36 +472,10 @@ Page({
433 //获取活动表的信息根据活动team_id 472 //获取活动表的信息根据活动team_id
434 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + teamgroup.team_id, { 473 await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + teamgroup.team_id, {
435 data: {} 474 data: {}
436 - }).then(async res => {  
437 - var flag=null; 475 + }).then(res => {
438 if (res.data.code == 0) { 476 if (res.data.code == 0) {
439 teamlist = res.data.data; 477 teamlist = res.data.data;
440 goods_id = res.data.data.goods_id; 478 goods_id = res.data.data.goods_id;
441 -  
442 - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{  
443 - data:{  
444 - store_id: os.stoid,  
445 - is_end: 0,  
446 - is_show: 1,  
447 - user_id: getApp().globalData.user_id,  
448 - pageSize:1000  
449 - }  
450 - }).then(res=>{  
451 - let pd_list=res.data.data.pageData;  
452 - if(res.data.code==0 && pd_list.length>0){  
453 - flag =pd_list.some(pd=>{  
454 - return pd.goods_id==teamlist['goods_id']  
455 - })  
456 - }  
457 - })  
458 - if(!flag){  
459 - wx.showToast({title: "当前会员身份不符,无法参与", icon: 'none', duration: 3000});  
460 - // setTimeout(function () {  
461 - ut.wx_back();  
462 - // }, 2000)  
463 - return false;  
464 - }  
465 -  
466 //----------查看阶梯团------------ 479 //----------查看阶梯团------------
467 if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined) { 480 if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined) {
468 var ct_rylist = JSON.parse(teamlist.ct_rylist); 481 var ct_rylist = JSON.parse(teamlist.ct_rylist);
pages/team/team_success/team_success.js
@@ -398,19 +398,26 @@ Page({ @@ -398,19 +398,26 @@ Page({
398 var app = getApp(); 398 var app = getApp();
399 var unit = that.data.screenWidth / 750 * 1.35; 399 var unit = that.data.screenWidth / 750 * 1.35;
400 var scene=th.data.teamgroup.id; 400 var scene=th.data.teamgroup.id;
  401 + var goods_id=th.data.teamlist.goods_id;
401 var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0; 402 var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
402 if(user_id>0){ 403 if(user_id>0){
403 scene+="_"+user_id; 404 scene+="_"+user_id;
404 } 405 }
  406 + if(goods_id !==""){
  407 + scene+="_"+goods_id;
  408 + }
405 409
406 //二微码 410 //二微码
407 var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+ 411 var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+
408 os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show"; 412 os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show";
409 413
  414 + console.log(path3,6000);
  415 +
410 //读取文件成功则OK-- 416 //读取文件成功则OK--
411 wx.getImageInfo({ 417 wx.getImageInfo({
412 src: path3, 418 src: path3,
413 success:function (res) { 419 success:function (res) {
  420 + console.log(res,5000);
414 //回调写法 421 //回调写法
415 th.get_head_temp(th.get_goods_temp,function () { 422 th.get_head_temp(th.get_goods_temp,function () {
416 var vpath = res.path; 423 var vpath = res.path;
@@ -812,7 +819,8 @@ Page({ @@ -812,7 +819,8 @@ Page({
812 onShareAppMessage: function (e) { 819 onShareAppMessage: function (e) {
813 var th=this; 820 var th=this;
814 var scene=this.data.teamgroup.id; 821 var scene=this.data.teamgroup.id;
815 - var url="/pages/team/team_show/team_show?tg_id="+scene; 822 + var goods_id=this.data.teamlist.goods_id;
  823 + var url="/pages/team/team_show/team_show?tg_id="+scene+"&goods_id"+goods_id;
816 //--分享图片-- 824 //--分享图片--
817 var img=th.data.iurl+th.data.teamlist.share_imgurl; 825 var img=th.data.iurl+th.data.teamlist.share_imgurl;
818 //--把会员分享出去-- 826 //--把会员分享出去--
@@ -828,7 +836,6 @@ Page({ @@ -828,7 +836,6 @@ Page({
828 if(th.data.teamlist.share_title){ 836 if(th.data.teamlist.share_title){
829 share_title=th.data.teamlist.share_title; 837 share_title=th.data.teamlist.share_title;
830 } 838 }
831 - console.log(url,3000);  
832 return { 839 return {
833 path:url, 840 path:url,
834 title: share_title, 841 title: share_title,