|
@@ -853,6 +853,7 @@ export default {
|
|
|
current: 0,
|
|
|
examData: {},
|
|
|
orderGoodsId: "",
|
|
|
+ collectList: [],
|
|
|
};
|
|
|
},
|
|
|
async mounted() {
|
|
@@ -1020,6 +1021,49 @@ export default {
|
|
|
].ansText.imageList.push(res);
|
|
|
});
|
|
|
},
|
|
|
+ /**
|
|
|
+ * @param {Object} current
|
|
|
+ * 获取收藏信息
|
|
|
+ */
|
|
|
+ getCollectInfo(current) {
|
|
|
+ this.$request
|
|
|
+ .getCollectInfo({
|
|
|
+ examId: this.examId,
|
|
|
+ questionId: this.questionList[current].questionId,
|
|
|
+ goodsId: this.goodsId,
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ this.$set(this.collectList, current, res.data);
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.$set(this.collectList, current, false);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ 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;
|
|
|
+ },
|
|
|
isOver(item, index) {
|
|
|
if (this.questionList[index].ques) {
|
|
|
if (item.type == 4) {
|