开始考试按钮显示逻辑问题

This commit is contained in:
caoqianming 2020-12-10 08:56:34 +08:00
parent 1c0b463c24
commit 98d6495b21
3 changed files with 65 additions and 60 deletions

View File

@ -55,12 +55,17 @@ Page({
let ksdata = res.data let ksdata = res.data
ksdata['testdisable'] = false ksdata['testdisable'] = false
if (ksdata.notinTime == 1) { if(ksdata.state == 0){
ksdata['testdisable'] = true
ksdata['msg'] = '考试已关闭!'
}
else if (ksdata.notinTime == 1) {
ksdata['testdisable'] = true ksdata['testdisable'] = true
ksdata['msg'] = '不在考试期限范围内!' ksdata['msg'] = '不在考试期限范围内!'
} }
if (ksdata.testnum == 0) { else if (ksdata.testnum == 0) {
ksdata['testdisable'] = false ksdata['testdisable'] = false
ksdata['msg'] = ''
}else{ }else{
ksdata['testdisable'] = true ksdata['testdisable'] = true
ksdata['msg'] = '您已考过!' ksdata['msg'] = '您已考过!'

View File

@ -29,5 +29,5 @@
<view style="position:fixed;bottom:0;left:0;width:100%;"> <view style="position:fixed;bottom:0;left:0;width:100%;">
<view style="color:red;text-align:center">{{msg}}</view> <view style="color:red;text-align:center">{{msg}}</view>
<button class="weui-btn" type="primary" bindtap="start" disabled="{{testdisable}}">开始考试</button> <button class="weui-btn" type="primary" bindtap="start" disabled="{{testdisable}}">开始考试</button>
<button class="weui-btn" bindtap="start" wx:if="{{remainnum>0}}">重考({{remainnum}})</button> <button class="weui-btn" bindtap="start" wx:if="{{remainnum>0 && state==1 && notinTime ==0}}">重考({{remainnum}})</button>
</view> </view>

View File

@ -1,59 +1,59 @@
{ {
"description": "项目配置文件。", "description": "项目配置文件。",
"setting": { "setting": {
"urlCheck": false, "urlCheck": false,
"es6": true, "es6": true,
"enhance": false, "enhance": false,
"postcss": true, "postcss": true,
"preloadBackgroundData": false, "preloadBackgroundData": false,
"minified": true, "minified": true,
"newFeature": true, "newFeature": true,
"coverView": true, "coverView": true,
"nodeModules": true, "nodeModules": true,
"autoAudits": false, "autoAudits": false,
"showShadowRootInWxmlPanel": true, "showShadowRootInWxmlPanel": true,
"scopeDataCheck": false, "scopeDataCheck": false,
"uglifyFileName": false, "uglifyFileName": false,
"checkInvalidKey": true, "checkInvalidKey": true,
"checkSiteMap": true, "checkSiteMap": true,
"uploadWithSourceMap": true, "uploadWithSourceMap": true,
"compileHotReLoad": false, "compileHotReLoad": false,
"useMultiFrameRuntime": false, "babelSetting": {
"useApiHook": true, "ignore": [],
"babelSetting": { "disablePlugins": [],
"ignore": [], "outputPath": ""
"disablePlugins": [], },
"outputPath": "" "useIsolateContext": true,
}, "useCompilerModule": false,
"useIsolateContext": true, "userConfirmedUseCompilerModuleSwitch": false,
"useCompilerModule": true, "useMultiFrameRuntime": false,
"userConfirmedUseCompilerModuleSwitch": false, "useApiHook": true,
"packNpmManually": false, "packNpmManually": false,
"packNpmRelationList": [] "packNpmRelationList": []
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.9.4", "libVersion": "2.9.4",
"appid": "wx5c39b569f01c27db", "appid": "wx5c39b569f01c27db",
"projectname": "aqyj", "projectname": "aqyj",
"isGameTourist": false, "isGameTourist": false,
"simulatorType": "wechat", "simulatorType": "wechat",
"simulatorPluginLibVersion": {}, "simulatorPluginLibVersion": {},
"condition": { "condition": {
"search": { "search": {
"current": -1, "current": -1,
"list": [] "list": []
}, },
"conversation": { "conversation": {
"current": -1, "current": -1,
"list": [] "list": []
}, },
"game": { "game": {
"currentL": -1, "currentL": -1,
"list": [] "list": []
}, },
"miniprogram": { "miniprogram": {
"current": -1, "current": -1,
"list": [] "list": []
} }
} }
} }