From 5579d456a32ff3be647b1f045c4917942b0c4626 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 20 Feb 2020 19:44:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2=E6=8F=90=E5=89=8D=E7=AD=94?= =?UTF-8?q?=E5=8D=B7=EF=BC=8C=E7=BB=9F=E4=B8=80=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 4 ++-- pages/examtest/index.js | 3 +-- pages/examtest/index.wxml | 2 +- pages/examtest/main.js | 4 ++-- pages/examtest/note.js | 18 ++++-------------- pages/examtest/note2.js | 6 +++++- pages/examtest/note2.wxml | 2 +- 7 files changed, 16 insertions(+), 23 deletions(-) diff --git a/app.js b/app.js index b1ae3ae..33ff925 100644 --- a/app.js +++ b/app.js @@ -94,8 +94,8 @@ App({ perms:[], openid:null }, - //serverUrl: 'https://safeyun.ctcshe.com/', - serverUrl: 'http://127.0.0.1:8000/', + serverUrl: 'https://safeyun.ctcshe.com/', + //serverUrl: 'http://10.21.28.148:8000/', //serverUrl: 'http://192.168.0.107:8000/', //serverUrl:'http://10.0.11.195:8000/', timepass:null //定时器 diff --git a/pages/examtest/index.js b/pages/examtest/index.js index 236ba85..655685c 100644 --- a/pages/examtest/index.js +++ b/pages/examtest/index.js @@ -44,7 +44,6 @@ Page({ }, success: res => { if (res.statusCode === 200) { - console.log(res.data.rows) if (res.data.rows.length == 0) { if (page == 1) { this.setData({ @@ -67,7 +66,7 @@ Page({ list = this.data.yklist.concat(res.data.rows) } for(var i=0;i{{item.examtest__name}} 参加时间:{{item.starttime}} - 耗时:{{item.took}} 得分:{{item.score}} + 耗时:{{item.tookformat}} 得分:{{item.score}} diff --git a/pages/examtest/main.js b/pages/examtest/main.js index 4135764..9137bf9 100644 --- a/pages/examtest/main.js +++ b/pages/examtest/main.js @@ -87,7 +87,7 @@ Page({ this.showTm(0) this.setData({ tmtotal: tms.tms.length, - starttime: util.formatTime(new Date()) }) + starttime: tms.starttime }) wx.hideLoading() } @@ -161,7 +161,7 @@ Page({ countdown: temp, }); - if (mil < 2000) { + if (mil < 1000) { wx.showLoading({ title: '时间到,正在交卷..', }); diff --git a/pages/examtest/note.js b/pages/examtest/note.js index 9b89d7b..1f37994 100644 --- a/pages/examtest/note.js +++ b/pages/examtest/note.js @@ -45,20 +45,10 @@ Page({ let ksdata = res.data ksdata['testdisable'] = false - if (ksdata.starttime != null) { - let st = new Date(ksdata.starttime) - if(new Date() et) { - ksdata['testdisable'] = true - ksdata['msg'] = '考试时间已过!' - } - } + if (ksdata.notinTime == 1){ + ksdata['testdisable'] = true + ksdata['msg'] = '不在考试期限范围内!' + } if (ksdata.ison == 1) { ksdata['testdisable'] = true ksdata['msg'] = '您已考过!' diff --git a/pages/examtest/note2.js b/pages/examtest/note2.js index 62673fc..5cad1ee 100644 --- a/pages/examtest/note2.js +++ b/pages/examtest/note2.js @@ -19,9 +19,12 @@ Page({ this.setData({ examtestid:examtestid, detailid:detailid, - took: util.formatSeconds(options.took), + tookformat: util.formatSeconds(options.took), score:options.score }) + wx.showLoading({ + title: '加载中', + }) wx.request({ url: getApp().globalData.serverUrl + 'api/examtest?a=detail&id=' + examtestid, header: { @@ -29,6 +32,7 @@ Page({ 'Cookie': wx.getStorageSync("sessionid"), }, success: res => { + wx.hideLoading() if (res.statusCode === 200) { let ksdata = res.data this.setData(ksdata) diff --git a/pages/examtest/note2.wxml b/pages/examtest/note2.wxml index 4889cdc..619b0c2 100644 --- a/pages/examtest/note2.wxml +++ b/pages/examtest/note2.wxml @@ -15,7 +15,7 @@ 答题信息 - 您耗时:{{took}} + 您耗时:{{tookformat}} 总得分:{{score}} 分