|
@@ -98,7 +98,12 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="question__btns">
|
|
<div class="question__btns">
|
|
- <div class="collect" @click="collect">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="collect"
|
|
|
|
+ @click="
|
|
|
|
+ collect(collectList[questionIndex], questionIndex)
|
|
|
|
+ "
|
|
|
|
+ >
|
|
<template v-if="!collectList[questionIndex]"
|
|
<template v-if="!collectList[questionIndex]"
|
|
><i class="el-icon-star-off"></i>收藏本题</template
|
|
><i class="el-icon-star-off"></i>收藏本题</template
|
|
>
|
|
>
|
|
@@ -802,6 +807,17 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="right-box">
|
|
<div class="right-box">
|
|
|
|
+ <div class="right-box__header">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ round
|
|
|
|
+ plain
|
|
|
|
+ size="small"
|
|
|
|
+ class="back-btn"
|
|
|
|
+ @click="$router.back(-1)"
|
|
|
|
+ >返回</el-button
|
|
|
|
+ >
|
|
|
|
+ </div>
|
|
<div class="right-box__header">答题卡</div>
|
|
<div class="right-box__header">答题卡</div>
|
|
<div class="right-box__body">
|
|
<div class="right-box__body">
|
|
<div class="card">
|
|
<div class="card">
|
|
@@ -1242,6 +1258,7 @@ export default {
|
|
|
|
|
|
changeIndex(index) {
|
|
changeIndex(index) {
|
|
this.current = index;
|
|
this.current = index;
|
|
|
|
+ this.getCollectInfo(this.current);
|
|
},
|
|
},
|
|
nextQuestion() {
|
|
nextQuestion() {
|
|
if (this.current >= this.questionList.length - 1) {
|
|
if (this.current >= this.questionList.length - 1) {
|
|
@@ -1252,6 +1269,7 @@ export default {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
this.current++;
|
|
this.current++;
|
|
|
|
+ this.getCollectInfo(this.current);
|
|
},
|
|
},
|
|
prevQuestion() {
|
|
prevQuestion() {
|
|
if (this.current == 0) {
|
|
if (this.current == 0) {
|
|
@@ -1262,6 +1280,7 @@ export default {
|
|
return;
|
|
return;
|
|
} else {
|
|
} else {
|
|
this.current--;
|
|
this.current--;
|
|
|
|
+ this.getCollectInfo(this.current);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
isRight(item, index) {
|
|
isRight(item, index) {
|
|
@@ -1410,11 +1429,28 @@ export default {
|
|
return count;
|
|
return count;
|
|
},
|
|
},
|
|
|
|
|
|
- collect() {
|
|
|
|
- this.$message({
|
|
|
|
- message: "试做题目,不支持收藏~",
|
|
|
|
- type: "warning",
|
|
|
|
- });
|
|
|
|
|
|
+ collect(state, index) {
|
|
|
|
+ if (!state) {
|
|
|
|
+ this.$request
|
|
|
|
+ .collectQuestion({
|
|
|
|
+ examId: this.examId,
|
|
|
|
+ questionId: this.questionList[index].questionId,
|
|
|
|
+ goodsId: this.goodsId || "",
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$set(this.collectList, index, true);
|
|
|
|
+ this.$message.success("收藏成功");
|
|
|
|
+ this.getCollectInfo(index);
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this.$request
|
|
|
|
+ .deleteCollectQuestion(this.collectList[index].collectQuestionId)
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$set(this.collectList, index, false);
|
|
|
|
+ this.$message.success("取消收藏成功");
|
|
|
|
+ });
|
|
|
|
+ }
|
|
return;
|
|
return;
|
|
},
|
|
},
|
|
submit() {
|
|
submit() {
|
|
@@ -2089,6 +2125,10 @@ export default {
|
|
color: #333333;
|
|
color: #333333;
|
|
text-align: center;
|
|
text-align: center;
|
|
border-bottom: 1px solid #eeeeee;
|
|
border-bottom: 1px solid #eeeeee;
|
|
|
|
+
|
|
|
|
+ .back-btn {
|
|
|
|
+ width: 160px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
&__body {
|
|
&__body {
|
|
@@ -2134,7 +2174,7 @@ export default {
|
|
}
|
|
}
|
|
|
|
|
|
&__content {
|
|
&__content {
|
|
- height: 410px;
|
|
|
|
|
|
+ height: 630px;
|
|
overflow-y: scroll;
|
|
overflow-y: scroll;
|
|
|
|
|
|
&::-webkit-scrollbar {
|
|
&::-webkit-scrollbar {
|