Commit fa823149ddc628adf561ff138e55fc1314a0b946
Merge branch 'dev_oa_fu42' into dev
Showing
5 changed files
with
226 additions
and
39 deletions
packageE/pages/cart/cart2/cart2.js
... | ... | @@ -2929,14 +2929,16 @@ Page({ |
2929 | 2929 | cart_item.g_monthlb_num = [{ |
2930 | 2930 | 'month_id': item_map.monthlibao, |
2931 | 2931 | "monthnum": item_map.monthlb_num, |
2932 | - 'monthlbtitle': item_map.monthlbtitle | |
2932 | + 'monthlbtitle': item_map.monthlbtitle, | |
2933 | + 'prom_id':item_map.prom_id | |
2933 | 2934 | }]; |
2934 | 2935 | } else { |
2935 | 2936 | cart_item.monthlibao += "," + item_map.monthlibao; |
2936 | 2937 | cart_item.g_monthlb_num.push({ |
2937 | 2938 | 'month_id': item_map.monthlibao, |
2938 | 2939 | "monthnum": item_map.monthlb_num, |
2939 | - 'monthlbtitle': item_map.monthlbtitle | |
2940 | + 'monthlbtitle': item_map.monthlbtitle, | |
2941 | + 'prom_id':item_map.prom_id | |
2940 | 2942 | }) |
2941 | 2943 | } |
2942 | 2944 | } |
... | ... | @@ -5431,7 +5433,8 @@ Page({ |
5431 | 5433 | let obj = { |
5432 | 5434 | num: ite.monthnum, |
5433 | 5435 | l_id: ite.month_id, |
5434 | - monthlbtitle: ite.monthlbtitle | |
5436 | + monthlbtitle: ite.monthlbtitle, | |
5437 | + prom_id: ite.prom_id, | |
5435 | 5438 | } |
5436 | 5439 | marr.push(obj) |
5437 | 5440 | }) |
... | ... | @@ -5886,8 +5889,12 @@ Page({ |
5886 | 5889 | } |
5887 | 5890 | var str = JSON.stringify(pdata); |
5888 | 5891 | |
5892 | + console.log("--str--"); | |
5893 | + console.log(str); | |
5889 | 5894 | |
5890 | 5895 | |
5896 | + return false; | |
5897 | + | |
5891 | 5898 | wx.showLoading({ title: "加载中" }); |
5892 | 5899 | th.setData({ submit: 1, }) |
5893 | 5900 | wx.request({ | ... | ... |
pages/user/order_list/ofilter.wxs
... | ... | @@ -4,5 +4,24 @@ module.exports = { |
4 | 4 | if(item.presell && item.presell.presell_type==0 && item.order_status<3 && item.presell.deposit_pay_time>0 && item.presell.tail_pay_state==0) |
5 | 5 | url='/packageC/pages/presell/cart/cart?is_fwk=1&order_id='+item.order_id |
6 | 6 | return url; |
7 | - } | |
7 | + }, | |
8 | + for_mat_val:function (e){ | |
9 | + if(e==undefined) return '-'; | |
10 | + if(e==null) return '-'; | |
11 | + if(e=="null") return '-'; | |
12 | + if(e=="") return '-'; | |
13 | + return e; | |
14 | + }, | |
15 | + toFix: function (val, count) { | |
16 | + | |
17 | + if(val==undefined) return '-'; | |
18 | + if(val==null) return '-'; | |
19 | + if(val=="null") return '-'; | |
20 | + if(val=="") return '-'; | |
21 | + if (!val) { | |
22 | + return parseFloat(0).toFixed(count); | |
23 | + } | |
24 | + val = parseFloat(val); | |
25 | + return val.toFixed(count) | |
26 | + }, | |
8 | 27 | } |
9 | 28 | \ No newline at end of file | ... | ... |
pages/user/order_list/order_list.js
... | ... | @@ -252,7 +252,11 @@ Page({ |
252 | 252 | r = r + "&page=" + e.data.currentPage; |
253 | 253 | s.request(r, function (t) { |
254 | 254 | |
255 | - th.setData({ is_get: 1 }); | |
255 | + | |
256 | + if(t.data.data.page*t.data.data.pageSize>=t.data.data.total){ | |
257 | + th.setData({ iscodeall: 1 }); | |
258 | + } | |
259 | + | |
256 | 260 | var data = e.data.orderList; |
257 | 261 | |
258 | 262 | //-- 如果有值的时候 -- |
... | ... | @@ -437,6 +441,8 @@ Page({ |
437 | 441 | wx.hideLoading(); |
438 | 442 | } |
439 | 443 | |
444 | + th.setData({ is_get: 1 }); | |
445 | + | |
440 | 446 | |
441 | 447 | |
442 | 448 | |
... | ... | @@ -445,19 +451,30 @@ Page({ |
445 | 451 | |
446 | 452 | //滑倒底部 |
447 | 453 | onReachBottom: function () { |
454 | + | |
455 | + | |
456 | + | |
448 | 457 | if (this.data.currentIndex == 0) { |
449 | 458 | if (s.data.goodsLoadFinishFlag) { |
450 | 459 | this.setData({ |
451 | 460 | iscodeall: 1 |
452 | 461 | }) |
453 | 462 | } |
454 | - s.canloadMore() && this.requestOrderList(this.data.activeCategoryId); | |
463 | + | |
464 | + if(!this.data.iscodeall){ | |
465 | + wx.showLoading(); | |
466 | + s.canloadMore() && this.requestOrderList(this.data.activeCategoryId); | |
467 | + } | |
468 | + | |
469 | + | |
455 | 470 | } else { |
456 | 471 | if (this.data.currentIndex == 1) { |
457 | 472 | this.request_list({ |
458 | 473 | store_id: os.stoid, |
459 | 474 | user_id: oo.user_id, |
460 | 475 | page: this.data.currentPage2, |
476 | + BeginDate: this.data.startDate, | |
477 | + EndDate: this.data.endDate | |
461 | 478 | }); |
462 | 479 | } else { // 卡项订单 |
463 | 480 | this.request_list({ |
... | ... | @@ -2646,26 +2663,57 @@ Page({ |
2646 | 2663 | url = '/api/weshop/recharge/user/page'; |
2647 | 2664 | }; |
2648 | 2665 | |
2666 | + wx.showLoading({ | |
2667 | + title: '', | |
2668 | + }) | |
2669 | + | |
2649 | 2670 | app.request.promiseGet(url, { |
2650 | 2671 | data: data |
2651 | 2672 | }).then(async res => { |
2652 | 2673 | wx.hideLoading(); |
2653 | 2674 | // 关闭加载状态 |
2654 | 2675 | th.data.is_load2 = 0; |
2676 | + | |
2655 | 2677 | // 请求成功 |
2656 | 2678 | if (res.data.code == 0) { |
2679 | + | |
2657 | 2680 | if (res.data.data.pageData.length > 0) { |
2658 | 2681 | th.data.currentPage2++; |
2659 | 2682 | var data = res.data.data.pageData; |
2660 | 2683 | // 判断有无更多数据可以加载,如果大于则没有更多数据,反之则有 |
2661 | - if (res.data.data.page * res.data.data.pageSize > res.data.data.total) { th.setData({ is_no_more2: 1 }); } | |
2684 | + if (res.data.data.page * res.data.data.pageSize >= res.data.data.total) { th.setData({ is_no_more2: 1 }); } | |
2662 | 2685 | let list = []; |
2663 | 2686 | |
2664 | 2687 | if (currentIndex == 1) { |
2665 | 2688 | //list = th.data.list2; |
2666 | - list = list.concat(data); | |
2689 | + var new_data= data.map((item,index)=>{ | |
2690 | + var all_qty=0; //总数量 | |
2691 | + var all_yh=0; //总是优惠金额 | |
2692 | + if(item.list && item.list.length){ | |
2693 | + for (let iv = 0; iv < item.list.length; iv++) { | |
2694 | + var tt_ite=item.list[iv]; | |
2695 | + all_qty+=tt_ite.Qty; | |
2696 | + all_yh+=tt_ite.LetSum; | |
2697 | + } | |
2698 | + item.all_qty=all_qty; | |
2699 | + item.all_yh=all_yh; | |
2700 | + } | |
2701 | + if(item.CashRepNo){ | |
2702 | + var q_arr=item.CashRepNo.split(','); | |
2703 | + var n_arr=[]; | |
2704 | + for (let ix = 0; ix <q_arr.length; ix++) { | |
2705 | + if(!q_arr[ix]) continue; | |
2706 | + n_arr.push(q_arr[ix]); | |
2707 | + } | |
2708 | + item.quan_arr=n_arr; | |
2709 | + } | |
2710 | + return item; | |
2711 | + }) | |
2712 | + | |
2713 | + list = list.concat(new_data); | |
2667 | 2714 | th.setData({ list2: list }); |
2668 | 2715 | }; |
2716 | + | |
2669 | 2717 | if (currentIndex == 2) { // 卡项订单 |
2670 | 2718 | list = th.data.cardList; |
2671 | 2719 | // var new_data= data.map((item,index)=>{ |
... | ... | @@ -2713,6 +2761,7 @@ Page({ |
2713 | 2761 | th.setData({ is_no_more2: 1 }); |
2714 | 2762 | } |
2715 | 2763 | } |
2764 | + | |
2716 | 2765 | if (callback) callback(res); |
2717 | 2766 | } else { |
2718 | 2767 | // wx.showToast({ |
... | ... | @@ -2721,6 +2770,9 @@ Page({ |
2721 | 2770 | // duration: 2000 |
2722 | 2771 | // }) |
2723 | 2772 | } |
2773 | + | |
2774 | + th.setData({is_get:1}) | |
2775 | + | |
2724 | 2776 | }) |
2725 | 2777 | }, |
2726 | 2778 | |
... | ... | @@ -2728,7 +2780,8 @@ Page({ |
2728 | 2780 | onClickTab(e) { |
2729 | 2781 | let currentIndex = e.target.dataset.index; |
2730 | 2782 | this.setData({ |
2731 | - currentIndex: currentIndex | |
2783 | + currentIndex: currentIndex, | |
2784 | + is_get:0 | |
2732 | 2785 | }); |
2733 | 2786 | |
2734 | 2787 | this.setData({ |
... | ... | @@ -2744,6 +2797,9 @@ Page({ |
2744 | 2797 | endDate: '选择结束时间', |
2745 | 2798 | });--*/ |
2746 | 2799 | }; |
2800 | + | |
2801 | + | |
2802 | + | |
2747 | 2803 | if (currentIndex == 1) { |
2748 | 2804 | console.log('线下订单'); |
2749 | 2805 | this.request_list({ |
... | ... | @@ -2869,14 +2925,6 @@ Page({ |
2869 | 2925 | let endDate = this.data.endDate; |
2870 | 2926 | |
2871 | 2927 | // this.data.is_no_data2 = 0; |
2872 | - this.setData({ | |
2873 | - currentPage2: 1, | |
2874 | - list2: [], | |
2875 | - is_no_data2: 0, | |
2876 | - is_no_more2:0 | |
2877 | - }); | |
2878 | - | |
2879 | - | |
2880 | 2928 | if (startDate == '选择开始时间' || endDate == '选择结束时间') { |
2881 | 2929 | wx.showToast({ |
2882 | 2930 | title: '请选择完整的查询时间~', |
... | ... | @@ -2892,6 +2940,19 @@ Page({ |
2892 | 2940 | return; |
2893 | 2941 | }; |
2894 | 2942 | |
2943 | + this.setData({ | |
2944 | + currentPage2: 1, | |
2945 | + list2: [], | |
2946 | + is_no_data2: 0, | |
2947 | + is_no_more2:0, | |
2948 | + is_get:0 | |
2949 | + }); | |
2950 | + | |
2951 | + | |
2952 | + wx.showLoading({ | |
2953 | + title: '', | |
2954 | + }) | |
2955 | + | |
2895 | 2956 | |
2896 | 2957 | this.request_list({ |
2897 | 2958 | store_id: os.stoid, | ... | ... |
pages/user/order_list/order_list.wxml
... | ... | @@ -499,29 +499,73 @@ |
499 | 499 | <!-- 线下订单 --> |
500 | 500 | <view class="offline-container" wx:elif="{{currentIndex == 1}}"> |
501 | 501 | <view class="offline-list"> |
502 | - <view class="item" wx:for="{{list2}}"> | |
503 | - <view class="title"> | |
504 | - <view><text class="iconfont icon-order"></text>单号:{{item.No}}</view> | |
505 | - <view>{{item.states}}</view> | |
502 | + <view class="item new_d" wx:for="{{list2}}"> | |
503 | + <!-- 顶部 --> | |
504 | + <view class="fs32 sto_title">{{item.StorageName}}</view> | |
505 | + <view class="fs24 order_info_new flex jc_sb"> | |
506 | + <view>营业员:{{item.StaffName}}</view> | |
507 | + <view>单号:{{item.No}}</view> | |
506 | 508 | </view> |
507 | - <view class="subtitle"> | |
508 | - <text>{{item.BillDate}}</text> | |
509 | - <view>消费总额:<text class="co-red fs28">¥{{item.Sum}}</text></view> | |
509 | + <view class="fs24 order_info_new flex jc_sb" style="margin-top: 26rpx;"> | |
510 | + <view>收银员:{{ofil.for_mat_val(item.Operator)}}</view> | |
511 | + <view>{{item.BillDate}}</view> | |
510 | 512 | </view> |
511 | - <view wx:for="{{item.list}}" wx:for-item="i"> | |
512 | - <view class="ellipsis-2 name">{{i.BarCode}} - {{i.WareName}}</view> | |
513 | - <view class="flex"> | |
514 | - <view class="subitem"> | |
515 | - <view class="key">数量</view> | |
516 | - <view class="val">{{i.Qty}}</view> | |
517 | - </view> | |
518 | - <view class="subitem"> | |
519 | - <view class="key">单价</view> | |
520 | - <view class="val">¥{{i.Price}}(<text style="text-decoration: line-through;">{{i.PosPrice}}</text>)</view> | |
513 | + <view class="line_new" style="margin-top: 34rpx;"></view> | |
514 | + <!-- 中间商品 --> | |
515 | + <view class="flex fs24 tab_title"> | |
516 | + <view class="subitem_n1"> | |
517 | + 名称/条码 | |
518 | + </view> | |
519 | + <view class="flex subitem_n2"> | |
520 | + <view class="subitem_nn">数量</view> | |
521 | + <view class="subitem_nn">单价</view> | |
522 | + <view class="subitem_nn">金额</view> | |
523 | + </view> | |
524 | + </view> | |
525 | + <view class="val_item flex ai_c" wx:for="{{item.list}}" wx:for-item="i"> | |
526 | + <view class="subitem_n1"> | |
527 | + <view class="ellipsis-2">{{i.WareName}}</view> | |
528 | + <view> | |
529 | + {{i.BarCode}} | |
530 | + <block wx:if="{{i.SpecName || i.UnitName}}"> | |
531 | + ({{i.SpecName}}<text wx:if="{{i.SpecName && i.UnitName}}">/</text>{{i.UnitName}}) | |
532 | + </block> | |
521 | 533 | </view> |
522 | - <view class="subitem"> | |
523 | - <view class="key">金额</view> | |
524 | - <view class="val">¥{{i.Sum}}</view> | |
534 | + </view> | |
535 | + <view class="flex subitem_n2"> | |
536 | + <view class="subitem_nn">{{i.Qty}}</view> | |
537 | + <view class="subitem_nn">{{i.Price}}</view> | |
538 | + <view class="subitem_nn je_color">{{i.Sum}}</view> | |
539 | + </view> | |
540 | + </view> | |
541 | + <view class="line_new" style="margin-top: 34rpx;"></view> | |
542 | + <!-- 底部金额 --> | |
543 | + <view style="margin-top: 16rpx;padding-bottom: 26rpx;"> | |
544 | + <view class="more_info flex jc_sb ai_c fs24"> | |
545 | + <text>商品总数</text> | |
546 | + <text>{{item.all_qty}}</text> | |
547 | + </view> | |
548 | + <view class="more_info flex jc_sb ai_c fs24"> | |
549 | + <text>优惠金额</text> | |
550 | + <text class="je_color">{{ofil.toFix(item.all_yh,2)}}</text> | |
551 | + </view> | |
552 | + <view class="more_info flex jc_sb ai_c fs24"> | |
553 | + <text>实付金额</text> | |
554 | + <text class="je_color">{{item.FactSum}}</text> | |
555 | + </view> | |
556 | + <view class="more_info flex jc_sb ai_c fs24"> | |
557 | + <text>本次积分</text> | |
558 | + <text>{{ofil.for_mat_val(item.FactIntRepSum)}}</text> | |
559 | + </view> | |
560 | + <view class="more_info flex jc_sb ai_c fs24"> | |
561 | + <text>会员卡号</text> | |
562 | + <text>{{item.VIPNo}}</text> | |
563 | + </view> | |
564 | + <view class="more_info flex jc_sb fs24"> | |
565 | + <view>本次使用优惠券号</view> | |
566 | + <view wx:if="{{!item.quan_arr}}">-</view> | |
567 | + <view wx:else> | |
568 | + <view wx:for="{{item.quan_arr}}" wx:for-item="quan">{{quan}}</view> | |
525 | 569 | </view> |
526 | 570 | </view> |
527 | 571 | </view> |
... | ... | @@ -538,7 +582,7 @@ |
538 | 582 | </view> |
539 | 583 | |
540 | 584 | <!-- 无订单 --> |
541 | -<view class="empty_order" wx:if="{{((!orderList||orderList.length==0) && is_get && currentIndex == 0) || (list2.length==0 && currentIndex == 1) || (cardList.length == 0 && currentIndex == 2 && is_get)}}"> | |
585 | +<view class="empty_order" wx:if="{{((!orderList||orderList.length==0) && is_get && currentIndex == 0) || (list2.length==0 && currentIndex == 1 && is_get) || (cardList.length == 0 && currentIndex == 2 && is_get)}}"> | |
542 | 586 | <view class="flex-level"> |
543 | 587 | <image src="{{iurl}}miniapp/images/order/empty_order.png"></image> |
544 | 588 | </view> | ... | ... |
pages/user/order_list/order_list.wxss
... | ... | @@ -587,11 +587,19 @@ page { |
587 | 587 | border-radius: 16rpx; |
588 | 588 | margin-top: 20rpx; |
589 | 589 | } |
590 | +.item.new_d { | |
591 | + background-color: white; | |
592 | + border-radius: 12rpx; | |
593 | + margin-top: 20rpx; | |
594 | +} | |
595 | + | |
590 | 596 | .subitem { |
591 | 597 | width: calc(100% / 3); |
592 | 598 | text-align: center; |
593 | 599 | font-size: 26rpx; |
594 | 600 | } |
601 | + | |
602 | + | |
595 | 603 | .name { |
596 | 604 | padding: 0 20rpx; |
597 | 605 | margin: 20rpx 0; |
... | ... | @@ -609,7 +617,7 @@ page { |
609 | 617 | } |
610 | 618 | |
611 | 619 | .offline-container { |
612 | - padding: 244rpx 20rpx 20rpx; | |
620 | + padding: 256rpx 18rpx 20rpx; | |
613 | 621 | } |
614 | 622 | |
615 | 623 | .search-btn2 { |
... | ... | @@ -622,3 +630,51 @@ page { |
622 | 630 | } |
623 | 631 | |
624 | 632 | |
633 | + | |
634 | +.sto_title{ | |
635 | + line-height: 32rpx;font-weight: bolder;color: #000; text-align: center;padding-top: 38rpx; | |
636 | +} | |
637 | + | |
638 | +.order_info_new{ | |
639 | + line-height: 24rpx; color:#898585; padding: 0 30rpx; margin-top: 41rpx; | |
640 | +} | |
641 | + | |
642 | +.line_new{ | |
643 | + border-bottom:1rpx #a9a9a9 dashed; | |
644 | + border-top:1rpx #a9a9a9 dashed; | |
645 | + margin: 0rpx 30rpx; | |
646 | + height: 6rpx; | |
647 | +} | |
648 | + | |
649 | +.subitem_n1 { | |
650 | + width:314rpx; | |
651 | + font-size: 24rpx; | |
652 | +} | |
653 | + | |
654 | + | |
655 | +.subitem_n2 { | |
656 | + width:358rpx; | |
657 | + font-size: 24rpx; | |
658 | +} | |
659 | + | |
660 | +.tab_title{ | |
661 | + padding: 0 30rpx;color: #000; line-height: 24rpx;margin-top: 31rpx; margin-bottom: 34rpx; | |
662 | +} | |
663 | +.val_item{ | |
664 | + padding: 0 30rpx; line-height: 33rpx; | |
665 | +} | |
666 | +.val_item~.val_item{ | |
667 | + margin-top: 38rpx; | |
668 | +} | |
669 | +.more_info{ | |
670 | + min-height: 52rpx;padding: 0 30rpx;color: #898585; | |
671 | +} | |
672 | + | |
673 | +.je_color{ | |
674 | + color: #f87d27; | |
675 | +} | |
676 | + | |
677 | +.subitem_nn { | |
678 | + width: calc(100% / 3); | |
679 | + text-align: center; | |
680 | +} | ... | ... |