防止提前答卷,统一时间
This commit is contained in:
parent
1de054e722
commit
5579d456a3
4
app.js
4
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 //定时器
|
||||
|
|
|
@ -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<list.length;i++){
|
||||
list[i].took = util.formatSeconds(list[i].took)
|
||||
list[i].tookformat = util.formatSeconds(list[i].took)
|
||||
}
|
||||
this.setData({
|
||||
yktotal: res.data.total,
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
<view class="weui-media-box__title">{{item.examtest__name}}
|
||||
</view>
|
||||
<view class="weui-media-box__desc">参加时间:{{item.starttime}}</view>
|
||||
<view class="weui-media-box__desc" style="color:blue">耗时:{{item.took}} 得分:{{item.score}}</view>
|
||||
<view class="weui-media-box__desc" style="color:blue">耗时:{{item.tookformat}} 得分:{{item.score}}</view>
|
||||
</view>
|
||||
<view class="weui-panel__ft weui-cell__ft_in-access">
|
||||
<view class="weui-media-box__title">
|
||||
|
|
|
@ -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: '时间到,正在交卷..',
|
||||
});
|
||||
|
|
|
@ -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()<st){
|
||||
ksdata['testdisable'] = true
|
||||
ksdata['msg'] = '考试时间未到!'
|
||||
}
|
||||
}
|
||||
if (ksdata.endtime != null) {
|
||||
let et = new Date(ksdata.endtime)
|
||||
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'] = '您已考过!'
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
</view>
|
||||
<view class="weui-article">
|
||||
<view class="page__title" style="text-align:center;margin-top:10rpx;font-weight:bold">答题信息</view>
|
||||
<view>您耗时:<span style="color:blue">{{took}}</span></view>
|
||||
<view>您耗时:<span style="color:blue">{{tookformat}}</span></view>
|
||||
<view>总得分:{{score}} 分</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
Loading…
Reference in New Issue