From 8ff046d5fd059f8e93c4d11f12f7bca5d186109d Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 8 Aug 2019 23:21:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E5=BC=80=E5=A7=8B=E7=BB=93?= =?UTF-8?q?=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/examtest/note.js | 23 +++++++++++++++++++---- pages/examtest/note.wxml | 8 +++++++- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pages/examtest/note.js b/pages/examtest/note.js index 0030b03..7d5a929 100644 --- a/pages/examtest/note.js +++ b/pages/examtest/note.js @@ -6,7 +6,7 @@ Page({ * 页面的初始数据 */ data: { - + testdisable:false }, /** @@ -22,8 +22,24 @@ Page({ success: res => { if (res.statusCode === 200) { let ksdata = res.data - if (ksdata.starttime != '') { ksdata.starttime = util.formatTime2(new Date(ksdata.starttime)) } - if (ksdata.endtime != '') { ksdata.endtime = util.formatTime2(new Date(ksdata.endtime)) } + if (ksdata.starttime != null) { + let st = new Date(ksdata.starttime) + ksdata.starttime = util.formatTime2(st) + if(new Date() et) { + this.setData({ + testdisable: true + }) + } + } this.setData(res.data) } } @@ -43,7 +59,6 @@ Page({ onShow: function () { }, - /** * 生命周期函数--监听页面隐藏 */ diff --git a/pages/examtest/note.wxml b/pages/examtest/note.wxml index 877792f..638b3c0 100644 --- a/pages/examtest/note.wxml +++ b/pages/examtest/note.wxml @@ -7,6 +7,12 @@ 答卷时长:{{duration}}分钟 满分{{totalscore}};{{passscore}}以上通过 {{exampaper__total.dx.num}}道单选题,{{exampaper__total.duox.num}}道多选题,{{exampaper__total.pd.num}}道判断题 + 考试开启时间: + {{starttime}} + + 考试关闭时间: + {{endtime}} + 2.答题须知 @@ -18,5 +24,5 @@ - + \ No newline at end of file