|
@@ -75,7 +75,7 @@
|
|
|
|
|
|
<script>
|
|
|
//引入题目
|
|
|
-import { questions } from "@/assets/js/data.js";
|
|
|
+import { questions } from "./data.js";
|
|
|
export default {
|
|
|
name: "issue",
|
|
|
components: {},
|
|
@@ -106,7 +106,7 @@ export default {
|
|
|
//点击答错里面的下一题
|
|
|
nextTi() {
|
|
|
// 最后一题
|
|
|
- if (this.topicInd === 9 && this.cunot >= 6) {
|
|
|
+ if (this.topicInd === 19 && this.cunot >= 12) {
|
|
|
this.flag = "three";
|
|
|
this.topic.forEach((v) => {
|
|
|
let temp = "";
|
|
@@ -115,13 +115,13 @@ export default {
|
|
|
});
|
|
|
v.title += "---" + temp;
|
|
|
});
|
|
|
- } else if (this.topicInd === 9 && this.cunot < 6) {
|
|
|
+ } else if (this.topicInd === 19 && this.cunot < 12) {
|
|
|
this.flag = "four";
|
|
|
}
|
|
|
|
|
|
this.caseInd = null;
|
|
|
this.caseErr = false;
|
|
|
- if (this.topicInd < 10) this.topicInd++;
|
|
|
+ if (this.topicInd < 20) this.topicInd++;
|
|
|
}, //选择题目
|
|
|
select(index, id) {
|
|
|
this.caseInd = index;
|
|
@@ -130,7 +130,7 @@ export default {
|
|
|
//点击确定
|
|
|
btnOk() {
|
|
|
// 最后一题
|
|
|
- if (this.topicInd === 9 && this.cunot >= 6) {
|
|
|
+ if (this.topicInd === 19 && this.cunot >= 12) {
|
|
|
this.flag = "three";
|
|
|
this.topic.forEach((v) => {
|
|
|
let temp = "";
|
|
@@ -140,7 +140,7 @@ export default {
|
|
|
v.title += "---" + temp;
|
|
|
});
|
|
|
return;
|
|
|
- } else if (this.topicInd === 9 && this.cunot < 6) {
|
|
|
+ } else if (this.topicInd === 19 && this.cunot < 12) {
|
|
|
this.flag = "four";
|
|
|
return;
|
|
|
}
|
|
@@ -150,7 +150,7 @@ export default {
|
|
|
if (this.topic[this.topicInd].correct === this.caseABC) {
|
|
|
// console.log('答对了');
|
|
|
this.caseInd = null;
|
|
|
- if (this.topicInd < 10) this.topicInd++;
|
|
|
+ if (this.topicInd < 20) this.topicInd++;
|
|
|
this.cunot++;
|
|
|
} else {
|
|
|
// console.log('答错了');
|
|
@@ -174,23 +174,25 @@ export default {
|
|
|
getTopic() {
|
|
|
this.topic = [];
|
|
|
let arr = [];
|
|
|
- for (let i = 0; i < 200; i++) {
|
|
|
- //一个从0到100的数组
|
|
|
+ for (let i = 0; i < 50; i++) {
|
|
|
+ //一个从0到50的数组
|
|
|
arr.push(i);
|
|
|
}
|
|
|
arr.sort(function () {
|
|
|
//随机打乱这个数组
|
|
|
return Math.random() - 0.5;
|
|
|
});
|
|
|
- arr.length = 10; //改写长度
|
|
|
+ arr.length = 20; //改写长度
|
|
|
arr.forEach((v) => {
|
|
|
this.topic.push(questions[v]);
|
|
|
});
|
|
|
- // console.log(999, this.topic); //控制台会输出10个不同的数
|
|
|
+ // console.log(999, this.topic); //控制台会输出20个不同的数
|
|
|
},
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {},
|
|
|
+ created() {
|
|
|
+ console.log('题目长度',questions.length);
|
|
|
+ },
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {},
|
|
|
beforeCreate() {}, //生命周期 - 创建之前
|