| | |
| | | const item = this.cardData[index]; |
| | | for (let cindex = 0; cindex < item.infoList.length; cindex++) { |
| | | const citem = item.infoList[cindex]; |
| | | if (typeof citem.userAnswer == "string") { |
| | | citem.userAnswer = ""; |
| | | } else { |
| | | if (citem.questionType == "multipleChoice") { |
| | | citem.userAnswer = []; |
| | | } else { |
| | | // 填空题 |
| | | for (let dindex = 0; dindex < citem.userAnswer.length; dindex++) { |
| | | citem.userAnswer[dindex] = ''; |
| | | } |
| | | } |
| | | } |
| | | citem.isComplete = false; |
| | | } |
| | | } |
| | |
| | | }, |
| | | // 题目收藏按钮,收藏和取消同一接口,取消数组减去该项id |
| | | setCollect(num, number) { |
| | | let item = null |
| | | let item = null; |
| | | if(number) { |
| | | item = this.cardData[num].infoList[number]; |
| | | |
| | | } else { |
| | | item = this.cardData[num] |
| | | item = this.cardData[num]; |
| | | } |
| | | item.isCollect = !item.isCollect; |
| | | console.log(111,item); |
| | |
| | | const item = this.allCollect[index]; |
| | | if (item.type == this.sourceType) item.collectList = this.collectList; |
| | | } |
| | | console.log('点击收藏按钮',this.allCollect) |
| | | console.log("点击收藏按钮", this.allCollect); |
| | | this.MG.identity |
| | | .setUserKey({ |
| | | setKeyRequests: [ |
| | |
| | | .then((res) => { |
| | | try { |
| | | const collect = JSON.parse(res[0].value); |
| | | console.log('全部收藏id',collect); |
| | | console.log("全部收藏id", collect); |
| | | if (collect.length) { |
| | | this.collectList = collect.find( |
| | | (citem) => citem.type == this.sourceType |
| | |
| | | .catch(() => {}); |
| | | }, |
| | | onChangeInput(e,index,cindex,num) { |
| | | this.cardData[index].infoList[cindex].userAnswer[num] = e.target.value |
| | | this.cardData[index].infoList[cindex].userAnswer[num] = e.target.value; |
| | | }, |
| | | }, |
| | | }; |