From cb6bb8bda31df75afe5a5bd50fe8e3ff6a3d34e2 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期一, 15 四月 2024 09:31:39 +0800 Subject: [PATCH] 详情页bug修改,资源购买页添加骨架屏 --- packageBookService/pages/bookServices/examination/examination.js | 31 ++++++++++++++++++++++++++++--- 1 files changed, 28 insertions(+), 3 deletions(-) diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js index d5c4b7a..070b53f 100644 --- a/packageBookService/pages/bookServices/examination/examination.js +++ b/packageBookService/pages/bookServices/examination/examination.js @@ -202,14 +202,15 @@ // 姝e垯琛ㄨ揪寮忓尮閰�<source>鏍囩涓殑src灞炴�у�� var srcRegex = /<source\s+src="([^"]+)"/i; var srcTwo = /<audio\s+src="([^"]+)"/i; + // 鎵ц姝e垯鍖归厤 var match = srcRegex.exec(htmlString); const local = srcTwo.exec(htmlString) // 濡傛灉鍖归厤鎴愬姛锛岃繑鍥炵涓�涓崟鑾风粍鐨勫唴瀹癸紙src灞炴�х殑鍊硷級 if (match && match[1]) { - return match[1]; + return match[1].replace( '../file', app.config.requestCtx + '/file'); } else if (local && local[1]) { - return local[1] + return local[1].replace( '../file', app.config.requestCtx + '/file') } else { // 濡傛灉娌℃湁鍖归厤鍒帮紝杩斿洖null return null; @@ -906,7 +907,6 @@ if (src) { questionObj.src = src questionObj.stem.stemTxt = this.removeVideoAndAudioTags(questionObj.stem.stemTxt) - console.log('棰樺共', questionObj.stem.stemTxt); } } // 鑾峰彇鍥剧墖 @@ -1414,6 +1414,14 @@ '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ' ); } + // 鍚姏棰樹慨鏀� + if (questionObj.questionType == 'singleChoice') { + const src = this.extractSourceSrc(questionObj.stem.stemTxt) + if (src) { + questionObj.src = src + questionObj.stem.stemTxt = this.removeVideoAndAudioTags(questionObj.stem.stemTxt) + } + } if (item.Embedded_QuestionBank_QuestionType == "judge") { questionObj.type = "鍒ゆ柇棰�"; judgeArr.push(questionObj); @@ -1653,6 +1661,15 @@ /\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ' ); + } + // 鍚姏棰樹慨鏀� + if (questionObj.questionType == 'singleChoice') { + const src = this.extractSourceSrc(questionObj.stem.stemTxt) + if (src) { + questionObj.src = src + questionObj.stem.stemTxt = this.removeVideoAndAudioTags(questionObj.stem.stemTxt) + console.log('棰樺共', questionObj.stem.stemTxt); + } } if (item.Embedded_QuestionBank_QuestionType == "judge") { questionObj.type = "鍒ゆ柇棰�"; @@ -1906,6 +1923,14 @@ ); }); } + // 鍚姏棰樹慨鏀� + if (questionObj.questionType == 'singleChoice') { + const src = this.extractSourceSrc(questionObj.stem.stemTxt) + if (src) { + questionObj.src = src + questionObj.stem.stemTxt = this.removeVideoAndAudioTags(questionObj.stem.stemTxt) + } + } // 鑾峰彇鍥剧墖 if ( questionObj.stemStyle == "Image" || -- Gitblit v1.9.1