Commit 9163e9969507f73851b85c778146616745726222

Authored by abson
1 parent 0e1500db

不包邮地区

packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
@@ -121,22 +121,22 @@ Page({ @@ -121,22 +121,22 @@ Page({
121 tabs: ['门店自提', '快递邮寄'], 121 tabs: ['门店自提', '快递邮寄'],
122 currentTabIndex: 1, 122 currentTabIndex: 1,
123 123
124 - in_zhact_gdmap:{}, //不同门店参与同一活动的限购  
125 - hid_inp:1,  
126 - user_note:{},  
127 - zuhe_map_good:{}, 124 + in_zhact_gdmap: {}, //不同门店参与同一活动的限购
  125 + hid_inp: 1,
  126 + user_note: {},
  127 + zuhe_map_good: {},
128 }, 128 },
129 - 129 +
130 onLoad: function (t) { 130 onLoad: function (t) {
131 - wx.setNavigationBarTitle({title: "填写订单",}) 131 + wx.setNavigationBarTitle({ title: "填写订单", })
132 var th = this; 132 var th = this;
133 - this.setData({is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow,}); 133 + this.setData({ is_b_now: t.is_bnow == undefined ? 0 : t.is_bnow, });
134 th.data.param = t; 134 th.data.param = t;
135 //清理一下,确保最新的系统配置 135 //清理一下,确保最新的系统配置
136 getApp().globalData.config2 = null; 136 getApp().globalData.config2 = null;
137 //清空is_pick_up 137 //清空is_pick_up
138 getApp().request.put("/api/weshop/useraddress/updatePickUp", { 138 getApp().request.put("/api/weshop/useraddress/updatePickUp", {
139 - data: {user_id: getApp().globalData.user_id, is_pickup: 0}, 139 + data: { user_id: getApp().globalData.user_id, is_pickup: 0 },
140 success: function (s) { 140 success: function (s) {
141 } 141 }
142 }); 142 });
@@ -144,7 +144,7 @@ Page({ @@ -144,7 +144,7 @@ Page({
144 144
145 }, 145 },
146 onUnload: function () { 146 onUnload: function () {
147 - this.setData({isclose: 1}) 147 + this.setData({ isclose: 1 })
148 }, 148 },
149 onHide: function () { 149 onHide: function () {
150 this.setData({ 150 this.setData({
@@ -157,7 +157,7 @@ Page({ @@ -157,7 +157,7 @@ Page({
157 //----------子页返回父页触发---------- 157 //----------子页返回父页触发----------
158 onShow: function () { 158 onShow: function () {
159 var th = this; 159 var th = this;
160 - th.setData({show_submit: 0}); //让提交先掩藏 160 + th.setData({ show_submit: 0 }); //让提交先掩藏
161 th.data.g_cart_q_time = null; 161 th.data.g_cart_q_time = null;
162 162
163 if (th.data.isclose == 0) { 163 if (th.data.isclose == 0) {
@@ -190,20 +190,20 @@ Page({ @@ -190,20 +190,20 @@ Page({
190 th.data.is_summit_ing = 0; 190 th.data.is_summit_ing = 0;
191 //更换地址回来要重新调用计算价钱的接口 191 //更换地址回来要重新调用计算价钱的接口
192 if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { 192 if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) {
193 - th.setData({user_addr: ie}); 193 + th.setData({ user_addr: ie });
194 if (th.data.is_b_now == 1) { 194 if (th.data.is_b_now == 1) {
195 if (th.data.bn_goods) { 195 if (th.data.bn_goods) {
196 - th.setData({add_back: 1}); 196 + th.setData({ add_back: 1 });
197 //th.calculatePrice2(); 197 //th.calculatePrice2();
198 } 198 }
199 } else { 199 } else {
200 if (th.data.cartlist) { 200 if (th.data.cartlist) {
201 - th.setData({add_back: 1}); 201 + th.setData({ add_back: 1 });
202 //th.calculatePrice(); 202 //th.calculatePrice();
203 } 203 }
204 } 204 }
205 } else { 205 } else {
206 - th.setData({user_addr: ie}); 206 + th.setData({ user_addr: ie });
207 } 207 }
208 var going = 0; 208 var going = 0;
209 209
@@ -257,34 +257,34 @@ Page({ @@ -257,34 +257,34 @@ Page({
257 //-- 获取所有的等级卡, -- 257 //-- 获取所有的等级卡, --
258 getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid, 258 getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid,
259 {}).then(res => { 259 {}).then(res => {
260 - if (res.data.code == 0) {  
261 - var plusCard = res.data.data;  
262 - //-- 循环判断,拿到最贵的那张卡 --  
263 - for (var ih in plusCard) {  
264 - if (plusCard[ih].IsStopBuy == true) {  
265 - continue;  
266 - }  
267 - if (max_price < 0) {  
268 - max_price = plusCard[ih].CardFee;  
269 - name = 'card' + plusCard[ih]['CorrPrice'];  
270 - show_card = plusCard[ih];  
271 - } else {  
272 - if (max_price < plusCard[ih].CardFee) { 260 + if (res.data.code == 0) {
  261 + var plusCard = res.data.data;
  262 + //-- 循环判断,拿到最贵的那张卡 --
  263 + for (var ih in plusCard) {
  264 + if (plusCard[ih].IsStopBuy == true) {
  265 + continue;
  266 + }
  267 + if (max_price < 0) {
273 max_price = plusCard[ih].CardFee; 268 max_price = plusCard[ih].CardFee;
274 name = 'card' + plusCard[ih]['CorrPrice']; 269 name = 'card' + plusCard[ih]['CorrPrice'];
275 show_card = plusCard[ih]; 270 show_card = plusCard[ih];
  271 + } else {
  272 + if (max_price < plusCard[ih].CardFee) {
  273 + max_price = plusCard[ih].CardFee;
  274 + name = 'card' + plusCard[ih]['CorrPrice'];
  275 + show_card = plusCard[ih];
  276 + }
276 } 277 }
277 } 278 }
278 - }  
279 279
280 - if (show_card) {  
281 - name = name.toLowerCase();  
282 - th.setData({card_name: name, show_card: show_card}) 280 + if (show_card) {
  281 + name = name.toLowerCase();
  282 + th.setData({ card_name: name, show_card: show_card })
  283 + }
283 } 284 }
284 - }  
285 - //-----先获取物流,再获取用户信息,再展示页面-----  
286 - th.get_wuliu(th.get_info(th.show_page));  
287 - }) 285 + //-----先获取物流,再获取用户信息,再展示页面-----
  286 + th.get_wuliu(th.get_info(th.show_page));
  287 + })
288 } else { 288 } else {
289 //-----先获取物流,再获取用户信息,再展示页面----- 289 //-----先获取物流,再获取用户信息,再展示页面-----
290 th.get_wuliu(th.get_info(th.show_page)); 290 th.get_wuliu(th.get_info(th.show_page));
@@ -303,10 +303,10 @@ Page({ @@ -303,10 +303,10 @@ Page({
303 if (th.data.is_default_logistics) { 303 if (th.data.is_default_logistics) {
304 //如果第一个不是开启默认,说明要让用户自己选 304 //如果第一个不是开启默认,说明要让用户自己选
305 if (!e[0].is_default) { 305 if (!e[0].is_default) {
306 - th.setData({is_default_logistics: 0}); 306 + th.setData({ is_default_logistics: 0 });
307 } 307 }
308 } 308 }
309 - th.setData({wu_arr: e}) 309 + th.setData({ wu_arr: e })
310 typeof func == "function" && func(); 310 typeof func == "function" && func();
311 }) 311 })
312 }, 312 },
@@ -320,7 +320,7 @@ Page({ @@ -320,7 +320,7 @@ Page({
320 getuser_addr: function (func) { 320 getuser_addr: function (func) {
321 var th = this; 321 var th = this;
322 a.get("/api/weshop/useraddress/page", { 322 a.get("/api/weshop/useraddress/page", {
323 - data: {user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600, t: Math.random()}, 323 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600, t: Math.random() },
324 success: function (su) { 324 success: function (su) {
325 /*--- 325 /*---
326 var user_addr=[ 326 var user_addr=[
@@ -345,7 +345,7 @@ Page({ @@ -345,7 +345,7 @@ Page({
345 } 345 }
346 346
347 if (item == undefined) item = null; 347 if (item == undefined) item = null;
348 - if (!item) th.setData({user_addr: null}); //地址为空的时候,要清空,因为返回的时候,有缓存 348 + if (!item) th.setData({ user_addr: null }); //地址为空的时候,要清空,因为返回的时候,有缓存
349 349
350 func(item); 350 func(item);
351 } 351 }
@@ -360,19 +360,19 @@ Page({ @@ -360,19 +360,19 @@ Page({
360 //会员的信息,要获取最新 360 //会员的信息,要获取最新
361 var user = getApp().globalData.userInfo; 361 var user = getApp().globalData.userInfo;
362 getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, { 362 getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
363 - data: {r: Math.random()}, 363 + data: { r: Math.random() },
364 success: function (e) { 364 success: function (e) {
365 getApp().globalData.userInfo = e.data.data; 365 getApp().globalData.userInfo = e.data.data;
366 - th.setData({userinfo: e.data.data}); 366 + th.setData({ userinfo: e.data.data });
367 367
368 //选获取地址 368 //选获取地址
369 th.getuser_addr(function (addr) { 369 th.getuser_addr(function (addr) {
370 - th.setData({user_addr: addr}); 370 + th.setData({ user_addr: addr });
371 //--------------------------立即购买------------------ 371 //--------------------------立即购买------------------
372 if (ta.is_bnow == 1) { 372 if (ta.is_bnow == 1) {
373 //读取门店 373 //读取门店
374 to.get_allsto(function (e) { 374 to.get_allsto(function (e) {
375 - th.setData({allsto: e}); 375 + th.setData({ allsto: e });
376 //获取立即购买的商品信息 376 //获取立即购买的商品信息
377 th.get_buy_goods(ta.goods_id); 377 th.get_buy_goods(ta.goods_id);
378 }); 378 });
@@ -380,7 +380,7 @@ Page({ @@ -380,7 +380,7 @@ Page({
380 //------------------------购物车结算---------------------- 380 //------------------------购物车结算----------------------
381 //读取门店 381 //读取门店
382 to.get_allsto(function (e) { 382 to.get_allsto(function (e) {
383 - th.setData({allsto: e}); 383 + th.setData({ allsto: e });
384 //-------获取购物车已经选择的商品-------- 384 //-------获取购物车已经选择的商品--------
385 th.get_cart(); 385 th.get_cart();
386 }) 386 })
@@ -389,12 +389,12 @@ Page({ @@ -389,12 +389,12 @@ Page({
389 389
390 //获取提现金额 390 //获取提现金额
391 getApp().request.get("/api/weshop/withdrawals/summoney", { 391 getApp().request.get("/api/weshop/withdrawals/summoney", {
392 - data: {user_id: to.globalData.user_id, store_id: oo.stoid, status: 0}, 392 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
393 success: function (su) { 393 success: function (su) {
394 if (su.data.code == 0) { 394 if (su.data.code == 0) {
395 var yuer = parseFloat(th.data.userinfo.user_money - 395 var yuer = parseFloat(th.data.userinfo.user_money -
396 (th.data.userinfo.frozen_money > 0 ? th.data.userinfo.frozen_money : 0) - su.data.data.summoney).toFixed(2); 396 (th.data.userinfo.frozen_money > 0 ? th.data.userinfo.frozen_money : 0) - su.data.data.summoney).toFixed(2);
397 - th.setData({txmon: su.data.data.summoney, yuer: yuer}); 397 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
398 } 398 }
399 } 399 }
400 }); 400 });
@@ -418,7 +418,7 @@ Page({ @@ -418,7 +418,7 @@ Page({
418 var arr = new Array(); 418 var arr = new Array();
419 var carr = su.data.data.pageData; 419 var carr = su.data.data.pageData;
420 th.data.cartlist_y = carr; //存储原始购物车列表 420 th.data.cartlist_y = carr; //存储原始购物车列表
421 - th.data.in_zhact_gdmap={}; 421 + th.data.in_zhact_gdmap = {};
422 422
423 //---是不是购买等级卡成功的返回---等级卡显示的判断--- 423 //---是不是购买等级卡成功的返回---等级卡显示的判断---
424 var is_card_back = getApp().globalData.is_card_back; 424 var is_card_back = getApp().globalData.is_card_back;
@@ -427,7 +427,7 @@ Page({ @@ -427,7 +427,7 @@ Page({
427 var item1 = carr[i]; 427 var item1 = carr[i];
428 //把已经购买了多少见的内容填入 428 //把已经购买了多少见的内容填入
429 429
430 - var goodsbuynum=0,promgoodsbuynum=0; 430 + var goodsbuynum = 0, promgoodsbuynum = 0;
431 //--要获得商品,该用户买了多少件,同步应用-- 431 //--要获得商品,该用户买了多少件,同步应用--
432 await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", { 432 await getApp().request.promiseGet("/api/weshop/ordergoods/getUserBuyGoodsNum", {
433 data: { 433 data: {
@@ -445,7 +445,7 @@ Page({ @@ -445,7 +445,7 @@ Page({
445 goodsbuynum = buy_num_data.goodsbuynum; 445 goodsbuynum = buy_num_data.goodsbuynum;
446 }) 446 })
447 //如果有购买活动 447 //如果有购买活动
448 - item1.promgoodsbuynum=promgoodsbuynum; 448 + item1.promgoodsbuynum = promgoodsbuynum;
449 449
450 //要把优惠活动加入,prom_goods_map中,赠品不要运算 450 //要把优惠活动加入,prom_goods_map中,赠品不要运算
451 if (item1.prom_type == 3 && item1.is_gift != 1) { 451 if (item1.prom_type == 3 && item1.is_gift != 1) {
@@ -455,9 +455,9 @@ Page({ @@ -455,9 +455,9 @@ Page({
455 //要把组合购的东西拿出来算一下 455 //要把组合购的东西拿出来算一下
456 if (item1.prom_type == 7) { 456 if (item1.prom_type == 7) {
457 var isok = 1; 457 var isok = 1;
458 - var is_flag=1; 458 + var is_flag = 1;
459 //如果有组合购 459 //如果有组合购
460 - var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item1.prom_id+'/'+getApp().globalData.userInfo.user_id; 460 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + item1.prom_id + '/' + getApp().globalData.userInfo.user_id;
461 await getApp().request.promiseGet(url, {}).then(res => { 461 await getApp().request.promiseGet(url, {}).then(res => {
462 if (res.data.code == 0 && res.data.data) { 462 if (res.data.code == 0 && res.data.data) {
463 //如果活动已经结束 463 //如果活动已经结束
@@ -488,16 +488,16 @@ Page({ @@ -488,16 +488,16 @@ Page({
488 data: req_data 488 data: req_data
489 }).then(res => { 489 }).then(res => {
490 if (ut.ajax_ok(res)) { 490 if (ut.ajax_ok(res)) {
491 - var gdlist = res.data.data.pageData;  
492 - gdlist.forEach(i=>{  
493 - if(item1.goods_id==i.goods_id&&!is_flag){  
494 - item1.prom_type=0;  
495 - item1.prom_type1=0;  
496 - item1.prom_id=0;  
497 - item1.prom_id1=0 491 + var gdlist = res.data.data.pageData;
  492 + gdlist.forEach(i => {
  493 + if (item1.goods_id == i.goods_id && !is_flag) {
  494 + item1.prom_type = 0;
  495 + item1.prom_type1 = 0;
  496 + item1.prom_id = 0;
  497 + item1.prom_id1 = 0
498 } 498 }
499 }) 499 })
500 - th.data.zuhe_map_good[item1.prom_id]=gdlist; 500 + th.data.zuhe_map_good[item1.prom_id] = gdlist;
501 } 501 }
502 }) 502 })
503 } 503 }
@@ -532,7 +532,7 @@ Page({ @@ -532,7 +532,7 @@ Page({
532 532
533 item.original_img = oo.imghost + item.original_img; 533 item.original_img = oo.imghost + item.original_img;
534 534
535 - var car_item=item; 535 + var car_item = item;
536 /*----接口要弄出来的,先顶着-----*/ 536 /*----接口要弄出来的,先顶着-----*/
537 var pcid = car_item.pick_id; 537 var pcid = car_item.pick_id;
538 var find = 0; 538 var find = 0;
@@ -560,7 +560,7 @@ Page({ @@ -560,7 +560,7 @@ Page({
560 break; 560 break;
561 } 561 }
562 arr[j].exp_type = e_t; 562 arr[j].exp_type = e_t;
563 - if (e_t == 0) th.setData({is_all_zt: 0}); 563 + if (e_t == 0) th.setData({ is_all_zt: 0 });
564 //} 564 //}
565 565
566 //-- 把等级卡会优惠多少钱装进去 -- 566 //-- 把等级卡会优惠多少钱装进去 --
@@ -603,7 +603,7 @@ Page({ @@ -603,7 +603,7 @@ Page({
603 break; 603 break;
604 } 604 }
605 //如果是物流的话,全部自提的控制要弄成0 605 //如果是物流的话,全部自提的控制要弄成0
606 - if (e_t == 0) th.setData({is_all_zt: 0}); 606 + if (e_t == 0) th.setData({ is_all_zt: 0 });
607 607
608 var narr = new Array(); 608 var narr = new Array();
609 narr.push(car_item); 609 narr.push(car_item);
@@ -662,11 +662,11 @@ Page({ @@ -662,11 +662,11 @@ Page({
662 var offline_price = 0; 662 var offline_price = 0;
663 var offline_num = 0; 663 var offline_num = 0;
664 for (var c = 0; c < item.length; c++) { 664 for (var c = 0; c < item.length; c++) {
665 - if(th.data.sales_rules!=2){  
666 - item[c].offline_price=0; 665 + if (th.data.sales_rules != 2) {
  666 + item[c].offline_price = 0;
667 } 667 }
668 //-- 如果这个商品是线下取价的时候 -- 668 //-- 如果这个商品是线下取价的时候 --
669 - if (item[c].offline_price > 0 && item[c].prom_type != 7 ) { 669 + if (item[c].offline_price > 0 && item[c].prom_type != 7) {
670 offline_price += (item[c].goods_price - item[c].offline_price) * item[c].goods_num; 670 offline_price += (item[c].goods_price - item[c].offline_price) * item[c].goods_num;
671 offline_num += item[c].goods_num; 671 offline_num += item[c].goods_num;
672 } 672 }
@@ -689,10 +689,10 @@ Page({ @@ -689,10 +689,10 @@ Page({
689 //存储不同活动的商品列表 689 //存储不同活动的商品列表
690 u_item.zh_prom_goods = {}; 690 u_item.zh_prom_goods = {};
691 for (let var1 in obj) { 691 for (let var1 in obj) {
692 - var h_item=obj[var1];  
693 - var gdlist= th.data.zuhe_map_good[h_item.prom_id];  
694 - //获取活动需要的商品列表  
695 - // u_item.zh_prom_goods[h_item.prom_id]=gdlist; 692 + var h_item = obj[var1];
  693 + var gdlist = th.data.zuhe_map_good[h_item.prom_id];
  694 + //获取活动需要的商品列表
  695 + // u_item.zh_prom_goods[h_item.prom_id]=gdlist;
696 // var h_item = obj[var1]; 696 // var h_item = obj[var1];
697 // var gdlist = null; 697 // var gdlist = null;
698 // var url1 = "/api/weshop/prom/zhbuyGoods/page"; 698 // var url1 = "/api/weshop/prom/zhbuyGoods/page";
@@ -710,7 +710,7 @@ Page({ @@ -710,7 +710,7 @@ Page({
710 // } 710 // }
711 // }) 711 // })
712 //获取活动需要的商品列表 712 //获取活动需要的商品列表
713 - u_item.zh_prom_goods[h_item.prom_id] = {gdlist: gdlist, act: h_item.act}; 713 + u_item.zh_prom_goods[h_item.prom_id] = { gdlist: gdlist, act: h_item.act };
714 } 714 }
715 zh_calc.fir_set_arr(u_item, th); 715 zh_calc.fir_set_arr(u_item, th);
716 } 716 }
@@ -723,7 +723,7 @@ Page({ @@ -723,7 +723,7 @@ Page({
723 setTimeout(function () { 723 setTimeout(function () {
724 var frozenQuan = null; 724 var frozenQuan = null;
725 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; 725 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
726 - app.request.promiseGet(url0, {1: 1}).then(res => { 726 + app.request.promiseGet(url0, { 1: 1 }).then(res => {
727 if (res.data.code == 0) { 727 if (res.data.code == 0) {
728 frozenQuan = res.data.data; 728 frozenQuan = res.data.data;
729 th.data.frozenQuan = frozenQuan; 729 th.data.frozenQuan = frozenQuan;
@@ -794,7 +794,7 @@ Page({ @@ -794,7 +794,7 @@ Page({
794 th.data.card_name = th.data.userinfo.card_field; 794 th.data.card_name = th.data.userinfo.card_field;
795 gg.goods_price = gd[th.data.card_name]; 795 gg.goods_price = gd[th.data.card_name];
796 getApp().globalData.is_card_back = 0; 796 getApp().globalData.is_card_back = 0;
797 - th.setData({card_cut_price: 0}); 797 + th.setData({ card_cut_price: 0 });
798 //如果是秒杀的返回 798 //如果是秒杀的返回
799 if (gd.prom_type == 1) gd.prom_type = 0; 799 if (gd.prom_type == 1) gd.prom_type = 0;
800 } else { 800 } else {
@@ -802,13 +802,13 @@ Page({ @@ -802,13 +802,13 @@ Page({
802 //-- 搭配购的商品也可以单独购买,所以此时搭配购的商品要进行计算优惠 -- 802 //-- 搭配购的商品也可以单独购买,所以此时搭配购的商品要进行计算优惠 --
803 if (!gg.collocation_goods && gd['prom_type'] != 6 && th.data.card_name && gd[th.data.card_name] > 0 && gg.goods_price > gd[th.data.card_name] && !th.data.userinfo.card_field) { 803 if (!gg.collocation_goods && gd['prom_type'] != 6 && th.data.card_name && gd[th.data.card_name] > 0 && gg.goods_price > gd[th.data.card_name] && !th.data.userinfo.card_field) {
804 var cut_p = (gg.goods_price - gd[th.data.card_name]) * gg.goods_num; 804 var cut_p = (gg.goods_price - gd[th.data.card_name]) * gg.goods_num;
805 - th.setData({card_cut_price: cut_p}); 805 + th.setData({ card_cut_price: cut_p });
806 } 806 }
807 } 807 }
808 808
809 809
810 - gd.prom_type=gg.prom_type;  
811 - gd.prom_id=gg.prom_id; 810 + gd.prom_type = gg.prom_type;
  811 + gd.prom_id = gg.prom_id;
812 812
813 switch (gd.prom_type) { 813 switch (gd.prom_type) {
814 case 0: 814 case 0:
@@ -872,7 +872,7 @@ Page({ @@ -872,7 +872,7 @@ Page({
872 ob.exp_sum_type = data.gift_exp_sum_type; //商品的物流计算方式 872 ob.exp_sum_type = data.gift_exp_sum_type; //商品的物流计算方式
873 ob.uniform_exp_sum = data.gift_uniform_exp_sum //统一运费的金额 873 ob.uniform_exp_sum = data.gift_uniform_exp_sum //统一运费的金额
874 874
875 - th.setData({buy_now_gift_goods: ob}); 875 + th.setData({ buy_now_gift_goods: ob });
876 } 876 }
877 } 877 }
878 878
@@ -900,7 +900,7 @@ Page({ @@ -900,7 +900,7 @@ Page({
900 t.data.data.guide_id = gg.guide_id; 900 t.data.data.guide_id = gg.guide_id;
901 t.data.data.guide_type = gg.guide_type; 901 t.data.data.guide_type = gg.guide_type;
902 } 902 }
903 - th.setData({collocation_goods: gg.collocation_goods}); 903 + th.setData({ collocation_goods: gg.collocation_goods });
904 904
905 var cart_arr = new Array(); 905 var cart_arr = new Array();
906 //var narr=gg.collocation_goods; 906 //var narr=gg.collocation_goods;
@@ -915,7 +915,7 @@ Page({ @@ -915,7 +915,7 @@ Page({
915 for (var hi in narr) { 915 for (var hi in narr) {
916 var dis_t = narr[hi].distr_type; 916 var dis_t = narr[hi].distr_type;
917 if (dis_t == 2) { 917 if (dis_t == 2) {
918 - th.setData({is_all_zt: 0}); 918 + th.setData({ is_all_zt: 0 });
919 et = 0; 919 et = 0;
920 } 920 }
921 if (dis_t > 0) { 921 if (dis_t > 0) {
@@ -957,7 +957,7 @@ Page({ @@ -957,7 +957,7 @@ Page({
957 if (gg.prom_type == 5) { 957 if (gg.prom_type == 5) {
958 var frozenQuan = null; 958 var frozenQuan = null;
959 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; 959 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
960 - app.request.promiseGet(url0, {1: 1}).then(res => { 960 + app.request.promiseGet(url0, { 1: 1 }).then(res => {
961 if (res.data.code == 0) { 961 if (res.data.code == 0) {
962 frozenQuan = res.data.data; 962 frozenQuan = res.data.data;
963 th.data.frozenQuan = frozenQuan; 963 th.data.frozenQuan = frozenQuan;
@@ -978,13 +978,13 @@ Page({ @@ -978,13 +978,13 @@ Page({
978 case 1: //---秒杀----- 978 case 1: //---秒杀-----
979 var quanlist = null; 979 var quanlist = null;
980 getApp().request.get("/api/weshop/activitylist/getSJGoodsPriceNew/" + gd.store_id 980 getApp().request.get("/api/weshop/activitylist/getSJGoodsPriceNew/" + gd.store_id
981 - + "/" + gd.goods_id + "/1/" + gd.prom_id+"/"+app.globalData.user_id, { 981 + + "/" + gd.goods_id + "/1/" + gd.prom_id + "/" + app.globalData.user_id, {
982 success: async function (tt) { 982 success: async function (tt) {
983 if (tt.data.code == 0) { 983 if (tt.data.code == 0) {
984 //t.data.data.shop_price = tt.data.data.prom_price; 984 //t.data.data.shop_price = tt.data.data.prom_price;
985 t.data.data.shop_price = tt.data.data.prom_user_price; 985 t.data.data.shop_price = tt.data.data.prom_user_price;
986 - th.data.ckeck_quan_price=0;  
987 - gd.is_xz_yh=1; 986 + th.data.ckeck_quan_price = 0;
  987 + gd.is_xz_yh = 1;
988 } else { 988 } else {
989 t.data.data.prom_id = 0; 989 t.data.data.prom_id = 0;
990 t.data.data.prom_type = 0; 990 t.data.data.prom_type = 0;
@@ -1006,7 +1006,7 @@ Page({ @@ -1006,7 +1006,7 @@ Page({
1006 //计算价格 1006 //计算价格
1007 th.calculatePrice2(); 1007 th.calculatePrice2();
1008 //获取优惠券,如果有券的钱,就调用 1008 //获取优惠券,如果有券的钱,就调用
1009 - if(th.data.ckeck_quan_price>0) th.get_buy_now_quan(); 1009 + if (th.data.ckeck_quan_price > 0) th.get_buy_now_quan();
1010 } 1010 }
1011 }); 1011 });
1012 1012
@@ -1014,7 +1014,7 @@ Page({ @@ -1014,7 +1014,7 @@ Page({
1014 1014
1015 case 2: //--- 团购 --- 1015 case 2: //--- 团购 ---
1016 var quanlist = null; 1016 var quanlist = null;
1017 - getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" +os.stoid + "/" +gd.goods_id+"/"+ gd.prom_id, { 1017 + getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gd.goods_id + "/" + gd.prom_id, {
1018 success: async function (tt) { 1018 success: async function (tt) {
1019 if (tt.data.code == 0) { 1019 if (tt.data.code == 0) {
1020 //t.data.data.shop_price = tt.data.data.prom_price; 1020 //t.data.data.shop_price = tt.data.data.prom_price;
@@ -1024,12 +1024,12 @@ Page({ @@ -1024,12 +1024,12 @@ Page({
1024 t.data.data.prom_type = 0; 1024 t.data.data.prom_type = 0;
1025 } 1025 }
1026 1026
1027 - if(tt.data.data.isQuan){ 1027 + if (tt.data.data.isQuan) {
1028 th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num; 1028 th.data.ckeck_quan_price = t.data.data.shop_price * gg.goods_num;
1029 th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + ""; 1029 th.data.check_quan_price_list = t.data.data.shop_price * gg.goods_num + "";
1030 th.data.check_quan_ware_list = t.data.data.erpwareid + ""; 1030 th.data.check_quan_ware_list = t.data.data.erpwareid + "";
1031 - }else{  
1032 - gd.is_xz_yh=1; 1031 + } else {
  1032 + gd.is_xz_yh = 1;
1033 } 1033 }
1034 1034
1035 th.setData({ 1035 th.setData({
@@ -1045,7 +1045,7 @@ Page({ @@ -1045,7 +1045,7 @@ Page({
1045 //-- 计算价格 -- 1045 //-- 计算价格 --
1046 th.calculatePrice2(); 1046 th.calculatePrice2();
1047 //获取优惠券,如果有券的钱,就调用 1047 //获取优惠券,如果有券的钱,就调用
1048 - if(th.data.ckeck_quan_price>0) th.get_buy_now_quan(); 1048 + if (th.data.ckeck_quan_price > 0) th.get_buy_now_quan();
1049 } 1049 }
1050 }); 1050 });
1051 1051
@@ -1060,14 +1060,14 @@ Page({ @@ -1060,14 +1060,14 @@ Page({
1060 checkAddressList: function () { 1060 checkAddressList: function () {
1061 var t = this; 1061 var t = this;
1062 return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({ 1062 return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({
1063 - title: "请先填写或选择收货地址~",  
1064 - success: function (a) {  
1065 - a.confirm ? t.enterAddressPage() : wx.navigateBack();  
1066 - },  
1067 - fail: function () {  
1068 - wx.navigateBack();  
1069 - }  
1070 - }), !1); 1063 + title: "请先填写或选择收货地址~",
  1064 + success: function (a) {
  1065 + a.confirm ? t.enterAddressPage() : wx.navigateBack();
  1066 + },
  1067 + fail: function () {
  1068 + wx.navigateBack();
  1069 + }
  1070 + }), !1);
1071 }, 1071 },
1072 showInvoice: function () { 1072 showInvoice: function () {
1073 this.setData({ 1073 this.setData({
@@ -1086,7 +1086,7 @@ Page({ @@ -1086,7 +1086,7 @@ Page({
1086 }, 1086 },
1087 keyUpChangeNum: function (t) { 1087 keyUpChangeNum: function (t) {
1088 var index = t.currentTarget.dataset.index; 1088 var index = t.currentTarget.dataset.index;
1089 - var txt="user_note."+index; 1089 + var txt = "user_note." + index;
1090 this.setData({ 1090 this.setData({
1091 maxWord: t.detail.value.length, 1091 maxWord: t.detail.value.length,
1092 [txt]: t.detail.value 1092 [txt]: t.detail.value
@@ -1176,7 +1176,7 @@ Page({ @@ -1176,7 +1176,7 @@ Page({
1176 } 1176 }
1177 1177
1178 var pt_res = null; 1178 var pt_res = null;
1179 - await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", { 1179 + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", {
1180 is_json: 1, 1180 is_json: 1,
1181 data: pt_data 1181 data: pt_data
1182 }).then(res => { 1182 }).then(res => {
@@ -1231,11 +1231,11 @@ Page({ @@ -1231,11 +1231,11 @@ Page({
1231 if (item_map.s_coupon_id) { 1231 if (item_map.s_coupon_id) {
1232 if (!cart_item.s_coupon_id) { 1232 if (!cart_item.s_coupon_id) {
1233 cart_item.s_coupon_id = item_map.s_coupon_id + ""; 1233 cart_item.s_coupon_id = item_map.s_coupon_id + "";
1234 - cart_item.g_coupon_num = [{'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num}]; 1234 + cart_item.g_coupon_num = [{ 'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num }];
1235 } 1235 }
1236 else { 1236 else {
1237 cart_item.s_coupon_id += "," + item_map.s_coupon_id; 1237 cart_item.s_coupon_id += "," + item_map.s_coupon_id;
1238 - cart_item.g_coupon_num.push({'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num}) 1238 + cart_item.g_coupon_num.push({ 'c_id': item_map.s_coupon_id, "num": item_map.s_coupon_num })
1239 } 1239 }
1240 } 1240 }
1241 1241
@@ -1243,11 +1243,11 @@ Page({ @@ -1243,11 +1243,11 @@ Page({
1243 if (item_map.s_libao) { 1243 if (item_map.s_libao) {
1244 if (!cart_item.s_libao) { 1244 if (!cart_item.s_libao) {
1245 cart_item.s_libao = item_map.s_libao + ""; 1245 cart_item.s_libao = item_map.s_libao + "";
1246 - cart_item.g_lb_num = [{'l_id': item_map.s_libao, "num": item_map.s_lb_num}]; 1246 + cart_item.g_lb_num = [{ 'l_id': item_map.s_libao, "num": item_map.s_lb_num }];
1247 } 1247 }
1248 else { 1248 else {
1249 cart_item.s_libao += "," + item_map.s_libao; 1249 cart_item.s_libao += "," + item_map.s_libao;
1250 - cart_item.g_lb_num.push({'l_id': item_map.s_libao, "num": item_map.s_lb_num}) 1250 + cart_item.g_lb_num.push({ 'l_id': item_map.s_libao, "num": item_map.s_lb_num })
1251 } 1251 }
1252 } 1252 }
1253 } 1253 }
@@ -1272,7 +1272,7 @@ Page({ @@ -1272,7 +1272,7 @@ Page({
1272 var all_cutprice = 0; //所有的优惠减 1272 var all_cutprice = 0; //所有的优惠减
1273 var all_zh_cutprice = 0; //所有的组合优惠减 1273 var all_zh_cutprice = 0; //所有的组合优惠减
1274 var all_order_prom = 0; //所有的订单优惠 1274 var all_order_prom = 0; //所有的订单优惠
1275 - var out_of_weight=0; //超出多少重量 1275 + var out_of_weight = 0; //超出多少重量
1276 var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money : 0); 1276 var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money : 0);
1277 var freight_free = ee.freight_free; //全场满多少包邮 1277 var freight_free = ee.freight_free; //全场满多少包邮
1278 var weight_free = ee.weight_free; //多少kg内包邮 1278 var weight_free = ee.weight_free; //多少kg内包邮
@@ -1283,7 +1283,7 @@ Page({ @@ -1283,7 +1283,7 @@ Page({
1283 if (no_ex_id && freight_free > 0) { 1283 if (no_ex_id && freight_free > 0) {
1284 //-----------获取不包邮区域,不包邮商品------- 1284 //-----------获取不包邮区域,不包邮商品-------
1285 await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", { 1285 await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
1286 - data: {store_id: os.stoid, id: no_ex_id} 1286 + data: { store_id: os.stoid, id: no_ex_id }
1287 }).then(res => { 1287 }).then(res => {
1288 if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { 1288 if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
1289 by_qc = res.data.data[0]; 1289 by_qc = res.data.data[0];
@@ -1303,7 +1303,7 @@ Page({ @@ -1303,7 +1303,7 @@ Page({
1303 //调用函数计算每件商品的单价 1303 //调用函数计算每件商品的单价
1304 await th.calc_per(c_arr); 1304 await th.calc_per(c_arr);
1305 //调用函数计算每件组合购商品的单价, 1305 //调用函数计算每件组合购商品的单价,
1306 - await zh_calc.calc_zh_split_price(c_arr,th); 1306 + await zh_calc.calc_zh_split_price(c_arr, th);
1307 //调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品 1307 //调用函数计算,优惠券优惠什么商品价格,优惠券优惠什么商品
1308 await th.get_cart_quan(c_arr); 1308 await th.get_cart_quan(c_arr);
1309 //---循环购物车--- 1309 //---循环购物车---
@@ -1326,7 +1326,7 @@ Page({ @@ -1326,7 +1326,7 @@ Page({
1326 var cart_item = c_arr[i]; //就是每一单的意思 1326 var cart_item = c_arr[i]; //就是每一单的意思
1327 var pickid = cart_item.pickup_id; 1327 var pickid = cart_item.pickup_id;
1328 var o_price = 0; 1328 var o_price = 0;
1329 - var o_price_no_zh=0; //参与订单优惠叠加--组合购的金额汇总 1329 + var o_price_no_zh = 0; //参与订单优惠叠加--组合购的金额汇总
1330 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; 1330 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
1331 var item = c_arr[i].goods; //就是每一单的从表的意思 1331 var item = c_arr[i].goods; //就是每一单的从表的意思
1332 1332
@@ -1334,8 +1334,8 @@ Page({ @@ -1334,8 +1334,8 @@ Page({
1334 var quan_price = 0; 1334 var quan_price = 0;
1335 var coupon_price = 0; 1335 var coupon_price = 0;
1336 var quan_no = null; 1336 var quan_no = null;
1337 - var is_has_zh=c_arr[i].is_has_zh;  
1338 - var zh_prom_goods=c_arr[i].zh_prom_goods; //组合购计算的原始数据存储空间 1337 + var is_has_zh = c_arr[i].is_has_zh;
  1338 + var zh_prom_goods = c_arr[i].zh_prom_goods; //组合购计算的原始数据存储空间
1339 1339
1340 if (th.data.using_quan[pickid] != null && th.data.using_quan[pickid] != undefined) 1340 if (th.data.using_quan[pickid] != null && th.data.using_quan[pickid] != undefined)
1341 quan_no = th.data.using_quan[pickid].coupon_no; 1341 quan_no = th.data.using_quan[pickid].coupon_no;
@@ -1363,43 +1363,42 @@ Page({ @@ -1363,43 +1363,42 @@ Page({
1363 1363
1364 //--------循环计算总价----------- 1364 //--------循环计算总价-----------
1365 for (var j = 0; j < item.length; j++) { 1365 for (var j = 0; j < item.length; j++) {
1366 - if(item[j].prom_type!=7){ 1366 + if (item[j].prom_type != 7) {
1367 o_price_no_zh += item[j].goods_price * item[j].goods_num; 1367 o_price_no_zh += item[j].goods_price * item[j].goods_num;
1368 } 1368 }
1369 //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加 1369 //组合购的商品,且有订单优惠的叠加,is_orderyh就是优惠叠加
1370 - else if(zh_prom_goods && zh_prom_goods[item[j].prom_id] && zh_prom_goods[item[j].prom_id].act.is_orderyh )  
1371 - { 1370 + else if (zh_prom_goods && zh_prom_goods[item[j].prom_id] && zh_prom_goods[item[j].prom_id].act.is_orderyh) {
1372 o_price_no_zh += item[j].goods_price * item[j].goods_num; 1371 o_price_no_zh += item[j].goods_price * item[j].goods_num;
1373 } 1372 }
1374 o_price += item[j].goods_price * item[j].goods_num; 1373 o_price += item[j].goods_price * item[j].goods_num;
1375 1374
1376 //判断是否有设置限制重量包邮 1375 //判断是否有设置限制重量包邮
1377 - if(item[j]['is_past']!==1 && item[j]['exp_sum_type']==2){ 1376 + if (item[j]['is_past'] !== 1 && item[j]['exp_sum_type'] == 2) {
1378 if (goods_weight < 0) goods_weight = 0; 1377 if (goods_weight < 0) goods_weight = 0;
1379 - //累积商品重量 每种商品的重量 * 数量 1378 + //累积商品重量 每种商品的重量 * 数量
1380 goods_weight += item[j]['weight'] * item[j]['goods_num']; 1379 goods_weight += item[j]['weight'] * item[j]['goods_num'];
1381 - if(weight_free > 0){  
1382 - out_of_weight = (weight_free*1000) - goods_weight; 1380 + if (weight_free > 0) {
  1381 + out_of_weight = (weight_free * 1000) - goods_weight;
1383 } 1382 }
1384 } 1383 }
1385 } 1384 }
1386 //判断是不是有组合购的金额 1385 //判断是不是有组合购的金额
1387 var f_o_price = o_price; 1386 var f_o_price = o_price;
1388 //如果又优惠的钱,就要减价 1387 //如果又优惠的钱,就要减价
1389 - if (c_arr[i].cut_price > 0){ 1388 + if (c_arr[i].cut_price > 0) {
1390 o_price -= c_arr[i].cut_price; 1389 o_price -= c_arr[i].cut_price;
1391 - o_price_no_zh-=c_arr[i].cut_price; 1390 + o_price_no_zh -= c_arr[i].cut_price;
1392 } 1391 }
1393 //如果有组合购优惠的钱,就要减价 1392 //如果有组合购优惠的钱,就要减价
1394 - if (c_arr[i].zh_cut_price>0 || c_arr[i].zh_cut_price<0){ 1393 + if (c_arr[i].zh_cut_price > 0 || c_arr[i].zh_cut_price < 0) {
1395 o_price -= c_arr[i].zh_cut_price; 1394 o_price -= c_arr[i].zh_cut_price;
1396 - if(o_price_no_zh>0){ 1395 + if (o_price_no_zh > 0) {
1397 //找到那些可以订单优惠叠加的 1396 //找到那些可以订单优惠叠加的
1398 - for(let ij in zh_prom_goods){  
1399 - let kitem=zh_prom_goods[ij];  
1400 - var is_has_zh=kitem.is_has_zh;  
1401 - if(kitem.act.is_orderyh)  
1402 - o_price_no_zh-=kitem.cut_price; 1397 + for (let ij in zh_prom_goods) {
  1398 + let kitem = zh_prom_goods[ij];
  1399 + var is_has_zh = kitem.is_has_zh;
  1400 + if (kitem.act.is_orderyh)
  1401 + o_price_no_zh -= kitem.cut_price;
1403 } 1402 }
1404 } 1403 }
1405 } 1404 }
@@ -1407,12 +1406,12 @@ Page({ @@ -1407,12 +1406,12 @@ Page({
1407 //-- 计算线下取价的功能 -- 1406 //-- 计算线下取价的功能 --
1408 if (cart_item.is_offline == 1) { 1407 if (cart_item.is_offline == 1) {
1409 o_price = o_price - cart_item.offline_price; 1408 o_price = o_price - cart_item.offline_price;
1410 - o_price_no_zh-=c_arr[i].offline_price; 1409 + o_price_no_zh -= c_arr[i].offline_price;
1411 } 1410 }
1412 //判断包邮券的钱,组合购的商品不使用优惠券 1411 //判断包邮券的钱,组合购的商品不使用优惠券
1413 var q_conditin = 0; 1412 var q_conditin = 0;
1414 q_conditin = o_price - quan_price; 1413 q_conditin = o_price - quan_price;
1415 - if(is_has_zh){ 1414 + if (is_has_zh) {
1416 q_conditin = o_price_no_zh - quan_price; 1415 q_conditin = o_price_no_zh - quan_price;
1417 } 1416 }
1418 cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算 1417 cart_item.goods_price = f_o_price.toFixed(2); //商品总费用,用f_o_price来计算
@@ -1426,12 +1425,17 @@ Page({ @@ -1426,12 +1425,17 @@ Page({
1426 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) { 1425 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) {
1427 if (th.check_by_area(by_qc.region_list)) { 1426 if (th.check_by_area(by_qc.region_list)) {
1428 freight_free = 0; 1427 freight_free = 0;
  1428 + goods_weight = -1;
  1429 + out_of_weight = 0;
1429 th.data.is_no_by[pickid] = 1; 1430 th.data.is_no_by[pickid] = 1;
1430 } 1431 }
1431 } 1432 }
1432 //如果有设置不包邮区商品 1433 //如果有设置不包邮区商品
1433 if (by_qc.goods_list != "" && by_qc.goods_list != undefined && by_qc != null && freight_free > 0) { 1434 if (by_qc.goods_list != "" && by_qc.goods_list != undefined && by_qc != null && freight_free > 0) {
1434 freight_free = 0; 1435 freight_free = 0;
  1436 + goods_weight = -1;
  1437 + out_of_weight = 0;
  1438 + th.data.is_no_by[pickid] = 1;
1435 no_ex_good = by_qc.goods_list; 1439 no_ex_good = by_qc.goods_list;
1436 } 1440 }
1437 } 1441 }
@@ -1446,7 +1450,7 @@ Page({ @@ -1446,7 +1450,7 @@ Page({
1446 store_id: os.stoid, 1450 store_id: os.stoid,
1447 isuse: 0, 1451 isuse: 0,
1448 //condition: q_conditin, 1452 //condition: q_conditin,
1449 - condition:cart_item.ckeck_quan_price, 1453 + condition: cart_item.ckeck_quan_price,
1450 user_id: getApp().globalData.user_id, 1454 user_id: getApp().globalData.user_id,
1451 pageSize: 2000 1455 pageSize: 2000
1452 } 1456 }
@@ -1471,7 +1475,7 @@ Page({ @@ -1471,7 +1475,7 @@ Page({
1471 } 1475 }
1472 if (arr) { 1476 if (arr) {
1473 th.data.get_by_quan_list_cart[pickid] = arr; 1477 th.data.get_by_quan_list_cart[pickid] = arr;
1474 - th.setData({get_by_quan_list_cart:th.data.get_by_quan_list_cart}); 1478 + th.setData({ get_by_quan_list_cart: th.data.get_by_quan_list_cart });
1475 //if (th.data.is_b_now) { 1479 //if (th.data.is_b_now) {
1476 // th.setData({get_by_quan_list: arr}); 1480 // th.setData({get_by_quan_list: arr});
1477 //} 1481 //}
@@ -1496,7 +1500,7 @@ Page({ @@ -1496,7 +1500,7 @@ Page({
1496 if (ut.isContained(arr, arr2)) { 1500 if (ut.isContained(arr, arr2)) {
1497 getApp().my_warnning("全场不包邮商品和包邮券的重复", 0, th); 1501 getApp().my_warnning("全场不包邮商品和包邮券的重复", 0, th);
1498 th.data.using_quan[pickid] = {}; 1502 th.data.using_quan[pickid] = {};
1499 - th.setData({using_quan: th.data.using_quan}) 1503 + th.setData({ using_quan: th.data.using_quan })
1500 return false; 1504 return false;
1501 } 1505 }
1502 var n_arr = ut.mergeArray(arr, arr2); 1506 var n_arr = ut.mergeArray(arr, arr2);
@@ -1522,7 +1526,7 @@ Page({ @@ -1522,7 +1526,7 @@ Page({
1522 } 1526 }
1523 1527
1524 //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 1528 //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮
1525 - if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1) { 1529 + if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1 && out_of_weight >= 0) {
1526 continue; 1530 continue;
1527 } 1531 }
1528 1532
@@ -1535,7 +1539,7 @@ Page({ @@ -1535,7 +1539,7 @@ Page({
1535 if (no_ex_good) no_ex_good_arr = no_ex_good.split(','); 1539 if (no_ex_good) no_ex_good_arr = no_ex_good.split(',');
1536 1540
1537 //----------------如果是选择了物流--------------------- 1541 //----------------如果是选择了物流---------------------
1538 - if (cart_item.exp_type == 0 && item[j].is_free_shipping == 0 && (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '') > -1 )) { 1542 + if (cart_item.exp_type == 0 && item[j].is_free_shipping == 0 && (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '') > -1)) {
1539 1543
1540 //如果地址不为空 1544 //如果地址不为空
1541 if (th.data.user_addr != null) { 1545 if (th.data.user_addr != null) {
@@ -1545,7 +1549,7 @@ Page({ @@ -1545,7 +1549,7 @@ Page({
1545 o_shipping_price += item[j]['uniform_exp_sum']; 1549 o_shipping_price += item[j]['uniform_exp_sum'];
1546 break; 1550 break;
1547 // case 2: //1464行已计算 不必重复计算 注释为:判断是否有设置限制重量包邮 1551 // case 2: //1464行已计算 不必重复计算 注释为:判断是否有设置限制重量包邮
1548 - // +'' 1552 + // +''
1549 // if (goods_weight < 0) goods_weight = 0; 1553 // if (goods_weight < 0) goods_weight = 0;
1550 // //累积商品重量 每种商品的重量 * 数量 1554 // //累积商品重量 每种商品的重量 * 数量
1551 // goods_weight += item[j]['weight'] * item[j]['goods_num']; 1555 // goods_weight += item[j]['weight'] * item[j]['goods_num'];
@@ -1559,12 +1563,10 @@ Page({ @@ -1559,12 +1563,10 @@ Page({
1559 } 1563 }
1560 } 1564 }
1561 1565
1562 - }else{  
1563 - if(item[j]['exp_sum_type']==2){  
1564 - if(out_of_weight !==0){  
1565 - goods_weight=-1;  
1566 - out_of_weight=0;  
1567 - } 1566 + } else {
  1567 + if (item[j]['exp_sum_type'] == 2 && out_of_weight !== 0) {
  1568 + goods_weight = -1;
  1569 + out_of_weight = 0;
1568 } 1570 }
1569 } 1571 }
1570 } 1572 }
@@ -1576,8 +1578,8 @@ Page({ @@ -1576,8 +1578,8 @@ Page({
1576 if (th.data.wu_arr && th.data.wu_arr[cart_item.wind]) 1578 if (th.data.wu_arr && th.data.wu_arr[cart_item.wind])
1577 code = th.data.wu_arr[cart_item.wind].code; 1579 code = th.data.wu_arr[cart_item.wind].code;
1578 cart_item.shipping_price = 1580 cart_item.shipping_price =
1579 - th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight,  
1580 - goods_piece, th.data.user_addr, freight_free, o_price - quan_price, rs); 1581 + th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  1582 + goods_piece, th.data.user_addr, freight_free, o_price - quan_price, rs, pickid);
1581 1583
1582 if (!th.data.using_quan[pickid] || th.data.using_quan[pickid].isby != 1) { 1584 if (!th.data.using_quan[pickid] || th.data.using_quan[pickid].isby != 1) {
1583 if (cart_item.shipping_price == 0) th.data.is_by[pickid] = 1; //已经全场包邮,就不要选择券了 1585 if (cart_item.shipping_price == 0) th.data.is_by[pickid] = 1; //已经全场包邮,就不要选择券了
@@ -1596,19 +1598,19 @@ Page({ @@ -1596,19 +1598,19 @@ Page({
1596 var order_prom_id = 0; 1598 var order_prom_id = 0;
1597 var o_condition = cart_item.order_amount; 1599 var o_condition = cart_item.order_amount;
1598 //看一下是不是不用组合购的订单优惠的叠加 1600 //看一下是不是不用组合购的订单优惠的叠加
1599 - if(is_has_zh){  
1600 - o_condition=o_price_no_zh-quan_price; 1601 + if (is_has_zh) {
  1602 + o_condition = o_price_no_zh - quan_price;
1601 } 1603 }
1602 1604
1603 var order_m = 0; 1605 var order_m = 0;
1604 //---判断是不是有订单优惠--- 1606 //---判断是不是有订单优惠---
1605 - await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {  
1606 - data: {store_id: os.stoid, orderAmount: o_condition} 1607 + await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
  1608 + data: { store_id: os.stoid, orderAmount: o_condition }
1607 }).then(res => { 1609 }).then(res => {
1608 if (res.data.code == 0) { 1610 if (res.data.code == 0) {
1609 var ord_prom = res.data.data; 1611 var ord_prom = res.data.data;
1610 //么有使用券,或者活动没有限制使用优惠券 1612 //么有使用券,或者活动没有限制使用优惠券
1611 - if(quan_price<=0 || !ord_prom.is_xz_yh) { 1613 + if (quan_price <= 0 || !ord_prom.is_xz_yh) {
1612 order_prom_id = ord_prom['id']; 1614 order_prom_id = ord_prom['id'];
1613 switch (ord_prom['type']) { 1615 switch (ord_prom['type']) {
1614 case 0: 1616 case 0:
@@ -1749,7 +1751,7 @@ Page({ @@ -1749,7 +1751,7 @@ Page({
1749 } 1751 }
1750 } 1752 }
1751 var set_txt = "cartlist[" + iter + "].can_num"; 1753 var set_txt = "cartlist[" + iter + "].can_num";
1752 - th.setData({[set_txt]: num}); 1754 + th.setData({ [set_txt]: num });
1753 } 1755 }
1754 }, 1756 },
1755 1757
@@ -1781,10 +1783,10 @@ Page({ @@ -1781,10 +1783,10 @@ Page({
1781 1783
1782 allpice = parseFloat(allpice).toFixed(2); 1784 allpice = parseFloat(allpice).toFixed(2);
1783 var txt = "formData.all_price"; 1785 var txt = "formData.all_price";
1784 - th.setData({[txt]: allpice,}); 1786 + th.setData({ [txt]: allpice, });
1785 if (cut_price) { 1787 if (cut_price) {
1786 var c_txt = "formData.cut_price"; 1788 var c_txt = "formData.cut_price";
1787 - th.setData({[c_txt]: cut_price,}); 1789 + th.setData({ [c_txt]: cut_price, });
1788 1790
1789 } 1791 }
1790 1792
@@ -1798,7 +1800,7 @@ Page({ @@ -1798,7 +1800,7 @@ Page({
1798 to.getwuliuprice(async function (rs) { 1800 to.getwuliuprice(async function (rs) {
1799 1801
1800 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1; 1802 var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
1801 - var out_of_weight=null; //超出多少重量 1803 + var out_of_weight = null; //超出多少重量
1802 var freight_free = ee.freight_free; //全场满多少包邮 1804 var freight_free = ee.freight_free; //全场满多少包邮
1803 var weight_free = ee.weight_free; //多少kg内包邮 1805 var weight_free = ee.weight_free; //多少kg内包邮
1804 var no_ex_id = ee.no_ex_id; 1806 var no_ex_id = ee.no_ex_id;
@@ -1852,7 +1854,7 @@ Page({ @@ -1852,7 +1854,7 @@ Page({
1852 arr.push(item); 1854 arr.push(item);
1853 } 1855 }
1854 if (arr) { 1856 if (arr) {
1855 - th.setData({get_by_quan_list: arr}); 1857 + th.setData({ get_by_quan_list: arr });
1856 } 1858 }
1857 th.data.isget_by_quan[th.data.bn_pick] = 1; 1859 th.data.isget_by_quan[th.data.bn_pick] = 1;
1858 } 1860 }
@@ -1868,8 +1870,8 @@ Page({ @@ -1868,8 +1870,8 @@ Page({
1868 if (goods_weight < 0) goods_weight = 0; 1870 if (goods_weight < 0) goods_weight = 0;
1869 //累积商品重量 每种商品的重量 * 数量 1871 //累积商品重量 每种商品的重量 * 数量
1870 goods_weight += good['weight'] * good['buynum']; 1872 goods_weight += good['weight'] * good['buynum'];
1871 - if(weight_free > 0){  
1872 - out_of_weight = (weight_free * 1000 ) - goods_weight; 1873 + if (weight_free > 0) {
  1874 + out_of_weight = (weight_free * 1000) - goods_weight;
1873 } 1875 }
1874 break; 1876 break;
1875 case 3: 1877 case 3:
@@ -1881,7 +1883,7 @@ Page({ @@ -1881,7 +1883,7 @@ Page({
1881 1883
1882 var code = ""; 1884 var code = "";
1883 if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code; 1885 if (th.data.wu_arr && th.data.wu_arr[th.data.index]) code = th.data.wu_arr[th.data.index].code;
1884 - 1886 +
1885 th.data.is_no_by[th.data.bn_pick] = 0; 1887 th.data.is_no_by[th.data.bn_pick] = 0;
1886 1888
1887 var no_by_data = null; 1889 var no_by_data = null;
@@ -1892,7 +1894,7 @@ Page({ @@ -1892,7 +1894,7 @@ Page({
1892 if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice) - cut_price - quan_price) { 1894 if (no_ex_id && freight_free > 0 && freight_free <= parseFloat(allpice) - cut_price - quan_price) {
1893 //-----------获取不包邮区域,不包邮商品------- 1895 //-----------获取不包邮区域,不包邮商品-------
1894 await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", { 1896 await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods", {
1895 - data: {store_id: os.stoid, id: no_ex_id} 1897 + data: { store_id: os.stoid, id: no_ex_id }
1896 }).then(res => { 1898 }).then(res => {
1897 if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { 1899 if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
1898 no_by_data = res.data.data[0]; 1900 no_by_data = res.data.data[0];
@@ -1900,7 +1902,7 @@ Page({ @@ -1900,7 +1902,7 @@ Page({
1900 if (res.data.data[0].region_list) { 1902 if (res.data.data[0].region_list) {
1901 if (th.check_by_area(res.data.data[0].region_list)) { 1903 if (th.check_by_area(res.data.data[0].region_list)) {
1902 freight_free = 0; 1904 freight_free = 0;
1903 - out_of_weight=0; 1905 + out_of_weight = 0;
1904 th.data.is_no_by[th.data.bn_pick] = 1; 1906 th.data.is_no_by[th.data.bn_pick] = 1;
1905 } 1907 }
1906 } 1908 }
@@ -1908,7 +1910,7 @@ Page({ @@ -1908,7 +1910,7 @@ Page({
1908 if (res.data.data[0].goods_list && freight_free) { 1910 if (res.data.data[0].goods_list && freight_free) {
1909 if (th.check_by_goods(res.data.data[0].goods_list)) { 1911 if (th.check_by_goods(res.data.data[0].goods_list)) {
1910 freight_free = 0; 1912 freight_free = 0;
1911 - out_of_weight=0; 1913 + out_of_weight = 0;
1912 th.data.is_no_by[th.data.bn_pick] = 1; 1914 th.data.is_no_by[th.data.bn_pick] = 1;
1913 } 1915 }
1914 } 1916 }
@@ -1919,12 +1921,12 @@ Page({ @@ -1919,12 +1921,12 @@ Page({
1919 th.data.is_by[th.data.bn_pick] = 0; 1921 th.data.is_by[th.data.bn_pick] = 0;
1920 //--------------开始计算物流------------------ 1922 //--------------开始计算物流------------------
1921 var shipping_price = 1923 var shipping_price =
1922 - th.calculatewuliu(code, o_shipping_price, goods_weight,out_of_weight,  
1923 - goods_piece, th.data.user_addr, freight_free, parseFloat(allpice) - cut_price - quan_price, rs); 1924 + th.calculatewuliu(code, o_shipping_price, goods_weight, out_of_weight,
  1925 + goods_piece, th.data.user_addr, freight_free, parseFloat(allpice) - cut_price - quan_price, rs,th.data.bn_pick);
1924 1926
1925 //如果有赠品的时候,也要计算赠品的物流费用 1927 //如果有赠品的时候,也要计算赠品的物流费用
1926 if (th.data.buy_now_gift_goods) { 1928 if (th.data.buy_now_gift_goods) {
1927 - shipping_price = th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free,out_of_weight, 1929 + shipping_price = th.get_now_gift_goods_wuliu(code, o_shipping_price, th.data.user_addr, gift_freight_free, out_of_weight,
1928 parseFloat(allpice) - cut_price - quan_price, rs, shipping_price, no_by_data, goods_weight, goods_piece); 1930 parseFloat(allpice) - cut_price - quan_price, rs, shipping_price, no_by_data, goods_weight, goods_piece);
1929 } 1931 }
1930 1932
@@ -1934,18 +1936,18 @@ Page({ @@ -1934,18 +1936,18 @@ Page({
1934 1936
1935 shipping_price = parseFloat(shipping_price).toFixed(2); 1937 shipping_price = parseFloat(shipping_price).toFixed(2);
1936 var wl_txt = "formData.shipping_price"; 1938 var wl_txt = "formData.shipping_price";
1937 - th.setData({[wl_txt]: shipping_price,}) 1939 + th.setData({ [wl_txt]: shipping_price, })
1938 1940
1939 } else { 1941 } else {
1940 var wl_txt = "formData.shipping_price"; 1942 var wl_txt = "formData.shipping_price";
1941 - th.setData({[wl_txt]: 0,}) 1943 + th.setData({ [wl_txt]: 0, })
1942 } 1944 }
1943 1945
1944 if (quan_no) { 1946 if (quan_no) {
1945 if (th.data.using_quan[bn_pick].isby == 1) { 1947 if (th.data.using_quan[bn_pick].isby == 1) {
1946 shipping_price = 0; 1948 shipping_price = 0;
1947 var wl_txt = "formData.shipping_price"; 1949 var wl_txt = "formData.shipping_price";
1948 - th.setData({[wl_txt]: 0,}) 1950 + th.setData({ [wl_txt]: 0, })
1949 } 1951 }
1950 } 1952 }
1951 //-----------------支付价,优惠券不减物流----------------- 1953 //-----------------支付价,优惠券不减物流-----------------
@@ -1966,7 +1968,7 @@ Page({ @@ -1966,7 +1968,7 @@ Page({
1966 var ord_prom = th.data.order_prom[th.data.bn_pick]; 1968 var ord_prom = th.data.order_prom[th.data.bn_pick];
1967 1969
1968 //么有使用券,或者活动没有限制使用优惠券 1970 //么有使用券,或者活动没有限制使用优惠券
1969 - if(coupon_price<=0 || !ord_prom.is_xz_yh) { 1971 + if (coupon_price <= 0 || !ord_prom.is_xz_yh) {
1970 order_prom_id = ord_prom['id']; 1972 order_prom_id = ord_prom['id'];
1971 switch (ord_prom['type']) { 1973 switch (ord_prom['type']) {
1972 case 0: 1974 case 0:
@@ -1984,7 +1986,7 @@ Page({ @@ -1984,7 +1986,7 @@ Page({
1984 if (order_prom_id > 0) { 1986 if (order_prom_id > 0) {
1985 var order_prom_txt1 = "formData.order_prom_id"; 1987 var order_prom_txt1 = "formData.order_prom_id";
1986 var order_prom_txt2 = "formData.order_prom_amount"; 1988 var order_prom_txt2 = "formData.order_prom_amount";
1987 - th.setData({[order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount}) 1989 + th.setData({ [order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount })
1988 } 1990 }
1989 1991
1990 total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); 1992 total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
@@ -1994,7 +1996,7 @@ Page({ @@ -1994,7 +1996,7 @@ Page({
1994 order_m = order_m.toFixed(2); 1996 order_m = order_m.toFixed(2);
1995 1997
1996 var atxt = "formData.total_amount"; 1998 var atxt = "formData.total_amount";
1997 - th.setData({[atxt]: total_m,}) 1999 + th.setData({ [atxt]: total_m, })
1998 2000
1999 var txt = "formData.user_money"; 2001 var txt = "formData.user_money";
2000 var txt2 = "formData.order_amount"; 2002 var txt2 = "formData.order_amount";
@@ -2004,44 +2006,44 @@ Page({ @@ -2004,44 +2006,44 @@ Page({
2004 if (th.data.bn_use_money == 1) { 2006 if (th.data.bn_use_money == 1) {
2005 if (amoney > order_m) { 2007 if (amoney > order_m) {
2006 order_m = parseFloat(order_m).toFixed(2); 2008 order_m = parseFloat(order_m).toFixed(2);
2007 - th.setData({[txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1}) 2009 + th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 })
2008 } else { 2010 } else {
2009 order_m = parseFloat(order_m) - parseFloat(amoney); 2011 order_m = parseFloat(order_m) - parseFloat(amoney);
2010 order_m = order_m.toFixed(2); 2012 order_m = order_m.toFixed(2);
2011 - th.setData({[txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1}) 2013 + th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
2012 } 2014 }
2013 } else { 2015 } else {
2014 - th.setData({[txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1}) 2016 + th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
2015 } 2017 }
2016 //优惠活动送积分 2018 //优惠活动送积分
2017 if (good.s_intValue) { 2019 if (good.s_intValue) {
2018 txt = "formData.give_integral"; 2020 txt = "formData.give_integral";
2019 - th.setData({[txt]: good.s_intValue}); 2021 + th.setData({ [txt]: good.s_intValue });
2020 } 2022 }
2021 //优惠送券 2023 //优惠送券
2022 if (good.s_coupon_id) { 2024 if (good.s_coupon_id) {
2023 var i_txt = "formData.give_coupon_id"; 2025 var i_txt = "formData.give_coupon_id";
2024 //这个是json格式的 2026 //这个是json格式的
2025 var i_txt1 = "formData.g_coupon_num"; 2027 var i_txt1 = "formData.g_coupon_num";
2026 - var ob = [{"num": good.s_coupon_num, "c_id": good.s_coupon_id}]; 2028 + var ob = [{ "num": good.s_coupon_num, "c_id": good.s_coupon_id }];
2027 ob = JSON.stringify(ob); 2029 ob = JSON.stringify(ob);
2028 - th.setData({[i_txt]: good.s_coupon_id, [i_txt1]: ob}); 2030 + th.setData({ [i_txt]: good.s_coupon_id, [i_txt1]: ob });
2029 } 2031 }
2030 //优惠礼包 2032 //优惠礼包
2031 if (good.s_libao) { 2033 if (good.s_libao) {
2032 var l_txt = "formData.give_lb_id"; 2034 var l_txt = "formData.give_lb_id";
2033 //这个是json格式的 2035 //这个是json格式的
2034 var l_txt1 = "formData.g_lb_num"; 2036 var l_txt1 = "formData.g_lb_num";
2035 - var ob = [{"num": good.s_lb_num, "l_id": good.s_libao}]; 2037 + var ob = [{ "num": good.s_lb_num, "l_id": good.s_libao }];
2036 ob = JSON.stringify(ob); 2038 ob = JSON.stringify(ob);
2037 - th.setData({[l_txt]: good.s_libao, [l_txt1]: ob}); 2039 + th.setData({ [l_txt]: good.s_libao, [l_txt1]: ob });
2038 } 2040 }
2039 }) 2041 })
2040 } else { 2042 } else {
2041 2043
2042 var order_prom_txt1 = "formData.order_prom_id"; 2044 var order_prom_txt1 = "formData.order_prom_id";
2043 var order_prom_txt2 = "formData.order_prom_amount"; 2045 var order_prom_txt2 = "formData.order_prom_amount";
2044 - th.setData({[order_prom_txt1]: 0, [order_prom_txt2]: 0}) 2046 + th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 })
2045 2047
2046 2048
2047 total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); 2049 total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price);
@@ -2051,7 +2053,7 @@ Page({ @@ -2051,7 +2053,7 @@ Page({
2051 total_m = total_m.toFixed(2); 2053 total_m = total_m.toFixed(2);
2052 order_m = order_m.toFixed(2); 2054 order_m = order_m.toFixed(2);
2053 2055
2054 - th.setData({[atxt]: total_m,}) 2056 + th.setData({ [atxt]: total_m, })
2055 2057
2056 var txt = "formData.user_money"; 2058 var txt = "formData.user_money";
2057 var txt2 = "formData.order_amount"; 2059 var txt2 = "formData.order_amount";
@@ -2061,37 +2063,37 @@ Page({ @@ -2061,37 +2063,37 @@ Page({
2061 if (th.data.bn_use_money == 1) { 2063 if (th.data.bn_use_money == 1) {
2062 if (amoney > order_m) { 2064 if (amoney > order_m) {
2063 order_m = parseFloat(order_m).toFixed(2); 2065 order_m = parseFloat(order_m).toFixed(2);
2064 - th.setData({[txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1}) 2066 + th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 })
2065 } else { 2067 } else {
2066 order_m = parseFloat(order_m) - parseFloat(amoney); 2068 order_m = parseFloat(order_m) - parseFloat(amoney);
2067 order_m = order_m.toFixed(2); 2069 order_m = order_m.toFixed(2);
2068 - th.setData({[txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1}) 2070 + th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
2069 } 2071 }
2070 } else { 2072 } else {
2071 - th.setData({[txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1}) 2073 + th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 })
2072 } 2074 }
2073 //优惠活动送积分 2075 //优惠活动送积分
2074 if (good.s_intValue) { 2076 if (good.s_intValue) {
2075 txt = "formData.give_integral"; 2077 txt = "formData.give_integral";
2076 - th.setData({[txt]: good.s_intValue}); 2078 + th.setData({ [txt]: good.s_intValue });
2077 } 2079 }
2078 //优惠送券 2080 //优惠送券
2079 if (good.s_coupon_id) { 2081 if (good.s_coupon_id) {
2080 var i_txt = "formData.give_coupon_id"; 2082 var i_txt = "formData.give_coupon_id";
2081 //这个是json格式的 2083 //这个是json格式的
2082 var i_txt1 = "formData.g_coupon_num"; 2084 var i_txt1 = "formData.g_coupon_num";
2083 - var ob = [{"num": good.s_coupon_num, "c_id": good.s_coupon_id}]; 2085 + var ob = [{ "num": good.s_coupon_num, "c_id": good.s_coupon_id }];
2084 ob = JSON.stringify(ob); 2086 ob = JSON.stringify(ob);
2085 - th.setData({[i_txt]: good.s_coupon_id, [i_txt1]: ob}); 2087 + th.setData({ [i_txt]: good.s_coupon_id, [i_txt1]: ob });
2086 } 2088 }
2087 //优惠礼包 2089 //优惠礼包
2088 if (good.s_libao) { 2090 if (good.s_libao) {
2089 var l_txt = "formData.give_lb_id"; 2091 var l_txt = "formData.give_lb_id";
2090 //这个是json格式的 2092 //这个是json格式的
2091 var l_txt1 = "formData.g_lb_num"; 2093 var l_txt1 = "formData.g_lb_num";
2092 - var ob = [{"num": good.s_lb_num, "l_id": good.s_libao}]; 2094 + var ob = [{ "num": good.s_lb_num, "l_id": good.s_libao }];
2093 ob = JSON.stringify(ob); 2095 ob = JSON.stringify(ob);
2094 - th.setData({[l_txt]: good.s_coupon_id, [l_txt1]: ob}); 2096 + th.setData({ [l_txt]: good.s_coupon_id, [l_txt1]: ob });
2095 } 2097 }
2096 } 2098 }
2097 2099
@@ -2102,7 +2104,7 @@ Page({ @@ -2102,7 +2104,7 @@ Page({
2102 }, 2104 },
2103 2105
2104 //--------------------提交订单----------------------- 2106 //--------------------提交订单-----------------------
2105 - async submitForm(t){ 2107 + async submitForm(t) {
2106 var sub_value = t; 2108 var sub_value = t;
2107 2109
2108 if (this.data.is_summit_ing == 1) return false; //--提交中退出-- 2110 if (this.data.is_summit_ing == 1) return false; //--提交中退出--
@@ -2174,7 +2176,7 @@ Page({ @@ -2174,7 +2176,7 @@ Page({
2174 } 2176 }
2175 2177
2176 //--判断优惠活动的提交-- 2178 //--判断优惠活动的提交--
2177 - if (th.data.formData.cut_price > 0 ) { 2179 + if (th.data.formData.cut_price > 0) {
2178 order_prom_list.discount_amount = th.data.formData.cut_price.toFixed(2); 2180 order_prom_list.discount_amount = th.data.formData.cut_price.toFixed(2);
2179 var ob = [{ 2181 var ob = [{
2180 "prom_id": th.data.bn_goods.prom_id, 2182 "prom_id": th.data.bn_goods.prom_id,
@@ -2237,7 +2239,7 @@ Page({ @@ -2237,7 +2239,7 @@ Page({
2237 goods.guide_id = gg.guide_id; 2239 goods.guide_id = gg.guide_id;
2238 goods.guide_type = gg.guide_type; 2240 goods.guide_type = gg.guide_type;
2239 //调用接口判断是不是会员 2241 //调用接口判断是不是会员
2240 - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => { 2242 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + gg.guide_id, {}).then(res => {
2241 if (res.data.code == 0) { 2243 if (res.data.code == 0) {
2242 goods.guide_name = res.data.data.salesman; 2244 goods.guide_name = res.data.data.salesman;
2243 goods.guide_sn = res.data.data.salesman_no; 2245 goods.guide_sn = res.data.data.salesman_no;
@@ -2289,7 +2291,7 @@ Page({ @@ -2289,7 +2291,7 @@ Page({
2289 } 2291 }
2290 2292
2291 var pt_res = null; 2293 var pt_res = null;
2292 - await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", { 2294 + await getApp().request.promisePost("/api/weshop/order/getGoodsSplit", {
2293 is_json: 1, 2295 is_json: 1,
2294 data: pt_data 2296 data: pt_data
2295 }).then(res => { 2297 }).then(res => {
@@ -2409,14 +2411,14 @@ Page({ @@ -2409,14 +2411,14 @@ Page({
2409 order_prom_list.order_prom_amount = t_item.order_prom_amount; 2411 order_prom_list.order_prom_amount = t_item.order_prom_amount;
2410 } 2412 }
2411 2413
2412 - order_prom_list.discount_amount =0; 2414 + order_prom_list.discount_amount = 0;
2413 //--判断优惠活动的提交-- 2415 //--判断优惠活动的提交--
2414 if (t_item.cut_price > 0) { 2416 if (t_item.cut_price > 0) {
2415 order_prom_list.discount_amount += t_item.cut_price; 2417 order_prom_list.discount_amount += t_item.cut_price;
2416 order_prom_list.prom_pt_json = JSON.stringify(t_item.prom_pt_json); 2418 order_prom_list.prom_pt_json = JSON.stringify(t_item.prom_pt_json);
2417 } 2419 }
2418 //--判断组合优惠活动的提交-- 2420 //--判断组合优惠活动的提交--
2419 - if (t_item.zh_cut_price > 0 || t_item.zh_cut_price<0) { 2421 + if (t_item.zh_cut_price > 0 || t_item.zh_cut_price < 0) {
2420 order_prom_list.discount_amount += t_item.zh_cut_price; 2422 order_prom_list.discount_amount += t_item.zh_cut_price;
2421 order_prom_list.zh_pt_json = JSON.stringify(t_item.zh_pt_json); 2423 order_prom_list.zh_pt_json = JSON.stringify(t_item.zh_pt_json);
2422 } 2424 }
@@ -2431,11 +2433,11 @@ Page({ @@ -2431,11 +2433,11 @@ Page({
2431 order_prom_list.give_lb_id = t_item.s_libao; 2433 order_prom_list.give_lb_id = t_item.s_libao;
2432 order_prom_list.g_lb_num = JSON.stringify(t_item.g_lb_num); 2434 order_prom_list.g_lb_num = JSON.stringify(t_item.g_lb_num);
2433 } 2435 }
2434 - if (Object.keys(order_prom_list).length > 0){  
2435 - if(order_prom_list.discount_amount)  
2436 - order_prom_list.discount_amount= parseFloat(order_prom_list.discount_amount).toFixed(2);  
2437 - if(order_prom_list.order_prom_amount)  
2438 - order_prom_list.order_prom_amount= parseFloat(order_prom_list.order_prom_amount).toFixed(2); 2436 + if (Object.keys(order_prom_list).length > 0) {
  2437 + if (order_prom_list.discount_amount)
  2438 + order_prom_list.discount_amount = parseFloat(order_prom_list.discount_amount).toFixed(2);
  2439 + if (order_prom_list.order_prom_amount)
  2440 + order_prom_list.order_prom_amount = parseFloat(order_prom_list.order_prom_amount).toFixed(2);
2439 item.order_prom_list = order_prom_list; 2441 item.order_prom_list = order_prom_list;
2440 } 2442 }
2441 2443
@@ -2459,7 +2461,7 @@ Page({ @@ -2459,7 +2461,7 @@ Page({
2459 //-------------让商品添加到商品列表-------------------- 2461 //-------------让商品添加到商品列表--------------------
2460 for (var k = 0; k < t_item.goods.length; k++) { 2462 for (var k = 0; k < t_item.goods.length; k++) {
2461 var g_item = t_item.goods[k]; 2463 var g_item = t_item.goods[k];
2462 - if(g_item.goods_num<=0) continue; 2464 + if (g_item.goods_num <= 0) continue;
2463 var goods = { 2465 var goods = {
2464 'goods_id': g_item.goods_id, 2466 'goods_id': g_item.goods_id,
2465 'goods_name': g_item.goods_name, 2467 'goods_name': g_item.goods_name,
@@ -2472,7 +2474,7 @@ Page({ @@ -2472,7 +2474,7 @@ Page({
2472 }; 2474 };
2473 2475
2474 //-- 线下取价也要写入,组合购的商品不能去线下价格 -- 2476 //-- 线下取价也要写入,组合购的商品不能去线下价格 --
2475 - if (g_item.offline_price && t_item.is_offline == 1 && g_item.prom_type!=7) { 2477 + if (g_item.offline_price && t_item.is_offline == 1 && g_item.prom_type != 7) {
2476 goods.goods_price = g_item.offline_price; 2478 goods.goods_price = g_item.offline_price;
2477 goods.member_goods_price = g_item.offline_price; 2479 goods.member_goods_price = g_item.offline_price;
2478 goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2); 2480 goods.offline_cut = (g_item.goods_price - g_item.offline_price).toFixed(2);
@@ -2483,7 +2485,7 @@ Page({ @@ -2483,7 +2485,7 @@ Page({
2483 if (t_item.quan_youhui_list && t_item.coupon_price) { 2485 if (t_item.quan_youhui_list && t_item.coupon_price) {
2484 for (var kk in t_item.quan_youhui_list) { 2486 for (var kk in t_item.quan_youhui_list) {
2485 var you_item = t_item.quan_youhui_list[kk]; 2487 var you_item = t_item.quan_youhui_list[kk];
2486 - if (g_item.prom_type!=7 && g_item.erpwareid == you_item.WareId) { 2488 + if (g_item.prom_type != 7 && g_item.erpwareid == you_item.WareId) {
2487 goods.quan_num = you_item.WareCashSum; 2489 goods.quan_num = you_item.WareCashSum;
2488 goods.quan_no = you_item.CashRepNo; 2490 goods.quan_no = you_item.CashRepNo;
2489 } 2491 }
@@ -2493,7 +2495,7 @@ Page({ @@ -2493,7 +2495,7 @@ Page({
2493 //--判断活动的类型-- 2495 //--判断活动的类型--
2494 switch (g_item.prom_type) { 2496 switch (g_item.prom_type) {
2495 case 1: 2497 case 1:
2496 - case 2: 2498 + case 2:
2497 goods.prom_type = g_item.prom_type; 2499 goods.prom_type = g_item.prom_type;
2498 goods.prom_id = g_item.prom_id; 2500 goods.prom_id = g_item.prom_id;
2499 break; 2501 break;
@@ -2535,7 +2537,7 @@ Page({ @@ -2535,7 +2537,7 @@ Page({
2535 } 2537 }
2536 2538
2537 //把优惠的平摊结果写进去 2539 //把优惠的平摊结果写进去
2538 - if (g_item.account >= 0 || (g_item.account_yu != 0 && g_item.account!=undefined)) { 2540 + if (g_item.account >= 0 || (g_item.account_yu != 0 && g_item.account != undefined)) {
2539 if (g_item.account >= 0) goods.account = g_item.account; 2541 if (g_item.account >= 0) goods.account = g_item.account;
2540 if (g_item.account_yu != 0) goods.account_yu = g_item.account_yu; 2542 if (g_item.account_yu != 0) goods.account_yu = g_item.account_yu;
2541 item.is_discount_amount = 1; 2543 item.is_discount_amount = 1;
@@ -2546,7 +2548,7 @@ Page({ @@ -2546,7 +2548,7 @@ Page({
2546 goods.guide_id = g_item.guide_id; 2548 goods.guide_id = g_item.guide_id;
2547 goods.guide_type = g_item.guide_type; 2549 goods.guide_type = g_item.guide_type;
2548 //调用接口判断是不是会员 2550 //调用接口判断是不是会员
2549 - await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + g_item.guide_id, {}).then(res => { 2551 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/" + oo.stoid + "/" + g_item.guide_id, {}).then(res => {
2550 if (res.data.code == 0) { 2552 if (res.data.code == 0) {
2551 goods.guide_name = res.data.data.salesman; 2553 goods.guide_name = res.data.data.salesman;
2552 goods.guide_sn = res.data.data.salesman_no; 2554 goods.guide_sn = res.data.data.salesman_no;
@@ -2572,7 +2574,7 @@ Page({ @@ -2572,7 +2574,7 @@ Page({
2572 if (pdata.length == 0) return; 2574 if (pdata.length == 0) return;
2573 var str = JSON.stringify(pdata); 2575 var str = JSON.stringify(pdata);
2574 2576
2575 - wx.showLoading({title: "加载中"}); 2577 + wx.showLoading({ title: "加载中" });
2576 wx.request({ 2578 wx.request({
2577 url: oo.url + '/api/weshop/order/createWxdOrder', 2579 url: oo.url + '/api/weshop/order/createWxdOrder',
2578 data: str, 2580 data: str,
@@ -2603,7 +2605,7 @@ Page({ @@ -2603,7 +2605,7 @@ Page({
2603 }) 2605 })
2604 //要进行判断,如果是用微信支付,就要跳转到支付界面 2606 //要进行判断,如果是用微信支付,就要跳转到支付界面
2605 if (order_amount > 0) { 2607 if (order_amount > 0) {
2606 - th.setData({isclose: 0}); 2608 + th.setData({ isclose: 0 });
2607 //void e.jumpToCart4({ 2609 //void e.jumpToCart4({
2608 // order_sn: data.data, 2610 // order_sn: data.data,
2609 //}, 1); 2611 //}, 1);
@@ -2618,12 +2620,12 @@ Page({ @@ -2618,12 +2620,12 @@ Page({
2618 }, function () { 2620 }, function () {
2619 //支付失败 2621 //支付失败
2620 setTimeout(function () { 2622 setTimeout(function () {
2621 - var cps=getCurrentPages();  
2622 - if(cps.length>1){  
2623 - wx.navigateBack({delta: 1})  
2624 - }else{  
2625 - getApp().goto("/pages/index/index/index");  
2626 - } 2623 + var cps = getCurrentPages();
  2624 + if (cps.length > 1) {
  2625 + wx.navigateBack({ delta: 1 })
  2626 + } else {
  2627 + getApp().goto("/pages/index/index/index");
  2628 + }
2627 2629
2628 }, 1000) 2630 }, 1000)
2629 }, oo.stoid); 2631 }, oo.stoid);
@@ -2641,7 +2643,7 @@ Page({ @@ -2641,7 +2643,7 @@ Page({
2641 if (t.data.code == 0) { 2643 if (t.data.code == 0) {
2642 //app.my_warnning("支付成功",1,th); 2644 //app.my_warnning("支付成功",1,th);
2643 //setTimeout(function () { 2645 //setTimeout(function () {
2644 - th.setData({isclose: 0}); 2646 + th.setData({ isclose: 0 });
2645 wx.redirectTo({ 2647 wx.redirectTo({
2646 url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, 2648 url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data,
2647 }) 2649 })
@@ -2666,7 +2668,7 @@ Page({ @@ -2666,7 +2668,7 @@ Page({
2666 cancelText: '取消', 2668 cancelText: '取消',
2667 confirmText: '确定', 2669 confirmText: '确定',
2668 showCancel: true, 2670 showCancel: true,
2669 - success(res){ 2671 + success(res) {
2670 if (res.cancel) { 2672 if (res.cancel) {
2671 return; 2673 return;
2672 } else if (res.confirm) { 2674 } else if (res.confirm) {
@@ -2700,11 +2702,11 @@ Page({ @@ -2700,11 +2702,11 @@ Page({
2700 2702
2701 }, 2703 },
2702 //---确认线下门店的数量足不足--- 2704 //---确认线下门店的数量足不足---
2703 - async check_store_num(goods_id, pick, goods_num, func){ 2705 + async check_store_num(goods_id, pick, goods_num, func) {
2704 var lock = 0, pick_no, plist, erpwareid; 2706 var lock = 0, pick_no, plist, erpwareid;
2705 //先读取门店的lock 2707 //先读取门店的lock
2706 await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { 2708 await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", {
2707 - data: {store_id: os.stoid, wareId: goods_id, storageId: pick, pageSize: 1000} 2709 + data: { store_id: os.stoid, wareId: goods_id, storageId: pick, pageSize: 1000 }
2708 }).then(res => { 2710 }).then(res => {
2709 if (res.data.code == 0 && res.data.data.total > 0) { 2711 if (res.data.code == 0 && res.data.data.total > 0) {
2710 for (var i in res.data.data.pageData) 2712 for (var i in res.data.data.pageData)
@@ -2713,7 +2715,7 @@ Page({ @@ -2713,7 +2715,7 @@ Page({
2713 }) 2715 })
2714 //先获取门店的编号 2716 //先获取门店的编号
2715 await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + pick, { 2717 await getApp().request.promiseGet("/api/weshop/pickup/get/" + os.stoid + "/" + pick, {
2716 - data: {storeId: os.stoid, goodsId: t.goods_id, pickupId: pick} 2718 + data: { storeId: os.stoid, goodsId: t.goods_id, pickupId: pick }
2717 }).then(res => { 2719 }).then(res => {
2718 if (res.data.code == 0) { 2720 if (res.data.code == 0) {
2719 pick_no = res.data.data.pickup_no; 2721 pick_no = res.data.data.pickup_no;
@@ -2721,7 +2723,7 @@ Page({ @@ -2721,7 +2723,7 @@ Page({
2721 }) 2723 })
2722 //先获取商品的线下库存 2724 //先获取商品的线下库存
2723 await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, { 2725 await getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, {
2724 - data: {storeId: os.stoid, goodsId: t.goods_id, pickupId: pick} 2726 + data: { storeId: os.stoid, goodsId: t.goods_id, pickupId: pick }
2725 }).then(res => { 2727 }).then(res => {
2726 if (res.data.code == 0) { 2728 if (res.data.code == 0) {
2727 erpwareid = res.data.data.erpwareid; 2729 erpwareid = res.data.data.erpwareid;
@@ -2729,7 +2731,7 @@ Page({ @@ -2729,7 +2731,7 @@ Page({
2729 }) 2731 })
2730 //读取线下的门店库存 2732 //读取线下的门店库存
2731 await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { 2733 await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", {
2732 - data: {storageNos: pick_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid, pageSize: 2000} 2734 + data: { storageNos: pick_no, wareIds: encodeURIComponent(erpwareid), storeId: os.stoid, pageSize: 2000 }
2733 }).then(res => { 2735 }).then(res => {
2734 if (res.data.code == 0) { 2736 if (res.data.code == 0) {
2735 plist = res.data.data.pageData[0]; 2737 plist = res.data.data.pageData[0];
@@ -2771,11 +2773,11 @@ Page({ @@ -2771,11 +2773,11 @@ Page({
2771 wl_txt = t.currentTarget.dataset.wl_txt, 2773 wl_txt = t.currentTarget.dataset.wl_txt,
2772 ont = t.currentTarget.dataset.ont; 2774 ont = t.currentTarget.dataset.ont;
2773 2775
2774 - th.setData({[txt]: ty}); 2776 + th.setData({ [txt]: ty });
2775 var iszt = 1; 2777 var iszt = 1;
2776 2778
2777 if (ty == 0) { 2779 if (ty == 0) {
2778 - th.setData({is_all_zt: 0}); 2780 + th.setData({ is_all_zt: 0 });
2779 } else { 2781 } else {
2780 for (var i = 0; i < th.data.cartlist.length; i++) { 2782 for (var i = 0; i < th.data.cartlist.length; i++) {
2781 var item = th.data.cartlist[i]; 2783 var item = th.data.cartlist[i];
@@ -2785,7 +2787,7 @@ Page({ @@ -2785,7 +2787,7 @@ Page({
2785 } 2787 }
2786 } 2788 }
2787 2789
2788 - th.setData({is_all_zt: iszt}); 2790 + th.setData({ is_all_zt: iszt });
2789 2791
2790 var ind = t.currentTarget.dataset.ind; 2792 var ind = t.currentTarget.dataset.ind;
2791 var c_item = th.data.cartlist[ind]; 2793 var c_item = th.data.cartlist[ind];
@@ -2793,7 +2795,7 @@ Page({ @@ -2793,7 +2795,7 @@ Page({
2793 2795
2794 if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1) { 2796 if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1) {
2795 th.data.using_quan[pickid] = {}; 2797 th.data.using_quan[pickid] = {};
2796 - th.setData({using_quan: th.data.using_quan}); 2798 + th.setData({ using_quan: th.data.using_quan });
2797 } 2799 }
2798 2800
2799 2801
@@ -2805,7 +2807,7 @@ Page({ @@ -2805,7 +2807,7 @@ Page({
2805 for (var i = 0; i < wu_arr.length; i++) { 2807 for (var i = 0; i < wu_arr.length; i++) {
2806 if (wu_arr[i].shipping_code == def_exp_code) { 2808 if (wu_arr[i].shipping_code == def_exp_code) {
2807 var set_txt = "cartlist" 2809 var set_txt = "cartlist"
2808 - th.setData({wl_txt: i}); 2810 + th.setData({ wl_txt: i });
2809 } 2811 }
2810 } 2812 }
2811 } 2813 }
@@ -2818,9 +2820,9 @@ Page({ @@ -2818,9 +2820,9 @@ Page({
2818 setexptype: function (t) { 2820 setexptype: function (t) {
2819 var th = this; 2821 var th = this;
2820 var ty = t.currentTarget.dataset.t, def_exp_code = getApp().globalData.userInfo.def_exp_code; 2822 var ty = t.currentTarget.dataset.t, def_exp_code = getApp().globalData.userInfo.def_exp_code;
2821 - th.setData({bn_exp_type: ty}); 2823 + th.setData({ bn_exp_type: ty });
2822 if (ty == 0) { 2824 if (ty == 0) {
2823 - th.setData({is_all_zt: 0}); 2825 + th.setData({ is_all_zt: 0 });
2824 } 2826 }
2825 2827
2826 //当物流为空的时候。 2828 //当物流为空的时候。
@@ -2833,7 +2835,7 @@ Page({ @@ -2833,7 +2835,7 @@ Page({
2833 if (ty == 1) { 2835 if (ty == 1) {
2834 th.data.isget_by_quan = {}; 2836 th.data.isget_by_quan = {};
2835 if (th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].isby == 1) { 2837 if (th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].isby == 1) {
2836 - th.setData({using_quan: {}}); 2838 + th.setData({ using_quan: {} });
2837 } 2839 }
2838 } 2840 }
2839 2841
@@ -2843,7 +2845,7 @@ Page({ @@ -2843,7 +2845,7 @@ Page({
2843 if (wu_arr != null && wu_arr != "") { 2845 if (wu_arr != null && wu_arr != "") {
2844 for (var i = 0; i < wu_arr.length; i++) { 2846 for (var i = 0; i < wu_arr.length; i++) {
2845 if (wu_arr[i].shipping_code == def_exp_code) { 2847 if (wu_arr[i].shipping_code == def_exp_code) {
2846 - th.setData({index: i}); 2848 + th.setData({ index: i });
2847 } 2849 }
2848 } 2850 }
2849 } 2851 }
@@ -2855,17 +2857,17 @@ Page({ @@ -2855,17 +2857,17 @@ Page({
2855 //--------立即购买时,使用余额-------- 2857 //--------立即购买时,使用余额--------
2856 set_bn_useyuer: function () { 2858 set_bn_useyuer: function () {
2857 var th = this; 2859 var th = this;
2858 - th.setData({bn_use_money: !th.data.bn_use_money}); 2860 + th.setData({ bn_use_money: !th.data.bn_use_money });
2859 th.calculatePrice2(); 2861 th.calculatePrice2();
2860 }, 2862 },
2861 set_js_useyuer: function () { 2863 set_js_useyuer: function () {
2862 var th = this; 2864 var th = this;
2863 - th.setData({js_use_money: !th.data.js_use_money}); 2865 + th.setData({ js_use_money: !th.data.js_use_money });
2864 th.calculatePrice(); 2866 th.calculatePrice();
2865 }, 2867 },
2866 //-------------------计算物流--------------- 2868 //-------------------计算物流---------------
2867 - calculatewuliu: function (code, o_shipping_price, goods_weight,out_of_weight,  
2868 - goods_piece, user_addr, freight_free, o_price, rs) { 2869 + calculatewuliu: function (code, o_shipping_price, goods_weight, out_of_weight,
  2870 + goods_piece, user_addr, freight_free, o_price, rs, pickid) {
2869 var price = 0, th = this; 2871 var price = 0, th = this;
2870 price += parseFloat(o_shipping_price); 2872 price += parseFloat(o_shipping_price);
2871 //如果是包邮 2873 //如果是包邮
@@ -2896,7 +2898,7 @@ Page({ @@ -2896,7 +2898,7 @@ Page({
2896 } 2898 }
2897 } 2899 }
2898 //------超出重量---------- 2900 //------超出重量----------
2899 - if(out_of_weight < 0 && o_price >= freight_free){ 2901 + if (out_of_weight < 0 && o_price >= freight_free && !th.data.is_no_by[pickid]) {
2900 fw_price = parseFloat(item['money']); 2902 fw_price = parseFloat(item['money']);
2901 var out_of_weight = Math.abs(out_of_weight); 2903 var out_of_weight = Math.abs(out_of_weight);
2902 if (out_of_weight > item['first_weight']) { 2904 if (out_of_weight > item['first_weight']) {
@@ -2942,13 +2944,13 @@ Page({ @@ -2942,13 +2944,13 @@ Page({
2942 //----------立即购买,选择物流------------- 2944 //----------立即购买,选择物流-------------
2943 bindPickerChange: function (e) { 2945 bindPickerChange: function (e) {
2944 var ind = e.detail.value 2946 var ind = e.detail.value
2945 - this.setData({index: ind}); 2947 + this.setData({ index: ind });
2946 this.calculatePrice2(); 2948 this.calculatePrice2();
2947 }, 2949 },
2948 //----------购物车结算,选择物流------------- 2950 //----------购物车结算,选择物流-------------
2949 bindPickerChange_w: function (e) { 2951 bindPickerChange_w: function (e) {
2950 var ind = e.detail.value, txt = e.currentTarget.dataset.txt; 2952 var ind = e.detail.value, txt = e.currentTarget.dataset.txt;
2951 - this.setData({[txt]: ind}); 2953 + this.setData({ [txt]: ind });
2952 this.calculatePrice(); 2954 this.calculatePrice();
2953 }, 2955 },
2954 2956
@@ -2962,7 +2964,7 @@ Page({ @@ -2962,7 +2964,7 @@ Page({
2962 2964
2963 2965
2964 if (bn == 1) { 2966 if (bn == 1) {
2965 - th.setData({open_quan: 1, selected_quan_pick: pickid, disabled: 1}); 2967 + th.setData({ open_quan: 1, selected_quan_pick: pickid, disabled: 1 });
2966 } else { 2968 } else {
2967 //---多单打开券的时候,就要判断券在其他门店是否有使用--- 2969 //---多单打开券的时候,就要判断券在其他门店是否有使用---
2968 var quanlist = th.data.cartlist[cindx].quan_list; 2970 var quanlist = th.data.cartlist[cindx].quan_list;
@@ -2988,9 +2990,9 @@ Page({ @@ -2988,9 +2990,9 @@ Page({
2988 else 2990 else
2989 get_by_quan_list_cart[i].show_red = 0; 2991 get_by_quan_list_cart[i].show_red = 0;
2990 } 2992 }
2991 - th.setData({by_quan_list_cart: get_by_quan_list_cart}); 2993 + th.setData({ by_quan_list_cart: get_by_quan_list_cart });
2992 } else { 2994 } else {
2993 - th.setData({by_quan_list_cart: null}); 2995 + th.setData({ by_quan_list_cart: null });
2994 } 2996 }
2995 2997
2996 console.log("2222222券的列表", quanlist); 2998 console.log("2222222券的列表", quanlist);
@@ -3006,7 +3008,7 @@ Page({ @@ -3006,7 +3008,7 @@ Page({
3006 }, 3008 },
3007 close_coupon: function (e) { 3009 close_coupon: function (e) {
3008 var th = this; 3010 var th = this;
3009 - th.setData({open_quan: 0, disabled: 0}); 3011 + th.setData({ open_quan: 0, disabled: 0 });
3010 }, 3012 },
3011 3013
3012 //---判断券时候在已经选择的列表中--- 3014 //---判断券时候在已经选择的列表中---
@@ -3077,14 +3079,14 @@ Page({ @@ -3077,14 +3079,14 @@ Page({
3077 for (var i in quanlist) { 3079 for (var i in quanlist) {
3078 quanlist[i].show_red = 0; 3080 quanlist[i].show_red = 0;
3079 } 3081 }
3080 - this.setData({selected_quan_list: quanlist}); 3082 + this.setData({ selected_quan_list: quanlist });
3081 var by_quanlist = this.data.get_by_quan_list; 3083 var by_quanlist = this.data.get_by_quan_list;
3082 if (by_quanlist) { 3084 if (by_quanlist) {
3083 //---所有的券的显示红色选择都清理一遍--- 3085 //---所有的券的显示红色选择都清理一遍---
3084 for (var inb in by_quanlist) { 3086 for (var inb in by_quanlist) {
3085 by_quanlist[inb].show_red = 0; 3087 by_quanlist[inb].show_red = 0;
3086 } 3088 }
3087 - this.setData({get_by_quan_list: by_quanlist}); 3089 + this.setData({ get_by_quan_list: by_quanlist });
3088 } 3090 }
3089 3091
3090 var by_cart_list = this.data.by_quan_list_cart; 3092 var by_cart_list = this.data.by_quan_list_cart;
@@ -3093,7 +3095,7 @@ Page({ @@ -3093,7 +3095,7 @@ Page({
3093 for (var inc in by_cart_list) { 3095 for (var inc in by_cart_list) {
3094 by_cart_list[inc].show_red = 0; 3096 by_cart_list[inc].show_red = 0;
3095 } 3097 }
3096 - this.setData({by_quan_list_cart: by_cart_list}); 3098 + this.setData({ by_quan_list_cart: by_cart_list });
3097 } 3099 }
3098 3100
3099 var using_quan = this.data.using_quan; 3101 var using_quan = this.data.using_quan;
@@ -3105,9 +3107,9 @@ Page({ @@ -3105,9 +3107,9 @@ Page({
3105 using_quan[th.data.selected_quan_pick].is_nouse_red = 1; 3107 using_quan[th.data.selected_quan_pick].is_nouse_red = 1;
3106 } 3108 }
3107 else { 3109 else {
3108 - using_quan[th.data.selected_quan_pick] = {is_nouse_red: 1}; 3110 + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 };
3109 } 3111 }
3110 - this.setData({using_quan: using_quan, is_coupon: 2222}); 3112 + this.setData({ using_quan: using_quan, is_coupon: 2222 });
3111 return; 3113 return;
3112 } 3114 }
3113 3115
@@ -3124,9 +3126,9 @@ Page({ @@ -3124,9 +3126,9 @@ Page({
3124 using_quan[th.data.selected_quan_pick].is_nouse_red = 0; 3126 using_quan[th.data.selected_quan_pick].is_nouse_red = 0;
3125 } 3127 }
3126 else { 3128 else {
3127 - using_quan[th.data.selected_quan_pick] = {is_nouse_red: 0}; 3129 + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 };
3128 } 3130 }
3129 - this.setData({using_quan: using_quan}); 3131 + this.setData({ using_quan: using_quan });
3130 3132
3131 }, 3133 },
3132 3134
@@ -3141,7 +3143,7 @@ Page({ @@ -3141,7 +3143,7 @@ Page({
3141 for (var ind in by_quanlist) { 3143 for (var ind in by_quanlist) {
3142 by_quanlist[ind].show_red = 0; 3144 by_quanlist[ind].show_red = 0;
3143 } 3145 }
3144 - this.setData({get_by_quan_list: by_quanlist}); 3146 + this.setData({ get_by_quan_list: by_quanlist });
3145 } 3147 }
3146 3148
3147 //--购物车过来的包邮券-- 3149 //--购物车过来的包邮券--
@@ -3151,7 +3153,7 @@ Page({ @@ -3151,7 +3153,7 @@ Page({
3151 for (var ind in by_cart_list) { 3153 for (var ind in by_cart_list) {
3152 by_cart_list[ind].show_red = 0; 3154 by_cart_list[ind].show_red = 0;
3153 } 3155 }
3154 - this.setData({by_quan_list_cart: by_cart_list}); 3156 + this.setData({ by_quan_list_cart: by_cart_list });
3155 } 3157 }
3156 //普通券 3158 //普通券
3157 var quanlist = this.data.selected_quan_list; 3159 var quanlist = this.data.selected_quan_list;
@@ -3160,7 +3162,7 @@ Page({ @@ -3160,7 +3162,7 @@ Page({
3160 for (var ind in quanlist) { 3162 for (var ind in quanlist) {
3161 quanlist[ind].show_red = 0; 3163 quanlist[ind].show_red = 0;
3162 } 3164 }
3163 - this.setData({selected_quan_list: quanlist}); 3165 + this.setData({ selected_quan_list: quanlist });
3164 } 3166 }
3165 3167
3166 var th = this; 3168 var th = this;
@@ -3171,9 +3173,9 @@ Page({ @@ -3171,9 +3173,9 @@ Page({
3171 using_quan[th.data.selected_quan_pick].is_nouse_red = 1; 3173 using_quan[th.data.selected_quan_pick].is_nouse_red = 1;
3172 } 3174 }
3173 else { 3175 else {
3174 - using_quan[th.data.selected_quan_pick] = {is_nouse_red: 1}; 3176 + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 1 };
3175 } 3177 }
3176 - this.setData({using_quan: using_quan, is_coupon: 2222}); 3178 + this.setData({ using_quan: using_quan, is_coupon: 2222 });
3177 return; 3179 return;
3178 } 3180 }
3179 3181
@@ -3202,9 +3204,9 @@ Page({ @@ -3202,9 +3204,9 @@ Page({
3202 using_quan[th.data.selected_quan_pick].is_nouse_red = 0; 3204 using_quan[th.data.selected_quan_pick].is_nouse_red = 0;
3203 } 3205 }
3204 else { 3206 else {
3205 - using_quan[th.data.selected_quan_pick] = {is_nouse_red: 0}; 3207 + using_quan[th.data.selected_quan_pick] = { is_nouse_red: 0 };
3206 } 3208 }
3207 - this.setData({using_quan: using_quan}); 3209 + this.setData({ using_quan: using_quan });
3208 }, 3210 },
3209 3211
3210 //--确认使用券--- 3212 //--确认使用券---
@@ -3264,14 +3266,14 @@ Page({ @@ -3264,14 +3266,14 @@ Page({
3264 //选择了的券,看是不是点击了不使用券,点击了不使用优惠券 3266 //选择了的券,看是不是点击了不使用券,点击了不使用优惠券
3265 if (using_quan[pickid]) { 3267 if (using_quan[pickid]) {
3266 if (using_quan[pickid].is_nouse_red == 1) { 3268 if (using_quan[pickid].is_nouse_red == 1) {
3267 - using_quan[pickid] = {is_nouse_red: 1};  
3268 - th.setData({using_quan: using_quan}); 3269 + using_quan[pickid] = { is_nouse_red: 1 };
  3270 + th.setData({ using_quan: using_quan });
3269 if (th.data.is_b_now == 1) { 3271 if (th.data.is_b_now == 1) {
3270 th.calculatePrice2(); 3272 th.calculatePrice2();
3271 } else { 3273 } else {
3272 th.calculatePrice(); 3274 th.calculatePrice();
3273 } 3275 }
3274 - th.setData({open_quan: 0}); 3276 + th.setData({ open_quan: 0 });
3275 return; 3277 return;
3276 } 3278 }
3277 } 3279 }
@@ -3290,16 +3292,16 @@ Page({ @@ -3290,16 +3292,16 @@ Page({
3290 }; 3292 };
3291 using_quan[pickid].isby = 1; 3293 using_quan[pickid].isby = 1;
3292 } else { 3294 } else {
3293 - using_quan[pickid] = {coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0}; 3295 + using_quan[pickid] = { coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0 };
3294 using_quan[pickid].isby = 0; 3296 using_quan[pickid].isby = 0;
3295 } 3297 }
3296 - this.setData({using_quan: using_quan}); 3298 + this.setData({ using_quan: using_quan });
3297 if (th.data.is_b_now == 1) { 3299 if (th.data.is_b_now == 1) {
3298 th.calculatePrice2(); 3300 th.calculatePrice2();
3299 } else { 3301 } else {
3300 th.calculatePrice(); 3302 th.calculatePrice();
3301 } 3303 }
3302 - th.setData({open_quan: 0}); 3304 + th.setData({ open_quan: 0 });
3303 }, 3305 },
3304 3306
3305 cart_set_err: function (e) { 3307 cart_set_err: function (e) {
@@ -3336,7 +3338,7 @@ Page({ @@ -3336,7 +3338,7 @@ Page({
3336 var wu_arr_txt = e.currentTarget.dataset.txt; 3338 var wu_arr_txt = e.currentTarget.dataset.txt;
3337 var w_sele_index = e.currentTarget.dataset.w_sele_index; 3339 var w_sele_index = e.currentTarget.dataset.w_sele_index;
3338 var is_express = null; 3340 var is_express = null;
3339 - var ob = {open_express: 1, wu_arr_txt: wu_arr_txt, disabled: 1}; 3341 + var ob = { open_express: 1, wu_arr_txt: wu_arr_txt, disabled: 1 };
3340 3342
3341 //--如果是多个门店的时候-- 3343 //--如果是多个门店的时候--
3342 if (w_sele_index != undefined) { 3344 if (w_sele_index != undefined) {
@@ -3347,20 +3349,20 @@ Page({ @@ -3347,20 +3349,20 @@ Page({
3347 }, 3349 },
3348 // 关闭物流的弹窗 3350 // 关闭物流的弹窗
3349 close_express: function () { 3351 close_express: function () {
3350 - this.setData({open_express: 0, disabled: 0}); 3352 + this.setData({ open_express: 0, disabled: 0 });
3351 }, 3353 },
3352 // 选择物流 3354 // 选择物流
3353 click_express_name: function (e) { 3355 click_express_name: function (e) {
3354 var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode; 3356 var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode;
3355 var index = e.currentTarget.dataset.idxe; 3357 var index = e.currentTarget.dataset.idxe;
3356 - var ob = {is_express: index, is_shipping_code: shippingcode, disabled: 0}; 3358 + var ob = { is_express: index, is_shipping_code: shippingcode, disabled: 0 };
3357 ob[this.data.wu_arr_txt] = index; 3359 ob[this.data.wu_arr_txt] = index;
3358 this.setData(ob); 3360 this.setData(ob);
3359 }, 3361 },
3360 3362
3361 //点击确定物流 3363 //点击确定物流
3362 determine_expres: function (e) { 3364 determine_expres: function (e) {
3363 - this.setData({open_express: 0}); 3365 + this.setData({ open_express: 0 });
3364 if (this.data.is_b_now == 1) 3366 if (this.data.is_b_now == 1)
3365 this.calculatePrice2(); 3367 this.calculatePrice2();
3366 else 3368 else
@@ -3380,7 +3382,7 @@ Page({ @@ -3380,7 +3382,7 @@ Page({
3380 obj[txt] = is_open; 3382 obj[txt] = is_open;
3381 3383
3382 this.setData(obj); 3384 this.setData(obj);
3383 - this.setData({disabled: 1}) 3385 + this.setData({ disabled: 1 })
3384 }, 3386 },
3385 3387
3386 clik_coupons2: function (e) { 3388 clik_coupons2: function (e) {
@@ -3395,7 +3397,7 @@ Page({ @@ -3395,7 +3397,7 @@ Page({
3395 obj[txt] = is_open; 3397 obj[txt] = is_open;
3396 3398
3397 this.setData(obj); 3399 this.setData(obj);
3398 - this.setData({disabled: 1}) 3400 + this.setData({ disabled: 1 })
3399 }, 3401 },
3400 3402
3401 3403
@@ -3404,11 +3406,11 @@ Page({ @@ -3404,11 +3406,11 @@ Page({
3404 var th = this; 3406 var th = this;
3405 var is_shipping_code = this.data.is_shipping_code 3407 var is_shipping_code = this.data.is_shipping_code
3406 getApp().request.put("/api/weshop/users/update", { 3408 getApp().request.put("/api/weshop/users/update", {
3407 - data: {user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code}, 3409 + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code },
3408 success: function (rse) { 3410 success: function (rse) {
3409 if (rse.data.code == 0) { 3411 if (rse.data.code == 0) {
3410 getApp().globalData.userInfo.def_exp_code = is_shipping_code; 3412 getApp().globalData.userInfo.def_exp_code = is_shipping_code;
3411 - th.setData({open_express: 0}); 3413 + th.setData({ open_express: 0 });
3412 //----计算此时购物车的价格---- 3414 //----计算此时购物车的价格----
3413 if (th.data.is_b_now == 1) th.calculatePrice2(); 3415 if (th.data.is_b_now == 1) th.calculatePrice2();
3414 else th.calculatePrice(); 3416 else th.calculatePrice();
@@ -3418,7 +3420,7 @@ Page({ @@ -3418,7 +3420,7 @@ Page({
3418 }, 3420 },
3419 3421
3420 //更新下默认,在onshow里面 3422 //更新下默认,在onshow里面
3421 - update_code(){ 3423 + update_code() {
3422 var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code; 3424 var th = this, m_wind = 0, def_exp_code = getApp().globalData.userInfo.def_exp_code;
3423 //--定时器,判断wu_arr不未空-- 3425 //--定时器,判断wu_arr不未空--
3424 var uii = setInterval(function () { 3426 var uii = setInterval(function () {
@@ -3432,7 +3434,7 @@ Page({ @@ -3432,7 +3434,7 @@ Page({
3432 } 3434 }
3433 //--如果是立即购买-- 3435 //--如果是立即购买--
3434 if (th.data.is_b_now == 1) { 3436 if (th.data.is_b_now == 1) {
3435 - th.setData({index: m_wind, is_express: m_wind}); 3437 + th.setData({ index: m_wind, is_express: m_wind });
3436 } else { 3438 } else {
3437 var ui = setInterval(function () { 3439 var ui = setInterval(function () {
3438 if (th.data.cartlist) { 3440 if (th.data.cartlist) {
@@ -3440,7 +3442,7 @@ Page({ @@ -3440,7 +3442,7 @@ Page({
3440 for (var i in c_arr) { 3442 for (var i in c_arr) {
3441 c_arr[i].wind = m_wind; 3443 c_arr[i].wind = m_wind;
3442 } 3444 }
3443 - th.setData({cartlist: c_arr, is_express: m_wind}) 3445 + th.setData({ cartlist: c_arr, is_express: m_wind })
3444 clearInterval(ui); 3446 clearInterval(ui);
3445 } 3447 }
3446 }, 500) 3448 }, 500)
@@ -3479,13 +3481,13 @@ Page({ @@ -3479,13 +3481,13 @@ Page({
3479 } 3481 }
3480 3482
3481 //--如果是团购,要判断有没有限制使用优惠券 3483 //--如果是团购,要判断有没有限制使用优惠券
3482 - if(gd.prom_type == 2){  
3483 - var prom1=null; 3484 + if (gd.prom_type == 2) {
  3485 + var prom1 = null;
3484 await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gd.goods_id + "/" + gd.prom_id, { 3486 await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gd.goods_id + "/" + gd.prom_id, {
3485 }).then(res => { 3487 }).then(res => {
3486 if (res.data.code == 0) prom1 = res.data.data; 3488 if (res.data.code == 0) prom1 = res.data.data;
3487 }) 3489 })
3488 - if(!prom1.isQuan){ 3490 + if (!prom1.isQuan) {
3489 continue; 3491 continue;
3490 } 3492 }
3491 } 3493 }
@@ -3555,10 +3557,10 @@ Page({ @@ -3555,10 +3557,10 @@ Page({
3555 if (th.data.is_b_now) { 3557 if (th.data.is_b_now) {
3556 if (arr && arr.length > 0) { 3558 if (arr && arr.length > 0) {
3557 var quanlist = arr[0].quan_list; 3559 var quanlist = arr[0].quan_list;
3558 - th.setData({selected_quan_list: quanlist, cartlist: arr}) 3560 + th.setData({ selected_quan_list: quanlist, cartlist: arr })
3559 } 3561 }
3560 } else { 3562 } else {
3561 - th.setData({cartlist: arr}) 3563 + th.setData({ cartlist: arr })
3562 th.set_can_num(); 3564 th.set_can_num();
3563 } 3565 }
3564 3566
@@ -3578,7 +3580,7 @@ Page({ @@ -3578,7 +3580,7 @@ Page({
3578 if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1) { 3580 if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1) {
3579 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; 3581 var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id;
3580 var url = "/api/weshop/couponList/getUseCouponList"; 3582 var url = "/api/weshop/couponList/getUseCouponList";
3581 - app.request.promiseGet(url0, {1: 1}).then(res => { 3583 + app.request.promiseGet(url0, { 1: 1 }).then(res => {
3582 if (res.data.code == 0) { 3584 if (res.data.code == 0) {
3583 frozenQuan = res.data.data; 3585 frozenQuan = res.data.data;
3584 th.data.frozenQuan = frozenQuan; 3586 th.data.frozenQuan = frozenQuan;
@@ -3596,7 +3598,7 @@ Page({ @@ -3596,7 +3598,7 @@ Page({
3596 quanlist = res.data.data.pageData; 3598 quanlist = res.data.data.pageData;
3597 if (quanlist) { 3599 if (quanlist) {
3598 quanlist = th.check_is_frozenQuan(quanlist, frozenQuan); 3600 quanlist = th.check_is_frozenQuan(quanlist, frozenQuan);
3599 - th.setData({selected_quan_list: quanlist}) 3601 + th.setData({ selected_quan_list: quanlist })
3600 } 3602 }
3601 } 3603 }
3602 } 3604 }
@@ -3624,7 +3626,7 @@ Page({ @@ -3624,7 +3626,7 @@ Page({
3624 if (!goods_id) goods_id = this.data.bn_goods.goods_id; 3626 if (!goods_id) goods_id = this.data.bn_goods.goods_id;
3625 for (var i in arr) { 3627 for (var i in arr) {
3626 var item = arr[i]; 3628 var item = arr[i];
3627 - if (goods_id == item) return 0; 3629 + if (goods_id == item) return 0;
3628 } 3630 }
3629 return 1; 3631 return 1;
3630 }, 3632 },
@@ -3695,7 +3697,7 @@ Page({ @@ -3695,7 +3697,7 @@ Page({
3695 if (this.data.is_b_now == 1) pick = this.data.bn_pick; 3697 if (this.data.is_b_now == 1) pick = this.data.bn_pick;
3696 //---获取订单优惠--- 3698 //---获取订单优惠---
3697 getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { 3699 getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
3698 - data: {store_id: os.stoid, orderAmount: condition} 3700 + data: { store_id: os.stoid, orderAmount: condition }
3699 }).then(res => { 3701 }).then(res => {
3700 if (res.data.code == 0) { 3702 if (res.data.code == 0) {
3701 var data = res.data.data; 3703 var data = res.data.data;
@@ -3717,7 +3719,7 @@ Page({ @@ -3717,7 +3719,7 @@ Page({
3717 var ob = map[pickid][item.prom_id]; 3719 var ob = map[pickid][item.prom_id];
3718 ob.price += item.goods_price * item.goods_num; 3720 ob.price += item.goods_price * item.goods_num;
3719 ob.goods_num += item.goods_num; 3721 ob.goods_num += item.goods_num;
3720 - ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num}); 3722 + ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num });
3721 3723
3722 } else { 3724 } else {
3723 var prom = null; 3725 var prom = null;
@@ -3733,7 +3735,7 @@ Page({ @@ -3733,7 +3735,7 @@ Page({
3733 ob.is_bz = prom.is_bz; 3735 ob.is_bz = prom.is_bz;
3734 ob.is_xz_yh = prom.is_xz_yh; 3736 ob.is_xz_yh = prom.is_xz_yh;
3735 ob.goods = new Array(); 3737 ob.goods = new Array();
3736 - ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num}); 3738 + ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num });
3737 map[pickid][item.prom_id] = ob; 3739 map[pickid][item.prom_id] = ob;
3738 } 3740 }
3739 } else { 3741 } else {
@@ -3750,7 +3752,7 @@ Page({ @@ -3750,7 +3752,7 @@ Page({
3750 ob.is_bz = prom.is_bz; 3752 ob.is_bz = prom.is_bz;
3751 ob.is_xz_yh = prom.is_xz_yh; 3753 ob.is_xz_yh = prom.is_xz_yh;
3752 ob.goods = new Array(); 3754 ob.goods = new Array();
3753 - ob.goods.push({goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num}); 3755 + ob.goods.push({ goods_id: item.goods_id, goods_price: item.goods_price, goods_num: item.goods_num });
3754 3756
3755 var obj = {}; 3757 var obj = {};
3756 obj[item.prom_id] = ob; 3758 obj[item.prom_id] = ob;
@@ -3760,7 +3762,7 @@ Page({ @@ -3760,7 +3762,7 @@ Page({
3760 }, 3762 },
3761 3763
3762 //计算立即购买赠品的物流费用 3764 //计算立即购买赠品的物流费用
3763 - 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) { 3765 + 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) {
3764 var good = this.data.buy_now_gift_goods; 3766 var good = this.data.buy_now_gift_goods;
3765 var goods_weight = -1, goods_piece = -1; 3767 var goods_weight = -1, goods_piece = -1;
3766 var gift_shipping_price = 0; 3768 var gift_shipping_price = 0;
@@ -3776,8 +3778,9 @@ Page({ @@ -3776,8 +3778,9 @@ Page({
3776 //累积商品重量 每种商品的重量 * 数量 3778 //累积商品重量 每种商品的重量 * 数量
3777 goods_weight += good['weight'] * good['buynum']; 3779 goods_weight += good['weight'] * good['buynum'];
3778 if (goods_weight1 > 0) { 3780 if (goods_weight1 > 0) {
  3781 + out_of_weight = gift_weight_free - goods_weight;
  3782 + //不能调换位置 下面goods_weight会变大
3779 goods_weight += goods_weight1; 3783 goods_weight += goods_weight1;
3780 - out_of_weight = (gift_weight_free*1000) - goods_weight;  
3781 } 3784 }
3782 break; 3785 break;
3783 case 3: 3786 case 3:
@@ -3795,7 +3798,7 @@ Page({ @@ -3795,7 +3798,7 @@ Page({
3795 if (no_by_data && no_by_data.region_list) { 3798 if (no_by_data && no_by_data.region_list) {
3796 if (th.check_by_area(no_by_data.region_list)) { 3799 if (th.check_by_area(no_by_data.region_list)) {
3797 gift_freight_free = 0; 3800 gift_freight_free = 0;
3798 - out_of_weight=0; 3801 + out_of_weight = 0;
3799 th.data.is_no_by[th.data.bn_pick] = 1; 3802 th.data.is_no_by[th.data.bn_pick] = 1;
3800 } 3803 }
3801 } 3804 }
@@ -3803,14 +3806,15 @@ Page({ @@ -3803,14 +3806,15 @@ Page({
3803 if (no_by_data && no_by_data.goods_list && gift_freight_free) { 3806 if (no_by_data && no_by_data.goods_list && gift_freight_free) {
3804 if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) { 3807 if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) {
3805 gift_freight_free = 0; 3808 gift_freight_free = 0;
3806 - out_of_weight=0; 3809 + out_of_weight = 0;
  3810 + th.data.is_no_by[th.data.bn_pick] = 1;
3807 //th.data.is_no_by[th.data.bn_pick]=1; 3811 //th.data.is_no_by[th.data.bn_pick]=1;
3808 } 3812 }
3809 } 3813 }
3810 3814
3811 var t_shipping_price = 3815 var t_shipping_price =
3812 - this.calculatewuliu(code, gift_shipping_price, goods_weight,out_of_weight,  
3813 - goods_piece, user_addr, gift_freight_free, allpice, rs); 3816 + this.calculatewuliu(code, gift_shipping_price, goods_weight, out_of_weight,
  3817 + goods_piece, user_addr, gift_freight_free, allpice, rs, th.data.bn_pick);
3814 return t_shipping_price; 3818 return t_shipping_price;
3815 3819
3816 }, 3820 },
@@ -3867,7 +3871,7 @@ Page({ @@ -3867,7 +3871,7 @@ Page({
3867 3871
3868 //跳转关闭弹出框的显示 3872 //跳转关闭弹出框的显示
3869 close_offline: function () { 3873 close_offline: function () {
3870 - this.setData({is_offline_show: 0}); 3874 + this.setData({ is_offline_show: 0 });
3871 }, 3875 },
3872 3876
3873 //立即购买显示弹出框 3877 //立即购买显示弹出框
@@ -3875,7 +3879,7 @@ Page({ @@ -3875,7 +3879,7 @@ Page({
3875 var off_price = this.data.bn_goods.shop_price - this.data.bn_goods.offline_price; 3879 var off_price = this.data.bn_goods.shop_price - this.data.bn_goods.offline_price;
3876 //是不是线下 3880 //是不是线下
3877 var is_get_offline = this.data.bn_goods.is_offline; 3881 var is_get_offline = this.data.bn_goods.is_offline;
3878 - this.setData({is_offline_show: 1, show_off_price: off_price.toFixed(2), is_get_offline: is_get_offline}); 3882 + this.setData({ is_offline_show: 1, show_off_price: off_price.toFixed(2), is_get_offline: is_get_offline });
3879 }, 3883 },
3880 3884
3881 //确定使用线下取价 3885 //确定使用线下取价
@@ -3883,14 +3887,14 @@ Page({ @@ -3883,14 +3887,14 @@ Page({
3883 var bn_goods = this.data.bn_goods; 3887 var bn_goods = this.data.bn_goods;
3884 if (bn_goods && bn_goods.prom_type == 0) { 3888 if (bn_goods && bn_goods.prom_type == 0) {
3885 bn_goods.is_offline = 1; 3889 bn_goods.is_offline = 1;
3886 - this.setData({is_offline_show: 0, bn_goods: bn_goods}); 3890 + this.setData({ is_offline_show: 0, bn_goods: bn_goods });
3887 this.calculatePrice2(); 3891 this.calculatePrice2();
3888 } 3892 }
3889 //就是购物车结算时的 3893 //就是购物车结算时的
3890 else { 3894 else {
3891 var index = this.data.pop_offline_index; 3895 var index = this.data.pop_offline_index;
3892 var txt = "cartlist[" + index + "].is_offline"; 3896 var txt = "cartlist[" + index + "].is_offline";
3893 - this.setData({[txt]: 1, is_offline_show: 0,}); 3897 + this.setData({ [txt]: 1, is_offline_show: 0, });
3894 this.data.old_cartlist[index].is_offline = 1; 3898 this.data.old_cartlist[index].is_offline = 1;
3895 this.calculatePrice(); 3899 this.calculatePrice();
3896 } 3900 }
@@ -3902,14 +3906,14 @@ Page({ @@ -3902,14 +3906,14 @@ Page({
3902 var bn_goods = this.data.bn_goods; 3906 var bn_goods = this.data.bn_goods;
3903 if (bn_goods && bn_goods.prom_type == 0) { 3907 if (bn_goods && bn_goods.prom_type == 0) {
3904 bn_goods.is_offline = 0; 3908 bn_goods.is_offline = 0;
3905 - this.setData({is_offline_show: 0, bn_goods: bn_goods}); 3909 + this.setData({ is_offline_show: 0, bn_goods: bn_goods });
3906 this.calculatePrice2(); 3910 this.calculatePrice2();
3907 } 3911 }
3908 //就是购物车结算时的 3912 //就是购物车结算时的
3909 else { 3913 else {
3910 var index = this.data.pop_offline_index; 3914 var index = this.data.pop_offline_index;
3911 var txt = "cartlist[" + index + "].is_offline"; 3915 var txt = "cartlist[" + index + "].is_offline";
3912 - this.setData({[txt]: 0, is_offline_show: 0,}) 3916 + this.setData({ [txt]: 0, is_offline_show: 0, })
3913 this.data.old_cartlist[index].is_offline = 0; 3917 this.data.old_cartlist[index].is_offline = 0;
3914 this.calculatePrice(); 3918 this.calculatePrice();
3915 } 3919 }
@@ -3930,19 +3934,19 @@ Page({ @@ -3930,19 +3934,19 @@ Page({
3930 }); 3934 });
3931 }, 3935 },
3932 3936
3933 - set_hid_inp:function (e) { 3937 + set_hid_inp: function (e) {
3934 var index = e.currentTarget.dataset.index; 3938 var index = e.currentTarget.dataset.index;
3935 var txt = "cartlist[" + index + "].focus"; 3939 var txt = "cartlist[" + index + "].focus";
3936 - this.setData({[txt]:1}) 3940 + this.setData({ [txt]: 1 })
3937 }, 3941 },
3938 3942
3939 - clear_hid_inp:function (e) { 3943 + clear_hid_inp: function (e) {
3940 var index = e.currentTarget.dataset.index; 3944 var index = e.currentTarget.dataset.index;
3941 var txt = "cartlist[" + index + "].focus"; 3945 var txt = "cartlist[" + index + "].focus";
3942 - this.setData({[txt]:0}) 3946 + this.setData({ [txt]: 0 })
3943 }, 3947 },
3944 3948
3945 - go_url:function (e) { 3949 + go_url: function (e) {
3946 var url = e.currentTarget.dataset.url; 3950 var url = e.currentTarget.dataset.url;
3947 getApp().goto(url); 3951 getApp().goto(url);
3948 } 3952 }
pages/cart/cart2/cart2.js
@@ -1647,8 +1647,8 @@ Page({ @@ -1647,8 +1647,8 @@ Page({
1647 is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id); 1647 is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id);
1648 } 1648 }
1649 1649
1650 - //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮  
1651 - if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1) { 1650 + //如果达到全场包邮的条件,同时,没有地区不包邮,或者商品不包邮 并且没有超出重量
  1651 + if (o_price - quan_price >= freight_free && freight_free > 0 && !is_good_no_by && th.data.is_no_by[pickid] != 1 && out_of_weight >=0 ) {
1652 continue; 1652 continue;
1653 } 1653 }
1654 1654
@@ -1670,15 +1670,14 @@ Page({ @@ -1670,15 +1670,14 @@ Page({
1670 //统一运费 1670 //统一运费
1671 o_shipping_price += item[j]['uniform_exp_sum']; 1671 o_shipping_price += item[j]['uniform_exp_sum'];
1672 break; 1672 break;
1673 - case 2:  
1674 - +''  
1675 - if (goods_weight < 0) goods_weight = 0;  
1676 - //累积商品重量 每种商品的重量 * 数量  
1677 - goods_weight += item[j]['weight'] * item[j]['goods_num'];  
1678 - if (weight_free > 0) {  
1679 - out_of_weight = (weight_free * 1000) - goods_weight;  
1680 - }  
1681 - break; 1673 + // case 2:
  1674 + // if (goods_weight < 0) goods_weight = 0;
  1675 + // //累积商品重量 每种商品的重量 * 数量
  1676 + // goods_weight += item[j]['weight'] * item[j]['goods_num'];
  1677 + // if (weight_free > 0) {
  1678 + // out_of_weight = (weight_free * 1000) - goods_weight;
  1679 + // }
  1680 + // break;
1682 case 3: 1681 case 3:
1683 if (goods_piece < 0) goods_piece = 0; 1682 if (goods_piece < 0) goods_piece = 0;
1684 //累积商品数量 1683 //累积商品数量
@@ -1686,6 +1685,11 @@ Page({ @@ -1686,6 +1685,11 @@ Page({
1686 break; 1685 break;
1687 } 1686 }
1688 } 1687 }
  1688 + }else{
  1689 + if(item[j]['exp_sum_type']==2 && out_of_weight!==0){
  1690 + goods_weight = -1;
  1691 + out_of_weight = 0;
  1692 + }
1689 } 1693 }
1690 } 1694 }
1691 1695