| | |
| | | this.setData({ |
| | | collectList: JSON.parse(res[0].value) |
| | | }) |
| | | // total.value = collectList.value.length |
| | | } catch (error) {} |
| | | if (this.data.collectList && this.data.collectList.length) { |
| | | await this.getCollectDataList() |
| | |
| | | // 获取收藏夹 |
| | | async getCollectDataList() { |
| | | let questionArr = [] |
| | | // this.setData({ |
| | | // cardList: [{ |
| | | // catalogName: '收藏夹', |
| | | // infoList: [] |
| | | // }] |
| | | // }) |
| | | this.setData({ |
| | | cardList: [{ |
| | | catalogName: '单选题', |
| | |
| | | let shortArr = [] // 简答 |
| | | let multipleChoiceArr = [] // 多选 |
| | | let completionArr = [] // 填空 |
| | | for (let qindex = 0; qindex < this.data.collectList.length; qindex++) { |
| | | const qitem = this.data.collectList[qindex]; |
| | | let query = { |
| | | path: '*', |
| | | cmsPath: this.data.rootCmsItemId, |
| | | cmsType: '*', |
| | | productId: this.data.bookId, |
| | | queryType: '*', |
| | | itemIds: this.data.collectList.map((item) => item + ''), |
| | | itemIds: qitem + '', |
| | | itemFields: { |
| | | Embedded_QuestionBank_Stem: [], |
| | | Embedded_QuestionBank_AnalysisCon: [], |
| | |
| | | Embedded_QuestionBank_Difficulty: [] |
| | | } |
| | | } |
| | | app.MG.store.getProductDetail(query).then((res) => { |
| | | await app.MG.store.getProductDetail(query).then((res) => { |
| | | let questionArr = [] |
| | | res.datas.cmsDatas[0].datas.forEach((item, index) => { |
| | | const questionObj = { |
| | |
| | | questionObj.type = '简答题' |
| | | shortArr.push(questionObj) |
| | | } |
| | | // questionArr.push(questionObj) |
| | | }) |
| | | // this.setData({ |
| | | // questionDataList: questionArr, |
| | | // ['cardList[0].infoList']: questionArr, |
| | | // loading: false, |
| | | // }) |
| | | }) |
| | | } |
| | | this.setData({ |
| | | ['cardList[0].infoList']: singleChoiceArr, |
| | | ['cardList[1].infoList']: judgeArr, |
| | |
| | | questionDataList: questionArr, |
| | | cardList: cardList, |
| | | loading: false |
| | | }) |
| | | }) |
| | | }, |
| | | // 我的错题模式下获取错题id列表 |