Commit 02ca05ca2d18690bab24c8d0a4d0eade5951e405
1 parent
bb8b2f72
1、会员中心 图标隐藏的优化
2、订单的优化
Showing
5 changed files
with
47 additions
and
39 deletions
pages/user/index/filter.wxs
1 | -var is_close = function (name,c_list) { | |
1 | +var is_close = function (name,c_list,map) { | |
2 | 2 | if(!c_list) return 0; |
3 | - var map={}; | |
4 | - map['我的分销']="1"; | |
5 | - map['我的拼单']="2"; | |
6 | - map['秒杀活动']="3"; | |
7 | - map['PLUS会员']="4"; | |
8 | - map['我的权益']="5"; | |
9 | - map['联系客服']="6"; | |
10 | - map['收藏夹']="7"; | |
11 | - map['我的地址']="8"; | |
12 | - map['收入卡包']="9"; | |
13 | - map['专享礼包']="10"; | |
14 | - map['我的服务']="12"; | |
15 | - map['我的评价']="13"; | |
16 | - map['我的礼包']="14"; | |
17 | - map['助力活动']="15"; | |
18 | - map['充值有礼']="16"; | |
19 | - map['幸运大转盘']="17"; | |
20 | - map['幸运购']="18"; | |
21 | - map['套盒商品']="19"; | |
22 | - map['AI测肤']="20"; | |
23 | - map['附近门店']="21"; | |
24 | - map['积分签到']="22"; | |
25 | - map['瘦身日记']="23"; | |
26 | - map['每月礼包']="24"; | |
3 | + if(!map){ | |
4 | + return 0; | |
5 | + } | |
27 | 6 | var index=map[name]; |
28 | 7 | |
29 | 8 | //我的权益要判断5,和11 | ... | ... |
pages/user/index/index.js
... | ... | @@ -1118,6 +1118,17 @@ Page({ |
1118 | 1118 | }) |
1119 | 1119 | |
1120 | 1120 | if (!d_list) return false; |
1121 | + | |
1122 | + let t_map={}; | |
1123 | + for (let i in d_list) { | |
1124 | + let ite=d_list[i]; | |
1125 | + t_map[ite.name]=ite.id+''; | |
1126 | + } | |
1127 | + this.setData({ | |
1128 | + tool_map:t_map | |
1129 | + }) | |
1130 | + | |
1131 | + | |
1121 | 1132 | //过滤掉分销关闭的 |
1122 | 1133 | let distribut_end_time = await getApp().user_tools_endTime(2);//过滤掉分销到期的 |
1123 | 1134 | await getApp().promiseGet("/api/weshop/storeDistribut/get/" + os.stoid, {}).then(rs => { | ... | ... |
pages/user/index/index.wxml
... | ... | @@ -316,7 +316,7 @@ |
316 | 316 | <!-- 循环使用自定义菜单,显示和掩藏 --> |
317 | 317 | <block wx:for="{{user_tool}}"> |
318 | 318 | <!-- 判断系统配置中有没有把菜单关闭 --> |
319 | - <block wx:if="{{!util.is_close(item.name,c_list)}}"> | |
319 | + <block wx:if="{{!util.is_close(item.name,c_list,tool_map)}}"> | |
320 | 320 | <!-- 有链接地址的时候 --> |
321 | 321 | <block wx:if="{{item.new_weappurl}}"> |
322 | 322 | <block wx:if="{{item.name=='PLUS会员'}}"> | ... | ... |
pages/user/order_list/order_list.js
... | ... | @@ -80,19 +80,19 @@ Page({ |
80 | 80 | searchContent: '', |
81 | 81 | |
82 | 82 | ser_paying:0, |
83 | + have_get_nor:0, //看一下普通订单有没有获取 | |
83 | 84 | }, |
84 | 85 | onLoad: function (t) { |
85 | 86 | |
86 | 87 | self = this; |
87 | 88 | // 设置日期选择器的结束时间为当前日期 |
88 | 89 | var now = new Date(); |
89 | - var nowDate = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate(); | |
90 | + var nowDate = now.getFullYear() + '-' + this.check_is_big(now.getMonth() + 1) + '-' + this.check_is_big(now.getDate()); | |
90 | 91 | var date = new Date(now.getTime() - 7 * 24 * 3600 * 1000); |
91 | - var startDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); | |
92 | - | |
92 | + var startDate = date.getFullYear() + '-' + this.check_is_big(date.getMonth() + 1) + '-' + this.check_is_big(date.getDate()); | |
93 | 93 | |
94 | 94 | if (t.index) { |
95 | - if(t.tabindex) t.tabindex=0; | |
95 | + if(!t.tabindex) t.tabindex=0; | |
96 | 96 | this.setData({ |
97 | 97 | currentIndex: t.index, |
98 | 98 | tabIndex: t.tabindex, |
... | ... | @@ -126,6 +126,14 @@ Page({ |
126 | 126 | |
127 | 127 | |
128 | 128 | }, |
129 | + | |
130 | + | |
131 | + //判断是不是大于10补0 | |
132 | + check_is_big(num){ | |
133 | + if(num<10) num='0'+num; | |
134 | + return num; | |
135 | + }, | |
136 | + | |
129 | 137 | onShow: function () { |
130 | 138 | wx.showLoading(); |
131 | 139 | var th=this; |
... | ... | @@ -252,6 +260,7 @@ Page({ |
252 | 260 | r = r + "&page=" + e.data.currentPage; |
253 | 261 | s.request(r, function (t) { |
254 | 262 | |
263 | + th.data.have_get_nor=1; | |
255 | 264 | |
256 | 265 | if(t.data.data.page*t.data.data.pageSize>=t.data.data.total){ |
257 | 266 | th.setData({ iscodeall: 1 }); |
... | ... | @@ -2676,7 +2685,7 @@ Page({ |
2676 | 2685 | th.data.is_load2 = 0; |
2677 | 2686 | |
2678 | 2687 | // 请求成功 |
2679 | - if (res.data.code == 0) { | |
2688 | + if (res.data.code == 0 && res.data.data && res.data.data.pageData) { | |
2680 | 2689 | |
2681 | 2690 | if (res.data.data.pageData.length > 0) { |
2682 | 2691 | th.data.currentPage2++; |
... | ... | @@ -2782,7 +2791,7 @@ Page({ |
2782 | 2791 | |
2783 | 2792 | |
2784 | 2793 | onClickTab(e) { |
2785 | - let currentIndex = e.target.dataset.index; | |
2794 | + let currentIndex = parseInt(e.target.dataset.index || 0); | |
2786 | 2795 | this.setData({ |
2787 | 2796 | currentIndex: currentIndex, |
2788 | 2797 | is_get:0 |
... | ... | @@ -2793,17 +2802,21 @@ Page({ |
2793 | 2802 | is_no_more2: 0, |
2794 | 2803 | currentPage2: 1, |
2795 | 2804 | }); |
2796 | - if (currentIndex == 0) { | |
2805 | + if (currentIndex == 0 && !this.data.have_get_nor) { | |
2797 | 2806 | console.log('线上订单'); |
2798 | 2807 | /*--- |
2799 | 2808 | this.setData({ |
2800 | 2809 | startDate: '选择开始时间', |
2801 | 2810 | endDate: '选择结束时间', |
2802 | 2811 | });--*/ |
2812 | + wx.showLoading({ | |
2813 | + title: '', | |
2814 | + }) | |
2815 | + this.requestOrderList(this.data.activeCategoryId); | |
2816 | + | |
2803 | 2817 | }; |
2804 | 2818 | |
2805 | 2819 | |
2806 | - | |
2807 | 2820 | if (currentIndex == 1) { |
2808 | 2821 | console.log('线下订单'); |
2809 | 2822 | this.request_list({ |
... | ... | @@ -3025,7 +3038,7 @@ Page({ |
3025 | 3038 | if (e) { |
3026 | 3039 | currentIndex = e.target.dataset.index; |
3027 | 3040 | } else { |
3028 | - currentIndex = this.data.tabIndex | |
3041 | + currentIndex = this.data.currentIndex | |
3029 | 3042 | }; |
3030 | 3043 | |
3031 | 3044 | // let || this.data.tabIndex; |
... | ... | @@ -3036,14 +3049,14 @@ Page({ |
3036 | 3049 | user_id: oo.user_id, |
3037 | 3050 | }; |
3038 | 3051 | this.setData({ |
3039 | - tabIndex: currentIndex, | |
3052 | + tabIndex: this.data.tabIndex || 0, | |
3040 | 3053 | is_no_data2: 0, |
3041 | 3054 | is_no_more2: 0, |
3042 | 3055 | cardList: [], |
3043 | 3056 | }); |
3044 | 3057 | |
3045 | 3058 | |
3046 | - switch (currentIndex) { | |
3059 | + switch (parseInt(currentIndex+'')) { | |
3047 | 3060 | case 0: { // 全部 |
3048 | 3061 | delete data.order_status; |
3049 | 3062 | delete data.pay_status; |
... | ... | @@ -3052,6 +3065,11 @@ Page({ |
3052 | 3065 | case 1: { // 待支付 |
3053 | 3066 | data.order_status = 0; |
3054 | 3067 | delete data.pay_status; |
3068 | + | |
3069 | + data.page=1; | |
3070 | + data.BeginDate=this.data.startDate, | |
3071 | + data.EndDate=this.data.endDate | |
3072 | + | |
3055 | 3073 | break; |
3056 | 3074 | }; |
3057 | 3075 | case 2: { // 待评价 | ... | ... |
pages/user/order_list/order_list.wxml
... | ... | @@ -551,11 +551,11 @@ |
551 | 551 | </view> |
552 | 552 | <view class="more_info flex jc_sb ai_c fs24"> |
553 | 553 | <text>实付金额</text> |
554 | - <text class="je_color">{{ofil.toFix(item.FactSum,2)}}</text> | |
554 | + <text class="je_color">{{ofil.toFix(item.FactAndBank,2)}}</text> | |
555 | 555 | </view> |
556 | 556 | <view class="more_info flex jc_sb ai_c fs24"> |
557 | 557 | <text>本次积分</text> |
558 | - <text>{{ofil.for_mat_val(item.FactIntRepSum)}}</text> | |
558 | + <text>{{ofil.for_mat_val(item.PIntegral)}}</text> | |
559 | 559 | </view> |
560 | 560 | <view class="more_info flex jc_sb ai_c fs24"> |
561 | 561 | <text>会员卡号</text> | ... | ... |