From e90c18770dfccded106c395c05dbc88d8fd99040 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期一, 15 四月 2024 16:17:21 +0800 Subject: [PATCH] 答题器,详情页bug修改 --- packageBookService/pages/bookServices/examination/examination.js | 35 +++++++++++++++++++---------------- 1 files changed, 19 insertions(+), 16 deletions(-) diff --git a/packageBookService/pages/bookServices/examination/examination.js b/packageBookService/pages/bookServices/examination/examination.js index 070b53f..a819f70 100644 --- a/packageBookService/pages/bookServices/examination/examination.js +++ b/packageBookService/pages/bookServices/examination/examination.js @@ -75,7 +75,6 @@ }); } this.init(); - console.log("浼犲弬", options); }, /** @@ -202,15 +201,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].replace( '../file', app.config.requestCtx + '/file'); + return match[1].replace('../file', app.config.requestCtx + '/file'); } else if (local && local[1]) { - return local[1].replace( '../file', app.config.requestCtx + '/file') + return local[1].replace('../file', app.config.requestCtx + '/file') } else { // 濡傛灉娌℃湁鍖归厤鍒帮紝杩斿洖null return null; @@ -794,9 +793,6 @@ }, }; await app.MG.store.getProductDetail(query).then((res) => { - if (!res.datas.cmsDatas[0].datas.length) return this.setData({ - noData: true - }) this.setData({ total: res.datas.cmsDatas[0].datas.length, }); @@ -875,7 +871,7 @@ /\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ' ) - .replace(/\<p/gi, '<p class="stem-rich-p"'); + .replace(/\<p/gi, '<p class="stem-rich-p"').replace('../file', app.config.requestCtx + '/file'); } // 閫夐」瀵屾枃鏈鐞� if ( @@ -888,7 +884,7 @@ if (item.txt) item.txt = item.txt .replace(/\<img/gi, '<img class="option-rich-img"') - .replace(/\<p/gi, '<p class="stem-rich-p"'); + .replace(/\<p/gi, '<p class="stem-rich-p"').replace('../file', app.config.requestCtx + '/file'); }); } // 瑙f瀽瀵屾枃鏈鐞� @@ -987,7 +983,14 @@ }); } // 鏈夐鐩啀寮�濮嬪�掕鏃� - if (this.data.questionDataList.length) this.startCountdown(); + if (this.data.questionDataList.length) { + // console.log(this.data.questionDataList); + this.startCountdown(); + } else { + this.setData({ + noData: true + }) + } this.setData({ loading: false, }); @@ -1388,7 +1391,7 @@ /\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ' ) - .replace(/\<p/gi, '<p class="stem-rich-p"'); + .replace(/\<p/gi, '<p class="stem-rich-p"').replace('../file', app.config.requestCtx + '/file'); } // 閫夐」瀵屾枃鏈鐞� if ( @@ -1401,7 +1404,7 @@ if (item.txt) item.txt = item.txt .replace(/\<img/gi, '<img class="option-rich-img"') - .replace(/\<p/gi, '<p class="stem-rich-p"'); + .replace(/\<p/gi, '<p class="stem-rich-p"').replace('../file', app.config.requestCtx + '/file'); }); } // 瑙f瀽瀵屾枃鏈鐞� @@ -1636,7 +1639,7 @@ /\<img/gi, '<img style="max-width: 300rpx !important;object-fit: contain;" class="stem-rich-img" ' ) - .replace(/\<p/gi, '<p class="stem-rich-p"'); + .replace(/\<p/gi, '<p class="stem-rich-p"').replace('../file', app.config.requestCtx + '/file'); } // 閫夐」瀵屾枃鏈鐞� if ( @@ -1649,7 +1652,7 @@ if (item.txt) item.txt = item.txt .replace(/\<img/gi, '<img class="option-rich-img"') - .replace(/\<p/gi, '<p class="stem-rich-p"'); + .replace(/\<p/gi, '<p class="stem-rich-p"').replace('../file', app.config.requestCtx + '/file'); }); } // 瑙f瀽瀵屾枃鏈鐞� @@ -1906,7 +1909,7 @@ 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"').replace('../file', app.config.requestCtx + '/file'); } // 閫夐」瀵屾枃鏈鐞� if ( @@ -1920,7 +1923,7 @@ item.txt = item.txt.replace( /\<img/gi, '<img class="option-rich-img"' - ); + ).replace(/\<p/gi, '<p class="stem-rich-p"').replace('../file', app.config.requestCtx + '/file'); }); } // 鍚姏棰樹慨鏀� -- Gitblit v1.9.1