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


Test


From test into qa

Merged by 后端研发-苏明海

1 participants















app.js
... ... @@ -447,6 +447,7 @@ App({
447 447 text: '' + num //显示的内容
448 448 });--*/
449 449 th.getTabBar().setData({cartGoodsNum:num});
  450 + th.data.up_dating = 0
450 451 }
451 452 });
452 453 },
... ...
app.json
... ... @@ -103,11 +103,15 @@
103 103 "pages/quan_pro/quan_pro",
104 104 "pages/liveStream/liveStream",
105 105 "pages/liveStreamDetails/liveStreamDetails",
106   -
  106 + "pages/addCustomer/addCustomer",
107 107 "pages/goods_share/goods_share",
108 108 "pages/activity_share/activity_share",
109 109 "pages/live_share/live_share",
110   - "pages/quan/quan"
  110 + "pages/quan/quan",
  111 + "pages/chongzhi/chongzhi",
  112 + "pages/chongzhiDetails/chongzhiDetails",
  113 + "pages/jfbuy/jfbuy"
  114 +
111 115 ]
112 116  
113 117 }],
... ...
app.wxss
1 1 .pdt20 {
2 2 padding-top: 20rpx;
3 3 }
  4 +.pdb18 {
  5 + padding-bottom: 18rpx;
  6 +}
4 7 .pdt40 {
5 8 padding-top: 40rpx;
6 9 }
7   -.flex {
8   - display: flex;
9   -}
10 10 .ib{
11 11 display: inline-block;
12 12 }
13 13 .flex_auto {
14 14 flex: 1;
15 15 }
  16 +.bdt16 {
  17 + border-top: 16rpx solid #f4f4f4;
  18 +}
16 19 .container {
17 20 /*font-family: "iconfont" !important; */
18 21 display: flex; flex-direction: column;
... ... @@ -20,6 +23,7 @@
20 23 box-sizing: border-box;
21 24 overflow-x:hidden;
22 25 }
  26 +
23 27 page {
24 28 overflow-x: hidden;
25 29 }
... ... @@ -79,9 +83,11 @@ button {
79 83 .hide {
80 84 display: none;
81 85 }
  86 +
82 87 .t-c {
83 88 text-align: center;
84 89 }
  90 +
85 91 .ai_and{
86 92 align-items: flex-end;
87 93 }
... ... @@ -397,9 +403,15 @@ background: #ffe3e2;
397 403 .fs36 {
398 404 font-size: 36rpx;
399 405 }
  406 +.fs38 {
  407 + font-size: 38rpx;
  408 +}
400 409 .fs40 {
401 410 font-size: 40rpx;
402 411 }
  412 +.ai_c {
  413 + align-items: center;
  414 +}
403 415 .ai_end{
404 416 align-items: flex-end;
405 417 }
... ... @@ -410,7 +422,8 @@ background: #ffe3e2;
410 422 font-size: 50rpx;
411 423 }
412 424 .fs60{ font-size:60rpx;}
413   -.flex-wrap{
  425 +.fs80 {font-size: 80rpx;}
  426 +.flex-wrap {
414 427 flex-wrap:wrap;
415 428 }
416 429  
... ... @@ -433,12 +446,12 @@ background: #ffe3e2;
433 446 /* 图标字体(ty) */
434 447 @font-face {
435 448 font-family: 'iconfont'; /* project id 2054717 */
436   - src: url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.eot');
437   - src: url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.eot?#iefix') format('embedded-opentype'),
438   - url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.woff2') format('woff2'),
439   - url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.woff') format('woff'),
440   - url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.ttf') format('truetype'),
441   - url('//at.alicdn.com/t/font_2054717_eqd24qr0g9a.svg#iconfont') format('svg');
  449 + src: url('//at.alicdn.com/t/font_2054717_kp0q24eh5l.eot');
  450 + src: url('//at.alicdn.com/t/font_2054717_kp0q24eh5l.eot?#iefix') format('embedded-opentype'),
  451 + url('//at.alicdn.com/t/font_2054717_kp0q24eh5l.woff2') format('woff2'),
  452 + url('//at.alicdn.com/t/font_2054717_kp0q24eh5l.woff') format('woff'),
  453 + url('//at.alicdn.com/t/font_2054717_kp0q24eh5l.ttf') format('truetype'),
  454 + url('//at.alicdn.com/t/font_2054717_kp0q24eh5l.svg#iconfont') format('svg');
442 455 }
443 456  
444 457 .iconfont {
... ... @@ -449,6 +462,42 @@ background: #ffe3e2;
449 462 -moz-osx-font-smoothing: grayscale;
450 463 }
451 464  
  465 +.icon-buqian:before {
  466 + content: "\e65f";
  467 +}
  468 +
  469 +.icon-rili:before {
  470 + content: "\e65e";
  471 +}
  472 +
  473 +.icon-yihexiao:before {
  474 + content: "\e726";
  475 +}
  476 +
  477 +.icon-daihexiao:before {
  478 + content: "\e727";
  479 +}
  480 +
  481 +.icon-meirong2:before {
  482 + content: "\e861";
  483 +}
  484 +
  485 +.icon-shoujichongzhi:before {
  486 + content: "\e607";
  487 +}
  488 +
  489 +.icon-cloud:before {
  490 + content: "\e61c";
  491 +}
  492 +
  493 +.icon-shop:before {
  494 + content: "\e605";
  495 +}
  496 +
  497 +.icon-order:before {
  498 + content: "\e606";
  499 +}
  500 +
452 501 .icon-save:before {
453 502 content: "\e6bb";
454 503 }
... ... @@ -518,3 +567,4 @@ background: #ffe3e2;
518 567 }
519 568  
520 569  
  570 +
... ...
components/diy_goodsGroup/diy_goodsGroup.js
... ... @@ -316,13 +316,24 @@ Component({
316 316 var arr = [1219, 2089, 3031];
317 317 var new_arr = new Array();
318 318 var card_name_map = new Map();
319   - for (var i = 0; i < plusCard.length; i++) {
320   - var name = "card" + plusCard[i].CorrPrice.toLowerCase();
321   - card_name_map.set(name, plusCard[i].CardName);
322   - }
  319 +
  320 + var user = getApp().globalData.userInfo;
  321 +
  322 + if(plusCard) {
  323 +
  324 + for (var i = 0; i < plusCard.length; i++) {
  325 + if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
  326 + continue;
  327 + }
  328 +
  329 + var name = "card" + plusCard[i].CorrPrice.toLowerCase();
  330 + card_name_map.set(name, plusCard[i].CardName);
  331 + new_arr.push(plusCard[i]);
  332 + }
  333 + }
323 334  
324 335 var ob = {
325   - "card_list": plusCard,
  336 + "card_list": new_arr,
326 337 "name_map": card_name_map
327 338 };
328 339 func(ob);
... ... @@ -392,7 +403,10 @@ Component({
392 403 item.cardprice1 = val.cardprice1;
393 404 item.cardprice2 = val.cardprice2;
394 405 item.cardprice3 = val.cardprice3;
395   -
  406 +
  407 + if(val.prom_price) item.prom_price = val.prom_price;
  408 + if(val.prom_integral) item.prom_integral = val.prom_integral;
  409 +
396 410 prom_id = val.prom_id;
397 411  
398 412 var prom_type = val.prom_type; //0普通商品 1秒杀 6拼单
... ...
components/diy_goodsGroup/diy_goodsGroup.wxml
... ... @@ -43,9 +43,13 @@
43 43 <view class='zs_wz1' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
44 44 <!--如果有显示价格 -->
45 45 <view class='zs_wz2' wx:if="{{object.goodsprice}}">
46   - <block wx:if="{{item.prom_price}}">
47   - <view class='wz_red'>¥{{item.prom_price}}</view>
48   - <view class='del'>¥{{item.market_price}}</view>
  46 + <block wx:if="{{item.prom_price || item.prom_integral}}">
  47 + <view class='wz_red'>
  48 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  49 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  50 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  51 + </view>
  52 + <view class='del'>¥{{item.market_price}}</view>
49 53 </block>
50 54 <block wx:else>
51 55  
... ... @@ -187,8 +191,12 @@
187 191 <view class='zs_wz1_2l' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
188 192 <view class='zs_wz2_2l' wx:if="{{object.goodsprice}}">
189 193  
190   - <block wx:if="{{item.prom_price}}">
191   - <view class='wz_red'>¥{{item.prom_price}}</view>
  194 + <block wx:if="{{item.prom_price || item.prom_integral}}">
  195 + <view class='wz_red'>
  196 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  197 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  198 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  199 + </view>
192 200 <view class='del'>¥{{item.market_price}}</view>
193 201 </block>
194 202 <block wx:else>
... ... @@ -330,8 +338,12 @@
330 338  
331 339 <view class='zs_wz1_3l' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
332 340 <view class='zs_wz2_3l' wx:if="{{object.goodsprice}}">
333   - <block wx:if="{{item.prom_price}}">
334   - <view class='wz_red'>¥{{item.prom_price}}</view>
  341 + <block wx:if="{{item.prom_price || item.prom_integral}}">
  342 + <view class='wz_red'>
  343 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  344 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  345 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  346 + </view>
335 347 <view class='del'>¥{{item.market_price}}</view>
336 348 </block>
337 349 <block wx:else>
... ... @@ -473,96 +485,114 @@
473 485 <view class='zs_center_x'>
474 486 <view class='zs_wz1_x' wx:if="{{object.goodstit}}">{{item.goods_name}}</view>
475 487 <view class='zs_wz2_x' wx:if="{{object.goodsprice}}">
476   - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}" >
477   - <!-- 当会员是等级卡的时候 -->
478   - <block wx:if="{{card_field}}">
479   - <!-- 等级价>0 -->
480   - <block wx:if="{{item[card_field]>0}}">
481   - <view class="money flex" >
482   - <!-- 办卡价 -->
483   - <view class="flex xc-wc ai_and">
484   - <view class="fs24 wz_red">¥</view>
485   - <view class="fs35 wz_red">{{filter.toFix(item[card_field],2)}}</view>
486   - <view class="card_bg ellipsis-1">
487   - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
488   - <text class="card_name">{{card_name}}</text>
489   - </view>
490   - </view>
491   - </view>
492   - <view class="flex" style="line-height: 28rpx;" >
493   - <!-- 原价 -->
494   - <view class="price flex xc-ash line_th">
495   - <view class="fs22">¥</view>
496   - <view class="fs22">{{item.market_price}}</view>
497   - </view>
498   - </view>
499   - </block>
500   - <blocK wx:else>
501   - <view class="money flex" >
502   - <!-- 办卡价 -->
503   - <view class="flex xc-wc">
504   - <view class="fs24">¥</view>
505   - <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
506   - </view>
507   - </view>
508   - <view class="flex" style="line-height: 28rpx;" >
509   - <!-- 原价 -->
510   - <view class="price flex xc-ash line_th">
511   - <view class="fs22">¥</view>
512   - <view class="fs22">{{item.market_price}}</view>
513   - </view>
514   - </view>
515   - </blocK>
516   - </block>
517   - <block wx:else>
518   - <!-- 如果商品有设置等级价大于0的 -->
519   - <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
520   - <view class="money flex" >
521   - <!-- 办卡价 -->
522   - <view class="flex xc-wc">
523   - <view class="fs24">¥</view>
524   - <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
525   - </view>
526   - <!-- 原价 -->
527   - <view class="price flex xc-ash line_th">
528   - <view class="fs22">¥</view>
529   - <view class="fs22">{{item.market_price}}</view>
530   - </view>
531   -
532   - </view>
533   - <view class="flex" style="line-height: 28rpx;" >
534   - <!-- 等级价 -->
535   - <view class="price flex ai_and">
536   - <view class="fs22">¥</view>
537   - <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
538   - <view class="card_bg">
539   - <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>{{g_filter.get_card_price(item,card_list,1)}}</view>
540   - </view>
541   - </view>
542   - </block>
543   - <block wx:else>
544   - <view class="money flex" >
545   - <!-- 办卡价 -->
546   - <view class="flex xc-wc">
547   - <view class="fs24 wz_red">¥</view>
548   - <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view>
549   - </view>
550   - </view>
551   - <view class="flex" style="line-height: 28rpx;" >
552   - <!-- 原价 -->
553   - <view class="price flex xc-ash line_th">
554   - <view class="fs22">¥</view>
555   - <view class="fs22">{{item.market_price}}</view>
556   - </view>
557   - </view>
558   - </block>
559   - </block>
560   - </block>
561   -
562   - <block wx:else>
563   - <view class='wz_red'>¥{{item.shop_price}}</view>
564   - <view class='del'>¥{{item.market_price}}</view>
565   - </block>
  488 +
  489 + <block wx:if="{{item.prom_price || item.prom_integral}}">
  490 + <view class='wz_red'>
  491 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  492 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  493 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  494 + </view>
  495 + <view class='del'>¥{{item.market_price}}</view>
  496 + </block>
  497 + <!-- 不是活动的情况 -->
  498 + <block wx:else>
  499 +
  500 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}" >
  501 + <!-- 当会员是等级卡的时候 -->
  502 + <block wx:if="{{card_field}}">
  503 + <!-- 等级价>0 -->
  504 + <block wx:if="{{item[card_field]>0}}">
  505 + <view class="money flex" >
  506 + <!-- 办卡价 -->
  507 + <view class="flex xc-wc ai_and">
  508 + <view class="fs24 wz_red">¥</view>
  509 + <view class="fs35 wz_red">{{filter.toFix(item[card_field],2)}}</view>
  510 + <view class="card_bg ellipsis-1">
  511 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  512 + <text class="card_name">{{card_name}}</text>
  513 + </view>
  514 + </view>
  515 + </view>
  516 + <view class="flex" style="line-height: 28rpx;" >
  517 + <!-- 原价 -->
  518 + <view class="price flex xc-ash line_th">
  519 + <view class="fs22">¥</view>
  520 + <view class="fs22">{{item.market_price}}</view>
  521 + </view>
  522 + </view>
  523 + </block>
  524 + <blocK wx:else>
  525 + <view class="money flex" >
  526 + <!-- 办卡价 -->
  527 + <view class="flex xc-wc">
  528 + <view class="fs24">¥</view>
  529 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  530 + </view>
  531 + </view>
  532 + <view class="flex" style="line-height: 28rpx;" >
  533 + <!-- 原价 -->
  534 + <view class="price flex xc-ash line_th">
  535 + <view class="fs22">¥</view>
  536 + <view class="fs22">{{item.market_price}}</view>
  537 + </view>
  538 + </view>
  539 + </blocK>
  540 + </block>
  541 + <block wx:else>
  542 + <!-- 如果商品有设置等级价大于0的 -->
  543 + <block wx:if="{{g_filter.get_card_price(item,card_list,0)}}">
  544 + <view class="money flex" >
  545 + <!-- 办卡价 -->
  546 + <view class="flex xc-wc">
  547 + <view class="fs24">¥</view>
  548 + <view class="fs35">{{filter.toFix(item.shop_price,2)}}</view>
  549 + </view>
  550 + <!-- 原价 -->
  551 + <view class="price flex xc-ash line_th">
  552 + <view class="fs22">¥</view>
  553 + <view class="fs22">{{item.market_price}}</view>
  554 + </view>
  555 +
  556 + </view>
  557 + <view class="flex" style="line-height: 28rpx;" >
  558 + <!-- 等级价 -->
  559 + <view class="price flex ai_and">
  560 + <view class="fs22">¥</view>
  561 + <view class="fs28">{{filter.toFix(g_filter.get_card_price(item,card_list,0),2)}}</view>
  562 + <view class="card_bg">
  563 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>{{g_filter.get_card_price(item,card_list,1)}}</view>
  564 + </view>
  565 + </view>
  566 + </block>
  567 + <block wx:else>
  568 + <view class="money flex" >
  569 + <!-- 办卡价 -->
  570 + <view class="flex xc-wc">
  571 + <view class="fs24 wz_red">¥</view>
  572 + <view class="fs35 wz_red">{{filter.toFix(item.shop_price,2)}}</view>
  573 + </view>
  574 + </view>
  575 + <view class="flex" style="line-height: 28rpx;" >
  576 + <!-- 原价 -->
  577 + <view class="price flex xc-ash line_th">
  578 + <view class="fs22">¥</view>
  579 + <view class="fs22">{{item.market_price}}</view>
  580 + </view>
  581 + </view>
  582 + </block>
  583 + </block>
  584 + </block>
  585 +
  586 + <block wx:else>
  587 + <view class='wz_red'>¥{{item.shop_price}}</view>
  588 + <view class='del'>¥{{item.market_price}}</view>
  589 + </block>
  590 +
  591 +
  592 + </block>
  593 +
  594 +
  595 +
566 596 </view>
567 597 <view class='zs_wz5_x' wx:if="{{object.goodsnum}}">销量:{{item.sales_sum}}件</view>
568 598 </view>
... ... @@ -623,8 +653,12 @@
623 653 <view class='sp_wz'>
624 654 <view class='zs_wz1_3l' wx:if="{{object.goodstit}}">{{aitem.goods_name}}</view>
625 655 <view class='zs_wz2_3l' wx:if="{{object.goodsprice}}">
626   - <block wx:if="{{aitem.prom_price}}">
627   - <view class='wz_red'>¥{{aitem.prom_price}}</view>
  656 + <block wx:if="{{aitem.prom_price || aitem.prom_integral }}">
  657 + <view class='wz_red'>
  658 + <text wx:if="{{aitem.prom_integral}}">{{aitem.prom_integral}}</text>
  659 + <text wx:if="{{aitem.prom_integral && aitem.prom_price}}">+</text>
  660 + <text wx:if="{{aitem.prom_price}}">¥{{aitem.prom_price}}</text>
  661 + </view>
628 662 <view class='del'>¥{{aitem.market_price}}</view>
629 663 </block>
630 664 <block wx:else>
... ...
components/diy_goodsGroup/g_filter.wxs
... ... @@ -47,6 +47,7 @@ var g_filters = {
47 47 //---设置对应的价格名字----
48 48 for(var i=0;i<3;i++) {
49 49 var vl=all_card[i];
  50 + if(!vl) continue;
50 51 if(vl['CorrPrice']=="Price1" && price1>0)
51 52 {
52 53 if(min_price==null) {
... ...
components/goods_list/goods_list.js
... ... @@ -159,7 +159,7 @@ Component({
159 159 var user = getApp().globalData.userInfo;
160 160 if(plusCard) {
161 161 for (var i = 0; i < plusCard.length; i++) {
162   - if (user && (user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
  162 + if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
163 163 continue;
164 164 }
165 165 var name = "card" + plusCard[i].CorrPrice.toLowerCase();
... ...
components/goods_list/goods_list.wxml
... ... @@ -12,10 +12,12 @@
12 12 <!-- 商品名称 -->
13 13 <view class="goods_name ellipsis-2 fs28">{{item.goods_name}}</view>
14 14 <!-- 判断是否有活动价 -->
15   - <block wx:if="{{item.prom_price>0}}">
16   - <view class="money flex">
  15 + <block wx:if="{{item.prom_price>0 || item.prom_integral>0}}">
  16 + <view class="money flex xc-wc" >
  17 + <text wx:if="{{item.prom_integral}}"><text class="fs35" style="font-weight: bold;">{{item.prom_integral}}</text>积分</text>
  18 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
17 19 <!-- 活动价 -->
18   - <view class="flex xc-wc">
  20 + <view class="flex xc-wc" wx:if="{{item.prom_price}}">
19 21 <view class="fs24">¥</view>
20 22 <view class="fs35">{{item.prom_price}}</view>
21 23 </view>
... ...
components/qr_code/qr_code.wxml
... ... @@ -11,14 +11,15 @@
11 11 <view class="q_code">{{object.val}}</view>
12 12 </view>
13 13 <view class="qrcode_rim {{is_fw==0?'mt':'mts'}}">
14   - <canvas class="qrcode" canvas-id="qrcode{{item.index}}" wx:for="{{barcode_canvas}}" />
15   - <view class="r-code">{{object.content}}</view>
  14 + <canvas class="qrcode" canvas-id="qrcode{{item.index}}" wx:for="{{barcode_canvas}}" />
  15 + <view class="r-code">{{object.content}}</view>
16 16 <view class="r-code flex" wx:if="{{object.is_quan}}">有效时间:{{object.now}} 至 <view>{{object.validay}}</view></view>
17 17 <block wx:if="{{object.is_quan}}">
18 18 <view class="r-code" wx:if="{{object.name}}">使用说明: 仅{{object.name}}使用</view>
19 19 <view class="r-code" wx:else>使用说明: 全场通用</view>
20 20 </block>
21   - <view></view>
  21 + <view wx:if="{{object.code}}" class="code_show">{{object.code}}</view>
  22 + <view></view>
22 23 </view>
23 24 </view>
24 25  
... ...
components/qr_code/qr_code.wxss
... ... @@ -78,11 +78,11 @@ letter-spacing:6rpx;
78 78 /* 二维码边框*/
79 79 .qrcode_rim {
80 80 width: 550rpx;
81   - height:544rpx;
  81 + height:544rpx;
82 82 display:flex;
83 83 flex-direction:column;
84 84 position: absolute;
85   -left: 74rpx;
  85 +left: 75rpx;
86 86  
87 87 }
88 88 .qrcode{
... ... @@ -125,4 +125,8 @@ margin-top: -5.5rpx;
125 125 .flex{
126 126 display: flex;
127 127 justify-content:center;
  128 +}
  129 +
  130 +.code_show{
  131 + text-align: center;position: relative; left: -20rpx;
128 132 }
129 133 \ No newline at end of file
... ...
packageA/pages/activity_share/activity_share.js
... ... @@ -225,7 +225,7 @@ Page({
225 225 clickTab2(e) {
226 226 if(this.data.currentIndex2!=e.target.dataset.index){
227 227 this.setData({
228   - currentIndex2: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[],
  228 + currentIndex2: e.target.dataset.index,is_no_data:0,is_no_more:0,list:[],list2:[]
229 229 });
230 230 this.data.is_load=0;
231 231 this.data.currentPage=1;
... ... @@ -303,6 +303,10 @@ Page({
303 303 var th=this;
304 304 var prom_goods=null;
305 305 var hui_active=this.data.hui_active;
  306 + th.data.is_no_more2=0;
  307 + th.data.is_no_data2=0;
  308 + th.data.currentPage2=1;
  309 + th.setData({list2:[]})
306 310  
307 311 //-- 获取优惠活动的详情信息 --
308 312 app.request.promiseGet("/api/weshop/promgoodslist/getPromGoodsInfo/"+hui_active.id,{}).then(res=>{
... ...
packageA/pages/activity_share/activity_share.wxml
... ... @@ -53,7 +53,7 @@
53 53 <!-- 点击拼单时显示 -->
54 54 <view class="flex pdtb6" wx:if="{{currentIndex == 1}}">
55 55 <view class="group-num">已拼{{item.buy_num}}份</view>
56   - <view class="group-type">1人团</view>
  56 + <view class="group-type">{{item.ct_num}}人团</view>
57 57 </view>
58 58 <!-- 公共项 -->
59 59 <view class="fs22 red">剩余:
... ... @@ -153,9 +153,9 @@
153 153 <block wx:if="{{currentIndex2 == 1}}">
154 154 <view class="pdv20 dash-b fs28" bindtap="go_coll_good" data-gid="{{hui_active.main_goods_id}}">
155 155 <view class="popup-title2">必买商品</view>
156   - <view class="popup-title3">商品编号:{{hui_active.goods_sn}}</view>
157   - <view class="popup-title3">{{hui_active.main_goods_name}}</view>
158   - <view class="popup-title3 red">手店价:¥{{g_filter.toFix(hui_active.ginfo.shop_price,2)}}</view>
  156 + <view class="popup-title3">商品编号:{{hui_active.ginfo.goods_sn}}</view>
  157 + <view class="popup-title3">商品名称:{{hui_active.main_goods_name}}</view>
  158 + <view class="popup-title3">手店价:<text class="red">¥{{g_filter.toFix(hui_active.ginfo.shop_price,2)}}</text></view>
159 159 </view>
160 160 <view class="pdv20">
161 161 <view class="popup-title2 fs28">搭配商品</view>
... ... @@ -226,14 +226,14 @@
226 226 </view>
227 227 <view class="pdl20">
228 228 <view class="flex pdb20">
229   - <view class="w50" wx:if="{{item.money}}"><radio checked="true" disabled/>减现金 <text class="red">-{{item.money}}</text></view>
230   - <view class="w50" wx:if="{{item.sale}}"><radio checked="true" disabled/>打折 <text class="red">{{item.sale}}%</text></view>
  229 + <view class="w50" wx:if="{{item.money}}"><radio checked="true" disabled/>减现金 <text class="red">{{item.money}}</text></view>
  230 + <view class="w50" wx:if="{{item.sale}}"><radio checked="true" disabled/>打折 <text class="red">{{item.sale}}折</text></view>
231 231 </view>
232 232 <view class="flex pdb20">
233 233 <view class="w50"><radio wx:if="{{item.past}}" checked="true" disabled/><radio wx:else disabled/>包邮</view>
234 234 <view class="w50">
235 235 <block wx:if="{{item.intValue}}">
236   - <radio disabled/>积分 <text class="red">{{item.intValue}}</text>
  236 + <radio checked="true" disabled/>积分 <text class="red">{{item.intValue}}</text>
237 237 </block>
238 238 <block wx:else>
239 239 <radio disabled/>积分
... ...
packageA/pages/checkin/checkin.js 0 → 100644
  1 +// packageA//pages/checkin/checkin.js
  2 +const app = getApp();
  3 +
  4 +Page({
  5 +
  6 + /**
  7 + * 页面的初始数据
  8 + */
  9 + data: {
  10 + year: '',
  11 + month: '',
  12 + day: '',
  13 + weekArr: ['日', '一', '二', '三', '四', '五', '六'],
  14 + dateArr: [],
  15 + firstDay: '',
  16 + lastDay: '',
  17 + param: null,
  18 + clockNum: 3,
  19 +
  20 + res: null,
  21 + isShowRules: false,
  22 + isCheckIn: false,
  23 + checkInDays: 0, //连续签到天数
  24 + integral: 0, //积分
  25 + checkInNums: 0, //补签次数
  26 + isCheckInDay: '',
  27 +
  28 +
  29 + flag: true,
  30 + },
  31 +
  32 + loadQd(callback) {
  33 + let self = this;
  34 + app.request.get('/api/weshop/qdrecord/getUser/'+ app.globalData.setting.stoid + '/' + app.globalData.user_id, {
  35 + success: function (res) {
  36 + if(callback) callback();
  37 + self.setData({
  38 + res: res.data.data
  39 + });
  40 + self.loadCheckedRecord();
  41 + },
  42 + });
  43 + },
  44 +
  45 + /**
  46 + * 生命周期函数--监听页面加载
  47 + */
  48 + onLoad: function(options) {
  49 + let self = this;
  50 + this.getDate();
  51 + this.setDate();
  52 + var res = wx.getSystemInfoSync();
  53 + this.setData({
  54 + param: res.windowHeight / 12,
  55 + })
  56 +
  57 + this.loadQd();
  58 +
  59 + },
  60 +
  61 +
  62 + // 点击"我的积分"和"去购物"进行跳转
  63 + goto(e) {
  64 + let url = e.target.dataset.url;
  65 + app.goto(url);
  66 + },
  67 +
  68 +
  69 + // 点击显示签到规则
  70 + showRules() {
  71 + if(this.data.isShowRules) {
  72 + this.setData({
  73 + isShowRules: false
  74 + });
  75 + } else {
  76 + this.setData({
  77 + isShowRules: true
  78 + });
  79 + }
  80 + },
  81 +
  82 +
  83 + // 加载签到记录
  84 + loadCheckedRecord() {
  85 + let newDateArr = this.data.dateArr;
  86 + let list;
  87 + let bqlist;
  88 + if(this.data.res.qddaylist) {
  89 + list = this.data.res.qddaylist.split(',');
  90 + for(let item of list) {
  91 + newDateArr[item-1].isCheckIn = true;
  92 + };
  93 + }
  94 + if(this.data.res.curbqdaynum) {
  95 + bqlist = this.data.res.curbqdaynum.split(',');
  96 + for(let item of bqlist) {
  97 + var date = new Date(item);
  98 + newDateArr[date.getDate()-1].isBq = true;
  99 + }
  100 + }
  101 + this.setData({
  102 + dateArr: newDateArr
  103 + });
  104 + },
  105 +
  106 + // 点击签到
  107 + checkInToday() {
  108 + const self = this;
  109 + // 获取今天的签到状态
  110 + let isCheckInToday = this.data.dateArr[this.data.day-1].isCheckIn;
  111 + // 如果还没签到, 可以点击签到
  112 + if(!isCheckInToday) {
  113 + app.request.promisePost('/api/weshop/qdrecord/saveQd', {
  114 + data: {
  115 + store_id: app.globalData.setting.stoid,
  116 + user_id: app.globalData.user_id,
  117 + }
  118 + }).then(res => {
  119 + // 改变签到状态,由false置为true
  120 + // let newDateArr = self.data.dateArr;
  121 + // newDateArr[self.data.day-1].isCheckIn = true;
  122 +
  123 + self.loadQd(function() {
  124 + wx.showToast({
  125 + title: self.data.res.qdintro,
  126 + icon: 'none',
  127 + duration: 1500,
  128 + success: function() {
  129 +
  130 + }
  131 + });
  132 + });
  133 +
  134 + })
  135 + }
  136 + },
  137 +
  138 +
  139 + // 补签
  140 + reCheckIn() {
  141 + var self = this;
  142 + // var i = 0;
  143 + console.log('补签~');
  144 + if(this.data.flag) {
  145 + this.data.flag = false;
  146 + app.request.promisePost('/api/weshop/qdrecord/saveBQd', {
  147 + data: {
  148 + store_id: app.globalData.setting.stoid,
  149 + user_id: app.globalData.user_id,
  150 + daynum: self.data.res.getBQIntegral,
  151 + bqnum: self.data.res.getbqnum2,
  152 + bqintegral: self.data.res.getBQIntegral1,
  153 + }
  154 + }).then(res => {
  155 + // 改变签到状态,由false置为true
  156 + // let newDateArr = self.data.dateArr;
  157 + // newDateArr[self.data.day-1].isCheckIn = true;
  158 + var bqlist = self.data.res.curbqdaynum.split(',').sort();
  159 + var list = [];
  160 + for(let item of bqlist) {
  161 + var date = new Date(item);
  162 + list.push(date.getDate());
  163 + }
  164 +
  165 + self.data.dateArr[list[0]-1].isBq = false;
  166 + self.setData({
  167 + dateArr: self.data.dateArr
  168 + });
  169 +
  170 + self.loadQd(function() {
  171 + self.data.flag = true;
  172 + wx.showToast({
  173 + title: '补签成功',
  174 + icon: 'success',
  175 + duration: 1500,
  176 + success: function() {
  177 +
  178 + }
  179 + });
  180 + });
  181 + })
  182 + }
  183 + },
  184 +
  185 +
  186 +
  187 +
  188 +
  189 + getDate: function() { //获取当月日期
  190 + var mydate = new Date();
  191 + var year = mydate.getFullYear();
  192 + var month = mydate.getMonth(); //0~11: 一月至十二月
  193 + var months = month + 1; //1~12:一月至十二月
  194 + this.data.year = year;
  195 + this.data.month = months;
  196 + this.data.day = mydate.getDate(); //获取当月日期: 1~31
  197 + var fist = new Date(year, month, 1);
  198 + this.data.firstDay = fist.getDay(); //获取当月第一天
  199 + var last = new Date(year, months, 0); //0表示当月最后一天
  200 + this.data.lastDay = last.getDate(); //获取当月最后一天
  201 +
  202 + this.setData({
  203 + year: this.data.year,
  204 + month: this.data.month,
  205 + day: this.data.day,
  206 + firstDay: this.data.firstDay,
  207 + lastDay: this.data.lastDay
  208 + })
  209 + console.log("今天:" + this.data.day);
  210 + },
  211 +
  212 + setDate: function() {
  213 + var day;
  214 + for (var i = 1; i < this.data.lastDay + 1; i++) {
  215 + day = {
  216 + num: i,
  217 + };
  218 + this.data.dateArr.push(day);
  219 + }
  220 + this.setData({
  221 + dateArr: this.data.dateArr,
  222 + // firstDay: this.data.firstDay
  223 + });
  224 + },
  225 +
  226 + // prevMonth: function() { //上一月
  227 + // var months = "";
  228 + // var years = "";
  229 + // if (this.data.month == 1) {
  230 + // years = this.data.year - 1
  231 + // this.data.month = 12;
  232 + // months = this.data.month;
  233 + // } else {
  234 + // years = this.data.year;
  235 + // months = this.data.month - 1;
  236 + // }
  237 +
  238 + // var first = new Date(years, months - 1, 1);
  239 + // this.data.firstDay = first.getDay();
  240 + // var last = new Date(years, months, 0);
  241 + // this.data.lastDay = last.getDate();
  242 +
  243 + // this.setData({
  244 + // month: months,
  245 + // year: years,
  246 + // firstDay: this.data.firstDay,
  247 + // lastDay: this.data.lastDay
  248 + // })
  249 +
  250 + // this.data.dateArr = [];
  251 + // for (var i = 1; i < this.data.lastDay + 1; i++) {
  252 + // this.data.dateArr.push(i);
  253 + // }
  254 + // this.setData({
  255 + // dateArr: this.data.dateArr
  256 + // })
  257 + // },
  258 +
  259 + // nextMonth: function() { //下一月
  260 + // var months = "";
  261 + // var years = "";
  262 + // if (this.data.month == 12) {
  263 + // this.data.month = 0;
  264 + // months = this.data.month;
  265 + // years = this.data.year + 1;
  266 + // } else {
  267 + // months = this.data.month + 1;
  268 + // years = this.data.year;
  269 + // }
  270 + // var months = this.data.month + 1;
  271 + // var first = new Date(years, months - 1, 1);
  272 + // this.data.firstDay = first.getDay();
  273 + // var last = new Date(years, months, 0);
  274 + // this.data.lastDay = last.getDate();
  275 + // this.setData({
  276 + // month: months,
  277 + // year: years,
  278 + // firstDay: this.data.firstDay,
  279 + // lastDay: this.data.lastDay
  280 + // })
  281 +
  282 + // this.data.dateArr = [];
  283 + // for (var i = 1; i < this.data.lastDay + 1; i++) {
  284 + // this.data.dateArr.push(i);
  285 + // }
  286 + // this.setData({
  287 + // dateArr: this.data.dateArr
  288 + // })
  289 + // },
  290 +
  291 +})
... ...
packageA/pages/checkin/checkin.json 0 → 100644
  1 +{
  2 + "usingComponents": {},
  3 + "navigationBarTitleText": "签到领积分",
  4 + "enablePullDownRefresh": false
  5 +}
0 6 \ No newline at end of file
... ...
packageA/pages/checkin/checkin.wxml 0 → 100644
  1 +<!--packageA//pages/checkin/checkin.wxml-->
  2 +<wxs src="checkin.wxs" module="myUtil"></wxs>
  3 +<view class="checkin-container">
  4 + <view class="rule-container flex">
  5 + <view class="points" bindtap="goto" data-url="/pages/user/integral/integral"><image class="coin" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/integral/coins.png"></image>我的积分</view>
  6 + <view class="rule" bindtap="showRules">规则</view>
  7 + </view>
  8 +
  9 + <view class="list flex">
  10 + <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 0)-1].isCheckIn ? 'active':''}}">
  11 + <view class="circle">+{{res.cday1}}</view>
  12 + <view class="fs26">{{myUtil.setDate(year, res.sday2, 0)}}日</view>
  13 + </view>
  14 + <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 1)-1].isCheckIn ? 'active':''}}">
  15 + <view class="circle">+{{res.daynum}}</view>
  16 + <view class="fs26">{{myUtil.setDate(year, res.sday2, 1)}}日</view>
  17 + </view>
  18 + <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 2)-1].isCheckIn ? 'active':''}}">
  19 + <view class="circle">+{{res.tdayc1}}</view>
  20 + <view class="fs26">{{myUtil.setDate(year, res.sday2, 2)}}日</view>
  21 + </view>
  22 + <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 3)-1].isCheckIn ? 'active':''}}">
  23 + <view class="circle">+{{res.tdayc2}}</view>
  24 + <view class="fs26">{{myUtil.setDate(year, res.sday2, 3)}}日</view>
  25 + </view>
  26 + <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 4)-1].isCheckIn ? 'active':''}}">
  27 + <view class="circle">+{{res.tdayc3}}</view>
  28 + <view class="fs26">{{myUtil.setDate(year, res.sday2, 4)}}日</view>
  29 + </view>
  30 + <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 5)-1].isCheckIn ? 'active':''}}">
  31 + <view class="circle">+{{res.tdayc4}}</view>
  32 + <view class="fs26">{{myUtil.setDate(year, res.sday2, 5)}}日</view>
  33 + </view>
  34 + <view class="list-item {{dateArr[myUtil.setDate(year, res.sday2, 6)-1].isCheckIn ? 'active':''}}">
  35 + <view class="circle">+{{res.tdayc5}}</view>
  36 + <view class="fs26">{{myUtil.setDate(year, res.sday2, 6)}}日</view>
  37 + </view>
  38 + </view>
  39 +
  40 + <view class="btn-container">
  41 + <view class="btn" bindtap="checkInToday">
  42 + <text class="iconfont icon-rili"></text>{{!dateArr[day-1].isCheckIn ? '立即签到':'今日已签到'}}
  43 + </view>
  44 + <view class="btn" wx:if="{{res.curbqdaynum}}" bindtap="reCheckIn"><text class="iconfont icon-buqian"></text>补签(-10分)</view>
  45 + </view>
  46 +
  47 +
  48 + <!-- <view class="current">
  49 + <view class="f-vc">当前连续签到:<text class="days fs34">{{res.getlxnum}}</text> 天</view>
  50 + <view class="f-vc">当前积分:<text class="fs34">{{integral}}</text></view>
  51 + </view> -->
  52 +
  53 + <!-- <view class="goleft iconfont icon-jianzuo" bindtap="prevMonth">a</view> -->
  54 +
  55 + <view class="calendar-container">
  56 + <view class="calendar-wrapper">
  57 + <view class="calendar-title">
  58 + <view>{{year}}年{{month}}月</view>
  59 + <view class="fs24" style="color:#999;">补签卡:{{res.getkbqnum}}</view>
  60 + </view>
  61 + <view class="calendar">
  62 + <!-- <view class="selectDate"> -->
  63 + <!-- <view class="goleft iconfont icon-jianzuo" bindtap="prevMonth">a</view> -->
  64 + <!-- <view class="date-wrap">
  65 + {{year}}年{{month}}月
  66 + </view> -->
  67 + <!-- <view class="goright iconfont icon-jianzuo" bindtap="nextMonth">b</view> -->
  68 + <!-- </view> -->
  69 + <view class="week">
  70 + <view wx:for="{{weekArr}}" wx:for-index="index" wx:for-item="item" wx:key="key" style="height:{{param-17}}px;line-height:{{param-17}}px;flex:1;">{{item}}</view>
  71 + </view>
  72 +
  73 + <view class="date">
  74 + <block wx:for="{{dateArr}}" wx:for-index="index" wx:for-item="item" wx:key="key">
  75 + <!-- <view style="{{index ==0?'margin-left:calc(100%/7 * ' + firstDay + ');':''}}width:calc(100%/7);line-height:80rpx;" class="{{index+1==day?'today':''}} {{index+1==day&&isClock?'clockOn':''}}" ><view class="day">{{item}}</view></view> -->
  76 + <view style="{{index ==0?'margin-left:calc(100%/7 * ' + firstDay + ');':''}}width:calc(100%/7);line-height:80rpx;" class="{{item.isCheckIn ? 'active':''}} {{res.curbqdaynum&&item.isBq ? 'bq':''}}" bindtap="clickDay" data-day="{{item.num}}">
  77 + <view class="day">{{item.num}}</view>
  78 + </view>
  79 + </block>
  80 + </view>
  81 +
  82 + </view>
  83 + </view>
  84 +
  85 + </view>
  86 +
  87 + <view class="jfbuy-container">
  88 + <view class="jfbuy flex">
  89 + <image class="jfbuy-img" src="https://mshop-lib.yolipai.net/template/mobile/new/static/images/integral/liwu.png"></image>
  90 + <view class="right">
  91 + <view>
  92 + <view class="t1">小积分大作为</view>
  93 + <view class="t2">积分抵用现金,积少成多</view>
  94 + </view>
  95 + <view class="t-c">
  96 + <view class="btn-buy" bindtap="goto" data-url="/packageA/pages/jfbuy/jfbuy">去购物 Go!</view>
  97 + </view>
  98 + </view>
  99 + </view>
  100 + </view>
  101 +
  102 + <view class="popup-container" wx:if="{{isShowRules}}">
  103 + <view class="popup-wrapper">
  104 + <view class="popup">
  105 + <view class="popup-title">签到规则</view>
  106 + <view class="popup-content">1.每日签到领积分</view>
  107 + </view>
  108 + <view class="popup-close">
  109 + <text class="btn-close" bindtap="showRules">X</text>
  110 + </view>
  111 + </view>
  112 + </view>
  113 +
  114 +</view>
... ...
packageA/pages/checkin/checkin.wxs 0 → 100644
  1 +var myUtil = {
  2 + setDate: function(year, startDate, num) {
  3 + var date = getDate(year + '-' + startDate);
  4 + date.setDate(date.getDate() + num);
  5 + date = getDate(date).getDate();
  6 + return date;
  7 + },
  8 +
  9 + // dateDiff: function(firstDate,secondDate) {
  10 + // var firstDate = new Date(firstDate);
  11 + // var secondDate = new Date(secondDate);
  12 + // var diff = Math.abs(firstDate.getTime() - secondDate.getTime());
  13 + // var result = parseInt(diff / (1000 * 60 * 60 * 24));
  14 + // return result;
  15 + // },
  16 +};
  17 +
  18 +module.exports = {
  19 + setDate: myUtil.setDate,
  20 +};
0 21 \ No newline at end of file
... ...
packageA/pages/checkin/checkin.wxss 0 → 100644
  1 +/* packageA//pages/checkin/checkin.wxss */
  2 +@charset "utf-8";
  3 +page,
  4 +.checkin-container {
  5 + /* height: 100%;
  6 + overflow: hidden; */
  7 +}
  8 +
  9 +.checkin-container {
  10 + background: linear-gradient(#FF7A07, #FF980F, white 95%);
  11 + background-repeat: no-repeat;
  12 +}
  13 +
  14 +.checkin-container {
  15 + /* background-color: #3F7EFF; */
  16 +}
  17 +
  18 +.rule-container {
  19 + padding-top: 40rpx;
  20 + align-items: center;
  21 + justify-content: space-between;
  22 + position: relative;
  23 +}
  24 +.points {
  25 + background-color: #FFBC47;
  26 + color: #333;
  27 + font-size: 26rpx;
  28 + border-top-right-radius: 25rpx;
  29 + border-bottom-right-radius: 25rpx;
  30 + display: flex;
  31 + align-items: center;
  32 + padding-right: 20rpx;
  33 + line-height: 50rpx;
  34 +}
  35 +.rule {
  36 + padding: 10rpx 20rpx;
  37 + color: #FFBC47;
  38 + font-size: 26rpx;
  39 +}
  40 +
  41 +.coin {
  42 + width: 30rpx;
  43 + height: 25rpx;
  44 + padding-left: 10rpx;
  45 + padding-right: 6rpx;
  46 +}
  47 +
  48 +.current {
  49 + display: flex;
  50 + justify-content: space-between;
  51 + padding: 60rpx 30rpx 30rpx;
  52 + color: white;
  53 + font-size: 28rpx;
  54 +}
  55 +
  56 +.days {
  57 + font-weight: bold;
  58 + color: #FFE749;
  59 +}
  60 +
  61 +.f-vc {
  62 + display: flex;
  63 + align-items: center;
  64 +}
  65 +
  66 +.btn-container {
  67 + display: flex;
  68 + justify-content: space-around;
  69 + margin-bottom: 80rpx;
  70 +}
  71 +
  72 +.icon-rili,
  73 +.icon-buqian {
  74 + margin-right: 10rpx;
  75 + font-size: 40rpx;
  76 + font-weight: normal;
  77 +}
  78 +
  79 +
  80 +.btn {
  81 + width: 260rpx;
  82 + line-height: 76rpx;
  83 + padding-left: 30rpx;
  84 + padding-right: 30rpx;
  85 + background-color: #FFBC47;
  86 + border-radius: 38rpx;
  87 + color: white;
  88 + text-align: center;
  89 + box-shadow: 0 7px 0 #FF9A45, 0 8px 3px rgba(0, 0, 0, 0.3);
  90 + margin: 0 auto;
  91 + display: flex;
  92 + align-items: center;
  93 + justify-content: center;
  94 + font-weight: bold;
  95 +}
  96 +
  97 +.list {
  98 + margin: 80rpx 20rpx 60rpx;
  99 + color: rgba(255,255,255,.3);
  100 + align-items: center;
  101 + position: relative;
  102 +}
  103 +.list::after {
  104 + content: '';
  105 + position: absolute;
  106 + left: 0;
  107 + right: 0;
  108 + top: 30rpx;
  109 + margin: 0 auto;
  110 + width: 94%;
  111 + height: 10rpx;
  112 + background-color: rgba(255,255,255,.3);
  113 +}
  114 +.list-item {
  115 + width: calc(100% / 7);
  116 + text-align: center;
  117 +}
  118 +.circle {
  119 + width: 68rpx;
  120 + height: 68rpx;
  121 + line-height: 68rpx;
  122 + font-size: 26rpx;
  123 + color: white;
  124 + background-color: #FF9A45;
  125 + margin: 0 auto 10rpx auto;
  126 + position: relative;
  127 + z-index: 3;
  128 +}
  129 +.list-item.active {
  130 + color: white;
  131 + /* font-weight: bold; */
  132 +}
  133 +.list-item.active .circle {
  134 + box-sizing: border-box;
  135 + background-color: #FFBC47;
  136 + /* color: white; */
  137 + border: 4rpx solid white;
  138 + line-height: 64rpx;
  139 + /* box-shadow: 2rpx 2rpx 16rpx #ddd; */
  140 +}
  141 +
  142 +.calendar-container {
  143 + position: relative;
  144 + padding: 0 60rpx;
  145 +}
  146 +.calendar-container::before {
  147 + content: '';
  148 + position: absolute;
  149 + left: 0;
  150 + right: 0;
  151 + top: 0;
  152 + margin: 0 auto;
  153 + width: 680rpx;
  154 + height: 24rpx;
  155 + border-radius: 12rpx;
  156 + /* background-color: #8AAFFC; */
  157 + background: linear-gradient(#CBDAFC, #6E9CFD);
  158 + box-shadow: 0 2rpx 10rpx #6C98F4;
  159 +}
  160 +.calendar-wrapper {
  161 + background: linear-gradient(#BAD4FD, white 6rpx);
  162 + position: relative;
  163 + z-index: 2;
  164 + width: 100%;
  165 + top: 12rpx;
  166 + left: 0;
  167 + border-bottom-left-radius: 16rpx;
  168 + border-bottom-right-radius: 16rpx;
  169 + box-shadow: 0 2rpx 16rpx #999;
  170 +}
  171 +.calendar-title {
  172 + text-align: center;
  173 + line-height: 86rpx;
  174 + border-bottom: 2rpx solid #E0E6EE;
  175 + display: flex;
  176 + align-items: center;
  177 + padding: 0 20rpx;
  178 + justify-content: space-between;
  179 +}
  180 +
  181 +.calendar {
  182 + /* height: 400rpx; */
  183 + font-size: 26rpx;
  184 + color: #838E9C;
  185 + padding-bottom: 20rpx;
  186 +}
  187 +.week {
  188 + display: flex;
  189 + flex-wrap: wrap;
  190 + text-align: center;
  191 +}
  192 +
  193 +
  194 +.jfbuy-container {
  195 + padding: 60rpx 40rpx 40rpx;
  196 +}
  197 +.jfbuy {
  198 + /* border: 2rpx solid black; */
  199 + border-radius: 16rpx;
  200 + padding: 40rpx 30rpx;
  201 + background-color: #FF980F;
  202 + box-shadow: 0 2rpx 16rpx #FF7A07;
  203 + /* position: fixed;
  204 + width: 100%;
  205 + bottom: 0; */
  206 + /* padding: 40rpx 20rpx; */
  207 +}
  208 +
  209 +.jfbuy-img {
  210 + width: 260rpx;
  211 + height: 180rpx;
  212 + padding-right: 40rpx;
  213 +}
  214 +.t1 {
  215 + font-weight: bolder;
  216 + color: white;
  217 +}
  218 +.t2 {
  219 + color: white;
  220 + font-size: 24rpx;
  221 + padding-top: 10rpx;
  222 +}
  223 +.right {
  224 + display: flex;
  225 + flex-direction: column;
  226 + justify-content: space-between;
  227 + flex: 1;
  228 +}
  229 +.btn-buy {
  230 + /* padding: 20rpx 10rpx; */
  231 + border: 2rpx solid white;
  232 + color: white;
  233 + line-height: 60rpx;
  234 + border-radius: 30rpx;
  235 +}
  236 +
  237 +.today .day {
  238 + /* background-color: skyblue;
  239 + border-radius: 50%; */
  240 + /* color: white; */
  241 + /* width: 44rpx;
  242 + height: 44rpx;
  243 + line-height: 44rpx; */
  244 + /* border-radius: 50%; */
  245 + /* background-color: rgba(255,188,71,.6); */
  246 + /* box-shadow: 0 2rpx 12rpx #FFBC47; */
  247 +}
  248 +
  249 +.active .day,
  250 +.bq .day {
  251 + position: relative;
  252 +}
  253 +
  254 +.active .day::after {
  255 + content: '';
  256 + position: absolute;
  257 + width: 10rpx;
  258 + height: 10rpx;
  259 + border-radius: 50%;
  260 + background-color: #FFBC47;
  261 + left: 0;
  262 + right: 0;
  263 + bottom: 12rpx;
  264 + margin: auto;
  265 + box-shadow: 0 2rpx 12rpx #FFBC47;
  266 +}
  267 +
  268 +.bq .day {
  269 + background-color: #eee;
  270 +}
  271 +
  272 +.bq .day::before {
  273 + position: absolute;
  274 + top: 4rpx;
  275 + right: 0;
  276 + content: '补';
  277 + color: white;
  278 + font-size: 16rpx;
  279 + line-height: 16rpx;
  280 + z-index: 5;
  281 +}
  282 +.bq .day::after {
  283 + position: absolute;
  284 + top: 0;
  285 + right: 0;
  286 + content: '';
  287 + width: 0;
  288 + border-top: 34rpx solid #ccc;
  289 + border-left: 34rpx solid transparent;
  290 +
  291 +}
  292 +
  293 +
  294 +.popup-container {
  295 + position: fixed;
  296 + top: 0;
  297 + bottom: 0;
  298 + left: 0;
  299 + right: 0;
  300 + z-index: 99;
  301 + background-color: rgba(0,0,0,.5);
  302 +}
  303 +
  304 +.popup-wrapper {
  305 + position: absolute;
  306 + width: 80%;
  307 + max-height: 880rpx;
  308 + top: 0;
  309 + bottom: 0;
  310 + left: 0;
  311 + right: 0;
  312 + margin: auto;
  313 + display: flex;
  314 + flex-direction: column;
  315 + justify-content: center;
  316 + align-items: center;
  317 +}
  318 +
  319 +.popup {
  320 + padding: 30rpx;
  321 + background-color: white;
  322 + border-radius: 20rpx;
  323 + max-height: 800rpx;
  324 + overflow: auto;
  325 +}
  326 +
  327 +.popup-title {
  328 + font-weight: 28rpx;
  329 + font-weight: bold;
  330 + padding-bottom: 20rpx;
  331 +}
  332 +
  333 +.popup-content {
  334 + text-align: justify;
  335 +}
  336 +
  337 +.popup-close {
  338 + color: white;
  339 + text-align: center;
  340 + padding-top: 20rpx;
  341 +}
  342 +.btn-close {
  343 + display: inline-block;
  344 + width: 50rpx;
  345 + height: 50rpx;
  346 + line-height: 50rpx;
  347 + border-radius: 50%;
  348 + border: 4rpx solid white;
  349 +}
  350 +
  351 +.date {
  352 + width: 100%;
  353 + display: flex;
  354 + flex-wrap: wrap;
  355 + text-align:center;
  356 +}
... ...
packageA/pages/chongzhi/chongzhi.js 0 → 100644
  1 +// packageA//pages/chongzhi/chongzhi.js
  2 +const app = getApp();
  3 +var util = require('../../../utils/util.js');
  4 +
  5 +Page({
  6 +
  7 + /**
  8 + * 页面的初始数据
  9 + */
  10 + data: {
  11 + url: app.globalData.setting.imghost,
  12 + imgAd: '',
  13 + ad_color:'',
  14 +
  15 + currentIndex: 0,
  16 + list: null,
  17 +
  18 + // 检测是否已经发送请求,防止重复发送请求
  19 + isLoading: false,
  20 + // 检测是否有更多数据,true为没有更多数据,false为还有数据
  21 + noMore: false,
  22 + // 当前页数
  23 + pageNum: 1,
  24 +
  25 + },
  26 +
  27 + /**
  28 + * 生命周期函数--监听页面加载
  29 + */
  30 + onLoad: function (options) {
  31 +
  32 +
  33 + var self = this;
  34 +
  35 + this.getData(true,'/api/weshop/users/pageNewVIPAddMoney',{
  36 + store_id: app.globalData.userInfo.store_id,
  37 + user_id: app.globalData.userInfo.user_id,
  38 + IsPos: 0,
  39 + });
  40 +
  41 + app.request.get('/api/weshop/ad/page', {
  42 + data: {
  43 + pid: 601,
  44 + store_id: app.globalData.userInfo.store_id,
  45 + enabled: 1,
  46 + },
  47 + success: function (res) {
  48 + // console.log('604',res.data.data[0].ad_code);
  49 + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0 ){
  50 + var a = res.data.data.pageData;
  51 + self.setData({
  52 + imgAd: a[0].ad_code,
  53 + ad_color: a[0].bgcolor,
  54 + });
  55 + }
  56 +
  57 +
  58 + },
  59 + });
  60 + },
  61 +
  62 +
  63 + /**
  64 + * 生命周期函数--监听页面显示
  65 + */
  66 + onShow: function () {
  67 +
  68 + },
  69 +
  70 + /**
  71 + * 页面相关事件处理函数--监听用户下拉动作
  72 + */
  73 + onPullDownRefresh: function () {
  74 +
  75 + },
  76 +
  77 + /**
  78 + * 页面上拉触底事件的处理函数
  79 + */
  80 + onReachBottom: function () {
  81 + console.log('上拉加载');
  82 + var data = this.data.saveData;
  83 + // 数据总量
  84 + var total = this.data.result.total;
  85 + // 单页最大数据量
  86 + var pageSize = this.data.result.pageSize;
  87 +
  88 + if((total !== 0)&&(total <= pageSize)) {
  89 + this.setData({
  90 + noMore: true
  91 + });
  92 + };
  93 +
  94 + if(!this.data.isLoading && !this.data.noMore) {
  95 + this.setData({
  96 + isLoading: true,
  97 + pageNum: this.data.pageNum + 1
  98 + });
  99 +
  100 + data.page = this.data.pageNum;
  101 +
  102 + this.getData(false,'/api/weshop/users/pageNewVIPAddMoney',data);
  103 + };
  104 + },
  105 +
  106 + /**
  107 + * 用户点击右上角分享
  108 + */
  109 + onShareAppMessage: function () {
  110 +
  111 + },
  112 +
  113 +
  114 + onClickTab(e) {
  115 + var data = {
  116 + store_id: app.globalData.userInfo.store_id,
  117 + user_id: app.globalData.userInfo.user_id,
  118 + page: 1,
  119 + };
  120 +
  121 + this.setData({
  122 + currentIndex: e.target.dataset.index,
  123 + list: [],
  124 + });
  125 +
  126 + if(e.target.dataset.index == 0) {
  127 + data.IsPos = 0;
  128 +
  129 + } else {
  130 + data.IsPos = 1;
  131 +
  132 + this.setData({
  133 + saveData: data
  134 + });
  135 + }
  136 + this.getData(true,'/api/weshop/users/pageNewVIPAddMoney',data);
  137 + },
  138 +
  139 +
  140 + // 请求数据
  141 + getData(isInit, url, data, callback) {
  142 + var self = this;
  143 + // 请求数据
  144 + app.request.get(url, {
  145 + data: data,
  146 + success: function (res) {
  147 + console.log('res-->', res);
  148 + // 请求成功后,把正在请求加载状态置为false
  149 + self.setData({
  150 + isLoading: false,
  151 + });
  152 + // 检测是否是初始化第一次加载
  153 + if(isInit) {
  154 + //第一页数据直接赋值
  155 + self.setData({
  156 + list: res.data.data.pageData,
  157 + // 这里保存了一份完整的响应数据
  158 + result: res.data.data,
  159 + });
  160 + } else {
  161 + // 下一页的数据拼接在原有数据后面
  162 + self.setData({
  163 + list: self.data.list.concat(res.data.data.pageData)
  164 + });
  165 + };
  166 + console.log('result', self.data.list);
  167 + // 回调函数
  168 + if(callback) callback();
  169 + // 1、第一次请求返回的数据为空,显示‘没有更多了’;
  170 + // 2、后面的请求,如果返回的数据为空,就表示没有下一页了,noMore置为true,这样上拉加载scrollToLower不再发起请求;
  171 + if((res.data.data.pageData.length === 0) || (res.data.data.total <= res.data.data.pageSize)) {
  172 + self.setData({
  173 + noMore: true
  174 + });
  175 + };
  176 + },
  177 + });
  178 + },
  179 +
  180 +
  181 + goDetails(e) {
  182 + let id = e.currentTarget.dataset.id;
  183 + app.goto('../chongzhiDetails/chongzhiDetails?id=' + id+"&type=1");
  184 + },
  185 +
  186 + viewDetails(e){
  187 + var index=e.currentTarget.dataset.index;
  188 + var WriteOffCode=this.data.list[index].WriteOffCode;
  189 + var qrcode = this.selectComponent("#qrcode"); //组件的id
  190 + var code=WriteOffCode;
  191 + var e={is_fw:1,val:code,code:code}
  192 + qrcode.open(e);
  193 +
  194 + },
  195 +
  196 + // 检测上拉滚动到底部
  197 + // scrollToLower: function (requestData, callback) {
  198 + // // 数据总量
  199 + // var total = this.data.result.total;
  200 + // // 单页最大数据量
  201 + // var pageSize = this.data.result.pageSize;
  202 +
  203 + // if((total !== 0)&&(total <= pageSize)) {
  204 + // this.setData({
  205 + // noMore: true
  206 + // });
  207 + // };
  208 +
  209 + // if(!this.data.isLoading && !this.data.noMore) {
  210 + // this.setData({
  211 + // isLoading: true,
  212 + // pageNum: this.data.pageNum + 1
  213 + // });
  214 +
  215 + // requestData.data.page = this.data.pageNum;
  216 +
  217 + // this.getData(false, requestData, callback);
  218 + // };
  219 + // },
  220 +
  221 +
  222 + onerror:function(e){
  223 + var _errImg = e.currentTarget.dataset.errimg;
  224 + var _errObj = {};
  225 + _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
  226 + this.setData(_errObj);
  227 + }
  228 +})
0 229 \ No newline at end of file
... ...
packageA/pages/chongzhi/chongzhi.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "充值有礼",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "nodata": "/components/nodata/nodata",
  6 + "qrcode":"/components/qr_code/qr_code"
  7 + }
  8 +}
0 9 \ No newline at end of file
... ...
packageA/pages/chongzhi/chongzhi.wxml 0 → 100644
  1 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
  2 +<view class="container">
  3 + <!-- 封面 -->
  4 + <view class="banner-container">
  5 + <image class="img-block" src="{{url + imgAd}}" binderror="onerror" data-errimg="imgAd"></image>
  6 + </view>
  7 + <!-- 列表 -->
  8 + <view>
  9 + <!-- 标题 -->
  10 + <view class="title flex" bindtap="onClickTab">
  11 + <view class="t-item {{currentIndex == 0 ? 'active':''}}" data-index="0">待核销</view>
  12 + <view class="t-item {{currentIndex == 1 ? 'active':''}}" data-index="1">已核销</view>
  13 + </view>
  14 + <!-- 内容 -->
  15 + <view class="list" style="background-color: {{ad_color?ad_color:'#ff9a00'}};">
  16 + <block wx:for="{{list}}" >
  17 + <view class="l-item" bindtap="goDetails" data-id="{{item.ID}}" >
  18 + <!-- 上 -->
  19 + <view class="{{currentIndex == 0 ? 'top flex':'flex'}}">
  20 + <!-- 左 -->
  21 + <!-- <view class="left">
  22 + <image class="img-block"></image>
  23 + </view> -->
  24 + <!-- 右 -->
  25 + <view class="right">
  26 + <view class="fs28 ellipsis-2 txt-justify">{{item.ActName}}</view>
  27 + <view>
  28 + <view class="price fs24">零售价:¥{{item.PosPrice}}</view>
  29 + <view class="date fs24">{{(currentIndex == 0 ? '兑换截止日期': '核销时间') + ':' + item.BeginDate + '至' + item.EndDate}}</view>
  30 + </view>
  31 + </view>
  32 + </view>
  33 + <!-- 下 -->
  34 + <view class="bottom" wx:if="{{currentIndex == 0}}" >
  35 + <text wx:if="{{g_filter.is_acting(item.EndDate)}}"
  36 + catchtap="viewDetails" data-index="{{index}}" class="btn" >立即使用</text>
  37 + <text data-index="{{index}}" class="btn details" >详情</text>
  38 + </view>
  39 + <view class="bottom" wx:if="{{currentIndex == 1}}" >
  40 + <text data-index="{{index}}" class="btn" >已核销</text>
  41 + <text data-index="{{index}}" class="btn details" >详情</text>
  42 + </view>
  43 +
  44 + </view>
  45 + </block>
  46 + <view hidden="{{!noMore}}" class="no-more t-c" wx:if="{{list.length !== 0}}">- 已全部加载 -</view>
  47 + </view>
  48 +
  49 + <nodata nodataContainer="nodata" wx:if="{{list.length === 0}}">暂无数据</nodata>
  50 +
  51 + </view>
  52 +</view>
  53 +
  54 +<qrcode id="qrcode" ></qrcode>
0 55 \ No newline at end of file
... ...
packageA/pages/chongzhi/chongzhi.wxss 0 → 100644
  1 +/* packageA/pages/chongzhi/chongzhi.wxss */
  2 +@charset "utf-8";
  3 +
  4 +page {
  5 + /* background-color: #FA437E; */
  6 +}
  7 +
  8 +.banner-container {
  9 + height: 400rpx;
  10 +}
  11 +
  12 +
  13 +.title {
  14 + background-color: white;
  15 + position: relative;
  16 +}
  17 +
  18 +.title::after {
  19 + content: '';
  20 + position: absolute;
  21 + width: 2rpx;
  22 + height: 50%;
  23 + background-color: #f5f5f5;
  24 + left: 0;
  25 + right: 0;
  26 + top: 0;
  27 + bottom: 0;
  28 + margin: auto;
  29 +}
  30 +
  31 +.t-item {
  32 + width: 50%;
  33 + text-align: center;
  34 + line-height: 100rpx;
  35 + font-size: 30rpx;
  36 + position: relative;
  37 +}
  38 +
  39 +.t-item.active {
  40 + color: #FE6867;
  41 + font-weight: bold;
  42 +}
  43 +
  44 +.t-item.active::after {
  45 + content: '';
  46 + position: absolute;
  47 + width: 10%;
  48 + height: 4rpx;
  49 + background-color: #FE6867;
  50 + bottom: 0;
  51 + left: 0;
  52 + right: 0;
  53 + margin: 0 auto;
  54 +}
  55 +
  56 +
  57 +.list {
  58 + padding: 0 20rpx;
  59 + overflow: hidden;
  60 +}
  61 +
  62 +.l-item {
  63 + padding: 20rpx;
  64 + background-color: white;
  65 + border-radius: 16rpx;
  66 + margin-top: 20rpx;
  67 +}
  68 +.img-block {
  69 + display: block;
  70 + width: 100%;
  71 + height: 100%;
  72 + background-color: #ccc;
  73 +}
  74 +
  75 +
  76 +.top {
  77 + padding-bottom: 20rpx;
  78 + border-bottom: 2rpx solid #f2f2f2;
  79 +}
  80 +.bottom {
  81 + padding-top: 20rpx;
  82 + text-align: right;
  83 +}
  84 +.left {
  85 + width: 200rpx;
  86 + height: 200rpx;
  87 + flex-shrink: 0;
  88 + padding-right: 20rpx;
  89 +}
  90 +.right {
  91 + display: flex;
  92 + flex-direction: column;
  93 + justify-content: space-between;
  94 +}
  95 +
  96 +.price {
  97 + text-decoration:line-through;
  98 +}
  99 +
  100 +.date {
  101 + padding-top: 10rpx;
  102 + color: #FE6867;
  103 +}
  104 +
  105 +.btn {
  106 + display: inline-block;
  107 + background-color: #FE6867;
  108 + color: white;
  109 + padding: 20rpx 60rpx;
  110 + font-size: 24rpx;
  111 + border-radius: 8rpx;
  112 +}
  113 +.btn.details{
  114 + margin-left: 8rpx; background-color: #ff9a00;
  115 +}
  116 +
  117 +.nodata {
  118 + text-align: center;
  119 + /* background-color: #f2f2f2; */
  120 +}
  121 +
  122 +.no-more {
  123 + line-height: 3;
  124 + color: #ccc;
  125 + font-size: 26rpx;
  126 +}
  127 +
  128 +.t-c {
  129 + text-align: center;
  130 +}
0 131 \ No newline at end of file
... ...
packageA/pages/chongzhi/g_filter.wxs 0 → 100644
  1 +var is_acting = function(endtime){
  2 + //判断结束时间减去当前时间 ,如果当前时间大于0则为True
  3 + endtime = endtime.substring(0, 19);
  4 + var reg = getRegExp("-", "g");
  5 + endtime = endtime.replace(reg, '/');
  6 + var bijiao = getDate(endtime) - getDate();
  7 + return bijiao > 0 ? true : false;
  8 +}
  9 +module.exports = {
  10 + is_acting:is_acting
  11 +}
0 12 \ No newline at end of file
... ...
packageA/pages/chongzhiDetails/chongzhiDetails.js 0 → 100644
  1 +// packageA//pages/chongzhiDetails/chongzhiDetails.js
  2 +var util = require('../../../utils/util.js');
  3 +const app = getApp(),os = app.globalData.setting;
  4 +var regeneratorRuntime = require('../../../utils/runtime.js');
  5 +
  6 +Page({
  7 +
  8 + /**
  9 + * 页面的初始数据
  10 + */
  11 + data: {
  12 + showCode: false,
  13 + result: null,
  14 + show_img:null,
  15 + url: app.globalData.setting.imghost,
  16 + type:0, //0是立即充值 1是购买后的
  17 + is_buying:0,
  18 + },
  19 +
  20 + /**
  21 + * 生命周期函数--监听页面加载
  22 + */
  23 + onLoad: function (options) {
  24 +
  25 + const self = this;
  26 + if(options.type)
  27 + self.setData({type:options.type});
  28 +
  29 + var UserInfo=app.globalData.userInfo;
  30 + if(!UserInfo) {
  31 + getApp().goto("/pages/togoin/togoin");
  32 + return false;
  33 + }
  34 +
  35 +
  36 + getApp().request.get("/api/wx/weappSendlist/page", {
  37 + data: {
  38 + store_id: os.stoid,
  39 + typeid: "1002"
  40 + },
  41 + success: function(res) {
  42 + if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  43 + var template_id = res.data.data.pageData[0].template_id;
  44 + self.setData({template_id:template_id});
  45 +
  46 + }
  47 + },
  48 + })
  49 +
  50 +
  51 + getApp().request.promiseGet("/api/weshop/ad/page",{
  52 + data:{store_id:os.stoid,enabled:1,pid:601}
  53 + }).then(res=>{
  54 + if(res.data.code==0 && res.data.data.pageData && res.data.data.pageData.length>0){
  55 + var a = res.data.data.pageData;
  56 + self.setData({show_img:a[0].ad_code,ad_color:a[0].bgcolor});
  57 + }
  58 + })
  59 +
  60 + var api="/api/weshop/users/getAddmoneyactDetails";
  61 + if(options.type==1){
  62 + api="/api/weshop/users/getBuyaddmoneyactDetails";
  63 + }
  64 +
  65 + app.request.get(api, {
  66 + data: {
  67 + Id:options.id,
  68 + store_id:os.stoid,
  69 + user_id: UserInfo.user_id,
  70 + },
  71 + success: function (res) {
  72 + var result=res.data.data;
  73 +
  74 + var now=new Date();
  75 + var reg = RegExp("-", "g");
  76 + var endtime = result.EndDate.replace(reg, '/');
  77 + var end=new Date(endtime);
  78 + result.is_acting=1;
  79 + if(end<now) result.is_acting=0;
  80 +
  81 +
  82 + var givelist=result.givelist;
  83 + if(!givelist) givelist=new Array();
  84 + if(result.Integral){
  85 + var ob={Integral:result.Integral};
  86 + givelist.push(ob);
  87 + }
  88 + if(result.GradeSum){
  89 + var ob={GradeSum:result.GradeSum};
  90 + givelist.push(ob);
  91 + }
  92 +
  93 + self.setData({
  94 + result: result,
  95 + });
  96 +
  97 + },
  98 + });
  99 +
  100 + // this.data.result.WriteOffCode
  101 + },
  102 +
  103 +
  104 + /**
  105 + * 生命周期函数--监听页面显示
  106 + */
  107 + onShow: function () {
  108 +
  109 + },
  110 +
  111 + /**
  112 + * 页面相关事件处理函数--监听用户下拉动作
  113 + */
  114 + onPullDownRefresh: function () {
  115 +
  116 + },
  117 +
  118 + /**
  119 + * 页面上拉触底事件的处理函数
  120 + */
  121 + onReachBottom: function () {
  122 +
  123 + },
  124 +
  125 + /**
  126 + * 用户点击右上角分享
  127 + */
  128 + onShareAppMessage: function () {
  129 +
  130 + },
  131 +
  132 + onUse() {
  133 + var qrcode = this.selectComponent("#qrcode"); //组件的id
  134 + var code=this.data.result.WriteOffCode;
  135 + var e={is_fw:1,val:code,code:code}
  136 + qrcode.open(e);
  137 + },
  138 +
  139 +
  140 + bind_err:function(e){
  141 + var _errImg = e.target.dataset.errorimg;
  142 + var _errObj = {};
  143 + _errObj[_errImg] = "/miniapp/images/default_g_img.gif";
  144 + this.setData(_errObj);
  145 + },
  146 +
  147 + //-- 确定充值 --
  148 + go_buy: function(e) {
  149 + if(this.data.is_buying) return false;
  150 + this.data.is_buying=1;
  151 +
  152 + var money = e.target.dataset.money;
  153 + var advance = e.target.dataset.advance;
  154 + var th=this;
  155 + this.sendsm(function(){
  156 + th.recharge(money, advance);
  157 + })
  158 +
  159 + },
  160 + //确定接口
  161 + async recharge(money, advancek) {
  162 + console.log(money, "有进来吗银行卡", advancek);
  163 + var user_id = getApp().globalData.user_id;
  164 + var store_id = os.stoid;
  165 + var recharge_type = 6;
  166 + var buynum = 1;
  167 + console.log(money, "有进来吗预存劵", advancek, user_id, store_id );
  168 + var e = this,
  169 + perpaid = "";
  170 + await getApp().request.promiseGet("/api/weshop/users/getPay", {
  171 + data: {
  172 + account: money,
  173 + yucun_id: advancek,
  174 + user_id: user_id,
  175 + store_id: store_id,
  176 + recharge_type: recharge_type,
  177 + buynum: buynum ,
  178 + }
  179 + }).then(res => {
  180 + console.log(res);
  181 + this.data.is_buying=0;
  182 + if(res.data.code!=0){
  183 + getApp().confirmBox(res.data.msg);
  184 + return false;
  185 + }
  186 +
  187 +
  188 + var msg = res.data.data;
  189 + var parentSn = msg.order_sn;
  190 + var store_id = os.stoid;
  191 + getApp().request.post("/api/weshop/order/pay/createRechargeOrder", {
  192 + data: {
  193 + parentSn: parentSn,
  194 + store_id: store_id
  195 + },
  196 + success: function (su) {
  197 + console.log("su是什么",su);
  198 + var n=su.data.data;
  199 + console.log("su是什么", su);
  200 +
  201 + e.weixinPay(n,
  202 + function () {
  203 + e.jumpPaymentPage();
  204 + }, function () {
  205 + getApp().showWarning("支付失败");
  206 + })
  207 + }
  208 + })
  209 + })
  210 + },
  211 + //------支付成功页面--------
  212 + jumpPaymentPage: function () {
  213 + wx.redirectTo({
  214 + url:"msg/msg",
  215 + });
  216 + },
  217 +
  218 + //------调起支付框--------
  219 + weixinPay: function (n, success, fail) {
  220 + wx.requestPayment({
  221 + timeStamp: String(n.timeStamp),
  222 + nonceStr: n.nonceStr,
  223 + package: n.packageValue,
  224 + signType: n.signType,
  225 + paySign: n.paySign,
  226 + success: function (n) {
  227 + console.log(n), getApp().showSuccess("支付成功!");
  228 + "function" == typeof success && success();
  229 + wx.redirectTo({
  230 + url: "../deposit/deposit"
  231 + });
  232 + },
  233 + fail: function (n) {
  234 + console.log(n), "requestPayment:fail" == n.errMsg ? getApp().showWarning("支付失败") : "requestPayment:fail cancel" == n.errMsg ? getApp().showWarning("您已取消支付") : getApp().showWarning("支付失败:" + n.errMsg.substr("requestPayment:fail ".length)),
  235 + "function" == typeof fail && fail();
  236 + }
  237 + });
  238 + },
  239 +
  240 + //订阅消息提醒
  241 + sendsm:function(func)
  242 + {
  243 + var template_id = this.data.template_id;
  244 + //授权订阅
  245 + wx.requestSubscribeMessage({
  246 + tmplIds: [template_id],
  247 + success(res) {
  248 + func();
  249 + },
  250 + fail(res) {
  251 + func();
  252 + }
  253 + })
  254 + },
  255 +})
0 256 \ No newline at end of file
... ...
packageA/pages/chongzhiDetails/chongzhiDetails.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "充值有礼",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "qrcode":"/components/qr_code/qr_code"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
packageA/pages/chongzhiDetails/chongzhiDetails.wxml 0 → 100644
  1 +<!--packageA//pages/chongzhiDetails/chongzhiDetails.wxml-->
  2 +<wxs module="g_filter" src="g_filter.wxs"></wxs>
  3 +<view class="container">
  4 + <view>
  5 + <view class="banner-container">
  6 + <image class="img-block" src="{{url+show_img}}" mode="widthFix"
  7 + lazy-load="true" binderror="bind_err" data-errorimg="show_img" ></image></view>
  8 +
  9 + <view class="list">
  10 + <view class="title-container">
  11 + <view class="title">
  12 + <view>女王专享</view>
  13 + <view>你的美丽我来缔造</view>
  14 + </view>
  15 + </view>
  16 + <view style="background-color: {{ad_color?ad_color:'#fff'}};">
  17 + <view class="list-item flex" wx:for="{{result.givelist}}">
  18 + <!-- 左图片 -->
  19 + <view class="avatar">
  20 + <image wx:if="{{item.GiveType=='0'}}" src="{{url}}/miniapp/images/giftbag/gift05.png"></image><!-- 代金券 -->
  21 + <image wx:if="{{item.GiveType=='1'}}" src="{{url}}/miniapp/images/giftbag/gift02.png"></image><!-- 服务项目 -->
  22 + <image wx:if="{{item.GiveType=='2'}}" src="{{url}}/miniapp/images/giftbag/gift01.png"></image><!-- 商品 -->
  23 + <image wx:if="{{item.Integral>0}}" src="{{url}}/miniapp/images/giftbag/gift03.png"></image><!-- 积分 -->
  24 + <image wx:if="{{item.GradeSum>0}}" src="{{url}}/miniapp/images/giftbag/gift04.png"></image><!-- 成长值 -->
  25 + <image wx:if="{{item.PAdvanceItemId>0}}" src="{{url}}/miniapp/images/giftbag/gift01.png"></image><!-- 预存 -->
  26 + </view>
  27 + <!-- 右 -->
  28 + <view class="info">
  29 + <view wx:if="{{item.GiveType=='0'}}">{{item.CouponSum}}元优惠券</view>
  30 + <view wx:elif="{{item.Integral>0}}">{{item.Integral}}积分</view>
  31 + <view wx:elif="{{item.GradeSum>0}}">{{item.GradeSum}}成长值</view>
  32 + <view wx:else>{{item.GiveName}}</view>
  33 + <!-- <view class="fs28 pdv10 txt-justify">节日可免费享受专业美甲,可以享受1次。</view> -->
  34 + <view wx:if="{{item.Qty>0}}" class="t-r fs24">数量:{{item.Qty}}</view>
  35 + </view>
  36 + </view>
  37 + </view>
  38 + </view>
  39 + </view>
  40 +
  41 + <view class="btn-container" >
  42 + <block wx:if="{{result.is_acting}}">
  43 + <text wx:if="{{type==0}}" data-advance="{{result.Id}}" data-money="{{result.BeginSum}}"
  44 + class="btn" bindtap="go_buy">立即充值</text>
  45 + <block wx:else>
  46 + <text wx:if="{{result.AddType==0}}" class="btn" bindtap="onUse">立即使用</text>
  47 + <text wx:if="{{result.AddType==1}}" class="btn" >已核销</text>
  48 + </block>
  49 + </block>
  50 + <block wx:else>
  51 + <text wx:if="{{result.AddType==1}}" class="btn" >已核销</text>
  52 + </block>
  53 + </view>
  54 +
  55 + <qrcode id="qrcode"></qrcode>
  56 +
  57 +</view>
... ...
packageA/pages/chongzhiDetails/chongzhiDetails.wxss 0 → 100644
  1 +/* packageA//pages/chongzhiDetails/chongzhiDetails.wxss */
  2 +@charset "utf-8";
  3 +.c-y {
  4 + color: #FFC736;
  5 +}
  6 +
  7 +.pdv10 {
  8 + padding-top: 10rpx;
  9 + padding-bottom: 10rpx;
  10 +}
  11 +
  12 +.txt-justify {
  13 + text-align: justify;
  14 +}
  15 +
  16 +.container {
  17 + background-color: white;
  18 + padding-bottom: 120rpx;
  19 +}
  20 +
  21 +.banner-container {}
  22 +
  23 +.list {
  24 + /* padding: 0 20rpx;
  25 + background-color: skyblue; */
  26 +}
  27 +
  28 +.list-item {
  29 + align-items: center;
  30 + padding: 20rpx;
  31 +}
  32 +
  33 +
  34 +.title-container {
  35 + padding:40rpx;
  36 + background-color: white;
  37 + letter-spacing:2px;
  38 +}
  39 +
  40 +.title {
  41 + text-align: center;
  42 + position: relative;
  43 + color: #FFC736;
  44 + font-weight: bold;
  45 +}
  46 +
  47 +.title::before,
  48 +.title::after {
  49 + content: '';
  50 + position: absolute;
  51 + width: 15%;
  52 + height: 2rpx;
  53 + background-color: #FFC736;
  54 + top: 0;
  55 + bottom: 0;
  56 + margin: auto 0;
  57 +}
  58 +
  59 +.title::before {
  60 + left: 40rpx;
  61 +}
  62 +
  63 +.title::after {
  64 + right: 40rpx;
  65 +}
  66 +
  67 +.avatar {
  68 + width: 120rpx;
  69 + height: 120rpx;
  70 + line-height: 120rpx;
  71 + border-radius: 50%;
  72 + background-color: pink;
  73 + flex-shrink: 0;
  74 + text-align: center;
  75 +}
  76 +
  77 +.avatar image{ width: 100%; height: 100%;}
  78 +
  79 +.icon-meirong2 {
  80 + color: white;
  81 + font-size: 64rpx;
  82 +}
  83 +
  84 +.info {
  85 + padding-left: 40rpx;
  86 + display: flex;
  87 + flex-direction: column;
  88 + justify-content: center;
  89 + flex: 1;
  90 +}
  91 +
  92 +
  93 +.btn-container {
  94 + position: fixed;
  95 + width: 100%;
  96 + bottom: 0;
  97 + text-align: center;
  98 + padding: 20rpx 0;
  99 + background-color: white;
  100 + border-top: 1rpx solid #f2f2f2;
  101 +}
  102 +
  103 +.btn {
  104 + display: inline-block;
  105 + background-color: #FFC736;
  106 + color: white;
  107 + padding: 20rpx 160rpx;
  108 + border-radius: 40rpx;
  109 + font-size: 28rpx;
  110 +}
  111 +
  112 +.img-block {
  113 + display: block;
  114 + width: 100%;
  115 + height: 100%;
  116 +}
  117 +
  118 +.qr-container {
  119 + position: fixed;
  120 + background-color: rgba(0,0,0,.4);
  121 + top: 0;
  122 + bottom: 0;
  123 + left: 0;
  124 + right: 0;
  125 +}
  126 +.qr {
  127 + background-color: white;
  128 + width: 80%;
  129 + height: 600rpx;
  130 + position: absolute;
  131 + top: 0;
  132 + bottom: 0;
  133 + left: 0;
  134 + right: 0;
  135 + margin: auto;
  136 + text-align: center;
  137 + display: flex;
  138 + flex-direction: column;
  139 + justify-content: center;
  140 +}
  141 +
  142 +.qr-img {
  143 + width: 500rpx;
  144 + height: 500rpx;
  145 + margin: 0 auto;
  146 +}
0 147 \ No newline at end of file
... ...
packageA/pages/chongzhiDetails/g_filter.wxs 0 → 100644
  1 +var is_acting = function(endtime){
  2 + //判断结束时间减去当前时间 ,如果当前时间大于0则为True
  3 + endtime = endtime.substring(0, 19);
  4 + var reg = getRegExp("-", "g");
  5 + endtime = endtime.replace(reg, '/');
  6 + var bijiao = getDate(endtime) - getDate();
  7 + return bijiao > 0 ? true : false;
  8 +}
  9 +module.exports = {
  10 + is_acting:is_acting
  11 +}
0 12 \ No newline at end of file
... ...
packageA/pages/goods_share/goods_share.js
... ... @@ -96,28 +96,32 @@ Page({
96 96 var sw_arr=JSON.parse(swithc_list);
97 97 //---如果后台又开等级卡的开关---
98 98 if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){
99   - th.setData({rank_switch:true});
100   - var user=getApp().globalData.userInfo;
101   - var ti=setInterval(function(){
102   - if(!user) return false;
103   - clearInterval(ti);
  99 + th.setData({rank_switch:true});
  100 + var user=getApp().globalData.userInfo;
  101 +
104 102 //---回调卡的列表---
105 103 th.getPlusCardType(function(ob){
106   - th.setData({card_list:ob.card_list});
107   - if(user.card_field ){
108   - var str = user['card_expiredate'].replace(/-/g, '/');
109   - var end = new Date(str);
110   - end = Date.parse(end) / 1000;
111   - var now = ut.gettimestamp();
112   - //--- 判断是等级会员,且在有效期范围内 ---
113   - if(user.card_field && now<end){
114   - var card_name=ob.name_map.get(user.card_field);
115   - // if(card_name.length>4) card_name=card_name.substring(0,4);
116   - th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list});
117   - }
118   - }
119   - })
120   - },500)
  104 + th.setData({card_list:ob.card_list});
  105 +
  106 + var ti=setInterval(function(){
  107 + if(!user) return false;
  108 + clearInterval(ti);
  109 +
  110 + if(user.card_field ){
  111 + var str = user['card_expiredate'].replace(/-/g, '/');
  112 + var end = new Date(str);
  113 + end = Date.parse(end) / 1000;
  114 + var now = ut.gettimestamp();
  115 + //--- 判断是等级会员,且在有效期范围内 ---
  116 + if(user.card_field && now<end){
  117 + var card_name=ob.name_map.get(user.card_field);
  118 + // if(card_name.length>4) card_name=card_name.substring(0,4);
  119 + th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list});
  120 + }
  121 + }
  122 + },1000)
  123 + })
  124 +
121 125 }
122 126 });
123 127 },
... ... @@ -277,7 +281,7 @@ Page({
277 281 var card_name_map=new Map();
278 282 var user = getApp().globalData.userInfo;
279 283 for (var i = 0; i < plusCard.length; i++) {
280   - if ((user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
  284 + if ((!user || user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
281 285 continue;
282 286 }
283 287 var name="card"+plusCard[i].CorrPrice.toLowerCase();
... ...
packageA/pages/goods_share/goods_share.wxml
... ... @@ -42,20 +42,37 @@
42 42 data-errorimg="list[{{index}}].original_img"></image>
43 43 </view>
44 44 <view class="details">
45   - <view class="ellipsis-2 fs28 name">{{item.goods_name}}</view>
46   - <view class="red pdt14">¥{{item.shop_price}}
47   - <!-- 如果有等级卡的话 -->
48   - <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
49   - <!-- 当会员是等级卡的时候,且卡有钱的时候 -->
50   - <block wx:if="{{card_field && item[card_field]>0}}">
51   - <text class="plus_show">PLUS</text>¥{{item[card_field]}}
52   - </block>
53   - <!-- 当会员不是等级卡的时候,且卡有钱的时候 -->
54   - <block wx:if="{{!card_field && g_filter.get_card_price(item,card_list,0)>0}}">
55   - <text class="plus_show">PLUS</text>¥{{g_filter.get_card_price(item,card_list,0)}}
56   - </block>
57   - </block>
58   - </view>
  45 + <view class="ellipsis-2 fs28 name">{{item.goods_name}}</view>
  46 +
  47 + <view class="flex">
  48 + <view class="red pdt14">¥{{item.shop_price}}</view>
  49 + <view class="txt_line">¥{{item.market_price}}</view>
  50 + </view>
  51 +
  52 + <view class="flex ai-center">
  53 + <!-- 如果有等级卡的话 -->
  54 + <block wx:if="{{g_filter.is_has_rank(rank_switch,item)}}">
  55 + <!-- 当会员是等级卡的时候,且卡有钱的时候 -->
  56 + <block wx:if="{{card_field && item[card_field]>0}}">
  57 + <!-- <text class="plus_show">card_name</text>¥{{item[card_field]}} -->
  58 + <view class="card_bg ellipsis-1 flex ai-center">
  59 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  60 + <text class="card_name">{{card_name}}</text>
  61 + </view>
  62 + <view class="fs28">¥{{filter.toFix(item[card_field],2)}}</view>
  63 +
  64 + </block>
  65 + <!-- 当会员不是等级卡的时候,且卡有钱的时候 -->
  66 + <block wx:if="{{!card_field && g_filter.get_card_price(item,card_list,0)>0}}">
  67 + <view class="card_bg ellipsis-1 flex ai-center">
  68 + <image src="{{url}}/miniapp/images/plus/dj_icon.png"></image>
  69 + <text class="card_name">{{g_filter.get_card_price(item,card_list,1)}}</text>
  70 + </view>
  71 + <view class="fs28">¥{{g_filter.get_card_price(item,card_list,0)}}</view>
  72 +
  73 + </block>
  74 + </block>
  75 + </view>
59 76  
60 77 <view class="flex jc_sb fs24 pdt14">
61 78 <view class="gray">已售:<text class="red">{{item.sales_sum}}</text></view>
... ...
packageA/pages/goods_share/goods_share.wxss
... ... @@ -116,3 +116,28 @@ page {
116 116 margin-left: 10rpx;
117 117 margin-right: 5rpx;
118 118 }
  119 +
  120 +.card_bg {
  121 + box-sizing: border-box;
  122 + padding: 2rpx 10rpx;
  123 + height: 28rpx;
  124 + border-radius: 26rpx;
  125 + font-size: 18rpx;
  126 + line-height: 28rpx;
  127 + max-width: 210rpx;
  128 + background: #333;
  129 + color: #fff;
  130 + margin-left: 8rpx;
  131 +}
  132 +
  133 +.card_bg image {
  134 + width: 19rpx;
  135 + height: 19rpx;
  136 + margin-right: 8rpx;
  137 +}
  138 +
  139 +.txt_line{
  140 + text-decoration: line-through; position: relative;
  141 + top: 23rpx;color: #adadad;
  142 + font-size: 24rpx; margin-left: 10rpx;
  143 + }
... ...
packageA/pages/jfbuy/jfbuy.js
... ... @@ -18,7 +18,8 @@ Page({
18 18 active1: false,
19 19 // 控制佣金
20 20 active2: false,
21   - url: oo.imghost,
  21 + url: oo.imghost,
  22 + h5_url:oo.h5_url,
22 23 //popup
23 24 hiddenPopup: true,
24 25 // 排序
... ... @@ -356,4 +357,12 @@ Page({
356 357 th.isPullDownRefresh = false;
357 358 });
358 359 },
  360 +
  361 + // 点击查看
  362 + viewItemDetails:function(e){
  363 + var index=e.currentTarget.dataset.index;
  364 + var item=this.data.list2[index];
  365 + var url="/pages/goods/goodsInfo/goodsInfo?goods_id="+item.goods_id;
  366 + getApp().goto(url);
  367 + }
359 368 })
360 369 \ No newline at end of file
... ...
packageA/pages/jfbuy/jfbuy.wxml
... ... @@ -6,12 +6,14 @@
6 6 <view bindtap="search_data" class="btn-search">搜索</view>
7 7 </view> -->
8 8  
9   - <view class="banner-container">
10   - <image src="../../images/jfbuy.jpg" class="banner"></image>
  9 + <view class="banner-container flex">
  10 + <image src="{{url}}/miniapp/images/integral/liwu.png?v=1" class="banner"></image>
  11 + <view style="display: inline-block; padding-top: 72rpx;">
  12 + <view class="fs36">小积分大作为</view>
  13 + <view class="fs26" style="color: #999; margin-top: 20rpx;">积分抵用现金,积少成多</view>
  14 + </view>
11 15 </view>
12   -
13   -
14   -
  16 +
15 17 <!-- 列表 -->
16 18 <view class="list-container">
17 19 <!-- 标题 -->
... ... @@ -32,7 +34,7 @@
32 34 bindrefresherrefresh="onPullDownRefresh">
33 35  
34 36 <block wx:for="{{list2}}">
35   - <view class class="list-item" bindtap="viewItemDetails">
  37 + <view class class="list-item" bindtap="viewItemDetails" data-index="{{index}}">
36 38 <view class="img-container">
37 39 <image
38 40 src="{{url+item.original_img}}"
... ... @@ -54,8 +56,7 @@
54 56 </view>
55 57 </view>
56 58 </block>
57   -
58   -
  59 +
59 60 <!-- <view style="height: 1rpx;"></view> -->
60 61 <nodata wx:if="{{list2.length==0}}" nodataContainer="nodata">暂无数据</nodata>
61 62 <view wx:if="{{is_no_more2}}" class="no-more t-c">- 已全部加载 -</view>
... ...
packageA/pages/jfbuy/jfbuy.wxss
... ... @@ -105,7 +105,7 @@ page {
105 105 margin-left: 8rpx;
106 106 }
107 107 .list-container {
108   - height: calc(100% - 360rpx);
  108 + height: calc(100% - 320rpx);
109 109 /* height: 100%; */
110 110 }
111 111 .list {
... ... @@ -420,10 +420,13 @@ radio .wx-radio-input.wx-radio-input-checked::before{
420 420 } */
421 421  
422 422 .banner-container {
423   - height: 360rpx;
  423 + height: 320rpx;
424 424 }
425 425 .banner {
426 426 display: block;
427   - width: 100%;
428   - height: 100%;
  427 + width: 340rpx;
  428 + height: 240rpx;
  429 + margin-left:25rpx;
  430 + margin-right:25rpx;
  431 + margin-top: 30rpx;
429 432 }
430 433 \ No newline at end of file
... ...
packageA/pages/quan_pro/quan_pro.js
... ... @@ -119,6 +119,11 @@ Page({
119 119 }
120 120 })
121 121 },
  122 +
  123 + go_quan:function(){
  124 + //跳转到券列表
  125 + getApp().goto("/pages/user/coupons/coupons");
  126 + }
122 127  
123 128  
124 129 });
... ...
pages/cart/cart/cart.js
... ... @@ -27,10 +27,9 @@ Page({
27 27 isadd: 0, //是否可以加商品数量
28 28  
29 29 card_field:"",
30   - bconf:null,
31   -
  30 + bconf:null,
  31 + btn_click:1,
32 32 },
33   -
34 33 onLoad: function() {
35 34 var a = this,ee=a;
36 35 //----获取系统参数-----
... ... @@ -50,8 +49,6 @@ Page({
50 49 a.getCardList();
51 50 });
52 51  
53   -
54   -
55 52 },
56 53 onShow: function() {
57 54  
... ... @@ -65,6 +62,7 @@ Page({
65 62 }
66 63  
67 64 var th = this;
  65 + this.setData({requestData:null,is_load:0});
68 66 //调用底部导航
69 67 //t.editTabBar(th,getApp().globalData.setting.stoid,getApp().globalData.url);
70 68 this.getCardList();
... ... @@ -170,7 +168,7 @@ Page({
170 168  
171 169 var tt = ut.gettimestamp();
172 170 //如果商品下架了,或者商品是赠品,一开始都要清除
173   - if ((good.down_time > 0 && good.down_time < tt) || good.is_on_sale == 0 || item.is_gift) {
  171 + if ((good.down_time > 0 && good.down_time < tt) || good.is_on_sale == 0) {
174 172 var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
175 173 getApp().request.delete(url, {
176 174 success: function (t) {
... ... @@ -204,13 +202,13 @@ Page({
204 202 var r_data = res.data.data;
205 203 if (!r_data.promGoodsLists) {
206 204 var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
207   - a.delete(url, {});
  205 + getApp().request.delete(url, {});
208 206 //商品已经下架
209 207 isok = 0;
210 208 }
211 209 } else {
212 210 var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
213   - a.delete(url, {});
  211 + getApp().request.delete(url, {});
214 212 //商品已经下架
215 213 isok = 0;
216 214 }
... ... @@ -275,6 +273,7 @@ Page({
275 273 is_edit: 0
276 274 }),
277 275 th.doCheckAll(), wx.stopPullDownRefresh();
  276 +
278 277 }
279 278 });
280 279 },
... ... @@ -300,27 +299,42 @@ Page({
300 299 },
301 300  
302 301 //-----------------点击输入修改商品数量---------------
303   - valueToNum: function(t) {
304   - var a = t.currentTarget.dataset.item;
305   - var b = t.currentTarget.dataset.pitems;
306   - a = this.data.requestData[b].goods[a];
307   - var e = a;
308   - if (a = isNaN(t.detail.value) || t.detail.value < 1 ? 1 : parseInt(t.detail.value)) {
309   - var s = {
310   - goods_num: a,
311   - goods_id: e.goods_id,
312   - id: e.id,
313   - store_id: oo.stoid
314   - };
315   - this.postCardList(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
316   - }
  302 + valueToNum: function(t) {
  303 + if(!this.data.is_load) return false;
  304 + //控制住,避免事件响应冲突,只有input有输入的时候,才刷新
  305 + if(this.data.btn_click){
  306 + return false;
  307 + }
  308 + this.data.btn_click=1;
  309 +
  310 + var a = t.currentTarget.dataset.item;
  311 + var b = t.currentTarget.dataset.pitems;
  312 + a = this.data.requestData[b].goods[a];
  313 + var e = a;
  314 + var th=this;
  315 +
  316 +
  317 +
  318 + if (a = isNaN(t.detail.value) || t.detail.value < 1 ? 1 : parseInt(t.detail.value)) {
  319 + var s = {
  320 + goods_num: a,
  321 + goods_id: e.goods_id,
  322 + id: e.id,
  323 + store_id: oo.stoid
  324 + };
  325 + th.postCardList(s, t.currentTarget.dataset.item, t.currentTarget.dataset.pitems);
  326 + }
  327 +
  328 +
  329 +
317 330 },
318 331  
319 332 //-------------加数量---------------------
320 333 addNum: function(t) {
  334 + if(!this.data.is_load) return false;
321 335 if (this.data.up_dating == 1) return false;
322 336 this.data.up_dating = 1;
323   -
  337 +
324 338 var a = t.currentTarget.dataset.item;
325 339 var b = t.currentTarget.dataset.pitems;
326 340 a = this.data.requestData[b].goods[a];
... ... @@ -344,9 +358,14 @@ Page({
344 358 },
345 359 //-------------减数量---------------------
346 360 subNum: function(t) {
  361 + if(!this.data.is_load) return false;
  362 + if (this.data.up_dating == 1) return false;
  363 + this.data.up_dating = 1;
  364 +
347 365 var a = t.currentTarget.dataset.item;
348 366 var b = t.currentTarget.dataset.pitems;
349 367 a = this.data.requestData[b].goods[a];
  368 + this.data.btn_click=1;
350 369  
351 370 if (a.goods_num - 1 < 0) return false;
352 371  
... ... @@ -367,6 +386,8 @@ Page({
367 386 tfeel = 0,
368 387 t_num = 0,
369 388 text_arr = "";
  389 + this.data.btn_click=1;
  390 +
370 391 for (var i = 0; i < dda.length; i++) {
371 392 var item = dda[i].goods;
372 393 if (!e.data.checkAllToggle) {
... ... @@ -419,11 +440,12 @@ Page({
419 440 },
420 441  
421 442 //------门店全选按钮,要判断是否门店的匹配方式一致---------
422   - check_th_all_item: function(ele) {
  443 + check_th_all_item:async function(ele) {
423 444 var e = this,
424 445 pitems = ele.currentTarget.dataset.pitems,
425 446 item = this.data.requestData[pitems].goods,
426 447 sele = this.data.requestData[pitems].selected;
  448 + this.data.btn_click=1;
427 449  
428 450 var isok = 1,
429 451 fir = 0,
... ... @@ -462,18 +484,19 @@ Page({
462 484 e.setData({
463 485 [txt]: Number(!sele),
464 486 });
465   - e.check_prom_activity(pitems);
  487 + await e.check_prom_activity(pitems);
466 488 this.doCheckAll();
467 489 },
468 490  
469 491 //---------------单选,也要判断门店的配送方式是否一致--------------
470   - check_th_item: function(t) {
  492 + check_th_item: async function(t) {
471 493 var e = this,
472 494 item = t.currentTarget.dataset.item,
473 495 pitems = t.currentTarget.dataset.pitems;
474 496 a = this.data.requestData[pitems].goods[item];
475 497 var isok = 1,fir = 0;
476 498 var iarr = e.data.requestData[pitems].goods;
  499 + this.data.btn_click=1;
477 500  
478 501  
479 502 //当数量大于1,且是选择的时候
... ... @@ -508,7 +531,7 @@ Page({
508 531  
509 532 if(a.prom_type==3){
510 533 //判断商品是不是优惠活动
511   - e.check_prom_activity(pitems);
  534 + await e.check_prom_activity(pitems);
512 535 }
513 536  
514 537 this.doCheckAll();
... ... @@ -554,6 +577,7 @@ Page({
554 577  
555 578 //----------------------更新购物数量,加减,调用接口---------------------
556 579 postCardList: function(t, item, pitem) {
  580 +
557 581 var e = this,th=e;
558 582 var user_id = getApp().globalData.user_id;
559 583 console.log('update');
... ... @@ -800,17 +824,18 @@ Page({
800 824 //--更新购物车---
801 825 update_cart: function(t, pitem, item) {
802 826 var e = this;
  827 +
803 828 getApp().request.put("/api/weshop/cart/update", {
804 829 data: t,
805   - success: function(ee) {
  830 + success:async function(ee) {
806 831 var txt = "requestData[" + pitem + "].goods[" + item + "].goods_num";
807   - e.data.up_dating = 0
  832 +
808 833 e.setData({
809 834 [txt]: t.goods_num,
810 835 });
811   - for(var i in e.data.requestData){
812   - e.check_prom_activity(i)
813   - }
  836 + //for(var i in e.data.requestData){
  837 + await e.check_prom_activity(pitem)
  838 + //}
814 839 e.doCheckAll();
815 840 getApp().requestCardNum(e);
816 841 }
... ... @@ -824,6 +849,14 @@ Page({
824 849  
825 850 //--------------去结算------------
826 851 async checkout() {
  852 +
  853 + if(!this.data.is_load) return false;
  854 + if(this.data.up_dating) {
  855 + wx.showLoading({
  856 + title:"计算中"
  857 + })
  858 + }
  859 +
827 860 var glist = ""; //用逗号隔开的
828 861 var map = new Map(); //使用map值键进行运算
829 862 var map_limit = new Map(); //使用map值键进行存储限购
... ... @@ -1156,15 +1189,17 @@ Page({
1156 1189 var make_up_arr=new Array();
1157 1190 var th=this;
1158 1191 var map=new Map();
1159   - var list=this.data.requestData[cindex];
  1192 + var list= JSON.parse(JSON.stringify(this.data.requestData[cindex]));
1160 1193 //循环处理活动,看活动商品的数量,用map来出来存储,key为活动id,值是数量
1161   - for(var i in list.goods){
  1194 +
  1195 + for(var i=0;i<list.goods.length;i++){
1162 1196 var item=list.goods[i];
1163 1197 if(item.prom_type==3 && item.selected && !item.is_gift){
1164 1198 if(map.has(item.prom_id+"")){
1165 1199 var ob=map.get(item.prom_id+"");
1166 1200 ob.num+=item.goods_num;
1167 1201 ob.price+=item.goods_num*item.goods_price;
  1202 + delete map[item.prom_id+""];
1168 1203 map.set(item.prom_id+"",ob);
1169 1204 }else{
1170 1205 var ob={};
... ... @@ -1174,13 +1209,14 @@ Page({
1174 1209 }
1175 1210 }
1176 1211 if(item.is_gift==1){
1177   - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
  1212 + //var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id;
1178 1213 //getApp().request.delete(url, {});
1179   - await getApp().request.promiseDelete(url, {}) // 要用同步让赠品删除
1180   - list.goods.splice(i,1);
  1214 + //await getApp().request.promiseDelete(url, {}) // 要用同步让赠品删除
  1215 + list.goods.splice(i--,1);
1181 1216 }
1182 1217 }
1183 1218  
  1219 + /*--
1184 1220 var map2=new Map();
1185 1221 //请那些是赠品,但是优惠活动并没有被选中的商品要删除,同时满足条件的要放到map2,
1186 1222 for(var i in list.goods){
... ... @@ -1196,7 +1232,10 @@ Page({
1196 1232 getApp().request.delete(url, {});
1197 1233 }
1198 1234 }
1199   - }
  1235 + }--*/
  1236 +
  1237 + var t_prom_list=new Array();
  1238 +
1200 1239 for(let p_item of map.entries()){
1201 1240 var prom=null;
1202 1241 await getApp().request.promiseGet("/api/weshop/promgoods/get/"+os.stoid+"/"+p_item[0],{}).then(res=> {
... ... @@ -1216,6 +1255,9 @@ Page({
1216 1255 }
1217 1256 continue;
1218 1257 }
  1258 +
  1259 + t_prom_list.push(prom);
  1260 +
1219 1261 //---读取打折的详情---
1220 1262 var ob=p_item[1];var discount=null;
1221 1263 await getApp().request.promiseGet("/api/weshop/goods/getDiscount",{
... ... @@ -1251,6 +1293,8 @@ Page({
1251 1293 gift_id:discount.gift_id
1252 1294 };
1253 1295  
  1296 +
  1297 + /*---
1254 1298 if(map2.has(p_item[0]+"")){
1255 1299 var index=map2.get(p_item[0]+"");
1256 1300 if( list.goods[index].goods_num!=discount.bs){
... ... @@ -1268,7 +1312,11 @@ Page({
1268 1312 });
1269 1313 }
1270 1314  
1271   - }else{
  1315 + }else{---*/
  1316 + var url="/api/weshop/cart/delGift?store_id="+newd.store_id+"&user_id="
  1317 + +newd.user_id+"&goods_id="+newd.goods_id+"&is_gift=1&pick_id="+newd.pick_id;
  1318 + await getApp().request.promiseDelete(url, {})
  1319 +
1272 1320 var add_data=null;
1273 1321 await getApp().request.promisePost("/api/weshop/cart/save", { data: newd }).then(res=>{
1274 1322 if(res.data.code==0){
... ... @@ -1279,37 +1327,44 @@ Page({
1279 1327 newd.id=add_data.id;
1280 1328 list.goods.push(newd);
1281 1329 }
1282   - }
  1330 + //}
1283 1331 }
1284   -
1285   -
1286   -
1287   - //-- 获取 --
1288   - await getApp().request.promiseGet("/api/weshop/promgoodslist/list",{
1289   - data:{prom_id:prom.id}
1290   - }).then(res=>{
1291   - if(res.data.code==0){
1292   - var list=res.data.data;
1293   - for(var i in list){
1294   - var item=list[i];
1295   - if(item.prom_type==0){
1296   - if(ob.price<item.condition){
1297   - var elem={prom_id:prom.id,diff_type:item.prom_type,diff:(item.condition-ob.price).toFixed(2), content:JSON.parse(item.preferential_type)}
1298   - make_up_arr.push(elem); break;
1299   - }
1300   - }else{
1301   - if(ob.num<item.condition){
1302   - var elem={prom_id:prom.id,diff_type:item.prom_type,diff:(item.condition-ob.num).toFixed(2), content:JSON.parse(item.preferential_type)}
1303   - make_up_arr.push(elem);break;
1304   - }
1305   - }
1306   - }
1307   - }
1308   - })
  1332 +
1309 1333 }
1310 1334 //--更新购物车的前台渲染--
1311 1335 var rq_text="requestData["+cindex+"]";
1312 1336 this.setData({[rq_text]:list});
  1337 +
  1338 + if(!t_prom_list || t_prom_list.length==0 ) return false;
  1339 +
  1340 + //-- 提示凑单的,放在最后显示 --
  1341 + for(let prid in t_prom_list){
  1342 + var prom=t_prom_list[prid];
  1343 + //-- 获取凑单提示 --
  1344 + await getApp().request.promiseGet("/api/weshop/promgoodslist/list",{
  1345 + data:{prom_id:prom.id}
  1346 + }).then(res=>{
  1347 + if(res.data.code==0){
  1348 + var list=res.data.data;
  1349 + for(var i in list){
  1350 + var item=list[i];
  1351 + if(item.prom_type==0){
  1352 + if(ob.price<item.condition){
  1353 + var elem={prom_id:prom.id,diff_type:item.prom_type,diff:(item.condition-ob.price).toFixed(2), content:JSON.parse(item.preferential_type)}
  1354 + make_up_arr.push(elem); break;
  1355 + }
  1356 + }else{
  1357 + if(ob.num<item.condition){
  1358 + var elem={prom_id:prom.id,diff_type:item.prom_type,diff:(item.condition-ob.num).toFixed(2), content:JSON.parse(item.preferential_type)}
  1359 + make_up_arr.push(elem);break;
  1360 + }
  1361 + }
  1362 + }
  1363 + }
  1364 + })
  1365 + }
  1366 +
  1367 +
1313 1368 var diff_text="requestData["+cindex+"].make_up_arr";
1314 1369 //-- 如果有凑单的话 --
1315 1370 if(make_up_arr.length>0){
... ... @@ -1332,5 +1387,9 @@ Page({
1332 1387 if(!url || url=='') return;
1333 1388 if(url[0]!='/') url='/'+url;
1334 1389 getApp().goto(url);
1335   - }
  1390 + },
  1391 +
  1392 + refresh_input:function(){
  1393 + this.data.btn_click=0;
  1394 + }
1336 1395 });
1337 1396 \ No newline at end of file
... ...
pages/cart/cart/cart.wxml
... ... @@ -79,7 +79,9 @@
79 79 </view>
80 80 <view class="count">
81 81 <view bindtap="subNum" class="sub fs28" data-pitems="{{pidx}}" data-item="{{idx}}">一</view>
82   - <input class="goodadd" bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}" type="number" value="{{items.goods_num}}"></input>
  82 + <input class="goodadd" bindblur="valueToNum" data-pitems="{{pidx}}" data-item="{{idx}}"
  83 + bindinput="refresh_input"
  84 + type="number" value="{{items.goods_num}}"></input>
83 85 <view class="add" bindtap="addNum" data-pitems="{{pidx}}" data-item="{{idx}}">+</view>
84 86 </view>
85 87 </view>
... ...
pages/cart/cart2/cart2.js
... ... @@ -208,10 +208,10 @@ Page({
208 208  
209 209 });
210 210 //--更新默认地址--,看一下是不是跳到地址页面
211   - if(!getApp().globalData.is_cart2_old){
  211 + if(!getApp().globalData.is_cart_old){
212 212 this.update_code();
213 213 }else{
214   - getApp().globalData.is_cart2_old=0;
  214 + getApp().globalData.is_cart_old=0;
215 215 }
216 216 }
217 217  
... ... @@ -317,41 +317,54 @@ Page({
317 317 //----------------展示页面,是再获取用户信息之后--------------
318 318 show_page:function(){
319 319 var th=this,ta = this.data.param;
320   - th.setData({
321   - userinfo: getApp().globalData.userInfo,});
322   -
323   - //选获取地址
324   - th.getuser_addr(function(addr){
325   - th.setData({user_addr: addr});
326   - //--------------------------立即购买------------------
327   - if(ta.is_bnow== 1){
328   - //读取门店
329   - to.get_allsto(function (e) {
330   - th.setData({ allsto: e });
331   - //获取立即购买的商品信息
332   - th.get_buy_goods(ta.goods_id);
333   - });
334   - }else {
335   - //------------------------购物车结算----------------------
336   - //读取门店
337   - to.get_allsto(function (e) {
338   - th.setData({ allsto: e });
339   - //-------获取购物车已经选择的商品--------
340   - th.get_cart();
341   - })
342   - }
343   - });
344   - //获取提现金额
345   - getApp().request.get("/api/weshop/withdrawals/summoney", {
346   - data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
347   - success: function (su) {
348   - if (su.data.code == 0) {
349   - var yuer = parseFloat(th.data.userinfo.user_money -
350   - (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
351   - th.setData({ txmon: su.data.data.summoney, yuer: yuer });
352   - }
353   - }
354   - });
  320 + //th.setData({ userinfo: getApp().globalData.userInfo,}); //这个余额被缓存了
  321 +
  322 + //会员的信息,要获取最新
  323 + var user=getApp().globalData.userInfo;
  324 + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
  325 + data:{r:Math.random()},
  326 + success: function (e) {
  327 + getApp().globalData.userInfo = e.data.data;
  328 + th.setData({userinfo:e.data.data});
  329 +
  330 + //选获取地址
  331 + th.getuser_addr(function(addr){
  332 + th.setData({user_addr: addr});
  333 + //--------------------------立即购买------------------
  334 + if(ta.is_bnow== 1){
  335 + //读取门店
  336 + to.get_allsto(function (e) {
  337 + th.setData({ allsto: e });
  338 + //获取立即购买的商品信息
  339 + th.get_buy_goods(ta.goods_id);
  340 + });
  341 + }else {
  342 + //------------------------购物车结算----------------------
  343 + //读取门店
  344 + to.get_allsto(function (e) {
  345 + th.setData({ allsto: e });
  346 + //-------获取购物车已经选择的商品--------
  347 + th.get_cart();
  348 + })
  349 + }
  350 + });
  351 +
  352 + //获取提现金额
  353 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  354 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
  355 + success: function (su) {
  356 + if (su.data.code == 0) {
  357 + var yuer = parseFloat(th.data.userinfo.user_money -
  358 + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
  359 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
  360 + }
  361 + }
  362 + });
  363 +
  364 +
  365 + },
  366 + });
  367 +
355 368 },
356 369  
357 370  
... ... @@ -370,7 +383,17 @@ Page({
370 383  
371 384 //---是不是购买等级卡成功的返回---等级卡显示的判断---
372 385 var is_card_back=getApp().globalData.is_card_back;
  386 +
  387 + for (var i = 0; i < carr.length; i++) {
  388 + var item1 = carr[i];
  389 + //要把优惠活动加入,prom_goods_map中,赠品不要运算
  390 + if(item1.prom_type==3 && item1.is_gift!=1){
  391 + await th.add_prom_goods_map(item1);
  392 + }
  393 +
  394 + }
373 395  
  396 + //在分组的时候,就不要再调用接口,await
374 397 for (var i = 0; i < carr.length; i++) {
375 398 var item = carr[i];
376 399  
... ... @@ -397,13 +420,7 @@ Page({
397 420 }
398 421  
399 422 }
400   -
401   - //要把优惠活动加入,prom_goods_map中,赠品不要运算
402   - if(item.prom_type==3 && item.is_gift!=1){
403   - await th.add_prom_goods_map(item);
404   - }
405   -
406   -
  423 +
407 424 item.original_img = oo.imghost + item.original_img;
408 425 /*----接口要弄出来的,先顶着-----*/
409 426 var pcid = item.pick_id;
... ... @@ -471,23 +488,27 @@ Page({
471 488 var ie = {
472 489 pickup_id: pcid, pname: pikname, goods: narr, wind: m_wind, distr_t: dis_t,card_cut_price:0,exp_type:e_t,
473 490 goods_price: 0, shipping_price: 0, user_money: 0, total_amount: 0, order_amount: 0, user_note:0};
474   -
475   - //-- 如果是回退回来的情况 --
476   - if(th.data.cartlist && th.data.cartlist.length>0) {
477   - for(var kj in th.data.cartlist){
478   - if(ie.pickup_id==th.data.cartlist[kj].pickup_id){
479   - ie.exp_type=th.data.cartlist[kj].exp_type;
480   - break;
481   - }
482   - }
483   - }
484   -
  491 +
485 492 //-- 把等级卡会优惠多少钱装进去 --
486 493 if(item.cut_price1) ie.card_cut_price+=item.cut_price1;
487 494 arr.push(ie);
488 495  
489 496 }
490   - }
  497 + }
  498 + //-- 如果是回退回来的情况 --
  499 + if(th.data.cartlist && th.data.cartlist.length>0) {
  500 + for(var kj in th.data.cartlist){
  501 + for(var ih in arr){
  502 + var ie=arr[ih];
  503 + if(ie.pickup_id==th.data.cartlist[kj].pickup_id){
  504 + ie.exp_type=parseInt(th.data.cartlist[kj].exp_type);
  505 + ie.wind=parseInt(th.data.cartlist[kj].wind);
  506 + break;
  507 + }
  508 + }
  509 + }
  510 + }
  511 +
491 512 //深拷贝
492 513 th.data.old_cartlist= JSON.parse(JSON.stringify(arr));
493 514 th.setData({
... ... @@ -532,15 +553,20 @@ Page({
532 553 case 2: et = 0; break;
533 554 }
534 555  
535   - if(th.data.bn_goods) et=th.data.bn_exp_type
536   -
537   - var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
  556 +
  557 + var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
538 558 if(et==0 && def_exp_code){
539 559 for(var k=0;k<th.data.wu_arr.length;k++){
540 560 var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; }
541 561 }
542 562 }
543 563  
  564 +
  565 + if(th.data.bn_goods){
  566 + et=th.data.bn_exp_type;
  567 + m_wind=th.data.index;
  568 + }
  569 +
544 570 //---是不是购买等级卡成功的返回---等级卡显示的判断---
545 571 var is_card_back=getApp().globalData.is_card_back;
546 572 if(is_card_back){
... ... @@ -852,7 +878,10 @@ Page({
852 878  
853 879 //--优惠多少钱--
854 880 if(!cart_item.cut_price) cart_item.cut_price=0;
855   - cart_item.cut_price+=(item_map.price-item_map.prom_price);
  881 + //-- --
  882 + if(item_map.price!=undefined && item_map.price!=null
  883 + && item_map.prom_price!=undefined && item_map.prom_price!=null)
  884 + cart_item.cut_price+=(item_map.price-item_map.prom_price);
856 885 //---如果有送积分---
857 886 if(item_map.s_intValue){
858 887 if(!cart_item.s_intValue) cart_item.s_intValue=0;
... ... @@ -920,6 +949,8 @@ Page({
920 949 })
921 950 };
922 951 var c_arr=JSON.parse(JSON.stringify(th.data.old_cartlist));
  952 +
  953 +
923 954 if(th.data.cartlist && th.data.cartlist.length>0){
924 955 for(var i =0;i<c_arr.length;i++){
925 956 c_arr[i].exp_type=th.data.cartlist[i].exp_type;
... ... @@ -958,12 +989,11 @@ Page({
958 989 for(var j=0;j<item.length;j++){
959 990 o_price += item[j].goods_price * item[j].goods_num;
960 991 }
961   -
  992 +
  993 + var f_o_price=o_price;
962 994 //如果又优惠的钱,就要减价
963 995 if(c_arr[i].cut_price>0) o_price-=c_arr[i].cut_price;
964 996  
965   - var f_o_price=o_price;
966   -
967 997 //判断包邮券的钱
968 998 var q_conditin=0;
969 999 q_conditin=o_price;
... ... @@ -1825,7 +1855,7 @@ Page({
1825 1855 'twon': addr == null ? 0 : addr.twon,
1826 1856 'address': addr == null ? "" : addr.address,
1827 1857 'more_address': addr == null ? "" : addr.more_address,
1828   - 'mobile': th.data.userinfo.mobile,
  1858 + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile,
1829 1859 'email': '',
1830 1860 'shipping_code': th.data.is_all_zt == 1 ? 0 : th.data.wu_arr[t_item.wind].code,
1831 1861 'shipping_name': th.data.is_all_zt == 1 ? '' : th.data.wu_arr[t_item.wind].name,
... ...
pages/cart/cart2_inte/c_filter.wxs 0 → 100644
  1 +var filters = {
  2 + toFix:function(val,count){
  3 + return val.toFixed(count)
  4 + },
  5 + format_time:function(ts,isFull) {
  6 + var d = getDate(ts*1000)
  7 + var fm=[d.getFullYear(), d.getMonth()+1, d.getDate()].join('-');
  8 + if(isFull==1)
  9 + fm=fm + ' '+ [d.getHours(), d.getMinutes(), d.getSeconds()].join(':')
  10 + return fm;
  11 + },
  12 + setcolor:function(ind){
  13 + if (ind == 0 || ind ==null) return "red";
  14 + if(ind==1 ) return "green";
  15 + if(ind==2) return "blue";
  16 + if(ind==11) return "green";
  17 + if(ind==12) return "blue";
  18 + if(ind==20) return "green";
  19 + return "";
  20 + },
  21 + setbgcolor: function (ind) {
  22 + if (ind == 0 || ind == null) return "#ffa1b9";
  23 + if (ind == 1) return "#59e1d2";
  24 + if (ind == 2) return "#a3bcff";
  25 + if (ind == 11) return "#59e1d2";
  26 + if (ind == 12) return "#a3bcff";
  27 + if (ind == 20) return "#6d87cd";
  28 + return "";
  29 + },
  30 +
  31 + get_type:function(ind){
  32 + if (ind == 0 || ind == null) return "全场通用";
  33 + if (ind == 1) return "品牌";
  34 + if (ind == 2) return "品类";
  35 + if (ind == 11) return "用途";
  36 + if (ind == 12) return "分类1";
  37 + if (ind == 20) return "指定单品";
  38 + return "";
  39 + },
  40 + get_type_card:function(ind){
  41 + if (ind == 0 || ind == null) return "全场通用";
  42 + if (ind == 1) return "指定品牌";
  43 + if (ind == 2) return "指定品类";
  44 + if (ind == 11) return "指定用途";
  45 + if (ind == 12) return "指定分类1";
  46 + if (ind == 20) return "指定单品";
  47 + return "";
  48 + },
  49 + format_huiche:function (text) {
  50 + if (!text) {
  51 + return "";
  52 + }
  53 + var reg = getRegExp('\\\\n', 'g')
  54 + return text.replace(reg, '\n')
  55 + }
  56 +}
  57 +
  58 +module.exports = {
  59 + toFix: filters.toFix,
  60 + format_time:filters.format_time,
  61 + setcolor:filters.setcolor,
  62 + setbgcolor: filters.setbgcolor,
  63 + get_type: filters.get_type,
  64 + get_split_name: filters.get_split_name,
  65 + get_type_card: filters.get_type_card,
  66 + format_huiche: filters.format_huiche,
  67 +}
0 68 \ No newline at end of file
... ...
pages/cart/cart2_inte/cart2_inte.js 0 → 100644
  1 +var t = getApp(),app=t, a = t.request, e = require("../../../utils/common.js"),
  2 + s = require("../../../utils/util.js"),ut=s, o = require("../../../utils/md5.js"), to = getApp();
  3 +var oo=t.globalData.setting,os=oo;
  4 +var regeneratorRuntime = require('../../../utils/runtime.js');
  5 +var util_pay = require("../../../utils/pay.js");
  6 +
  7 +Page({
  8 + data: {
  9 + url: t.globalData.setting.url,
  10 + imgUrl: t.globalData.setting.imghost,
  11 + goods: null,
  12 + order: null,
  13 + orderPrices: null,
  14 + coupons: null,
  15 + coupon: null,
  16 + invoiceToggle: !0,
  17 + payWithUserMoney: !0,
  18 + payWithPoints: !0,
  19 + maxWord: 0,
  20 + enterAddressPage: !1,
  21 + firstEnter: !0,
  22 + //页面获取的参数
  23 + param:null,
  24 + //提交订单的格式
  25 + formData: {
  26 + order_amount:0,//支付金额
  27 + total_amount:0,//总价
  28 + all_price:0,//商品卖的总价
  29 + pay_points: 0,//使用积分
  30 + user_money: 0,//使用余额
  31 + couponCode: "",//使用优惠券(多单就用逗号隔开)
  32 + shipping_price:0,//物流费用
  33 + },
  34 +
  35 +
  36 + /*----------------立即购买---------------------*/
  37 + is_b_now:1, //0是购物车结算 1立即购买
  38 + bn_goods:null, //立即购买时候的调用商品
  39 + bn_use_money:0,//是否使用余额
  40 + bn_exp_type:1, //0是物流 1自提
  41 + bn_pick:0, //选择的门店
  42 + bn_pickname: "", //选择的门店名称
  43 + bn_t_exp_t:0, //判断商品和门店一起决定的物流自提的方式0 都可以 1自提 2物流
  44 +
  45 + bn_plus_cut_price:0, //显示等级卡会优惠多少钱
  46 + /*------------------------*/
  47 + user_addr:null,//物流
  48 + userinfo:null, //获取会员
  49 + /*----------物流选择--------*/
  50 + wu_arr:null,
  51 + index:0,
  52 + w_sele_index:0,
  53 +
  54 + //判断页面是返回回来的还是 首次进入的
  55 + isclose:1,
  56 + //申请提现的金额
  57 + txmon:0,
  58 + yuer:0,
  59 + //提交中,不重复提交
  60 + is_summit_ing:0,
  61 +
  62 + disabled:0,
  63 + open_express:0,//控制选择物流名列表 的属性
  64 +
  65 + is_express:0, //选中物流的属性
  66 + expres_name:"", //点击选定
  67 + is_shipping_code:"",//插入用户默认地址
  68 + wu_arr_txt:"", //要更新的物流的字段
  69 +
  70 + //如果是全场包邮了,或者是全场不包邮了,就不要选包邮券
  71 + is_no_by:{},
  72 + is_by:{},
  73 + is_quan_by:{},
  74 + //--购买赠送的商品--
  75 + buy_now_gift_goods:null,
  76 + //--订单优惠--
  77 + order_prom:{},
  78 + show_submit:0, //提交按钮变正常显示
  79 +
  80 + },
  81 + onLoad: function(t) {
  82 + wx.setNavigationBarTitle({ title: "填写订单",})
  83 + var th = this;
  84 + th.data.param=t;
  85 + //清空is_pick_up
  86 + getApp().request.put("/api/weshop/useraddress/updatePickUp", {
  87 + data: {user_id: getApp().globalData.user_id, is_pickup: 0},
  88 + success: function (s) {
  89 + }
  90 + });
  91 +
  92 + //先获取是否有关闭使用优惠券
  93 + getApp().getConfig2(function (ee) {
  94 + var json_d = JSON.parse(ee.switch_list);
  95 + th.data.ispt_goods=json_d.ispt_goods; //是不是平摊到单品的控制参数赋值
  96 + th.setData({ is_close_quan: json_d.is_close_quan,sales_rules:ee.sales_rules,rank_switch:json_d.rank_switch});
  97 +
  98 + var rank_switch=json_d.rank_switch;
  99 + var max_price=-1;
  100 + var show_card=null;
  101 + var name="";
  102 + //如果有开等级卡的时候,
  103 + //因为都是调接口,要返回在计算
  104 + if(rank_switch==2){
  105 + //-- 获取所有的等级卡, --
  106 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?storeId=" + os.stoid,
  107 + {}).then(res => {
  108 + if(res.data.code==0){
  109 + var plusCard = res.data.data;
  110 + //-- 循环判断,拿到最贵的那张卡 --
  111 + for(var ih in plusCard){
  112 + if(plusCard[ih].IsStopBuy == true){ continue; }
  113 + if(max_price<0){
  114 + max_price=plusCard[ih].CardFee;
  115 + name='card'+plusCard[ih]['CorrPrice'];
  116 + show_card=plusCard[ih];
  117 + }else{
  118 + if(max_price<plusCard[ih].CardFee){
  119 + max_price=plusCard[ih].CardFee;
  120 + name='card'+plusCard[ih]['CorrPrice'];
  121 + show_card=plusCard[ih];
  122 + }
  123 + }
  124 + }
  125 +
  126 + if(show_card){
  127 + name=name.toLowerCase();
  128 + th.setData({card_name:name,show_card:show_card})
  129 + }
  130 + }
  131 + //-----先获取物流,再获取用户信息,再展示页面-----
  132 + th.get_wuliu(th.get_info(th.show_page));
  133 + })
  134 + }else{
  135 + //-----先获取物流,再获取用户信息,再展示页面-----
  136 + th.get_wuliu(th.get_info(th.show_page));
  137 + }
  138 + })
  139 +
  140 +
  141 + },
  142 + onUnload: function () { this.setData({ isclose: 1 })},
  143 + onHide: function () {
  144 + this.setData({
  145 + is_no_by:{},
  146 + is_by:{}
  147 + })
  148 + },
  149 +
  150 + //----------子页返回父页触发----------
  151 + onShow: function() {
  152 + var th=this;
  153 + th.data.g_cart_q_time=null;
  154 +
  155 + if (th.data.isclose==0){
  156 + wx.navigateTo({
  157 + url: "/pages/index/index/index"
  158 + })
  159 +
  160 + }else{
  161 + this.getuser_addr(function(ie){
  162 + /*--
  163 + //地址切换要把包邮券清空
  164 + if( !th.data.user_addr || !ie || th.data.user_addr.address_id!=ie.address_id){
  165 + var using_quan=th.data.using_quan;
  166 + for(var i in using_quan){
  167 + var item=using_quan[i];
  168 + if(item.isby==1){
  169 + var ob={},txt="using_quan["+i+"]";ob[txt]={};
  170 + th.setData(ob);
  171 + }
  172 + }
  173 +
  174 + }--*/
  175 +
  176 + //th.data.prom_goods_map={};
  177 + //更换地址回来要重新调用计算价钱的接口
  178 + if(!th.data.user_addr || th.data.user_addr.address_id!=ie.address_id){
  179 + th.setData({user_addr: ie,show_submit:0 });
  180 + if (th.data.is_b_now == 1) {
  181 + if(th.data.bn_goods) {
  182 + th.setData({add_back:1});
  183 + th.calculatePrice2();
  184 + }
  185 + }
  186 + }else{
  187 + th.setData({user_addr: ie });
  188 + }
  189 + var going=0;
  190 +
  191 + });
  192 + //--更新默认地址--,看一下是不是跳到地址页面
  193 + if(!getApp().globalData.is_cart_old){
  194 + this.update_code();
  195 + }else{
  196 + getApp().globalData.is_cart_old=0;
  197 + }
  198 + }
  199 +
  200 + },
  201 +
  202 + //-------------------获取物流---------------
  203 + get_wuliu(func) {
  204 + var th = this;
  205 + to.getwuliu(function (e) {
  206 + th.setData({ wu_arr: e })
  207 + typeof func == "function" && func();
  208 + })
  209 + },
  210 + //------获取会员信息-----先获取用户信息,在进行下一步---
  211 + get_info:function(func){
  212 + var user_id = t.globalData.user_id;
  213 + to.auth.get_u(func);
  214 + },
  215 +
  216 + //------获取会员收货地址-----
  217 + getuser_addr:function(func){
  218 + var th=this;
  219 + a.get("/api/weshop/useraddress/page", {
  220 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, pageSize: 600,t:Math.random()},
  221 + success: function (su) {
  222 +
  223 + var item = null;
  224 + if(su.data.code==0 && su.data.data && su.data.data.pageData){
  225 + var user_addr = su.data.data.pageData;
  226 + var def_item=null;
  227 + for (var i = 0; i < user_addr.length; i++) {
  228 + if (user_addr[i]['is_default'] == 1) { def_item = user_addr[i];}
  229 + if (user_addr[i]['is_pickup'] == 1) { item = user_addr[i]; }
  230 + }
  231 +
  232 + if (item == null) item = def_item;
  233 + if (item == null) item = user_addr[0];
  234 + }
  235 +
  236 + if(item==undefined) item=null;
  237 + if(!item) th.setData({user_addr:null}); //地址为空的时候,要清空,因为返回的时候,有缓存
  238 + func(item);
  239 + }
  240 + });
  241 + },
  242 +
  243 + //----------------展示页面,是再获取用户信息之后--------------
  244 + show_page:function(){
  245 + var th=this,ta = this.data.param;
  246 + //th.setData({ userinfo: getApp().globalData.userInfo,});
  247 +
  248 + var user=getApp().globalData.userInfo;
  249 + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
  250 + data:{r:Math.random()},
  251 + success: function (e) {
  252 +
  253 + getApp().globalData.userInfo = e.data.data;
  254 + th.setData({userinfo:e.data.data});
  255 +
  256 + //选获取地址
  257 + th.getuser_addr(function(addr){
  258 + th.setData({user_addr: addr});
  259 + //--------------------------立即购买------------------
  260 + if(ta.is_bnow== 1){
  261 + //读取门店
  262 + to.get_allsto(function (e) {
  263 + th.setData({ allsto: e });
  264 + //获取立即购买的商品信息
  265 + th.get_buy_goods(ta.goods_id);
  266 + });
  267 + }
  268 + });
  269 + //获取提现金额
  270 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  271 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
  272 + success: function (su) {
  273 + if (su.data.code == 0) {
  274 + var yuer = parseFloat(th.data.userinfo.user_money -
  275 + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
  276 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
  277 + }
  278 + }
  279 + });
  280 +
  281 + },
  282 + })
  283 +
  284 +
  285 + },
  286 +
  287 + //-----获取立即购买的商品信息,入口----
  288 + get_buy_goods: function (e){
  289 + var th=this;
  290 + var gg = to.get_b_now();
  291 + //--------如果goods_id一样,就是要立即购买-----
  292 + if(e==gg.goods_id){
  293 + a.get("/api/weshop/goods/get/" + oo.stoid+"/"+e, {
  294 + success:async function (t) {
  295 + var gd = t.data.data;
  296 + t.data.data.original_img = oo.imghost + t.data.data.original_img;
  297 + t.data.data['buynum'] = gg.goods_num;
  298 + var distr_t=0,et=0
  299 + if (t.data.data.distr_type==0){
  300 + distr_t = gg.pick_dis;
  301 + }else{
  302 + distr_t = t.data.data.distr_type;
  303 + }
  304 + switch (distr_t){
  305 + case 0: et=1; break;
  306 + case 1: et = 1; break;
  307 + case 2: et = 0; break;
  308 + }
  309 +
  310 + if(th.data.bn_goods) et=th.data.bn_exp_type
  311 +
  312 + var m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
  313 + if(et==0 && def_exp_code){
  314 + for(var k=0;k<th.data.wu_arr.length;k++){
  315 + var item=th.data.wu_arr[k]; if(def_exp_code==item.code){ m_wind=k; }
  316 + }
  317 + }
  318 +
  319 + //---是不是购买等级卡成功的返回---等级卡显示的判断---
  320 + var is_card_back=getApp().globalData.is_card_back;
  321 + if(is_card_back){
  322 + th.data.card_name=th.data.userinfo.card_field;
  323 + gg.goods_price=gd[th.data.card_name];
  324 + getApp().globalData.is_card_back=0;
  325 + th.setData({card_cut_price:0});
  326 + //如果是秒杀的返回
  327 + if(gd.prom_type==4) gd.prom_type=0;
  328 + }else{
  329 + //--- 商家等级卡开通的情况下, 会员不是等级会员的情况, 商品有设置等级卡价格,同时等级卡价格小于商品的价格
  330 + //-- 搭配购的商品也可以单独购买,所以此时搭配购的商品要进行计算优惠 --
  331 + if(!gg.collocation_goods && gd['prom_type']!=6 && th.data.card_name && gd[th.data.card_name]>0 && gg.goods_price>gd[th.data.card_name] && !th.data.userinfo.card_field){
  332 + var cut_p= (gg.goods_price-gd[th.data.card_name])*gg.goods_num;
  333 + th.setData({card_cut_price:cut_p});
  334 + }
  335 + }
  336 +
  337 + switch (gd.prom_type){
  338 + case 0:
  339 + case 2:
  340 + case 3:
  341 + case 5:
  342 + case 6:
  343 + getApp().my_warnning("商品不是积分活动",0,th);
  344 + wx.navigateBack();
  345 + break;
  346 + case 4: //-- 积分购 --
  347 + getApp().request.get("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{
  348 + data:{store_id:os.stoid,goods_id:gg.goods_id},
  349 + success: async function (tt) {
  350 + if(tt.data.code==0 && tt.data.data && tt.data.data.pageData){
  351 + var inte_data=tt.data.data.pageData[0];
  352 + t.data.data.shop_price=inte_data.addmoney;
  353 + t.data.data.integral=inte_data.integral;
  354 + th.setData({
  355 + bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind,
  356 + bn_pick: gg.pick_id, bn_t_exp_t: distr_t,bn_exp_type: et
  357 + });
  358 + //计算价格
  359 + th.calculatePrice2();
  360 + }else{
  361 + getApp().my_warnning("商品不是积分活动",0,th);
  362 + wx.navigateBack();
  363 + }
  364 + }
  365 + });
  366 + break;
  367 + }
  368 + },
  369 + });
  370 + }
  371 + },
  372 +
  373 + //---------------检查是否有收货地址-------------------
  374 + checkAddressList: function() {
  375 + var t = this;
  376 + return !(!this.data.order || null == this.data.order.userAddress) || (wx.showModal({
  377 + title: "请先填写或选择收货地址~",
  378 + success: function(a) {
  379 + a.confirm ? t.enterAddressPage() : wx.navigateBack();
  380 + },
  381 + fail: function() {
  382 + wx.navigateBack();
  383 + }
  384 + }), !1);
  385 + },
  386 + showInvoice: function() {
  387 + this.setData({
  388 + invoiceToggle: !this.data.invoiceToggle
  389 + });
  390 + },
  391 + keyUpChangePay1: function(t) {
  392 + this.setData({
  393 + payWithUserMoney: !(t.detail.value.length > 0)
  394 + });
  395 + },
  396 + keyUpChangePay2: function(t) {
  397 + this.setData({
  398 + payWithPoints: !(t.detail.value.length > 0)
  399 + });
  400 + },
  401 + keyUpChangeNum: function(t) {
  402 + this.setData({
  403 + maxWord: t.detail.value.length
  404 + });
  405 + },
  406 +
  407 +
  408 + //---------计算立即购买----------
  409 + calculatePrice2: function () {
  410 + var th = this, good = this.data.bn_goods;
  411 + wx.showLoading({ title:"处理中.",})
  412 + //-----------计算商品总价--------------
  413 + var allpice = good.shop_price * good.buynum;
  414 + var all_integral=good.integral * good.buynum;
  415 +
  416 + var cut_price=0;
  417 + if(good.prom_type==3 && good.prom_price!==null){
  418 + cut_price=allpice-good.prom_price;
  419 + }
  420 + allpice=parseFloat(allpice).toFixed(2);
  421 + var txt = "formData.all_price";
  422 + th.setData({ [txt]: allpice, });
  423 + if(cut_price){
  424 + var c_txt="formData.cut_price";
  425 + th.setData({ [c_txt]: cut_price, });
  426 + }
  427 + to.getConfig2(function (ee) {
  428 + to.getwuliuprice(async function (rs) {
  429 +
  430 + var o_shipping_price = 0, goods_weight = -1, goods_piece = -1;
  431 + //-----------当地址不为空,且是物流时,计算物流费用,并同时商品不是优惠活动的包邮----------
  432 + if (th.data.user_addr != null && th.data.bn_exp_type == 0 && good.is_free_shipping == 0 && good.is_past!=1 ){
  433 +
  434 + switch (good['exp_sum_type']) {
  435 + case 1:
  436 + //统一运费
  437 + o_shipping_price += good['uniform_exp_sum']; break;
  438 + case 2:
  439 + if (goods_weight < 0) goods_weight = 0;
  440 + //累积商品重量 每种商品的重量 * 数量
  441 + goods_weight += good['weight'] * good['buynum'];break;
  442 + case 3:
  443 + if (goods_piece < 0) goods_piece = 0;
  444 + //累积商品数量
  445 + goods_piece += good['buynum']; break;
  446 + }
  447 +
  448 + var code ="";
  449 + if(th.data.wu_arr && th.data.wu_arr[th.data.index]) code=th.data.wu_arr[th.data.index].code;
  450 + var freight_free = ee.freight_free; //全场满多少包邮
  451 + var no_ex_id=ee.no_ex_id;
  452 + th.data.is_no_by[th.data.bn_pick]=0;
  453 +
  454 + var no_by_data=null;
  455 + var gift_freight_free=freight_free;
  456 + //有不包邮区域,且不免运费
  457 + if(no_ex_id && freight_free>0 && freight_free<=allpice-cut_price){
  458 + //-----------获取不包邮区域,不包邮商品-------
  459 + await getApp().request.promiseGet("/api/weshop/areaFeemail/getAreaGoods",{
  460 + data:{store_id:os.stoid,id:no_ex_id}
  461 + }).then(res=>{
  462 + if(res.data.code==0){
  463 + no_by_data=res.data.data[0];
  464 + //如果有设置不包邮区域的时候
  465 + if(res.data.data[0].region_list){
  466 + if(th.check_by_area(res.data.data[0].region_list)){
  467 + freight_free=0;
  468 + th.data.is_no_by[th.data.bn_pick]=1;
  469 + }
  470 + }
  471 + //如果有设置不包邮商品
  472 + if(res.data.data[0].goods_list && freight_free){
  473 + if(th.check_by_goods(res.data.data[0].goods_list)){
  474 + freight_free=0;
  475 + th.data.is_no_by[th.data.bn_pick]=1;
  476 + }
  477 + }
  478 + }
  479 + })
  480 + }
  481 +
  482 + th.data.is_by[th.data.bn_pick]=0;
  483 + //--------------开始计算物流------------------
  484 + var shipping_price=
  485 + th.calculatewuliu(code, o_shipping_price, goods_weight,
  486 + goods_piece, th.data.user_addr, freight_free, allpice-cut_price, rs);
  487 + if(shipping_price<=0){
  488 + th.data.is_by[th.data.bn_pick]=1; //已经是包邮了,就不要选择包邮券
  489 + }
  490 +
  491 + shipping_price = parseFloat(shipping_price).toFixed(2);
  492 + var wl_txt = "formData.shipping_price";
  493 + th.setData({ [wl_txt]: shipping_price, })
  494 +
  495 + }else{
  496 + var wl_txt = "formData.shipping_price";
  497 + th.setData({ [wl_txt]: 0, })
  498 + }
  499 + //---如果有选择优惠券的情况下---
  500 + var quan_price=0,bn_pick=th.data.bn_pick;
  501 +
  502 + //-----------------支付价,优惠券不减物流-----------------
  503 + var total_m = (parseFloat(allpice)).toFixed(2);
  504 + var order_m = (parseFloat(allpice-cut_price)-quan_price).toFixed(2);
  505 + var coupon_price=quan_price; //优惠券优惠了多少钱
  506 + if(order_m<0) {
  507 + order_m=0;coupon_price=parseFloat(order_m).toFixed(2);
  508 + }
  509 +
  510 + //--看一下有没有订单优惠--
  511 + total_m= parseFloat( total_m)+ parseFloat( th.data.formData.shipping_price);
  512 + order_m = parseFloat(order_m)+ parseFloat( th.data.formData.shipping_price);
  513 + var atxt= "formData.total_amount";
  514 + th.setData({ [atxt]: total_m, })
  515 +
  516 + var txt = "formData.user_money";
  517 + var txt2 = "formData.order_amount";
  518 + var txt4="formData.integral";
  519 +
  520 + var amoney = parseFloat(th.data.userinfo.user_money - th.data.txmon - th.data.userinfo.frozen_money);
  521 + //--------------如果使用余额---------------------
  522 + if (th.data.bn_use_money == 1) {
  523 + if (amoney> order_m) {
  524 + order_m = order_m.toFixed(2);
  525 + th.setData({ [txt]: order_m, [txt2]:0,[txt4]:all_integral,show_submit:1 })
  526 + }else{
  527 + order_m =parseFloat(order_m - amoney);
  528 + order_m = order_m.toFixed(2);
  529 + th.setData({ [txt]: amoney, [txt2]: order_m,[txt4]:all_integral,show_submit:1 })
  530 + }
  531 + }else{
  532 + th.setData({ [txt]: 0, [txt2]: order_m,[txt4]:all_integral, show_submit:1 })
  533 + }
  534 +
  535 + wx.hideLoading();
  536 +
  537 + });
  538 + });
  539 + },
  540 +
  541 + //--------------------提交订单-----------------------
  542 + async submitForm(t){
  543 + var sub_value=t;
  544 +
  545 + if(this.data.is_summit_ing==1) return false; //--提交中退出--
  546 + this.data.is_summit_ing=1;
  547 + var th=this,pdata=new Array();
  548 + var ff=true;
  549 + //------------立即购买-------------
  550 + if (th.data.is_b_now==1 && th.data.bn_goods.prom_type!=5){
  551 +
  552 + if(th.data.bn_exp_type == 0 && th.data.user_addr==null ){
  553 + ff = false; getApp().my_warnning("请选择收货地址",0,th);
  554 + th.data.is_summit_ing = 0;
  555 + }
  556 + if (!ff) return false;
  557 + var addr = th.data.user_addr;
  558 + if (th.data.bn_exp_type == 1) addr=null;
  559 +
  560 + if(th.data.bn_exp_type==0)
  561 + if(th.data.wu_arr==null || th.data.wu_arr.length<=0){
  562 + getApp().my_warnning("读取物流失败",0,th);
  563 + th.data.is_summit_ing = 0;
  564 + return false;
  565 + }
  566 +
  567 +
  568 + var integrals=0;
  569 + var get_datas= {
  570 + user_id:getApp().globalData.user_id, store_id:o.stoid,
  571 + };
  572 + await getApp().request.promiseGet("/api/weshop/users/getAllPoints", {
  573 + data: get_datas
  574 + }).then(res => {
  575 + if(res.data.code==0){
  576 + integrals=res.data.data.Integral;
  577 + }
  578 + })
  579 +
  580 + //判断积分的情况
  581 + if(th.data.formData.integral && parseFloat(th.data.formData.integral)< parseFloat(integrals) ){
  582 + getApp().my_warnning("积分不足",0,th);
  583 + th.data.is_summit_ing = 0;
  584 + return false;
  585 + }
  586 +
  587 +
  588 + var item={
  589 + 'user_id': to.globalData.user_id,
  590 + 'consignee': addr == null ? "" : addr.consignee,
  591 + 'province': addr == null ? 0 : addr.province,
  592 + 'city': addr == null ? 0 : addr.city,
  593 + 'district': addr == null ? 0 : addr.district,
  594 + 'twon': addr == null ? 0 : addr.twon,
  595 + 'address': addr == null ? "": addr.address,
  596 + 'more_address': addr == null ? "" : addr.more_address,
  597 + //'mobile': th.data.userinfo.mobile,
  598 + 'mobile': addr == null ? th.data.userinfo.mobile : addr.mobile,
  599 + 'email':'',
  600 + 'shipping_code': th.data.bn_exp_type == 1 ? 0 : th.data.wu_arr[th.data.index].code,
  601 + 'shipping_name': th.data.bn_exp_type == 1 ? '' : th.data.wu_arr[th.data.index].name,
  602 + 'invoice_title':'',
  603 + 'goods_price': th.data.formData.all_price, //商品总价
  604 + 'shipping_price': th.data.formData.shipping_price, //物流金额
  605 + 'user_money': th.data.formData.user_money, //使用余额
  606 + 'total_amount': th.data.formData.total_amount, //订单总价
  607 + 'order_amount': th.data.formData.order_amount, //应付
  608 + 'user_note': t.detail.value.user_note, //用户备注
  609 + 'store_id':oo.stoid, //商家
  610 + 'pickup_id': th.data.bn_pick, //门店
  611 + 'exp_type': th.data.bn_exp_type, //配送方式
  612 + 'order_goods':new Array(),
  613 + 'integral': th.data.formData.integral,
  614 + };
  615 + //是不是重新提交
  616 + if(th.data.is_continue==1) item.is_continue=1;
  617 +
  618 + //获取立即购买的商品的信息
  619 + var gg = to.get_b_now();
  620 + //--商品的房间号--
  621 + if(gg.room_id && gg.room_id>0){
  622 + item.room_ids=gg.room_id;
  623 + }
  624 +
  625 + var goods={
  626 + 'goods_id': gg.goods_id,
  627 + 'goods_name': gg.goods_name,
  628 + 'goods_sn': gg.goods_sn,
  629 + 'goods_num': gg.goods_num,
  630 + 'market_price': th.data.bn_goods.market_price,
  631 + 'goods_price': th.data.bn_goods.shop_price,
  632 + 'member_goods_price': th.data.bn_goods.shop_price,
  633 + 'store_id': oo.stoid,
  634 + 'prom_type':th.data.bn_goods.prom_type, //促销活动类型
  635 + 'prom_id': th.data.bn_goods.prom_id, //促销活动id
  636 + };
  637 +
  638 + //-- 把导购的信息填入--
  639 + if(gg.guide_id){
  640 + goods.guide_id=gg.guide_id;
  641 + goods.guide_type=gg.guide_type;
  642 + //调用接口判断是不是会员
  643 + await getApp().request.promiseGet("/api/weshop/shoppingGuide/getId/"+oo.stoid+"/"+gg.guide_id,{}).then(res=>{
  644 + if(res.data.code==0){
  645 + goods.guide_name=res.data.data.salesman;
  646 + goods.guide_sn=res.data.data.salesman_no;
  647 + }
  648 + })
  649 + }
  650 +
  651 + //--商品的房间号--
  652 + if(gg.room_id && gg.room_id>0){
  653 + goods.room_id=gg.room_id;
  654 + }
  655 +
  656 + item.order_goods.push(goods);
  657 + pdata.push(item);
  658 + }
  659 +
  660 +
  661 + if (pdata.length==0) return;
  662 + var str = JSON.stringify(pdata);
  663 +
  664 + wx.showLoading({title: "加载中"});
  665 + wx.request({
  666 + url: oo.url + '/api/weshop/order/createWxdOrder',
  667 + data: str,
  668 + method: 'POST',
  669 + header: {
  670 + 'content-type': 'application/json'
  671 + },// 设置请求的 header
  672 + success: function (res) {
  673 +
  674 + th.data.is_summit_ing=0; //是否提交中
  675 + wx.hideLoading();
  676 + if (res.statusCode == 200) {
  677 + var data=res.data;
  678 + if(data.code==0){
  679 + console.log(th.data.is_b_now);
  680 + //如果是购物车结算,还要删除购物车
  681 + if (th.data.is_b_now == 0) {
  682 + console.log(th.data.cartlist_y);
  683 + var list = th.data.cartlist_y;
  684 + for (var i = 0; i < list.length; i++) {
  685 + //删除购物车
  686 + a.delete("/api/weshop/cart/del/" + oo.stoid + "/" + list[i].id, {});
  687 + }
  688 + }
  689 + var order_amount = 0;
  690 + pdata.forEach(function (em, ind) {
  691 + order_amount += em.order_amount;
  692 + })
  693 + //要进行判断,如果是用微信支付,就要跳转到支付界面
  694 + if (order_amount > 0) {
  695 + th.setData({ isclose: 0 });
  696 + //void e.jumpToCart4({
  697 + // order_sn: data.data,
  698 + //}, 1);
  699 + util_pay.pay(data.data, function() {
  700 + //app.my_warnning("支付成功",1,th);
  701 + //setTimeout(function () {
  702 + wx.redirectTo({
  703 + url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data
  704 + })
  705 + //},1000)
  706 +
  707 + }, function () {
  708 + //支付失败
  709 + setTimeout(function () {
  710 + wx.navigateBack({ delta: 1 })
  711 + },1000)
  712 + },oo.stoid);
  713 +
  714 + } else {
  715 + var dd = {
  716 + parent_sn: data.data,
  717 + store_id: oo.stoid,
  718 + type: 2,
  719 + };
  720 + a.post("/api/weshop/order/pay/createOrder", {
  721 + data: dd,
  722 + success: function (t) {
  723 + //console.log(t);
  724 + if(t.data.code==0){
  725 + //app.my_warnning("支付成功",1,th);
  726 + //setTimeout(function () {
  727 + th.setData({ isclose: 0 });
  728 + wx.redirectTo({
  729 + url: "/pages/payment/pay_success/pay_success?type=2&order_sn="+data.data,
  730 + })
  731 + //}, 1000)
  732 + }
  733 + },
  734 + fail:function () {
  735 +
  736 + }
  737 + });
  738 + }
  739 +
  740 + }
  741 + else{
  742 + //--内容换行--
  743 + var msg=data.msg;
  744 + //赠品活动已经取消,无法赠送,是否继续买单?
  745 + if(msg.indexOf("是否继续买单")>0){
  746 + wx.showModal({
  747 + title:"提示",
  748 + content: data.msg,
  749 + cancelText:'取消',
  750 + confirmText:'确定',
  751 + showCancel: true,
  752 + success(res){
  753 + if(res.cancel){
  754 + return;
  755 + }else if(res.confirm){
  756 + th.data.is_continue=1;
  757 + th.submitForm(sub_value);
  758 + }
  759 + }
  760 + })
  761 + return;
  762 + }
  763 + if(msg.length>13){
  764 + msg=msg.slice(0, 13) + "\r\n"+ msg.slice(13);
  765 + }
  766 + getApp().confirmBox(msg);
  767 + }
  768 + }else{
  769 + console.log("index.js wx.request CheckCallUser statusCode" + res.statusCode);
  770 + }
  771 + },
  772 + fail: function () {
  773 + th.data.is_summit_ing=0;
  774 + wx.hideLoading();
  775 + console.log("index.js wx.request CheckCallUser fail");
  776 + },
  777 + complete: function () {}
  778 + })
  779 +
  780 + },
  781 +
  782 + //---确认线下门店的数量足不足---
  783 + async check_store_num(goods_id,pick,goods_num,func){
  784 + var lock=0,pick_no,plist,erpwareid;
  785 + //先读取门店的lock
  786 + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page",{
  787 + data:{store_id:os.stoid,wareId:goods_id,storageId:pick,pageSize:1000}
  788 + }).then(res=>{
  789 + if(res.data.code==0 && res.data.data.total>0){
  790 + for(var i in res.data.data.pageData)
  791 + lock+=res.data.data.pageData[i].outQty;
  792 + }
  793 + })
  794 + //先获取门店的编号
  795 + await getApp().request.promiseGet("/api/weshop/pickup/get/"+os.stoid+"/"+pick,{
  796 + data:{storeId:os.stoid,goodsId:t.goods_id,pickupId:pick}
  797 + }).then(res=>{
  798 + if(res.data.code==0){
  799 + pick_no=res.data.data.pickup_no;
  800 + }
  801 + })
  802 + //先获取商品的线下库存
  803 + await getApp().request.promiseGet("/api/weshop/goods/get/"+os.stoid+"/"+goods_id,{
  804 + data:{storeId:os.stoid,goodsId:t.goods_id,pickupId:pick}
  805 + }).then(res=>{
  806 + if(res.data.code==0){
  807 + erpwareid=res.data.data.erpwareid;
  808 + }
  809 + })
  810 + //读取线下的门店库存
  811 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages",{
  812 + data:{storageNos:pick_no,wareIds:encodeURIComponent(erpwareid),storeId:os.stoid}
  813 + }).then(res=>{
  814 + if(res.data.code==0){
  815 + plist=res.data.data.pageData[0];
  816 + }
  817 + })
  818 + var isok=1;
  819 + if(goods_num>plist.CanOutQty-lock){
  820 + isok=0;
  821 + }
  822 + func(isok);
  823 + },
  824 +
  825 + useCoupon: function() {
  826 + if (this.data.order.couponNum <= 0) {
  827 + getApp().my_warnning("无可用优惠券",0,this);
  828 + return;
  829 + }
  830 +
  831 + var a = {
  832 + lid: this.data.coupon ? this.data.coupon.id : "0"
  833 + };
  834 + wx.navigateTo({
  835 + url: "/pages/user/checkcoupon/checkcoupon?" + s.Obj2Str(a)
  836 + });
  837 + },
  838 + enterAddressPage: function() {
  839 + getApp().globalData.is_cart_old=1;
  840 + this.data.isget_by_quan={};
  841 + this.data.enterAddressPage = !0, wx.navigateTo({
  842 + url: "/pages/user/address_list/address_list"
  843 + });
  844 + },
  845 +
  846 +
  847 +
  848 + //--------立即购买时,选择自提和物流----------
  849 + setexptype:function(t){
  850 + var th=this;
  851 + var ty = t.currentTarget.dataset.t,def_exp_code= getApp().globalData.userInfo.def_exp_code;
  852 + th.setData({ bn_exp_type:ty});
  853 + //当物流为空的时候。
  854 + if (ty == 0 && th.data.wu_arr==null){
  855 + th.data.isget_by_quan={};
  856 + return th.get_wuliu(th.calculatePrice2());
  857 + }
  858 +
  859 + //--自提就要把包邮券清理掉--
  860 + if(ty==1){
  861 + th.data.isget_by_quan={};
  862 + if(th.data.using_quan && th.data.using_quan[th.data.bn_pick] && th.data.using_quan[th.data.bn_pick].isby==1){
  863 + th.setData({using_quan:{}});
  864 + }
  865 + }
  866 +
  867 + //判断有没有默认的物流地址值
  868 + if (def_exp_code != "" && def_exp_code != null && def_exp_code !=undefined) {
  869 + var wu_arr=this.data.wu_arr;
  870 + if (wu_arr!= null && wu_arr!=""){
  871 + for(var i=0;i<wu_arr.length;i++){
  872 + if (wu_arr[i].shipping_code == def_exp_code){
  873 + th.setData({index:i});
  874 + }
  875 + }
  876 + }
  877 + }
  878 + th.calculatePrice2()
  879 +
  880 + },
  881 +
  882 + //--------立即购买时,使用余额--------
  883 + set_bn_useyuer:function(){
  884 + var th=this;
  885 + th.setData({ bn_use_money: !th.data.bn_use_money});
  886 + th.calculatePrice2();
  887 + },
  888 + set_js_useyuer:function(){
  889 + var th = this;
  890 + th.setData({ js_use_money: !th.data.js_use_money });
  891 + th.calculatePrice();
  892 + },
  893 + //-------------------计算物流---------------
  894 + calculatewuliu:function(code, o_shipping_price, goods_weight,
  895 + goods_piece,user_addr, freight_free, o_price, rs){
  896 + var price =0,th=this;
  897 + price +=parseFloat(o_shipping_price);
  898 + //如果是包邮
  899 + if (freight_free > 0 && o_price >= freight_free){ return 0;}
  900 + if (user_addr==null) { return 0; }
  901 + //计算物流的config item;
  902 + var item=null;
  903 + //先根据 镇 县 区找计算的config
  904 + item = th.get_wuliu_config(user_addr.district,code,rs);
  905 + if (item==null) item = th.get_wuliu_config(user_addr.city, code, rs);
  906 + if (item==null) item = th.get_wuliu_config(user_addr.province, code, rs);
  907 + if (item == null) item = th.get_wuliu_default(code,rs);
  908 + if (item == null) return o_shipping_price;
  909 + var fw_price = 0, fp_price=0;
  910 + item=item.config;
  911 + if (item == null) return o_shipping_price;
  912 + //------按重量----------
  913 + if (goods_weight>=0 && item['money']) {
  914 + fw_price =parseFloat(item['money']);
  915 + if (goods_weight > item['first_weight']){
  916 + var fw = goods_weight - item['first_weight'];
  917 + var n = Math.ceil(fw/item['second_weight'])
  918 + fw_price = fw_price + n * parseFloat(item['add_money']);
  919 + }
  920 + }
  921 + //------按件数----------
  922 + if (goods_piece > 0 && item['piecemoney']) {
  923 + fp_price = parseFloat(item['piecemoney']);
  924 + if (goods_piece > item['first_piece']) {
  925 + var fp = goods_piece - item['first_piece'];
  926 + var m = Math.ceil(fp / item['second_piece'])
  927 + fp_price = fp_price + m * parseFloat(item['add_piecemoney']);
  928 + }
  929 + }
  930 + var rspice =parseFloat(price + fw_price + fp_price);
  931 + return rspice;
  932 + },
  933 +
  934 + //------------循环获取config-----------
  935 + get_wuliu_config:function(region_id,code,rs){
  936 + var item=null,rslist = rs.pageData;
  937 + for (var i = 0; i < rslist.length;i++){
  938 + if (rslist[i].code == code && rslist[i].region_id == region_id) { item = rslist[i];}
  939 + }
  940 + return item;
  941 + },
  942 + //-------循环获取config,code default-------
  943 + get_wuliu_default: function (code, rs) {
  944 + var item = null, rslist=rs.pageData;
  945 + for (var i = 0; i < rslist.length; i++) {
  946 + if (rslist[i].shipping_code == code && rslist[i].is_default == 1) { item = rslist[i]; }
  947 + }
  948 + return item;
  949 + },
  950 +
  951 + //----------立即购买,选择物流-------------
  952 + bindPickerChange:function(e){
  953 + var ind = e.detail.value
  954 + this.setData({ index: ind });
  955 + this.calculatePrice2();
  956 + },
  957 + //----------购物车结算,选择物流-------------
  958 + bindPickerChange_w: function (e) {
  959 + var ind=e.detail.value, txt = e.currentTarget.dataset.txt;
  960 + this.setData({ [txt]: ind });
  961 + this.calculatePrice();
  962 + },
  963 +
  964 + cart_set_err:function(e){
  965 + var txt = e.currentTarget.dataset.err;
  966 + var ob={};
  967 + ob[txt] = this.data.imgUrl + "/miniapp/images/default_g_img.gif";
  968 + this.setData(ob);
  969 + },
  970 +
  971 + //// 开启物流的弹窗
  972 + show_wu_arr:function(e){
  973 + var wu_arr_txt=e.currentTarget.dataset.txt;
  974 + var w_sele_index=e.currentTarget.dataset.w_sele_index;
  975 + var is_express=null;
  976 + var ob={open_express: 1,wu_arr_txt:wu_arr_txt,disabled:1};
  977 +
  978 + //--如果是多个门店的时候--
  979 + if(w_sele_index!=undefined){
  980 + is_express=this.data.cartlist[w_sele_index].wind;
  981 + ob['is_express']=is_express;
  982 + }
  983 + this.setData(ob);
  984 + },
  985 + // 关闭物流的弹窗
  986 + close_express:function(){
  987 + this.setData({ open_express:0,disabled:0 });
  988 + },
  989 + // 选择物流
  990 + click_express_name:function(e){
  991 + var express_name = e.currentTarget.dataset.name, shippingcode = e.currentTarget.dataset.shippingcode;
  992 + var index=e.currentTarget.dataset.idxe;
  993 + var ob={ is_express: index, is_shipping_code: shippingcode,disabled:0};
  994 + ob[this.data.wu_arr_txt]=index;
  995 + this.setData(ob);
  996 + },
  997 +
  998 + //点击确定物流
  999 + determine_expres:function(e){
  1000 + this.setData({ open_express: 0});
  1001 + this.calculatePrice2();
  1002 + },
  1003 +
  1004 + //设置默认物流
  1005 + select_default_logistics: function () {
  1006 + var th=this;
  1007 + var is_shipping_code=this.data.is_shipping_code
  1008 + getApp().request.put("/api/weshop/users/update",{
  1009 + data: { user_id: getApp().globalData.user_id, store_id: oo.stoid, def_exp_code: is_shipping_code},
  1010 + success:function(rse){
  1011 + if (rse.data.code==0){
  1012 + getApp().globalData.userInfo.def_exp_code=is_shipping_code;
  1013 + th.setData({ open_express: 0 });
  1014 + //----计算此时购物车的价格----
  1015 + if(th.data.is_b_now==1) th.calculatePrice2();
  1016 + else th.calculatePrice();
  1017 + }
  1018 + }
  1019 + })
  1020 + },
  1021 +
  1022 + //更新下默认,在onshow里面
  1023 + update_code(){
  1024 + var th=this,m_wind=0,def_exp_code=getApp().globalData.userInfo.def_exp_code;
  1025 + //--定时器,判断wu_arr不未空--
  1026 + var uii=setInterval(function () {
  1027 + if(th.data.wu_arr)
  1028 + {
  1029 + clearInterval(uii);
  1030 + for (var k = 0; k < th.data.wu_arr.length; k++) {
  1031 + var item = th.data.wu_arr[k];
  1032 + if (def_exp_code == item.code) { m_wind = k; }
  1033 + }
  1034 + //--如果是立即购买--
  1035 + th.setData({index: m_wind,is_express:m_wind});
  1036 +
  1037 + }
  1038 + },500);
  1039 + },
  1040 +
  1041 + //检查区域是不是包邮
  1042 + check_area:function(arr){
  1043 + var user_addr=this.data.user_addr;
  1044 + for(var i in arr){
  1045 + var item=arr[i];
  1046 + if(user_addr.twon==item || user_addr.district==item
  1047 + || user_addr.city==item|| user_addr.province==item ){
  1048 + return 0;
  1049 + }
  1050 + }
  1051 + return 1;
  1052 + },
  1053 +
  1054 + //检查立即购买的商品是不是不包邮
  1055 + check_good:function(arr,goods_id){
  1056 + if(!goods_id) goods_id=this.data.bn_goods.goods_id;
  1057 + for(var i in arr){
  1058 + var item=arr[i];
  1059 + if(goods_id==item) return 0;
  1060 + }
  1061 + return 1;
  1062 + },
  1063 + check_by_area:function(region_list){
  1064 + var arr=region_list.split(",");
  1065 + var check=this.check_area(arr);
  1066 + return !check;
  1067 + },
  1068 + check_by_goods:function(goods_list,goods_id){
  1069 + var arr=goods_list.split(",");
  1070 + var check=this.check_good(arr,goods_id);
  1071 + return !check;
  1072 + },
  1073 +
  1074 +
  1075 + //从优惠的映射中拿出商品从表的item
  1076 + arr_get_goods:function(goods_id,arr){
  1077 + for(var i in arr){
  1078 + if(arr[i].goods_id==goods_id) return arr[i];
  1079 + }
  1080 + },
  1081 +
  1082 + //跳转到购买卡
  1083 + buycard:function(){
  1084 + getApp().goto("/pages/user/plus/plus");
  1085 + getApp().globalData.plus_buy_back=1;
  1086 + }
  1087 +
  1088 +});
... ...
pages/cart/cart2_inte/cart2_inte.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "填写订单",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "warn": "/components/long_warn/long_warn"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
pages/cart/cart2_inte/cart2_inte.wxml 0 → 100644
  1 +<wxs module="filter" src="c_filter.wxs"></wxs>
  2 +<wxs src="filter.wxs" module="util"></wxs>
  3 +<wxs module="filters" src="../../../utils/filter.wxs"></wxs>
  4 +
  5 +<form bindsubmit="submitForm">
  6 + <view class="container">
  7 + <!--要进行判断地址是否显示---->
  8 + <view bindtap="enterAddressPage" class="user-mes mgt20" hidden='{{(bn_exp_type==1 && is_b_now==1) || (is_all_zt==1 && is_b_now==0)}}'>
  9 + <!---默认地址显示------>
  10 + <block wx:if="{{user_addr!=null}}">
  11 +
  12 + <view class="user-contact">
  13 + <text>收货人:</text>{{user_addr.consignee}}{{'  '}}{{user_addr.mobile}}</view>
  14 + <view class="location">
  15 + <view class="address">{{user_addr.more_address}}{{' '}}{{user_addr.address}}</view>
  16 + <view class="pos-icon">
  17 + <image class="wh100 bdr14" src="{{imgUrl}}/miniapp/images/goodscategory/new_position.png"></image>
  18 + </view>
  19 + </view>
  20 + <view class="update-logistics">
  21 + <!-- <image class="arrow-rigth" src="{{imgUrl}}/miniapp/images/new_position.png"></image> -->
  22 + <view class="xc-right"></view>
  23 + </view>
  24 + </block>
  25 + <!---先增地址------>
  26 + <block wx:else>
  27 + <view class="add_new">
  28 + <image class="addr_jia" src="{{imgUrl}}/miniapp/images/jia.png"></image>添加地址
  29 + </view>
  30 + </block>
  31 + <!-- <view class="border-img">
  32 + <image class="wh100" src="{{imgUrl}}/miniapp/images/order/new_dividing_line.png"></image>
  33 + </view> -->
  34 + </view>
  35 +
  36 +
  37 +
  38 + <!-- ----立即购买------ -->
  39 + <!-- <view class="xc-border xc-border"></view> -->
  40 + <block wx:if="{{is_b_now==1}}">
  41 + <view class="use-item bfff bdr_t-14 mgt20">
  42 + <image class="dp" src='{{imgUrl}}/miniapp/images/goodscategory/new_store.png'> </image>
  43 + <view>{{bn_pickname}}</view>
  44 + <!-- <view>门店:{{bn_pickname}}</view> -->
  45 + </view>
  46 + <view class="order-detail">
  47 + <view class="goods-img">
  48 + <image class="wh100 bdr14" src="{{bn_goods.original_img}}" binderror='cart_set_err' data-err="bn_goods.original_img"></image>
  49 + </view>
  50 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{bn_goods.goods_id}}">
  51 + <view class="goods-name ellipsis-2">{{bn_goods.goods_name}}</view>
  52 + <!-- 商品属性 -->
  53 + <view class="flex-vertical fs28 xc-ash color-gray n_guige">
  54 + <view class="goods-color">
  55 + <block><text>{{filters.show_gui_ge(bn_goods.goods_spec,bn_goods.goods_color)}}</text></block>
  56 + </view>
  57 + </view>
  58 +
  59 + <!-----商品名称规格------>
  60 + <view class="order-num flex-space-between">
  61 + <view class="co-red">
  62 + <text wx:if="{{bn_goods.integral}}" class="fs36">{{bn_goods.integral}}积分</text>
  63 + <text wx:if="{{bn_goods.integral && bn_goods.shop_price}}">+</text>
  64 + <block wx:if="{{bn_goods.shop_price}}"> ¥<text class="fs36">{{filters.toFix(bn_goods.shop_price,2)}}</text></block>
  65 + </view>
  66 + <view class="goods-num">x{{bn_goods.buynum}}</view>
  67 + </view>
  68 + </navigator>
  69 +
  70 + </view>
  71 +
  72 + <view class="set-mes bdr_b-14">
  73 + <view wx:if="{{order.store_prom}}">
  74 + <icon color="#f23030" size="16" type="info"></icon>{{order.store_prom}}
  75 + </view>
  76 +
  77 + <view class="xc-coupon-frame flex-center" data-bn="1" bindtap="open_coupon_list" data-pickid="{{bn_pick}}" wx:if="{{(selected_quan_list && selected_quan_list.length>0) || get_by_quan_list!=null}}">
  78 + <view class="work-frame flex-space-between">
  79 + <view class="work">
  80 + 优惠券 <text class="quan_num_show">{{(selected_quan_list?selected_quan_list.length:0)+ (get_by_quan_list?get_by_quan_list.length:0)}}张可用</text>
  81 + </view>
  82 + <view class="xc-right-frame">
  83 + <text wx:if="{{using_quan[bn_pick].is_nouse}}">不使用</text>
  84 + <block wx:else>
  85 + <text wx:if="{{using_quan[bn_pick].money}}">¥{{using_quan[bn_pick].money}}元优惠券</text>
  86 + <text wx:if="{{using_quan[bn_pick].isby}}">包邮券</text>
  87 + </block>
  88 + <view class="xc-right"></view>
  89 + </view>
  90 + </view>
  91 + </view>
  92 +
  93 + <view class="use-item flex-space-between">
  94 + <view class="flex">
  95 + <view bindtap='setexptype' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{bn_t_exp_t==2?'none':'flex;align-items:center;'}};">
  96 + <icon color="{{bn_exp_type==1?'red':'gray'}}" size="16" type="success"></icon>
  97 + <view class="yu_er">门店自提</view>
  98 + </view>
  99 + <view bindtap='setexptype' data-t='0' data-txt='cartlist[{{pidx}}].exp_type' style="display:{{bn_t_exp_t==1?'none':'flex;align-items:center;'}};">
  100 + <icon color="{{bn_exp_type==0?'red':'gray'}}" size="16" type="success"></icon>
  101 + <view class="yu_er">快递邮寄</view>
  102 + </view>
  103 + </view>
  104 + <block wx:if="{{bn_exp_type==0}}">
  105 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index'>
  106 + <view class="logistics-name">{{wu_arr[index].name}}</view>
  107 + <view class="xc-right"></view>
  108 + </view>
  109 + </block>
  110 + </view>
  111 + </view>
  112 +
  113 + <view class="coupon-mes flex-vertical">
  114 + <view>留言</view>
  115 + <view class="leave-word">
  116 + <input placeholder-class="fs28" placeholder='给商家留言,最多100字' bindinput="keyUpChangeNum" disabled="{{disabled}}"
  117 + class="word-box" maxlength="100" name="user_note"></input>
  118 + </view>
  119 + </view>
  120 +
  121 + <!-- ---使用余额---- -->
  122 + <view class="set-mes bdr_t-14" wx:if="{{yuer>0 && formData.all_price>0}}">
  123 + <view class="use-item" bindtap='set_bn_useyuer'>
  124 + <icon color="{{bn_use_money?'red':'gray'}}" size="16" type="success"></icon>
  125 + <view class="yu_er">使用余额 :¥{{yuer}} </view>
  126 + </view>
  127 + </view>
  128 +
  129 + </block>
  130 +
  131 + <view class="information bdr14">
  132 + <view class="item" wx:if="{{formData.all_price>0}}">
  133 + <view>商品金额</view>
  134 + <view class="co-red">¥ {{formData.all_price}}元</view>
  135 + </view>
  136 + <view class="item" wx:if="{{formData.integral>0}}">
  137 + <view>可用积分{{integral_can}}</view>
  138 + <view class="co-red">{{formData.integral}}积分</view>
  139 + </view>
  140 + <view class="item" wx:if="{{formData.shipping_price>0}}">
  141 + <view>配送费用</view>
  142 + <view class="co-red">¥ {{formData.shipping_price}}元</view>
  143 + </view>
  144 + <view class="item" wx:if="{{formData.user_money>0}}">
  145 + <view>使用余额</view>
  146 + <view class="co-red">- ¥ {{formData.user_money}}元</view>
  147 + </view>
  148 + </view>
  149 + </view>
  150 +
  151 + <view class="btn-wrap shadow-1" wx:if="{{show_submit}}">
  152 + <view class="pay-amount">
  153 + <view class="payable">应付金额:<text class="co-red">¥{{formData.order_amount}}</text></view>
  154 + <view class="payable">应付积分:<text class="co-red">{{formData.integral}}积分</text></view>
  155 + </view>
  156 + <button class="tips-btn" formType="submit" id="submitOrder">提交订单</button>
  157 + </view>
  158 +</form>
  159 +
  160 +<!----弹起选择物流名的列表---->
  161 +<view wx:if='{{open_express==1}}'>
  162 + <view class="cover-layer flex-center " bindtap='close_express'>
  163 + </view>
  164 +
  165 + <view class="cx-popup radius {{open_express==1?'up' : 'down'}}">
  166 + <view class="tops flex">
  167 + <view class="top-content fs32">
  168 + <view>选择物流名字</view>
  169 + </view>
  170 + <view class="close-frame" bindtap='close_express'>
  171 + <view class="xc-close-express">×</view>
  172 + </view>
  173 + </view>
  174 + <view class="express_list">
  175 + <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx">
  176 + <view class="express_list_frame" bindtap="click_express_name" data-shippingcode="{{express_list.shipping_code}}"
  177 + data-name="{{express_list.name}}" data-idxe="{{idx}}">
  178 +
  179 + <block wx:if="{{is_express==idx}}">
  180 + <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view>
  181 + </block>
  182 + <block wx:else>
  183 + <view class="circle xc-hooks"></view>
  184 + </block>
  185 + <view class="fs30">{{express_list.name}}</view>
  186 +
  187 + </view>
  188 + </view>
  189 + </view>
  190 + <view class="flex click-buttem">
  191 + <view class="xc-determine flex-center" bindtap="determine_expres">
  192 + <view class="flex-vertical t-c">确定</view>
  193 + </view>
  194 + <view class="xc-confirms flex-center" bindtap="select_default_logistics">
  195 + <view class="flex-vertical t-c">设为默认</view>
  196 + </view>
  197 + </view>
  198 +
  199 + </view>
  200 +</view>
  201 +
  202 +<warn id="warn"></warn>
... ...
pages/cart/cart2_inte/cart2_inte.wxss 0 → 100644
  1 +.bdr_t-14 {
  2 + border-top-left-radius: 14rpx;
  3 + border-top-right-radius: 14rpx;
  4 +}
  5 +.bdr_b-14 {
  6 + border-bottom-left-radius: 14rpx;
  7 + border-bottom-right-radius: 14rpx;
  8 +}
  9 +.bdr14 {
  10 + border-radius: 14rpx;
  11 +}
  12 +.mgt20 {
  13 + margin-top: 20rpx;
  14 +}
  15 +.shadow {
  16 + box-shadow: 0 4rpx 12px #e7e9eb;
  17 +}
  18 +.shadow-1 {
  19 + box-shadow: 16rpx 0px 12px #e7e9eb;
  20 +}
  21 +
  22 +
  23 +page {
  24 + /* background-color: #FAFAFA; */
  25 + background-color: #F0F0F0;
  26 + padding: 0 22rpx;
  27 + box-sizing: border-box;
  28 +}
  29 +.container {
  30 + background-color: #F0F0F0;
  31 + /* padding-top: 28rpx; */
  32 + padding-bottom: 120rpx;
  33 +}
  34 +.user-mes {
  35 + position: relative;
  36 + background-color: #fff;
  37 + font-size: 32rpx;
  38 + color: #444;
  39 + /* margin-top: 28rpx; */
  40 + border-radius: 14rpx;
  41 +}
  42 +.user-contact {
  43 + padding: 24rpx 26rpx;
  44 + font-weight: 600;
  45 +}
  46 +
  47 +.location {
  48 + position: relative;
  49 + padding: 0 70rpx 24rpx;
  50 +}
  51 +
  52 +.pos-icon {
  53 + position: absolute;
  54 + left: 28rpx;
  55 + top: 6rpx;
  56 + width: 30rpx;
  57 + height: 36rpx;
  58 +}
  59 +
  60 +.border-img {
  61 + width: 100%;
  62 + height: 12rpx;
  63 +}
  64 +
  65 +.update-logistics {
  66 + position: absolute;
  67 + right: 0;
  68 + top: 0;
  69 + width: 80rpx;
  70 + height: 100%;
  71 + display: flex;
  72 + align-items: center;
  73 + justify-content: center;
  74 +}
  75 +
  76 +.arrow-rigth {
  77 + width: 32rpx;
  78 + height: 32rpx;
  79 +}
  80 +
  81 +.order-meg {
  82 + margin-bottom: 20rpx;
  83 + font-size: 28rpx;
  84 +
  85 +}
  86 +
  87 +.order-detail {
  88 + padding: 30rpx 0;
  89 + border-bottom: 2rpx solid #eee;
  90 + color: #777;
  91 + min-height: 190rpx;
  92 + background-color: #fff;
  93 +
  94 +}
  95 +
  96 +.goods-img {
  97 + float: left;
  98 + width: 200rpx;
  99 + height: 200rpx;
  100 + margin: 0 20rpx;
  101 +}
  102 +
  103 +.order-cont {
  104 + float: left;
  105 + width: 438rpx;
  106 +}
  107 +
  108 +.goods-name {
  109 + height: 74rpx;
  110 + line-height: 40rpx;
  111 + overflow: hidden;
  112 + margin-bottom: 16rpx;
  113 + font-size: 28rpx;
  114 + color: #333;
  115 +
  116 +}
  117 +
  118 +.goods-color {
  119 + font-size: 24rpx;
  120 +}
  121 +
  122 +.order-num {
  123 + margin-top: 25rpx;
  124 + font-size: 24rpx;
  125 + line-height: 42rpx;
  126 +}
  127 +
  128 +.set-mes{
  129 + background-color: #fff;
  130 + /* margin-top: 20rpx; */
  131 +}
  132 +.use-item{
  133 + display: flex;
  134 + align-items: center;
  135 + height: 80rpx;
  136 + /* border-bottom: 1px solid #ddd; */
  137 + font-size: 30rpx;
  138 + /* width:95%;
  139 +margin:auto; */
  140 + padding: 0 26rpx;
  141 +}
  142 +.use-item>view{
  143 + display: flex;
  144 + /* margin-right: 12rpx; */
  145 +}
  146 +.use-item.bfff{
  147 + background-color: #fff;
  148 +}
  149 +.use-item .dp{
  150 + display: block;
  151 + width: 50rpx;
  152 + height: 50rpx;
  153 + margin-left: -6rpx;
  154 +}
  155 +
  156 +.set-item {
  157 + justify-content: space-between;
  158 + background-color: #fff;
  159 +}
  160 +
  161 +.set-btn {
  162 + display: flex;
  163 + font-size: 24rpx;
  164 +}
  165 +
  166 +.set-mes input {
  167 + width: 380rpx;
  168 + height: 50rpx;
  169 + line-height: 50rpx;
  170 + border: 1px solid #ddd;
  171 +}
  172 +
  173 +.use-btn {
  174 + width: 100rpx;
  175 + height: 50rpx;
  176 + margin-left: 20rpx;
  177 + line-height: 50rpx;
  178 + text-align: center;
  179 + background-color: #f23030;
  180 + color: #fff;
  181 +}
  182 +
  183 +.coupon-mes {
  184 + /* box-sizing: border-box; */
  185 + height:95rpx;
  186 + padding: 0 26rpx;
  187 + background-color: #fff;
  188 + font-size: 30rpx;
  189 + color: #444;
  190 + /* width: 100%; */
  191 + border-radius: 14rpx;
  192 + margin-top: 20rpx;
  193 + margin-bottom: 20rpx;
  194 +}
  195 +
  196 +.coupon-title {
  197 + display: flex;
  198 + justify-content: space-between;
  199 + align-items: center;
  200 + height: 92rpx;
  201 +}
  202 +
  203 +.coupon-title>view {
  204 + display: flex;
  205 +}
  206 +
  207 +.coupon-num {
  208 + height: 36rpx;
  209 + margin-left: 20rpx;
  210 + padding: 0 16rpx;
  211 + line-height: 36rpx;
  212 + text-align: center;
  213 + background-color: #f23030;
  214 + color: #fff;
  215 + font-size: 24rpx;
  216 +}
  217 +
  218 +.leave-word {
  219 + position: relative;
  220 + font-size: 24rpx;
  221 + margin-left: 20rpx;
  222 + flex-grow: 1;
  223 +}
  224 +
  225 +.word-box {
  226 + font-size: 26rpx;
  227 + /* width: 600rpx; */
  228 + padding: 10rpx;
  229 + height: 28rpx;
  230 + line-height: 40rpx;
  231 +}
  232 +
  233 +.max-word {
  234 + position: absolute;
  235 + right: 0;
  236 + bottom: 0;
  237 +}
  238 +
  239 +.information {
  240 + padding: 0 26rpx;
  241 + background-color: #fff;
  242 + /* margin-bottom: 120rpx; */
  243 +}
  244 +
  245 +.information .item {
  246 + display: flex;
  247 + justify-content: space-between;
  248 + height: 60rpx;
  249 + line-height: 60rpx;
  250 + font-size: 26rpx;
  251 + color: #777;
  252 +}
  253 +
  254 +.btn-wrap {
  255 + height: 94rpx;
  256 + box-sizing: border-box;
  257 + display: flex;
  258 + justify-content: space-between;
  259 + background-color: white;
  260 + align-items: center;
  261 + position: fixed;
  262 + bottom: 0;
  263 + left: 0;
  264 + width: 100%;
  265 + padding: 0 30rpx;
  266 +}
  267 +
  268 +.tips-btn {
  269 + /* float: right;
  270 + width: 200rpx;
  271 + height: 100rpx;
  272 + line-height: 100rpx;
  273 + text-align: center;
  274 + font-size: 30rpx;
  275 + color: #fff;
  276 + background-color: #f23030; */
  277 + color: white;
  278 + background-color: #FE4445;
  279 + height: 72rpx;
  280 + line-height: 72rpx;
  281 + padding: 0 42rpx;
  282 + border-radius: 36rpx;
  283 + margin-left: 0;
  284 + margin-right: 0;
  285 +}
  286 +
  287 +.pay-amount {
  288 + /* float: right;
  289 + display: flex;
  290 + align-items: center;
  291 + height: 100rpx;
  292 + font-size: 26rpx;
  293 + margin-right: 40rpx; */
  294 +}
  295 +
  296 +.payable {
  297 + color: #444;
  298 + /* margin-right: 20rpx; */
  299 +}
  300 +
  301 +.shipping-modal {
  302 + z-index: 20;
  303 + position: fixed;
  304 + bottom: 0;
  305 + left: 0;
  306 + right: 0;
  307 + overflow-y: hidden;
  308 + color: #666666;
  309 + background-color: white;
  310 +}
  311 +
  312 +.shipping-nav {
  313 + text-align: center;
  314 + font-size: 35rpx;
  315 + padding-top: 30rpx;
  316 +}
  317 +
  318 +.shipping-list {
  319 + padding: 20rpx 30rpx 40rpx;
  320 + font-size: 28rpx;
  321 +}
  322 +
  323 +.shipping-item {
  324 + display: block;
  325 + padding: 20rpx 0;
  326 +}
  327 +
  328 +.shipping-btn {
  329 + width: 100%;
  330 + color: white;
  331 + background-color: #f23030;
  332 + line-height: 90rpx;
  333 + text-align: center;
  334 + font-size: 40rpx;
  335 +}
  336 +
  337 +/*----------nyf新增,地址---------*/
  338 +.add_new{
  339 + height: 90rpx;
  340 + display: flex;
  341 + align-items: center;
  342 + padding: 0 26rpx;
  343 +}
  344 +.addr_jia{width: 45rpx; height: 45rpx; border: 1rpx solid #ddd;
  345 + margin-right: 15rpx;vertical-align: middle;}
  346 +.yu_er{
  347 + margin-left: 10rpx;
  348 + /* margin-right: 60rpx; */
  349 +}
  350 +.wuliu{margin-left: 20rpx;}
  351 +
  352 +
  353 +/*---- 优惠券列表 -----*/
  354 +.xc-coupon-frame{
  355 + width: 100%;
  356 + height: 92rpx;
  357 +
  358 +}
  359 +.xc-coupon-frame .work-frame{
  360 + width: 100%;
  361 + height: 100%;
  362 + border-bottom:3rpx solid #eee;
  363 + padding: 0 26rpx;
  364 + background-color: white;
  365 +}
  366 +.xc-right{
  367 + width:20rpx;
  368 + height:20rpx;
  369 + border-top:2rpx solid #000;
  370 + border-right:2rpx solid #000;
  371 + transform:rotate(45deg);
  372 + display:inline-block;
  373 +}
  374 +
  375 +.xc-coupon-frame .work-frame .work{ font-size: 30rpx; line-height: 92rpx; }
  376 +.xc-right-frame{font-size: 30rpx;line-height: 92rpx; margin-right: 10rpx }
  377 +
  378 +/* 自定义弹出窗口 */
  379 +.cx-popup{
  380 + width:100%;
  381 + height:880rpx;
  382 + background: #fff;
  383 + z-index: 35;
  384 + border-top-left-radius: 20rpx;
  385 + border-top-right-radius: 20rpx;
  386 + position:fixed;
  387 + bottom:0;
  388 + left: 0;
  389 + /* padding-bottom: 25rpx; */
  390 +}
  391 +
  392 +.cx-popup .top{
  393 + width:95%;
  394 + height:100rpx;
  395 + border-bottom:3rpx solid #ddd;
  396 + margin: auto;
  397 + margin-top: 30rpx;
  398 +
  399 +}
  400 +.xc-top-content{
  401 + width: 93%;
  402 + height:85rpx;
  403 + padding-top: 30rpx;
  404 + font-size: 34rpx;
  405 + font-weight: 600;
  406 +
  407 +}
  408 +
  409 +
  410 +.xc-valid-coupon{
  411 + width: 90%;
  412 + height:40rpx;
  413 + padding-top: 24rpx;
  414 + overflow: hidden;
  415 +}
  416 +.xc-frame{
  417 + width: 100%;
  418 + height:60%;
  419 +}
  420 +
  421 +.xc-frame .list-frame{
  422 + width: 95%;
  423 + height: 100%;
  424 + overflow-y:scroll;
  425 +
  426 +}
  427 +.xc-close-frame{
  428 + margin-top:-10rpx;
  429 +
  430 +}
  431 +
  432 +.xc-close{
  433 + width: 37rpx;
  434 +height: 37rpx;
  435 +border-radius: 50%;
  436 +border: 3rpx solid #333;
  437 +text-align: center;
  438 +line-height: 34rpx;
  439 +font-size: 29rpx;
  440 +color: #333;
  441 +
  442 +}
  443 +.xc-money{
  444 + color: #af2346;
  445 + font-size: 35rpx;
  446 +}
  447 +
  448 +.xc-money-frame{
  449 + margin-left:35rpx;
  450 +
  451 +}
  452 +.xc-coupon-effect{
  453 + width: 99%;
  454 + min-height: 100rpx;
  455 + border-bottom:3rpx solid #ddd;
  456 +
  457 +
  458 +}
  459 +.xc-goods-coupon{
  460 + width: 85%;
  461 + height:100%;
  462 +
  463 +}
  464 +.xc-title{
  465 + width:50%;
  466 + margin-left:222rpx;
  467 +
  468 +}
  469 +.xc-coupon-money0{
  470 + color: #c91e31;
  471 + font-size: 35rpx;
  472 + line-height: 40rpx;
  473 +
  474 +}
  475 +.xc-coupon-money{
  476 + color: #c91e31;
  477 + font-size: 35rpx;
  478 + line-height: 40rpx;
  479 + padding-top: 10px;
  480 +
  481 +}
  482 +.xc-coupon-money1{
  483 + color: #444;
  484 + font-size: 28rpx;
  485 + line-height: 60rpx;
  486 +
  487 +
  488 +}
  489 +.xc-coupon-time{
  490 + height: 50rpx;
  491 + font-size: 27rpx;
  492 + color: #a4a4a4;
  493 +}
  494 +.xc-coupon-time .time{
  495 + margin-left: 15rpx;
  496 + font-size: 27rpx;
  497 +}
  498 +.xc-coupon-selection{
  499 + height:100%;
  500 +}
  501 +
  502 +.xc-confirm {
  503 + width: 50%;
  504 + border-radius: 50rpx;
  505 + height: 80rpx;
  506 + margin:0 auto;
  507 + background:#d60021;
  508 + color:#fff;
  509 + font-size:28rpx;
  510 + margin-top: 28rpx;
  511 +}
  512 +
  513 +.up{ animation: up .7s; }
  514 +.down{ animation: down 1s; }
  515 +@keyframes up { 0% { transform: translateY(550rpx); } 100% { transform: translateY(0); } }
  516 +@keyframes down { 0% { transform: translateY(0); } 100% { transform: translateY(550rpx); } }
  517 +
  518 +.xc-not-Selection{
  519 + width: 40rpx;
  520 +height: 40rpx;
  521 + background: #eeeeee;
  522 +}
  523 +
  524 +
  525 +.xc-close-express{
  526 + width: 40rpx;
  527 +height: 40rpx;
  528 +border-radius: 50%;
  529 +border: 3rpx solid #333;
  530 +text-align: center;
  531 +font-size:32rpx;
  532 +line-height: 38rpx;
  533 +color: #333;
  534 +margin-top: 5rpx;
  535 +}
  536 +.cx-popup .tops{
  537 + width: 100%;
  538 +height: 145rpx;
  539 +border-bottom: 3rpx solid #eee;
  540 +
  541 +}
  542 +.top-content {
  543 + width: 82%;
  544 +padding-top: 33px;
  545 +height: 100%;
  546 +padding-left: 40rpx;
  547 +}
  548 +.close-frame{
  549 + margin-top: 30rpx;
  550 +
  551 +}
  552 +
  553 +.xc-hook {
  554 +width: 33rpx;
  555 +height: 33rpx;
  556 +transform: rotate(-135deg);
  557 +line-height: 35rpx;
  558 +text-align: center;
  559 +margin-right: 20rpx
  560 +
  561 +
  562 +}
  563 +.xc-hooks {
  564 +width: 30rpx;
  565 +height: 30rpx;
  566 +border: 1rpx solid #999;
  567 +margin-right: 20rpx;
  568 +}
  569 +.express_list_frame{
  570 + display: flex;
  571 +height: 80rpx;
  572 +align-items: center;
  573 +padding-left: 40rpx;
  574 +border-bottom: 1rpx solid #eee;
  575 +
  576 +}
  577 +.express_list{
  578 + width: 100%;
  579 + height: 65%;
  580 + overflow-y: auto;
  581 + margin-bottom: 40rpx;
  582 +
  583 +}
  584 +.xc-confirms {
  585 + box-sizing: border-box;
  586 + width: 40%;
  587 + border-radius: 50rpx;
  588 + height: 80rpx;
  589 + margin:0 auto;
  590 + font-size:28rpx;
  591 + background: #fff;
  592 + color: #333;
  593 + border: 2rpx solid #333;
  594 +}
  595 +
  596 +
  597 +/* 优惠券的改版样式 */
  598 +.xc-coupon-frame{
  599 + /* width: 710rpx; */
  600 + width: 100%;
  601 + height:auto;
  602 + margin: 0 auto;
  603 +
  604 +}
  605 +.xc-coupon-frame .coupon-frame{
  606 + width: 100%;
  607 + height: 200rpx;
  608 + margin-top:10rpx;
  609 + border-bottom: 1rpx solid #eee;
  610 +
  611 +}
  612 +.xc-coupon-frame .coupon-frame .coupon-left{
  613 + width: 215rpx;
  614 + height:100%;
  615 + overflow: hidden;
  616 +}
  617 +.xc-money-frames{
  618 + width:96%;
  619 + margin-top: -10px;
  620 +}
  621 +
  622 +.xc-rmb-symbol{
  623 + font-size:40rpx;
  624 +
  625 +}
  626 +
  627 +.xc-rmb-val{
  628 + font-size:60rpx;
  629 +
  630 +}
  631 +.coupon-explain{
  632 + font-size:25rpx;
  633 +width:100%;
  634 +
  635 +
  636 +}
  637 +.xc-valuer{
  638 + margin-top:39rpx;
  639 + margin-left:28rpx;
  640 + font-size:25rpx;
  641 +}
  642 +.coupon-frame .oval{
  643 + width:155rpx;
  644 + height:83rpx;
  645 + border-radius: 50%;
  646 + right:-78rpx;
  647 + top:-37rpx;
  648 +}
  649 +.coupon-right{
  650 + /* width:490rpx; */
  651 + height: 99%;
  652 + border-top: 1rpx solid #eaeaea;
  653 + /* //border-bottom: 1rpx solid #eaeaea; */
  654 + border-right: 1rpx solid #eaeaea;
  655 + flex-grow: 1;
  656 +}
  657 +.coupon-annotation{
  658 + width: 95%;
  659 + height: 100%;
  660 +
  661 +}
  662 +.xc-brand{
  663 + width:100rpx;
  664 + height:35rpx;
  665 + line-height: 35rpx;
  666 + font-size:21rpx;
  667 + border-radius:10rpx; position: relative; top:-1px;
  668 + margin-right: 8rpx
  669 +}
  670 +.top-frame{
  671 + width:82%;
  672 + height: 75rpx;
  673 + margin-top:10rpx;
  674 +}
  675 +.top-frame .coupon-wode{
  676 + font-size: 25rpx;
  677 + margin-left:10rpx;
  678 + width:340rpx;
  679 + height:88rpx;
  680 +}
  681 +.coupon-code{
  682 + width:60rpx;
  683 + height:60rpx;
  684 + margin-top:5rpx;
  685 +
  686 +}
  687 +.frame{
  688 + width: 100%
  689 +}
  690 +.coupon-time{
  691 + font-size: 23rpx;
  692 + line-height:33rpx;
  693 + color: #333;
  694 +}
  695 +
  696 +.clik-get{
  697 + width:125rpx;
  698 + height:45rpx;
  699 + border-radius: 25rpx;
  700 + line-height: 45rpx;
  701 + font-size:25rpx;
  702 + bottom:67rpx;
  703 + right:6px;
  704 +}
  705 +
  706 +.code-img{
  707 + margin-left:20rpx;
  708 +}
  709 +.bottmo-explain{
  710 +top:145rpx;
  711 +width:94%;
  712 +border-top:1rpx dashed #eee;
  713 +padding-top:8rpx;
  714 +height:38rpx;
  715 +line-height: 51rpx;
  716 +
  717 +}
  718 +.font-word{
  719 + font-size: 22rpx;
  720 +}
  721 +.circle-size{
  722 + background: #a0a0a0;
  723 + width: 27rpx;
  724 + height: 27rpx;
  725 + margin-top:13rpx;
  726 +margin-left:8rpx;
  727 +display: flex;
  728 +
  729 +align-items: center;
  730 +}
  731 +.xc-jiantou{
  732 + /* width: 9rpx;
  733 + height: 9rpx; */
  734 + /* border-top: 2rpx solid #fff;
  735 + border-right: 2rpx solid #fff; */
  736 + transform: rotate(-90deg);
  737 + color: #fff;
  738 + font-size: 15rpx;
  739 + /* display:inline-block;
  740 + margin-top: 6.5rpx; */
  741 + text-align: center;
  742 +width: 24rpx;
  743 +}
  744 +.xc-buttom{
  745 + box-sizing: border-box;
  746 + width:100%;
  747 + min-height:76rpx;
  748 + height:auto;
  749 + line-height:40rpx;
  750 + border-left:1rpx solid #eee;
  751 + border-right:1rpx solid #eee;
  752 + border-bottom:1rpx solid #eee;
  753 +/* margin-left: 6rpx; */
  754 +}
  755 +
  756 +.goods-num{
  757 + font-size: 28rpx;
  758 + color: #333;
  759 +}
  760 +
  761 +.explain-coupon{
  762 + font-size:25rpx;
  763 + padding: 10rpx 10rpx
  764 +}
  765 +.circle-frame{
  766 + width: 20rpx;
  767 + height: auto;
  768 + z-index:1;
  769 + left:210rpx;
  770 +
  771 +}
  772 +.circle-sawtooth{
  773 + width: 11rpx;
  774 + height: 11rpx;
  775 + background: #fff;
  776 +}
  777 +
  778 +.red{background-color: #fe7496;}
  779 +.green{ background-color: #22c7c1;}
  780 +.blue{background-color:#5e82e3;}
  781 +.g_gray{background-color: #aaaaaa}
  782 +
  783 +.f_text{text-align: center; height:96rpx; }
  784 +.xc-hook.sn {
  785 + margin-top:12%;
  786 +width:45rpx;
  787 +height:45rpx;
  788 +font-size:28rpx;
  789 +line-height:44rpx;
  790 +
  791 +
  792 +}
  793 +.xc-hooks.on{
  794 + margin-top:12%;
  795 +width:42rpx;
  796 +height:42rpx;
  797 +}
  798 +.may_use_coupon{
  799 + /* width: 95%; */
  800 + /* height: 68rpx; */
  801 + line-height:78rpx;
  802 + padding: 0 26rpx;
  803 + justify-content: space-between;
  804 + align-items: center;
  805 +}
  806 +.determine-frame{
  807 + width: 100%;
  808 + height: 130rpx;
  809 +
  810 +}
  811 +.xc-determine{
  812 + height: 80rpx;
  813 + width: 40%;
  814 + border-radius: 50rpx;
  815 +background: #d60021;
  816 +color: #fff;
  817 +font-size: 28rpx;
  818 +margin: 0 auto;
  819 +
  820 +}
  821 +.click-buttem{
  822 +width: 90%;
  823 +margin: auto;
  824 +}
  825 +.logistics-name{
  826 + margin-right:20rpx;
  827 +}
  828 +.xc-border{
  829 + border-top:8rpx solid #eee;
  830 +width: 100%
  831 +}
  832 +.main-top{
  833 +margin-top: 20rpx;
  834 +
  835 +}
  836 +.xc-hookts{
  837 +border: 1rpx solid #999;
  838 +
  839 +}
  840 +.xc-hookts.on{
  841 + width:30rpx;
  842 +height:30rpx;
  843 +
  844 +}
  845 +.xc-hookt.sn{
  846 + width: 32rpx;
  847 +height: 32rpx;
  848 +font-size: 28rpx;
  849 +line-height: 34rpx;
  850 +}
  851 +.xc-hookt{
  852 + transform: rotate(-135deg);
  853 +text-align: center;
  854 +
  855 +}
  856 +.main-bottom{
  857 + margin-bottom: 20rpx;
  858 +
  859 +}
  860 +.xc-hookst{
  861 + border: 1rpx solid #999;
  862 +
  863 +}
  864 +.xc-hookst.ons{
  865 + width: 42rpx;
  866 +height: 42rpx;
  867 +margin-left: 20rpx;
  868 +
  869 +}
  870 +.is_use_coupon{
  871 + width: 65%;
  872 +justify-content: flex-end;
  873 +padding-top: 10rpx;
  874 +
  875 +
  876 +}
  877 +.xc-hooka{
  878 + transform: rotate(-135deg);
  879 +text-align: center;
  880 +
  881 +}
  882 +.xc-hooka.sn{
  883 + width: 45rpx;
  884 +height: 45rpx;
  885 +font-size: 28rpx;
  886 +line-height: 44rpx;
  887 +margin-left: 20rpx;
  888 +
  889 +}
  890 +.color-gray{
  891 + color: #808080;
  892 +}
  893 +.n_guige{ display: inline-block; background:rgb(236, 236, 236); color: rgb(63,63,63); padding: 3rpx 10rpx; border-radius: 3rpx }
  894 +.gift_image{ width: 60rpx; height: 60rpx; position: absolute; top: 0; left: 0}
  895 +
  896 +.quan_num_show{ padding: 4rpx 6rpx; background-color:#ea5551; color:#fff; border-radius: 6rpx;margin-left:10rpx;font-size:24rpx;}
  897 +
  898 +.navigator-hover {
  899 + background: none;
  900 + opacity: 1;
  901 +}
  902 +
  903 +
  904 +.plus_buy{
  905 + background-color: #fff;
  906 + margin:15rpx 0;
  907 + padding: 20rpx 10rpx;
  908 + position: relative;
  909 +}
  910 +
  911 +
  912 +.card_bg {
  913 + box-sizing: border-box;
  914 + padding: 2rpx 10rpx;
  915 + height: 28rpx;
  916 + border-radius: 26rpx;
  917 + font-size: 18rpx;
  918 + line-height: 28rpx;
  919 + max-width: 210rpx;
  920 + background: #333;
  921 + color: #fff;
  922 + margin-left: 8rpx;
  923 + position:relative;
  924 + top:7rpx;
  925 +}
  926 +
  927 +.card_bg image {
  928 + width: 19rpx;
  929 + height: 19rpx;
  930 + margin-right: 8rpx;
  931 +}
  932 +
  933 +/* .card_bg .card_name {
  934 + max-width: 76rpx;
  935 + width: auto;
  936 + overflow: hidden;
  937 + white-space: nowrap;
  938 +} */
  939 +
  940 +.card_name {
  941 + position: relative;
  942 + top: -4rpx;
  943 + margin-left: 6px;
  944 +}
  945 +
  946 +.car_tri_up {
  947 + width: 0;height: 0;
  948 + border-left: 20rpx solid transparent;
  949 + border-right: 20rpx solid transparent;
  950 + border-bottom: 20rpx solid #fff;
  951 + position: absolute;
  952 + right: 20rpx;
  953 + top:-10rpx
  954 +}
  955 +.card_op{
  956 + position: absolute;
  957 + right: 20rpx;
  958 + top:36rpx
  959 +}
  960 +
... ...
pages/cart/cart2_inte/filter.wxs 0 → 100644
  1 +var format = function (text) {
  2 + if (!text) {
  3 + return
  4 + }
  5 + var reg = getRegExp('\\\\n', 'g')
  6 + return text.replace(reg, '\n')
  7 +}
  8 +
  9 +module.exports = {
  10 + format: format
  11 +}
... ...
pages/cart/cart2_pt/cart2_pt.js
... ... @@ -131,21 +131,30 @@ Page({
131 131 //----------------展示页面,是再获取用户信息之后--------------
132 132 show_page:function(){
133 133 var th=this;
134   - th.setData({ userinfo: to.globalData.userInfo});
135   - //获取立即购买的商品信息
136   - th.get_buy_goods();
137   -
138   - //获取提现金额
139   - getApp().request.get("/api/weshop/withdrawals/summoney", {
140   - data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
141   - success: function (su) {
142   - if (su.data.code == 0) {
143   - var yuer = parseFloat(th.data.userinfo.user_money -
144   - (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
145   - th.setData({ txmon: su.data.data.summoney, yuer: yuer });
146   - }
147   - }
148   - });
  134 + //th.setData({ userinfo: to.globalData.userInfo}); 会员信息要时时获取
  135 + var user=getApp().globalData.userInfo;
  136 + getApp().request.get("/api/weshop/users/get/" + oo.stoid + "/" + user.user_id, {
  137 + data:{r:Math.random()},
  138 + success: function (e) {
  139 +
  140 + getApp().globalData.userInfo = e.data.data;
  141 + th.setData({userinfo:e.data.data});
  142 + //获取立即购买的商品信息
  143 + th.get_buy_goods();
  144 +
  145 + //获取提现金额
  146 + getApp().request.get("/api/weshop/withdrawals/summoney", {
  147 + data: { user_id: to.globalData.user_id, store_id: oo.stoid, status: 0 },
  148 + success: function (su) {
  149 + if (su.data.code == 0) {
  150 + var yuer = parseFloat(th.data.userinfo.user_money -
  151 + (th.data.userinfo.frozen_money>0?th.data.userinfo.frozen_money:0) - su.data.data.summoney).toFixed(2);
  152 + th.setData({ txmon: su.data.data.summoney, yuer: yuer });
  153 + }
  154 + }
  155 + });
  156 + }
  157 + });
149 158 },
150 159  
151 160 //-----获取立即购买的商品信息----
... ... @@ -201,14 +210,18 @@ Page({
201 210 th.setData({card_cut_price:cut_p});
202 211 }
203 212 }
  213 +
  214 + if(th.data.bn_goods){
  215 + et=th.data.bn_exp_type;
  216 + }
  217 +
204 218  
205 219 th.setData({
206 220 bn_goods: t.data.data, bn_pickname: gg.pick_name,
207   - bn_pick: gg.pick_id, bn_t_exp_t: distr_t, is_normal:1
208   - });
209   - if(!th.data.add_back){
210   - th.setData({ bn_exp_type: et })
211   - }
  221 + bn_pick: gg.pick_id, bn_t_exp_t: distr_t, is_normal:1,bn_exp_type:et
  222 + });
  223 +
  224 +
212 225  
213 226 th.calculatePrice2();
214 227 }else{
... ... @@ -241,14 +254,17 @@ Page({
241 254 t.data.data.prom_type = 0;
242 255 t.data.data.is_normal=1;
243 256 }
  257 +
  258 + if(th.data.bn_goods){
  259 + et=th.data.bn_exp_type;
  260 + }
  261 +
244 262 th.setData({
245 263 bn_goods: t.data.data, bn_pickname: gg.pick_name,
246   - bn_pick: gg.pick_id, bn_t_exp_t: distr_t
  264 + bn_pick: gg.pick_id, bn_t_exp_t: distr_t,bn_exp_type:et
247 265 });
248 266  
249   - if(!th.data.add_back){
250   - th.setData({ bn_exp_type: et })
251   - }
  267 +
252 268 //计算价格
253 269 th.calculatePrice2();
254 270 }
... ... @@ -275,10 +291,10 @@ Page({
275 291 }
276 292 })
277 293 //--更新默认地址--,看一下是不是跳到地址页面
278   - if(!getApp().globalData.is_cart2_old){
  294 + if(!getApp().globalData.is_cart_old){
279 295 this.update_code();
280 296 }else{
281   - getApp().globalData.is_cart2_old=0;
  297 + getApp().globalData.is_cart_old=0;
282 298 }
283 299 }
284 300  
... ... @@ -481,7 +497,7 @@ Page({
481 497 'twon': addr == null ? 0 : addr.twon,
482 498 'address': addr == null ? "": addr.address,
483 499 'more_address': addr == null ? "" : addr.more_address,
484   - 'mobile': th.data.userinfo.mobile,
  500 + 'mobile': addr == null ? th.data.userinfo.mobile:addr.mobile,
485 501 'email':'',
486 502 'invoice_title':'',
487 503 'goods_price': th.data.formData.all_price, //商品总价
... ...
pages/cart/cart4/cart4.js
... ... @@ -40,7 +40,9 @@ Page({
40 40  
41 41 //如果是拼单就不做处理
42 42 if(rs.data.data.pageData[0].pt_prom_id>0) {
43   - th.data.pt_order_sn=rs.data.data.pageData[0].order_sn; th.data.is_pt=1; return false;
  43 + th.data.pt_order_sn=rs.data.data.pageData[0].order_sn; th.data.is_pt=1;
  44 + t.setData({ type:1});
  45 + return false;
44 46 }
45 47 //如果是只有一单的情况下,就是单号=组合单号
46 48 if(rs.data.data.pageData[0]['order_sn']==rs.data.data.pageData[0]['parent_sn']){
... ...
pages/giftpack/giftpacklist/giftpacklist.wxml
... ... @@ -74,19 +74,23 @@
74 74 <text class="data-v-3a5b7e36"></text>
75 75 </view>
76 76 <view class="box_ware_item_qty data-v-3a5b7e36">
77   - <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text>
  77 + <text class="data-v-3a5b7e36 ellipsis-1">
  78 + {{"数量:"+item.num}}
  79 + </text>
78 80 </view>
79 81 <view class="box_ware_code data-v-3a5b7e36">
80   - <block wx:if="{{c_state==0}}">
  82 + <!-- <block wx:if="{{c_state==0}}"> -->
81 83 <block wx:if="{{isBuy==0&item.lbType==1}}">
82 84 <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" class="data-v-3a5b7e36"></image>
83 85 </block>
84   - </block>
  86 + <!-- </block> -->
  87 + <!--
85 88 <block wx:else>
86 89 <block wx:if="{{isBuy==0&item.lbType==1}}">
87 90 <image src="{{iurl+'/miniapp/images/giftbag/gift08.png'}}" lazy-load="true" class="data-v-3a5b7e36"></image>
88 91 </block>
89   - </block>
  92 + </block>-->
  93 +
90 94 <block wx:if="{{isBuy==0&item.lbType==2}}">
91 95 <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/coupons/coupons" bindtap="goto"></image>
92 96 </block>
... ...
pages/goods/categoryList/categoryList.wxml
... ... @@ -411,9 +411,13 @@
411 411 <view class="item-cont">
412 412 <view class="title">{{item.goods_name}}</view>
413 413 <!-- 判断是否有活动价 -->
414   - <block wx:if="{{item.prom_price>0}}">
  414 + <block wx:if="{{item.prom_price>0 || item.prom_integral}}">
415 415 <!-- 活动价 -->
416   - <view class="price">¥{{item.prom_price}}</view>
  416 + <view class="price">
  417 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  418 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  419 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  420 + </view>
417 421 <view class="comment flex jc_sb">
418 422 <view class="word-line xc-ash">¥{{item.market_price}}</view>
419 423 <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view>
... ...
pages/goods/goodsInfo/buy_integral.wxml 0 → 100644
  1 +<view bindtap="closeSpecModal_inte" class="cover-layer"></view>
  2 + <view class="spec-model">
  3 + <view class="pding">
  4 + <icon bindtap="closeSpecModal_inte" class="modal-close" color="black" size="22" type="cancel"></icon>
  5 + <view class="spec-goods">
  6 + <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
  7 + <view class="spec-goods-info">
  8 + <view class="spec-goods-name ellipsis-2">{{data.goods_name}}</view>
  9 + <view class="flex ai_end xc-val-money">
  10 + <view class="spec-goods-price">
  11 + <text wx:if="{{prom_integral}}">{{prom_integral}}积分</text>
  12 + <text wx:if="{{prom_integral && prom_price}}">+</text>
  13 + <text wx:if="{{prom_price}}">{{prom_price}}元</text>
  14 + </view>
  15 + </view>
  16 +
  17 +
  18 + <view class="flex">
  19 + <view class="spec-goods-stock">已售:{{prom_act.buy_num}}</view>
  20 + <view class="spec-goods-stock">可售:{{prom_act.limitqty-prom_act.buy_num}}</view>
  21 + </view>
  22 +
  23 + </view>
  24 +
  25 + <!-- 选择门店模块 -->
  26 + <view class="flex-space-between address ai_end xc-width ">
  27 +
  28 + <view class="flex ai_end" wx:if="{{def_pick_store}}">
  29 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  30 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  31 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  32 +
  33 + </view>
  34 + </view>
  35 +
  36 + <!-- 没有门店的时候 -->
  37 + <view class="flex" bindtap="choice_store" wx:else>
  38 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  39 + <view class="fs30" style="color:black;">选择门店</view>
  40 + </view>
  41 +
  42 + <view class="red-co fs28" bindtap="choice_store" >
  43 + 更多门店
  44 + <text class="right-arrow"></text>
  45 + </view>
  46 + </view>
  47 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  48 + <block wx:else>
  49 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  50 + <block wx:else>
  51 + <view wx:if="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  52 + </block>
  53 + </block>
  54 +
  55 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  56 +
  57 +
  58 + <!--商品的属性项目-->
  59 + <view class="xc-goods-attribute">
  60 + <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  61 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  62 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
  63 + {{item.gg}}
  64 + </view>
  65 + </view>
  66 + </view>
  67 +
  68 + <view class="b_num">
  69 + <view>购买数量</view>
  70 + <view class="count">
  71 + <view bindtap="subCartNum_inte" class="sub">-</view>
  72 + <input bindblur="inputCartNum_inte" type="number" value="{{goodsInputNum}}"></input>
  73 + <view bindtap="addCartNum_inte" class="add">+</view>
  74 + </view>
  75 + </view>
  76 + </view>
  77 +
  78 + <!-- 按钮部分 -->
  79 + <view class="spec-cart-btns">
  80 + <!-- 根本就找不到门店 -->
  81 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  82 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  83 + </block>
  84 + <block wx:else>
  85 +
  86 +
  87 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  88 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  89 + </block>
  90 + <block wx:else>
  91 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  92 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  93 + </block>
  94 + <block wx:else>
  95 + <block wx:if="{{!def_pick_store}}">
  96 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  97 + </block>
  98 + <block wx:else>
  99 + <block wx:if="{{data.store_count<=0}}">
  100 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  101 + </block>
  102 + <block wx:else>
  103 + <view bindtap="addCart_inte" class="spec-cart-btn spec-buy" data-action="buy">立即兑换</view>
  104 + </block>
  105 +
  106 + </block>
  107 + </block>
  108 + </block>
  109 + </block>
  110 + </view>
  111 +
  112 +
  113 + </view>
  114 + </view>
  115 + <view class="clear"></view>
0 116 \ No newline at end of file
... ...
pages/goods/goodsInfo/buy_integral_normal.wxml 0 → 100644
  1 +<view bindtap="closeSpecModal_inte_normal" class="cover-layer"></view>
  2 + <view class="spec-model">
  3 + <view class="pding">
  4 + <icon bindtap="closeSpecModal_inte_normal" class="modal-close" color="black" size="22" type="cancel"></icon>
  5 + <view class="spec-goods">
  6 + <image class="wh100 spec-img xc-distance-bottom" src="{{sele_g.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
  7 + <view class="spec-goods-info">
  8 + <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
  9 + <view class="flex ai_end xc-val-money">
  10 + <text class="fs20">¥</text>
  11 + <!-- 如果是等级会员,且有等级价 -->
  12 + <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block>
  13 + <block wx:else>{{sele_g.shop_price}}</block>
  14 + </view>
  15 +
  16 + <view class="flex">
  17 + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  18 + <block wx:if="{{sales_rules==2}}">
  19 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
  20 + <view class="spec-goods-stock" wx:else>可售:0</view>
  21 + </block>
  22 + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
  23 + </view>
  24 +
  25 +
  26 + </view>
  27 +
  28 + <!-- 选择门店模块 -->
  29 + <view class="flex-space-between address ai_end xc-width ">
  30 +
  31 + <view class="flex ai_end" wx:if="{{def_pick_store}}">
  32 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  33 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  34 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  35 +
  36 + </view>
  37 + </view>
  38 +
  39 + <!-- 没有门店的时候 -->
  40 + <view class="flex" bindtap="choice_store" wx:else>
  41 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  42 + <view class="fs30" style="color:black;">选择门店</view>
  43 + </view>
  44 +
  45 + <view class="red-co fs28" bindtap="choice_store" >
  46 + 更多门店
  47 + <text class="right-arrow"></text>
  48 + </view>
  49 + </view>
  50 + <view wx:if="{{only_pk && !only_pk.length}}">(库存不足)</view>
  51 + <block wx:else>
  52 + <view wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">(库存不足)</view>
  53 + <block wx:else>
  54 + <view wx:if="{{def_pick_store && !def_pick_store.CanOutQty && sales_rules==2 && prom_type==0}}">(库存不足)</view>
  55 + </block>
  56 + </block>
  57 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  58 +
  59 +
  60 + <!--商品的属性项目-->
  61 + <view class="xc-goods-attribute">
  62 + <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  63 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  64 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
  65 + {{item.gg}}
  66 + </view>
  67 + </view>
  68 + </view>
  69 +
  70 + <view class="b_num">
  71 + <view>购买数量</view>
  72 + <view class="count">
  73 + <view bindtap="subCartNum" class="sub">-</view>
  74 + <input bindblur="inputCartNum" type="number" value="{{goodsInputNum}}"></input>
  75 + <view bindtap="addCartNum" class="add">+</view>
  76 + </view>
  77 + </view>
  78 + </view>
  79 +
  80 + <!-- 按钮部分 -->
  81 + <view class="spec-cart-btns">
  82 + <!-- 根本就找不到门店 -->
  83 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  84 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  85 + </block>
  86 + <block wx:else>
  87 +
  88 +
  89 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  90 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  91 + </block>
  92 + <block wx:else>
  93 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  94 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  95 + </block>
  96 + <block wx:else>
  97 + <block wx:if="{{!def_pick_store}}">
  98 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  99 + </block>
  100 + <block wx:else>
  101 + <block wx:if="{{data.store_count<=0}}">
  102 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  103 + </block>
  104 + <block wx:else>
  105 + <view class="flex jc_sb">
  106 + <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  107 + data-action="add" style="background-color: #ffb03f;">加入购物车</view>
  108 + <view class="spec-cart-btn spec-buy w40" bindtap="addCart"
  109 + data-action="buy">立即购买</view>
  110 + </view>
  111 + </block>
  112 +
  113 + </block>
  114 + </block>
  115 + </block>
  116 + </block>
  117 + </view>
  118 +
  119 +
  120 + </view>
  121 + </view>
  122 + <view class="clear"></view>
0 123 \ No newline at end of file
... ...
pages/goods/goodsInfo/buy_pt.wxml 0 → 100644
  1 +<view bindtap="closeSpecModal" class="cover-layer"></view>
  2 + <view class="spec-model">
  3 + <view class="pding">
  4 + <icon bindtap="closeSpecModal" class="modal-close" color="gray" size="22" type="cancel"></icon>
  5 +
  6 + <!-- 商品名称 -->
  7 + <view class="spec-goods">
  8 + <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
  9 + <view class="spec-goods-info">
  10 + <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view>
  11 + <view class="flex ai_end xc-val-money {{sele_g[card_field]}}" >
  12 + <view class="spec-goods-price" wx:if="{{is_normal==1}}" >
  13 + <!-- 如果是等级会员,且有等级价 -->
  14 + <block wx:if="{{card_field && sele_g[card_field]>0}}">
  15 + ¥ {{sele_g[card_field]}}
  16 + </block>
  17 + <block wx:else>
  18 + ¥ {{sele_g.shop_price}}
  19 + </block>
  20 + </view>
  21 + <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view>
  22 + </view>
  23 +
  24 + <block wx:if="{{is_normal==1}}">
  25 + <view class="flex">
  26 + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  27 + <block wx:if="{{sales_rules==2}}">
  28 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
  29 + <view class="spec-goods-stock" wx:else>可售:0</view>
  30 + </block>
  31 + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
  32 + </view>
  33 + </block>
  34 + <block wx:if="{{is_normal==0}}">
  35 + <view class="flex">
  36 + <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num}}</view>
  37 + <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
  38 + <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
  39 + </view>
  40 + </block>
  41 + </view>
  42 +
  43 + </view>
  44 +
  45 +
  46 + <view style="clear: both"></view>
  47 + <view style="margin-top: 20rpx">
  48 + <view class="flex-space-between address ai_end xc-width ">
  49 +
  50 + <view class="flex ai_end" wx:if="{{def_pick_store}}">
  51 + <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
  52 + <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
  53 + 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
  54 +
  55 + </view>
  56 + </view>
  57 +
  58 + <!-- 没有门店的时候 -->
  59 + <view class="flex" bindtap="choice_store" wx:else>
  60 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
  61 + <view class="fs28 xc-ash-9f">选择门店</view>
  62 + </view>
  63 +
  64 + <view class="red-co fs28" bindtap="choice_store" >
  65 + 更多门店
  66 + <text class="right-arrow"></text>
  67 + </view>
  68 + </view>
  69 + <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
  70 + </view>
  71 + <!----商品的属性项目---->
  72 + <view>
  73 + <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  74 + <block wx:if="{{is_normal==0}}">
  75 + <view hidden="{{ismend==1}}" class="flex">
  76 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
  77 + </view>
  78 + </view>
  79 + </block>
  80 +
  81 + <block wx:else>
  82 + <view hidden="{{ismend==1}}" class="flex">
  83 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
  84 + </view>
  85 + </view>
  86 + </block>
  87 + <view class="clear"></view>
  88 + </view>
  89 +
  90 +
  91 + <view>
  92 + <!--<view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">-->
  93 + <!--<view wx:if="{{sto_sele_name==''}}">取货门店-->
  94 + <!--<text class='small'>(选择门店)</text>-->
  95 + <!--</view>-->
  96 + <!--<view wx:else>{{sto_sele_name}}</view>-->
  97 + <!--<view class="item-img">-->
  98 + <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>-->
  99 + <!--</view>-->
  100 + <!--</view>-->
  101 +
  102 +
  103 + <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
  104 + <view>购买数量</view>
  105 + <view class="count">
  106 + <view bindtap="subCartNum" class="sub">-</view>
  107 + <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
  108 + <view bindtap="addCartNum" class="add">+</view>
  109 + </view>
  110 + </view>
  111 +
  112 + <view class="clear"></view>
  113 + <!---当选取门店的时候会显示门店的选项---->
  114 + <view hidden="{{ismend==0}}" class="sto_v">
  115 + <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">
  116 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>选择门店
  117 + </view>
  118 + <!-----第一级显示------>
  119 + <view class="itemlists" hidden="{{is_sec_mend==1}}">
  120 + <block wx:if="{{is_show_sto_cat>0}}">
  121 + <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">{{item.name}}</view>
  122 + </block>
  123 + <block wx:else>
  124 + <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}
  125 + </view>
  126 + </block>
  127 + </view>
  128 + <!-----第二级显示------>
  129 + <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">
  130 + <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>{{sec_sto.name}}</view>
  131 + <view class="itemlists" hidden="{{is_sec_mend==0}}">
  132 + <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}
  133 + </view>
  134 + </view>
  135 + </view>
  136 + </view>
  137 + </view>
  138 + <view class="pt_qd">
  139 + <block wx:if="{{is_normal==1}}">
  140 + <!-- 按钮部分 -->
  141 + <view class="spec-cart-btns">
  142 + <!-- 根本就找不到门店 -->
  143 + <block wx:if="{{!only_pk && !def_pickpu_list}}">
  144 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  145 + </block>
  146 + <block wx:else>
  147 +
  148 +
  149 + <block wx:if="{{only_pk.length && !only_pk.length}}">
  150 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999;">库存不足</view>
  151 + </block>
  152 + <block wx:else>
  153 + <block wx:if="{{def_pickpu_list && !def_pickpu_list.length}}">
  154 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  155 + </block>
  156 + <block wx:else>
  157 + <block wx:if="{{!def_pick_store}}">
  158 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">请先选择门店</view>
  159 + </block>
  160 + <block wx:else>
  161 + <block wx:if="{{data.store_count<=0}}">
  162 + <view class="spec-cart-btn fs32" data-action="add" style="background-color: #dcdcdc;color: #999">库存不足</view>
  163 + </block>
  164 + <block wx:else>
  165 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy" data-action="buy">立即购买</view>
  166 + </block>
  167 +
  168 + </block>
  169 + </block>
  170 + </block>
  171 + </block>
  172 + </view>
  173 +
  174 + </block>
  175 + <block wx:else>
  176 + <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
  177 + </block>
  178 +
  179 +
  180 + </view>
  181 + </view>
  182 +
0 183 \ No newline at end of file
... ...
pages/goods/goodsInfo/goodsInfo.js
... ... @@ -28,9 +28,10 @@ Page({
28 28 gid: "",
29 29 stoid: o.stoid,
30 30 url: o.url,
31   - resourceUrl: o.resourceUrl,
  31 + resourceUrl: o.h5_url, //公众号那边的图片文件域名
32 32 iurl: o.imghost,
33 33 defaultAvatar: o.resourceUrl + "/static/images/user68.jpg",
  34 +
34 35 data: null,
35 36 content: "", //商品详情
36 37 comments: null, //商品评论
... ... @@ -242,7 +243,8 @@ Page({
242 243 poster:null, //自定义海报
243 244 share_b_img:'', //自定义分享的背景
244 245  
245   - showPoster: false,
  246 + showPoster: false,
  247 + hui_condition:null,
246 248 },
247 249  
248 250 //------初始化加载----------
... ... @@ -279,8 +281,7 @@ Page({
279 281 },
280 282 fail: function(res) {}
281 283 });
282   - }
283   -
  284 + }
284 285 th.setData({poster:json_data})
285 286  
286 287 }
... ... @@ -313,7 +314,6 @@ Page({
313 314 getApp().globalData.room_goods_id=gid;
314 315 }
315 316  
316   -
317 317 var c_guide_id=t.c_guide_id;
318 318 if(c_guide_id){
319 319 th.data.c_guide_id=c_guide_id;
... ... @@ -388,7 +388,6 @@ Page({
388 388 }
389 389 }, 500)
390 390 })
391   -
392 391 }
393 392  
394 393 });
... ... @@ -404,8 +403,8 @@ Page({
404 403  
405 404 //获取用户的默认门店
406 405 getApp().get_user_store(function(ee) {
407   -
408   - if(!ee) {
  406 +
  407 + if(!ee) {
409 408 th.data.fir_def_store={}; //赋值空对象
410 409 return false;
411 410 }
... ... @@ -480,8 +479,6 @@ Page({
480 479 },1000)
481 480  
482 481 });
483   -
484   -
485 482  
486 483 },
487 484  
... ... @@ -710,7 +707,7 @@ Page({
710 707  
711 708  
712 709 //获取统一条形码,普通商品和优惠促销的商品
713   - if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 4 || ee.data.data.prom_type == 5){
  710 + if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 2 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5){
714 711 //默认门店要拿下门店库存
715 712 if(that.data.sales_rules==2 && that.data.is_newsales_rules){
716 713 //获取门店
... ... @@ -753,8 +750,7 @@ Page({
753 750 ee.get_sku(o.stoid, t.data.data.sku, gid);
754 751 }
755 752 else {
756   - var gg = "",
757   - item = t.data.data;
  753 + var gg = "", item = t.data.data;
758 754  
759 755 if(item.goods_spec=="null" || item.goods_spec==null ) item.goods_spec="";
760 756 if(item.goods_color=="null" || item.goods_color==null) item.goods_color="";
... ... @@ -951,7 +947,106 @@ Page({
951 947 th.add_cart_func(t);
952 948 }
953 949 },
954   - //加入购物的函数
  950 +
  951 +
  952 +
  953 + //-- 加入购物的函数 --
  954 + add_cart_func_inte: function(t) {
  955 + var i = getApp().request;
  956 + if (oo.user_id == null) {
  957 + return s.my_warnning("还未登录!", 0, this);
  958 + }
  959 + var e = this,
  960 + th = e,
  961 + a = 0,
  962 + o = this.data.data;
  963 + a = o.goods_id;
  964 +
  965 + //----------添加到购物车时,要判断限购数量,--------
  966 + e.get_buy_num(o, function(ee) {
  967 + //---判断商品是否超出限购---
  968 + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) {
  969 + if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) {
  970 + wx.showModal({
  971 + title: '提示',
  972 + content: '超出商品限购'
  973 + });
  974 + return false;
  975 + }
  976 + }
  977 + //---判断商品是否超出活动限购---
  978 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  979 + if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
  980 + wx.showModal({
  981 + title: '提示',
  982 + content: '超出商品活动限购'
  983 + });
  984 + return false;
  985 + }
  986 + }
  987 +
  988 + if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th);
  989 + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined)
  990 + this.setData({
  991 + sto_sele_name: ""
  992 + });
  993 + if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th);
  994 +
  995 + //--------------此时操作的数据------------
  996 + var newd = {
  997 + goods_id: o.goods_id,
  998 + goods_num: th.data.goodsInputNum,
  999 + pick_id: th.data.sto_sele_id,
  1000 + user_id: oo.user_id,
  1001 + store_id: th.data.stoid,
  1002 + goods_price: th.data.prom_price,
  1003 + integral:th.data.prom_integral,
  1004 + member_goods_price: o.shop_price,
  1005 + goods_name: o.goods_name,
  1006 + goods_sn: o.goods_sn,
  1007 + sku: o.sku,
  1008 + };
  1009 +
  1010 + //---是不是从收藏夹出来的---
  1011 + if(th.data.c_guide_id){
  1012 + newd['guide_id'] = th.data.c_guide_id;
  1013 + newd['guide_type']=2;
  1014 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=3;
  1015 + }else{
  1016 + if(getApp().globalData.guide_id){
  1017 + newd['guide_id'] = getApp().globalData.guide_id;
  1018 + newd['guide_type']=0;
  1019 + if ("add" == t.currentTarget.dataset.action) newd['guide_type']=1;
  1020 + }
  1021 + }
  1022 +
  1023 + //让商品带上房间号
  1024 + //让商品带上房间号
  1025 + if(th.data.sys_switch.is_skuroom_id==1){
  1026 + if(th.data.data.goods_id==getApp().globalData.room_goods_id){
  1027 + newd.room_id=getApp().globalData.room_id;
  1028 + }
  1029 + }else{
  1030 + if(newd.goods_id==getApp().globalData.room_goods_id) newd.room_id=getApp().globalData.room_id;
  1031 + }
  1032 +
  1033 + //如果是积分够,is_integral_normal就要有积分购普通购买字段
  1034 + //if(o.prom_type==4){
  1035 + //newd.is_integral_normal=1;
  1036 + //}
  1037 +
  1038 + //-----如果是秒杀,团购,积分购,拼团-----
  1039 + newd.prom_type = th.data.prom_type;
  1040 + newd.prom_id = th.data.prom_id;
  1041 + if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th);
  1042 + if (o.store_count <e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th);
  1043 +
  1044 + th.add_cart_next(e,t,a,o,newd); //立即购买下一步
  1045 +
  1046 + })
  1047 + },
  1048 +
  1049 + //-- 加入购物的函数 --
955 1050 add_cart_func: function(t) {
956 1051 var i = getApp().request;
957 1052 if (oo.user_id == null) {
... ... @@ -1105,7 +1200,7 @@ Page({
1105 1200 add_cart_next(e,t,a,o,newd,CanOutQty){
1106 1201 var th=this,i=getApp().request;
1107 1202 //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------
1108   - if(o.prom_type!=1 && o.prom_type!=6){
  1203 + if(o.prom_type!=1 && ((o.prom_type!=6 && o.prom_type!=4) || th.data.is_normal)){
1109 1204 var conf=th.data.bconfig;
1110 1205 if (conf.switch_list && getApp().globalData.userInfo['card_field']){
1111 1206 var s_list=JSON.parse(conf.switch_list);
... ... @@ -1258,16 +1353,22 @@ Page({
1258 1353 url: "/pages/cart/integral/integral?" + t.Obj2Str(e)
1259 1354 });
1260 1355 },
1261   -
  1356 +
  1357 +
1262 1358 //----------立即购买-----------
1263 1359 buyNow: function(e) {
1264 1360 // this.data.shippingCost < 0 || this.data.select.stock <= 0 || (Object.assign(e, {
1265 1361 // action: "buy_now"
1266 1362 // }),
1267   - s.set_b_now(e);
1268   - wx.redirectTo({
1269   - url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
1270   - });
  1363 + s.set_b_now(e);
  1364 + if(e.prom_type==4){
  1365 + var url="/pages/cart/cart2_inte/cart2_inte?is_bnow=1&goods_id=" + e.goods_id;
  1366 + getApp().goto(url);
  1367 + }else{
  1368 + wx.redirectTo({
  1369 + url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id,
  1370 + });
  1371 + }
1271 1372 },
1272 1373  
1273 1374 //----------增加购买数量-----------
... ... @@ -1282,6 +1383,20 @@ Page({
1282 1383 inputCartNum: function(t) {
1283 1384 this.checkCartNum(Number(t.detail.value));
1284 1385 },
  1386 +
  1387 + //----------增加购买数量-----------
  1388 + addCartNum_inte: function(t) {
  1389 + this.checkCartNum_inte(this.data.goodsInputNum + 1);
  1390 + },
  1391 + //----------减少购买数量-----------
  1392 + subCartNum_inte: function(t) {
  1393 + this.checkCartNum_inte(this.data.goodsInputNum - 1);
  1394 + },
  1395 + //----------输入框输入购买数量-----------
  1396 + inputCartNum_inte: function(t) {
  1397 + this.checkCartNum_inte(Number(t.detail.value));
  1398 + },
  1399 +
1285 1400  
1286 1401 //------检查数量是不是超出限购------
1287 1402 checkCartNum: function(t) {
... ... @@ -1306,7 +1421,7 @@ Page({
1306 1421 }
1307 1422  
1308 1423 //--判断商品是否超出活动限购--
1309   - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  1424 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) {
1310 1425 if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
1311 1426 wx.showModal({
1312 1427 title: '超出商品活动限购',
... ... @@ -1356,16 +1471,99 @@ Page({
1356 1471 }
1357 1472 t > e || 0 == e ? t = e : t < 1 && (t = 1);
1358 1473 th.setData({ goodsInputNum: t });
  1474 + th.is_show_more_buy();
1359 1475  
1360 1476 })
1361 1477 },
1362 1478  
1363   - closeSpecModal: function() {
  1479 + //----- 检查一下积分购的限购之类的问题 -----
  1480 + checkCartNum_inte: function(t) {
  1481 + var th = this;
  1482 + this.get_buy_num(this.data.data, async function() {
  1483 +
  1484 + //--判断商品是否超出限购--
  1485 + if (th.data.g_buy_num != null && th.data.data.viplimited > 0) {
  1486 +
  1487 + var gd_buy_num=th.data.g_buy_num.get(th.data.sele_g.goods_id);
  1488 +
  1489 + if (t + gd_buy_num > th.data.sele_g.viplimited) {
  1490 + wx.showModal({
  1491 + title: '超出商品限购',
  1492 + });
  1493 +
  1494 + var num= th.data.sele_g.viplimited-gd_buy_num;
  1495 + if(num<0) num=0;
  1496 + th.setData({goodsInputNum:num})
  1497 + return false;
  1498 + }
  1499 + }
  1500 +
  1501 + //--判断商品是否超出活动限购--
  1502 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  1503 + if (t + th.data.prom_buy_num > th.data.prom_buy_limit) {
  1504 + wx.showModal({
  1505 + title: '超出商品活动限购',
  1506 + });
  1507 +
  1508 + var num=th.data.prom_buy_limit- th.data.prom_buy_num ;
  1509 + if(num<0) num=0;
  1510 + th.setData({goodsInputNum:num})
  1511 + return false;
  1512 + }
  1513 + }
  1514 +
  1515 + if (th.data.sele_g.prom_type == 1 || th.data.sele_g.prom_type == 6) {
  1516 + var redis_num = 0;
  1517 + //------判断活动是否抢光-----
  1518 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  1519 + os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, {
  1520 + 1: 1
  1521 + }).then(res => {
  1522 + redis_num = res.data.data;
  1523 + });
  1524 +
  1525 + if (t > redis_num) {
  1526 + wx.showModal({
  1527 + title: '超出商品活动库存',
  1528 + });
  1529 + th.setData({goodsInputNum:redis_num})
  1530 + return false;
  1531 + }
  1532 +
  1533 + }
  1534 +
  1535 + var e = th.data.sele_g.store_count;
  1536 + if(th.data.sales_rules==2){
  1537 + if(!th.data.def_pick_store){
  1538 + wx.showModal({ title: '请选择门店', });
  1539 + return false;
  1540 + }else{
  1541 + e=th.data.def_pick_store.CanOutQty;
  1542 + }
  1543 + }
  1544 +
  1545 + //库存不足,不增加
  1546 + if(e<t){ wx.showModal({ title: '库存不足', });
  1547 + if(e<0) e=0;
  1548 + th.setData({ goodsInputNum: e }); return false;
  1549 + }
  1550 + t > e || 0 == e ? t = e : t < 1 && (t = 1);
  1551 + th.setData({ goodsInputNum: t });
  1552 + })
  1553 + },
  1554 +
  1555 +
  1556 + closeSpecModal: function() {
  1557 + if(this.data.openSpecModal_pt && this.data.is_normal){
  1558 + this.get_sto();
  1559 + }
  1560 +
1364 1561 this.setData({
1365 1562 openSpecModal: !1,
1366 1563 openSpecModal_pt: !1
1367 1564 });
1368 1565 },
  1566 +
1369 1567 openSpecModel: function(t) {
1370 1568 var open_store = t.currentTarget.dataset.ind;
1371 1569  
... ... @@ -1597,7 +1795,8 @@ Page({
1597 1795 store_id: o.stoid,
1598 1796 sku: sku,
1599 1797 isonsale: 1,
1600   - is_on_sale: 1
  1798 + is_on_sale: 1,
  1799 + pageSize:500
1601 1800 }
1602 1801 }).then(res => {
1603 1802 var e = res;
... ... @@ -1692,8 +1891,11 @@ Page({
1692 1891  
1693 1892 that.check_is_youhui(gid)
1694 1893  
1695   -
  1894 + var ty=0;
  1895 +
1696 1896 this.get_sto();
  1897 +
  1898 +
1697 1899 //默认门店要拿下门店库存
1698 1900 if(that.data.sales_rules==2 && that.data.def_pick_store){
1699 1901 var lock=0,plist=null;
... ... @@ -1778,6 +1980,14 @@ Page({
1778 1980 //---------拿出门店分类和门店------------
1779 1981 get_sto(e) {
1780 1982 var th = this,that=this;
  1983 + var is_normal=e;
  1984 +
  1985 + if(e==1){
  1986 + th.setData({is_normal:1})
  1987 + }else{
  1988 + th.setData({is_normal:0})
  1989 + }
  1990 +
1781 1991 var timer_get = setInterval(function() {
1782 1992 if (th.data.is_get_local_ok == 0) return false;
1783 1993 var dd = null,
... ... @@ -1803,16 +2013,25 @@ Page({
1803 2013 dd.lon = th.data.lon;
1804 2014 }
1805 2015 clearInterval(timer_get);
1806   -
  2016 +
  2017 + //如果会员是有默认的门店话
  2018 + if(!th.data.def_pick_store && th.data.fir_def_store){
  2019 + th.setData({def_pick_store:th.data.fir_def_store});
  2020 + }
  2021 +
1807 2022 if(th.data.def_pick_store && g_distr_type!=0 && th.data.def_pick_store.distr_type!=0 && th.data.def_pick_store.distr_type!=g_distr_type ){
1808 2023 th.setData({def_pick_store:null});
1809 2024 }
1810   -
  2025 +
  2026 + wx.showLoading({
  2027 + title:'加载中.'
  2028 + });
1811 2029 //----------获取门店----------------
1812 2030 getApp().request.promiseGet("/api/weshop/pickup/list", {
1813 2031 data: dd,
1814 2032 }).then(res => {
1815 2033 var e = res;
  2034 +
1816 2035 if (e.data.code == 0) {
1817 2036  
1818 2037 //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店
... ... @@ -1827,7 +2046,7 @@ Page({
1827 2046 }
1828 2047  
1829 2048 //-- 如果有默认选择门店的时候,要把默认门店放在第一位 --
1830   - if (th.data.def_pick_store && (th.data.def_pick_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type )){
  2049 + if (th.data.def_pick_store && (g_distr_type==0 || th.data.def_pick_store.distr_type==0 || th.data.def_pick_store.distr_type==g_distr_type )){
1831 2050 for (var k = 0; k < e.data.data.pageData.length; k++) {
1832 2051 if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) {
1833 2052 e.data.data.pageData.splice(k, 1); //删除
... ... @@ -1840,8 +2059,8 @@ Page({
1840 2059  
1841 2060 th.setData({all_pick_list:e.data.data.pageData});
1842 2061  
1843   - //--获取线下库存,而且不是新的门店规则,同时不能是活动--
1844   - if(th.data.sales_rules==2 && !th.data.is_newsales_rules && th.data.prom_type!=1 && th.data.prom_type!=6){
  2062 + //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购--
  2063 + if(th.data.sales_rules==2 && !th.data.is_newsales_rules && ((th.data.prom_type!=1 && th.data.prom_type!=6 && th.data.prom_type!=4) || is_normal==1)){
1845 2064 setTimeout(function(){
1846 2065 th.deal_pickup_dline(e);
1847 2066 },800)
... ... @@ -1859,8 +2078,8 @@ Page({
1859 2078 //------------处理门店---------------
1860 2079 deal_pickup(e){
1861 2080 var th=this;
1862   -
1863 2081 var g_distr_type=th.data.sele_g.distr_type;
  2082 + wx.hideLoading();
1864 2083  
1865 2084 //单总量超出5个的时候
1866 2085 if (e.data.data.total > 5) {
... ... @@ -1874,6 +2093,7 @@ Page({
1874 2093 },
1875 2094 success: function(ee) {
1876 2095 if (ee.data.code == 0) {
  2096 +
1877 2097 if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) {
1878 2098 var def_arr = new Array();
1879 2099 var ishas = 0;
... ... @@ -1969,10 +2189,7 @@ Page({
1969 2189 };
1970 2190 newarr.push(item);
1971 2191 }
1972   -
1973   -
1974   -
1975   -
  2192 +
1976 2193 th.setData({
1977 2194 is_show_sto_cat: 1,
1978 2195 all_sto: newarr
... ... @@ -2001,7 +2218,7 @@ Page({
2001 2218 }
2002 2219 }
2003 2220 });
2004   - } else {
  2221 + } else {
2005 2222 th.setData({
2006 2223 is_show_sto_cat: 0,
2007 2224 only_pk: e.data.data.pageData
... ... @@ -2017,6 +2234,7 @@ Page({
2017 2234 }
2018 2235 }
2019 2236 },
  2237 +
2020 2238 //------------处理线下门店库存--------
2021 2239 deal_pickup_dline(e){
2022 2240 var pkno=[],th=this;
... ... @@ -2048,8 +2266,10 @@ Page({
2048 2266 data:{storageNos:pkno_str,wareIds:encodeURIComponent(th.data.sele_g.erpwareid),storeId:os.stoid,pageSize:2000}
2049 2267 })
2050 2268 }).then(res=>{
  2269 +
  2270 + wx.hideLoading();
2051 2271 if(res.data.code==0){
2052   - if(res.data.data.pageData){
  2272 + if(res.data.data.pageData && res.data.data.pageData.length>0){
2053 2273 var plist=res.data.data.pageData;
2054 2274 var def_pick_store=th.data.def_pick_store;
2055 2275 //以原来的数组为外循环,保证距离的顺序
... ... @@ -2237,19 +2457,19 @@ Page({
2237 2457 async check_prom(gid, prom_type, prom_id) {
2238 2458 var ee = this,
2239 2459 th = ee;
2240   - if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 4 || prom_type == 5) {
  2460 + if (prom_type == 3 || prom_type == 0 || prom_type == 2 || prom_type == 5) {
2241 2461 this.setData({
2242 2462 prom_type: 0,
2243 2463 isshow: 1,
2244 2464 });
2245 2465 return false;
2246 2466 }
2247   - if(prom_type==4){
2248   - th.setData({is_integral_normal:1});
2249   - }
2250   - //if (prom_type != 3 && prom_type!=0){
2251   - //---判断秒杀----
2252   - if (prom_type == 1) {
  2467 +
  2468 +
  2469 +
  2470 + //if (prom_type != 3 && prom_type!=0){
  2471 + //---判断秒杀----
  2472 + if (prom_type == 1) {
2253 2473 //-------判断活动是否抢光---------
2254 2474 await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, {
2255 2475 1: 1
... ... @@ -2351,6 +2571,55 @@ Page({
2351 2571 })
2352 2572 }
2353 2573  
  2574 + if(prom_type==4){
  2575 + //th.setData({is_integral_normal:1});
  2576 + var rdata={
  2577 + store_id:o.stoid,stype:1,stypeup:1,goods_id:gid
  2578 + }
  2579 +
  2580 + var integrals=0;
  2581 + var get_datas= {
  2582 + user_id:getApp().globalData.user_id, store_id:o.stoid,
  2583 + };
  2584 + await getApp().request.promiseGet("/api/weshop/users/getAllPoints", {
  2585 + data: get_datas
  2586 + }).then(res => {
  2587 + if(res.data.code==0){
  2588 + integrals=res.data.data.Integral;
  2589 + }
  2590 + })
  2591 +
  2592 + //获取一下积分活动
  2593 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", {
  2594 + data: rdata
  2595 + }).then(res => {
  2596 + //调用接口有数据的时候
  2597 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0) {
  2598 + var inte_data=res.data.data.pageData[0];
  2599 + var can_integral=(parseFloat(integrals)>=parseFloat(inte_data.integral));
  2600 + ee.setData({
  2601 + prom_price:parseFloat(inte_data.addmoney),
  2602 + prom_integral:parseFloat(inte_data.integral),
  2603 + prom_type: 4,
  2604 + prom_id: inte_data.id,
  2605 + prom_buy_limit: inte_data.limitvipqty,
  2606 + prom_act: inte_data,
  2607 + isshow: 1,
  2608 + can_integral:can_integral,
  2609 + is_shopbuy: parseInt(inte_data.is_shopbuy?inte_data.is_shopbuy:0)
  2610 + });
  2611 + ee.get_sto();
  2612 +
  2613 + }else{
  2614 + ee.setData({prom_type: 0, isshow: 1,});
  2615 + ee.get_sku(os.stoid, ee.data.data.sku, gid);
  2616 + return false;
  2617 + }
  2618 + })
  2619 +
  2620 + }
  2621 +
  2622 +
2354 2623 //---判断拼单----
2355 2624 if (prom_type == 6) {
2356 2625 //-------判断活动是否抢光---------
... ... @@ -2740,11 +3009,13 @@ Page({
2740 3009 if (ind == 1) {
2741 3010 //如果拼单的sku data是空的,就要先获取一下
2742 3011 if (th.data.sku_g_pt) {
  3012 + th.get_sto(1);
2743 3013 th.setData({
2744 3014 is_normal: ind,
2745 3015 openSpecModal_pt: 1
2746 3016 });
2747 3017 } else {
  3018 + th.get_sto(1);
2748 3019 th.get_sku(o.stoid, th.data.data.sku, th.data.gid, 1, function() {
2749 3020 th.setData({
2750 3021 is_normal: ind,
... ... @@ -2753,7 +3024,7 @@ Page({
2753 3024 });
2754 3025 }
2755 3026 } else {
2756   -
  3027 +
2757 3028 //拼单商品从这里进,先判断有没有买过商品,
2758 3029 getApp().request.get("/api/weshop/order/page", {
2759 3030 data: {
... ... @@ -2845,8 +3116,8 @@ Page({
2845 3116 return false;
2846 3117 }
2847 3118 }
2848   - //---判断商品是否超出活动限购---
2849   - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) {
  3119 + //---判断商品是否超出活动限购,拼团的普通购买不计算活动的限购---
  3120 + if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && th.data.is_normal!=1) {
2850 3121 if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) {
2851 3122 wx.showModal({
2852 3123 title: '提示',
... ... @@ -3292,7 +3563,7 @@ Page({
3292 3563 return false;
3293 3564 }
3294 3565  
3295   - //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
  3566 + //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团 4阶梯团
3296 3567 var type = this.data.prom_type;
3297 3568 if (type == 6) type = 2;
3298 3569 if (this.data.prom_act && this.data.prom_act.kttype == 3) type = 3;
... ... @@ -3379,39 +3650,58 @@ Page({
3379 3650 context.fillText('强烈推荐', 149 * unit + width + 15 * unit, 76 * unit);
3380 3651 }
3381 3652  
3382   -
3383   -
  3653 +
3384 3654 //---产品名称---
3385 3655 //文本换行 参数:1、canvas对象,2、文本 3、距离左侧的距离 4、距离顶部的距离 5、6、文本的宽度
3386   - context.setFillStyle("black");
3387   - context.setFontSize(21.3 * unit)
3388   - th.draw_Text(context, th.data.data.goods_name,
3389   - 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
3390   - //------产品的价格-------
3391   - context.setFontSize(23 * unit)
3392   - context.setFillStyle("red")
3393   - context.fillText("¥", 416 * unit, 185 * unit);
3394   - context.setFontSize(31 * unit)
3395   - var pri0 = th.data.data.shop_price;
3396   - if (th.data.prom_act)
3397   - pri0 = th.data.prom_act.price;
3398   -
3399   - pri0 = parseFloat(pri0).toFixed(2);
3400   - context.fillText(pri0, 438 * unit, 185 * unit);
3401   - //---市场价划掉---
3402   - context.setFillStyle("gray")
3403   - context.setFontSize(22 * unit)
3404   - context.fillText("¥" + th.data.data.market_price, 426 * unit, 213 * unit);
3405   - context.setStrokeStyle('gray')
3406   - context.setLineWidth(1 * unit)
3407   - context.moveTo(426 * unit, 206 * unit)
3408   - context.lineTo(510 * unit, 206 * unit)
3409   - context.stroke();
  3656 + if(type!=4){
  3657 + context.setFillStyle("black");
  3658 + context.setFontSize(21.3 * unit)
  3659 + th.draw_Text(context, th.data.data.goods_name,
  3660 + 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
  3661 + //------产品的价格-------
  3662 + context.setFontSize(23 * unit)
  3663 + context.setFillStyle("red")
  3664 + context.fillText("¥", 416 * unit, 185 * unit);
  3665 + context.setFontSize(31 * unit)
  3666 + var pri0 = th.data.data.shop_price;
  3667 + if (th.data.prom_act)
  3668 + pri0 = th.data.prom_act.price;
  3669 + pri0 = parseFloat(pri0).toFixed(2);
  3670 + context.fillText(pri0, 438 * unit, 185 * unit);
  3671 + //---市场价划掉---
  3672 + context.setFillStyle("gray")
  3673 + context.setFontSize(22 * unit)
  3674 + context.fillText("¥" + th.data.data.market_price, 426 * unit, 213 * unit);
  3675 + context.setStrokeStyle('gray');
  3676 + context.setLineWidth(1 * unit);
  3677 + context.moveTo(426 * unit, 206 * unit);
  3678 + context.lineTo(510 * unit, 206 * unit);
  3679 + context.stroke();
  3680 +
  3681 + }else{
  3682 + context.setFillStyle("black");
  3683 + context.setFontSize(21.3 * unit)
  3684 + th.draw_Text(context, th.data.data.goods_name,
  3685 + 38 * unit, 180 * unit, 20 * unit, 300*unit, unit);
  3686 + //------ 产品的价格 -----
  3687 + var pri0 = th.data.prom_act.addmoney;
  3688 + var integral=th.data.prom_act.integral;
  3689 + var text= "";
  3690 + if(integral){text=integral+"积分"; }
  3691 + if(pri0 && integral){ text+="+";}
  3692 + if(pri0){ text+="¥"+pri0;}
  3693 +
  3694 + context.setFillStyle("red");
  3695 + context.fillText(text, 38 * unit, 215 * unit);
  3696 +
  3697 + }
  3698 +
3410 3699 //---中间大图---
3411 3700 context.drawImage(th.data.share_goods_img, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
3412 3701 //-------大图后面就不一样了-----------
3413 3702 switch (type) {
3414 3703 case 0: //普通商品的展示
  3704 + case 4:
3415 3705 //中间的几个字
3416 3706 if(th.data.poster && parseInt(th.data.poster.style)==2 ){
3417 3707 if(parseInt(th.data.poster.show_quality)){
... ... @@ -3459,10 +3749,17 @@ Page({
3459 3749 //---文字---
3460 3750 context.setFillStyle("black")
3461 3751 context.setFontSize(22 * unit)
3462   - // 原来start --->
3463   - context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
3464   - context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit);
3465   -
  3752 +
  3753 + if(type==0){
  3754 + // 原来start --->
  3755 + context.fillText("优惠乐翻天,精彩就在你身边", 40 * unit, 776 * unit);
  3756 + context.fillText("长按识别二维码,立即开始抢购", 40 * unit, 826 * unit);
  3757 + }else{
  3758 + // 原来start --->
  3759 + context.fillText("长按识别二维码", 40 * unit, 776 * unit);
  3760 + context.fillText("立即开始兑换", 40 * unit, 826 * unit);
  3761 + }
  3762 +
3466 3763 //---二维吗图---
3467 3764 //-- 自定义海报 --
3468 3765 if(th.data.poster){
... ... @@ -3471,7 +3768,7 @@ Page({
3471 3768 context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
3472 3769 }else{
3473 3770 //---二维吗图---
3474   - context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
  3771 + context.drawImage(vpath, 410 * unit, 726 * unit, 115 * unit, 125 * unit);
3475 3772 }
3476 3773  
3477 3774 break;
... ... @@ -3500,9 +3797,7 @@ Page({
3500 3797 }else{
3501 3798 //---二维吗图---
3502 3799 context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
3503   - }
3504   -
3505   -
  3800 + }
3506 3801 break;
3507 3802  
3508 3803 case 2: //会员团和商家团的展示
... ... @@ -3592,6 +3887,8 @@ Page({
3592 3887 context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
3593 3888 }
3594 3889 break
  3890 +
  3891 + case 3: //阶梯团的展示
3595 3892 }
3596 3893  
3597 3894  
... ... @@ -4022,8 +4319,8 @@ Page({
4022 4319 var plist=null;
4023 4320 var lock=0;
4024 4321  
4025   - //---如果是活动的时候---
4026   - if(th.data.prom_type==1 || th.data.prom_type==6){
  4322 + //---如果是活动的时候,同时不是普通购买---
  4323 + if((th.data.prom_type==1 || th.data.prom_type==6 || th.data.prom_type==4) && !th.data.is_normal ) {
4027 4324 func(); return false;
4028 4325 }
4029 4326  
... ... @@ -4290,6 +4587,7 @@ Page({
4290 4587 var storid = os.stoid;
4291 4588 var th = this;
4292 4589 var user=getApp().globalData.userInfo;
  4590 + if(!user) return false;
4293 4591 getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
4294 4592 var plusCard = res.data.data;
4295 4593 var arr = [1219, 2089, 3031];
... ... @@ -4360,6 +4658,8 @@ Page({
4360 4658 collocationGoods:r_data.collocationPromList,
4361 4659 prom_goods:r_data.promGoodsLists,
4362 4660 })
  4661 +
  4662 + th.is_show_more_buy();
4363 4663 }
4364 4664 })
4365 4665 },
... ... @@ -4475,5 +4775,56 @@ Page({
4475 4775 urls: [this.data.shareImgPath]
4476 4776 });
4477 4777 },
  4778 +
  4779 + is_show_more_buy:function(){
  4780 + var prom_goods=this.data.prom_goods;
  4781 + var per_price=this.data.sele_g.shop_price
  4782 + if(this.data.card_field && this.data.sele_g[this.data.card_field]>0){
  4783 + per_price=this.data.sele_g[this.data.card_field];
  4784 + }
  4785 + var all_price=per_price*this.data.goodsInputNum;
  4786 + var con=null;
  4787 + for(var i in prom_goods){
  4788 + var item=prom_goods[i];
  4789 + if(item.prom_type==1){
  4790 + if(item.condition>this.data.goodsInputNum) {
  4791 + con=item;
  4792 + con.need=(item.condition-this.data.goodsInputNum)+"件";
  4793 + break;
  4794 + }
  4795 + }else{
  4796 + if(item.condition>this.data.goodsInputNum){
  4797 + con=item;
  4798 + con.need=(item.condition-this.data.goodsInputNum)+"元";
  4799 + break;
  4800 + }
  4801 + }
  4802 + }
  4803 +
  4804 + this.setData({hui_condition:con});
  4805 +
  4806 + },
  4807 +
  4808 + //-- 积分购 --
  4809 + go_pay_integral:function(){
  4810 + this.setData({openSpecModal_inte:1});
  4811 + },
  4812 + //-- 积分购普通购买 --
  4813 + go_pay_integral_normal:function(){
  4814 + this.get_sto(1)
  4815 + this.setData({openSpecModal_inte_normal:1});
  4816 + },
  4817 +
  4818 + closeSpecModal_inte:function(){
  4819 + this.setData({openSpecModal_inte:0});
  4820 + } ,
  4821 + closeSpecModal_inte_normal:function(){
  4822 + this.get_sto()
  4823 + this.setData({openSpecModal_inte_normal:0});
  4824 + },
  4825 +
  4826 + addCart_inte:function(t){
  4827 + this.add_cart_func_inte(t);
  4828 + }
4478 4829  
4479 4830 });
... ...
pages/goods/goodsInfo/goodsInfo.wxml
... ... @@ -230,8 +230,41 @@
230 230 </view>
231 231 </view>
232 232  
233   - <!-- 不是拼团 -->
234   - <block wx:if="{{prom_type!=6}}">
  233 + <!-- 积分购 -->
  234 + <view wx:if="{{prom_type==4}}">
  235 + <view class="goods-price rel">
  236 + <!-- 价格显示 -->
  237 + <view class="co-red" style="overflow: hidden" >
  238 + <view class="market-price" style="overflow: hidden">
  239 + <image class="rel_img" src="{{iurl}}/miniapp/images/integral/integral_red.png"></image>
  240 + <block wx:if="{{prom_integral}}">{{prom_integral}}
  241 + <text class="rel_txt">积分</text></block>
  242 + <text class="rel_txt" wx:if="{{prom_integral && prom_price}}">+</text>
  243 + <text class="rel_txt" wx:if="{{prom_price}}" >{{filters.toFix(prom_price,2)}}元</text>
  244 + <text class="rel_txt" decode="{{true}}" space="{{true}}" style="color: #999; text-decoration: line-through;">&nbsp;&nbsp;&nbsp;零售价:¥{{data.market_price}}</text>
  245 + </view>
  246 + </view>
  247 +
  248 + <!-- 这个是分享按钮 -->
  249 + <view class="xc-share-frame flex {{prom_type==1?'s_ms_bth':''}} " bindtap="saveImageToPhotosAlbum">
  250 + <image class="share-frame" src="{{iurl}}/miniapp/images/share.png"></image>
  251 + <view class="share-font">分享</view>
  252 + </view>
  253 +
  254 + <view class="goods-title">
  255 + <view class="goods-name elli">{{data.goods_name}}</view>
  256 + </view>
  257 +
  258 + <view class="goods-num">
  259 + <view class="sales">销量:{{prom_act.buy_num}}件</view>
  260 + <view class="stock">折扣:{{filters.pInt((prom_price?prom_price:0)*100/data.shop_price)}}折</view>
  261 + <view class="stock">{{categories3[0].num}}人评价</view>
  262 + </view>
  263 + </view>
  264 + </view>
  265 +
  266 + <!-- 不是拼团,不是积分购 -->
  267 + <block wx:if="{{prom_type!=6 && prom_type!=4}}">
235 268 <view class="goods-price rel">
236 269 <view class="co-red" style="overflow: hidden" wx:if="{{prom_type==0 || prom_type==3}}">
237 270 <view class="market-price" style="overflow: hidden">
... ... @@ -241,7 +274,7 @@
241 274 <view class="fs24 white view card-name ellipsis-1">{{card_name}}</view>
242 275 </view>
243 276 <text class="rel yuan">¥</text>{{filters.toFix(data[card_field],2)}}
244   - <view class='yj' style="top:35rpx">
  277 + <view class='yj' style="top:35rpx">
245 278 <text>零售价:¥{{data.market_price}}</text>
246 279 </view>
247 280 </block>
... ... @@ -350,7 +383,7 @@
350 383 </view>
351 384 </view>
352 385  
353   - <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0}}">
  386 + <view class="xc-explain fs32 ellipsis-2" wx:if="{{prom_type!=0 && prom_type!=4}}">
354 387 {{data.goods_name}}
355 388 </view>
356 389  
... ... @@ -835,7 +868,7 @@
835 868 <view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:if="{{data.goods.is_virtual}}">立即购买</view>
836 869  
837 870 <!-- 普通商品购买 -->
838   - <block wx:if="{{prom_type==0 || prom_type==2 || prom_type==3 || prom_type==4}}">
  871 + <block wx:if="{{prom_type==0 || prom_type==2 || prom_type==3}}">
839 872  
840 873 <!-- 线上销售的时候,要判断库存量, 线下库存的时候不用判断 -->
841 874 <block wx:if="{{(sele_g.store_count>0 && sales_rules==1) || sales_rules==2 }}">
... ... @@ -916,6 +949,34 @@
916 949 <view wx:if="{{user_order_pt_state==3}}" bindtap="go_pay_wk" class="buy-btn cart-btn">支付尾款</view>
917 950 </block>
918 951 </block>
  952 +
  953 +
  954 + <!-------积分购-------->
  955 + <block wx:if="{{prom_type==4}}">
  956 +
  957 + <block wx:if="{{is_shopbuy}}">
  958 + <view bindtap="go_pay_integral_normal" class="join-btn cart-btn line-h">
  959 + <view class="fir-v">
  960 + <block wx:if="{{card_field && sele_g[card_field]>0}}">
  961 + {{filters.toFix(sele_g[card_field],2)}}
  962 + </block>
  963 + <block wx:else>
  964 + {{filters.toFix(sele_g.shop_price,2)}}
  965 + </block>
  966 + </view>
  967 + <view>单独购买</view>
  968 + </view>
  969 + <view bindtap="go_pay_integral" class="buy-btn cart-btn" wx:if="{{can_integral}}" >立即兑换</view>
  970 + <view class="buy-btn cart-btn" style="background-color: #aaa;" wx:else >积分不足</view>
  971 + </block>
  972 +
  973 + <block wx:else>
  974 + <view bindtap="go_pay_integral" class="buy-btn-all cart-btn" style="width: 58%; margin-left:1%;" wx:if="{{can_integral}}" >立即兑换</view>
  975 + <view class="buy-btn-all cart-btn" style="background-color: #aaa; width: 58%;margin-left:1%" wx:else >积分不足</view>
  976 + </block>
  977 +
  978 + </block>
  979 +
919 980 <!---<view bindtap="openSpecModel" class="buy-btn cart-btn cart-btn-lg" wx:else>立即兑换</view>-->
920 981 </view>
921 982  
... ... @@ -926,7 +987,7 @@
926 987  
927 988 <!----弹起来,选择规格数量,普通商品购买和秒杀------>
928 989 <view hidden="{{!openSpecModal}}">
929   - <view bindtap="closeSpecModal" class="cover-layer"></view>
  990 + <view bindtap="closeSpecModal" class="cover-layer"></view>
930 991 <view class="spec-model">
931 992 <view class="pding">
932 993 <icon bindtap="closeSpecModal" class="modal-close" color="black" size="22" type="cancel"></icon>
... ... @@ -935,41 +996,31 @@
935 996 <view class="spec-goods-info">
936 997 <view class="spec-goods-name ellipsis-2">{{sele_g.goods_name}}</view>
937 998 <view class="flex ai_end xc-val-money">
938   - <view class="spec-goods-price" wx:if="{{prom_price==null}}" >
939   - <text class="fs20">¥</text>
940   - <!-- 如果是等级会员,且有等级价 -->
941   - <block wx:if="{{card_field && sele_g[card_field]>0}}">
942   - {{sele_g[card_field]}}
943   - </block>
944   - <block wx:else>
945   - {{sele_g.shop_price}}
946   - </block>
947   -
  999 + <view class="spec-goods-price" wx:if="{{prom_price==null}}" >
  1000 + <text class="fs20">¥</text>
  1001 + <!-- 如果是等级会员,且有等级价 -->
  1002 + <block wx:if="{{card_field && sele_g[card_field]>0}}">{{sele_g[card_field]}} </block>
  1003 + <block wx:else>{{sele_g.shop_price}}</block>
948 1004 </view>
949   - <view class="spec-goods-price" wx:else><text class="fs20">¥</text>{{prom_price}}</view>
950   - </view>
  1005 + <view class="spec-goods-price" wx:else><text class="fs20">¥</text>{{prom_price}}</view>
  1006 + </view>
951 1007  
952 1008 <block wx:if="{{prom_type==0}}">
953   - <view class="flex">
954   - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
955   - <block wx:if="{{sales_rules==2}}">
956   - <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
957   - <view class="spec-goods-stock" wx:else>可售:0</view>
958   - </block>
959   - <block wx:else>
960   - <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view>
961   - </block>
962   -
963   - </view>
  1009 + <view class="flex">
  1010 + <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
  1011 + <block wx:if="{{sales_rules==2}}">
  1012 + <view class="spec-goods-stock" wx:if="{{def_pick_store && def_pick_store.CanOutQty}}">可售:{{def_pick_store.CanOutQty}}</view>
  1013 + <view class="spec-goods-stock" wx:else>可售:0</view>
  1014 + </block>
  1015 + <block wx:else><view class="spec-goods-stock">可售:{{sele_g.store_count}}</view></block>
  1016 + </view>
964 1017 </block>
965 1018 <block wx:if="{{prom_type==1}}">
966   - <view class="flex">
967   - <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view>
968   - <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
969   - <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
970   -
971   -
972   - </view>
  1019 + <view class="flex">
  1020 + <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num+prom_act.virtual}}</view>
  1021 + <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
  1022 + <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
  1023 + </view>
973 1024 </block>
974 1025 </view>
975 1026  
... ... @@ -1006,15 +1057,15 @@
1006 1057 <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
1007 1058 </view>
1008 1059  
1009   - <!----商品的属性项目---->
1010   - <view class="xc-goods-attribute">
1011   - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
1012   - <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
1013   - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
1014   - {{item.gg}}
  1060 + <!--商品的属性项目-->
  1061 + <view class="xc-goods-attribute">
  1062 + <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
  1063 + <view hidden="{{ismend==1}}" style="max-height: 120rpx;overflow-y: auto;">
  1064 + <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">
  1065 + {{item.gg}}
  1066 + </view>
  1067 + </view>
1015 1068 </view>
1016   - </view>
1017   -</view>
1018 1069  
1019 1070  
1020 1071 <view class="b_num">
... ... @@ -1025,6 +1076,20 @@
1025 1076 <view bindtap="addCartNum" class="add">+</view>
1026 1077 </view>
1027 1078 </view>
  1079 +
  1080 + <!-- 提示再买多少优惠 -->
  1081 + <view style="margin-top: 35rpx;color:#333;font-size:28rpx;" wx:if="{{hui_condition && openSpecModal_ind==2}}">
  1082 + 再买{{hui_condition.need}}
  1083 + <text wx:if="{{hui_condition.money}}">,免{{hui_condition.money}}元</text>
  1084 + <text wx:if="{{hui_condition.sale}}">,打{{hui_condition.sale}}折</text>
  1085 + <text wx:if="{{hui_condition.past==1}}">,包邮</text>
  1086 + <text wx:if="{{hui_condition.intValue>0}}">,送{{hui_condition.intValue}}积分</text>
  1087 + <text wx:if="{{hui_condition.couponId>0}}">,送优惠券</text>
  1088 + <text wx:if="{{hui_condition.gift_id>0}}">,送赠品</text>
  1089 + <text wx:if="{{hui_condition.lb_id>0}}">,送礼包</text>
  1090 + </view>
  1091 +
  1092 +
1028 1093 </view>
1029 1094 <view class="spec-cart-btns">
1030 1095 <!-- 根本就找不到门店 -->
... ... @@ -1072,12 +1137,9 @@
1072 1137 </block>
1073 1138 </block>
1074 1139 </block>
1075   - </block>
1076   -
1077   -
1078   - </block>
1079   -
1080   - </view>
  1140 + </block>
  1141 + </block>
  1142 + </view>
1081 1143  
1082 1144 <view class="clear"></view>
1083 1145 <!---选择门店的列表--->
... ... @@ -1103,152 +1165,23 @@
1103 1165 </view>
1104 1166 </view>
1105 1167 </view>
1106   - </view>
1107   -
  1168 + </view>
1108 1169 </view>
1109 1170  
  1171 +<!-- 弹起来,购买积分购 -->
  1172 +<view hidden="{{!openSpecModal_inte}}">
  1173 + <include src="buy_integral.wxml" />
  1174 +</view>
  1175 +<!-- 弹起来,购买积分购的普通购买 -->
  1176 +<view hidden="{{!openSpecModal_inte_normal}}">
  1177 + <include src="buy_integral_normal.wxml" />
  1178 +</view>
1110 1179  
1111 1180 <!----弹起来,选择规格数量,拼单商品购买------>
1112 1181 <view hidden="{{!openSpecModal_pt}}">
1113   - <view bindtap="closeSpecModal" class="cover-layer"></view>
1114   - <view class="spec-model">
1115   - <view class="pding">
1116   - <icon bindtap="closeSpecModal" class="modal-close" color="gray" size="22" type="cancel"></icon>
1117   -
1118   - <!-- 商品名称 -->
1119   - <view class="spec-goods">
1120   - <image class="wh100 spec-img xc-distance-bottom" src="{{data.original_img}}" binderror="pop_err_img" data-errorimg="data.original_img"></image>
1121   - <view class="spec-goods-info">
1122   - <view class="spec-goods-name ellipsis-1">{{sele_g.goods_name}}</view>
1123   - <view class="flex ai_end xc-val-money {{sele_g[card_field]}}" >
1124   - <view class="spec-goods-price" wx:if="{{is_normal==1}}" >
1125   - <!-- 如果是等级会员,且有等级价 -->
1126   - <block wx:if="{{card_field && sele_g[card_field]>0}}">
1127   - ¥ {{sele_g[card_field]}}
1128   - </block>
1129   - <block wx:else>
1130   - ¥ {{sele_g.shop_price}}
1131   - </block>
1132   - </view>
1133   - <view class="spec-goods-price" wx:else>¥ {{prom_price}}</view>
1134   - </view>
1135   -
1136   - <block wx:if="{{is_normal==1}}">
1137   - <view class="flex">
1138   - <view class="spec-goods-stock">已售:{{sele_g.sales_sum}}</view>
1139   - <view class="spec-goods-stock">可售:{{sele_g.store_count}}</view>
1140   - </view>
1141   - </block>
1142   - <block wx:if="{{is_normal==0}}">
1143   - <view class="flex">
1144   - <view class="spec-goods-stock" wx:if="{{prom_st>0}}">已售:{{prom_act.buy_num}}</view>
1145   - <view class="spec-goods-stock" wx:else >已售:{{prom_act.buy_num}}</view>
1146   - <view class="spec-goods-stock">可售:{{prom_act.goods_num-prom_act.buy_num}}</view>
1147   - </view>
1148   - </block>
1149   - </view>
1150   -
1151   - </view>
1152   -
1153   -
1154   -
1155   - <view style="clear: both"></view>
1156   - <view style="margin-top: 20rpx">
1157   - <view class="flex-space-between address ai_end xc-width ">
1158   -
1159   - <view class="flex ai_end" wx:if="{{def_pick_store}}">
1160   - <text class="fs30 xc-black3 shop_name">{{def_pick_store.pickup_name}}</text>
1161   - <view class="distance fs24 xc-ash"wx:if="{{def_pick_store.distance!=null}}">
1162   - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}}
1163   -
1164   - </view>
1165   - </view>
1166   -
1167   - <!-- 没有门店的时候 -->
1168   - <view class="flex" bindtap="choice_store"wx:else>
1169   - <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>
1170   - <view class="fs28 xc-ash-9f">选择门店</view>
1171   - </view>
1172   -
1173   - <view class="red-co fs28" bindtap="choice_store" >
1174   - 更多门店
1175   - <text class="right-arrow"></text>
1176   - </view>
1177   - </view>
1178   - <view class="fs24 xc-ash-9f xc-distance-top "wx:if="{{def_pick_store}}">地址:{{def_pick_store.fulladdress}}</view>
1179   - </view>
1180   - <!----商品的属性项目---->
1181   - <view>
1182   - <view hidden="{{ismend==1}}" class="spec-name">商品属性</view>
1183   - <block wx:if="{{is_normal==0}}">
1184   - <view hidden="{{ismend==1}}" class="flex">
1185   - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
1186   - </view>
1187   - </view>
1188   - </block>
1189   -
1190   - <block wx:else>
1191   - <view hidden="{{ismend==1}}" class="flex">
1192   - <view class="spec_bt {{gid==item.goods_id?'act':''}}" bindtap="sele_spec" data-gid='{{item.goods_id}}' wx:for="{{sku_g}}" wx:key="sku_g">{{item.gg}}
1193   - </view>
1194   - </view>
1195   - </block>
1196   - <view class="clear"></view>
1197   - </view>
1198   -
1199   -
1200   - <view>
1201   - <!--<view bindtap="getmendian" class="quhuo logistics-item" hidden="{{ismend==1}}">-->
1202   - <!--<view wx:if="{{sto_sele_name==''}}">取货门店-->
1203   - <!--<text class='small'>(选择门店)</text>-->
1204   - <!--</view>-->
1205   - <!--<view wx:else>{{sto_sele_name}}</view>-->
1206   - <!--<view class="item-img">-->
1207   - <!--<image class="wh100" src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image>-->
1208   - <!--</view>-->
1209   - <!--</view>-->
1210   -
1211   -
1212   - <view class="b_num" hidden="{{ismend==1}}" style="margin-top: 20rpx">
1213   - <view>购买数量</view>
1214   - <view class="count">
1215   - <view bindtap="subCartNum" class="sub">-</view>
1216   - <input bindblur="inputCartNum" class="xc-val-fream" type="number" value="{{goodsInputNum}}"></input>
1217   - <view bindtap="addCartNum" class="add">+</view>
1218   - </view>
1219   - </view>
1220   -
1221   - <view class="clear"></view>
1222   - <!---当选取门店的时候会显示门店的选项---->
1223   - <view hidden="{{ismend==0}}" class="sto_v">
1224   - <view class="title" hidden="{{is_sec_mend==1}}" bindtap="hidemend">
1225   - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>选择门店
1226   - </view>
1227   - <!-----第一级显示------>
1228   - <view class="itemlists" hidden="{{is_sec_mend==1}}">
1229   - <block wx:if="{{is_show_sto_cat>0}}">
1230   - <view wx:for="{{all_sto}}" wx:key="all_sto" class="item" bindtap="show_sec" data-index="{{index}}">{{item.name}}</view>
1231   - </block>
1232   - <block wx:else>
1233   - <view wx:for="{{only_pk}}" wx:key="only_pk" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}
1234   - </view>
1235   - </block>
1236   - </view>
1237   - <!-----第二级显示------>
1238   - <view class="stitle" hidden="{{is_sec_mend==0}}" bindtap="hide_sec_mend">
1239   - <image class="tubiao" src="{{iurl}}/miniapp/images/icon-left.png"></image>{{sec_sto.name}}</view>
1240   - <view class="itemlists" hidden="{{is_sec_mend==0}}">
1241   - <view wx:for="{{sec_sto.s_arr}}" wx:key="{{index}}" class="item" bindtap="hidemend" data-p_id="{{item.pickup_id}}" data-p_name="{{item.pickup_name}}" data-p_dis="{{item.distr_type}}">{{item.pickup_name}}
1242   - </view>
1243   - </view>
1244   - </view>
1245   - </view>
1246   - </view>
1247   - <view class="pt_qd">
1248   - <view bindtap="addCart_pt" class="spec-cart-btn spec-buy w100" data-action="buy">确定</view>
1249   - </view>
1250   - </view>
  1182 + <include src="buy_pt.wxml" />
1251 1183 </view>
  1184 +
1252 1185 <!----弹起来优惠信息------>
1253 1186 <view hidden="{{!openPromModal}}">
1254 1187 <view bindtap="closePromModal" class="cover-layer"></view>
... ... @@ -1490,13 +1423,15 @@
1490 1423  
1491 1424  
1492 1425 <view wx:if="{{showPoster}}" class="poster-container">
1493   - <view class="poster" bindtap="previewImage">
1494   - <image src="{{shareImgPath}}" class="poster-img"></image>
1495   - <view class="btn-close" catchtap="closePoster">x</view>
1496   - </view>
1497   - <view class="btn-container">
1498   - <button class="btn-share" open-type="share" bindtap="">微信好友分享</button>
1499   - <button class="btn-share" bindtap="savePic">保存到相册</button>
  1426 + <view class="poster-wrapper">
  1427 + <view class="poster" bindtap="previewImage">
  1428 + <image src="{{shareImgPath}}" class="poster-img"></image>
  1429 + <view class="btn-close" catchtap="closePoster">x</view>
  1430 + </view>
  1431 + <view class="btn-container">
  1432 + <button class="btn-share" open-type="share" bindtap="">微信好友分享</button>
  1433 + <button class="btn-share" bindtap="savePic">保存到相册</button>
  1434 + </view>
1500 1435 </view>
1501 1436 </view>
1502 1437  
... ...
pages/goods/goodsInfo/goodsInfo.wxss
... ... @@ -422,6 +422,13 @@ border-radius: 0 56rpx 55rpx 0;
422 422  
423 423 }
424 424  
  425 +.buy-btn-all{
  426 + background-color: #f23030;
  427 + height: 70rpx;
  428 + border-radius: 56rpx;
  429 +}
  430 +
  431 +
425 432 .toTop {
426 433 position: fixed;
427 434 z-index: 3;
... ... @@ -659,7 +666,6 @@ border-radius: 0 56rpx 55rpx 0;
659 666 position: fixed;
660 667 bottom: 50rpx;
661 668 left: 4%;
662   -
663 669 }
664 670  
665 671 .spec-cart-btn {
... ... @@ -671,6 +677,10 @@ left: 4%;
671 677 border-radius: 40rpx;
672 678 }
673 679  
  680 +.spec-cart-btn.w40 {
  681 + width: 46%;
  682 +}
  683 +
674 684 .spec-add-cart {
675 685 background-color: #ffb03f;
676 686 }
... ... @@ -2640,13 +2650,19 @@ button.custom-service::after{
2640 2650 height: 100%;
2641 2651 z-index: 999;
2642 2652 background-color: rgba(0,0,0,.4);
2643   - padding: 60rpx;
  2653 + padding: 0 60rpx;
  2654 + display: flex;
  2655 + /* flex-wrap: wrap; */
  2656 + align-items: center;
  2657 +}
  2658 +.poster-wrapper {
  2659 + width: 100%;
2644 2660 }
2645 2661  
2646 2662 .poster {
2647 2663 box-sizing: border-box;
2648 2664 width: 100%;
2649   - height: 90%;
  2665 + height: 1055rpx;
2650 2666 border-radius: 20rpx;
2651 2667 /* box-shadow: 0 8px 12px #666; */
2652 2668 position: relative;
... ... @@ -2682,4 +2698,9 @@ button.custom-service::after{
2682 2698 position: absolute;
2683 2699 right: 20rpx;
2684 2700 top: 10rpx;
2685   -}
2686 2701 \ No newline at end of file
  2702 +}
  2703 +
  2704 +.goods-price .rel_txt{
  2705 + position: relative; top: 32rpx; font-size: 30rpx;
  2706 +}
  2707 +.goods-price .rel_img{width: 62rpx; height: 62rpx;position: relative; top: 12rpx;}
2687 2708 \ No newline at end of file
... ...
pages/goods/goodsList/goodsList.js
... ... @@ -16,8 +16,8 @@ Page({
16 16 openFilterModal: !1,
17 17 baseUrl: "/api/weshop/goods/page?1=1",
18 18 requestUrl: "",
19   - tabname:"goods_id", //排序的字段
20   - adname:"desc", //升降的字段
  19 + tabname:"sort", //排序的字段
  20 + adname:"asc", //升降的字段
21 21 is_new:0,
22 22 is_hot:0,
23 23 prom_goods_list:null,
... ... @@ -257,7 +257,7 @@ Page({
257 257 var card_name_map=new Map();
258 258 var user = getApp().globalData.userInfo;
259 259 for (var i = 0; i < plusCard.length; i++) {
260   - if ((user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
  260 + if ((!user || user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
261 261 continue;
262 262 }
263 263 var name="card"+plusCard[i].CorrPrice.toLowerCase();
... ...
pages/goods/goodsList/goodsList.wxml
... ... @@ -52,9 +52,14 @@
52 52 <view class="item-cont">
53 53 <view class="title">{{item.goods_name}}</view>
54 54 <!-- 判断是否有活动价 -->
55   - <block wx:if="{{item.prom_price>0 && item.prom_type!=2 && item.prom_type!=4}}">
  55 + <block wx:if="{{(item.prom_price>0 || item.prom_integral>0) && item.prom_type!=2}}">
56 56 <!-- 活动价 -->
57   - <view class="price">¥{{item.prom_price}}</view>
  57 + <view class="price">
  58 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  59 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  60 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  61 + </view>
  62 +
58 63 <view class="comment flex jc_sb">
59 64 <view class="word-line xc-ash">¥{{item.market_price}}</view>
60 65 <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view>
... ...
pages/goods/search/search.js
... ... @@ -19,8 +19,8 @@ Page({
19 19 //hotWords: [ [ "手机", "小米", "iphone" ], [ "三星", "华为", "冰箱" ] ]
20 20 hotWords: null,
21 21  
22   - tabname: "goods_id", //排序的字段
23   - adname: "desc", //升降的字段
  22 + tabname: "sort", //排序的字段
  23 + adname: "asc", //升降的字段
24 24 rq_data:null,
25 25 },
26 26 onLoad: function(t) {
... ... @@ -240,7 +240,7 @@ Page({
240 240 var user = getApp().globalData.userInfo;
241 241  
242 242 for (var i = 0; i < plusCard.length; i++) {
243   - if ((user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
  243 + if ((!user || user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
244 244 continue;
245 245 }
246 246 var name="card"+plusCard[i].CorrPrice.toLowerCase();
... ...
pages/goods/search/search.wxml
... ... @@ -35,9 +35,13 @@
35 35 <view class="item-cont">
36 36 <view class="title ellipsis-2">{{item.goods_name}}</view>
37 37 <!-- 判断是否有活动价,小程序没有有团购和拼单 -->
38   - <block wx:if="{{item.prom_price>0 && item.prom_type!=2 && item.prom_type!=4}}">
  38 + <block wx:if="{{(item.prom_price>0 || item.prom_integral) && item.prom_type!=2}}">
39 39 <!-- 活动价 -->
40   - <view class="price">¥{{item.prom_price}}</view>
  40 + <view class="price">
  41 + <text wx:if="{{item.prom_integral}}">{{item.prom_integral}}积分</text>
  42 + <text wx:if="{{item.prom_integral && item.prom_price}}">+</text>
  43 + <text wx:if="{{item.prom_price}}">¥{{item.prom_price}}</text>
  44 + </view>
41 45 <view class="comment flex jc_sb">
42 46 <view class="word-line xc-ash">¥{{item.market_price}}</view>
43 47 <view>评论{{item.comment_count}} 已售{{item.sales_sum}}</view>
... ...
pages/index/index/index.wxml
... ... @@ -44,36 +44,57 @@
44 44 </view>
45 45 </view>
46 46 <view class="pd-view" wx:else></view>
  47 +
  48 + <view class="flex-center-around {{banner==null?'mar-top':'mar-tops'}}">
  49 + <view class="flex-vertical">
  50 + <image class="xc-hook" src="{{url}}/miniapp/images/index/youxuan.png">
  51 + </image>
  52 + <text bindtap='go_test' class="yellow-co fs26 margin-left" data-url="../../../packageA/pages/prom_list/prom_list">人工优先</text>
  53 + </view>
  54 +
  55 +
  56 + <view class="flex-vertical">
  57 + <image class="xc-hook" src="{{url}}/miniapp/images/index/zhengpin.png">
  58 + </image>
  59 + <text class="yellow-co fs26 margin-left">正品保证</text>
  60 + </view>
  61 +
  62 + <view class="flex-vertical">
  63 + <image class="xc-hook" src="{{url}}/miniapp/images/index/shouhou.png">
  64 + </image>
  65 + <text class="yellow-co fs26 margin-left">售后无忧</text>
  66 + </view>
  67 + </view>
47 68  
48 69 <!---导航-->
49   - <view class="venues_box" hidden='true'>
  70 + <view class="venues_box">
50 71 <view class="venues_list">
51   - <view class="venues_item">
  72 + <!-- <view class="venues_item">
52 73 <navigator url="/pages/activity/group_list/group_list">
53 74 <image src="{{url}}/miniapp/images/index/tuangou.png"></image>
54 75 <view>团购</view>
55 76 </navigator>
56   - </view>
  77 + </view> -->
57 78 <view class="venues_item">
58   - <navigator url="/pages/goods/integralMall/integralMall">
  79 + <navigator url="/packageA/pages/jfbuy/jfbuy">
59 80 <image src="{{url}}/miniapp/images/index/jifen.png"></image>
60 81 <view>积分购</view>
61 82 </navigator>
62 83 </view>
63 84 <view class="venues_item">
64   - <navigator url="/pages/goods/brandstreet/brandstreet">
  85 + <navigator url="/packageA/pages/quan_list/quan_list">
65 86 <image src="{{url}}/miniapp/images/index/youhui.png"></image>
66 87 <view>优惠券</view>
67 88 </navigator>
68 89 </view>
69 90 <view class="venues_item">
70   - <navigator url="/pages/activity/coupon_list/coupon_list">
  91 + <navigator url="/packageA/pages/checkin/checkin">
71 92 <image src="{{url}}/miniapp/images/index/qiandao.png"></image>
72 93 <view>签到</view>
73 94 </navigator>
74 95 </view>
75 96 <view class="venues_item">
76   - <navigator url="/pages/goods/categoryList/categoryList">
  97 + <navigator bindtap="go_url" data-url="/pages/goods/categoryList/categoryList">
77 98 <image src="{{url}}/miniapp/images/index/fenlei.png"></image>
78 99 <view>全部分类</view>
79 100 </navigator>
... ... @@ -82,26 +103,7 @@
82 103 </view>
83 104  
84 105  
85   - <view class="flex-center-around {{banner==null?'mar-top':'mar-tops'}}">
86   - <view class="flex-vertical">
87   - <image class="xc-hook" src="{{url}}/miniapp/images/index/youxuan.png">
88   - </image>
89   - <text bindtap='go_test' class="yellow-co fs26 margin-left" data-url="../../../packageA/pages/prom_list/prom_list">人工优先</text>
90   - </view>
91   -
92   -
93   - <view class="flex-vertical">
94   - <image class="xc-hook" src="{{url}}/miniapp/images/index/zhengpin.png">
95   - </image>
96   - <text class="yellow-co fs26 margin-left">正品保证</text>
97   - </view>
98   -
99   - <view class="flex-vertical">
100   - <image class="xc-hook" src="{{url}}/miniapp/images/index/shouhou.png">
101   - </image>
102   - <text class="yellow-co fs26 margin-left">售后无忧</text>
103   - </view>
104   - </view>
  106 +
105 107  
106 108 <!---大分类--->
107 109 <view class="flex-center-around">
... ...
pages/index/index/index.wxss
... ... @@ -90,7 +90,12 @@
90 90  
91 91 .venues_box {
92 92 background-color: #fff;
93   - padding: 20rpx 10rpx;
  93 + padding: 20rpx 10rpx 0;
  94 +}
  95 +
  96 +.venues_list {
  97 + display: flex;
  98 + justify-content: space-around;
94 99 }
95 100  
96 101 .venues_item {
... ... @@ -450,7 +455,7 @@
450 455  
451 456 .xc-class-frame {
452 457 line-height: 40rpx;
453   - margin-top: 40rpx;
  458 + margin-top: 20rpx;
454 459 margin-bottom: 20rpx;
455 460 }
456 461  
... ...
pages/user/coupons/coupons.wxml
... ... @@ -55,7 +55,7 @@
55 55 </view>
56 56 <view class="moneys">{{filter.getNum(detail.Sum)}}元微券</view>
57 57 <view class="car-rim">
58   - <view class="coupon_from">微券来源: {{detail.Operator==null?'微信商城':detail.Operator==''?"微信商城":detail.Operator}}</view>
  58 + <view class="coupon_from">微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view>
59 59 <view wx:if="{{detail.ValidDate!=null&&detail.BeginDate!=null}}">
60 60 <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 -->
61 61 <view class="text">有效期: {{(detail.BeginDate==null || detail.BeginDate=='')?"":time.replace_time2(detail.BeginDate)}}至{{time.replace_time2(detail.ValidDate)}}</view>
... ...
pages/user/coupons/query/index.wxml
... ... @@ -92,7 +92,7 @@
92 92 <view class="moneys">{{filter.getNum(detail.Sum)}}元微券</view>
93 93 <view class="car-rim">
94 94 <view class="text">
95   - 微券来源: {{detail.Operator==null?'微信商城':detail.Operator}}</view>
  95 + 微券来源: {{detail.SendMan==null?'线下发放':detail.SendMan==''?"线下发放":detail.SendMan}}</view>
96 96 <view wx:if="{{detail.ValidDate!=null}}">
97 97 <!-- 不指定格式则默认输出:yyyy-MM-dd hh:mm:ss 格式 -->
98 98 <view class="text">有效期:
... ...
pages/user/deposit/prepaid/prepaid.js
... ... @@ -14,6 +14,21 @@ Page({
14 14 },
15 15 /* 生命周期函数--监听页面初次渲染完成*/
16 16 onReady: function() {
  17 + var th=this;
  18 +
  19 + getApp().request.get("/api/wx/weappSendlist/page", {
  20 + data: {
  21 + store_id: os.stoid,
  22 + typeid: "1002"
  23 + },
  24 + success: function(res) {
  25 + if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  26 + var template_id = res.data.data.pageData[0].template_id;
  27 + th.setData({template_id:template_id});
  28 + }
  29 + }
  30 + });
  31 +
17 32 this.yuck();
18 33 },
19 34 /*预存款的劵*/
... ... @@ -44,6 +59,10 @@ Page({
44 59 var money = e.target.dataset.name;
45 60 var s = e.target.dataset.money;
46 61 var advancek = e.target.dataset.advance;
  62 +
  63 + var item_type=e.target.dataset.item_type;
  64 + this.data.item_type=item_type;
  65 +
47 66 console.log("sss", e.target.dataset.name);
48 67 this.setData({
49 68 showModal: true
... ... @@ -69,6 +88,7 @@ Page({
69 88 },
70 89 //确定充值
71 90 determine: function(e) {
  91 + var th=this;
72 92 this.setData({
73 93 showModal: false
74 94 })
... ... @@ -76,8 +96,11 @@ Page({
76 96 var moneyone = e.target.dataset.moneyone;
77 97 var money = e.target.dataset.money;
78 98 var advancek = e.target.dataset.adv;
79   - console.log(moneyone, "aaa", money);
80   - this.recharge(money, advancek);
  99 +
  100 + this.sendsm(function(){
  101 + th.recharge(money, advancek);
  102 + })
  103 +
81 104 },
82 105 //确定接口
83 106 async recharge(money, advancek) {
... ... @@ -85,6 +108,8 @@ Page({
85 108 var user_id = getApp().globalData.user_id;
86 109 var store_id = os.stoid;
87 110 var recharge_type = 0;
  111 + if(this.data.item_type==2) recharge_type=6;
  112 +
88 113 var buynum = 1;
89 114 console.log(money, "有进来吗预存劵", advancek, user_id, store_id );
90 115 var e = this,
... ... @@ -160,5 +185,28 @@ Page({
160 185 })
161 186 console.log("bb");
162 187  
163   - }
  188 + },
  189 +
  190 + go_detail:function(e){
  191 + var id=e.currentTarget.dataset.id;
  192 + getApp().goto('/packageA/pages/chongzhiDetails/chongzhiDetails?id=' + id);
  193 + },
  194 +
  195 +
  196 + //订阅消息提醒
  197 + sendsm:function(func)
  198 + {
  199 + var template_id = this.data.template_id;
  200 + // //授权订阅
  201 + wx.requestSubscribeMessage({
  202 + tmplIds: [template_id],
  203 + success(res) {
  204 + func();
  205 + },
  206 + fail(res) {
  207 + func();
  208 + }
  209 + })
  210 +
  211 + },
164 212 })
... ...
pages/user/deposit/prepaid/prepaid.wxml
1 1 <block wx:for="{{perpaid}}" wx:for-index="idx" wx:for-item="perpaid">
2   - <image class="picture" src="{{iurl}}/miniapp/images/usermoney/green.png">
  2 + <view class="coupon-container">
  3 + <image wx:if="{{idx % 4 == 0}}" class="picture" src="{{iurl+'miniapp/images/usermoney/green.png'}}"></image>
  4 + <image wx:if="{{idx % 4 == 1}}" class="picture" src="{{iurl+'miniapp/images/usermoney/red.png'}}"></image>
  5 + <image wx:if="{{idx % 4 == 2}}" class="picture" src="{{iurl+'miniapp/images/usermoney/yellow.png'}}"></image>
  6 + <image wx:if="{{idx % 4 == 3}}" class="picture" src="{{iurl+'miniapp/images/usermoney/blue.png'}}"></image>
  7 + <view class="info-container flex">
  8 + <view class="left" catchtap="go_detail" data-id="{{perpaid.Id}}">
  9 + <view>{{perpaid.ItemName}}</view>
  10 + <view class="pdv20">充{{perpaid.BeginSum}}
  11 + <text wx:if="{{perpaid.NewSum>0}}">送{{perpaid.NewSum}}元</text>
  12 + </view>
  13 + <view wx:if="{{perpaid.ItemType==2}}">充值送大礼 ></view>
  14 + </view>
  15 + <view class="right">备注:
  16 + <view class="">{{perpaid.ItemName}}</view>
  17 + <view class="ljcz" bindtap="submit" data-name="{{perpaid.BeginSum}}" data-item_type="{{perpaid.ItemType}}"
  18 + data-advance="{{perpaid.Id}}" data-money="{{perpaid.NewSum}}">立即充值</view>
  19 + </view>
  20 + </view>
  21 +
  22 + <!-- <view class="rim"> -->
  23 + <!-- <view class="con">充{{perpaid.BeginSum}}<text>送{{perpaid.NewSum}}元</text></view> -->
  24 + <!-- <view class="qian">{{perpaid.BeginSum}}</view>
  25 + <view class="q-one" wx:if="{{perpaid.ItemType==1}}">送{{perpaid.NewSum}}元</view> -->
  26 + <!-- <view class="give" wx:if="{{perpaid.ItemType==2}}">充值送大礼 ></view> -->
  27 + <!-- </view> -->
  28 + <!-- <view class="bz">备注:
  29 + <view class="yck">{{perpaid.ItemName}}</view>
  30 + </view> -->
  31 + <!-- <view wx:if="{{perpaid.ItemType==1}}" class="ljcz" bindtap="submit" data-name="{{perpaid.BeginSum}}"
  32 + data-advance="{{perpaid.AdvanceItemId}}"data-money="{{perpaid.NewSum}}">立即充值</view>
  33 +
  34 + <view wx:if="{{perpaid.ItemType==2}}" class="ljcz" bindtap="go_detail" data-advance="{{perpaid.AdvanceItemId}}">立即充值</view> -->
  35 + </view>
3 36  
4   - <view class="wz">{{perpaid.ItemName}}</view>
5   - <view class="rim">
6   - <view class="con">充</view>
7   - <view class="qian">{{perpaid.BeginSum}}</view>
8   - <view class="q-one">送{{perpaid.NewSum}}元</view>
9   - </view>
10   - <view class="bz">备注:
11   - <view class="yck">{{perpaid.ItemName}}</view>
12   - </view>
13   - <view class="ljcz" bindtap="submit" data-name="{{perpaid.BeginSum}}" data-advance="{{perpaid.AdvanceItemId}}"data-money="{{perpaid.NewSum}}">立即充值</view>
14   - </image>
15   - </block>
  37 +
  38 +</block>
16 39  
17 40 <view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
18 41 <view class="big-rim modalDlg" wx:if="{{showModal}}">
19 42 <view class="gb-rim" bindtap="shut">
20 43 <image class="imag" src="{{iurl}}/miniapp/images/usermoney/img.png"></image>
21   -
22 44 </view>
23 45 <view class="bk">
24 46 <view class="text">充{{BeginSum}}送{{NewSum}}元</view>
... ... @@ -29,3 +51,24 @@
29 51 <button bindtap="determine" class="button" data-adv="{{adv}}" data-money='{{BeginSum}}' data-moneyone='{{NewSum}}' >确定</button>
30 52 </view>
31 53 </view>
  54 +
  55 +
  56 +<!-- <view> -->
  57 + <!-- 列表 -->
  58 + <!-- <view class="list"> -->
  59 + <!-- 列表项 -->
  60 + <!-- <view class="coupon"> -->
  61 + <!-- 左 -->
  62 + <!-- <view class="left">
  63 + <view>预存5折</view>
  64 + <view>充1000元</view>
  65 + <view>充值送大礼</view>
  66 + </view> -->
  67 + <!-- 右 -->
  68 + <!-- <view class="right">
  69 + <view>备注:</view>
  70 + <view>立即充值</view>
  71 + </view>
  72 + </view>
  73 + </view>
  74 +</view> -->
... ...
pages/user/deposit/prepaid/prepaid.wxss
1 1 /* 图片 */
2 2 .picture{
3   -margin-top: 5rpx;
  3 +/* margin-top: 5rpx; */
4 4 width:100%;
5 5 height:270rpx;
  6 +display: block;
6 7 }
7 8 /* 预存款扣款情况 */
8 9 .wz{
... ... @@ -61,14 +62,15 @@ font-size:28rpx;
61 62 }
62 63 /* 立即充值 */
63 64 .ljcz{
64   - width: 2278rpx;
  65 + /* width: 2278rpx;
65 66 height: 111rpx;
66 67 font-size: 25rpx;
67 68 line-height: 320%;
68 69 color: #C4182E;
69 70 margin-left: 463rpx;
70   - padding-left:66rpx;
71   -
  71 + padding-left:66rpx; */
  72 + padding-top: 20rpx;
  73 + color: red;
72 74 }
73 75 /* 弹出框的大边框 */
74 76 .big-rim{
... ... @@ -180,6 +182,77 @@ font-size:28rpx;
180 182 left:0;
181 183 }
182 184  
  185 +.give {
  186 + position: absolute;
  187 + margin-top: 70rpx;
  188 + margin-left: 60rpx;
  189 +}
  190 +
  191 +.list {
  192 + padding: 0 20rpx;
  193 +}
  194 +
  195 +.coupon {
  196 + box-sizing: border-box;
  197 + display: flex;
  198 + justify-content: space-between;
  199 + background-color: pink;
  200 + padding: 0 40rpx;
  201 +
  202 +
  203 + background-image: radial-gradient(circle at 8rpx 8rpx, transparent, red);
  204 + /* background-image:
  205 + radial-gradient(
  206 + circle at 0px 8px,
  207 + transparent 6px,
  208 + #ff9e6d 6px,
  209 + #ff9e6d 0px),
  210 + radial-gradient(
  211 + circle at 199px 8px,
  212 + transparent 6px,
  213 + #ff9e6d 6px,
  214 + #ff9e6d 0px); */
  215 + background-size: 30px 30px;
  216 + /* background-position: 0 0, 200px 0; */
  217 + /* background-repeat-y: no-repeat; */
  218 + background-repeat-x: no-repeat;
  219 +}
  220 +
  221 +.left {
  222 + width: 464rpx;
  223 + display: flex;
  224 + flex-direction: column;
  225 + justify-content: center;
  226 + color: white;
  227 +}
  228 +
  229 +.right {
  230 + width: calc(100% - 464rpx);
  231 + display: flex;
  232 + flex-direction: column;
  233 + justify-content: center;
  234 +}
  235 +
  236 +.coupon-container {
  237 + position: relative;
  238 + margin-bottom: 10rpx;
  239 + text-align: center;
  240 +}
  241 +
  242 +.info-container {
  243 + position: absolute;
  244 + top: 0;
  245 + left: 0;
  246 + width: 100%;
  247 + height: 100%;
  248 +
  249 +}
  250 +
  251 +.pdv20 {
  252 + padding-top: 20rpx;
  253 + padding-bottom: 20rpx;
  254 +}
  255 +
183 256  
184 257  
185 258  
... ...
pages/user/index/index.js
... ... @@ -187,6 +187,10 @@ Page({
187 187 }
188 188 })
189 189  
  190 +
  191 +
  192 +
  193 +
190 194 /*-----获取会员权益列表-----*/
191 195 rq.get("/api/weshop/users/grade/vipprivilegeinfo/page", {
192 196 data: {
... ... @@ -426,7 +430,9 @@ Page({
426 430 },
427 431 //--跳转到优惠券--
428 432 coupon: function() {
  433 + var th = this;
429 434 if (!this.data.userInfo) return false;
  435 + // th.sendsm();
430 436 wx.navigateTo({
431 437 url: '../coupons/coupons',
432 438 })
... ... @@ -673,7 +679,7 @@ Page({
673 679 }
674 680 })
675 681 },
676   -
  682 +
677 683 //导航跳转
678 684 nav_goto:function(e){
679 685 var url=e.currentTarget.dataset.url;
... ... @@ -711,6 +717,34 @@ Page({
711 717 success: function (res) {},
712 718 cancel: function (res) {}
713 719 });
714   - }
  720 + },
  721 +
  722 + //订阅消息提醒
  723 + sendsm:function()
  724 + {
  725 + var template_id = "";
  726 + rq.get("/api/wx/weappSendlist/page", {
  727 + data: {
  728 + store_id: os.stoid,
  729 + typeid: "1020"
  730 + },
  731 + success: function(res) {
  732 + if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  733 + template_id = res.data.data.pageData[0].template_id;
  734 + // //授权订阅
  735 + wx.requestSubscribeMessage({
  736 + tmplIds: [template_id],
  737 + success(res) {
  738 +
  739 + },
  740 + fail(res) {
  741 +
  742 + }
  743 + })
  744 + }
  745 + }
  746 + })
  747 + },
  748 +
715 749  
716 750 })
... ...
pages/user/integral/integral.js
... ... @@ -192,6 +192,21 @@ Page({
192 192 * 生命周期函数--监听页面加载
193 193 */
194 194 onLoad: function (options) {
  195 +
  196 + var th=this;
  197 + getApp().request.get("/api/wx/weappSendlist/page", {
  198 + data: {
  199 + store_id: os.stoid,
  200 + typeid: "1002"
  201 + },
  202 + success: function(res) {
  203 + if (res.data.code == 0 && res.data.data.pageData.length > 0) {
  204 + var template_id = res.data.data.pageData[0].template_id;
  205 + th.setData({template_id:template_id});
  206 + }
  207 + }
  208 + });
  209 +
195 210 var th=this;
196 211 getApp().getConfig2(function(ee){
197 212 var json_d = JSON.parse(ee.switch_list);
... ... @@ -207,7 +222,7 @@ Page({
207 222 },
208 223  
209 224 //点击确定
210   - async determine(event) {
  225 + determine(event) {
211 226 console.log(event.currentTarget.dataset.money);
212 227 var money = event.currentTarget.dataset.money;
213 228 var integral = event.currentTarget.dataset.integral;
... ... @@ -216,32 +231,38 @@ Page({
216 231 var user_id = getApp().globalData.user_id;
217 232 var store_id = os.stoid;
218 233 var th= this, number;
219   - await getApp().request.promiseGet("/api/weshop/users/getPay"
220   - , {
221   - data: { user_id: user_id, store_id: store_id, buynum: val, mon: money, integ: integral, recharge_type:1}
222   - }).then(res => {
223   - // console.log("1" + res);
224   - var msg = res.data.data;
225   - var parentSn = msg.order_sn;
226   - var store_id = os.stoid;
227   -
228   - getApp().request.post("/api/weshop/order/pay/createRechargeOrder", {
229   - data: {
230   - parentSn: parentSn,
231   - store_id: store_id
232   - },
233   - success: function (su) {
234   - var n = su.data.data;
235   - th.weixinPay(n,
236   - function () {
237   - console.log("支付成功页面2333");
238   - th.jumpPaymentPage();
239   - }, function () {
240   - getApp().showWarning("支付失败");
241   - })
242   - }
243   - })
244   - })
  234 +
  235 + this.sendsm(function(){
  236 + getApp().request.promiseGet("/api/weshop/users/getPay"
  237 + , {
  238 + data: { user_id: user_id, store_id: store_id, buynum: val, mon: money, integ: integral, recharge_type:1}
  239 + }).then(res => {
  240 + // console.log("1" + res);
  241 + var msg = res.data.data;
  242 + var parentSn = msg.order_sn;
  243 + var store_id = os.stoid;
  244 +
  245 + getApp().request.post("/api/weshop/order/pay/createRechargeOrder", {
  246 + data: {
  247 + parentSn: parentSn,
  248 + store_id: store_id
  249 + },
  250 + success: function (su) {
  251 + var n = su.data.data;
  252 + th.weixinPay(n,
  253 + function () {
  254 + console.log("支付成功页面2333");
  255 + th.jumpPaymentPage();
  256 + }, function () {
  257 + getApp().showWarning("支付失败");
  258 + })
  259 + }
  260 + })
  261 + })
  262 + })
  263 +
  264 +
  265 +
245 266 },
246 267 //------支付成功页面--------
247 268 jumpPaymentPage: function () {
... ... @@ -299,12 +320,6 @@ Page({
299 320  
300 321 },
301 322  
302   - /**
303   - * 生命周期函数--监听页面卸载
304   - */
305   - onUnload: function () {
306   -
307   - },
308 323  
309 324 /**
310 325 * 页面相关事件处理函数--监听用户下拉动作
... ... @@ -319,5 +334,22 @@ Page({
319 334 */
320 335 onShareAppMessage: function () {
321 336  
322   - }
  337 + },
  338 +
  339 + //订阅消息提醒
  340 + sendsm:function(func)
  341 + {
  342 + var template_id = this.data.template_id;
  343 + // //授权订阅
  344 + wx.requestSubscribeMessage({
  345 + tmplIds: [template_id],
  346 + success(res) {
  347 + func();
  348 + },
  349 + fail(res) {
  350 + func();
  351 + }
  352 + })
  353 +
  354 + },
323 355 })
324 356 \ No newline at end of file
... ...
pages/user/order_detail/order_detail.js
... ... @@ -18,7 +18,23 @@ Page({
18 18 var r = void 0 !== e.isGoup && e.isGoup;
19 19  
20 20 getApp().getConfig2(function (e) {
21   - th.setData({conf:e});
  21 + th.setData({conf: e,sales_rules:e.sales_rules });
  22 + //--- 看后台是不是有开通等级卡 ---
  23 + if(e.switch_list){
  24 + var s_list=JSON.parse(e.switch_list);
  25 + var user=getApp().globalData.userInfo;
  26 + //如果后台有开启等级价的功能
  27 + if(parseInt(s_list.rank_switch)==2 && user['card_expiredate']){
  28 + var str = user['card_expiredate'].replace(/-/g, '/');
  29 + var end = new Date(str);
  30 + end = Date.parse(end) / 1000;
  31 + var now = ut.gettimestamp();
  32 + //--- 判断是等级会员,且在有效期范围内 ---
  33 + if(user.card_field && now<end){
  34 + th.setData({card_field:user.card_field})
  35 + }
  36 + }
  37 + }
22 38 })
23 39  
24 40 this.setData({
... ... @@ -285,10 +301,11 @@ Page({
285 301 var order=this.data.order;
286 302 var order_goods=order.order_goods;
287 303  
288   - for(var i in order_goods){
  304 +
  305 + for(var i in order_goods){
289 306 var good=order_goods[i];
290 307 //如果不是小程序有的功能,直接提示要去3.0处理
291   - if(good.prom_type==2 || good.prom_type==4){
  308 + if(good.prom_type==2 ){
292 309 wx.showModal({
293 310 title: '提示',
294 311 content: '小程序还未有该活动,请到3.0公众号支付'
... ... @@ -329,8 +346,9 @@ Page({
329 346 });
330 347 return false;
331 348 }
332   -
333   - if((good.prom_type==1 || good.prom_type==6 || good.prom_type==5 ) && !good.is_gift && !good.is_collocation){
  349 +
  350 + //商品的普通购买 ,不要进行判断
  351 + if((good.prom_type==1 || good.prom_type==6 || good.prom_type==5 || good.prom_type==4) && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){
334 352 if(gg.prom_type!=good.prom_type) {
335 353 wx.showModal({
336 354 title: '提示',
... ... @@ -338,36 +356,35 @@ Page({
338 356 });
339 357 return false;
340 358 }
341   - if(good.prom_type==3 || good.prom_type==5){
342   - await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => {
343   - }).then(res=>{
344   - if(res.data.code==0){
345   - var r_data=res.data.data;
346   - if(!r_data.collocationPromList && good.prom_type==5){
347   - wx.showModal({
348   - title: '提示',
349   - content: good.goods_name+'未找到活动'
350   - });
351   - }
352   - if(!r_data.promGoodsLists && good.prom_type==3){
353   - wx.showModal({
354   - title: '提示',
355   - content: good.goods_name+'未找到活动'
356   - });
357   - }
358   - }else{
359   - wx.showModal({
360   - title: '提示',
361   - content: good.goods_name+'未找到活动'
362   - });
363   - return false;
364   - }
365   - })
366   - }
367   -
  359 + if(good.prom_type==3 || good.prom_type==5){
  360 + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromList/" + os.stoid+"/"+good.goods_id+"/0", {}).then(res => {
  361 + }).then(res=>{
  362 + if(res.data.code==0){
  363 + var r_data=res.data.data;
  364 + if(!r_data.collocationPromList && good.prom_type==5){
  365 + wx.showModal({
  366 + title: '提示',
  367 + content: good.goods_name+'未找到活动'
  368 + });
  369 + }
  370 + if(!r_data.promGoodsLists && good.prom_type==3){
  371 + wx.showModal({
  372 + title: '提示',
  373 + content: good.goods_name+'未找到活动'
  374 + });
  375 + }
  376 + }else{
  377 + wx.showModal({
  378 + title: '提示',
  379 + content: good.goods_name+'未找到活动'
  380 + });
  381 + return false;
  382 + }
  383 + })
  384 + }
  385 +
368 386 }else{
369   -
370   - if(gg.prom_type==1 || gg.prom_type==6){
  387 + if((gg.prom_type==1 || gg.prom_type==6 || gg.prom_type==4) && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
371 388 var prom=null;
372 389 //---如果是活动的时候---
373 390 var prom=null,th=this;
... ... @@ -387,7 +404,17 @@ Page({
387 404 }
388 405 })
389 406 }
390   -
  407 +
  408 + if(gg.prom_type==4){
  409 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{
  410 + data:{store_id:os.stoid,goods_id:gg.goods_id}
  411 + }).then(res=>{
  412 + if(res.data.code==0 && res.data.data && res.data.data.pageData){
  413 + prom=res.data.data.pageData[0];
  414 + }
  415 + })
  416 + }
  417 +
391 418 if(prom){
392 419 var t_now=ut.gettimestamp();
393 420 if(prom.is_end==0 && prom.start_time<t_now && prom.end_time>t_now){
... ... @@ -399,25 +426,26 @@ Page({
399 426 }
400 427 }
401 428 }
402   -
403   - if(!good.is_gift && !good.is_collocation) {
404   - var isok = 1;
405   - var card_field = th.data.card_field;
406   - //如果会员是等级会员,商品有等级价,且不是活动商品
407   - if (card_field && gg[card_field] > 0) {
408   - if (good.goods_price != gg[card_field]) isok = 0;
409   - } else {
410   - if (good.goods_price != gg.shop_price) isok = 0;
411   -
412   - }
413   - if (!isok) {
414   - wx.showModal({
415   - title: '提示',
416   - content: gg.goods_name + '商品的价格发生了变化'
417   - });
418   - return false;
419   - }
420   - }
  429 + //赠品和搭配购不判断商品金额
  430 + var isok=1;
  431 + var card_field=th.data.card_field;
  432 + //如果会员是等级会员,商品有等级价,且不是活动商品
  433 + if(!good.is_gift && !good.is_collocation) {
  434 + if (card_field && gg[card_field] > 0) {
  435 + if (good.goods_price != gg[card_field]) isok = 0;
  436 + } else {
  437 + if (good.goods_price != gg.shop_price) isok = 0;
  438 +
  439 + }
  440 + var is_h=0;
  441 + if (!isok) {
  442 + wx.showModal({
  443 + title: '提示',
  444 + content: gg.goods_name + '商品的价格发生了变化'
  445 + });
  446 + return false;
  447 + }
  448 + }
421 449  
422 450 //--如果是线下库存的时候--
423 451 if(th.data.conf.sales_rules==2){
... ... @@ -444,6 +472,8 @@ Page({
444 472  
445 473 }
446 474 }
  475 +
  476 + console.log("------------------------------------");
447 477  
448 478 var prom=null;
449 479 //---如果是活动的时候---
... ... @@ -456,14 +486,26 @@ Page({
456 486 }
457 487 })
458 488 }
459   - if(goodsinfo.prom_type==6){
  489 + if(goodsinfo.prom_type==6 && !good.is_pd_normal){
460 490 await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{
461 491 }).then(res=>{
462 492 if(res.data.code==0){
463 493 prom=res.data.data;
464 494 }
465 495 })
466   - }
  496 + }
  497 +
  498 + if(goodsinfo.prom_type==4 && !good.is_integral_normal){
  499 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{
  500 + data:{store_id:os.stoid,goods_id:goodsinfo.goods_id}
  501 + }).then(res=>{
  502 + if(res.data.code==0 && res.data.data && res.data.data.pageData){
  503 + prom=res.data.data.pageData[0];
  504 + }
  505 + })
  506 + }
  507 +
  508 +
467 509 //----------如果有活动,并且在进行中,就不计算线下库存---------------
468 510 if(prom){
469 511 var now=ut.gettimestamp();
... ... @@ -484,27 +526,39 @@ Page({
484 526 return false;
485 527 }
486 528  
487   - var redis_num = 0;
488   - //------判断活动是否抢光-----
489   - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
490   - os.stoid + "/" + goodsinfo.prom_type + "/" + goodsinfo.prom_id, {
491   - }).then(res => {
492   - redis_num = res.data.data;
493   - });
494   -
495   - if (good.goods_num > redis_num) {
496   - wx.showModal({
497   - title: gg.goods_name+'超出商品活动库存',
498   - });
499   - return false;
500   - }
501   - }
502   -
  529 + if(goodsinfo.prom_type==4){
  530 + if (good.goods_num > prom.limitqty-prom.buy_num) {
  531 + wx.showModal({
  532 + title: '提示',
  533 + content: goodsinfo.goods_name+'购买数量超出商品活动库存'
  534 + });
  535 + return false;
  536 + }
  537 + }else{
  538 + var redis_num = 0;
  539 + //------判断活动是否抢光-----
  540 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  541 + os.stoid + "/" + goodsinfo.prom_type + "/" + goodsinfo.prom_id, {
  542 + }).then(res => {
  543 + redis_num = res.data.data;
  544 + });
  545 +
  546 + if (good.goods_num > redis_num) {
  547 + wx.showModal({
  548 + title: gg.goods_name+'超出商品活动库存',
  549 + });
  550 + return false;
  551 + }
  552 + }
  553 + }
  554 +
503 555 }
504   -
  556 +
  557 +
505 558 o.jumpToCart4({
506 559 order_sn: this.data.order.order_sn,
507   - order_amount: this.data.order.order_amount
  560 + order_amount: this.data.order.order_amount,
  561 + type: 1 //正常单
508 562 }, 1);
509 563 },
510 564 checkTeam: function() {
... ...
pages/user/order_detail/order_detail.wxml
... ... @@ -106,9 +106,9 @@
106 106 <view> ¥ {{order.coupon_price}}元</view>
107 107 </view>
108 108  
109   - <view class="item pnew" wx:if="{{order.integral_money>0}}">
  109 + <view class="item pnew" wx:if="{{order.integral>0}}">
110 110 <view>积分</view>
111   - <view> ¥ {{order.integral_money}}元</view>
  111 + <view>{{order.integral}}积分</view>
112 112 </view>
113 113  
114 114 <view class="item pnew" wx:if="{{order.discount_amount>0}}">
... ...
pages/user/order_list/order_list.js
... ... @@ -56,6 +56,12 @@ Page({
56 56 currentPage2: 1,
57 57 currentDate: '',
58 58 total: 0, //读取时段内记录数量
  59 + is_no_data2: 0,
  60 + is_no_more2: 0,
  61 +
  62 +
  63 + // 搜索内容
  64 + searchContent: '',
59 65 },
60 66 onLoad: function(t) {
61 67 // 设置日期选择器的结束时间为当前日期
... ... @@ -98,7 +104,7 @@ Page({
98 104 this.resetData(), this.requestOrderList(t.currentTarget.id);
99 105 },
100 106 resetData: function() {
101   - s.resetConfig(), this.data.orderList = null, this.data.currentPage = 1;
  107 + s.resetConfig(),this.data.orderList = null, this.data.currentPage = 1;
102 108 },
103 109  
104 110  
... ... @@ -117,6 +123,9 @@ Page({
117 123 r += "&order_status=2"; break;
118 124 }
119 125 r+="&isdel=0";
  126 + if(this.data.searchContent) {
  127 + r+="&keyWord=" + this.data.searchContent;
  128 + }
120 129 this.setData({ activeCategoryId: t }); r = r + "&page=" + e.data.currentPage;
121 130 s.request(r, function (t) {
122 131  
... ... @@ -408,7 +417,7 @@ Page({
408 417 for(var i in order_goods){
409 418 var good=order_goods[i];
410 419 //如果不是小程序有的功能,直接提示要去3.0处理
411   - if(good.prom_type==2 || good.prom_type==4 ){
  420 + if(good.prom_type==2 ){
412 421 wx.showModal({
413 422 title: '提示',
414 423 content: '小程序还未有该活动,请到3.0公众号支付'
... ... @@ -450,7 +459,8 @@ Page({
450 459 return false;
451 460 }
452 461  
453   - if((good.prom_type==1 || good.prom_type==6 || good.prom_type==5 ) && !good.is_gift && !good.is_collocation){
  462 + //商品的普通购买 ,不要进行判断
  463 + if((good.prom_type==1 || good.prom_type==6 || good.prom_type==5 || good.prom_type==4) && !good.is_gift && !good.is_collocation && !good.is_integral_normal && !good.is_pd_normal){
454 464 if(gg.prom_type!=good.prom_type) {
455 465 wx.showModal({
456 466 title: '提示',
... ... @@ -486,7 +496,7 @@ Page({
486 496 }
487 497  
488 498 }else{
489   - if(gg.prom_type==1 || gg.prom_type==6){
  499 + if((gg.prom_type==1 || gg.prom_type==6 || gg.prom_type==4) && !good.is_gift && !good.is_integral_normal && !good.is_pd_normal) {
490 500 var prom=null;
491 501 //---如果是活动的时候---
492 502 var prom=null,th=this;
... ... @@ -506,7 +516,17 @@ Page({
506 516 }
507 517 })
508 518 }
509   -
  519 +
  520 + if(gg.prom_type==4){
  521 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{
  522 + data:{store_id:os.stoid,goods_id:gg.goods_id}
  523 + }).then(res=>{
  524 + if(res.data.code==0 && res.data.data && res.data.data.pageData){
  525 + prom=res.data.data.pageData[0];
  526 + }
  527 + })
  528 + }
  529 +
510 530 if(prom){
511 531 var t_now=ut.gettimestamp();
512 532 if(prom.is_end==0 && prom.start_time<t_now && prom.end_time>t_now){
... ... @@ -578,14 +598,26 @@ Page({
578 598 }
579 599 })
580 600 }
581   - if(goodsinfo.prom_type==6){
  601 + if(goodsinfo.prom_type==6 && !good.is_pd_normal){
582 602 await getApp().request.promiseGet("/api/weshop/teamlist/get/"+os.stoid+"/"+goodsinfo.prom_id,{
583 603 }).then(res=>{
584 604 if(res.data.code==0){
585 605 prom=res.data.data;
586 606 }
587 607 })
588   - }
  608 + }
  609 +
  610 + if(goodsinfo.prom_type==4 && !good.is_integral_normal){
  611 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList?stype=1&stypeup=1",{
  612 + data:{store_id:os.stoid,goods_id:goodsinfo.goods_id}
  613 + }).then(res=>{
  614 + if(res.data.code==0 && res.data.data && res.data.data.pageData){
  615 + prom=res.data.data.pageData[0];
  616 + }
  617 + })
  618 + }
  619 +
  620 +
589 621 //----------如果有活动,并且在进行中,就不计算线下库存---------------
590 622 if(prom){
591 623 var now=ut.gettimestamp();
... ... @@ -606,20 +638,32 @@ Page({
606 638 return false;
607 639 }
608 640  
609   - var redis_num = 0;
610   - //------判断活动是否抢光-----
611   - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
612   - os.stoid + "/" + goodsinfo.prom_type + "/" + goodsinfo.prom_id, {
613   - }).then(res => {
614   - redis_num = res.data.data;
615   - });
  641 + if(goodsinfo.prom_type==4){
  642 + if (good.goods_num > prom.limitqty-prom.buy_num) {
  643 + wx.showModal({
  644 + title: '提示',
  645 + content: goodsinfo.goods_name+'购买数量超出商品活动库存'
  646 + });
  647 + return false;
  648 + }
  649 + }else{
  650 + var redis_num = 0;
  651 + //------判断活动是否抢光-----
  652 + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" +
  653 + os.stoid + "/" + goodsinfo.prom_type + "/" + goodsinfo.prom_id, {
  654 + }).then(res => {
  655 + redis_num = res.data.data;
  656 + });
  657 +
  658 + if (good.goods_num > redis_num) {
  659 + wx.showModal({
  660 + title: gg.goods_name+'超出商品活动库存',
  661 + });
  662 + return false;
  663 + }
  664 + }
  665 +
616 666  
617   - if (good.goods_num > redis_num) {
618   - wx.showModal({
619   - title: gg.goods_name+'超出商品活动库存',
620   - });
621   - return false;
622   - }
623 667 }
624 668  
625 669  
... ... @@ -630,6 +674,9 @@ Page({
630 674  
631 675 pay_next(e){
632 676 var th=this;
  677 +
  678 +
  679 +
633 680 if (e.order_amount == 0) {
634 681 var dd = {
635 682 parent_sn: e.order_sn,
... ... @@ -1246,7 +1293,7 @@ Page({
1246 1293 },
1247 1294  
1248 1295 request_list: function(data, callback){
1249   - // console.log('触发上拉刷新');
  1296 + // console.log('进入request_list');
1250 1297  
1251 1298 var th = this;
1252 1299 if(this.data.is_load2) return false; //-- 正在加载
... ... @@ -1282,7 +1329,7 @@ Page({
1282 1329 th.setData({is_no_more2:1});
1283 1330 }
1284 1331 }
1285   - if(callback) callback();
  1332 + if(callback) callback(res);
1286 1333 } else {
1287 1334 wx.showToast({
1288 1335 title: res.data.msg,
... ... @@ -1307,6 +1354,10 @@ Page({
1307 1354 });
1308 1355 if(currentIndex == 0) {
1309 1356 console.log('线上订单');
  1357 + this.setData({
  1358 + startDate: '选择开始时间',
  1359 + endDate: '选择结束时间',
  1360 + });
1310 1361 } else if(currentIndex == 1) {
1311 1362 console.log('线下订单');
1312 1363  
... ... @@ -1331,40 +1382,73 @@ Page({
1331 1382 endDate: e.detail.value
1332 1383 })
1333 1384 },
  1385 +
  1386 + bindInput(e) {
  1387 + this.data.searchContent = e.detail.value;
  1388 + },
  1389 +
  1390 + searchOnline() {
  1391 + console.log('online',this.data.searchContent);
  1392 + if(this.data.searchContent) {
  1393 + console.log(this.data.searchContent);
  1394 + this.resetData(), this.requestOrderList(this.data.activeCategoryId);
  1395 + } else {
  1396 + wx.showToast({
  1397 + title: '您还没有输入搜索内容~',
  1398 + icon: 'none',
  1399 + })
  1400 + };
  1401 + },
1334 1402  
1335   - search() {
  1403 + searchOffline() {
  1404 + console.log('执行查询');
1336 1405 let th = this;
1337 1406 let startDate = this.data.startDate;
1338 1407 let endDate = this.data.endDate;
1339   -
  1408 +
  1409 + // this.data.is_no_data2 = 0;
  1410 + this.setData({
  1411 + currentPage2: 1,
  1412 + list2: [],
  1413 + is_no_data2: 0,
  1414 + });
  1415 +
  1416 +
1340 1417 if(startDate == '选择开始时间' || endDate == '选择结束时间') {
1341 1418 wx.showToast({
1342 1419 title: '请选择完整的查询时间~',
1343 1420 icon: 'none',
1344 1421 })
1345   - }
  1422 + };
1346 1423  
1347 1424 if(new Date(startDate) > new Date(endDate)) {
1348 1425 wx.showToast({
1349   - title: '敲黑板!开始时间不能晚于结束时间噢~',
  1426 + title: '不对噢!开始时间不能晚于结束时间~',
1350 1427 icon: 'none',
1351 1428 })
1352   - }
  1429 + return;
  1430 + };
1353 1431  
1354 1432  
1355 1433 this.request_list({
1356 1434 store_id: os.stoid,
1357 1435 user_id: oo.user_id,
1358 1436 page: 1,
1359   - BeginDate:this.data.startDate,
1360   - EndDate: this.data.endDate,
1361   - }, function() {
1362   - th.setData({
1363   - total: res.data.data.total
1364   - });
  1437 + BeginDate: this.data.startDate,
  1438 + EndDate: this.data.endDate
  1439 + }, function(res) {
  1440 + if(res.data.data.total == 0) {
  1441 + wx.showToast({
  1442 + title: '没有找到相关订单',
  1443 + icon: 'none',
  1444 + duration: 2000
  1445 + })
  1446 + } else {
  1447 + th.setData({
  1448 + total: res.data.data.total
  1449 + });
  1450 + }
1365 1451 });
1366   -
1367   -
1368 1452 },
1369 1453  
1370 1454 currentDate() {
... ...
pages/user/order_list/order_list.wxml
1 1 <wxs module="filters" src="../../../utils/filter.wxs"></wxs>
2 2 <view class="container">
3 3 <view class="tab-container" bindtap="onClickTab">
4   - <view class="tab {{currentIndex == 0 ? 'active':''}}" data-index="0">线上订单</view>
5   - <view class="tab {{currentIndex == 1 ? 'active':''}}" data-index="1">线下订单</view>
  4 + <view class="tab {{currentIndex == 0 ? 'active':''}}" data-index="0"><text class="iconfont icon-cloud"></text>线上订单</view>
  5 + <view class="tab {{currentIndex == 1 ? 'active':''}}" data-index="1"><text class="iconfont icon-shop"></text>线下订单</view>
6 6 </view>
7 7 <view class="search-container flex" wx:if="{{currentIndex == 0}}">
8   - <input class="search-input" type="text" placeholder="请输入您所搜索的商品"/>
9   - <view class="search-btn">搜索</view>
  8 + <input class="search-input" type="text" placeholder="请输入您所搜索的商品" bindinput="bindInput" bindconfirm="bindInput" placeholder-style="color:#ccc;"/>
  9 + <view class="search-btn" bindtap="searchOnline">搜索</view>
10 10 </view>
11 11 <view class="type-navbar fs28" wx:if="{{currentIndex == 0}}">
12 12 <view class="type-box flex-center" wx:for="{{categories}}" wx:key="{{index}}">
... ... @@ -26,7 +26,7 @@
26 26 <view class="picker">{{endDate}}</view>
27 27 </picker>
28 28 </view>
29   - <view class="search-btn search-btn2" bindtap="search">查询</view>
  29 + <view class="search-btn search-btn2" bindtap="searchOffline">查询</view>
30 30 </view>
31 31 <view class="fs24 c-9 pdt20">注:读取时段内仅{{total}}笔记录</view>
32 32 </view>
... ... @@ -35,11 +35,11 @@
35 35 <view class="list-container" wx:if="{{currentIndex == 0}}">
36 36 <view class="stay_evaluate" data-id="{{item.order_id}}" wx:for="{{orderList}}" wx:key="{{index}}">
37 37 <!-- 商品编号和状态 -->
38   - <view class="Commodity_number flex-vertical-between fs26 padding border_bottom">
  38 + <view class="Commodity_number flex-vertical-between fs24 padding border_bottom">
39 39 <!--商品编号 -->
40 40 <text selectable='true'>订单编号:{{item.order_sn}}</text>
41 41 <!-- 商品评价状态 -->
42   - <view class="flex-center xc-wc">
  42 + <view class="flex-center c-r">
43 43 <!-- 订单状态 -->
44 44 <view wx:if="{{item.pt_status==1}}">组团中</view>
45 45 <view wx:if="{{(item.order_status==0&&item.pay_status==0)}}">未支付</view>
... ... @@ -81,7 +81,7 @@
81 81 <view class="Commodity_content">
82 82 <view class="Commodity_goods">
83 83 <!-- 商品名称 -->
84   - <view class="goods_name ellipsis-2 fs30">{{goods.goods_name}}</view>
  84 + <view class="goods_name ellipsis-2 fs26">{{goods.goods_name}}</view>
85 85 <view class="flex-space-between">
86 86 <!-- 商品规格 -->
87 87 <view class="Commodity_spec fs28 flex-center">
... ... @@ -104,9 +104,9 @@
104 104 <!-- 商品价格数量 -->
105 105 <view class="Commodity_money flex-vertical-between baseline">
106 106 <!-- 商品价格 -->
107   - <view class="flex-vertical xc-wc baseline">
  107 + <view class="flex-vertical c-tb baseline">
108 108 <view class="fs24">¥</view>
109   - <view class="fs32">{{filters.toFix(goods.member_goods_price,2)}}</view>
  109 + <view class="fs26">{{filters.toFix(goods.member_goods_price,2)}}</view>
110 110 </view>
111 111 <view class="fs26 c-a9">x{{goods.goods_num}}</view>
112 112 </view>
... ... @@ -115,7 +115,7 @@
115 115 <!-- 去评价 -->
116 116 <view class="commodity_evaluate jc_sb baseline fs26">
117 117 <!-- 商品数量 -->
118   - <view class="commodity_smy fs26">
  118 + <view class="commodity_smy fs24">
119 119 <view class="order-total">
120 120 <view>
121 121 共{{item.g_num}}件商品
... ... @@ -124,8 +124,8 @@
124 124 <block wx:if="{{item.pt_status==4 || item.pt_status==5}}">
125 125 <view class="commodity_money flex baseline">
126 126 <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view>
127   - <view class="fs24 xc-wc">¥</view>
128   - <view class="xc-wc">{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money,2)}}
  127 + <view class="fs24 c-r">¥</view>
  128 + <view class="c-r">{{filters.toFix(item.order_amount+item.user_money+item.pt_tail_money,2)}}
129 129 </view>
130 130  
131 131 </view>
... ... @@ -133,22 +133,22 @@
133 133 <block wx:else>
134 134 <view wx:if="{{item.is_zsorder==4}}" class="commodity_money flex baseline">
135 135 <view>定金<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view>
136   - <view class="fs24 xc-wc">¥</view>
137   - <view class="xc-wc">{{filters.toFix(item.order_amount+item.user_money,2)}}
  136 + <view class="fs24 c-r">¥</view>
  137 + <view class="c-r">{{filters.toFix(item.order_amount+item.user_money,2)}}
138 138 </view>
139 139 </view>
140 140 <view class="commodity_money flex baseline" wx:else>
141 141 <view>合计<text wx:if="{{item.discount!=underdefine && item.discount!=null && item.discount!=0}}" style="color:#d60021;">(改)</text>:</view>
142   - <view class="fs24 xc-wc">¥</view>
143   - <view class="xc-wc">{{filters.toFix(item.order_amount+item.user_money,2)}}
  142 + <view class="fs24 c-r">¥</view>
  143 + <view class="c-r">{{filters.toFix(item.order_amount+item.user_money,2)}}
144 144 <text wx:if="{{item.coupon_price}}">+{{item.coupon_price}}元优惠券</text>
145 145 <text wx:if="{{item.integral}}">+{{item.integral}}积分</text>
146 146 </view>
147 147 </view>
148 148 <view wx:if="{{item.pt_tail_money>0}}" class="commodity_money flex baseline">
149 149 <view>待支付尾款:</view>
150   - <view class="fs24 xc-wc">¥</view>
151   - <view class="xc-wc">{{filters.toFix(item.pt_tail_money-item.shipping_price,2)}}
  150 + <view class="fs24 c-r">¥</view>
  151 + <view class="c-r">{{filters.toFix(item.pt_tail_money-item.shipping_price,2)}}
152 152 </view>
153 153 </view>
154 154  
... ... @@ -157,7 +157,7 @@
157 157 </view>
158 158 </view>
159 159 </view>
160   - <view class="links flex-right-vertical fs26 padding" style="flex-wrap: wrap;">
  160 + <view class="links flex-right-vertical fs24 padding">
161 161 <image wx:if="{{(item.order_status==1&&item.pay_status==1 && item.shipping_status==0 && item.exp_type==1)}}" class="code" src="{{iurl}}miniapp/images/order/code.png" bindtap="code_show" data-order_sn="{{item.order_sn}}"></image>
162 162 <view bindtap="cancelOrder" class="commodity_To_evaluate flex-level View_evaluation" data-id="{{item.order_id}}" data-zsorder="{{item.is_zsorder}}" data-orderindex="{{index}}" wx:if="{{(item.order_status==0 &&item.pay_status==0)}}">取消订单</view>
163 163 <view class="commodity_To_evaluate flex-level View_evaluation" wx:if="{{item.pt_status==3}}">拼团失败</view>
... ... @@ -182,7 +182,7 @@
182 182  
183 183  
184 184 <block wx:if="{{item.order_status==2 && item.is_zsorder!=4}}">
185   - <navigator wx:if="{{item.order_goods.length>1}}" class="order-btn white red-b"
  185 + <navigator wx:if="{{item.order_goods.length>1}}" class="order-btn white"
186 186 url="/pages/user/comment/comment?status=0&order_id={{item.order_id}}">评价</navigator>
187 187 <navigator wx:else class="order-btn white red-b"
188 188 url="/pages/user/add_comment/add_comment?goods_id={{item.order_goods[0].goods_id}}&order_id={{item.order_id}}&price={{item.order_goods[0].member_goods_price}}">评价</navigator>
... ... @@ -208,10 +208,10 @@
208 208 <view class="offline-container" wx:else>
209 209 <view class="offline-list">
210 210 <view class="item" wx:for="{{list2}}">
211   - <view class="title">单号:{{item.No}}</view>
  211 + <view class="title"><text class="iconfont icon-order"></text>单号:{{item.No}}</view>
212 212 <view class="subtitle">
213 213 <text>{{item.BillDate}}</text>
214   - <view>消费总额:<text class="co-red">¥{{item.Sum}}</text></view>
  214 + <view>消费总额:<text class="co-red fs28">¥{{item.Sum}}</text></view>
215 215 </view>
216 216 <view wx:for="{{item.list}}" wx:for-item="i">
217 217 <view class="ellipsis-2 name">{{i.BarCode}} - {{i.WareName}}</view>
... ...
pages/user/order_list/order_list.wxss
... ... @@ -21,6 +21,14 @@ mgt12 {
21 21 color: #999;
22 22 }
23 23  
  24 +.c-tb {
  25 + color: #ff5000;
  26 +}
  27 +
  28 +.c-r {
  29 + color: #FF3B3D;
  30 +}
  31 +
24 32 /* 内边距 */
25 33 .pdt20 {
26 34 padding-top: 20rpx;
... ... @@ -52,7 +60,7 @@ page {
52 60 height: 88rpx;
53 61 background-color: #fff;
54 62 justify-content: space-between;
55   - border-top: 2rpx solid #f6f6f6;
  63 + /* border-top: 2rpx solid #f6f6f6; */
56 64 }
57 65  
58 66 .type-box {
... ... @@ -69,37 +77,37 @@ page {
69 77 }
70 78  
71 79 .type-item-on {
72   - background-color: #FF3B3D;
73   - color: white;
  80 + /* background-color: #FF3B3D; */
  81 + color: #FF3B3D;
74 82 font-weight: bold;
75 83 /* border-bottom: 4rpx solid #ED3036; */
76 84 position: relative;
77 85 }
78 86 .type-item-on:after {
79   - /* content: '';
  87 + content: '';
80 88 position: absolute;
81 89 left: 0;
82 90 right: 0;
83 91 bottom: 0;
84   - width: 50%;
  92 + width: 40%;
85 93 height: 4rpx;
86   - background-color: #ED3036;
87   - margin: 0 auto; */
  94 + background-color: #FF3B3D;
  95 + margin: 0 auto;
88 96 }
89 97  
90 98 .container {
91 99 position: fixed;
92 100 width: 100%;
93 101 top: 0;
94   - z-index: 999;
  102 + z-index: 4;
95 103 /* position: -webkit-sticky;
96 104 position:sticky;
97 105 top: 0; */
98 106 }
99 107  
100 108 .list-container {
101   - padding-left: 18rpx;
102   - padding-right: 18rpx;
  109 + padding-left: 20rpx;
  110 + padding-right: 20rpx;
103 111 overflow: hidden;
104 112 /* height: calc(100% - 282rpx); */
105 113 padding-top: 282rpx;
... ... @@ -107,7 +115,7 @@ page {
107 115  
108 116 .stay_evaluate {
109 117 background-color: white;
110   - margin-top: 18rpx;
  118 + margin-top: 20rpx;
111 119 border-radius: 8rpx;
112 120 }
113 121  
... ... @@ -210,10 +218,12 @@ page {
210 218 height: 50rpx;
211 219 line-height: 50rpx;
212 220 text-align: center;
213   - border: 1px solid #eee;
  221 + /* border: 1px solid #eee; */
214 222 margin-left: 10rpx;
215   - float: right;
216   - border-radius: 15rpx;
  223 + /* float: right; */
  224 + border-radius: 6rpx;
  225 + overflow: hidden;
  226 + background-color: #FF3B3D;
217 227 }
218 228  
219 229 .order-btn-pay {
... ... @@ -282,6 +292,7 @@ page {
282 292 width: 485rpx;
283 293 /* height: 75rpx; */
284 294 line-height: 37rpx;
  295 + text-align: justify;
285 296 }
286 297  
287 298 .Commodity_content {
... ... @@ -309,7 +320,8 @@ page {
309 320 .commodity_evaluate .commodity_smy .commodity_money {
310 321 margin-left: 29rpx;
311 322 letter-spacing: 1rpx;
312   - font-weight: bold;
  323 + /* font-weight: bold; */
  324 +
313 325 }
314 326  
315 327 .commodity_evaluate .links {
... ... @@ -318,6 +330,8 @@ page {
318 330 padding-top: 20rpx;
319 331 padding-bottom: 20rpx;
320 332 border-top: 2rpx solid #F6F6F6;
  333 + display: flex;
  334 + align-items: center;
321 335 }
322 336  
323 337 .commodity_evaluate .commodity_To_evaluate {
... ... @@ -448,8 +462,8 @@ page {
448 462  
449 463 .rel {
450 464 box-sizing: border-box;
451   - width: 184rpx;
452   - height: 184rpx;
  465 + width: 180rpx;
  466 + height: 180rpx;
453 467 overflow: hidden;
454 468 /* border: 2rpx solid rgb(236, 236, 236); */
455 469 }
... ... @@ -465,8 +479,8 @@ page {
465 479 line-height: 40rpx;
466 480 }
467 481 .code{
468   - width: 55rpx;
469   - height: 55rpx;
  482 + width: 44rpx;
  483 + height: 44rpx;
470 484 }
471 485 .refund{
472 486 margin-top: 20rpx;
... ... @@ -479,6 +493,9 @@ page {
479 493 font-size: 28rpx;
480 494 border-bottom: 2rpx solid #f2f2f2;
481 495 }
  496 +.tab-container .iconfont {
  497 + margin-right: 10rpx;
  498 +}
482 499 .tab {
483 500 flex: 1;
484 501 line-height: 80rpx;
... ... @@ -487,6 +504,7 @@ page {
487 504 }
488 505 .tab.active {
489 506 color: #FF3B3D;
  507 + font-weight: bold;
490 508 }
491 509 .tab.active::after {
492 510 content: '';
... ... @@ -531,10 +549,10 @@ page {
531 549 border-radius: 10rpx;
532 550 }
533 551 .picker {
534   - color: #999;
  552 + color: #ccc;
535 553 text-align: center;
536 554 line-height: 70rpx;
537   - font-size: 28rpx;
  555 + font-size: 26rpx;
538 556 }
539 557  
540 558 .list2 {
... ... @@ -543,11 +561,18 @@ page {
543 561 }
544 562 .title {
545 563 padding: 20rpx;
546   - font-size: 28rpx;
  564 + font-size: 26rpx;
  565 + display: flex;
  566 + align-items: center;
  567 +}
  568 +.icon-order {
  569 + font-size: 26rpx;
  570 + color: #FF3B3D;
  571 + margin-right: 10rpx;
547 572 }
548 573 .subtitle {
549 574 display: flex;
550   - font-size: 26rpx;
  575 + font-size: 24rpx;
551 576 justify-content: space-between;
552 577 background-color: #f0f0f0;
553 578 line-height: 60rpx;
... ... @@ -561,12 +586,12 @@ page {
561 586 .subitem {
562 587 width: calc(100% / 3);
563 588 text-align: center;
564   - font-size: 28rpx;
  589 + font-size: 26rpx;
565 590 }
566 591 .name {
567 592 padding: 0 20rpx;
568 593 margin: 20rpx 0;
569   - font-size: 30rpx;
  594 + font-size: 26rpx;
570 595 word-break: break-all;
571 596 text-align: justify;
572 597 }
... ... @@ -584,5 +609,9 @@ page {
584 609 }
585 610  
586 611 .search-btn2 {
587   - border-radius-top-left: 8rpx;
  612 + border-top-left-radius: 8rpx;
  613 + border-bottom-left-radius: 8rpx;
588 614 }
  615 +
  616 +
  617 +
... ...