guhongwei 4 years ago
parent
commit
0b7eb09c09
2 changed files with 14 additions and 2 deletions
  1. 10 0
      app.json
  2. 4 2
      pages/reserve/index.js

+ 10 - 0
app.json

@@ -1,12 +1,22 @@
 {
   "pages": [
+<<<<<<< HEAD
+=======
+    "pages/reserve/index",
+    "pages/history/index",
+    "pages/my/index",
+    "pages/login/index",
+>>>>>>> 83c4bf5848aa11a939b5a6bda8ac775e89148c67
     "pages/home/index",
     "pages/login/index",
     "pages/food/index",
     "pages/calorie/index",
+<<<<<<< HEAD
     "pages/reserve/index",
     "pages/my/index",
     "pages/history/index",
+=======
+>>>>>>> 83c4bf5848aa11a939b5a6bda8ac775e89148c67
     "pages/news/index",
     "pages/news/detail"
   ],

+ 4 - 2
pages/reserve/index.js

@@ -43,6 +43,7 @@ Page({
   bindDateChange: function (e) {
     console.log('picker发送选择改变,携带值为', e.detail.value)
     this.setData({ today: e.detail.value })
+    this.searchDate();
   },
   // 禁止左右滑动
   stopTab: function (e) {
@@ -169,12 +170,13 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
+    let today = moment().format('YYYY-MM-DD');
+    this.setData({ today: today })
     this.searchDate();
   },
   // 查询时间
   searchDate: function () {
-    let today = moment().format('YYYY-MM-DD');
-    if (today) this.setData({ today: today })
+    let today = this.data.today;
     wx.request({
       url: `${app.globalData.publicUrl}/api/st/dining/arrange/getByDate?date=` + today,
       method: "get",