Commit 6c372418 authored by 和慭琛's avatar 和慭琛

多选题问题

parent 77012c0f
...@@ -12,6 +12,12 @@ ...@@ -12,6 +12,12 @@
"navigationBarTitleText": "充电桩安装招募" "navigationBarTitleText": "充电桩安装招募"
} }
},{
"path": "pages/exam/start",
"style": {
"navigationBarTitleText": "考试"
}
},{ },{
"path": "pages/settle/base", "path": "pages/settle/base",
"style": { "style": {
...@@ -30,12 +36,6 @@ ...@@ -30,12 +36,6 @@
"navigationBarTitleText": "入驻考试" "navigationBarTitleText": "入驻考试"
} }
},{
"path": "pages/exam/start",
"style": {
"navigationBarTitleText": "考试"
}
},{ },{
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
......
...@@ -339,8 +339,9 @@ ...@@ -339,8 +339,9 @@
handleData: function() { handleData: function() {
this.currentItem.answerList.forEach(item => { this.currentItem.answerList.forEach((item,index) => {
item.isSelect = false item.isSelect = false
this.$set(this.currentItem.answerList,index,item)
}) })
}, },
...@@ -367,6 +368,11 @@ ...@@ -367,6 +368,11 @@
itemClick: function(currentItem, ikey) { itemClick: function(currentItem, ikey) {
this.isSelect = true this.isSelect = true
console.log('选点点击--处理前--this.currentItem.answerList:')
console.log(this.currentItem.answerList)
console.log('选点点击--处理前--ikey:')
console.log(ikey)
//answerType 题目类型,1单选,2多选,3简答, //answerType 题目类型,1单选,2多选,3简答,
for (let i = 0; i < this.currentItem.answerList.length; i++) { for (let i = 0; i < this.currentItem.answerList.length; i++) {
...@@ -375,15 +381,20 @@ ...@@ -375,15 +381,20 @@
if (this.currentItem.answerType == 2) { //多选 if (this.currentItem.answerType == 2) { //多选
if (ikey == i) { if (ikey == i) {
item.isSelect = !item.isSelect item.isSelect = !item.isSelect
} }
} else { //单选/简答 } else { //单选/简答
if (ikey == i) { if (ikey == i) {
item.isSelect = !item.isSelect item.isSelect = !item.isSelect
} else { } else {
item.isSelect = false item.isSelect = false
} }
} }
this.$set(this.currentItem.answerList[i],isSelect,item.isSelect)
} }
var isSelect = false var isSelect = false
...@@ -396,6 +407,10 @@ ...@@ -396,6 +407,10 @@
//有选答案 //有选答案
this.isSelect = isSelect this.isSelect = isSelect
console.log('选点点击--处理后--this.currentItem.answerList:')
console.log(this.currentItem.answerList)
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment