From fa662bf36ed8db479b42f912d4705c11511db558 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 19 三月 2024 18:45:25 +0800 Subject: [PATCH] 组卷功能完善 --- packageBookService/pages/bookServices/examination/questionList/index.js | 4 packageBookService/pages/bookServices/examination/questionList/index.wxml | 153 +-------- packageBookService/pages/bookServices/examination/questionSchedule/index.js | 18 + packageBookService/pages/bookServices/examination/questionOptions/index.js | 54 ++- packageBookService/pages/bookServices/examination/questionOptions/index.json | 4 packageBookService/pages/bookServices/examination/examination.wxml | 5 packageBookService/pages/bookServices/examination/questionOptions/index.wxss | 49 +++ packageBookService/pages/bookServices/examination/questionOptions/index.wxml | 108 ++---- packageBookService/pages/bookServices/examination/examination.wxss | 11 static/images/bookService/examination/rijian.png | 0 packageBookService/pages/bookServices/detail/components/tree/index.wxml | 2 packageBookService/pages/bookServices/examination/examination.js | 450 +++++++++++++++++++---------- packageBookService/pages/bookServices/examination/questionSchedule/index.wxml | 17 packageBookService/pages/bookServices/detail/components/tree/index.js | 8 packageBookService/pages/bookServices/detail/index.js | 17 static/images/bookService/examination/yejian.png | 0 16 files changed, 516 insertions(+), 384 deletions(-) diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js index 414cc08..33cc8d7 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.js +++ b/packageBookService/pages/bookServices/detail/components/tree/index.js @@ -82,11 +82,10 @@ }, // 璺宠浆闊宠棰戞挱鏀惧櫒 goPlayer(e) { + console.log(e); + debugger const item = e.currentTarget.dataset.item const parent = e.currentTarget.dataset.parent - - - let url if (item.selectType == 'video') { url = '/packageDomain/pages/resourceDetails/myVideo/index' @@ -249,5 +248,8 @@ }, oncheckbox() { console.log(111); + }, + logdata(e) { + console.log(e); } }) \ No newline at end of file diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.wxml b/packageBookService/pages/bookServices/detail/components/tree/index.wxml index 9d3efdd..346bd9a 100644 --- a/packageBookService/pages/bookServices/detail/components/tree/index.wxml +++ b/packageBookService/pages/bookServices/detail/components/tree/index.wxml @@ -11,7 +11,7 @@ <!-- // 鍒ゆ柇 鏃犲瓙椤� 涓斾负鍟嗗搧item 鐩存帴鏄剧ず --> <view class="listItems" wx:if="{{citem.childrenFolderCount <= 0 && citem.type == 'productItem'}}"> <view class="itemsInfo" wx:if="{{citem.name}}" data-item="{{citem}}" data-index="{{cindex}}"> - <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}"> + <view class="contentBox" bind:tap="goPlayer" data-item="{{citem}}" data-parent="{{item}}" > <!-- 鏁欏璧勬簮 浜戝涔� 鍥炬爣 --> <view class="box-image" style="{{ tab == 'jsek_teachingResources' ? 'width: 350rpx;' : 'width: 450rpx;'}}"> <view class="checkBox" wx:if="{{tab == 'jsek_cloudLearning'}}"> diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js index 0b617e4..77bf47c 100644 --- a/packageBookService/pages/bookServices/detail/index.js +++ b/packageBookService/pages/bookServices/detail/index.js @@ -417,20 +417,22 @@ //鏁欏璧勬簮 浜戝涔� if (type.refCode == 'jsek_teachingResources' || type.refCode == 'jsek_cloudLearning') { if (res.datas.cmsDatas[0].datas.length > 0) { + res.datas.cmsDatas[0].datas.forEach(item => { + item.checked = false + }) + const list = await this.getAllResource(res.datas.cmsDatas[0].datas) if (type.refCode == 'jsek_teachingResources') { - res.datas.cmsDatas[0].datas.forEach(item => { - item.checked = false - }) - const list = await this.getAllResource(res.datas.cmsDatas[0].datas) - - console.log(list, 'list'); this.setData({ teach: list, loading: false }) this.findChildIds(this.data.teach, this.data.openTeachids = []) } else if (type.refCode == 'jsek_cloudLearning') { - const list = await this.getAllResource(res.datas.cmsDatas[0].datas) + // res.datas.cmsDatas[0].datas.forEach(item => { + // item.checked = false + // }) + // const list = await this.getAllResource(res.datas.cmsDatas[0].datas) + console.log(list, 'currentlist'); this.setData({ learn: list, loading: false @@ -515,6 +517,7 @@ if (this.data.tabValue == 'jsek_teachingResources') { item.checked = false } else if (this.data.tabValue == 'jsek_cloudLearning') { + item.checked = false item.isbuy = this.resourceIsBuy(item) item.isShopCar = this.isShoppingCart(item) } diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js index e5c3c26..d948903 100644 --- a/packageBookService/pages/bookServices/examination/examination.js +++ b/packageBookService/pages/bookServices/examination/examination.js @@ -39,7 +39,9 @@ time: 0, // 绛旈鍓╀綑鏃堕棿 datas: [], // 鎵�鏈夋ā鑰冭褰曟暟鎹�(棰樼洰鍒楄〃锛岀敤鎴风瓟棰橈紝鑰冭瘯鎶ュ憡) answer: [] - } + }, + saveTime: 20, + isNight: false }, /** @@ -80,7 +82,19 @@ * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず */ onShow() { - + if (this.data.answerType == 'mock') { + if (wx.timer) { + clearInterval(wx.timer) + } + wx.timer = setInterval(() => { + this.setData({ + saveTime: this.data.saveTime - 1 + }) + if (this.data.saveTime == 0) { + this.saveMockData() + } + }, 1000) + } }, /** @@ -122,7 +136,12 @@ goBack() { wx.navigateBack(); }, - + //璁剧疆鑳屾櫙鑹� + changeBGColor(e) { + this.setData({ + isNight: e.detail.value + }) + }, // 鑾峰彇淇濆瓨鐨勫�掕鏃舵椂闂� getSavedTime() { const savedTime = wx.getStorageSync('countdownTime') @@ -207,12 +226,17 @@ questionList.forEach(item => { if (item.id == id) { item.userAnswer = radioChecked + item.isUserAnswer = this.isHaveAnswer(radioChecked) } }) this.setData({ questionDataList: questionList }) - console.log(this.data.questionDataList); + if (this.data.answerType == 'mock') { + this.setData({ + saveTime: 20 + }) + } }, // 杈撳叆妗嗚Е鍙� onChangeInput(e) { @@ -222,13 +246,18 @@ const questionList = this.data.questionDataList questionList.forEach(item => { if (item.id == id) { - item.userAnswer[index] = inputData + item.userAnswer[index] = inputData, + item.isUserAnswer = this.isHaveAnswer(item.userAnswer) } }) this.setData({ questionDataList: questionList }) - console.log(this.data.questionDataList); + if (this.data.answerType == 'mock') { + this.setData({ + saveTime: 20 + }) + } }, // 鏁扮粍杞负瀛楃涓叉柟娉� arrayToString(data) { @@ -267,23 +296,61 @@ this.setData({ submitStatus: true }) + const child = this.selectComponent('#question-options') + if (this.data.answerType == 'option' || this.data.answerType == 'errorQuestion' || this.data.answerType == 'mock') { + // 鍏堥亶鍘嗘墍鏈夐鐩紝灏嗘湭鎵规敼鐨勯鐩壒鏀� + const qustionList = this.data.questionDataList + for (let index = 0; index < qustionList.length; index++) { + const item = qustionList[index]; + if (!item.isComplete) this.handleQuestion(index + 1) + } + } if (this.data.answerType == 'option') { this.toggleCountdown() - const child = this.selectComponent('#question-options') - if (this.data.answerType == 'option' || this.data.answerType == 'errorQuestion') { - // 鍏堥亶鍘嗘墍鏈夐鐩紝灏嗘湭鎵规敼鐨勯鐩壒鏀� - const qustionList = this.data.questionDataList - for (let index = 0; index < qustionList.length; index++) { - const item = qustionList[index]; - if (!item.isComplete) this.handleQuestion(index + 1) - } - } - if (this.data.answerType == 'option') { - this.recordAnswerData() - child.openTestReportDialog() - } + this.recordAnswerData() + child.openTestReportDialog() } else if (this.data.answerType == 'collectQuestion' || this.data.answerType == 'errorQuestion') { this.goBack() + } else if (this.data.answerType == 'mock') { + this.toggleCountdown() + // 璁剧疆妯¤�冪姸鎬佷负宸插畬鎴� + const mockData = this.data.mockData + mockData.datas.forEach((item) => { + if (item.id == this.data.uuid) { + item.state = '3' + item.report = { + userScore: this.data.subjectiveNum + } + } + }) + this.setData({ + mockData: mockData, + submitStatus: true + }) + this.setMockInfo(mockData.datas) + // 璁板綍鐢ㄦ埛绛旈鏁版嵁 + let saveData = [] + for (let index = 0; index < this.data.questionDataList.length; index++) { + const item = this.data.questionDataList[index]; + saveData.push({ + id: item.id, + answer: item.userAnswer, + isRight: item.isRight + }) + } + app.MG.identity.setUserKey({ + setKeyRequests: [ + { + domain: 'mockAnswerData', + key: this.data.uuid, + value: JSON.stringify({ + time: this.data.countdownTime, + answerData: saveData + }) + } + ] + }) + child.openTestReportDialog() } }, @@ -342,7 +409,14 @@ 'mockData.sumTime': oldMockData.time, cardList: oldQuestionList }) - + } + if (oldMockData.state == '0' || oldMockData.state == '1' || oldMockData.state == '2') { + this.startCountdown() + } + if (oldMockData.state == '3') { + this.setData({ + submitStatus: true + }) } } }) @@ -377,9 +451,9 @@ setKeyRequests: [ { domain: 'mockAnswerData', - key: route.query.uuid, + key: this.data.uuid, value: JSON.stringify({ - time: countDownRef.value.countdownTime, + time: this.data.countdownTime, answerData: [] }) } @@ -542,6 +616,7 @@ item.Embedded_QuestionBank_QuestionType == 'multipleChoice' ? [] : '', + isUserAnswer: oldObj ? this.isHaveAnswer(oldObj.userAnswer) : false, isRight: oldObj ? oldObj.isRight : null, isComplete: oldObj ? oldObj.isComplete : false, isCollect: this.data.collectList.indexOf(item.id) > -1 ? true : false, @@ -623,7 +698,7 @@ aitem.infoList.forEach((bitem, bindex) => { questionList.push(bitem) bitem.number = bindex + 1 - bitem.grade = 2 + bitem.score = 2 }) }) this.setData({ @@ -685,13 +760,13 @@ if (item.questionType != 'shortAnswer') { this.setData({ subjectiveTotal: this.data.subjectiveTotal + 1, - subjectiveGrade: this.data.subjectiveGrade + item.grade + subjectiveGrade: this.data.subjectiveGrade + item.score }) } if (questionList[index].isRight && item.questionType != 'shortAnswer') { // 瀹㈣棰樺洖绛旀纭� this.setData({ - subjectiveNum: this.data.subjectiveNum + item.grade, + subjectiveNum: this.data.subjectiveNum + item.score, correctNum: this.data.correctNum + 1 }) } @@ -725,6 +800,7 @@ console.log(res) }) } + this.setData({ questionDataList: questionList }) @@ -1180,11 +1256,13 @@ }) try { this.setData({ - 'mockData.time': JSON.parse(configRes.config).time * 1000 + 'mockData.time': JSON.parse(configRes.config).time * 1000, + countdownTime: JSON.parse(configRes.config).time * 1000 }) } catch (error) { this.setData({ - 'mockData.time': 3600 * 1000 + 'mockData.time': 3600 * 1000, + countdownTime: 3600 * 1000, }) } this.setData({ @@ -1202,7 +1280,7 @@ numberIndex++ return { number: numberIndex, - itemId: idItem.id, + id: idItem.id, score: idItem.score } }) @@ -1216,7 +1294,7 @@ numberIndex++ return { number: numberIndex, - itemId: extractCmsItem.id, + id: extractCmsItem.id, score: extractCmsItem.score } }) @@ -1252,7 +1330,146 @@ await this.getMockDataList(this.data.cardList) // 璇锋眰棰樼洰鏁版嵁 }) }, - + // 鑾峰彇缁勫嵎棰樼洰鍒楄〃 + async getMockDataList(questionList, oldList) { + console.log(questionList, oldList); + const questionDataList = this.data.questionDataList + questionList.forEach(async (pathitem, pathindex) => { + let itemIds = [] + pathitem.infoList.forEach(item => { + itemIds.push(item.id + '') + }) + let query = { + path: '*', + cmsPath: this.data.rootCmsItemId, + cmsType: '*', + productId: this.data.bookId, + queryType: '*', + itemIds, + itemFields: { + Embedded_QuestionBank_Stem: [], + Embedded_QuestionBank_AnalysisCon: [], + Embedded_QuestionBank_Answer: [], + Embedded_QuestionBank_Option: [], + Embedded_QuestionBank_QuestionType: [], + Embedded_QuestionBank_StemStyle: [], + Embedded_QuestionBank_OptionStyle: [], + Embedded_QuestionBank_KnowledgePoint: [], + Embedded_QuestionBank_Difficulty: [] + } + } + await app.MG.store.getProductDetail(query).then((res) => { + res.datas.cmsDatas[0].datas.forEach((item, index) => { + // 寰幆questionList,缁欐瘡棰樿祴鍊煎垎鏁� + let oldObj + if (oldList) oldObj = oldList.find((oldItem) => oldItem.id == item.id) + let questionObj = { + // number: pathitem.infoList.find(infoItem => infoItem.itemId == item.id).number, + id: item.id, + score: pathitem.infoList.find(infoItem => infoItem.id == item.id).score, + stem: + item.Embedded_QuestionBank_QuestionType == 'completion' + ? JSON.parse(item.Embedded_QuestionBank_Stem) + .stemTxt.replaceAll('<vacancy>', ',input,') + .split(',') + : JSON.parse(item.Embedded_QuestionBank_Stem), // 棰樺共 + answer: item.Embedded_QuestionBank_Answer, // 绛旀 + option: item.Embedded_QuestionBank_Option + ? JSON.parse(item.Embedded_QuestionBank_Option) + : '', // 閫夋嫨棰橀�夐」 + analysisCon: item.Embedded_QuestionBank_AnalysisCon, // 瑙f瀽 + questionType: item.Embedded_QuestionBank_QuestionType, // 棰樺瀷 + optionStyle: item.Embedded_QuestionBank_OptionStyle, // 閫夐」鏄剧ず绫诲瀷 + stemStyle: item.Embedded_QuestionBank_StemStyle, // 棰樺共鏄剧ず绫诲瀷 + difficulty: item.Embedded_QuestionBank_Difficulty + ? 4 - item.Embedded_QuestionBank_Difficulty + : 0, // 闅惧害绛夌骇 + userAnswer: oldObj + ? oldObj.answer + : item.Embedded_QuestionBank_QuestionType == 'completion' || + item.Embedded_QuestionBank_QuestionType == 'multipleChoice' + ? [] + : '', + isUserAnswer: oldObj ? this.isHaveAnswer(oldObj.userAnswer) : false, + isRight: oldObj ? oldObj.isRight : null, + // isComplete: oldObj ? oldObj.isComplete : false, + isComplete: this.data.mockData.state == '3' ? true : oldObj ? this.isHaveAnswer(oldObj.answer) : false, + isCollect: this.data.collectList.indexOf(item.id) > -1 ? true : false, + isUnfold: '' // 鎺у埗瑙f瀽鐨勬姌鍙犻潰鏉挎槸鍚﹀睍寮� + } + // 澶氶�夊拰濉┖绛旀鑲负鏁扮粍锛岃杞崲JSON鏍煎紡 + if ( + questionObj.questionType == 'completion' || + questionObj.questionType == 'multipleChoice' + ) { + try { + questionObj.answer = JSON.parse(questionObj.answer) + } catch (error) { + questionObj.answer = item.Embedded_QuestionBank_Answer + } + } + // 濉┖棰樻敼閫� + if (questionObj.questionType == 'completion') { + let index = 0 + for (let i = 0; i < questionObj.stem.length; i++) { + const item = questionObj.stem[i] + if (item == 'input') { + questionObj.stem[i] = { + num: index, + data: 'input' + } + if (!oldObj) questionObj.userAnswer[index] = '' + index++ + } + } + } + // 鑾峰彇鍥剧墖 + if (questionObj.stemStyle == 'Image' || questionObj.stemStyle == 'TxtAndImage') { + questionObj.stem.stemImage = getPublicImage(questionObj.stem.stemImage, 150) + } + if (questionObj.optionStyle == 'Image' || questionObj.optionStyle == 'TxtAndImage') { + questionObj.option.forEach(optionItem => { + if (optionItem.img) optionItem.img = getPublicImage(optionItem.img, 150) + }) + } + if (oldObj && oldObj.isRight) { + this.setData({ + correctNum: this.data.correctNum + 1 + }) + } + if (item.questionType != 'shortAnswer' && item.isComplete) { + this.setData({ + subjectiveTotal: this.data.subjectiveTotal + 1 + }) + } + // if (oldObj && isHaveAnswer(oldObj.answer)) countDownRef.value.changeAlready() + // cardList璧嬪�� + let cardIndex = this.data.cardList.findIndex((item) => item.catalogName == pathitem.catalogName) + let infoIndex = this.data.cardList[cardIndex].infoList.findIndex(infoItem => infoItem.id == item.id) + this.setData({ + [`cardList[${cardIndex}].infoList[${infoIndex}]`]: questionObj + }) + let questionList = [] + const cardUpdatedList = this.data.cardList + // if (flag == this.data.idPathList.length) { + cardUpdatedList.forEach(aitem => { + aitem.infoList.forEach((bitem, bindex) => { + questionList.push(bitem) + bitem.number = bindex + 1 + }) + }) + this.setData({ + questionDataList: questionList, + cardList: cardUpdatedList + }) + }) + }) + }) + this.setData({ + // questionDataList: questionDataList, + loading: false + }) + }, // 鑾峰彇缁勫嵎鏁版嵁 getMockInfo(callback) { app.MG.identity @@ -1316,136 +1533,67 @@ .then((res) => { if (res[0]) { this.setData({ - 'mockData.time': JSON.parse(res[0].value).timem, + currentIndex: JSON.parse(res[0].value).currentIndex, + 'mockData.time': JSON.parse(res[0].value).time, + countdownTime: JSON.parse(res[0].value).time ? JSON.parse(res[0].value).time : this.data.mockData.sumTime, 'mockData.answer': JSON.parse(res[0].value).answerData }) + console.log(JSON.parse(res[0].value)); data = JSON.parse(res[0].value).answerData } }) return data }, - // 缁勫嵎鑾峰彇棰樼洰鍒楄〃 - async getMockDataList(questionList, oldList) { - const questionDataList = this.data.questionDataList - questionList.forEach(async (pathitem, pathindex) => { - let itemIds = [] - pathitem.infoList.forEach(item => { - itemIds.push(item.itemId + '') - }) - let query = { - path: '*', - cmsPath: this.data.rootCmsItemId, - cmsType: '*', - productId: this.data.bookId, - queryType: '*', - itemIds, - itemFields: { - Embedded_QuestionBank_Stem: [], - Embedded_QuestionBank_AnalysisCon: [], - Embedded_QuestionBank_Answer: [], - Embedded_QuestionBank_Option: [], - Embedded_QuestionBank_QuestionType: [], - Embedded_QuestionBank_StemStyle: [], - Embedded_QuestionBank_OptionStyle: [], - Embedded_QuestionBank_KnowledgePoint: [], - Embedded_QuestionBank_Difficulty: [] + + // 璁板綍妯¤�冪瓟棰樻暟鎹� + saveMockData() { + const data = this.data.mockData.datas.find((itme) => itme.id == this.data.uuid) + if (data.state == '3') return true + const saveData = this.data.mockData.answer + for (let i = 0; i < this.data.questionDataList.length; i++) { + const item = this.data.questionDataList[i] + if (this.isHaveAnswer(item.userAnswer)) { + const index = saveData.findIndex((saveitem) => saveitem.id == item.id) + if (index + '' != '-1') { + saveData[index].answer = item.userAnswer + } else { + saveData.push({ + id: item.id, + answer: item.userAnswer + }) } } - await app.MG.store.getProductDetail(query).then((res) => { - res.datas.cmsDatas[0].datas.forEach((item, index) => { - // 寰幆questionList,缁欐瘡棰樿祴鍊煎垎鏁� - let oldObj - if (oldList) oldObj = oldList.find((oldItem) => oldItem.id == item.id) - let questionObj = { - id: item.id, - stem: - item.Embedded_QuestionBank_QuestionType == 'completion' - ? JSON.parse(item.Embedded_QuestionBank_Stem) - .stemTxt.replaceAll('<vacancy>', ',input,') - .split(',') - : JSON.parse(item.Embedded_QuestionBank_Stem), // 棰樺共 - answer: item.Embedded_QuestionBank_Answer, // 绛旀 - option: item.Embedded_QuestionBank_Option - ? JSON.parse(item.Embedded_QuestionBank_Option) - : '', // 閫夋嫨棰橀�夐」 - analysisCon: item.Embedded_QuestionBank_AnalysisCon, // 瑙f瀽 - questionType: item.Embedded_QuestionBank_QuestionType, // 棰樺瀷 - optionStyle: item.Embedded_QuestionBank_OptionStyle, // 閫夐」鏄剧ず绫诲瀷 - stemStyle: item.Embedded_QuestionBank_StemStyle, // 棰樺共鏄剧ず绫诲瀷 - difficulty: item.Embedded_QuestionBank_Difficulty - ? 4 - item.Embedded_QuestionBank_Difficulty - : 0, // 闅惧害绛夌骇 - userAnswer: oldObj - ? oldObj.answer - : item.Embedded_QuestionBank_QuestionType == 'completion' || - item.Embedded_QuestionBank_QuestionType == 'multipleChoice' - ? [] - : '', - isRight: oldObj ? oldObj.isRight : null, - // isComplete: oldObj ? oldObj.isComplete : false, - isComplete: oldObj ? oldObj.isComplete : false, - isCollect: this.data.collectList.indexOf(item.id) > -1 ? true : false, - isUnfold: '' // 鎺у埗瑙f瀽鐨勬姌鍙犻潰鏉挎槸鍚﹀睍寮� - } - const cardList = this.data.cardList - for (let a = 0; a < cardList.length; a++) { - const cardItem = cardList[a]; - for (let b = 0; b < cardItem.infoList.length; b++) { - if (cardItem.infoList[b].itemId == item.id) { - questionObj.number = cardItem.infoList[b].number; - questionObj.score = cardItem.infoList[b].score; - cardItem.infoList[b] = obj; - } - } - } - this.setData({ - cardList: cardList - }) - // 澶氶�夊拰濉┖绛旀鑲负鏁扮粍锛岃杞崲JSON鏍煎紡 - if ( - questionObj.questionType == 'completion' || - questionObj.questionType == 'multipleChoice' - ) { - try { - questionObj.answer = JSON.parse(questionObj.answer) - } catch (error) { - questionObj.answer = item.Embedded_QuestionBank_Answer - } - } - // 濉┖棰樻敼閫� - if (questionObj.questionType == 'completion') { - let index = 0 - for (let i = 0; i < questionObj.stem.length; i++) { - const item = questionObj.stem[i] - if (item == 'input') { - questionObj.stem[i] = { - num: index, - data: 'input' - } - if (!oldObj) questionObj.userAnswer[index] = '' - index++ - } - } - } - if (oldObj && oldObj.isRight) { - this.setData({ - correctNum: this.data.correctNum + 1 - }) - } - if (item.questionType != 'shortAnswer') { - this.setData({ - subjectiveTotal: this.data.subjectiveTotal + 1 - }) - } - // if (oldObj && isHaveAnswer(oldObj.answer)) countDownRef.value.changeAlready() - questionDataList.push(questionObj) - }) + } + // + if (this.data.mockData.state == '1') { + const datas = this.data.mockData.datas + datas.forEach((item) => { + if (item.id == this.data.uuid) { + item.state = '2' + } }) - }) - - this.setData({ - questionDataList: questionDataList, - loading: false - }) + this.setMockInfo(datas) + } + // + app.MG.identity + .setUserKey({ + setKeyRequests: [ + { + domain: 'mockAnswerData', + key: this.data.uuid, + value: JSON.stringify({ + currentIndex: this.data.currentIndex, + time: this.data.countdownTime, + answerData: saveData + }) + } + ] + }) + .then((res) => { + this.setData({ + saveTime: 20 + }) + console.log('妯¤�冪瓟棰樻暟鎹凡璁板綍') + }) } }) \ No newline at end of file diff --git a/packageBookService/pages/bookServices/examination/examination.wxml b/packageBookService/pages/bookServices/examination/examination.wxml index 4c597a9..7e55aa7 100644 --- a/packageBookService/pages/bookServices/examination/examination.wxml +++ b/packageBookService/pages/bookServices/examination/examination.wxml @@ -26,6 +26,7 @@ <question-schedule wx:if="{{!loading}}" id="countDownRef" + isNight="{{isNight}}" answerType="{{answerType}}" countdownTime="{{countdownTime}}" currentIndex="{{currentIndex}}" @@ -34,6 +35,7 @@ ></question-schedule> <question-list wx:if="{{!loading}}" + isNight="{{isNight}}" currentIndex="{{currentIndex}}" questionList="{{questionDataList}}" submitStatus="{{submitStatus}}" @@ -55,6 +57,7 @@ <view class="page-bottom"> <question-options id="question-options" + isNight="{{isNight}}" submitStatus="{{submitStatus}}" answerType="{{answerType}}" countdownTime="{{countdownTime}}" @@ -65,9 +68,11 @@ subjectiveNum="{{subjectiveNum}}" subjectiveGrade="{{subjectiveGrade}}" correctNum="{{correctNum}}" + mockSumTime="{{mock.sumTime}}" bind:setCollect="setCollect" bind:submitPaper="submitPaper" bind:restart="restart" bind:goQuestion="goQuestion" + bind:changeBGColor="changeBGColor" ></question-options> </view> diff --git a/packageBookService/pages/bookServices/examination/examination.wxss b/packageBookService/pages/bookServices/examination/examination.wxss index d5798cf..d8a4efb 100644 --- a/packageBookService/pages/bookServices/examination/examination.wxss +++ b/packageBookService/pages/bookServices/examination/examination.wxss @@ -1,5 +1,6 @@ /* pages/examination/examination.wxss */ + .nacigationBar { display: flex; align-items: center; @@ -28,4 +29,14 @@ height: 78vh; padding: 20rpx; background-color: #F2F3F8; +} + +.daytime { + background-color: #fff; + color: #000; +} + +.night { + background-color: #000; + color: #fff; } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/examination/questionList/index.js b/packageBookService/pages/bookServices/examination/questionList/index.js index 49a40ba..dfb3b6e 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.js +++ b/packageBookService/pages/bookServices/examination/questionList/index.js @@ -15,6 +15,10 @@ currentIndex: { type: Number, value: 1 + }, + isNight:{ + type:Boolean, + value:false } }, created() { diff --git a/packageBookService/pages/bookServices/examination/questionList/index.wxml b/packageBookService/pages/bookServices/examination/questionList/index.wxml index 2314bd1..d776c40 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.wxml +++ b/packageBookService/pages/bookServices/examination/questionList/index.wxml @@ -1,63 +1,35 @@ <!--pages/bookServices/examination/questionList/index.wxml--> -<view class="question-list"> +<view class="question-list" style="background-color:{{isNight ? '#000' : '#fff'}}"> <!-- 棰樺瀷title --> - <view class="question-title" wx:if="{{questionList[showIndex].type}}"> - <text class="title-name">{{questionList[showIndex].type}}</text - ><text class="title-score">(姣忛{{questionList[showIndex].grade}}鍒�)</text> + <view class="question-title" wx:if="{{questionList[showIndex].type}}" style="background-color:{{isNight ? '#000' : '#fff'}}"> + <text class="title-name">{{questionList[showIndex].type}}</text><text class="title-score" style="color: {{isNight ? '#fff' : '#000'}};">(姣忛{{questionList[showIndex].score}}鍒�)</text> </view> <!-- 棰樼洰鍒楄〃 --> <swiper class="swiper" bind:change="changeSwiper" current="{{currentIndex}}"> <swiper-item wx:for="{{questionList}}" wx:key="{{item.id}}"> <!-- 棰樺共 --> - <view class="question-stem title-score"> + <view class="question-stem title-score" style="color: {{isNight ? '#fff' : '#000'}};"> <!-- 棰樺彿 --> <text>{{item.number}}.</text> <!-- 浠呮枃瀛� --> - <view - wx:if="{{item.stemStyle == 'Txt' && item.questionType != 'completion'}}" - >{{item.stem.stemTxt}}</view - > + <view wx:if="{{item.stemStyle == 'Txt' && item.questionType != 'completion'}}">{{item.stem.stemTxt}}</view> <!-- 浠呭浘鐗� --> <view wx:elif="{{item.stemStyle == 'Image'}}"> <t-image src="{{item.stem.stemImage}}" /> </view> <!-- 鍥剧墖鍔犳枃瀛� --> - <view - wx:elif="{{item.stemStyle == 'TxtAndImage'}}" - class="title-TxtAndImage" - > + <view wx:elif="{{item.stemStyle == 'TxtAndImage'}}" class="title-TxtAndImage"> <text>{{item.stem.stemTxt}}</text> <t-image src="{{item.stem.stemImage}}"></t-image> </view> <!-- 瀵屾枃鏈� --> - <view - wx:elif="{{item.stemStyle == 'RichText'}} " - class="title-RichText" - > + <view wx:elif="{{item.stemStyle == 'RichText'}} " class="title-RichText"> <rich-text nodes="{{item.stem.stemTxt}}"></rich-text> </view> <!-- 濉┖棰� --> <view wx:if="{{item.questionType == 'completion'}}"> - <view - class="completion-box" - wx:for="{{item.stem}}" - wx:for-item="inputItem" - wx:for-index="inputIndex" - wx:key="inputIndex" - > - <t-input - disabled="{{item.isComplete}}" - bind:change="onChangeInput" - data-value="{{item.option}}" - data-id="{{item.id}}" - data-index="{{inputItem.num}}" - class="title-input" - style="{{inputstyle}}" - placeholder-style="{{placeholderstyle}}" - wx:if="{{inputItem.data == 'input'}}" - placeholder="璇疯緭鍏ユ枃瀛�" - value="{{item.userAnswer[inputItem.num]}}" - ></t-input> + <view class="completion-box" wx:for="{{item.stem}}" wx:for-item="inputItem" wx:for-index="inputIndex" wx:key="inputIndex"> + <t-input disabled="{{item.isComplete}}" bind:change="onChangeInput" data-value="{{item.option}}" data-id="{{item.id}}" data-index="{{inputItem.num}}" class="title-input" style="{{inputstyle}}" placeholder-style="{{placeholderstyle}}" wx:if="{{inputItem.data == 'input'}}" placeholder="璇疯緭鍏ユ枃瀛�" value="{{item.userAnswer[inputItem.num]}}"></t-input> <text wx:else>{{inputItem}}</text> </view> </view> @@ -65,44 +37,19 @@ <!-- 绛旈鍖哄煙 --> <view class="question-answer"> <!-- 鍗曢�夐 --> - <t-radio-group - wx:if="{{item.questionType == 'singleChoice' || item.questionType == 'judge'}}" - defaultValue="{{item.userAnswer}}" - disabled="{{item.isComplete}}" - bind:change="onChangeRadio" - class="radio-group" - data-value="{{item.option}}" - data-id="{{item.id}}" - > - <view - wx:for="{{item.option}}" - wx:for-item="contentItem" - wx:for-index="contentIndex" - wx:key="contentIndex" - > - <t-radio - value="{{contentItem.value}}" - icon="none" - placement="right" - borderless - > - <view - class="radio-item {{item.answer == contentItem.value && item.answer == item.userAnswer ? 'radio-correct' : item.userAnswer == contentItem.value && item.userAnswer != item.answer ?'radio-error' :''}}" - > + <t-radio-group wx:if="{{item.questionType == 'singleChoice' || item.questionType == 'judge'}}" defaultValue="{{item.userAnswer}}" disabled="{{item.isComplete}}" bind:change="onChangeRadio" class="radio-group" data-value="{{item.option}}" data-id="{{item.id}}"> + <view wx:for="{{item.option}}" wx:for-item="contentItem" wx:for-index="contentIndex" wx:key="contentIndex"> + <t-radio value="{{contentItem.value}}" icon="none" placement="right" borderless style="color: {{isNight ? '#fff' : '#000'}}; background-color:{{isNight ? '#000' : '#fff'}}"> + <view class="radio-item {{item.answer == contentItem.value && item.answer == item.userAnswer ? 'radio-correct' : item.userAnswer == contentItem.value && item.userAnswer != item.answer ?'radio-error' :''}}" style="color: {{isNight ? '#fff' : '#000'}}; background-color:{{isNight ? '#000' : '#fff'}}"> <!-- 浠呮枃瀛� --> - <text wx:if="{{item.optionStyle == 'Txt'}}" - >{{contentItem.value}}銆亄{contentItem.txt}}</text - > + <text wx:if="{{item.optionStyle == 'Txt'}}">{{contentItem.value}}銆亄{contentItem.txt}}</text> <!-- 浠呭浘鐗� --> <view wx:if="{{item.optionStyle == 'Image'}}" class="fl-center"> <text>{{contentItem.value}}銆�</text> <t-image src="{{contentItem.img}}"></t-image> </view> <!-- 鏂囧瓧鍔犲浘鐗� --> - <view - wx:if="{{item.optionStyle == 'TxtAndImage'}}" - class="fl-center" - > + <view wx:if="{{item.optionStyle == 'TxtAndImage'}}" class="fl-center"> <text>{{contentItem.value}}銆�</text> <text>{{contentItem.txt}}</text> <t-image src="{{contentItem.img}}"></t-image> @@ -112,51 +59,25 @@ <text>{{contentItem.value}}銆�</text> <rich-text nodes="{{contentItem.txt}}"></rich-text> </view> - <text - wx:if="{{item.answer == contentItem.value && item.answer == item.userAnswer}}" - >瀵�</text - > - <text - wx:if="{{item.userAnswer == contentItem.value && item.userAnswer != item.answer}}" - >閿�</text - > + <text wx:if="{{item.answer == contentItem.value && item.answer == item.userAnswer}}">瀵�</text> + <text wx:if="{{item.userAnswer == contentItem.value && item.userAnswer != item.answer}}">閿�</text> </view> </t-radio> </view> </t-radio-group> <!-- 澶氶�夐 --> - <t-checkbox-group - disabled="{{item.isComplete}}" - class="checkbox-group" - wx:elif="{{item.questionType == 'multipleChoice'}}" - t-class="box" - borderless - bind:change="onChangeRadio" - data-value="{{item.option}}" - data-id="{{item.id}}" - defaultValue="{{item.userAnswer}}" - > - <view - wx:for="{{item.option}}" - wx:for-item="contentItem" - wx:for-index="contentIndex" - wx:key="contentIndex" - > + <t-checkbox-group disabled="{{item.isComplete}}" class="checkbox-group" wx:elif="{{item.questionType == 'multipleChoice'}}" t-class="box" borderless bind:change="onChangeRadio" data-value="{{item.option}}" data-id="{{item.id}}" defaultValue="{{item.userAnswer}}"> + <view wx:for="{{item.option}}" wx:for-item="contentItem" wx:for-index="contentIndex" wx:key="contentIndex"> <t-checkbox block="{{false}}" value="{{contentItem.value}}"> <!-- 浠呮枃瀛� --> - <text wx:if="{{item.optionStyle == 'Txt'}}" - >{{contentItem.value}}銆亄{contentItem.txt}}</text - > + <text wx:if="{{item.optionStyle == 'Txt'}}">{{contentItem.value}}銆亄{contentItem.txt}}</text> <!-- 浠呭浘鐗� --> <view wx:if="{{item.optionStyle == 'Image'}}" class="fl-center"> <text>{{contentItem.value}}銆�</text> <t-image src="{{contentItem.img}}"></t-image> </view> <!-- 鏂囧瓧鍔犲浘鐗� --> - <view - wx:if="{{item.optionStyle == 'TxtAndImage'}}" - class="fl-center" - > + <view wx:if="{{item.optionStyle == 'TxtAndImage'}}" class="fl-center"> <text>{{contentItem.value}}銆�</text> <text>{{contentItem.txt}}</text> <t-image src="{{contentItem.img}}"></t-image> @@ -170,43 +91,21 @@ </view> </t-checkbox-group> <!-- 绠�绛� 缈昏瘧 --> - <t-textarea - disabled="{{item.isComplete}}" - value="{{item.userAnswer}}" - bind:change="onChangeRadio" - data-value="{{item.option}}" - data-id="{{item.id}}" - class="option-textarea" - wx:elif="{{item.questionType == 'shortAnswer'}}" - t-class="external-class" - placeholder="璇疯緭鍏ユ枃瀛�" - bordered - maxlength="500" - disableDefaultPadding="{{true}}" - indicator - style="{{style}}" - /> + <t-textarea disabled="{{item.isComplete}}" value="{{item.userAnswer}}" bind:change="onChangeRadio" data-value="{{item.option}}" data-id="{{item.id}}" class="option-textarea" wx:elif="{{item.questionType == 'shortAnswer'}}" t-class="external-class" placeholder="璇疯緭鍏ユ枃瀛�" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="{{style}}" /> </view> <!-- 瑙f瀽 --> <view class="analysis" wx:if="{{item.isComplete}}"> <view class="analysis-answer"> <view class="answer-correct"> <text class="analysis-title-box">姝g‘绛旀锛�</text> - <rich-text - nodes="{{item.answer}}" - style="font-size: 40rpx" - ></rich-text> + <rich-text nodes="{{item.answer}}" style="font-size: 40rpx"></rich-text> </view> <view class="answer-error"> - <text class="analysis-title-box">鎮ㄧ殑绛旀锛�</text - ><text class="answer-text">{{item.userAnswer}}</text> + <text class="analysis-title-box">鎮ㄧ殑绛旀锛�</text><text class="answer-text">{{item.userAnswer}}</text> </view> </view> <view class="analysis-text" wx:if="{{item.analysisCon}}"> - 绛旀瑙f瀽锛�<rich-text - nodes="{{item.analysisCon}}" - class="analysis-content" - ></rich-text> + 绛旀瑙f瀽锛�<rich-text nodes="{{item.analysisCon}}" class="analysis-content"></rich-text> </view> </view> </swiper-item> @@ -214,4 +113,4 @@ <text>娌℃湁鏇村浜嗐�傘�傘��</text> </swiper-item> </swiper> -</view> +</view> \ No newline at end of file diff --git a/packageBookService/pages/bookServices/examination/questionOptions/index.js b/packageBookService/pages/bookServices/examination/questionOptions/index.js index 54aed63..49b4ac6 100644 --- a/packageBookService/pages/bookServices/examination/questionOptions/index.js +++ b/packageBookService/pages/bookServices/examination/questionOptions/index.js @@ -44,6 +44,10 @@ submitStatus: { type: Boolean, value: false + }, + mockSumTime: { + type: Number, + value: 0, } }, @@ -57,13 +61,19 @@ setUpPopup: false, testReportState: false, sliderValue: 0, - useTime: '' + useTime: '', + radioItem: 'daytime' }, observers: { "countdownTime": function (newValue, oldValue) { if (this.properties.answerType == 'option') { this.setData({ useTime: this.formatTime(2 * 60 * 60 * 1000 - this.properties.countdownTime) + }) + } + else if (this.properties.answerType == 'option') { + this.setData({ + useTime: this.formatTime(this.properties.mockSumTime - this.properties.countdownTime) }) } if (newValue == 0 && (this.properties.answerType == 'option' || this.properties.answerType == 'mock')) { @@ -163,6 +173,14 @@ setUpPopup: e.detail.visible }) }, + // 璁剧疆妯″紡鍒囨崲 + onRadioChange(e) { + this.setData({ + radioItem: e.detail.value + }) + const value = e.detail.value == 'night' ? true : false + this.triggerEvent('changeBGColor', { value }) + }, // 閲嶅仛鎸夐挳 resterBtn() { wx.showModal({ @@ -203,23 +221,27 @@ // 搴曢儴鎻愪氦鎸夐挳 submitBtn() { // 鎴戠殑閿欓鍜屾敹钘� 鐩存帴璧版彁浜ら�昏緫 - if (this.properties.answerType !== 'option' || this.properties.answerType !== 'option') { - return this.submitPaper() - } - this.properties.questionDataList.forEach(item => { - if (!this.isHaveAnswer(item.userAnswer)) { - this.setData({ - noReady: this.data.noReady + 1 - }) - } - }) - // 鏈仛瀹岋紝鎵撳紑鎻愮ず寮圭獥 - if (this.data.noReady > 0) { - this.confrimPromptDialog() - } else { - // 鍋氬畬浜嗙洿鎺ユ墽琛屾彁浜や簨浠� + if (this.properties.answerType == 'collectQuestion' || this.properties.answerType == 'errorQuestion') { this.submitPaper() + return wx.navigateBack() + } else if (this.properties.answerType == 'option' || this.properties.answerType == 'mock') { + if (this.properties.submitStatus) return wx.navigateBack() + this.properties.questionDataList.forEach(item => { + if (!this.isHaveAnswer(item.userAnswer)) { + this.setData({ + noReady: this.data.noReady + 1 + }) + } + }) + // 鏈仛瀹岋紝鎵撳紑鎻愮ず寮圭獥 + if (this.data.noReady > 0) { + this.confrimPromptDialog() + } else { + // 鍋氬畬浜嗙洿鎺ユ墽琛屾彁浜や簨浠� + this.submitPaper() + } } + }, // 鎻愪氦浜嬩欢 submitPaper() { diff --git a/packageBookService/pages/bookServices/examination/questionOptions/index.json b/packageBookService/pages/bookServices/examination/questionOptions/index.json index 99a169b..8ed1f7c 100644 --- a/packageBookService/pages/bookServices/examination/questionOptions/index.json +++ b/packageBookService/pages/bookServices/examination/questionOptions/index.json @@ -6,6 +6,8 @@ "t-button": "tdesign-miniprogram/button/button", "t-dialog": "tdesign-miniprogram/dialog/dialog", "t-popup": "tdesign-miniprogram/popup/popup", - "t-slider": "tdesign-miniprogram/slider/slider" + "t-slider": "tdesign-miniprogram/slider/slider", + "t-radio": "tdesign-miniprogram/radio/radio", + "t-radio-group": "tdesign-miniprogram/radio-group/radio-group" } } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/examination/questionOptions/index.wxml b/packageBookService/pages/bookServices/examination/questionOptions/index.wxml index 1130cc8..ee23b79 100644 --- a/packageBookService/pages/bookServices/examination/questionOptions/index.wxml +++ b/packageBookService/pages/bookServices/examination/questionOptions/index.wxml @@ -1,48 +1,30 @@ <!--pages/bookServices/examination/questionOptions/index.wxml--> <view class="page-bottom"> <view class="li-option" bind:tap="setCollect"> - <t-image - src="{{ questionDataList[currentIndex].isCollect ? '/static/images/bookService/detail/collecting.png' : '/static/images/bookService/examination/collect.png'}}" - > + <t-image src="{{ questionDataList[currentIndex].isCollect ? '/static/images/bookService/detail/collecting.png' : '/static/images/bookService/examination/collect.png'}}"> </t-image> 鏀惰棌 </view> <view class="li-option" bind:tap="handlePopup"> - <t-image - src="/static/images/bookService/examination/questionCard.png" - ></t-image> + <t-image src="/static/images/bookService/examination/questionCard.png"></t-image> 绛旈鍗� </view> <view class="li-option" bind:tap="setUpBtn"> <t-image src="/static/images/bookService/examination/setting.png"></t-image> 璁剧疆 </view> - <view - class="li-option" - bind:tap="resterBtn" - wx:if="{{answerType == 'option' || answerType == 'mock'}}" - > + <view class="li-option" bind:tap="resterBtn" wx:if="{{answerType == 'option' || answerType == 'mock'}}"> <t-image src="/static/images/bookService/examination/reset.png"></t-image> 閲嶅仛 </view> <view class="bottom-submit"> - <t-button - theme="primary" - size="large" - style="{{btnStyle}}" - bind:tap="submitBtn" - >{{(answerType == 'option' || answerType == 'mock') ? '鎻愪氦' : - '閫�鍑�'}}</t-button - > + <t-button theme="primary" size="large" style="{{btnStyle}}" bind:tap="submitBtn">{{(answerType == 'option' || answerType == 'mock') && !submitStatus ? '鎻愪氦' : + '閫�鍑�'}}</t-button> </view> </view> <!-- 绛旈鍗� --> -<t-popup - visible="{{questionCardState}}" - bind:visible-change="onVisibleChange" - placement="bottom" -> +<t-popup visible="{{questionCardState}}" bind:visible-change="onVisibleChange" placement="bottom"> <view class="popup-block"> <view class="popup-header"> <view class="popup-title">绛旈鍗�</view> @@ -65,14 +47,7 @@ <text class="title-text">{{item.catalogName}}</text> </view> <view class="question-list"> - <view - bind:tap="goQuestion" - data-id="{{citem.id}}" - wx:for="{{item.infoList}}" - wx:for-item="citem" - wx:for-index="cindex" - class="question-box {{citem.isComplete ? 'answered' : 'un-answered'}}" - > + <view bind:tap="goQuestion" data-id="{{citem.id}}" wx:for="{{item.infoList}}" wx:for-item="citem" wx:for-index="cindex" class="question-box {{citem.isUserAnswer ? 'answered' : 'un-answered'}}"> {{citem.number}} </view> </view> @@ -82,34 +57,47 @@ </t-popup> <!-- 璁剧疆 --> -<t-popup - visible="{{setUpPopup}}" - bind:visible-change="onSetUpChange" - placement="bottom" -> +<t-popup visible="{{setUpPopup}}" bind:visible-change="onSetUpChange" placement="bottom"> <view class="popup-block set-up-popup"> <view class="popup-header"> <view class="popup-title">璁剧疆</view> </view> <!-- 浜害 --> - <view> - <t-slider defaultValue="{{30}}" theme="capsule" /> + <view class="brightness"> + <text>A-</text> + <view class="brightness-slider"> + <t-slider defaultValue="{{30}}" theme="capsule" /> + </view> + + <text>A+</text> </view> <!-- 妯″紡 --> + <view> + <t-radio-group class="test-radio" t-class="horizontal-box" value="{{radioItem}}" bind:change="onRadioChange" style="margin: 0px"> + <view class="card {{radioItem == 'daytime' ? 'card--active' : ''}}"> + <t-radio value="daytime" icon="none" borderless> + <view class="radio-content" slot="content"> + <t-image src="{{ radioItem == 'daytime' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}"></t-image> + <text style="color: {{radioItem == 'daytime' ? '#fff':''}};">鏃ラ棿妯″紡</text> + </view> + </t-radio> + </view> + <view class="card {{radioItem == 'night' ? 'card--active' : ''}}"> + <t-radio value="night" icon="none" borderless> + <view class="radio-content" slot="content"> + <t-image src="{{ radioItem == 'night' ? '/static/images/bookService/detail/practice-icon.png' : '/static/images/bookService/detail/notest.png'}}"></t-image> + <text style="color: {{radioItem == 'night' ? '#fff':''}};">澶滈棿妯″紡</text> + </view> + </t-radio> + </view> + </t-radio-group> + </view> </view> </t-popup> <!-- 娴嬭瘯鎶ュ憡 --> -<t-dialog - class="test-report" - visible="{{testReportState}}" - cancel-btn="{{null}}" - confirm-btn="{{null}}" - close-btn="{{true}}" - title="娴嬭瘯鎶ュ憡" - bind:close="closeTestReportDialog" -> +<t-dialog class="test-report" visible="{{testReportState}}" cancel-btn="{{null}}" confirm-btn="{{null}}" close-btn="{{true}}" title="娴嬭瘯鎶ュ憡" bind:close="closeTestReportDialog"> <view slot="content" class="test-report"> <view class="report-content-top"> <view class="report-li"> @@ -122,34 +110,24 @@ </view> <view class="report-li"> <view class="report-li-left">鍏朵腑瀹㈣棰橈細</view> - <view class="report-li-right" - >{{subjectiveTotal}}閬擄紝鍒嗗�納{subjectiveGrade}}鍒�</view - > + <view class="report-li-right">{{subjectiveTotal}}閬擄紝鍒嗗�納{subjectiveGrade}}鍒�</view> </view> <view class="report-li"> <view class="report-li-left">绛斿锛�</view> - <view class="report-li-right" - ><text class="correct-color">{{correctNum}}</text> 閬�</view - > + <view class="report-li-right"><text class="correct-color">{{correctNum}}</text> 閬�</view> </view> <view class="report-li"> <view class="report-li-left">绛旈敊锛�</view> - <view class="report-li-right" - ><text class="error-color">{{subjectiveTotal - correctNum}}</text> - 閬�</view - > + <view class="report-li-right"><text class="error-color">{{subjectiveTotal - correctNum}}</text> + 閬�</view> </view> <view class="report-li"> <view class="report-li-left">瀹㈣棰樺緱鍒嗭細</view> - <view class="report-li-right" - ><text class="score-color">{{subjectiveNum}}</text> 鍒�</view - > + <view class="report-li-right"><text class="score-color">{{subjectiveNum}}</text> 鍒�</view> </view> </view> <view class="report-content-bottom"> - <t-button theme="primary" bind:tap="viewAnswer" style="width: 560rpx" - >鏌ョ湅绛旀涓庤В鏋�</t-button - > + <t-button theme="primary" bind:tap="viewAnswer" style="width: 560rpx">鏌ョ湅绛旀涓庤В鏋�</t-button> </view> </view> -</t-dialog> +</t-dialog> \ No newline at end of file diff --git a/packageBookService/pages/bookServices/examination/questionOptions/index.wxss b/packageBookService/pages/bookServices/examination/questionOptions/index.wxss index d1c5f70..50a6e03 100644 --- a/packageBookService/pages/bookServices/examination/questionOptions/index.wxss +++ b/packageBookService/pages/bookServices/examination/questionOptions/index.wxss @@ -184,4 +184,53 @@ .score-color { color: #ff6c00; +} + +.brightness { + display: flex; + justify-content: space-evenly; + align-items: center; + margin-bottom: 40rpx; +} + +.brightness-slider { + width: 80%; +} + +.test-radio { + height: 80rpx; + display: flex; + justify-content: space-evenly; + --td-radio-content-font-size: 28rpx; + --td-radio-vertical-padding: 0 +} + +.test-radio image { + width: 34rpx; + height: 34rpx; +} + +.card { + position: relative; + border-radius: 10rpx; + overflow: hidden; + box-sizing: border-box; + /* border: 3rpx solid #ff6c00; */ + --td-radio-content-color: #0F1214; + --td-radio-bg-color: #EFF0F1; + +} + +.card--active { + border-color: #ff6c00; + --td-radio-bg-color: #ff6c00; + --td-radio-content-color: #fff; +} + +.radio-content { + display: flex; + align-items: center; + justify-content: center; + width: 300rpx; + height: 68rpx; } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/examination/questionSchedule/index.js b/packageBookService/pages/bookServices/examination/questionSchedule/index.js index 311ed8a..458b052 100644 --- a/packageBookService/pages/bookServices/examination/questionSchedule/index.js +++ b/packageBookService/pages/bookServices/examination/questionSchedule/index.js @@ -24,9 +24,15 @@ answerType: { type: String, value: '' + }, + isNight:{ + type:Boolean, + value:false } }, - created() { + created( + + ) { }, detached() { }, @@ -37,7 +43,8 @@ data: { showTime: '', // percentage: 0, - ready: 0 + ready: 0, + scheduleStyle: 'back', }, observers: { 'countdownTime': function (newValue) { @@ -58,12 +65,19 @@ }) } } + }, + 'ready': function (newValue) { + this.setData({ + percentage: (this.data.ready / this.data.questionList.length) * 100 + }) } }, /** * 缁勪欢鐨勬柟娉曞垪琛� */ methods: { + // 澶滈棿鍜屾棩闂存ā寮� + // 鍒ゆ柇鏄惁鏈夌敤鎴风瓟妗� isHaveAnswer(data) { if (typeof data == 'string') { diff --git a/packageBookService/pages/bookServices/examination/questionSchedule/index.wxml b/packageBookService/pages/bookServices/examination/questionSchedule/index.wxml index c7cad08..ac5ebbf 100644 --- a/packageBookService/pages/bookServices/examination/questionSchedule/index.wxml +++ b/packageBookService/pages/bookServices/examination/questionSchedule/index.wxml @@ -1,17 +1,12 @@ <!--pages/bookServices/examination/questionSchedule/questionSchedule.wxml--> -<view class="schedule"> +<view class="schedule" id="schedule" style="background-color:{{isNight ? '#000' : '#fff'}}"> <view class="schedule-top"> - <view class="question-schedule" - >绛旈杩涘害<text class="parimary-color question-num">{{ready}}</text> - <text>/{{questionList.length}}</text></view - > - <view - class="remainder" - wx:if="{{!submitStatus && (answerType == 'option' || answerType == 'mock')}}" - >鍓╀綑鏃堕棿 <text class="parimary-color">{{showTime}}</text></view - > + <view class="question-schedule" style="color: {{isNight ? '#fff' : '#000'}};">绛旈杩涘害<text class="parimary-color question-num">{{ready}}</text> + <text>/{{questionList.length}}</text> + </view> + <view class="remainder" wx:if="{{!submitStatus && (answerType == 'option' || answerType == 'mock')}}" style="color: {{isNight ? '#fff' : '#000'}};">鍓╀綑鏃堕棿 <text class="parimary-color">{{showTime}}</text></view> </view> <view class="schedule-progress"> <t-progress percentage="{{percentage}}" color="#ff6c00" label="" /> </view> -</view> +</view> \ No newline at end of file diff --git a/static/images/bookService/examination/rijian.png b/static/images/bookService/examination/rijian.png new file mode 100644 index 0000000..3080ac1 --- /dev/null +++ b/static/images/bookService/examination/rijian.png Binary files differ diff --git a/static/images/bookService/examination/yejian.png b/static/images/bookService/examination/yejian.png new file mode 100644 index 0000000..86a0c05 --- /dev/null +++ b/static/images/bookService/examination/yejian.png Binary files differ -- Gitblit v1.9.1