From eef01393cf18038687be29ff23be353a1b456c3d Mon Sep 17 00:00:00 2001 From: yvan.ni <765199919@qq.com> Date: Tue, 1 Dec 2020 18:15:21 +0800 Subject: [PATCH] 线下订单 --- pages/user/order_list/order_list.js | 20 ++++++++++++++++---- pages/user/order_list/order_list.wxml | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index f75dc40..9d115f0 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -50,8 +50,8 @@ Page({ back_goods_arr:null, //返回商品的列表 currentIndex: 0, - startDate: '选择开始时间', - endDate: '选择结束时间', + startDate: '', + endDate: '', list2: [], currentPage2: 1, currentDate: '', @@ -65,8 +65,15 @@ Page({ }, onLoad: function(t) { // 设置日期选择器的结束时间为当前日期 + var now=new Date(); + var nowDate = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate(); + var date = new Date(now.getTime() - 7 * 24 * 3600 * 1000); + var startDate=date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate(); + this.setData({ - currentDate: this.currentDate() + currentDate: this.currentDate(), + startDate:startDate, + endDate:nowDate, }); @@ -1354,17 +1361,22 @@ Page({ }); if(currentIndex == 0) { console.log('线上订单'); + /*--- this.setData({ startDate: '选择开始时间', endDate: '选择结束时间', - }); + });--*/ } else if(currentIndex == 1) { console.log('线下订单'); + + this.request_list({ store_id: os.stoid, user_id: oo.user_id, page: 1, + BeginDate: this.data.startDate, + EndDate: this.data.endDate }); }; }, diff --git a/pages/user/order_list/order_list.wxml b/pages/user/order_list/order_list.wxml index ebe8cab..566f867 100644 --- a/pages/user/order_list/order_list.wxml +++ b/pages/user/order_list/order_list.wxml @@ -18,7 +18,7 @@ - + {{startDate}} -- libgit2 0.21.4