From 68e4dd0eaa9c6dacad3d9605d7d6fe6874bbde53 Mon Sep 17 00:00:00 2001 From: limqhz Date: Sun, 23 May 2021 20:59:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=81=A5=E5=BA=B7=E6=8A=A5=E5=91=8A=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/myBookings/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pages/myBookings/index.js b/pages/myBookings/index.js index bcc01a8..a074ea3 100644 --- a/pages/myBookings/index.js +++ b/pages/myBookings/index.js @@ -1,6 +1,7 @@ // pages/myBookings/index.js const app = getApp(); let orderSn = "" +let orderLimit = 48; Page({ /** @@ -113,7 +114,7 @@ Page({ return; } else { wx.showToast({ - title: '距离开课48小时内不得取消', + title: '距离开课' + orderLimit + '小时内不得取消', icon: 'none', }) } @@ -164,6 +165,9 @@ Page({ }).then(res => { let currentDate = new Date().getTime(); let startDate = currentDate; + if (res.memberLessonTicket.venueLesson.orderLimit){ + orderLimit = res.memberLessonTicket.venueLesson.orderLimit; + } if (res.memberLessonTicket) { startDate = new Date(res.memberLessonTicket.venueLesson.date.replace(/-/g, "/") + ' ' + res.memberLessonTicket.venueLesson.startTime).getTime(); } @@ -174,7 +178,7 @@ Page({ } this.setData({ memberLessonTicket: res.memberLessonTicket, - isSignIn: (startDate - currentDate) / 1000 / 60 / 60 < 48, + isSignIn: (startDate - currentDate) / 1000 / 60 / 60 < orderLimit, }) }, err => { @@ -223,4 +227,4 @@ Page({ urls: [this.data.memberLessonTicket.venueLesson.coach.wechatCode], }) } -}) \ No newline at end of file +})