From 1e9c2bd06ab6851ed85b883c62cb7d74e012e2b2 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期五, 29 三月 2024 15:10:20 +0800 Subject: [PATCH] 答题器bug修改,安装my-html插件 --- packageBookService/pages/bookServices/examination/questionList/index.wxss | 32 ++ packageBookService/pages/bookServices/examination/questionList/index.wxml | 43 ++- packageBookService/pages/bookServices/examination/examination.js | 340 +++++++++++++----------------- package.json | 3 packageBookService/pages/bookServices/list/index.js | 34 ++ packageBookService/pages/bookServices/examination/questionList/index.json | 3 packageDomain/pages/resourceDetails/myAudio/index.wxml | 194 +++++++++++++--- 7 files changed, 376 insertions(+), 273 deletions(-) diff --git a/package.json b/package.json index afcd516..eadb51a 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "dependencies": { "epub.js": "^0.2.15", "moment": "^2.30.1", + "mp-html": "^2.4.3", "spark-md5": "^3.0.2", "tdesign-miniprogram": "^1.0.0", "tslib": "^1.11.1" @@ -44,4 +45,4 @@ "lint-staged": "^10.0.8", "prettier": "^2.1.2" } -} \ No newline at end of file +} diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js index 0762452..196a0ce 100644 --- a/packageBookService/pages/bookServices/examination/examination.js +++ b/packageBookService/pages/bookServices/examination/examination.js @@ -1,4 +1,6 @@ -import { getPublicImage } from '../../../../assets/js/middleGround/tool' +import { + getPublicImage +} from '../../../../assets/js/middleGround/tool' const app = getApp() Page({ @@ -9,26 +11,26 @@ barHeight: "", navBarHeight: "", loading: false, - answerTitle: "", // 瀵艰埅鏍忔爣棰� - countdownInterval: null, // 璁℃椂鍣� + answerTitle: "", // 瀵艰埅鏍忔爣棰� + countdownInterval: null, // 璁℃椂鍣� isCountdownRunning: true, // 鏄惁鍊掕鏃� - countdownTime: 0, // 鍊掕鏃舵椂闂� + countdownTime: 0, // 鍊掕鏃舵椂闂� bookId: "", productLinkPath: "", rootCmsItemId: "", - idPathList: [], // 棰樼洰鍒楄〃 - answerType: "", // 绛旈妯″紡 - submitStatus: false, // 鎻愪氦鐘舵�� + idPathList: [], // 棰樼洰鍒楄〃 + answerType: "", // 绛旈妯″紡 + submitStatus: false, // 鎻愪氦鐘舵�� currentIndex: 0, // 褰撳墠鏄剧ず鐨勯鍙� - collectList: [], // 鏀惰棌棰樼洰鍒楄〃 - errorList: [], // 閿欓鍒楄〃 - subjectiveTotal: 0, // 瀹㈣棰樻�绘暟 + collectList: [], // 鏀惰棌棰樼洰鍒楄〃 + errorList: [], // 閿欓鍒楄〃 + subjectiveTotal: 0, // 瀹㈣棰樻�绘暟 subjectiveNum: 0, // 瀹㈣棰樺緱鍒� subjectiveGrade: 0, // 瀹㈣棰樻�诲垎 - correctNum: 0, // 姝g‘棰樼洰鏁伴噺 - total: 0, // 棰樼洰鎬绘暟 - cardList: [], // 鎻愪氦椤�, - questionDataList: [], // 鏄剧ず棰樼洰鍒楄〃 + correctNum: 0, // 姝g‘棰樼洰鏁伴噺 + total: 0, // 棰樼洰鎬绘暟 + cardList: [], // 鎻愪氦椤�, + questionDataList: [], // 鏄剧ず棰樼洰鍒楄〃 mockid: 0, uuid: 0, mockData: { @@ -84,8 +86,7 @@ /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ - onReady() { - }, + onReady() {}, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず @@ -149,8 +150,7 @@ /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� */ - onShareAppMessage() { - }, + onShareAppMessage() {}, // 鐩戝惉watch watch(context, variableName, callback) { @@ -438,16 +438,14 @@ }) } app.MG.identity.setUserKey({ - setKeyRequests: [ - { - domain: 'mockAnswerData', - key: this.data.uuid, - value: JSON.stringify({ - time: this.data.countdownTime, - answerData: saveData - }) - } - ] + setKeyRequests: [{ + domain: 'mockAnswerData', + key: this.data.uuid, + value: JSON.stringify({ + time: this.data.countdownTime, + answerData: saveData + }) + }] }) child.openTestReportDialog() } @@ -471,7 +469,7 @@ }) // 娴嬭瘯绛旈 await this.getCollectIdList() // 鑾峰彇鏀惰棌id鍒楄〃 - await this.getErrorList() // 鑾峰彇閿欓id鍒楄〃 + await this.getErrorList() // 鑾峰彇閿欓id鍒楄〃 } else if (this.data.answerType == 'collectQuestion') { this.setData({ submitStatus: true @@ -556,16 +554,14 @@ // 缁勫嵎妯″紡 // 娓呯┖绛旈璁板綍 await app.MG.identity.setUserKey({ - setKeyRequests: [ - { - domain: 'mockAnswerData', - key: this.data.uuid, - value: JSON.stringify({ - time: this.data.countdownTime, - answerData: [] - }) - } - ] + setKeyRequests: [{ + domain: 'mockAnswerData', + key: this.data.uuid, + value: JSON.stringify({ + time: this.data.countdownTime, + answerData: [] + }) + }] }) this.init() } else { @@ -588,8 +584,7 @@ this.setData({ collectList: JSON.parse(res[0].value) }) - } catch (error) { - } + } catch (error) {} if (this.data.answerType == 'option') { // 鍏堣幏鍙栫敤鎴风瓟棰樿褰� this.getAnswerInfo(async (res) => { @@ -637,8 +632,7 @@ this.setData({ errorList: JSON.parse(res[0].value) }) - } catch (error) { - } + } catch (error) {} }) }, // 鑾峰彇棰樺簱棰樼洰 @@ -703,29 +697,22 @@ // num: index, // 棰樺彿 id: item.id, type: pathitem.name, - stem: - item.Embedded_QuestionBank_QuestionType == 'completion' - ? JSON.parse(item.Embedded_QuestionBank_Stem) - .stemTxt.replaceAll('<vacancy>', ',input,') - .split(',') - : JSON.parse(item.Embedded_QuestionBank_Stem), // 棰樺共 + 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) - : '', // 閫夋嫨棰橀�夐」 + 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.userAnswer - : item.Embedded_QuestionBank_QuestionType == 'completion' || - item.Embedded_QuestionBank_QuestionType == 'multipleChoice' - ? [] - : '', + difficulty: item.Embedded_QuestionBank_Difficulty ? + 4 - item.Embedded_QuestionBank_Difficulty : 0, // 闅惧害绛夌骇 + userAnswer: oldObj ? + oldObj.userAnswer : 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, @@ -763,7 +750,7 @@ // 棰樺共瀵屾枃鏈鐞� if (questionObj.stemStyle == 'RichText') { // questionObj.option.txt = '' - questionObj.stem.stemTxt = questionObj.stem.stemTxt.replace(/\<img/gi, '<img class="stem-rich-img"').replace(/\<p/gi, '<p class="stem-rich-p"') + questionObj.stem.stemTxt = questionObj.stem.stemTxt.replace(/\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ').replace(/\<p/gi, '<p class="stem-rich-p"') } // 閫夐」瀵屾枃鏈鐞� @@ -912,13 +899,11 @@ // 璁板綍閿欓 app.MG.identity .setUserKey({ - setKeyRequests: [ - { - domain: 'errorData', - key: this.data.rootCmsItemId, - value: JSON.stringify(this.data.errorList) - } - ] + setKeyRequests: [{ + domain: 'errorData', + key: this.data.rootCmsItemId, + value: JSON.stringify(this.data.errorList) + }] }) .then((res) => { console.log(res) @@ -974,27 +959,23 @@ } app.MG.identity .setUserKey({ - setKeyRequests: [ - { - domain: 'collectData', - key: this.data.rootCmsItemId, - value: JSON.stringify(this.data.collectList) - } - ] + setKeyRequests: [{ + domain: 'collectData', + key: this.data.rootCmsItemId, + value: JSON.stringify(this.data.collectList) + }] }) - .then((res) => { }) + .then((res) => {}) }, // 澶勭悊绛旈鏁版嵁 recordAnswerData() { - this.data.cardList.push( - { - name: '瀹㈣棰樺緱鍒�', - score: this.data.subjectiveNum, - path: this.data.productLinkPath, - // infoList: [], - // catalogName: '' - } - ) + this.data.cardList.push({ + name: '瀹㈣棰樺緱鍒�', + score: this.data.subjectiveNum, + path: this.data.productLinkPath, + // infoList: [], + // catalogName: '' + }) let setInfoData = { currentIndex: this.data.currentIndex, dataList: JSON.parse(JSON.stringify(this.data.cardList)) @@ -1021,15 +1002,13 @@ setAnswerInfo(data) { app.MG.identity .setUserKey({ - setKeyRequests: [ - { - domain: 'answerData', - key: this.data.productLinkPath, - value: JSON.stringify(data) - } - ] + setKeyRequests: [{ + domain: 'answerData', + key: this.data.productLinkPath, + value: JSON.stringify(data) + }] }) - .then((res) => { }) + .then((res) => {}) }, // 鑾峰彇绛旈鏁版嵁 getAnswerInfo(callback) { @@ -1066,8 +1045,7 @@ collectList: JSON.parse(res[0].value) }) // total.value = collectList.value.length - } catch (error) { - } + } catch (error) {} if (this.data.collectList && this.data.collectList.length) { await this.getCollectDataList() } else { @@ -1076,8 +1054,8 @@ }) wx.showModal({ title: '鎻愮ず', - content: '鏀惰棌澶规殏鏃犳暟鎹�',//editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 - editable: false,//鏄惁鏄剧ず杈撳叆妗� + content: '鏀惰棌澶规殏鏃犳暟鎹�', //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + editable: false, //鏄惁鏄剧ず杈撳叆妗� showCancel: false, success: (res) => { if (res.confirm) { @@ -1096,12 +1074,10 @@ async getCollectDataList() { let questionArr = [] this.setData({ - cardList: [ - { - catalogName: '鏀惰棌澶�', - infoList: [] - } - ] + cardList: [{ + catalogName: '鏀惰棌澶�', + infoList: [] + }] }) let query = { path: '*', @@ -1128,28 +1104,21 @@ const questionObj = { number: index + 1, // 棰樺彿 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), // 棰樺共 + 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) - : '', // 閫夋嫨棰橀�夐」 + 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: - item.Embedded_QuestionBank_QuestionType == 'completion' || - item.Embedded_QuestionBank_QuestionType == 'multipleChoice' - ? [] - : '', + difficulty: item.Embedded_QuestionBank_Difficulty ? + 4 - item.Embedded_QuestionBank_Difficulty : 0, // 闅惧害绛夌骇 + userAnswer: item.Embedded_QuestionBank_QuestionType == 'completion' || + item.Embedded_QuestionBank_QuestionType == 'multipleChoice' ? [] : '', isSubmit: false, // 鏌ョ湅瑙f瀽 isRight: null, // 鏄惁姝g‘ isComplete: false, @@ -1224,8 +1193,7 @@ this.setData({ errorList: JSON.parse(res[0].value) }) - } catch (error) { - } + } catch (error) {} if (this.data.errorList && this.data.errorList.length) { this.getErrorDataList() } else { @@ -1234,8 +1202,8 @@ }) wx.showModal({ title: '鎻愮ず', - content: '閿欓闆嗘殏鏃犳暟鎹�',//editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 - editable: false,//鏄惁鏄剧ず杈撳叆妗� + content: '閿欓闆嗘殏鏃犳暟鎹�', //editable濡傛灉涓簍rue锛岃繖灏辨槸杈撳叆妗嗙殑鍐呭 + editable: false, //鏄惁鏄剧ず杈撳叆妗� showCancel: false, success: (res) => { if (res.confirm) { @@ -1252,12 +1220,10 @@ // 鑾峰彇閿欓闆� async getErrorDataList() { this.setData({ - cardList: [ - { - catalogName: '閿欓闆�', - infoList: [] - } - ] + cardList: [{ + catalogName: '閿欓闆�', + infoList: [] + }] }) let query = { path: '*', @@ -1284,28 +1250,21 @@ const questionObj = { number: index + 1, // 棰樺彿 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), // 棰樺共 + 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) - : '', // 閫夋嫨棰橀�夐」 + 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: - item.Embedded_QuestionBank_QuestionType == 'completion' || - item.Embedded_QuestionBank_QuestionType == 'multipleChoice' - ? [] - : '', + difficulty: item.Embedded_QuestionBank_Difficulty ? + 4 - item.Embedded_QuestionBank_Difficulty : 0, // 闅惧害绛夌骇 + userAnswer: item.Embedded_QuestionBank_QuestionType == 'completion' || + item.Embedded_QuestionBank_QuestionType == 'multipleChoice' ? [] : '', isSubmit: false, // 鏌ョ湅瑙f瀽 isRight: null, // 鏄惁姝g‘ isComplete: false, @@ -1400,7 +1359,10 @@ // 鑾峰彇蹇呭惈棰樼洰 let list = item.cmsItemList.map((idItem) => { itemIds.push(idItem.id + '') - questionIds.push({ id: idItem.id + '', score: idItem.score }) + questionIds.push({ + id: idItem.id + '', + score: idItem.score + }) numberIndex++ return { number: numberIndex, @@ -1414,7 +1376,10 @@ const extractItem = item.generatorResultList[i] let extractItemList = extractItem.cmsItemList.map((extractCmsItem) => { itemIds.push(extractCmsItem.id + '') - questionIds.push({ id: extractCmsItem.id + '', score: extractCmsItem.score }) + questionIds.push({ + id: extractCmsItem.id + '', + score: extractCmsItem.score + }) numberIndex++ return { number: numberIndex, @@ -1491,29 +1456,22 @@ // 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), // 棰樺共 + 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) - : '', // 閫夋嫨棰橀�夐」 + 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' - ? [] - : '', + 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, @@ -1550,7 +1508,7 @@ // 棰樺共瀵屾枃鏈鐞� if (questionObj.stemStyle == 'RichText') { // questionObj.option.txt = '' - questionObj.stem.stemTxt = questionObj.stem.stemTxt.replace(/\<img/gi, '<img class="stem-rich-img"') + questionObj.stem.stemTxt = questionObj.stem.stemTxt.replace(/\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img"') } // 閫夐」瀵屾枃鏈鐞� if (questionObj.optionStyle == 'RichText' && (questionObj.questionType == 'singleChoice' || questionObj.questionType == 'judge' || questionObj.questionType == 'multipleChoice')) { @@ -1617,26 +1575,22 @@ // 璁板綍璐拱缁勫嵎鏃堕棿 setMockInfo(data) { app.MG.identity.setUserKey({ - setKeyRequests: [ - { - domain: 'mockData', - key: this.data.bookId + '', - value: JSON.stringify(data) - } - ] + setKeyRequests: [{ + domain: 'mockData', + key: this.data.bookId + '', + value: JSON.stringify(data) + }] }) }, // 璁板綍缁勫嵎棰樼洰鍒楄〃 saveMockQuestionList(data) { app.MG.identity .setUserKey({ - setKeyRequests: [ - { - domain: 'mockQuestionData', - key: this.data.uuid, - value: JSON.stringify(data) - } - ] + setKeyRequests: [{ + domain: 'mockQuestionData', + key: this.data.uuid, + value: JSON.stringify(data) + }] }) .then((res) => { console.log('妯¤�冮鐩垪琛ㄥ凡璁板綍') @@ -1710,17 +1664,15 @@ // app.MG.identity .setUserKey({ - setKeyRequests: [ - { - domain: 'mockAnswerData', - key: this.data.uuid, - value: JSON.stringify({ - currentIndex: this.data.currentIndex, - time: this.data.countdownTime, - answerData: saveData - }) - } - ] + setKeyRequests: [{ + domain: 'mockAnswerData', + key: this.data.uuid, + value: JSON.stringify({ + currentIndex: this.data.currentIndex, + time: this.data.countdownTime, + answerData: saveData + }) + }] }) .then((res) => { this.setData({ diff --git a/packageBookService/pages/bookServices/examination/questionList/index.json b/packageBookService/pages/bookServices/examination/questionList/index.json index c2758c8..a447ca6 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.json +++ b/packageBookService/pages/bookServices/examination/questionList/index.json @@ -10,6 +10,7 @@ "t-checkbox": "tdesign-miniprogram/checkbox/checkbox", "t-checkbox-group": "tdesign-miniprogram/checkbox-group/checkbox-group", "t-textarea": "tdesign-miniprogram/textarea/textarea", - "t-empty": "tdesign-miniprogram/empty/empty" + "t-empty": "tdesign-miniprogram/empty/empty", + "mp-html": "mp-html" } } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/examination/questionList/index.wxml b/packageBookService/pages/bookServices/examination/questionList/index.wxml index 0a37b80..f866510 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.wxml +++ b/packageBookService/pages/bookServices/examination/questionList/index.wxml @@ -30,30 +30,25 @@ <text>{{item.number}}.</text> <!-- 浠呮枃瀛� --> <view + class="title-content" 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 wx:elif="{{item.stemStyle == 'Image'}}" class="title-content"> + <image src="{{item.stem.stemImage}}" mode="aspectFit" /> </view> <!-- 鍥剧墖鍔犳枃瀛� --> <view wx:elif="{{item.stemStyle == 'TxtAndImage'}}" - class="title-TxtAndImage" + class="title-content" > - <text>{{item.stem.stemTxt}}</text> - <t-image src="{{item.stem.stemImage}}" /> + <view>{{item.stem.stemTxt}}</view> + <image src="{{item.stem.stemImage}}" mode="aspectFit" /> </view> <!-- 瀵屾枃鏈� --> - <view - wx:elif="{{item.stemStyle == 'RichText'}} " - class="title-RichText" - > - <rich-text - nodes="{{item.stem.stemTxt}}" - style="height: 100%" - ></rich-text> + <view wx:elif="{{item.stemStyle == 'RichText'}} " class="title-content"> + <mp-html content="{{item.stem.stemTxt}}" /> </view> <!-- 濉┖棰� --> <view wx:if="{{item.questionType == 'completion'}}"> @@ -119,7 +114,7 @@ <!-- 浠呭浘鐗� --> <view wx:if="{{item.optionStyle == 'Image'}}" class="fl-center"> <text>{{contentItem.value}}銆�</text> - <t-image src="{{contentItem.img}}" /> + <image src="{{contentItem.img}}" mode="aspectFit" /> </view> <!-- 鏂囧瓧鍔犲浘鐗� --> <view @@ -127,8 +122,9 @@ class="fl-center" > <text>{{contentItem.value}}銆�</text> - <text>{{contentItem.txt}}</text> - <t-image src="{{contentItem.img}}" /> + <text class="radio-textimg">{{contentItem.txt}}</text> + + <image src="{{contentItem.img}}" mode="aspectFit" /> </view> <!-- 瀵屾枃鏈� --> <view @@ -174,7 +170,7 @@ <t-checkbox block="{{false}}" value="{{contentItem.value}}" - style="background-color:{{isNight ? '#222' :'#fff'}}; " + style="background-color:{{isNight ? '#222' :'#fff'}}; display: flex; align-items: center;" > <!-- 浠呮枃瀛� --> <text @@ -188,7 +184,7 @@ style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;" >{{contentItem.value}}銆�</text > - <t-image src="{{contentItem.img}}" /> + <image src="{{contentItem.img}}" mode="aspectFit" /> </view> <!-- 鏂囧瓧鍔犲浘鐗� --> <view @@ -203,10 +199,17 @@ style="color:{{ isNight ? '#fff' : '#000'}};font-size:{{sliderValue || 32}}rpx;" >{{contentItem.txt}}</text > - <t-image src="{{contentItem.img}}" /> + <image + src="{{contentItem.img}}" + wx:if="{{contentItem.img}}" + mode="aspectFit" + /> </view> <!-- 瀵屾枃鏈� --> - <view wx:if="{{item.optionStyle == 'RichText'}}"> + <view + wx:if="{{item.optionStyle == 'RichText'}}" + class="check-rich-box" + > <text>{{contentItem.value}}銆�</text> <rich-text nodes="{{contentItem.txt}}" diff --git a/packageBookService/pages/bookServices/examination/questionList/index.wxss b/packageBookService/pages/bookServices/examination/questionList/index.wxss index 6d1613c..6e45efd 100644 --- a/packageBookService/pages/bookServices/examination/questionList/index.wxss +++ b/packageBookService/pages/bookServices/examination/questionList/index.wxss @@ -1,7 +1,7 @@ /* pages/bookServices/examination/questionList/index.wxss */ .question-list { width: 95%; - height: 85%; + height: calc(100vh - 300px); padding: 20rpx; background-color: #ffffff; @@ -12,6 +12,10 @@ .question-title { font-size: 28rpx; margin-bottom: 20rpx; +} + +.title-content { + margin-left: 10rpx; } .title-name { @@ -52,6 +56,10 @@ background-color: #F9F9F9; } +.radio-item text { + height: min-content; +} + .night { background-color: #000; color: #ffffff; @@ -70,17 +78,10 @@ } .question-stem image { - margin-left: 20rpx; width: 300rpx; object-fit: contain; height: 200rpx; } - -.title-RichText img { - width: 300rpx; - height: 200rpx; -} - .question-answer image { margin: 10rpx 0 10rpx 10rpx; @@ -226,9 +227,24 @@ .judge-rich-box { display: flex; + align-items: center; } .t-checkbox { display: flex; align-items: center; +} + +.check-rich-box { + display: flex; + align-items: center; +} + +.check-rich-box text { + height: min-content; +} + +.radio-textimg { + display: inline-block; + width: calc(100% - 90rpx); } \ No newline at end of file diff --git a/packageBookService/pages/bookServices/list/index.js b/packageBookService/pages/bookServices/list/index.js index 5cd1be5..a2bf820 100644 --- a/packageBookService/pages/bookServices/list/index.js +++ b/packageBookService/pages/bookServices/list/index.js @@ -53,6 +53,7 @@ loading: false, noData: false, showDropdown: false, + isRequesting: false, }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 @@ -143,11 +144,13 @@ onReachBottom(e) { const flag = this.data.bookList.length < this.data.pageCount.total if (flag) { - this.setData({ - isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.getBookList(this.data.path) + if (!this.data.isRequesting) { + this.setData({ + isMore: true, + "pageCount.page": this.data.pageCount.page + 1 + }) + this.getBookList(this.data.path) + } } else { this.setData({ isMore: true, @@ -243,7 +246,7 @@ refCodes: [type], }; app.MG.store.getProductTypeField(query).then((res) => { - array = JSON.parse(res[0].config).option; + array = JSON.parse(res[0].config).option.filter(item => item.value == this.data.assortCheck.code); for (let index = 0; index < array.length; index++) { const element = array[index]; if (element.child) { @@ -281,9 +284,13 @@ }, // 鑾峰彇鍥句功鍒楄〃 getBookList(path) { + if (this.data.isRequesting) { + return false; + } this.setData({ loading: true, - noData: false + noData: false, + isRequesting: true }) let sort; let pathObj = {}; @@ -342,12 +349,23 @@ bookList: res.datas, enable: false, "pageCount.total": res.total, - loading: false + loading: false, + isRequesting: false }); if (!res.datas.length) { this.setData({ noData: true, }) + if (!this.data.pathList.length) { + // 鏈�夋嫨浜岀骇鍒嗙被锛屼笖鏃犲浘涔� + this.setData({ + disabledSecondList: true + }) + } else { + this.setData({ + disabledSecondList: false + }) + } } }); }, diff --git a/packageDomain/pages/resourceDetails/myAudio/index.wxml b/packageDomain/pages/resourceDetails/myAudio/index.wxml index bd26882..823711f 100644 --- a/packageDomain/pages/resourceDetails/myAudio/index.wxml +++ b/packageDomain/pages/resourceDetails/myAudio/index.wxml @@ -1,17 +1,21 @@ <view style="width: 100%; height: {{barHeight}}px; "></view> <view class="nacigationBar" style="width: 70%; height: {{navBarHeight}}px;"> <view> - <t-icon name="chevron-left" size="30" data-name="{{item}}" bind:click="goBack" /> + <t-icon + name="chevron-left" + size="30" + data-name="{{item}}" + bind:click="goBack" + /> </view> <view class="navbar-title">璧勬簮璇︽儏-闊抽</view> </view> - - - - <view class="audioPlayerBox"> - <view class="audioBackground" style="background-image: url('http://182.92.203.7:3007/jsek/website/image/video-bg.png');"> + <view + class="audioBackground" + style="background-image: url('http://182.92.203.7:3007/jsek/website/image/video-bg.png');" + > <image src="/static/images/resourceDetailsMyAudio/cd.png" alt="" /> </view> <!-- 瑙嗛鎾斁鐨勬寜閽� --> @@ -23,8 +27,11 @@ </view> --> <!-- 鏆傚仠鎾斁 --> - <view class="audioIconBox color" style="margin-left: 30rpx; margin-right: 10rpx;"> - <view wx:if="{{!isplay}}" bind:tap='play'> + <view + class="audioIconBox color" + style="margin-left: 30rpx; margin-right: 10rpx" + > + <view wx:if="{{!isplay}}" bind:tap="play"> <t-icon name="play-circle-stroke" size="24" /> </view> <view wx:else bind:tap="stop" class="pauseCircleBox"> @@ -32,7 +39,14 @@ <image src="/static/images/resourceDetailsMyAudio/zanting@2x.png" mode="" /> </view> </view> - <slider style="width: 300rpx;" activeColor='#FF6C00' class="mp-slider-bar" block-size="16" value="{{myAudioPos}}" bindchange="hanle_slider_change"></slider> + <slider + style="width: 300rpx" + activeColor="#FF6C00" + class="mp-slider-bar" + block-size="16" + value="{{myAudioPos}}" + bindchange="hanle_slider_change" + ></slider> <!-- 鍙冲垏鎹� --> <!-- <view class="rightSwitchBox color" bind:tap="onRightSwitch"> <t-icon name="next" size="24" /> @@ -40,24 +54,53 @@ <!-- 鏃堕棿 --> <view class="current-time color">{{myAudioCurrent}} </view> - <view class="color" style="margin: 0 10rpx;">/</view> + <view class="color" style="margin: 0 10rpx">/</view> <view class="duration-time color"> {{myAudioDuration}} </view> - <!-- bind:tap="onSpeed" --> <view class="publicBtn color"> <view class="publicText" bind:tap="toggleDropdown"> - <view> - {{"x "+speed}} - </view> - <t-icon style="margin-top: 10rpx;" wx:if="{{showDropdown}}" name="caret-up-small" size="14" bind:click="onIconTap" /> - <t-icon style="margin-top: 10rpx;" wx:else name="caret-down-small" size="14" bind:click="onIconTap" /> + <view> {{"x "+speed}} </view> + <t-icon + style="margin-top: 10rpx" + wx:if="{{showDropdown}}" + name="caret-up-small" + size="14" + bind:click="onIconTap" + /> + <t-icon + style="margin-top: 10rpx" + wx:else + name="caret-down-small" + size="14" + bind:click="onIconTap" + /> </view> <view class="multipleBox" wx:if="{{showDropdown}}"> - <view wx:if="{{speed != 0.5}}" style="margin: 5rpx 0;" bind:tap="smallSpeed">x0.5</view> - <view wx:if="{{speed != 1}}" style="margin: 5rpx 0;" bind:tap="smallSpeeDmultiple">x1</view> - <view wx:if="{{speed != 1.5}}" style="margin: 5rpx 0;" bind:tap="centreSpeed">x1.5</view> - <view wx:if="{{speed != 2}}" style="margin: 5rpx 0;" bind:tap="bigSpeed">x2</view> + <view + wx:if="{{speed != 0.5}}" + style="margin: 5rpx 0" + bind:tap="smallSpeed" + >x0.5</view + > + <view + wx:if="{{speed != 1}}" + style="margin: 5rpx 0" + bind:tap="smallSpeeDmultiple" + >x1</view + > + <view + wx:if="{{speed != 1.5}}" + style="margin: 5rpx 0" + bind:tap="centreSpeed" + >x1.5</view + > + <view + wx:if="{{speed != 2}}" + style="margin: 5rpx 0" + bind:tap="bigSpeed" + >x2</view + > </view> </view> </view> @@ -67,14 +110,36 @@ <!-- 鏍囬 --> <view class="titleBox">{{titleName}}</view> <view class="contentBox"> - <t-tabs defaultValue="{{0}}" bind:change="onTabsChange" bind:click="onTabsClick" t-class="custom-tabs" t-class-content="custom-panel"> + <t-tabs + defaultValue="{{0}}" + bind:change="onTabsChange" + bind:click="onTabsClick" + t-class="custom-tabs" + t-class-content="custom-panel" + > <!-- 璧勬簮鍒楄〃 --> - <t-tab-panel label="璧勬簮鍒楄〃" value="0" style="{{tabPanelstyle}}" style="width: 750rpx;"> + <t-tab-panel + label="璧勬簮鍒楄〃" + value="0" + style="{{tabPanelstyle}}" + style="width: 750rpx" + > <view class="wrapper"> <t-collapse value="{{activeValues}}" bind:change="handleChange"> <t-collapse-panel header="{{parentName}}" value="{{0}}" expandIcon> - <view class="detailsName" wx:for="{{threeLeveData}}" wx:key="index" wx:for-item="item" wx:for-index="index" bind:tap="onVideo" data-item="{{item}}" data-index="{{index}}"> - <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}">{{item.name}}</view> + <view + class="detailsName" + wx:for="{{threeLeveData}}" + wx:key="index" + wx:for-item="item" + wx:for-index="index" + bind:tap="onVideo" + data-item="{{item}}" + data-index="{{index}}" + > + <view style="color: {{selectedId == index ? '#ff6c00' : '#000'}}" + >{{item.name}}</view + > </view> </t-collapse-panel> </t-collapse> @@ -88,9 +153,16 @@ <t-empty icon="folder-open" description="鏆傛棤鏁版嵁" /> </view> - <t-collapse-panel value="{{item.id}}" expandIcon wx:for="{{noteList}}"> + <t-collapse-panel + value="{{item.id}}" + expandIcon + wx:for="{{noteList}}" + > <view slot="header" class="collapse-header"> - <t-image class="note-icon" src="/static/images/bookService/detail/note-icon.png"></t-image> + <t-image + class="note-icon" + src="/static/images/bookService/detail/note-icon.png" + ></t-image> <view class="header-name">{{titleName}}</view> </view> <view> @@ -98,9 +170,19 @@ <view class="note-bottom"> <view class="note-time">{{item.createDate}}</view> <view class="bottom-btn"> - <t-image src="/static/images/bookService/detail/compliceHover.png" class="complice" bind:tap="editNote" data-note="{{item}}"></t-image> + <t-image + src="/static/images/bookService/detail/compliceHover.png" + class="complice" + bind:tap="editNote" + data-note="{{item}}" + ></t-image> <view></view> - <t-image src="/static/images/bookService/detail/deleteHover.png" class="delete" bind:tap="deleteNote" data-id="{{item.id}}"></t-image> + <t-image + src="/static/images/bookService/detail/deleteHover.png" + class="delete" + bind:tap="deleteNote" + data-id="{{item.id}}" + ></t-image> </view> </view> </view> @@ -118,33 +200,63 @@ </view> </view> - <!-- 璁扮瑪璁板脊绐� --> -<t-popup visible="{{dialogKey}}" bind:visible-change="onVisibleChange" placement="center"> +<t-popup + visible="{{dialogKey}}" + bind:visible-change="onVisibleChange" + placement="center" +> <view class="popup"> <view slot="title"> <view class="title-text" wx:if="{{!flag}}"> <text class="note-title">{{titleName}}</text> - <t-image src="/static/images/bookService/detail/edit.png" class="edit-icon" bind:tap="changeTitle" data-value="{{true}}"></t-image> + <t-image + src="/static/images/bookService/detail/edit.png" + class="edit-icon" + bind:tap="changeTitle" + data-value="{{true}}" + ></t-image> </view> <view wx:else> - <t-input value="{{titleName}}" style="{{inputStyle}}" data-value="{{false}}" bind:enter="changeTitle" bind:blur="changeTitle" maxlength="{{50}}" bind:change="inputChange"></t-input> + <t-input + value="{{titleName}}" + style="{{inputStyle}}" + data-value="{{false}}" + bind:enter="changeTitle" + bind:blur="changeTitle" + maxlength="{{50}}" + bind:change="inputChange" + ></t-input> </view> </view> - <view slot='content'> + <view slot="content"> <view class="textarea-example"> <text class="textarea-example__label">鍐呭:</text> - <t-textarea value="{{textvalue}}" t-class="external-class" placeholder="璇疯緭鍏ユ枃瀛�" bordered maxlength="500" disableDefaultPadding="{{true}}" indicator style="{{inputStyle}}" bind:change="textareaChange" /> + <t-textarea + value="{{textvalue}}" + t-class="external-class" + placeholder="璇疯緭鍏ユ枃瀛�" + bordered + maxlength="500" + disableDefaultPadding="{{true}}" + indicator + style="{{inputStyle}}" + bind:change="textareaChange" + /> </view> - <view class="submit-btn"> - <t-button theme="primary" size="large" block bind:tap="confirmSuggest">鎻愪氦</t-button> + <t-button theme="primary" size="large" block bind:tap="confirmSuggest" + >鎻愪氦</t-button + > </view> </view> - - - </view> - <t-icon t-class="close-btn" name="close-circle" size="32" color="#fff" bind:tap="closeDialog" /> -</t-popup> \ No newline at end of file + <t-icon + t-class="close-btn" + name="close-circle" + size="32" + color="#fff" + bind:tap="closeDialog" + /> +</t-popup> -- Gitblit v1.9.1