From 02ca05ca2d18690bab24c8d0a4d0eade5951e405 Mon Sep 17 00:00:00 2001 From: yvan.ni Date: Tue, 9 Apr 2024 16:09:27 +0800 Subject: [PATCH] 1、会员中心 图标隐藏的优化 2、订单的优化 --- pages/user/index/filter.wxs | 29 ++++------------------------- pages/user/index/index.js | 11 +++++++++++ pages/user/index/index.wxml | 2 +- pages/user/order_list/order_list.js | 40 +++++++++++++++++++++++++++++----------- pages/user/order_list/order_list.wxml | 4 ++-- 5 files changed, 47 insertions(+), 39 deletions(-) diff --git a/pages/user/index/filter.wxs b/pages/user/index/filter.wxs index 99bc793..d636b20 100644 --- a/pages/user/index/filter.wxs +++ b/pages/user/index/filter.wxs @@ -1,29 +1,8 @@ -var is_close = function (name,c_list) { +var is_close = function (name,c_list,map) { if(!c_list) return 0; - var map={}; - map['我的分销']="1"; - map['我的拼单']="2"; - map['秒杀活动']="3"; - map['PLUS会员']="4"; - map['我的权益']="5"; - map['联系客服']="6"; - map['收藏夹']="7"; - map['我的地址']="8"; - map['收入卡包']="9"; - map['专享礼包']="10"; - map['我的服务']="12"; - map['我的评价']="13"; - map['我的礼包']="14"; - map['助力活动']="15"; - map['充值有礼']="16"; - map['幸运大转盘']="17"; - map['幸运购']="18"; - map['套盒商品']="19"; - map['AI测肤']="20"; - map['附近门店']="21"; - map['积分签到']="22"; - map['瘦身日记']="23"; - map['每月礼包']="24"; + if(!map){ + return 0; + } var index=map[name]; //我的权益要判断5,和11 diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 0df426f..a5e90b1 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -1118,6 +1118,17 @@ Page({ }) if (!d_list) return false; + + let t_map={}; + for (let i in d_list) { + let ite=d_list[i]; + t_map[ite.name]=ite.id+''; + } + this.setData({ + tool_map:t_map + }) + + //过滤掉分销关闭的 let distribut_end_time = await getApp().user_tools_endTime(2);//过滤掉分销到期的 await getApp().promiseGet("/api/weshop/storeDistribut/get/" + os.stoid, {}).then(rs => { diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml index 9d43f47..0c49f85 100644 --- a/pages/user/index/index.wxml +++ b/pages/user/index/index.wxml @@ -316,7 +316,7 @@ - + diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index 8fd05a0..ea575e4 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -80,19 +80,19 @@ Page({ searchContent: '', ser_paying:0, + have_get_nor:0, //看一下普通订单有没有获取 }, onLoad: function (t) { self = this; // 设置日期选择器的结束时间为当前日期 var now = new Date(); - var nowDate = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate(); + var nowDate = now.getFullYear() + '-' + this.check_is_big(now.getMonth() + 1) + '-' + this.check_is_big(now.getDate()); var date = new Date(now.getTime() - 7 * 24 * 3600 * 1000); - var startDate = date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); - + var startDate = date.getFullYear() + '-' + this.check_is_big(date.getMonth() + 1) + '-' + this.check_is_big(date.getDate()); if (t.index) { - if(t.tabindex) t.tabindex=0; + if(!t.tabindex) t.tabindex=0; this.setData({ currentIndex: t.index, tabIndex: t.tabindex, @@ -126,6 +126,14 @@ Page({ }, + + + //判断是不是大于10补0 + check_is_big(num){ + if(num<10) num='0'+num; + return num; + }, + onShow: function () { wx.showLoading(); var th=this; @@ -252,6 +260,7 @@ Page({ r = r + "&page=" + e.data.currentPage; s.request(r, function (t) { + th.data.have_get_nor=1; if(t.data.data.page*t.data.data.pageSize>=t.data.data.total){ th.setData({ iscodeall: 1 }); @@ -2676,7 +2685,7 @@ Page({ th.data.is_load2 = 0; // 请求成功 - if (res.data.code == 0) { + if (res.data.code == 0 && res.data.data && res.data.data.pageData) { if (res.data.data.pageData.length > 0) { th.data.currentPage2++; @@ -2782,7 +2791,7 @@ Page({ onClickTab(e) { - let currentIndex = e.target.dataset.index; + let currentIndex = parseInt(e.target.dataset.index || 0); this.setData({ currentIndex: currentIndex, is_get:0 @@ -2793,17 +2802,21 @@ Page({ is_no_more2: 0, currentPage2: 1, }); - if (currentIndex == 0) { + if (currentIndex == 0 && !this.data.have_get_nor) { console.log('线上订单'); /*--- this.setData({ startDate: '选择开始时间', endDate: '选择结束时间', });--*/ + wx.showLoading({ + title: '', + }) + this.requestOrderList(this.data.activeCategoryId); + }; - if (currentIndex == 1) { console.log('线下订单'); this.request_list({ @@ -3025,7 +3038,7 @@ Page({ if (e) { currentIndex = e.target.dataset.index; } else { - currentIndex = this.data.tabIndex + currentIndex = this.data.currentIndex }; // let || this.data.tabIndex; @@ -3036,14 +3049,14 @@ Page({ user_id: oo.user_id, }; this.setData({ - tabIndex: currentIndex, + tabIndex: this.data.tabIndex || 0, is_no_data2: 0, is_no_more2: 0, cardList: [], }); - switch (currentIndex) { + switch (parseInt(currentIndex+'')) { case 0: { // 全部 delete data.order_status; delete data.pay_status; @@ -3052,6 +3065,11 @@ Page({ case 1: { // 待支付 data.order_status = 0; delete data.pay_status; + + data.page=1; + data.BeginDate=this.data.startDate, + data.EndDate=this.data.endDate + break; }; case 2: { // 待评价 diff --git a/pages/user/order_list/order_list.wxml b/pages/user/order_list/order_list.wxml index 7f94377..937fd1d 100644 --- a/pages/user/order_list/order_list.wxml +++ b/pages/user/order_list/order_list.wxml @@ -551,11 +551,11 @@ 实付金额 - {{ofil.toFix(item.FactSum,2)}} + {{ofil.toFix(item.FactAndBank,2)}} 本次积分 - {{ofil.for_mat_val(item.FactIntRepSum)}} + {{ofil.for_mat_val(item.PIntegral)}} 会员卡号 -- libgit2 0.21.4