diff --git a/xietang-answer-h5/App.vue b/xietang-answer-h5/App.vue index 2b80abe..0e4ea6a 100644 --- a/xietang-answer-h5/App.vue +++ b/xietang-answer-h5/App.vue @@ -162,7 +162,7 @@ let redirect = encodeURIComponent(link.replace(/#\//, "")) // let appid = 'wx7b33df2cb829cec6' let appid = 'wxbf4862e929ab85b0' - // uni.setStorageSync('userInfo_token', {"token":"7777|QHwrodQSA6dhth3TEYjIwJfW2BNok5azI9CO25yb","user_id":5081}); + uni.setStorageSync('userInfo_token', {"token":"7881|46ePF9WTeCxRWTioGoy6Sf1zVvwaCCb4DOQYm5FQ","user_id":5101}); window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appid}&redirect_uri=${redirect}&response_type=code&scope=snsapi_base#wechat_redirect` diff --git a/xietang-answer-h5/pages/answer/index.vue b/xietang-answer-h5/pages/answer/index.vue index 235ac22..2513a0e 100644 --- a/xietang-answer-h5/pages/answer/index.vue +++ b/xietang-answer-h5/pages/answer/index.vue @@ -5,17 +5,20 @@ (答题{{questionIndex+1}}/10) - {{minutes}}:{{seconds}} + + + {{minutes}}:{{seconds}} - {{question_list[questionIndex]?question_list[questionIndex]['type_name']:''}}{{question_list[questionIndex]?question_list[questionIndex]['title']:''}} + {{question_list[questionIndex]?question_list[questionIndex]['type_name']:''}} - + {{answerNum[ansindex]}}{{ans.title}} + @@ -98,8 +101,11 @@ showAnswer:false, ansicon100:require('../../static/answer100icon.png'), ansicon80:require('../../static/answer80icon.png'), + timeicon:require('../../static/time.png'), maskHeight:0, maxscore:0, + isanswer:false,// 控制答案结束前不能点击到下一题 + } }, onShow(){ @@ -201,6 +207,9 @@ } }) }, + replaceAtSymbolsWithSpan(str) { + return str.replace(/@/g, ''); + }, chooseAnswer(ans,ansindex){ this.hasFlag = false if(this.question_list[this.questionIndex]['type_name']==='单选题'){ @@ -265,6 +274,10 @@ nextQue(){ console.log("进入questionIndex",this.questionIndex,this.correctNum) let that = this + // this.isanswer = false + if(this.isanswer){ + return + } if(!this.hasFlag){ this.util.toast("请先选择答案") return @@ -300,12 +313,22 @@ // that.answerSubmit = true // return // } + // 判断选择的是否正确 + this.question_list[this.questionIndex]['options'].map(item=>{ + if(item.is_correct===1){ + item.isanswer = true + }else if(item.flag==true&&item.is_correct===0){ + item.iswrong = true + } + }) + this.isanswer = true if(that.questionIndex==9){ that.submitQue() return } setTimeout(function(){ that.correctAnswer = '' + that.isanswer = false that.questionIndex++ if(that.questionIndex==9){ that.answerSubmit = true @@ -395,8 +418,10 @@ } .answertitle{ padding:30rpx; - line-height: 2; - font-weight: bold; + line-height: 1.8; + font-family: "宋体"; + color: rgba(0,0,0,0.8); + /* font-weight: bold; */ } .answertitle span{ @@ -408,6 +433,14 @@ border-radius: 10rpx; font-weight: normal; } + .answertitle span.more{ + background-color: cadetblue; + } + .borderb{ + display: inline-block; + width:10rpx; + border-bottom:1px solid #666; + } .answercheck{ padding:30rpx; padding-top:0rpx; @@ -419,9 +452,12 @@ border-radius: 20rpx; color:#666666; } - .answeritem.active{ + .answeritem.active,.answeritem.wrong{ border:4rpx solid #d22425; } + .answeritem.correct{ + border:4rpx solid green; + } .answeritem span{ display: inline-block; width:40rpx; @@ -433,11 +469,17 @@ border-radius: 10rpx; margin-right:10rpx } - .answeritem.active span{ + .answeritem.active span,.answeritem.wrong span{ border:2px solid #d22425; background-color: #d22425; color:#fff; } + .answeritem.correct span{ + border:2px solid green; + background-color: green; + color:#fff; + } + .answerbottom{ padding:30rpx; padding-top:10rpx; diff --git a/xietang-answer-h5/pages/index/index copy.vue b/xietang-answer-h5/pages/index/index copy.vue new file mode 100644 index 0000000..e71e000 --- /dev/null +++ b/xietang-answer-h5/pages/index/index copy.vue @@ -0,0 +1,355 @@ + + + + + \ No newline at end of file diff --git a/xietang-answer-h5/pages/index/index.vue b/xietang-answer-h5/pages/index/index.vue index e71e000..7a530ba 100644 --- a/xietang-answer-h5/pages/index/index.vue +++ b/xietang-answer-h5/pages/index/index.vue @@ -1,5 +1,5 @@ -