防止提前答卷,统一时间
This commit is contained in:
parent
1de054e722
commit
5579d456a3
4
app.js
4
app.js
|
@ -94,8 +94,8 @@ App({
|
||||||
perms:[],
|
perms:[],
|
||||||
openid:null
|
openid:null
|
||||||
},
|
},
|
||||||
//serverUrl: 'https://safeyun.ctcshe.com/',
|
serverUrl: 'https://safeyun.ctcshe.com/',
|
||||||
serverUrl: 'http://127.0.0.1:8000/',
|
//serverUrl: 'http://10.21.28.148:8000/',
|
||||||
//serverUrl: 'http://192.168.0.107:8000/',
|
//serverUrl: 'http://192.168.0.107:8000/',
|
||||||
//serverUrl:'http://10.0.11.195:8000/',
|
//serverUrl:'http://10.0.11.195:8000/',
|
||||||
timepass:null //定时器
|
timepass:null //定时器
|
||||||
|
|
|
@ -44,7 +44,6 @@ Page({
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
console.log(res.data.rows)
|
|
||||||
if (res.data.rows.length == 0) {
|
if (res.data.rows.length == 0) {
|
||||||
if (page == 1) {
|
if (page == 1) {
|
||||||
this.setData({
|
this.setData({
|
||||||
|
@ -67,7 +66,7 @@ Page({
|
||||||
list = this.data.yklist.concat(res.data.rows)
|
list = this.data.yklist.concat(res.data.rows)
|
||||||
}
|
}
|
||||||
for(var i=0;i<list.length;i++){
|
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({
|
this.setData({
|
||||||
yktotal: res.data.total,
|
yktotal: res.data.total,
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
<view class="weui-media-box__title">{{item.examtest__name}}
|
<view class="weui-media-box__title">{{item.examtest__name}}
|
||||||
</view>
|
</view>
|
||||||
<view class="weui-media-box__desc">参加时间:{{item.starttime}}</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>
|
||||||
<view class="weui-panel__ft weui-cell__ft_in-access">
|
<view class="weui-panel__ft weui-cell__ft_in-access">
|
||||||
<view class="weui-media-box__title">
|
<view class="weui-media-box__title">
|
||||||
|
|
|
@ -87,7 +87,7 @@ Page({
|
||||||
this.showTm(0)
|
this.showTm(0)
|
||||||
this.setData({
|
this.setData({
|
||||||
tmtotal: tms.tms.length,
|
tmtotal: tms.tms.length,
|
||||||
starttime: util.formatTime(new Date()) })
|
starttime: tms.starttime })
|
||||||
wx.hideLoading()
|
wx.hideLoading()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ Page({
|
||||||
countdown: temp,
|
countdown: temp,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (mil < 2000) {
|
if (mil < 1000) {
|
||||||
wx.showLoading({
|
wx.showLoading({
|
||||||
title: '时间到,正在交卷..',
|
title: '时间到,正在交卷..',
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,19 +45,9 @@ Page({
|
||||||
|
|
||||||
let ksdata = res.data
|
let ksdata = res.data
|
||||||
ksdata['testdisable'] = false
|
ksdata['testdisable'] = false
|
||||||
if (ksdata.starttime != null) {
|
if (ksdata.notinTime == 1){
|
||||||
let st = new Date(ksdata.starttime)
|
|
||||||
if(new Date()<st){
|
|
||||||
ksdata['testdisable'] = true
|
ksdata['testdisable'] = true
|
||||||
ksdata['msg'] = '考试时间未到!'
|
ksdata['msg'] = '不在考试期限范围内!'
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ksdata.endtime != null) {
|
|
||||||
let et = new Date(ksdata.endtime)
|
|
||||||
if (new Date() > et) {
|
|
||||||
ksdata['testdisable'] = true
|
|
||||||
ksdata['msg'] = '考试时间已过!'
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (ksdata.ison == 1) {
|
if (ksdata.ison == 1) {
|
||||||
ksdata['testdisable'] = true
|
ksdata['testdisable'] = true
|
||||||
|
|
|
@ -19,9 +19,12 @@ Page({
|
||||||
this.setData({
|
this.setData({
|
||||||
examtestid:examtestid,
|
examtestid:examtestid,
|
||||||
detailid:detailid,
|
detailid:detailid,
|
||||||
took: util.formatSeconds(options.took),
|
tookformat: util.formatSeconds(options.took),
|
||||||
score:options.score
|
score:options.score
|
||||||
})
|
})
|
||||||
|
wx.showLoading({
|
||||||
|
title: '加载中',
|
||||||
|
})
|
||||||
wx.request({
|
wx.request({
|
||||||
url: getApp().globalData.serverUrl + 'api/examtest?a=detail&id=' + examtestid,
|
url: getApp().globalData.serverUrl + 'api/examtest?a=detail&id=' + examtestid,
|
||||||
header: {
|
header: {
|
||||||
|
@ -29,6 +32,7 @@ Page({
|
||||||
'Cookie': wx.getStorageSync("sessionid"),
|
'Cookie': wx.getStorageSync("sessionid"),
|
||||||
},
|
},
|
||||||
success: res => {
|
success: res => {
|
||||||
|
wx.hideLoading()
|
||||||
if (res.statusCode === 200) {
|
if (res.statusCode === 200) {
|
||||||
let ksdata = res.data
|
let ksdata = res.data
|
||||||
this.setData(ksdata)
|
this.setData(ksdata)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="weui-article">
|
<view class="weui-article">
|
||||||
<view class="page__title" style="text-align:center;margin-top:10rpx;font-weight:bold">答题信息</view>
|
<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>总得分:{{score}} 分</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
Loading…
Reference in New Issue