Commit de1859cb93fe6c02ee001a017c663977482e03a1
Merge branch 'dev' into 'test'
Dev See merge request !1055
Showing
41 changed files
with
1335 additions
and
331 deletions
components/diy_goodsGroup/diy_goodsGroup.wxml
... | ... | @@ -534,8 +534,8 @@ |
534 | 534 | <!-- 列表显示 --> |
535 | 535 | <view class="zs_goods_xiao_wai" wx:if='{{object.column==4}}'> |
536 | 536 | <block wx:for="{{goods_array}}"> |
537 | - <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1"> | |
538 | - <view class="{{object.noboder==0?'zs_goods_xiao_bottom':'zs_goods_xiao'}}"> | |
537 | + <navigator url="{{g_filter.get_url_by_type(item)}}" class="s1_gk_a1 {{object.noboder==0?'list_border':'' }}"> | |
538 | + <view class="zs_goods_xiao_bottom {{g_filter.get_border_type(object.big_order_type)}}"> | |
539 | 539 | <view class='zs_top_x'> |
540 | 540 | <block wx:if="{{object.big_order_type==3}}"> |
541 | 541 | <view style="position: relative; width: 100%; height: 100%"> |
... | ... | @@ -567,9 +567,8 @@ |
567 | 567 | <image class='{{g_filter.get_class(object.column,object.position)}}' wx:if="{{object.styleicon==4 }}" src='{{imghost}}/miniapp/images/Promotion.png'></image> |
568 | 568 | </block> |
569 | 569 | </view> |
570 | - | |
571 | 570 | <view class='zs_center_x'> |
572 | - <view class='zs_wz1_x ellipsis-2' wx:if="{{object.goodstit}}">{{item.goods_name}}</view> | |
571 | + <view class='zs_wz1_x ellipsis-2' style="width: 360rpx; margin-top: 10rpx" wx:if="{{object.goodstit}}">{{item.goods_name}}</view> | |
573 | 572 | <view class='zs_wz2_x' wx:if="{{object.goodsprice}}"> |
574 | 573 | |
575 | 574 | <block wx:if="{{item.prom_price || item.prom_integral}}"> |
... | ... | @@ -698,7 +697,6 @@ |
698 | 697 | </view> |
699 | 698 | |
700 | 699 | </view> |
701 | - | |
702 | 700 | </view> |
703 | 701 | </navigator> |
704 | 702 | </block> | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxss
... | ... | @@ -139,7 +139,7 @@ |
139 | 139 | border-bottom: 2rpx #eee solid; |
140 | 140 | /* padding: 10rpx; */ |
141 | 141 | background-color: white; |
142 | - padding: 20rpx; | |
142 | + margin: 20rpx; | |
143 | 143 | /* background-color: pink; */ |
144 | 144 | box-sizing: border-box; |
145 | 145 | } |
... | ... | @@ -149,7 +149,7 @@ |
149 | 149 | min-height: 300rpx; |
150 | 150 | display: flex; |
151 | 151 | /* border-bottom: 2rpx #eee solid; */ |
152 | - padding: 10rpx; | |
152 | + margin: 10rpx; | |
153 | 153 | background-color: white; |
154 | 154 | } |
155 | 155 | |
... | ... | @@ -901,6 +901,10 @@ top: 10rpx; |
901 | 901 | border-radius: 40rpx; |
902 | 902 | } |
903 | 903 | |
904 | +.zs_goods_xiao_wai{ padding-top:1rpx } | |
905 | +.s1_gk_a1.list_border{ display: block; border-bottom: 1rpx solid #eee} | |
906 | + | |
907 | + | |
904 | 908 | |
905 | 909 | |
906 | 910 | ... | ... |
packageA/pages/goodsInfo/goodsInfo.js
... | ... | @@ -2932,14 +2932,38 @@ Page({ |
2932 | 2932 | |
2933 | 2933 | onShareTimeline() { |
2934 | 2934 | getApp().globalData.no_clear=1 |
2935 | - var store_name=getApp().globalData.config?getApp().globalData.config.store_name:''; | |
2936 | - if(!store_name) | |
2937 | - store_name=getApp().globalData.setting.appName; | |
2938 | - | |
2939 | - return { | |
2940 | - title:this.data.data.goods_name + '-' + store_name, | |
2941 | - imageUrl:this.data.gallery[0].image_url, | |
2942 | - } | |
2935 | + | |
2936 | + var th = this; | |
2937 | + var price = th.data.data.shop_price; | |
2938 | + if (th.data.prom_act) { | |
2939 | + price = th.data.prom_act.price; | |
2940 | + | |
2941 | + } | |
2942 | + var title= th.data.data.goods_name; | |
2943 | + var img=th.data.data.original_img; | |
2944 | + if(th.data.prom_type==6){ | |
2945 | + title=th.data.prom_act.share_title; | |
2946 | + img=th.data.iurl+th.data.prom_act.share_imgurl; | |
2947 | + } | |
2948 | + | |
2949 | + var url="goods_id=" + th.data.gid; | |
2950 | + if(getApp().globalData.user_id) { | |
2951 | + url+="&first_leader="+getApp().globalData.user_id; | |
2952 | + } | |
2953 | + | |
2954 | + //-- 如果房间分享,且不是会员分享的 -- | |
2955 | + if(getApp().globalData.room_id && | |
2956 | + th.data.data.goods_id==getApp().globalData.room_goods_id && | |
2957 | + !getApp().globalData.room_user_share | |
2958 | + ){ | |
2959 | + url+="&room_id="+getApp().globalData.room_id+"&room_user_share=1"; | |
2960 | + } | |
2961 | + | |
2962 | + return { | |
2963 | + title:price + "元 " +title, | |
2964 | + imageUrl:img, | |
2965 | + query: url | |
2966 | + } | |
2943 | 2967 | }, |
2944 | 2968 | |
2945 | 2969 | ... | ... |
packageA/pages/jfbuy/jfbuy.js
... | ... | @@ -267,23 +267,21 @@ Page({ |
267 | 267 | // } |
268 | 268 | |
269 | 269 | }, |
270 | - | |
271 | - | |
272 | - onShareTimeline() { | |
273 | - getApp().globalData.no_clear=1; | |
274 | - var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:''; | |
275 | - | |
276 | - var pagePath = this.route; //当前页面url | |
277 | - | |
278 | - if(!store_name) store_name = getApp().globalData.setting.appName; | |
279 | - if(pagePath.indexOf('/') != 0) { | |
280 | - pagePath = '/' + pagePath; | |
281 | - } | |
282 | - return { | |
283 | - title: store_name + '-积分购', | |
284 | - path: pagePath, | |
285 | - } | |
286 | - }, | |
270 | + | |
271 | + | |
272 | + onShareTimeline() { | |
273 | + getApp().globalData.no_clear=1; | |
274 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:''; | |
275 | + | |
276 | + var user_id=getApp().globalData.user_id; | |
277 | + if(!user_id) user_id=0; | |
278 | + if(!store_name) store_name = getApp().globalData.setting.appName; | |
279 | + | |
280 | + return { | |
281 | + title: store_name + '-积分购', | |
282 | + query: 'first_leader='+user_id | |
283 | + } | |
284 | + }, | |
287 | 285 | |
288 | 286 | |
289 | 287 | //-- 点击tab -- | ... | ... |
packageA/pages/liveStream/liveStream.js
... | ... | @@ -365,23 +365,18 @@ Page({ |
365 | 365 | } |
366 | 366 | }, |
367 | 367 | |
368 | - onShareTimeline: function (res) { | |
369 | - getApp().globalData.no_clear=1; | |
370 | - if (res.from === 'button') { | |
371 | - // 来自页面内转发按钮 | |
372 | - // console.log(res.target) | |
373 | - } | |
374 | - return { | |
375 | - title: '直播列表' | |
376 | - // path: '/page/user?id=123' | |
377 | - } | |
378 | - }, | |
379 | - | |
380 | - | |
381 | - | |
382 | - | |
383 | - | |
368 | + onShareTimeline: function (res) { | |
369 | + getApp().globalData.no_clear=1; | |
370 | + var user_id=getApp().globalData.user_id; | |
371 | + if(!user_id) user_id=0; | |
372 | + | |
373 | + return { | |
374 | + title: '直播列表', | |
375 | + query: 'first_leader='+user_id | |
376 | + } | |
377 | + }, | |
384 | 378 | |
379 | + | |
385 | 380 | /** |
386 | 381 | * 请求数据 |
387 | 382 | */ | ... | ... |
packageA/pages/liveStreamDetails/liveStreamDetails.js
... | ... | @@ -630,17 +630,17 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un |
630 | 630 | } |
631 | 631 | }, |
632 | 632 | |
633 | - onShareTimeline: function (res) { | |
634 | - getApp().globalData.no_clear=1; | |
635 | - if (res.from === 'button') { | |
636 | - // 来自页面内转发按钮 | |
637 | - console.log(res.target) | |
638 | - } | |
639 | - return { | |
640 | - title: this.data.details.name | |
641 | - // path: '/page/user?id=123' | |
642 | - } | |
643 | - }, | |
633 | + onShareTimeline: function (res) { | |
634 | + getApp().globalData.no_clear=1; | |
635 | + | |
636 | + var user_id=getApp().globalData.user_id; | |
637 | + if(!user_id) user_id=0; | |
638 | + | |
639 | + return { | |
640 | + title: this.data.details.name, | |
641 | + query: 'first_leader='+user_id+"&id="+this.data.id | |
642 | + } | |
643 | + }, | |
644 | 644 | |
645 | 645 | |
646 | 646 | imageResize(imgWidth, imgHeight) { | ... | ... |
packageA/pages/profile/profile.js
... | ... | @@ -1126,10 +1126,10 @@ Page({ |
1126 | 1126 | if(this.data.reg_info.introducer_state){ |
1127 | 1127 | let tjrname = this.data.referee; |
1128 | 1128 | if (tjrname == "" || tjrname == null) { |
1129 | - app.my_warnning("请输入推荐人", 0, this); | |
1130 | - return false; | |
1129 | + //app.my_warnning("请输入推荐人", 0, this); | |
1130 | + //return false; | |
1131 | 1131 | }; |
1132 | - data.tjrname=tjrname; | |
1132 | + if(tjrname) data.tjrname=tjrname; | |
1133 | 1133 | } |
1134 | 1134 | |
1135 | 1135 | //-- 需要姓名 -- |
... | ... | @@ -1150,7 +1150,6 @@ Page({ |
1150 | 1150 | }; |
1151 | 1151 | data.sex=sex; |
1152 | 1152 | } |
1153 | - | |
1154 | 1153 | //需要生日 |
1155 | 1154 | if(this.data.reg_info.birthday_state){ |
1156 | 1155 | let birthday = this.data.datet; | ... | ... |
packageA/pages/prom_list/prom_list.js
packageB/pages/zuhegou/index/index.js
... | ... | @@ -468,18 +468,19 @@ Page({ |
468 | 468 | onShareTimeline() { |
469 | 469 | getApp().globalData.no_clear=1; |
470 | 470 | var title = this.data.act.name; |
471 | - var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; | |
472 | - if (getApp().globalData.user_id) { | |
473 | - url += "&first_leader=" + getApp().globalData.user_id; | |
474 | - } | |
471 | + | |
472 | + var user_id=getApp().globalData.user_id; | |
473 | + if(!user_id) user_id=0; | |
474 | + | |
475 | 475 | var ob = { |
476 | 476 | title: title, |
477 | - path: url, | |
477 | + query: 'first_leader='+user_id+"&id=" + this.data.act.id | |
478 | 478 | }; |
479 | 479 | if (this.data.act.img_url) |
480 | 480 | ob.imageUrl = this.data.iurl + this.data.act.img_url; |
481 | 481 | return ob; |
482 | 482 | }, |
483 | + | |
483 | 484 | /** |
484 | 485 | * 点击规则详情,弹出规则 |
485 | 486 | */ | ... | ... |
packageB/pages/zuhegou/preindex/index.js
... | ... | @@ -470,18 +470,19 @@ Page({ |
470 | 470 | onShareTimeline() { |
471 | 471 | getApp().globalData.no_clear=1; |
472 | 472 | var title = this.data.act.name; |
473 | - var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; | |
474 | - if (getApp().globalData.user_id) { | |
475 | - url += "&first_leader=" + getApp().globalData.user_id; | |
476 | - } | |
473 | + | |
474 | + var user_id=getApp().globalData.user_id; | |
475 | + if(!user_id) user_id=0; | |
476 | + | |
477 | 477 | var ob = { |
478 | 478 | title: title, |
479 | - path: url, | |
479 | + query: 'first_leader='+user_id+"&id=" + this.data.act.id | |
480 | 480 | }; |
481 | 481 | if (this.data.act.img_url) |
482 | 482 | ob.imageUrl = this.data.iurl + this.data.act.img_url; |
483 | 483 | return ob; |
484 | 484 | }, |
485 | + | |
485 | 486 | /** |
486 | 487 | * 点击规则详情,弹出规则 |
487 | 488 | */ | ... | ... |
packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js
... | ... | @@ -1619,7 +1619,11 @@ Page({ |
1619 | 1619 | break; |
1620 | 1620 | case 1: |
1621 | 1621 | //order_m = o_condition - ord_prom['expression'];//满额优惠金额 |
1622 | - order_prom_amount = ord_prom['expression']; | |
1622 | + var bs=1; | |
1623 | + if(ord_prom.is_bz){ | |
1624 | + bs=Math.floor(o_condition/ord_prom.money); | |
1625 | + } | |
1626 | + order_prom_amount = bs*ord_prom['expression']; | |
1623 | 1627 | break; |
1624 | 1628 | } |
1625 | 1629 | } |
... | ... | @@ -1976,8 +1980,13 @@ Page({ |
1976 | 1980 | order_prom_amount = (o_condition - order_m).toFixed(2); |
1977 | 1981 | break; |
1978 | 1982 | case 1: |
1979 | - order_m = o_condition - ord_prom['expression'];//满额优惠金额 | |
1980 | - order_prom_amount = ord_prom['expression']; | |
1983 | + | |
1984 | + var bs=1; | |
1985 | + if(ord_prom.is_bz){ | |
1986 | + bs=Math.floor(o_condition/ord_prom.money); | |
1987 | + } | |
1988 | + order_m = o_condition - bs*ord_prom['expression'];//满额优惠金额 | |
1989 | + order_prom_amount = bs*ord_prom['expression']; | |
1981 | 1990 | break; |
1982 | 1991 | } |
1983 | 1992 | } | ... | ... |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js
... | ... | @@ -242,6 +242,20 @@ Page({ |
242 | 242 | var gd = t.data.data; |
243 | 243 | if (!gd) return false; |
244 | 244 | |
245 | + //-- 如果商品有同城配送的参数的时候,一件代发商品不能显示同城配送按钮 -- | |
246 | + if(gd.is_same_city && th.data.is_same_city && gd.whsle_id<=0){ | |
247 | + getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+gg.pick_id, {}).then(res=>{ | |
248 | + if(res.data.code==0){ | |
249 | + var pk=res.data.data; | |
250 | + if(pk && pk.is_same_city){ | |
251 | + th.setData({show_same_city:1}) | |
252 | + }} | |
253 | + | |
254 | + }) | |
255 | + | |
256 | + } | |
257 | + | |
258 | + | |
245 | 259 | t.data.data.original_img = oo.imghost + t.data.data.original_img; |
246 | 260 | t.data.data['buynum'] = gg.goods_num; |
247 | 261 | // console.log(t.data.data); |
... | ... | @@ -406,12 +420,14 @@ Page({ |
406 | 420 | th.data.json_d = json_d; |
407 | 421 | th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 |
408 | 422 | var is_default_logistics = json_d.is_default_logistics; |
423 | + var is_same_city = json_d.is_same_city; | |
409 | 424 | |
410 | 425 | th.setData({ |
411 | 426 | is_close_quan: json_d.is_close_quan, |
412 | 427 | sales_rules: ee.sales_rules, |
413 | 428 | rank_switch: json_d.rank_switch, |
414 | - is_default_logistics: is_default_logistics | |
429 | + is_default_logistics: is_default_logistics, | |
430 | + is_same_city: is_same_city | |
415 | 431 | }); |
416 | 432 | |
417 | 433 | var rank_switch = json_d.rank_switch; |
... | ... | @@ -499,9 +515,7 @@ Page({ |
499 | 515 | console.log('calculatePrice2'); |
500 | 516 | var th = this, |
501 | 517 | good = this.data.bn_goods; |
502 | - | |
503 | - th.setData({is_show_sub:0}); | |
504 | - | |
518 | + | |
505 | 519 | //-----------计算商品总价-------------- |
506 | 520 | var allpice = th.data.param.goods_price; |
507 | 521 | allpice = parseFloat(allpice).toFixed(2); |
... | ... | @@ -510,6 +524,8 @@ Page({ |
510 | 524 | [txt]: allpice, |
511 | 525 | }); |
512 | 526 | |
527 | + this.setData({sub:1}); | |
528 | + | |
513 | 529 | wx.showLoading({ |
514 | 530 | title: "处理中.", |
515 | 531 | mask:true |
... | ... | @@ -544,8 +560,9 @@ Page({ |
544 | 560 | let item = gd_arr_list[i]; |
545 | 561 | |
546 | 562 | if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { |
547 | - if (goods_weight < 0) goods_weight = 0; | |
563 | + | |
548 | 564 | if (item['exp_sum_type'] == 2) { |
565 | + if (goods_weight < 0) goods_weight = 0; | |
549 | 566 | goods_weight += item['weight'] * item['buynum']; |
550 | 567 | cut_good_weight += item['weight'] * item['buynum']; |
551 | 568 | } |
... | ... | @@ -611,7 +628,7 @@ Page({ |
611 | 628 | wx.showToast({ |
612 | 629 | title: "计算物流错误", icon: 'none',duration: 2000 |
613 | 630 | }) |
614 | - th.setData({ show_submit:0 }); | |
631 | + th.setData({ show_submit:0,sub:0 }); | |
615 | 632 | wx.hideLoading(); |
616 | 633 | } |
617 | 634 | |
... | ... | @@ -622,12 +639,62 @@ Page({ |
622 | 639 | [wl_txt]: shipping_price, |
623 | 640 | }) |
624 | 641 | |
625 | - } else { | |
642 | + } else if(th.data.bn_exp_type==1) { | |
626 | 643 | var wl_txt = "formData.shipping_price"; |
627 | 644 | th.setData({ |
628 | 645 | [wl_txt]: 0, |
629 | 646 | }) |
630 | 647 | } |
648 | + | |
649 | + | |
650 | + //判断是否同城配送,而且没有调用过 | |
651 | + if(th.data.bn_exp_type==2 && th.data.user_addr) { | |
652 | + | |
653 | + var lon=0;var lat=0; | |
654 | + //-- 获取距离 -- | |
655 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
656 | + is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address} | |
657 | + }).then(res=>{ | |
658 | + if(res.data.code==0){ | |
659 | + var data= JSON.parse(res.data.data); | |
660 | + if(data.status==0){ | |
661 | + lon=data.result.location.lng; | |
662 | + lat=data.result.location.lat; | |
663 | + } | |
664 | + } | |
665 | + }) | |
666 | + | |
667 | + | |
668 | + var gd_w = good['weight'] * good['buynum']; | |
669 | + //-- 获取距离 -- | |
670 | + var req_data = { | |
671 | + store_id: os.stoid, | |
672 | + order_amount:th.data.param.goods_price, | |
673 | + lon: lon, lat: lat, | |
674 | + pickup_id: th.data.bn_pick, | |
675 | + goods_weight: gd_w | |
676 | + } | |
677 | + | |
678 | + var is_next=1; | |
679 | + //获取同城配送参数 | |
680 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", { | |
681 | + is_json: 1, | |
682 | + data: req_data | |
683 | + }).then(res => { | |
684 | + if (res.data.code == 0) { | |
685 | + var wl_txt = "formData.shipping_price"; | |
686 | + th.setData({ [wl_txt]: res.data.data, }) | |
687 | + }else{ | |
688 | + is_next=0; | |
689 | + wx.showToast({ | |
690 | + title: res.data.msg, icon: 'none', duration: 2000 | |
691 | + }) | |
692 | + } | |
693 | + }) | |
694 | + if(!is_next) return false | |
695 | + } | |
696 | + | |
697 | + | |
631 | 698 | //-----------------总价----------------- |
632 | 699 | // 幸运购 01 |
633 | 700 | // var total_m = parseFloat(allpice) + parseFloat( th.data.formData.shipping_price); |
... | ... | @@ -648,7 +715,7 @@ Page({ |
648 | 715 | th.setData({ |
649 | 716 | [txt]: total_m, |
650 | 717 | [txt2]: 0, |
651 | - is_show_sub:1 | |
718 | + is_show_sub:1,sub:0 | |
652 | 719 | }) |
653 | 720 | } else { |
654 | 721 | order_m = parseFloat(order_m) - parseFloat(th.data.yuer); |
... | ... | @@ -656,14 +723,14 @@ Page({ |
656 | 723 | th.setData({ |
657 | 724 | [txt]: th.data.yuer, |
658 | 725 | [txt2]: order_m, |
659 | - is_show_sub:1 | |
726 | + is_show_sub:1,sub:0 | |
660 | 727 | }) |
661 | 728 | } |
662 | 729 | } else { |
663 | 730 | th.setData({ |
664 | 731 | [txt]: 0, |
665 | 732 | [txt2]: order_m, |
666 | - is_show_sub:1 | |
733 | + is_show_sub:1,sub:0 | |
667 | 734 | }) |
668 | 735 | } |
669 | 736 | wx.hideLoading(); | ... | ... |
packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml
... | ... | @@ -10,6 +10,11 @@ |
10 | 10 | |
11 | 11 | <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}" |
12 | 12 | data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view> |
13 | + | |
14 | + <!-- 同城配送 --> | |
15 | + <block wx:if="{{show_same_city}}"> | |
16 | + <view hidden="{{bn_t_exp_t==3}}" bindtap='setexptype' data-t='2' class="tab {{bn_exp_type== 2 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">同城配送</view> | |
17 | + </block> | |
13 | 18 | |
14 | 19 | </view> |
15 | 20 | </view> |
... | ... | @@ -160,7 +165,7 @@ |
160 | 165 | <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view> |
161 | 166 | <!-- <view class="co-red big"></view> --> |
162 | 167 | </view> |
163 | - <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | |
168 | + <button disabled="{{sub}}" class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | |
164 | 169 | </view> |
165 | 170 | </form> |
166 | 171 | ... | ... |
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
... | ... | @@ -528,8 +528,9 @@ Page({ |
528 | 528 | }); |
529 | 529 | |
530 | 530 | //更新点击量 |
531 | - getApp().request.put("/api/weshop/goods/updateClick", { | |
532 | - data: { store_id: os.stoid, goods_id: gid } | |
531 | + //noinspection JSUnresolvedFunction | |
532 | + getApp().request.put("/api/weshop/goods/updateClick", { | |
533 | + data: { store_id: os.stoid, goods_id: gid,user_id:getApp().globalData.user_id?getApp().globalData.user_id:0 } | |
533 | 534 | }); |
534 | 535 | |
535 | 536 | |
... | ... | @@ -2450,14 +2451,15 @@ Page({ |
2450 | 2451 | if (pagePath.indexOf('/') != 0) { |
2451 | 2452 | pagePath = '/' + pagePath; |
2452 | 2453 | } |
2453 | - // if(getApp().globalData.user_id){ | |
2454 | 2454 | |
2455 | - // if(pagePath.indexOf("?")>0){ | |
2456 | - // pagePath+="&first_leader="+getApp().globalData.user_id; | |
2457 | - // }else{ | |
2458 | - // pagePath+="?first_leader="+getApp().globalData.user_id; | |
2459 | - // } | |
2460 | - // } | |
2455 | + if(getApp().globalData.user_id){ | |
2456 | + if(pagePath.indexOf("?")>0){ | |
2457 | + pagePath+="&first_leader="+getApp().globalData.user_id; | |
2458 | + }else{ | |
2459 | + pagePath+="?first_leader="+getApp().globalData.user_id; | |
2460 | + } | |
2461 | + } | |
2462 | + | |
2461 | 2463 | return { |
2462 | 2464 | title: "邀您一起参加幸运购", |
2463 | 2465 | path: pagePath, |
... | ... | @@ -6197,12 +6199,19 @@ Page({ |
6197 | 6199 | |
6198 | 6200 | onShareTimeline() { |
6199 | 6201 | getApp().globalData.no_clear=1; |
6200 | - var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
6201 | - if (!store_name) | |
6202 | - store_name = getApp().globalData.setting.appName; | |
6202 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
6203 | + if (!store_name) | |
6204 | + store_name = getApp().globalData.setting.appName; | |
6205 | + | |
6206 | + var pagePath = `goods_id=${this.data.sele_g.goods_id}&prom_type=9&group_id=${this.data.group_id}`; //当前页面url | |
6207 | + if(getApp().globalData.user_id){ | |
6208 | + pagePath+="&first_leader="+getApp().globalData.user_id; | |
6209 | + } | |
6210 | + | |
6203 | 6211 | return { |
6204 | 6212 | title: this.data.data.goods_name + '-' + store_name, |
6205 | 6213 | imageUrl: this.data.gallery[0].image_url, |
6214 | + query: pagePath | |
6206 | 6215 | } |
6207 | 6216 | }, |
6208 | 6217 | ... | ... |
packageC/pages/presell/cart/cart.js
... | ... | @@ -205,12 +205,14 @@ Page({ |
205 | 205 | th.data.json_d = json_d; |
206 | 206 | th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 |
207 | 207 | var is_default_logistics = json_d.is_default_logistics; |
208 | + var is_same_city = json_d.is_same_city; | |
208 | 209 | |
209 | 210 | th.setData({ |
210 | 211 | is_close_quan: json_d.is_close_quan, |
211 | 212 | sales_rules: ee.sales_rules, |
212 | 213 | rank_switch: json_d.rank_switch, |
213 | 214 | is_default_logistics: is_default_logistics, |
215 | + is_same_city: is_same_city, | |
214 | 216 | sys_switch: json_d, |
215 | 217 | }); |
216 | 218 | |
... | ... | @@ -500,6 +502,21 @@ Page({ |
500 | 502 | order.show_img = oo.imghost + goods.original_img; |
501 | 503 | }); |
502 | 504 | |
505 | + //-- 如果商品有同城配送的参数的时候,一件代发商品不能显示同城配送按钮 -- | |
506 | + if(goods.is_same_city && th.data.is_same_city && goods.whsle_id<=0){ | |
507 | + | |
508 | + getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+order.pickup_id, {}).then(res=>{ | |
509 | + if(res.data.code==0){ | |
510 | + var pk=res.data.data; | |
511 | + if(pk && pk.is_same_city){ | |
512 | + th.setData({show_same_city:1}) | |
513 | + } | |
514 | + } | |
515 | + | |
516 | + }) | |
517 | + | |
518 | + } | |
519 | + | |
503 | 520 | |
504 | 521 | var g_url = "/packageC/pages/presell/goodsInfo/goodsInfo?goods_id=" + order_goods.goods_id + "&pre_id=" + pre_arr.id; |
505 | 522 | if (act.is_end || th.data.act.end_time < ut.gettimestamp()) { |
... | ... | @@ -590,6 +607,11 @@ Page({ |
590 | 607 | break; //物流 |
591 | 608 | } |
592 | 609 | |
610 | + if (th.data.exp_type) { | |
611 | + exp_type=th.data.exp_type | |
612 | + } | |
613 | + | |
614 | + | |
593 | 615 | //等待发货的时候 |
594 | 616 | if (th.data.wait_fh) { |
595 | 617 | var send_time = th.data.act.delivery_date; |
... | ... | @@ -626,15 +648,19 @@ Page({ |
626 | 648 | }, |
627 | 649 | |
628 | 650 | |
629 | - async calculatePrice2() { | |
651 | + async calculatePrice2() { | |
630 | 652 | var th = this; |
631 | 653 | if (!this.data.pre_arr) return false; |
632 | - th.setData({ show_submit: 0,}) | |
654 | + th.setData({ show_submit: 0,disabled_btn:0}) | |
633 | 655 | |
634 | 656 | //--计算物流-- |
635 | 657 | if (this.data.exp_type == 0) { |
636 | 658 | this.calculate_wuliu(); |
637 | - } else { | |
659 | + }else if (this.data.exp_type == 2) { | |
660 | + this.calculate_same_city(); | |
661 | + } | |
662 | + | |
663 | + else { | |
638 | 664 | var allpice = this.data.pre_arr.presell_price * this.data.order_goods.goods_num; |
639 | 665 | allpice = allpice.toFixed(2); |
640 | 666 | //--看一下有没有订单优惠-- |
... | ... | @@ -698,8 +724,14 @@ Page({ |
698 | 724 | order_prom_amount = (all_1 - o_condition1).toFixed(2); |
699 | 725 | break; |
700 | 726 | case 1: |
701 | - o_condition1 = ord_price - ord_prom['expression'];//满额优惠金额 | |
702 | - order_prom_amount = ord_prom['expression']; | |
727 | + | |
728 | + var bs=1; | |
729 | + if(ord_prom.is_bz){ | |
730 | + bs=Math.floor(o_condition/ord_prom.money); | |
731 | + } | |
732 | + | |
733 | + o_condition1 = ord_price - bs*ord_prom['expression'];//满额优惠金额 | |
734 | + order_prom_amount = bs*ord_prom['expression']; | |
703 | 735 | break; |
704 | 736 | } |
705 | 737 | } |
... | ... | @@ -1824,8 +1856,9 @@ Page({ |
1824 | 1856 | let item = gd_arr_list[i]; |
1825 | 1857 | |
1826 | 1858 | if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { |
1827 | - if (goods_weight < 0) goods_weight = 0; | |
1859 | + | |
1828 | 1860 | if (item['exp_sum_type'] == 2) { |
1861 | + if (goods_weight < 0) goods_weight = 0; | |
1829 | 1862 | goods_weight += item['weight'] * item['buynum']; |
1830 | 1863 | cut_good_weight += item['weight'] * item['buynum']; |
1831 | 1864 | } |
... | ... | @@ -1908,6 +1941,68 @@ Page({ |
1908 | 1941 | } |
1909 | 1942 | //}); |
1910 | 1943 | }, |
1944 | + async calculate_same_city() { | |
1945 | + var th = this, | |
1946 | + good = th.data.goods, | |
1947 | + quan_price = 0, | |
1948 | + exp_price = 0; | |
1949 | + | |
1950 | + var quan_no = null; | |
1951 | + var bn_pick = th.data.pickup.pickup_id; | |
1952 | + var allpice = th.data.all_price; | |
1953 | + | |
1954 | + good.buynum=th.data.order.order_goods.goods_num; | |
1955 | + | |
1956 | + if (th.data.using_quan[bn_pick] != null && th.data.using_quan[bn_pick] != undefined) | |
1957 | + quan_no = th.data.using_quan[bn_pick].coupon_no; | |
1958 | + | |
1959 | + if (quan_no) { | |
1960 | + if (th.data.using_quan[bn_pick].isby != 1) { | |
1961 | + //---获取优惠券优惠--- | |
1962 | + await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { | |
1963 | + data: { | |
1964 | + storeId: oo.stoid, | |
1965 | + CashRepNo: quan_no, | |
1966 | + WaresSum: th.data.ckeck_quan_price, | |
1967 | + WareIds: th.data.check_quan_ware_list | |
1968 | + } | |
1969 | + }).then(res => { | |
1970 | + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { | |
1971 | + quan_price = res.data.data[0].WareCashSum; | |
1972 | + } | |
1973 | + }) | |
1974 | + | |
1975 | + if (quan_price > 0) { | |
1976 | + if (quan_price < th.data.tail_pay) th.setData({ quan_price: quan_price }) | |
1977 | + else { | |
1978 | + th.setData({ quan_price: th.data.tail_pay }) | |
1979 | + quan_price = th.data.tail_pay; | |
1980 | + } | |
1981 | + } else { | |
1982 | + th.setData({ quan_price: 0 }) | |
1983 | + } | |
1984 | + } else { | |
1985 | + th.setData({ quan_price: 0 }) | |
1986 | + } | |
1987 | + } else { | |
1988 | + th.setData({ quan_price: 0 }) | |
1989 | + } | |
1990 | + | |
1991 | + //-----------当地址不为空,且是物流时,计算物流费用---------- | |
1992 | + if (th.data.user_addr != null) { | |
1993 | + th.wuliu_next(allpice, quan_price, 0); | |
1994 | + } else { | |
1995 | + wx.showToast({ | |
1996 | + title: '请先选择收货地址', icon: 'none', duration: 2000 | |
1997 | + }) | |
1998 | + return false; | |
1999 | + } | |
2000 | + //}); | |
2001 | + }, | |
2002 | + | |
2003 | + | |
2004 | + | |
2005 | + | |
1911 | 2006 | //相同的东西统一在一起 |
1912 | 2007 | wuliu_next(allpice, quan_price, exp_price) { |
1913 | 2008 | var th = this; |
... | ... | @@ -1915,7 +2010,7 @@ Page({ |
1915 | 2010 | if (o_condition < 0) o_condition = 0; |
1916 | 2011 | //如果同意参与订单优惠 |
1917 | 2012 | if (o_condition > 0 && this.data.pre_arr.is_useorderyh) { |
1918 | - th.check_is_order_prom(o_condition, function (ord_price) { | |
2013 | + th.check_is_order_prom(o_condition,async function (ord_price) { | |
1919 | 2014 | var bn_pick = th.data.pickup.pickup_id |
1920 | 2015 | var order_prom_amount = 0; |
1921 | 2016 | var order_prom_id = 0; |
... | ... | @@ -1950,9 +2045,59 @@ Page({ |
1950 | 2045 | th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 }) |
1951 | 2046 | } |
1952 | 2047 | |
2048 | + if(th.data.exp_type == 2) { | |
2049 | + var good = th.data.goods; | |
2050 | + //--------------开始计算物流------------------ | |
2051 | + var shipping_price = 0; | |
2052 | + var lon = 0; | |
2053 | + var lat = 0; | |
2054 | + //-- 获取距离 -- | |
2055 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
2056 | + is_json: 1, data: {address: th.data.user_addr.more_address + th.data.user_addr.address} | |
2057 | + }).then(res => { | |
2058 | + if (res.data.code == 0) { | |
2059 | + var data = JSON.parse(res.data.data); | |
2060 | + if (data.status == 0) { | |
2061 | + lon = data.result.location.lng; | |
2062 | + lat = data.result.location.lat; | |
2063 | + } | |
2064 | + } | |
2065 | + }) | |
2066 | + var gd_w = good['weight'] * good['buynum']; | |
2067 | + //-- 获取距离 -- | |
2068 | + var req_data = { | |
2069 | + store_id: os.stoid, | |
2070 | + order_amount: parseFloat(ord_price), | |
2071 | + lon: lon, lat: lat, | |
2072 | + pickup_id: bn_pick, | |
2073 | + goods_weight: gd_w | |
2074 | + } | |
2075 | + | |
2076 | + var is_next = 1; | |
2077 | + //获取同城配送参数 | |
2078 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", { | |
2079 | + is_json: 1, | |
2080 | + data: req_data | |
2081 | + }).then(res => { | |
2082 | + if (res.data.code == 0) { | |
2083 | + shipping_price = res.data.data; | |
2084 | + } else { | |
2085 | + is_next = 0; | |
2086 | + wx.showToast({ | |
2087 | + title: res.data.msg, icon: 'none', duration: 2000 | |
2088 | + }) | |
2089 | + } | |
2090 | + }) | |
2091 | + if (!is_next) { | |
2092 | + th.setData({show_submit: 1, disabled_btn: 1}) | |
2093 | + return false | |
2094 | + } | |
2095 | + exp_price = parseFloat(shipping_price).toFixed(2); | |
2096 | + } | |
1953 | 2097 | |
1954 | 2098 | ord_price = parseFloat(ord_price) - parseFloat(th.data.presell.presell_deposit); |
1955 | 2099 | if (ord_price < 0) ord_price = 0; |
2100 | + | |
1956 | 2101 | th.setData({ exp_price: exp_price, order_m: ord_price + parseFloat(exp_price), show_submit: 1, }) |
1957 | 2102 | |
1958 | 2103 | }) | ... | ... |
packageC/pages/presell/cart/cart.wxml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <wxs src="filter.wxs" module="util"></wxs> |
3 | 3 | <wxs module="filters" src="../../../../utils/filter.wxs"></wxs> |
4 | 4 | |
5 | -<form bindsubmit="submitForm" wx:if="{{show_submit}}"> | |
5 | +<form bindsubmit="submitForm"> | |
6 | 6 | <view class="container"> |
7 | 7 | <!-- 支付进度 --> |
8 | 8 | <view class="information bdr14 mgt20"> |
... | ... | @@ -120,6 +120,12 @@ |
120 | 120 | class="tab {{exp_type== 0 ? 'active':''}}" |
121 | 121 | data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">快递邮寄 |
122 | 122 | </view> |
123 | + | |
124 | + <!-- 同城配送 --> | |
125 | + <block wx:if="{{show_same_city}}"> | |
126 | + <view bindtap='set_wuliu' data-type='2' class="tab {{exp_type== 2 ? 'active':''}}" | |
127 | + data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">同城配送</view> | |
128 | + </block> | |
123 | 129 | </view> |
124 | 130 | <!----要进行判断地址是否显示----> |
125 | 131 | <view bindtap="enterAddressPage" class="user-mes mgt20" |
... | ... | @@ -359,7 +365,7 @@ |
359 | 365 | 请于{{days}}天{{hours}}小时{{minutes}}分{{seconds}}秒内付款完成,超时订单将自动取消 |
360 | 366 | </view> |
361 | 367 | |
362 | - <view class="btn-wrap"> | |
368 | + <view class="btn-wrap" hidden="{{disabled_btn}}"> | |
363 | 369 | <view class="pay-amount"> |
364 | 370 | <view class="payable">应付金额: |
365 | 371 | <text class="co-red"> <text class="fs24">¥</text>{{filters.toFix(order_m,2)}}</text> | ... | ... |
packageC/pages/presell/cart/cart2.js
... | ... | @@ -153,9 +153,7 @@ Page({ |
153 | 153 | //----------子页返回父页触发---------- |
154 | 154 | onShow: function () { |
155 | 155 | var th = this; |
156 | - th.setData({ show_submit: 0 }); //让提交先掩藏 | |
157 | 156 | th.data.g_cart_q_time = null; |
158 | - | |
159 | 157 | if (th.data.isclose == 0) { |
160 | 158 | wx.navigateTo({ |
161 | 159 | url: "/pages/index/index/index" |
... | ... | @@ -217,12 +215,14 @@ Page({ |
217 | 215 | th.data.json_d = json_d; |
218 | 216 | th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 |
219 | 217 | var is_default_logistics = json_d.is_default_logistics; |
218 | + var is_same_city = json_d.is_same_city; | |
220 | 219 | |
221 | 220 | th.setData({ |
222 | 221 | is_close_quan: json_d.is_close_quan, |
223 | 222 | sales_rules: ee.sales_rules, |
224 | 223 | rank_switch: json_d.rank_switch, |
225 | - is_default_logistics: is_default_logistics | |
224 | + is_default_logistics: is_default_logistics, | |
225 | + is_same_city: is_same_city | |
226 | 226 | }); |
227 | 227 | |
228 | 228 | var rank_switch = json_d.rank_switch; |
... | ... | @@ -384,6 +384,21 @@ Page({ |
384 | 384 | var gd = t.data.data; |
385 | 385 | if (!gd) return false; |
386 | 386 | |
387 | + //-- 如果商品有同城配送的参数的时候,一件代发商品不能显示同城配送按钮 -- | |
388 | + if(gd.is_same_city && th.data.is_same_city && gd.whsle_id<=0){ | |
389 | + | |
390 | + getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+th.data.gg.pick_id, {}).then(res=>{ | |
391 | + if(res.data.code==0){ | |
392 | + var pk=res.data.data; | |
393 | + if(pk && pk.is_same_city){ | |
394 | + th.setData({show_same_city:1}) | |
395 | + } | |
396 | + } | |
397 | + | |
398 | + }) | |
399 | + | |
400 | + } | |
401 | + | |
387 | 402 | t.data.data.original_img = oo.imghost + t.data.data.original_img; |
388 | 403 | t.data.data['buynum'] = th.data.gg.goods_num; |
389 | 404 | var distr_t = 0, et = 0 |
... | ... | @@ -581,6 +596,8 @@ Page({ |
581 | 596 | return false; |
582 | 597 | } |
583 | 598 | |
599 | + th.setData({dis_btn:1}) | |
600 | + | |
584 | 601 | wx.showLoading({ |
585 | 602 | title: "处理中.",mask:true |
586 | 603 | }) |
... | ... | @@ -699,8 +716,9 @@ Page({ |
699 | 716 | let item = gd_arr_list[i]; |
700 | 717 | |
701 | 718 | if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { |
702 | - if (goods_weight < 0) goods_weight = 0; | |
719 | + | |
703 | 720 | if (item['exp_sum_type'] == 2) { |
721 | + if (goods_weight < 0) goods_weight = 0; | |
704 | 722 | cut_good_weight += item['weight'] * item['buynum']; |
705 | 723 | goods_weight += item['weight'] * item['buynum']; |
706 | 724 | |
... | ... | @@ -785,7 +803,7 @@ Page({ |
785 | 803 | var wl_txt = "formData.shipping_price"; |
786 | 804 | th.setData({[wl_txt]: shipping_price,}) |
787 | 805 | |
788 | - } else { | |
806 | + } else if(th.data.bn_exp_type==1) { | |
789 | 807 | var wl_txt = "formData.shipping_price"; |
790 | 808 | th.setData({ [wl_txt]: 0, }) |
791 | 809 | } |
... | ... | @@ -807,8 +825,11 @@ Page({ |
807 | 825 | } |
808 | 826 | //--看一下有没有订单优惠-- |
809 | 827 | var o_condition = parseFloat(order_m); |
828 | + | |
829 | + | |
830 | + | |
810 | 831 | if (o_condition > 0 && th.data.act.is_useorderyh) { |
811 | - th.check_is_order_prom(o_condition, function () { | |
832 | + th.check_is_order_prom(o_condition, async function () { | |
812 | 833 | var order_prom_amount = 0; |
813 | 834 | var order_prom_id = 0; |
814 | 835 | if (th.data.order_prom[th.data.bn_pick]) { |
... | ... | @@ -821,8 +842,14 @@ Page({ |
821 | 842 | order_prom_amount = (o_condition - order_m).toFixed(2); |
822 | 843 | break; |
823 | 844 | case 1: |
824 | - order_m = o_condition - ord_prom['expression'];//满额优惠金额 | |
825 | - order_prom_amount = ord_prom['expression']; | |
845 | + | |
846 | + var bs=1; | |
847 | + if(ord_prom.is_bz){ | |
848 | + bs=Math.floor(o_condition/ord_prom.money); | |
849 | + } | |
850 | + | |
851 | + order_m = o_condition - bs*ord_prom['expression'];//满额优惠金额 | |
852 | + order_prom_amount = bs*ord_prom['expression']; | |
826 | 853 | break; |
827 | 854 | } |
828 | 855 | } |
... | ... | @@ -834,6 +861,55 @@ Page({ |
834 | 861 | th.setData({ [order_prom_txt1]: order_prom_id, [order_prom_txt2]: order_prom_amount }) |
835 | 862 | } |
836 | 863 | |
864 | + //判断是否同城配送,而且没有调用过 | |
865 | + if(th.data.bn_exp_type==2 && th.data.user_addr) { | |
866 | + | |
867 | + var lon=0;var lat=0; | |
868 | + //-- 获取距离 -- | |
869 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
870 | + is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address} | |
871 | + }).then(res=>{ | |
872 | + if(res.data.code==0){ | |
873 | + var data= JSON.parse(res.data.data); | |
874 | + if(data.status==0){ | |
875 | + lon=data.result.location.lng; | |
876 | + lat=data.result.location.lat; | |
877 | + } | |
878 | + } | |
879 | + }) | |
880 | + | |
881 | + | |
882 | + var gd_w = good['weight'] * good['buynum']; | |
883 | + //-- 获取距离 -- | |
884 | + var req_data = { | |
885 | + store_id: os.stoid, | |
886 | + order_amount: parseFloat(order_m), | |
887 | + lon: lon, lat: lat, | |
888 | + pickup_id: bn_pick, | |
889 | + goods_weight: gd_w | |
890 | + } | |
891 | + | |
892 | + var is_next=1; | |
893 | + //获取同城配送参数 | |
894 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", { | |
895 | + is_json: 1, | |
896 | + data: req_data | |
897 | + }).then(res => { | |
898 | + if (res.data.code == 0) { | |
899 | + var wl_txt = "formData.shipping_price"; | |
900 | + th.setData({ [wl_txt]: res.data.data, }) | |
901 | + }else{ | |
902 | + is_next=0; | |
903 | + wx.showToast({ | |
904 | + title: res.data.msg, icon: 'none', duration: 2000 | |
905 | + }) | |
906 | + } | |
907 | + }) | |
908 | + if(!is_next) return false | |
909 | + } | |
910 | + | |
911 | + | |
912 | + | |
837 | 913 | total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); |
838 | 914 | order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); |
839 | 915 | |
... | ... | @@ -851,14 +927,14 @@ Page({ |
851 | 927 | if (th.data.bn_use_money == 1) { |
852 | 928 | if (amoney > order_m) { |
853 | 929 | order_m = parseFloat(order_m).toFixed(2); |
854 | - th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 }) | |
930 | + th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,dis_btn:0 }) | |
855 | 931 | } else { |
856 | 932 | order_m = parseFloat(order_m) - parseFloat(amoney); |
857 | 933 | order_m = order_m.toFixed(2); |
858 | - th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 }) | |
934 | + th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 }) | |
859 | 935 | } |
860 | 936 | } else { |
861 | - th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 }) | |
937 | + th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 }) | |
862 | 938 | } |
863 | 939 | //优惠活动送积分 |
864 | 940 | if (good.s_intValue) { |
... | ... | @@ -889,6 +965,52 @@ Page({ |
889 | 965 | var order_prom_txt2 = "formData.order_prom_amount"; |
890 | 966 | th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 }) |
891 | 967 | |
968 | + | |
969 | + //判断是否同城配送,而且没有调用过 | |
970 | + if(th.data.bn_exp_type==2 && th.data.user_addr) { | |
971 | + var lon=0;var lat=0; | |
972 | + //-- 获取距离 -- | |
973 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
974 | + is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address} | |
975 | + }).then(res=>{ | |
976 | + if(res.data.code==0){ | |
977 | + var data= JSON.parse(res.data.data); | |
978 | + if(data.status==0){ | |
979 | + lon=data.result.location.lng; | |
980 | + lat=data.result.location.lat; | |
981 | + } | |
982 | + } | |
983 | + }) | |
984 | + | |
985 | + var gd_w = good['weight'] * good['buynum']; | |
986 | + //-- 获取距离 -- | |
987 | + var req_data = { | |
988 | + store_id: os.stoid, | |
989 | + order_amount:parseFloat(order_m), | |
990 | + lon: lon, lat: lat, | |
991 | + pickup_id: bn_pick, | |
992 | + goods_weight: gd_w | |
993 | + } | |
994 | + | |
995 | + var is_next=1; | |
996 | + //获取同城配送参数 | |
997 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", { | |
998 | + is_json: 1, | |
999 | + data: req_data | |
1000 | + }).then(res => { | |
1001 | + if (res.data.code == 0) { | |
1002 | + var wl_txt = "formData.shipping_price"; | |
1003 | + th.setData({ [wl_txt]: res.data.data, }) | |
1004 | + }else{ | |
1005 | + is_next=0; | |
1006 | + wx.showToast({ | |
1007 | + title: res.data.msg, icon: 'none', duration: 2000 | |
1008 | + }) | |
1009 | + } | |
1010 | + }) | |
1011 | + if(!is_next) return false | |
1012 | + } | |
1013 | + | |
892 | 1014 | total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); |
893 | 1015 | order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); |
894 | 1016 | var atxt = "formData.total_amount"; |
... | ... | @@ -906,14 +1028,14 @@ Page({ |
906 | 1028 | if (th.data.bn_use_money == 1) { |
907 | 1029 | if (amoney > order_m) { |
908 | 1030 | order_m = parseFloat(order_m).toFixed(2); |
909 | - th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1 }) | |
1031 | + th.setData({ [txt]: order_m, [txt2]: 0, [txt3]: coupon_price, show_submit: 1,dis_btn:0 }) | |
910 | 1032 | } else { |
911 | 1033 | order_m = parseFloat(order_m) - parseFloat(amoney); |
912 | 1034 | order_m = order_m.toFixed(2); |
913 | - th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 }) | |
1035 | + th.setData({ [txt]: amoney, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 }) | |
914 | 1036 | } |
915 | 1037 | } else { |
916 | - th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1 }) | |
1038 | + th.setData({ [txt]: 0, [txt2]: order_m, [txt3]: coupon_price, show_submit: 1,dis_btn:0 }) | |
917 | 1039 | } |
918 | 1040 | //优惠活动送积分 |
919 | 1041 | if (good.s_intValue) { | ... | ... |
packageC/pages/presell/cart/cart2.wxml
... | ... | @@ -13,6 +13,10 @@ |
13 | 13 | |
14 | 14 | <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}" |
15 | 15 | data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view> |
16 | + <!-- 同城配送 --> | |
17 | + <block wx:if="{{show_same_city}}"> | |
18 | + <view hidden="{{bn_t_exp_t==3}}" bindtap='setexptype' data-t='2' class="tab {{bn_exp_type== 2 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">同城配送</view> | |
19 | + </block> | |
16 | 20 | |
17 | 21 | </view> |
18 | 22 | </view> |
... | ... | @@ -239,7 +243,7 @@ |
239 | 243 | <view class="pay-amount"> |
240 | 244 | <view class="payable">应付金额:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view> |
241 | 245 | </view> |
242 | - <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | |
246 | + <button disabled="{{dis_btn}}" class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | |
243 | 247 | </view> |
244 | 248 | </form> |
245 | 249 | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.js
... | ... | @@ -580,6 +580,8 @@ Page({ |
580 | 580 | } |
581 | 581 | }) |
582 | 582 | |
583 | + this.getHistoryBuy(); //获取历史购买 | |
584 | + | |
583 | 585 | ee.setData({ |
584 | 586 | gallery: gallery, |
585 | 587 | is_collect: is_collect, |
... | ... | @@ -3183,6 +3185,27 @@ Page({ |
3183 | 3185 | this.setData(ob); |
3184 | 3186 | }, |
3185 | 3187 | |
3188 | + //历史购买 | |
3189 | + getHistoryBuy() { | |
3190 | + let _this = this; | |
3191 | + let req_data = { | |
3192 | + store_id: os.stoid, | |
3193 | + goods_id: this.data.gid, | |
3194 | + pay_status: 1, | |
3195 | + rndid: 1 | |
3196 | + }; | |
3197 | + getApp().request.promiseGet('/api/weshop/ordergoods/list', { | |
3198 | + data: req_data, | |
3199 | + }) | |
3200 | + .then(res => { | |
3201 | + if (t.ajax_ok(res)) { | |
3202 | + _this.setData({ | |
3203 | + historyBuyInfo: res.data.data.pageData, | |
3204 | + }) | |
3205 | + } | |
3206 | + }) | |
3207 | +}, | |
3208 | + | |
3186 | 3209 | //--调用更新阶梯团的接口-- |
3187 | 3210 | update_jiti: function (id) { |
3188 | 3211 | var th = this; | ... | ... |
packageC/pages/presell/goodsInfo/goodsInfo.wxml
... | ... | @@ -17,21 +17,22 @@ |
17 | 17 | <view class="goods-detail"> |
18 | 18 | <view class="goods-info" hidden="{{activeCategoryId==0?false:true}}"> |
19 | 19 | |
20 | - <!-- 历史购买记录 --> | |
21 | - <view class="swiper-container"> | |
20 | + <!-- 左上角轮播 历史购买记录 --> | |
21 | + <view class="swiper-container" wx:if="{{historyBuyInfo.length}}"> | |
22 | 22 | <swiper class="swiper" autoplay="true" circular="true" vertical="true" interval="3000"> |
23 | - <swiper-item class="swiper-item" wx:for=""> | |
23 | + <swiper-item class="swiper-item" wx:for="{{historyBuyInfo}}" wx:key="order_id"> | |
24 | 24 | <view class="item"> |
25 | 25 | <view class="avatar-container"> |
26 | - <image src=""></image> | |
26 | + <image src="{{item.head_pic}}"></image> | |
27 | 27 | </view> |
28 | 28 | <view class="flex ai_c pd10"> |
29 | - <view class="nickname ellipsis-1x">abson下单成功</view> | |
29 | + <view class="nickname ellipsis-1x">{{item.nickname}}下单成功</view> | |
30 | 30 | </view> |
31 | 31 | </view> |
32 | 32 | </swiper-item> |
33 | 33 | </swiper> |
34 | 34 | </view> |
35 | + | |
35 | 36 | <!-- 视频 --> |
36 | 37 | <!-- <swiper bindchange="swiperChange"class="xc-pictures swiperContainer rel" current="{{swiperCurrent}}" |
37 | 38 | indicator-dots="{{indicatorDots}}" autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> --> | ... | ... |
packageC/pages/presell/pregoodsInfo/goodsInfo.js
... | ... | @@ -425,7 +425,7 @@ Page({ |
425 | 425 | }); |
426 | 426 | //更新点击量 |
427 | 427 | getApp().request.put("/api/weshop/goods/updateClick", { |
428 | - data: { store_id: os.stoid, goods_id: gid } | |
428 | + data: { store_id: os.stoid, goods_id: gid,user_id:getApp().globalData.user_id?getApp().globalData.user_id:0 } | |
429 | 429 | }) |
430 | 430 | }, |
431 | 431 | |
... | ... | @@ -3801,17 +3801,35 @@ Page({ |
3801 | 3801 | getApp().pre_img(this.data.shareImgPath); |
3802 | 3802 | }, |
3803 | 3803 | |
3804 | + onShareTimeline() { | |
3805 | + getApp().globalData.no_clear=1; | |
3804 | 3806 | |
3805 | - onShareTimeline() { | |
3806 | - getApp().globalData.no_clear=1; | |
3807 | - var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
3808 | - if (!store_name) | |
3809 | - store_name = getApp().globalData.setting.appName; | |
3810 | - return { | |
3811 | - title: this.data.data.goods_name + '-' + store_name, | |
3812 | - imageUrl: this.data.gallery[0].image_url, | |
3813 | - } | |
3814 | - }, | |
3807 | + var th=this; | |
3808 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
3809 | + if (!store_name) | |
3810 | + store_name = getApp().globalData.setting.appName; | |
3811 | + | |
3812 | + | |
3813 | + var url = "goods_id=" + th.data.gid+"&pre_id="+th.data.pre_arr.id; | |
3814 | + if (getApp().globalData.user_id) { | |
3815 | + url += "&first_leader=" + getApp().globalData.user_id; | |
3816 | + } | |
3817 | + | |
3818 | + //-- 如果房间分享,且不是会员分享的 -- | |
3819 | + if (getApp().globalData.room_id && | |
3820 | + th.data.data.goods_id == getApp().globalData.room_goods_id && | |
3821 | + !getApp().globalData.room_user_share | |
3822 | + ) { | |
3823 | + url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1"; | |
3824 | + } | |
3825 | + | |
3826 | + | |
3827 | + return { | |
3828 | + title: this.data.data.goods_name + '-' + store_name, | |
3829 | + imageUrl: this.data.gallery[0].image_url, | |
3830 | + query: url | |
3831 | + } | |
3832 | + }, | |
3815 | 3833 | |
3816 | 3834 | clickCollapse() { |
3817 | 3835 | this.setData({ flag: !this.data.flag, }) | ... | ... |
packageD/pages/user/deposit/prepaid/prepaid.js
... | ... | @@ -28,8 +28,17 @@ Page({ |
28 | 28 | } |
29 | 29 | } |
30 | 30 | }); |
31 | - | |
32 | - this.yuck(); | |
31 | + | |
32 | + if(getApp().globalData.user_id){ | |
33 | + this.yuck(); | |
34 | + } | |
35 | + else{ | |
36 | + wx.showToast({ title: "您还未登陆,请先授权", icon: 'none', duration: 2000 }) | |
37 | + setTimeout(function () { | |
38 | + getApp().goto("/pages/togoin/togoin"); | |
39 | + },1200) | |
40 | + } | |
41 | + | |
33 | 42 | }, |
34 | 43 | /*预存款的劵*/ |
35 | 44 | async yuck() { |
... | ... | @@ -49,7 +58,7 @@ Page({ |
49 | 58 | // var perpaid = res.data.data; |
50 | 59 | console.log( "是什么", perpaids); |
51 | 60 | e.setData({ |
52 | - perpaid: perpaids | |
61 | + perpaid: perpaids,is_get:1 | |
53 | 62 | }); |
54 | 63 | }) |
55 | 64 | |
... | ... | @@ -85,6 +94,11 @@ Page({ |
85 | 94 | wx.setNavigationBarTitle({ |
86 | 95 | title: "流动资金转预存", |
87 | 96 | }) |
97 | + | |
98 | + if(getApp().globalData.user_id && !this.data.is_get){ | |
99 | + this.yuck(); | |
100 | + } | |
101 | + | |
88 | 102 | }, |
89 | 103 | //确定充值 |
90 | 104 | determine: function(e) { | ... | ... |
pages/activity/pind_list/pind_list.js
... | ... | @@ -249,15 +249,20 @@ Page({ |
249 | 249 | } |
250 | 250 | }, |
251 | 251 | |
252 | - onShareTimeline() { | |
253 | - getApp().globalData.no_clear=1; | |
254 | - var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
255 | - if (!store_name) | |
256 | - store_name = getApp().globalData.setting.appName; | |
257 | - return { | |
258 | - title: '秒杀活动-' + store_name, | |
259 | - } | |
260 | - }, | |
252 | + onShareTimeline() { | |
253 | + getApp().globalData.no_clear=1; | |
254 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
255 | + if (!store_name) | |
256 | + store_name = getApp().globalData.setting.appName; | |
257 | + var user_id=getApp().globalData.user_id; | |
258 | + if(!user_id) user_id=0; | |
259 | + return { | |
260 | + title: '拼团活动-' + store_name, | |
261 | + query: 'first_leader='+user_id | |
262 | + | |
263 | + } | |
264 | + }, | |
265 | + | |
261 | 266 | go_url(e){ |
262 | 267 | let url=e.currentTarget.dataset.url; |
263 | 268 | if(url){ | ... | ... |
pages/activity/seckill_list/seckill_list.js
... | ... | @@ -267,15 +267,20 @@ Page({ |
267 | 267 | } |
268 | 268 | }, |
269 | 269 | |
270 | - onShareTimeline() { | |
271 | - getApp().globalData.no_clear=1; | |
272 | - var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
273 | - if (!store_name) | |
274 | - store_name = getApp().globalData.setting.appName; | |
275 | - return { | |
276 | - title: '秒杀活动-' + store_name, | |
277 | - } | |
278 | - }, | |
270 | + onShareTimeline() { | |
271 | + getApp().globalData.no_clear=1; | |
272 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
273 | + if (!store_name) | |
274 | + store_name = getApp().globalData.setting.appName; | |
275 | + | |
276 | + var user_id=getApp().globalData.user_id; | |
277 | + if(!user_id) user_id=0; | |
278 | + | |
279 | + return { | |
280 | + title: '秒杀活动-' + store_name, | |
281 | + query: 'first_leader='+user_id | |
282 | + } | |
283 | + }, | |
279 | 284 | |
280 | 285 | imageLoad: function (e) { |
281 | 286 | var imgwidth = e.detail.width; | ... | ... |
pages/cart/cart2/cart2.js
... | ... | @@ -180,7 +180,6 @@ Page({ |
180 | 180 | //----------子页返回父页触发---------- |
181 | 181 | onShow: function () { |
182 | 182 | var th = this; |
183 | - th.setData({ show_submit: 0 }); //让提交先掩藏 | |
184 | 183 | th.data.g_cart_q_time = null; |
185 | 184 | |
186 | 185 | if (th.data.isclose == 0) { |
... | ... | @@ -243,12 +242,14 @@ Page({ |
243 | 242 | th.data.json_d = json_d; |
244 | 243 | th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 |
245 | 244 | var is_default_logistics = json_d.is_default_logistics; |
245 | + var is_same_city = json_d.is_same_city; | |
246 | 246 | |
247 | 247 | th.setData({ |
248 | 248 | is_close_quan: json_d.is_close_quan, |
249 | 249 | sales_rules: ee.sales_rules, |
250 | 250 | rank_switch: json_d.rank_switch, |
251 | - is_default_logistics: is_default_logistics | |
251 | + is_default_logistics: is_default_logistics, | |
252 | + is_same_city: is_same_city, | |
252 | 253 | }); |
253 | 254 | |
254 | 255 | var rank_switch = json_d.rank_switch; |
... | ... | @@ -369,23 +370,20 @@ Page({ |
369 | 370 | th.setData({ user_addr: addr }); |
370 | 371 | //--------------------------立即购买------------------ |
371 | 372 | if (ta.is_bnow == 1) { |
372 | - console.log('is_bnow'); | |
373 | 373 | //读取门店 |
374 | - to.get_allsto(function (e) { | |
375 | - th.setData({ allsto: e }); | |
374 | + //to.get_allsto(function (e) { | |
375 | + //th.setData({ allsto: e }); | |
376 | 376 | //获取立即购买的商品信息 |
377 | 377 | th.get_buy_goods(ta.goods_id); |
378 | - }); | |
378 | + //}); | |
379 | 379 | } else { |
380 | 380 | //------------------------购物车结算---------------------- |
381 | 381 | //读取门店 |
382 | - to.get_allsto(function (e) { | |
383 | - th.setData({ allsto: e }); | |
384 | - //-------获取购物车已经选择的商品-------- | |
385 | - console.log('购物车结算'); | |
386 | - | |
382 | + //to.get_allsto(function (e) { | |
383 | + //th.setData({ allsto: e }); | |
384 | + //-------获取购物车已经选择的商品-------- | |
387 | 385 | th.get_cart(); |
388 | - }) | |
386 | + //}) | |
389 | 387 | } |
390 | 388 | }); |
391 | 389 | |
... | ... | @@ -421,6 +419,25 @@ Page({ |
421 | 419 | //按门店分类的数组 |
422 | 420 | var arr = new Array(); |
423 | 421 | var carr = su.data.data.pageData; |
422 | + | |
423 | + th.setData({ is_all_zt: 1 }); | |
424 | + | |
425 | + //-- 找出所有的门店 -- | |
426 | + var pick_id_arr=[]; var len=carr.length; | |
427 | + for(var i=0;i<len;i++){ | |
428 | + if(pick_id_arr.length==0 || pick_id_arr.indexOf(carr[i].pick_id)==-1) | |
429 | + pick_id_arr.push(carr[i].pick_id); | |
430 | + } | |
431 | + var req_d={ | |
432 | + store_id:os.stoid,ids:pick_id_arr.join(',') | |
433 | + } | |
434 | + //-- 获取门店的列表 -- | |
435 | + await getApp().request.promiseGet("/api/weshop/pickup/list", {data:req_d }).then(res=>{ | |
436 | + if(ut.ajax_ok(res)){ | |
437 | + th.data.allsto=res.data.data.pageData; | |
438 | + } | |
439 | + }) | |
440 | + | |
424 | 441 | th.data.cartlist_y = carr; //存储原始购物车列表 |
425 | 442 | th.data.in_zhact_gdmap = {}; |
426 | 443 | |
... | ... | @@ -629,7 +646,7 @@ Page({ |
629 | 646 | } |
630 | 647 | arr[j].exp_type = e_t; |
631 | 648 | if (e_t == 0) th.setData({ is_all_zt: 0 }); |
632 | - else if (e_t == 1) th.setData({ is_all_zt: 1 }); | |
649 | + //else if (e_t == 1) th.setData({ is_all_zt: 1 }); | |
633 | 650 | } |
634 | 651 | |
635 | 652 | //-- 把等级卡会优惠多少钱装进去 -- |
... | ... | @@ -673,7 +690,7 @@ Page({ |
673 | 690 | } |
674 | 691 | //如果是物流的话,全部自提的控制要弄成0 |
675 | 692 | if (e_t == 0) th.setData({ is_all_zt: 0 }); |
676 | - else th.setData({ is_all_zt: 1 }); | |
693 | + //else th.setData({ is_all_zt: 1 }); | |
677 | 694 | |
678 | 695 | var narr = new Array(); |
679 | 696 | narr.push(car_item); |
... | ... | @@ -702,13 +719,13 @@ Page({ |
702 | 719 | user_money: 0, |
703 | 720 | total_amount: 0, |
704 | 721 | order_amount: 0, |
705 | - user_note: "" | |
722 | + user_note: "", | |
723 | + sto:sto | |
706 | 724 | }; |
707 | 725 | |
708 | 726 | //-- 把等级卡会优惠多少钱装进去 -- |
709 | 727 | if (car_item.cut_price1) ie.card_cut_price += car_item.cut_price1; |
710 | 728 | arr.push(ie); |
711 | - | |
712 | 729 | } |
713 | 730 | } |
714 | 731 | //-- 如果是回退回来的情况 -- |
... | ... | @@ -721,8 +738,7 @@ Page({ |
721 | 738 | ie.wind = parseInt(th.data.cartlist[kj].wind); |
722 | 739 | |
723 | 740 | //-- 是不是全部自提清空 -- |
724 | - if (ie.exp_type == 0) th.setData({ is_all_zt: 0 }); | |
725 | - | |
741 | + if (ie.exp_type == 0 || ie.exp_type == 2) th.setData({ is_all_zt: 0 }); | |
726 | 742 | break; |
727 | 743 | } |
728 | 744 | } |
... | ... | @@ -788,11 +804,26 @@ Page({ |
788 | 804 | ladder_calc.fir_set_arr(u_item, th); |
789 | 805 | } |
790 | 806 | |
807 | + | |
808 | + | |
809 | + //----- 判断每一个商品的配送方式,和门店的配送方式 ------- | |
810 | + for(var ik=0;ik<arr.length;ik++){ | |
811 | + if(!arr[ik].sto.is_same_city) continue; | |
812 | + var fd=arr[ik].goods.filter(function (e) { | |
813 | + return e.is_same_city!=1 || e.whsle_id>0 | |
814 | + }) | |
815 | + if(!fd || fd.length==0){ | |
816 | + arr[ik].show_same_city=1; | |
817 | + th.setData({is_all_zt:0}) | |
818 | + } | |
819 | + } | |
820 | + | |
791 | 821 | //深拷贝 |
792 | 822 | th.data.old_cartlist = JSON.parse(JSON.stringify(arr)); |
793 | 823 | th.setData({ |
794 | 824 | cartlist: arr, |
795 | 825 | }); |
826 | + | |
796 | 827 | //--- 获取一下看有没有优惠券 ---- |
797 | 828 | setTimeout(function () { |
798 | 829 | var frozenQuan = null; |
... | ... | @@ -823,6 +854,21 @@ Page({ |
823 | 854 | var gd = t.data.data; |
824 | 855 | if (!gd) return false; |
825 | 856 | |
857 | + //-- 如果商品有同城配送的参数的时候,一件代发商品不能显示同城配送按钮 -- | |
858 | + if(gd.is_same_city && th.data.is_same_city && gd.whsle_id<=0){ | |
859 | + | |
860 | + await getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+gg.pick_id, {}).then(res=>{ | |
861 | + if(res.data.code==0){ | |
862 | + var pk=res.data.data; | |
863 | + if(pk && pk.is_same_city){ | |
864 | + th.setData({show_same_city:1}) | |
865 | + } | |
866 | + } | |
867 | + | |
868 | + }) | |
869 | + | |
870 | + } | |
871 | + | |
826 | 872 | t.data.data.original_img = oo.imghost + t.data.data.original_img; |
827 | 873 | t.data.data['buynum'] = gg.goods_num; |
828 | 874 | var distr_t = 0, et = 0 |
... | ... | @@ -972,7 +1018,6 @@ Page({ |
972 | 1018 | if (gg.prom_type == 5) { |
973 | 1019 | t.data.data.prom_id = gg.prom_id; |
974 | 1020 | t.data.data.prom_type = 5; |
975 | - // console.log('xxxxxxxxxxxxxxxxxx', gg.is_coupon) | |
976 | 1021 | th.is_coupon = gg.is_coupon; |
977 | 1022 | th.setData({ |
978 | 1023 | is_coupon: gg.is_coupon |
... | ... | @@ -1006,6 +1051,12 @@ Page({ |
1006 | 1051 | if (dis_t > 0) { |
1007 | 1052 | distr_t = dis_t; |
1008 | 1053 | } |
1054 | + | |
1055 | + //-- 如果有一件代发的商品或者不是同城配送的配送 -- | |
1056 | + if(narr[hi].is_same_city!=1 || narr[hi].whsle_id>0){ | |
1057 | + th.setData({show_same_city:0}) | |
1058 | + } | |
1059 | + | |
1009 | 1060 | } |
1010 | 1061 | //自选的时候,系统配置了默认的配送方式是物流的时候 |
1011 | 1062 | if (distr_t == 0 && th.data.json_d.pickupway && th.data.json_d.pickupway == 1) { |
... | ... | @@ -1464,7 +1515,7 @@ Page({ |
1464 | 1515 | }, |
1465 | 1516 | |
1466 | 1517 | //-------------------计算订单价格------------------- |
1467 | - calculatePrice:async function (t, s) { | |
1518 | + calculatePrice:async function (qfunc) { | |
1468 | 1519 | var th = this; |
1469 | 1520 | th.setData({submit:1}); |
1470 | 1521 | |
... | ... | @@ -1516,6 +1567,9 @@ Page({ |
1516 | 1567 | |
1517 | 1568 | await th.get_cart_quan(c_arr); |
1518 | 1569 | |
1570 | + | |
1571 | + //-- 经纬度不循环调用接口 -- | |
1572 | + var lon=0; var lat=0; | |
1519 | 1573 | //---循环购物车--- |
1520 | 1574 | for (var i in c_arr) { |
1521 | 1575 | //因为搭配购买也是再这里计算,搭配购的is_b_now==1 |
... | ... | @@ -1526,13 +1580,14 @@ Page({ |
1526 | 1580 | if (th.data.cartlist[i].check_quan_price_list) c_arr[i].check_quan_price_list = th.data.cartlist[i].check_quan_price_list; //优惠券优惠什么商品价格 |
1527 | 1581 | if (th.data.cartlist[i].check_quan_ware_list) c_arr[i].check_quan_ware_list = th.data.cartlist[i].check_quan_ware_list; //优惠券优惠什么商品 |
1528 | 1582 | } else { |
1529 | - c_arr[i].exp_type = th.data.bn_exp_type; //配送方式 | |
1530 | - c_arr[i].wind = th.data.index; //立即购买选择的物流 | |
1583 | + c_arr[i].exp_type = th.data.bn_exp_type; //配送方式 | |
1584 | + c_arr[i].wind = th.data.index; //立即购买选择的物流 | |
1531 | 1585 | //c_arr[i].=th.data. //立即购买的使用余额 |
1532 | 1586 | if (th.data.cartlist) c_arr[i].check_quan_price_list = th.data.cartlist[i].check_quan_price_list; //优惠券优惠什么商品价格 |
1533 | 1587 | if (th.data.cartlist) c_arr[i].check_quan_ware_list = th.data.cartlist[i].check_quan_ware_list; //优惠券优惠什么商品 |
1534 | 1588 | } |
1535 | 1589 | |
1590 | + | |
1536 | 1591 | var cart_item = c_arr[i]; //就是每一单的意思 |
1537 | 1592 | var pickid = cart_item.pickup_id; |
1538 | 1593 | var o_price = 0; |
... | ... | @@ -1766,8 +1821,9 @@ Page({ |
1766 | 1821 | } |
1767 | 1822 | |
1768 | 1823 | if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item[j].goods_id) == -1)) { |
1769 | - if (goods_weight < 0) goods_weight = 0; | |
1824 | + | |
1770 | 1825 | if (item[j]['exp_sum_type'] == 2) { |
1826 | + if (goods_weight < 0) goods_weight = 0; | |
1771 | 1827 | cut_good_weight += item[j]['weight'] * item[j]['goods_num']; |
1772 | 1828 | goods_weight += item[j]['weight'] * item[j]['goods_num']; |
1773 | 1829 | } |
... | ... | @@ -1847,7 +1903,7 @@ Page({ |
1847 | 1903 | if (!th.data.using_quan[pickid] || th.data.using_quan[pickid].isby != 1) { |
1848 | 1904 | if (cart_item.shipping_price == 0) th.data.is_by[pickid] = 1; //已经全场包邮,就不要选择券了 |
1849 | 1905 | } |
1850 | - } else { | |
1906 | + } else if(cart_item.exp_type==1) { | |
1851 | 1907 | cart_item.shipping_price = 0; |
1852 | 1908 | } |
1853 | 1909 | |
... | ... | @@ -1859,11 +1915,13 @@ Page({ |
1859 | 1915 | var order_prom_amount = 0; |
1860 | 1916 | var order_prom_id = 0; |
1861 | 1917 | var o_condition = cart_item.order_amount; |
1918 | + var t_o_condition=cart_item.order_amount; | |
1919 | + | |
1920 | + | |
1862 | 1921 | //看一下是不是不用组合购的订单优惠的叠加 |
1863 | 1922 | if (is_has_zh) { |
1864 | 1923 | o_condition = o_price_no_zh - quan_price; |
1865 | 1924 | } |
1866 | - | |
1867 | 1925 | //看一下是不是不用组合购的订单优惠的叠加 |
1868 | 1926 | if (is_has_ladder) { |
1869 | 1927 | o_condition = o_price_no_zh - quan_price; |
... | ... | @@ -1871,8 +1929,11 @@ Page({ |
1871 | 1929 | |
1872 | 1930 | if(whsle_goods_price>0){ |
1873 | 1931 | o_condition=o_condition-whsle_goods_price; |
1932 | + t_o_condition=t_o_condition-whsle_goods_price; | |
1874 | 1933 | } |
1875 | 1934 | |
1935 | + | |
1936 | + | |
1876 | 1937 | var order_m = 0; |
1877 | 1938 | //---判断是不是有订单优惠--- |
1878 | 1939 | await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", { |
... | ... | @@ -1914,6 +1975,62 @@ Page({ |
1914 | 1975 | coupon_price = o_price; |
1915 | 1976 | } |
1916 | 1977 | |
1978 | + | |
1979 | + //-- 在选择到同城配送的时候 -- | |
1980 | + if(c_arr[i].exp_type==2 && th.data.user_addr){ | |
1981 | + | |
1982 | + var gd_w=0; | |
1983 | + for (let ib in c_arr[i].goods) { | |
1984 | + let item_bb = c_arr[i].goods[ib]; | |
1985 | + gd_w += item_bb['weight'] * item_bb['goods_num']; | |
1986 | + } | |
1987 | + | |
1988 | + if(!lon) { | |
1989 | + //-- 获取距离 -- | |
1990 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
1991 | + is_json: 1, data: {address: th.data.user_addr.more_address + th.data.user_addr.address} | |
1992 | + }).then(res => { | |
1993 | + if (res.data.code == 0) { | |
1994 | + var data = JSON.parse(res.data.data); | |
1995 | + if (data.status == 0) { | |
1996 | + lon = data.result.location.lng; | |
1997 | + lat = data.result.location.lat; | |
1998 | + } | |
1999 | + } | |
2000 | + }) | |
2001 | + } | |
2002 | + | |
2003 | + | |
2004 | + var req_data={ | |
2005 | + store_id:os.stoid, order_amount: parseFloat(cart_item.order_amount), | |
2006 | + lon:lon,lat:lat, pickup_id:c_arr[i].pickup_id, goods_weight:gd_w | |
2007 | + } | |
2008 | + var is_next=1; | |
2009 | + | |
2010 | + //获取同城配送参数 | |
2011 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {is_json:1,data:req_data}).then(res=>{ | |
2012 | + if(res.data.code==0){ | |
2013 | + cart_item.shipping_price = res.data.data; | |
2014 | + }else{ | |
2015 | + is_next=0; | |
2016 | + | |
2017 | + if(qfunc) qfunc(); | |
2018 | + else{ | |
2019 | + wx.showToast({ | |
2020 | + title: res.data.msg, | |
2021 | + icon: 'none', | |
2022 | + duration: 2000 | |
2023 | + }) | |
2024 | + } | |
2025 | + } | |
2026 | + }) | |
2027 | + if(!is_next) return false | |
2028 | + } | |
2029 | + | |
2030 | + | |
2031 | + | |
2032 | + | |
2033 | + | |
1917 | 2034 | cart_item.total_amount = parseFloat(cart_item.total_amount) + parseFloat(cart_item.shipping_price); //总金额 |
1918 | 2035 | cart_item.order_amount = parseFloat(cart_item.order_amount) + parseFloat(cart_item.shipping_price); //总金额 |
1919 | 2036 | cart_item.total_amount = cart_item.total_amount.toFixed(2); |
... | ... | @@ -2020,7 +2137,7 @@ Page({ |
2020 | 2137 | } |
2021 | 2138 | //-- 包邮券 -- |
2022 | 2139 | var by_quan = th.data.get_by_quan_list_cart[pkid]; |
2023 | - if (by_quan) { | |
2140 | + if (by_quan && c_item.exp_type==0) { | |
2024 | 2141 | for (var iter2 in by_quan) { |
2025 | 2142 | //判断是不是其他订单有选用 |
2026 | 2143 | var is_other_is_use = th.check_other_use_by(by_quan[iter2], pkid); |
... | ... | @@ -2034,7 +2151,7 @@ Page({ |
2034 | 2151 | |
2035 | 2152 | |
2036 | 2153 | //---------计算立即购买---------- |
2037 | - calculatePrice2: async function () { | |
2154 | + calculatePrice2: async function (qfunc) { | |
2038 | 2155 | var th = this, good = this.data.bn_goods; |
2039 | 2156 | |
2040 | 2157 | if (!good) return false; |
... | ... | @@ -2050,6 +2167,7 @@ Page({ |
2050 | 2167 | title: "处理中.", |
2051 | 2168 | mask:true |
2052 | 2169 | }) |
2170 | + | |
2053 | 2171 | //-----------计算商品总价-------------- |
2054 | 2172 | var allpice = good.shop_price * good.buynum; |
2055 | 2173 | var cut_price = 0; |
... | ... | @@ -2205,8 +2323,8 @@ Page({ |
2205 | 2323 | |
2206 | 2324 | if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { |
2207 | 2325 | |
2208 | - if (goods_weight < 0) goods_weight = 0; | |
2209 | 2326 | if (item['exp_sum_type'] == 2) { |
2327 | + if (goods_weight < 0) goods_weight = 0; | |
2210 | 2328 | goods_weight += item['weight'] * item['buynum']; |
2211 | 2329 | cut_good_weight += item['weight'] * item['buynum']; |
2212 | 2330 | } |
... | ... | @@ -2293,7 +2411,7 @@ Page({ |
2293 | 2411 | var wl_txt = "formData.shipping_price"; |
2294 | 2412 | th.setData({[wl_txt]: shipping_price,}) |
2295 | 2413 | |
2296 | - } else { | |
2414 | + } else if(th.data.bn_exp_type == 1 ) { | |
2297 | 2415 | var wl_txt = "formData.shipping_price"; |
2298 | 2416 | th.setData({ [wl_txt]: 0, }) |
2299 | 2417 | } |
... | ... | @@ -2318,9 +2436,8 @@ Page({ |
2318 | 2436 | if(th.data.bn_goods.whsle_id>0){ |
2319 | 2437 | o_condition=0; |
2320 | 2438 | } |
2321 | - | |
2322 | 2439 | if (o_condition > 0) { |
2323 | - th.check_is_order_prom(o_condition, function () { | |
2440 | + th.check_is_order_prom(o_condition,async function () { | |
2324 | 2441 | var order_prom_amount = 0; |
2325 | 2442 | var order_prom_id = 0; |
2326 | 2443 | if (th.data.order_prom[th.data.bn_pick] && th.data.order_prom[th.data.bn_pick]['money'] <= o_condition) { |
... | ... | @@ -2355,6 +2472,60 @@ Page({ |
2355 | 2472 | th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 }) |
2356 | 2473 | } |
2357 | 2474 | |
2475 | + //判断是否同城配送,而且没有调用过 | |
2476 | + if(th.data.bn_exp_type==2 && th.data.user_addr) { | |
2477 | + var gd_w = 0, lon = 0, lat = 0; | |
2478 | + for (let ib in gd_arr_list) { | |
2479 | + let item_b = gd_arr_list[ib]; | |
2480 | + gd_w += item_b['weight'] * item_b['buynum']; | |
2481 | + } | |
2482 | + | |
2483 | + //-- 获取距离 -- | |
2484 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
2485 | + is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address} | |
2486 | + }).then(res=>{ | |
2487 | + if(res.data.code==0){ | |
2488 | + var data= JSON.parse(res.data.data); | |
2489 | + if(data.status==0){ | |
2490 | + lon=data.result.location.lng; | |
2491 | + lat=data.result.location.lat; | |
2492 | + } | |
2493 | + } | |
2494 | + }) | |
2495 | + | |
2496 | + var req_data = { | |
2497 | + store_id: os.stoid, order_amount: parseFloat(order_m), | |
2498 | + lon: lon, lat: lat, pickup_id: bn_pick,goods_weight: gd_w | |
2499 | + } | |
2500 | + | |
2501 | + var is_next=1; | |
2502 | + | |
2503 | + //获取同城配送参数 | |
2504 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", { | |
2505 | + is_json: 1,data: req_data | |
2506 | + }).then(res => { | |
2507 | + if (res.data.code == 0) { | |
2508 | + var wl_txt = "formData.shipping_price"; | |
2509 | + th.setData({ [wl_txt]: res.data.data, }) | |
2510 | + | |
2511 | + }else{ | |
2512 | + is_next=0; | |
2513 | + if(qfunc){ | |
2514 | + qfunc(); | |
2515 | + }else{ | |
2516 | + wx.showToast({ | |
2517 | + title: res.data.msg, | |
2518 | + icon: 'none', | |
2519 | + duration: 2000 | |
2520 | + }) | |
2521 | + } | |
2522 | + | |
2523 | + } | |
2524 | + }) | |
2525 | + if(!is_next) return false | |
2526 | + } | |
2527 | + | |
2528 | + | |
2358 | 2529 | total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); |
2359 | 2530 | order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); |
2360 | 2531 | |
... | ... | @@ -2421,6 +2592,59 @@ Page({ |
2421 | 2592 | var order_prom_txt2 = "formData.order_prom_amount"; |
2422 | 2593 | th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 }) |
2423 | 2594 | |
2595 | + //判断是否同城配送,而且没有调用过 | |
2596 | + if(th.data.bn_exp_type==2 && th.data.user_addr) { | |
2597 | + var gd_w = 0, lon = 0, lat = 0; | |
2598 | + for (let ib in gd_arr_list) { | |
2599 | + let item_b = gd_arr_list[ib]; | |
2600 | + gd_w += item_b['weight'] * item_b['buynum']; | |
2601 | + } | |
2602 | + | |
2603 | + //-- 获取距离 -- | |
2604 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
2605 | + is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address} | |
2606 | + }).then(res=>{ | |
2607 | + if(res.data.code==0){ | |
2608 | + var data= JSON.parse(res.data.data); | |
2609 | + if(data.status==0){ | |
2610 | + lon=data.result.location.lng; | |
2611 | + lat=data.result.location.lat; | |
2612 | + } | |
2613 | + } | |
2614 | + }) | |
2615 | + | |
2616 | + var req_data = { | |
2617 | + store_id: os.stoid, order_amount: parseFloat(order_m), | |
2618 | + lon: lon, lat: lat, pickup_id: bn_pick,goods_weight: gd_w | |
2619 | + } | |
2620 | + | |
2621 | + var is_next=1; | |
2622 | + | |
2623 | + //获取同城配送参数 | |
2624 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", { | |
2625 | + is_json: 1,data: req_data | |
2626 | + }).then(res => { | |
2627 | + if (res.data.code == 0) { | |
2628 | + var wl_txt = "formData.shipping_price"; | |
2629 | + th.setData({ [wl_txt]: res.data.data, }) | |
2630 | + | |
2631 | + }else{ | |
2632 | + is_next=0; | |
2633 | + if(qfunc){ | |
2634 | + qfunc(); | |
2635 | + }else{ | |
2636 | + wx.showToast({ | |
2637 | + title: res.data.msg, | |
2638 | + icon: 'none', | |
2639 | + duration: 2000 | |
2640 | + }) | |
2641 | + } | |
2642 | + | |
2643 | + } | |
2644 | + }) | |
2645 | + if(!is_next) return false | |
2646 | + } | |
2647 | + | |
2424 | 2648 | |
2425 | 2649 | total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); |
2426 | 2650 | order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); |
... | ... | @@ -2520,6 +2744,10 @@ Page({ |
2520 | 2744 | |
2521 | 2745 | //--------------------提交订单----------------------- |
2522 | 2746 | async submit_func() { |
2747 | + | |
2748 | + if(this.data.is_summit_ing) return false; | |
2749 | + this.data.is_summit_ing = 1; | |
2750 | + | |
2523 | 2751 | var th = this, pdata = new Array(); |
2524 | 2752 | var ff = true; |
2525 | 2753 | //------------立即购买------------- |
... | ... | @@ -3119,6 +3347,7 @@ Page({ |
3119 | 3347 | |
3120 | 3348 | |
3121 | 3349 | wx.showLoading({ title: "加载中" }); |
3350 | + th.setData({ submit: 1,}) | |
3122 | 3351 | wx.request({ |
3123 | 3352 | url: oo.url + '/api/weshop/order/createWxdOrder', |
3124 | 3353 | data: str, |
... | ... | @@ -3131,7 +3360,7 @@ Page({ |
3131 | 3360 | if (res.statusCode == 200) { |
3132 | 3361 | var data = res.data; |
3133 | 3362 | if (data.code == 0) { |
3134 | - console.log(th.data.is_b_now); | |
3363 | + th.setData({ submit: 1,}) | |
3135 | 3364 | //如果是购物车结算,还要删除购物车 |
3136 | 3365 | if (th.data.is_b_now == 0) { |
3137 | 3366 | console.log(th.data.cartlist_y); |
... | ... | @@ -3221,24 +3450,31 @@ Page({ |
3221 | 3450 | } |
3222 | 3451 | }) |
3223 | 3452 | return; |
3453 | + }else{ | |
3454 | + if (msg.length > 13) { | |
3455 | + msg = msg.slice(0, 13) + "\r\n" + msg.slice(13); | |
3456 | + } | |
3457 | + getApp().confirmBox(msg); | |
3458 | + th.data.is_summit_ing = 0; //是否提交中 | |
3459 | + th.setData({ | |
3460 | + submit: 0, | |
3461 | + }) | |
3224 | 3462 | } |
3225 | - if (msg.length > 13) { | |
3226 | - msg = msg.slice(0, 13) + "\r\n" + msg.slice(13); | |
3227 | - } | |
3228 | - getApp().confirmBox(msg); | |
3229 | - th.data.is_summit_ing = 0; //是否提交中 | |
3463 | + | |
3464 | + | |
3230 | 3465 | } |
3231 | 3466 | } else { |
3232 | 3467 | th.data.is_summit_ing = 0; //是否提交中 |
3233 | 3468 | console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); |
3469 | + th.setData({ | |
3470 | + submit: 0, | |
3471 | + }) | |
3234 | 3472 | } |
3235 | 3473 | }, |
3236 | 3474 | fail: function () { |
3237 | 3475 | th.data.is_summit_ing = 0; |
3238 | 3476 | wx.hideLoading(); |
3239 | 3477 | console.log("index.js wx.request CheckCallUser fail"); |
3240 | - }, | |
3241 | - complete: function () { | |
3242 | 3478 | th.setData({ |
3243 | 3479 | submit: 0, |
3244 | 3480 | }) |
... | ... | @@ -3326,7 +3562,7 @@ Page({ |
3326 | 3562 | } else { |
3327 | 3563 | for (var i = 0; i < th.data.cartlist.length; i++) { |
3328 | 3564 | var item = th.data.cartlist[i]; |
3329 | - if (item.exp_type == 0) { | |
3565 | + if (item.exp_type == 0 || item.exp_type==2 ) { | |
3330 | 3566 | iszt = 0; |
3331 | 3567 | break; |
3332 | 3568 | } |
... | ... | @@ -3751,8 +3987,11 @@ Page({ |
3751 | 3987 | }, |
3752 | 3988 | |
3753 | 3989 | //----把券插入之后的操作,同时还要重新计算价格---- |
3754 | - insert_into_using_quan: function (item, using_quan, pickid, isby) { | |
3990 | + insert_into_using_quan:async function (item, using_quan, pickid, isby) { | |
3991 | + | |
3992 | + | |
3755 | 3993 | var th = this; |
3994 | + var old_quan=null; | |
3756 | 3995 | if (isby == 1) { |
3757 | 3996 | using_quan[pickid] = { |
3758 | 3997 | coupon_no: item.no, |
... | ... | @@ -3763,14 +4002,35 @@ Page({ |
3763 | 4002 | }; |
3764 | 4003 | using_quan[pickid].isby = 1; |
3765 | 4004 | } else { |
4005 | + if(using_quan[pickid]) old_quan=using_quan[pickid]; | |
3766 | 4006 | using_quan[pickid] = { coupon_no: item.CashRepNo, money: item.Sum, is_nouse_red: 0 }; |
3767 | 4007 | using_quan[pickid].isby = 0; |
3768 | 4008 | } |
3769 | 4009 | this.setData({ using_quan: using_quan }); |
3770 | 4010 | if (th.data.is_b_now == 1) { |
3771 | - th.calculatePrice2(); | |
4011 | + th.calculatePrice2(function () { | |
4012 | + | |
4013 | + if(old_quan) using_quan[pickid]=old_quan; | |
4014 | + else using_quan[pickid]=null; | |
4015 | + th.setData({ using_quan: using_quan,submit:0 }); | |
4016 | + wx.showToast({ | |
4017 | + title: "不能使用优惠券,同城起送价不足", | |
4018 | + icon: 'none', | |
4019 | + duration: 2000 | |
4020 | + }) | |
4021 | + | |
4022 | + }); | |
3772 | 4023 | } else { |
3773 | - th.calculatePrice(); | |
4024 | + th.calculatePrice(function () { | |
4025 | + if(old_quan) using_quan[pickid]=old_quan; | |
4026 | + else using_quan[pickid]=null; | |
4027 | + th.setData({ using_quan: using_quan ,submit:0 }); | |
4028 | + wx.showToast({ | |
4029 | + title: "不能使用优惠券,同城起送价不足", | |
4030 | + icon: 'none', | |
4031 | + duration: 2000 | |
4032 | + }) | |
4033 | + }); | |
3774 | 4034 | } |
3775 | 4035 | th.setData({ open_quan: 0 }); |
3776 | 4036 | }, |
... | ... | @@ -4611,15 +4871,9 @@ Page({ |
4611 | 4871 | tmplIds: [template_id], |
4612 | 4872 | success(res) { |
4613 | 4873 | func(); |
4614 | - th.setData({ | |
4615 | - submit: 0, | |
4616 | - }) | |
4617 | 4874 | }, |
4618 | 4875 | fail(res) { |
4619 | 4876 | func(); |
4620 | - th.setData({ | |
4621 | - submit: 0, | |
4622 | - }) | |
4623 | 4877 | } |
4624 | 4878 | }) |
4625 | 4879 | ... | ... |
pages/cart/cart2/cart2.wxml
... | ... | @@ -13,6 +13,11 @@ |
13 | 13 | |
14 | 14 | <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype2' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">快递邮寄</view> |
15 | 15 | |
16 | + <!-- 同城配送 --> | |
17 | + <block wx:if="{{show_same_city}}"> | |
18 | + <view hidden="{{bn_t_exp_t==3}}" bindtap='setexptype2' data-t='2' class="tab {{bn_exp_type== 2 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">同城配送</view> | |
19 | + </block> | |
20 | + | |
16 | 21 | </view> |
17 | 22 | </view> |
18 | 23 | </block> |
... | ... | @@ -24,13 +29,18 @@ |
24 | 29 | |
25 | 30 | <view hidden="{{cartlist[0].distr_t==1}}" bindtap='setexptype_w2' data-ind="0" data-t='0' class="tab {{cartlist[0].exp_type== 0 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">快递邮寄</view> |
26 | 31 | |
32 | + <!-- 判断能不能显示同城配送 --> | |
33 | + <block wx:if="{{cartlist[0].show_same_city}}"> | |
34 | + <view hidden="{{cartlist[0].distr_t==3}}" bindtap='setexptype_w2' data-ind="0" data-t='2' class="tab {{cartlist[0].exp_type== 2 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">同城配送</view> | |
35 | + </block> | |
36 | + | |
27 | 37 | </view> |
28 | 38 | </view> |
29 | 39 | </block> |
30 | 40 | </block> |
31 | 41 | |
32 | 42 | <!--要进行判断地址是否显示----> |
33 | - <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'> | |
43 | + <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0 )}}'> | |
34 | 44 | <!---默认地址显示------> |
35 | 45 | <block wx:if="{{user_addr!=null}}"> |
36 | 46 | |
... | ... | @@ -135,7 +145,7 @@ |
135 | 145 | |
136 | 146 | <block wx:if="{{item.exp_type==1}}"> |
137 | 147 | <!-- <view class="circle white xc-hookt fs20 red-b sn"><text>Γ</text></view> --> |
138 | - <icon data-t='0' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | |
148 | + <icon data-t='1' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | |
139 | 149 | </block> |
140 | 150 | <block wx:else> |
141 | 151 | <view class="circle xc-hookts on"></view> |
... | ... | @@ -154,11 +164,25 @@ |
154 | 164 | |
155 | 165 | <view bindtap='setexptype_w2' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind' class="yu_er">快递邮寄</view> |
156 | 166 | </view> |
167 | + | |
168 | + <!-- 同城配送 --> | |
169 | + <view data-t='2' data-txt='cartlist[{{pidx}}].exp_type' data-ind="{{pidx}}" bindtap="setexptype_w2" style=" margin-left: 5rpx;display:{{!item.show_same_city?'none':'flex;align-items: center'}};"> | |
170 | + | |
171 | + <block wx:if="{{item.exp_type==2}}"> | |
172 | + <icon data-t='2' data-txt='cartlist[{{pidx}}].exp_type' color="red" size="16" type="success"></icon> | |
173 | + </block> | |
174 | + <block wx:else> | |
175 | + <view class="circle xc-hookts on"></view> | |
176 | + </block> | |
177 | + | |
178 | + <view bindtap='setexptype_w2' data-t='2' data-ind="{{pidx}}" | |
179 | + data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind' class="yu_er">同城配送</view> | |
180 | + </view> | |
157 | 181 | </view> |
158 | 182 | |
159 | 183 | |
160 | 184 | <!-- 点击显示物流选择,如果是默认使用的情况不成立 --> |
161 | - <view wx:if="{{!is_default_logistics && item.exp_type!=1}}" class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;"> | |
185 | + <view wx:if="{{!is_default_logistics && item.exp_type!=1 && item.exp_type!=2}}" class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;"> | |
162 | 186 | <view>{{wu_arr[item.wind].name}}</view> |
163 | 187 | <view class="xc-right"></view> |
164 | 188 | </view> |
... | ... | @@ -215,7 +239,7 @@ |
215 | 239 | </view> |
216 | 240 | |
217 | 241 | <!-----使用优惠券------> |
218 | - <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" wx:if="{{(item.quan_list && item.quan_list.length>0) || get_by_quan_list_cart[item.pickup_id]!=null}}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}"> | |
242 | + <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" wx:if="{{(item.quan_list && item.quan_list.length>0) || get_by_quan_list_cart[item.pickup_id]!=null && item.can_num>0}}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}"> | |
219 | 243 | <view class="work-frame flex-space-between"> |
220 | 244 | <view class="work">优惠券<text class="quan_num_show fs20">{{item.can_num}}张可用</text></view> |
221 | 245 | <view class="xc-right-frame"> |
... | ... | @@ -415,10 +439,12 @@ |
415 | 439 | <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}} |
416 | 440 | </view> |
417 | 441 | |
418 | - <view class="xc-coupon-frame flex-center" data-bn="1" bindtap="open_coupon_list" data-pickid="{{bn_pick}}" wx:if="{{is_coupon > 0 && ((selected_quan_list && selected_quan_list.length>0) || get_by_quan_list!=null)}}"> | |
442 | + <view class="xc-coupon-frame flex-center" data-bn="1" bindtap="open_coupon_list" data-pickid="{{bn_pick}}" | |
443 | + hidden="{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list && bn_exp_type==0?get_by_quan_list.length:0)<=0}}" | |
444 | + wx:if="{{is_coupon > 0 && ((selected_quan_list && selected_quan_list.length>0) || get_by_quan_list!=null)}}"> | |
419 | 445 | <view class="work-frame flex-space-between"> |
420 | 446 | <view class="work"> |
421 | - 优惠券 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用</text> | |
447 | + 优惠券 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list && bn_exp_type==0?get_by_quan_list.length:0)}}张可用</text> | |
422 | 448 | </view> |
423 | 449 | <view class="xc-right-frame"> |
424 | 450 | <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text> | ... | ... |
pages/cart/cart2_inte/cart2_inte.js
... | ... | @@ -95,7 +95,9 @@ Page({ |
95 | 95 | th.data.json_d = json_d; |
96 | 96 | th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 |
97 | 97 | var is_default_logistics = json_d.is_default_logistics; |
98 | - th.setData({ is_close_quan: json_d.is_close_quan, sales_rules: ee.sales_rules, rank_switch: json_d.rank_switch, is_default_logistics: is_default_logistics }); | |
98 | + var is_same_city = json_d.is_same_city; | |
99 | + th.setData({ is_close_quan: json_d.is_close_quan, sales_rules: ee.sales_rules, | |
100 | + rank_switch: json_d.rank_switch, is_default_logistics: is_default_logistics,is_same_city:is_same_city }); | |
99 | 101 | |
100 | 102 | var rank_switch = json_d.rank_switch; |
101 | 103 | var max_price = -1; |
... | ... | @@ -165,7 +167,7 @@ Page({ |
165 | 167 | //th.data.prom_goods_map={}; |
166 | 168 | //更换地址回来要重新调用计算价钱的接口 |
167 | 169 | if (!th.data.user_addr || th.data.user_addr.address_id != ie.address_id) { |
168 | - th.setData({ user_addr: ie, show_submit: 0 }); | |
170 | + th.setData({ user_addr: ie }); | |
169 | 171 | if (th.data.is_b_now == 1) { |
170 | 172 | if (th.data.bn_goods) { |
171 | 173 | th.setData({ add_back: 1 }); |
... | ... | @@ -290,6 +292,22 @@ Page({ |
290 | 292 | var gd = t.data.data; |
291 | 293 | if (!gd) return false; |
292 | 294 | |
295 | + //-- 如果商品有同城配送的参数的时候,一件代发商品不能显示同城配送按钮 -- | |
296 | + if(gd.is_same_city && th.data.is_same_city && gd.whsle_id<=0){ | |
297 | + | |
298 | + getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+gg.pick_id, {}).then(res=>{ | |
299 | + if(res.data.code==0){ | |
300 | + var pk=res.data.data; | |
301 | + if(pk && pk.is_same_city){ | |
302 | + th.setData({show_same_city:1}) | |
303 | + } | |
304 | + } | |
305 | + | |
306 | + }) | |
307 | + | |
308 | + } | |
309 | + | |
310 | + | |
293 | 311 | t.data.data.original_img = oo.imghost + t.data.data.original_img; |
294 | 312 | t.data.data['buynum'] = gg.goods_num; |
295 | 313 | var distr_t = 0, et = 0 |
... | ... | @@ -409,6 +427,8 @@ Page({ |
409 | 427 | //---------计算立即购买---------- |
410 | 428 | calculatePrice2:async function () { |
411 | 429 | var th = this, good = this.data.bn_goods; |
430 | + | |
431 | + this.setData({submit:1}) | |
412 | 432 | wx.showLoading({ title: "处理中.", mask:true }) |
413 | 433 | //-----------计算商品总价-------------- |
414 | 434 | var allpice = good.shop_price * good.buynum; |
... | ... | @@ -519,11 +539,11 @@ Page({ |
519 | 539 | shipping_price=res.data.data; is_ok=1; |
520 | 540 | } |
521 | 541 | }) |
542 | + | |
522 | 543 | if(!is_ok){ |
523 | 544 | wx.showToast({ |
524 | 545 | title: "计算物流错误", icon: 'none',duration: 2000 |
525 | 546 | }) |
526 | - th.setData({ show_submit:0 }); | |
527 | 547 | wx.hideLoading(); |
528 | 548 | return false; |
529 | 549 | } |
... | ... | @@ -537,7 +557,7 @@ Page({ |
537 | 557 | var wl_txt = "formData.shipping_price"; |
538 | 558 | th.setData({ [wl_txt]: shipping_price, }) |
539 | 559 | |
540 | - } else { | |
560 | + } else if(th.data.bn_exp_type == 1 ) { | |
541 | 561 | var wl_txt = "formData.shipping_price"; |
542 | 562 | th.setData({ [wl_txt]: 0, }) |
543 | 563 | } |
... | ... | @@ -552,6 +572,55 @@ Page({ |
552 | 572 | order_m = 0; coupon_price = parseFloat(order_m).toFixed(2); |
553 | 573 | } |
554 | 574 | |
575 | + //判断是否同城配送,而且没有调用过 | |
576 | + if(th.data.bn_exp_type==2 && th.data.user_addr) { | |
577 | + | |
578 | + var lon=0;var lat=0; | |
579 | + //-- 获取距离 -- | |
580 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
581 | + is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address} | |
582 | + }).then(res=>{ | |
583 | + if(res.data.code==0){ | |
584 | + var data= JSON.parse(res.data.data); | |
585 | + if(data.status==0){ | |
586 | + lon=data.result.location.lng; | |
587 | + lat=data.result.location.lat; | |
588 | + } | |
589 | + } | |
590 | + }) | |
591 | + | |
592 | + | |
593 | + var gd_w = good['weight'] * good['buynum']; | |
594 | + //-- 获取距离 -- | |
595 | + var req_data = { | |
596 | + store_id: os.stoid, | |
597 | + order_amount: order_m, | |
598 | + lon: lon, lat: lat, | |
599 | + pickup_id: bn_pick, | |
600 | + goods_weight: gd_w | |
601 | + } | |
602 | + | |
603 | + var is_next=1; | |
604 | + //获取同城配送参数 | |
605 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", { | |
606 | + is_json: 1, | |
607 | + data: req_data | |
608 | + }).then(res => { | |
609 | + if (res.data.code == 0) { | |
610 | + var wl_txt = "formData.shipping_price"; | |
611 | + th.setData({ [wl_txt]: res.data.data, }) | |
612 | + }else{ | |
613 | + is_next=0; | |
614 | + wx.showToast({ | |
615 | + title: res.data.msg, icon: 'none', duration: 2000 | |
616 | + }) | |
617 | + } | |
618 | + }) | |
619 | + if(!is_next) return false | |
620 | + } | |
621 | + | |
622 | + | |
623 | + | |
555 | 624 | //--看一下有没有订单优惠--0 |
556 | 625 | total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); |
557 | 626 | order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); |
... | ... | @@ -567,14 +636,14 @@ Page({ |
567 | 636 | if (th.data.bn_use_money == 1) { |
568 | 637 | if (amoney > order_m) { |
569 | 638 | order_m = order_m.toFixed(2); |
570 | - th.setData({ [txt]: order_m, [txt2]: 0, [txt4]: all_integral, show_submit: 1 }) | |
639 | + th.setData({ [txt]: order_m, [txt2]: 0, [txt4]: all_integral, show_submit: 1,submit:0 }) | |
571 | 640 | } else { |
572 | 641 | order_m = parseFloat(order_m - amoney); |
573 | 642 | order_m = order_m.toFixed(2); |
574 | - th.setData({ [txt]: amoney, [txt2]: order_m, [txt4]: all_integral, show_submit: 1 }) | |
643 | + th.setData({ [txt]: amoney, [txt2]: order_m, [txt4]: all_integral, show_submit: 1,submit:0 }) | |
575 | 644 | } |
576 | 645 | } else { |
577 | - th.setData({ [txt]: 0, [txt2]: order_m, [txt4]: all_integral, show_submit: 1 }) | |
646 | + th.setData({ [txt]: 0, [txt2]: order_m, [txt4]: all_integral, show_submit: 1,submit:0}) | |
578 | 647 | } |
579 | 648 | |
580 | 649 | wx.hideLoading(); |
... | ... | @@ -586,6 +655,7 @@ Page({ |
586 | 655 | //--------------------提交订单----------------------- |
587 | 656 | async submitForm(t) { |
588 | 657 | var sub_value = t; |
658 | + this.setData({submit:1}) | |
589 | 659 | |
590 | 660 | if (this.data.is_summit_ing == 1) return false; //--提交中退出-- |
591 | 661 | this.data.is_summit_ing = 1; |
... | ... | @@ -739,16 +809,13 @@ Page({ |
739 | 809 | 'content-type': 'application/json' |
740 | 810 | },// 设置请求的 header |
741 | 811 | success: function (res) { |
742 | - | |
743 | - th.data.is_summit_ing = 0; //是否提交中 | |
744 | 812 | wx.hideLoading(); |
745 | 813 | if (res.statusCode == 200) { |
746 | 814 | var data = res.data; |
747 | 815 | if (data.code == 0) { |
748 | - console.log(th.data.is_b_now); | |
816 | + | |
749 | 817 | //如果是购物车结算,还要删除购物车 |
750 | 818 | if (th.data.is_b_now == 0) { |
751 | - console.log(th.data.cartlist_y); | |
752 | 819 | var list = th.data.cartlist_y; |
753 | 820 | for (var i = 0; i < list.length; i++) { |
754 | 821 | //删除购物车 |
... | ... | @@ -820,7 +887,8 @@ Page({ |
820 | 887 | showCancel: true, |
821 | 888 | success(res) { |
822 | 889 | if (res.cancel) { |
823 | - return; | |
890 | + th.setData({submit:0}) | |
891 | + return; | |
824 | 892 | } else if (res.confirm) { |
825 | 893 | th.data.is_continue = 1; |
826 | 894 | th.submitForm(sub_value); |
... | ... | @@ -832,13 +900,17 @@ Page({ |
832 | 900 | if (msg.length > 13) { |
833 | 901 | msg = msg.slice(0, 13) + "\r\n" + msg.slice(13); |
834 | 902 | } |
835 | - getApp().confirmBox(msg); | |
903 | + getApp().confirmBox(msg); | |
904 | + th.data.is_summit_ing = 0; //是否提交中 | |
836 | 905 | } |
837 | 906 | } else { |
838 | - console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); | |
907 | + th.setData({submit:0}) | |
908 | + th.data.is_summit_ing = 0; //是否提交中 | |
909 | + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode); | |
839 | 910 | } |
840 | 911 | }, |
841 | 912 | fail: function () { |
913 | + th.setData({submit:0}) | |
842 | 914 | th.data.is_summit_ing = 0; |
843 | 915 | wx.hideLoading(); |
844 | 916 | console.log("index.js wx.request CheckCallUser fail"); | ... | ... |
pages/cart/cart2_inte/cart2_inte.wxml
... | ... | @@ -12,6 +12,11 @@ |
12 | 12 | |
13 | 13 | <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}" |
14 | 14 | data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view> |
15 | + | |
16 | + <!-- 同城配送 --> | |
17 | + <block wx:if="{{show_same_city}}"> | |
18 | + <view hidden="{{bn_t_exp_t==3}}" bindtap='setexptype' data-t='2' class="tab {{bn_exp_type== 2 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">同城配送</view> | |
19 | + </block> | |
15 | 20 | |
16 | 21 | </view> |
17 | 22 | </view> |
... | ... | @@ -160,7 +165,7 @@ |
160 | 165 | <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view> |
161 | 166 | <view class="payable">应付积分:<text class="co-red">{{formData.integral}}积分</text></view> |
162 | 167 | </view> |
163 | - <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | |
168 | + <button disabled="{{submit}}" class="tips-btn" formType="submit" id="submitOrder">提交订单</button> | |
164 | 169 | </view> |
165 | 170 | </form> |
166 | 171 | ... | ... |
pages/cart/cart2_pt/cart2_pt.js
... | ... | @@ -148,14 +148,16 @@ Page({ |
148 | 148 | th.get_buy_goods(); |
149 | 149 | |
150 | 150 | //获取提现金额 |
151 | - getApp().request.get("/api/weshop/withdrawals/summoney", { | |
151 | + //noinspection JSUnresolvedFunction | |
152 | + getApp().request.get("/api/weshop/withdrawals/summoney", { | |
152 | 153 | data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 }, |
153 | 154 | success: function (su) { |
154 | 155 | if (su.data.code == 0) { |
155 | 156 | var yuer = parseFloat(th.data.userinfo.user_money - |
156 | 157 | (th.data.userinfo.frozen_money > 0 ? th.data.userinfo.frozen_money : 0) - su.data.data.summoney).toFixed(2); |
157 | 158 | if (yuer < 0) yuer = 0; |
158 | - th.setData({ txmon: su.data.data.summoney, yuer: yuer }); | |
159 | + //noinspection JSUnresolvedVariable | |
160 | + th.setData({ txmon: su.data.data.summoney, yuer: yuer }); | |
159 | 161 | } |
160 | 162 | } |
161 | 163 | }); |
... | ... | @@ -173,6 +175,22 @@ Page({ |
173 | 175 | var gd = t.data.data; |
174 | 176 | if (!gd) return false; |
175 | 177 | |
178 | + | |
179 | + //-- 如果商品有同城配送的参数的时候,一件代发商品不能显示同城配送按钮 -- | |
180 | + if(gd.is_same_city && th.data.is_same_city && gd.whsle_id<=0){ | |
181 | + | |
182 | + getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+gg.pick_id, {}).then(res=>{ | |
183 | + if(res.data.code==0){ | |
184 | + var pk=res.data.data; | |
185 | + if(pk && pk.is_same_city){ | |
186 | + th.setData({show_same_city:1}) | |
187 | + } | |
188 | + } | |
189 | + | |
190 | + }) | |
191 | + | |
192 | + } | |
193 | + | |
176 | 194 | t.data.data.original_img = oo.imghost + t.data.data.original_img; |
177 | 195 | t.data.data['buynum'] = gg.goods_num; |
178 | 196 | console.log(t.data.data); |
... | ... | @@ -315,8 +333,10 @@ Page({ |
315 | 333 | th.data.json_d = json_d; |
316 | 334 | th.data.ispt_goods = json_d.ispt_goods; //是不是平摊到单品的控制参数赋值 |
317 | 335 | var is_default_logistics = json_d.is_default_logistics; |
336 | + var is_same_city = json_d.is_same_city; | |
318 | 337 | |
319 | - th.setData({ is_close_quan: json_d.is_close_quan, sales_rules: ee.sales_rules, rank_switch: json_d.rank_switch, is_default_logistics: is_default_logistics }); | |
338 | + th.setData({ is_close_quan: json_d.is_close_quan, sales_rules: ee.sales_rules,is_same_city:is_same_city, | |
339 | + rank_switch: json_d.rank_switch, is_default_logistics: is_default_logistics }); | |
320 | 340 | |
321 | 341 | var rank_switch = json_d.rank_switch; |
322 | 342 | var max_price = -1; |
... | ... | @@ -398,7 +418,6 @@ Page({ |
398 | 418 | calculatePrice2:async function () { |
399 | 419 | |
400 | 420 | this.setData({submit:1}); |
401 | - | |
402 | 421 | wx.showLoading({ |
403 | 422 | title: "处理中.", |
404 | 423 | mask:true |
... | ... | @@ -441,7 +460,7 @@ Page({ |
441 | 460 | |
442 | 461 | if (back_data && back_data['is_by_all'] && (!back_data.no_free_goods || back_data.no_free_goods.indexOf(item.goods_id) == -1)) { |
443 | 462 | |
444 | - if (item['exp_sum_type'] == 2) { | |
463 | + if(item['exp_sum_type'] == 2) { | |
445 | 464 | if (goods_weight < 0) goods_weight = 0; |
446 | 465 | cut_good_weight += item['weight'] * item['buynum']; |
447 | 466 | goods_weight += item['weight'] * item['buynum']; |
... | ... | @@ -520,10 +539,54 @@ Page({ |
520 | 539 | var wl_txt = "formData.shipping_price"; |
521 | 540 | th.setData({ [wl_txt]: shipping_price, }) |
522 | 541 | |
523 | - } else { | |
542 | + } else if(th.data.bn_exp_type == 1 ) { | |
524 | 543 | var wl_txt = "formData.shipping_price"; |
525 | 544 | th.setData({ [wl_txt]: 0, }) |
526 | 545 | } |
546 | + | |
547 | + //判断是否同城配送,而且没有调用过 | |
548 | + if(th.data.bn_exp_type==2 && th.data.user_addr){ | |
549 | + var lon=0;var lat=0; | |
550 | + //-- 获取距离 -- | |
551 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
552 | + is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address} | |
553 | + }).then(res=>{ | |
554 | + if(res.data.code==0){ | |
555 | + var data= JSON.parse(res.data.data); | |
556 | + if(data.status==0){ | |
557 | + lon=data.result.location.lng; | |
558 | + lat=data.result.location.lat; | |
559 | + } | |
560 | + } | |
561 | + }) | |
562 | + | |
563 | + var gd_w=good['weight'] * good['buynum']; | |
564 | + //-- 获取距离 -- | |
565 | + var req_data={ | |
566 | + store_id:os.stoid, | |
567 | + order_amount:allpice, | |
568 | + lon:lon,lat:lat, | |
569 | + pickup_id:th.data.bn_pick, | |
570 | + goods_weight:gd_w | |
571 | + } | |
572 | + | |
573 | + var is_next=1; | |
574 | + //获取同城配送参数 | |
575 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {is_json:1,data:req_data}).then(res=>{ | |
576 | + if(res.data.code==0){ | |
577 | + var wl_txt = "formData.shipping_price"; | |
578 | + th.setData({ [wl_txt]: res.data.data, }) | |
579 | + }else{ | |
580 | + is_next=0; | |
581 | + wx.showToast({ | |
582 | + title: res.data.msg, icon: 'none', duration: 2000 | |
583 | + }) | |
584 | + } | |
585 | + }) | |
586 | + if(!is_next) return false | |
587 | + } | |
588 | + | |
589 | + | |
527 | 590 | //-----------------总价----------------- |
528 | 591 | var total_m = parseFloat(allpice) + parseFloat(th.data.formData.shipping_price); |
529 | 592 | total_m = parseFloat(total_m).toFixed(2); | ... | ... |
pages/cart/cart2_pt/cart2_pt.wxml
... | ... | @@ -10,6 +10,11 @@ |
10 | 10 | |
11 | 11 | <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}" |
12 | 12 | data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view> |
13 | + | |
14 | + <!-- 同城配送 --> | |
15 | + <block wx:if="{{show_same_city}}"> | |
16 | + <view bindtap='setexptype' data-t='2' class="tab {{bn_exp_type== 2 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">同城配送</view> | |
17 | + </block> | |
13 | 18 | |
14 | 19 | </view> |
15 | 20 | </view> | ... | ... |
pages/cart/cart_wk/cart_wk.js
... | ... | @@ -41,6 +41,7 @@ Page({ |
41 | 41 | |
42 | 42 | teamgroup: null, |
43 | 43 | submit:1, //默认按钮是灰色 |
44 | + show_submit:0, //不线上 | |
44 | 45 | }, |
45 | 46 | |
46 | 47 | /** |
... | ... | @@ -62,7 +63,8 @@ Page({ |
62 | 63 | var json_d = JSON.parse(e.switch_list); |
63 | 64 | th.data.json_d = json_d; |
64 | 65 | var is_default_logistics = json_d.is_default_logistics; |
65 | - th.setData({ is_default_logistics: is_default_logistics }); | |
66 | + var is_same_city = json_d.is_same_city; | |
67 | + th.setData({ is_default_logistics: is_default_logistics,is_same_city:is_same_city }); | |
66 | 68 | |
67 | 69 | th.get_wuliu(th.get_info(th.show_page)); |
68 | 70 | }, 1) |
... | ... | @@ -91,6 +93,11 @@ Page({ |
91 | 93 | if (th.data.exp_type == 0 && th.data.goods) { |
92 | 94 | th.calculate_wuliu(); |
93 | 95 | } |
96 | + | |
97 | + if (th.data.exp_type == 2 && th.data.goods) { | |
98 | + th.calculate_same_city(); | |
99 | + } | |
100 | + | |
94 | 101 | }) |
95 | 102 | |
96 | 103 | }, |
... | ... | @@ -265,7 +272,23 @@ Page({ |
265 | 272 | else |
266 | 273 | distr_type = pickup.distr_type; |
267 | 274 | |
268 | - switch (distr_type) { | |
275 | + | |
276 | + //-- 如果商品有同城配送的参数的时候,一件代发商品不能显示同城配送按钮 -- | |
277 | + if(goods.is_same_city && th.data.is_same_city && goods.whsle_id<=0){ | |
278 | + getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+order.pickup_id, {}).then(res=>{ | |
279 | + if(res.data.code==0){ | |
280 | + var pk=res.data.data; | |
281 | + if(pk && pk.is_same_city){ | |
282 | + th.setData({show_same_city:1}) | |
283 | + } | |
284 | + } | |
285 | + }) | |
286 | + } | |
287 | + | |
288 | + | |
289 | + | |
290 | + | |
291 | + switch (distr_type) { | |
269 | 292 | case 0: |
270 | 293 | exp_type = 1; |
271 | 294 | //-- 系统后台有设置要默认的 -- |
... | ... | @@ -297,7 +320,7 @@ Page({ |
297 | 320 | } else { |
298 | 321 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; |
299 | 322 | allpice = allpice.toFixed(2); |
300 | - th.setData({ exp_price: 0, allpice: allpice,submit:0 }) | |
323 | + th.setData({ exp_price: 0, allpice: allpice,submit:0,show_submit:1 }) | |
301 | 324 | } |
302 | 325 | }, |
303 | 326 | |
... | ... | @@ -326,22 +349,19 @@ Page({ |
326 | 349 | this.setData({ |
327 | 350 | exp_type: type |
328 | 351 | }); |
329 | - | |
330 | - | |
331 | - | |
332 | 352 | //--计算物流的值-- |
333 | 353 | if (type == 0) { |
334 | - | |
335 | - th.setData({submit:0}) | |
336 | 354 | th.calculate_wuliu(); |
337 | - } else { | |
355 | + } else if(type==1){ | |
338 | 356 | var allpice = parseFloat(th.data.order.order_amount) |
339 | 357 | + parseFloat(th.data.order.user_money) |
340 | 358 | + parseFloat(th.data.order.tail_money); |
341 | 359 | allpice = allpice.toFixed(2); |
342 | 360 | this.setData({ |
343 | - allpice: allpice, exp_price: 0, | |
361 | + allpice: allpice, exp_price: 0,show_submit:1,submit:0 | |
344 | 362 | }); |
363 | + }else{ | |
364 | + th.calculate_same_city(); | |
345 | 365 | } |
346 | 366 | }, |
347 | 367 | |
... | ... | @@ -400,6 +420,12 @@ Page({ |
400 | 420 | dd.shipping_price = parseFloat(th.data.exp_price); |
401 | 421 | dd.addressid = th.data.user_addr.address_id; |
402 | 422 | } |
423 | + | |
424 | + //如果是同城配送的时候 | |
425 | + if(th.data.exp_type==2){ | |
426 | + dd.shipping_price = parseFloat(th.data.exp_price); | |
427 | + } | |
428 | + | |
403 | 429 | if(getApp().globalData.scene){ |
404 | 430 | dd.scene=getApp().globalData.scene; |
405 | 431 | } |
... | ... | @@ -589,7 +615,7 @@ Page({ |
589 | 615 | } |
590 | 616 | }) |
591 | 617 | if(!is_ok){ |
592 | - th.setData({ submit:0 }); | |
618 | + th.setData({ submit:0,show_submit:1 }); | |
593 | 619 | wx.hideLoading(); |
594 | 620 | return false; |
595 | 621 | } |
... | ... | @@ -599,16 +625,89 @@ Page({ |
599 | 625 | allpice = allpice.toFixed(2); |
600 | 626 | |
601 | 627 | exp_price = parseFloat(exp_price); |
602 | - th.setData({ exp_price: exp_price, allpice: allpice,submit:0 }) | |
628 | + th.setData({ exp_price: exp_price, allpice: allpice,submit:0,show_submit:1 }) | |
603 | 629 | } else { |
604 | 630 | var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; |
605 | 631 | allpice = allpice.toFixed(2); |
606 | - th.setData({ exp_price: 0, allpice: allpice,submit:0}) | |
632 | + th.setData({ exp_price: 0, allpice: allpice,submit:0,show_submit:1}) | |
607 | 633 | } |
608 | 634 | //}); |
609 | 635 | |
610 | 636 | }, |
611 | 637 | |
638 | + //----计算物流的钱--- | |
639 | + async calculate_same_city() { | |
640 | + //让按钮变灰色 | |
641 | + this.setData({submit:1}); | |
642 | + var th = this; | |
643 | + var good = th.data.goods; | |
644 | + good.buynum=th.data.order.order_goods['goods_num']; | |
645 | + | |
646 | + //--全部金额-- | |
647 | + var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.pt_tail_money; | |
648 | + //-----------当地址不为空,且是物流时,计算物流费用---------- | |
649 | + if (th.data.user_addr != null) { | |
650 | + | |
651 | + | |
652 | + var lon=0;var lat=0; | |
653 | + //-- 获取距离 -- | |
654 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getGeocoder", { | |
655 | + is_json: 1, data: {address:th.data.user_addr.more_address+th.data.user_addr.address} | |
656 | + }).then(res=>{ | |
657 | + if(res.data.code==0){ | |
658 | + var data= JSON.parse(res.data.data); | |
659 | + if(data.status==0){ | |
660 | + lon=data.result.location.lng; | |
661 | + lat=data.result.location.lat; | |
662 | + } | |
663 | + } | |
664 | + }) | |
665 | + | |
666 | + var gd_w = good['weight'] * good['buynum']; | |
667 | + //--------------开始计算物流------------------ | |
668 | + var shipping_price =0; | |
669 | + | |
670 | + //-- 获取距离 -- | |
671 | + var req_data={ | |
672 | + store_id:os.stoid, | |
673 | + order_amount:allpice, | |
674 | + lon:lon,lat:lat, | |
675 | + pickup_id:th.data.pickup.pickup_id, | |
676 | + goods_weight:gd_w | |
677 | + } | |
678 | + | |
679 | + var is_next=1; | |
680 | + //获取同城配送参数 | |
681 | + await getApp().request.promisePost("/api/weshop/order/sameCityExp/getMoney", {is_json:1,data:req_data}).then(res=>{ | |
682 | + if(res.data.code==0){ | |
683 | + shipping_price=res.data.data; | |
684 | + }else{ | |
685 | + is_next=0; | |
686 | + wx.showToast({ | |
687 | + title: res.data.msg, icon: 'none', duration: 2000 | |
688 | + }) | |
689 | + } | |
690 | + }) | |
691 | + if(!is_next) return false | |
692 | + | |
693 | + var exp_price = parseFloat(shipping_price).toFixed(2); | |
694 | + allpice = parseFloat(exp_price) + parseFloat(allpice); | |
695 | + allpice = allpice.toFixed(2); | |
696 | + | |
697 | + exp_price = parseFloat(exp_price); | |
698 | + th.setData({ exp_price: exp_price, allpice: allpice,submit:0,show_submit:1 }) | |
699 | + | |
700 | + | |
701 | + | |
702 | + } else { | |
703 | + var allpice = th.data.order.order_amount + th.data.order.user_money + th.data.order.tail_money; | |
704 | + allpice = allpice.toFixed(2); | |
705 | + th.setData({ exp_price: 0, allpice: allpice,submit:0,show_submit:1}) | |
706 | + } | |
707 | + | |
708 | + | |
709 | + }, | |
710 | + | |
612 | 711 | |
613 | 712 | //---------------检查是否有收货地址------------------- |
614 | 713 | checkAddressList: function () { | ... | ... |
pages/cart/cart_wk/cart_wk.wxml
1 | 1 | <wxs module="filters" src="../../../utils/filter.wxs"></wxs> |
2 | 2 | |
3 | 3 | <!-- 先选择配送方式,2021.7修改 --> |
4 | + <block wx:if="{{show_submit}}"> | |
4 | 5 | <view class="tab-container" wx:if="{{kt_type!=3 || is_normal==1}}"> |
5 | 6 | <view class="tab-wrapper"> |
6 | 7 | <view hidden="{{distr_type==2}}" bindtap='set_wuliu' data-type='1' class="tab {{exp_type == 1? 'active':''}}" |
... | ... | @@ -8,9 +9,15 @@ |
8 | 9 | |
9 | 10 | <view hidden="{{distr_type==1}}" bindtap='set_wuliu' data-type='0' class="tab {{exp_type== 0 ? 'active':''}}" |
10 | 11 | data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view> |
12 | + | |
13 | + <!-- 同城配送 --> | |
14 | + <block wx:if="{{show_same_city}}"> | |
15 | + <view hidden="{{bn_t_exp_t==3}}" bindtap='set_wuliu' data-type='2' class="tab {{exp_type== 2 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">同城配送</view> | |
16 | + </block> | |
11 | 17 | |
12 | 18 | </view> |
13 | 19 | </view> |
20 | + </block> | |
14 | 21 | |
15 | 22 | |
16 | 23 | <!----要进行判断地址是否显示----> |
... | ... | @@ -171,3 +178,5 @@ |
171 | 178 | |
172 | 179 | </view > |
173 | 180 | </view> |
181 | +<view style="height: 50rpx"></view> | |
182 | + | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.js
... | ... | @@ -335,21 +335,20 @@ Page({ |
335 | 335 | } |
336 | 336 | }, |
337 | 337 | |
338 | - // 分享朋友圈 | |
339 | - onShareTimeline() { | |
340 | - getApp().globalData.no_clear=1; | |
341 | - var curPage = this; | |
342 | - var pagePath = curPage.route; //当前页面url | |
343 | - if (pagePath.indexOf('/') != 0) { | |
344 | - pagePath = '/' + pagePath; | |
345 | - } | |
346 | - pagePath += "?first_leader=" + this.data.getUserID; | |
347 | - return { | |
348 | - title: '专享礼包', | |
349 | - imageUrl: this.data.ad_data.ad_code, | |
350 | - path: pagePath, | |
351 | - } | |
352 | - }, | |
338 | + // 分享朋友圈 | |
339 | + onShareTimeline() { | |
340 | + getApp().globalData.no_clear=1; | |
341 | + | |
342 | + var user_id=getApp().globalData.user_id; | |
343 | + if(!user_id) user_id=0; | |
344 | + | |
345 | + return { | |
346 | + title: '专享礼包', | |
347 | + imageUrl: this.data.ad_data.ad_code, | |
348 | + query: 'first_leader='+user_id | |
349 | + } | |
350 | + }, | |
351 | + | |
353 | 352 | |
354 | 353 | |
355 | 354 | //--- 设置一下默认库存的数量 ---- | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.js
... | ... | @@ -544,28 +544,21 @@ Page({ |
544 | 544 | } |
545 | 545 | }, |
546 | 546 | |
547 | - /** | |
548 | - * 用户分享朋友圈 | |
549 | - */ | |
550 | - onShareTimeline() { | |
551 | - getApp().globalData.no_clear=1; | |
552 | - var curPage = this; | |
553 | - var pagePath = curPage.route; //当前页面url | |
554 | - if (pagePath.indexOf('/') != 0) { | |
555 | - pagePath = '/' + pagePath; | |
556 | - } | |
557 | - pagePath += "?isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader=" + this.data.getUserID; | |
558 | - // if (this.data.isBuy == 0) { | |
559 | - // pagePath += "&orderSn=" + this.data.orderSn; | |
560 | - // } else { | |
561 | - // pagePath += "&lbId=" + this.data.getGiftID; | |
562 | - // } | |
563 | - console.log('pagePath', pagePath); | |
564 | - return { | |
565 | - title: "礼包详情", | |
566 | - path: pagePath, | |
567 | - } | |
568 | - }, | |
547 | + /** | |
548 | + * 用户分享朋友圈 | |
549 | + */ | |
550 | + onShareTimeline() { | |
551 | + getApp().globalData.no_clear=1; | |
552 | + | |
553 | + var pagePath ="&isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader=" + this.data.getUserID; | |
554 | + var user_id=getApp().globalData.user_id; | |
555 | + if(!user_id) user_id=0; | |
556 | + | |
557 | + return { | |
558 | + title: "礼包详情", | |
559 | + query: 'first_leader='+user_id+pagePath | |
560 | + } | |
561 | + }, | |
569 | 562 | |
570 | 563 | //免费领取 |
571 | 564 | GetFree: function (e) { | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.js
... | ... | @@ -177,20 +177,14 @@ Page({ |
177 | 177 | } |
178 | 178 | }, |
179 | 179 | |
180 | - onShareTimeline() { | |
181 | - getApp().globalData.no_clear=1; | |
182 | - var curPage = this; | |
183 | - var pagePath = curPage.route; //当前页面url | |
184 | - if (pagePath.indexOf('/') != 0) { | |
185 | - pagePath = '/' + pagePath; | |
186 | - } | |
187 | - pagePath += "?first_leader=" + this.data.getUserID; | |
188 | - return { | |
189 | - title: '专享礼包', | |
190 | - imageUrl: this.data.ad_data.ad_code, | |
191 | - path: pagePath, | |
192 | - } | |
193 | - }, | |
180 | + onShareTimeline() { | |
181 | + getApp().globalData.no_clear=1; | |
182 | + return { | |
183 | + title: '专享礼包', | |
184 | + imageUrl: this.data.ad_data.ad_code, | |
185 | + query: "first_leader=" + this.data.getUserID | |
186 | + } | |
187 | + }, | |
194 | 188 | |
195 | 189 | |
196 | 190 | }); |
197 | 191 | \ No newline at end of file | ... | ... |
pages/goods/categoryList/categoryList.js
... | ... | @@ -1092,15 +1092,20 @@ Page({ |
1092 | 1092 | if(url[0]!='/') url='/'+url; |
1093 | 1093 | getApp().goto(url); |
1094 | 1094 | }, |
1095 | - | |
1096 | - onShareTimeline(){ | |
1097 | - getApp().globalData.no_clear=1; | |
1098 | - var store_name=getApp().globalData.config?getApp().globalData.config.store_name:''; | |
1099 | - if(!store_name) | |
1100 | - store_name=getApp().globalData.setting.appName; | |
1101 | - return { | |
1102 | - title:'商品分类-'+store_name, | |
1103 | - } | |
1104 | - } | |
1095 | + | |
1096 | + onShareTimeline(){ | |
1097 | + getApp().globalData.no_clear=1; | |
1098 | + var store_name=getApp().globalData.config?getApp().globalData.config.store_name:''; | |
1099 | + if(!store_name) | |
1100 | + store_name=getApp().globalData.setting.appName; | |
1101 | + | |
1102 | + var user_id=getApp().globalData.user_id; | |
1103 | + if(!user_id) user_id=0; | |
1104 | + | |
1105 | + return { | |
1106 | + title:'商品分类-'+store_name, | |
1107 | + query: "first_leader=" + user_id | |
1108 | + } | |
1109 | + } | |
1105 | 1110 | |
1106 | 1111 | }); |
1107 | 1112 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
... | ... | @@ -548,8 +548,9 @@ Page({ |
548 | 548 | }); |
549 | 549 | |
550 | 550 | //更新点击量 |
551 | + //noinspection JSUnresolvedFunction | |
551 | 552 | getApp().request.put("/api/weshop/goods/updateClick", { |
552 | - data: {store_id: os.stoid, goods_id: gid} | |
553 | + data: {store_id: os.stoid, goods_id: gid,user_id:getApp().globalData.user_id?getApp().globalData.user_id:0 } | |
553 | 554 | }); |
554 | 555 | |
555 | 556 | |
... | ... | @@ -6673,16 +6674,33 @@ Page({ |
6673 | 6674 | |
6674 | 6675 | onShareTimeline() { |
6675 | 6676 | getApp().globalData.no_clear=1; |
6677 | + var th=this; | |
6676 | 6678 | var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; |
6677 | 6679 | if (!store_name) |
6678 | 6680 | store_name = getApp().globalData.setting.appName; |
6681 | + | |
6682 | + var url = "&goods_id=" | |
6683 | + + th.data.sele_g.goods_id + "&prom_type=" + th.data.sele_g.prom_type + "&prom_id=" + th.data.sele_g.prom_id; | |
6684 | + if (getApp().globalData.user_id) { | |
6685 | + url += "&first_leader=" + getApp().globalData.user_id; | |
6686 | + } | |
6687 | + | |
6688 | + //-- 如果房间分享,且不是会员分享的 -- | |
6689 | + if (getApp().globalData.room_id && | |
6690 | + th.data.sele_g.goods_id == getApp().globalData.room_goods_id && !getApp().globalData.room_user_share | |
6691 | + ) { | |
6692 | + url += "&room_id=" + getApp().globalData.room_id + "&room_user_share=1"; | |
6693 | + } | |
6694 | + | |
6679 | 6695 | return { |
6680 | 6696 | title: this.data.data.goods_name + '-' + store_name, |
6681 | 6697 | imageUrl: this.data.gallery[0].image_url, |
6698 | + query: 'first_leader='+user_id+url | |
6682 | 6699 | } |
6683 | 6700 | }, |
6684 | 6701 | |
6685 | 6702 | |
6703 | + | |
6686 | 6704 | clickCollapse() { |
6687 | 6705 | this.setData({ |
6688 | 6706 | flag: !this.data.flag, | ... | ... |
pages/template/index.js
... | ... | @@ -126,7 +126,7 @@ Page({ |
126 | 126 | var ob = { |
127 | 127 | title: this.data.share_title, |
128 | 128 | path: url, |
129 | - imageUrl:this.data.url+this.data.store_config.store_logo, | |
129 | + //imageUrl:this.data.url+this.data.store_config.store_logo, | |
130 | 130 | }; |
131 | 131 | return ob; |
132 | 132 | }, |
... | ... | @@ -152,9 +152,8 @@ Page({ |
152 | 152 | |
153 | 153 | var ob = { |
154 | 154 | title:share_title, |
155 | - //path: url, | |
156 | 155 | query:url, |
157 | - imageUrl:this.data.url+store_config.store_logo, | |
156 | + //imageUrl:this.data.url+store_config.store_logo, | |
158 | 157 | }; |
159 | 158 | console.log(ob); |
160 | 159 | return ob; | ... | ... |
pages/user/assistance/assistance.js
... | ... | @@ -240,14 +240,19 @@ Page({ |
240 | 240 | } |
241 | 241 | }, |
242 | 242 | |
243 | - onShareTimeline() { | |
244 | - getApp().globalData.no_clear=1; | |
245 | - var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
246 | - if (!store_name) | |
247 | - store_name = getApp().globalData.setting.appName; | |
248 | - return { | |
249 | - title: '好友助力-' + store_name, | |
250 | - } | |
251 | - }, | |
243 | + onShareTimeline() { | |
244 | + getApp().globalData.no_clear=1; | |
245 | + var store_name = getApp().globalData.config ? getApp().globalData.config.store_name : ''; | |
246 | + if (!store_name) | |
247 | + store_name = getApp().globalData.setting.appName; | |
248 | + | |
249 | + var user_id=getApp().globalData.user_id; | |
250 | + if(!user_id) user_id=0; | |
251 | + | |
252 | + return { | |
253 | + title: '好友助力-' + store_name, | |
254 | + query: 'first_leader='+user_id | |
255 | + } | |
256 | + }, | |
252 | 257 | |
253 | 258 | }) | ... | ... |
pages/user/index/index.js
... | ... | @@ -42,7 +42,8 @@ Page({ |
42 | 42 | actId: "", //生日活动的id |
43 | 43 | actImg: "", |
44 | 44 | is_assistance: 0, //助力活动 |
45 | - ad_img: "", | |
45 | + ad_img: "", | |
46 | + usertop_ad: [],//会员顶部配置 | |
46 | 47 | add_card_data: '', //等级卡的内容 |
47 | 48 | getusercode_vailtime:10,//会员二维码时效 |
48 | 49 | hiddenCS: true, |
... | ... | @@ -70,8 +71,13 @@ Page({ |
70 | 71 | }, |
71 | 72 | success: function (res) { |
72 | 73 | if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length) { |
73 | - var item = res.data.data.pageData[0]; | |
74 | - if (item && item.ad_code) th.setData({ ad_img: item.ad_code }) | |
74 | + var item = res.data.data.pageData[0]; | |
75 | + if (item) | |
76 | + { | |
77 | + th.setData({ usertop_ad:item }); | |
78 | + if (item.ad_code) th.setData({ ad_img: item.ad_code }) | |
79 | + } | |
80 | + | |
75 | 81 | } |
76 | 82 | } |
77 | 83 | }) | ... | ... |
pages/user/index/index.wxml
... | ... | @@ -19,12 +19,12 @@ |
19 | 19 | <view class="flex fs24 xc-grow-ups" style="margin-left:8rpx;margin-top:6rpx" wx:if="{{is_init && gradeId}}" bindtap='jump'> |
20 | 20 | <block wx:if="{{cz_val<full_cz_val}}"> |
21 | 21 | {{" "}} |
22 | - <text class="grow-up-val">成长值</text> | |
22 | + <text class="grow-up-val" style="background:{{usertop_ad.bgcolor?usertop_ad.bgcolor:'#fe9db5'}};">成长值</text> | |
23 | 23 | <view style='margin-left:5rpx; '>{{cz_val}} / {{need_money}}</view> |
24 | 24 | </block> |
25 | 25 | <block wx:else> |
26 | 26 | {{" "}} |
27 | - <text class="grow-up-val">成长值</text> {{cz_val}} | |
27 | + <text class="grow-up-val" style="background:{{usertop_ad.bgcolor?usertop_ad.bgcolor:'#fe9db5'}};">成长值</text> {{cz_val}} | |
28 | 28 | </block> |
29 | 29 | </view> |
30 | 30 | </view> |
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | </view> |
41 | 41 | <view wx:if="{{userInfo}}" class="xc-qrcode-frame abs "> |
42 | 42 | <!-- {{iurl}}/miniapp --> |
43 | - <image bindtap='show_tc' class=" xc-qrcode " src="{{iurl}}/miniapp/images/qrcode1.png"></image> | |
43 | + <image bindtap='show_tc' class=" xc-qrcode " style="border: 5rpx solid {{usertop_ad.bgcolor?usertop_ad.bgcolor:'#fe9db5'}};background: {{usertop_ad.bgcolor?usertop_ad.bgcolor:'#fe9db5'}};" src="{{iurl}}/miniapp/images/qrcode1.png"></image> | |
44 | 44 | <view style="font-size:12px;color: #fff;">会员卡</view> |
45 | 45 | </view> |
46 | 46 | <view class="flex-vertical abs xc-grow-frame rel" style="display: none"> |
... | ... | @@ -52,7 +52,7 @@ |
52 | 52 | <view class="xc-line-Yes abs" style="width:{{length}}rpx;"></view> |
53 | 53 | </view> |
54 | 54 | |
55 | - <view class="xc-grow-val">5000/10000</view> | |
55 | + <view class="xc-grow-val">0/0</view> | |
56 | 56 | </view> |
57 | 57 | <view class="flex-equality abs xc-assets"> |
58 | 58 | <view class="t-c typefont" bindtap='balance'>{{yuer?yuer:0}} | ... | ... |