xugenyuan

ref |> 更新最新的H5模板

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
@@ -199,7 +199,7 @@ @@ -199,7 +199,7 @@
199 <div class="head-link-block" v-if="hasHeadLink" @click="moreInformationClick"> 199 <div class="head-link-block" v-if="hasHeadLink" @click="moreInformationClick">
200 <img v-if="darkMode === 'light'" src="./image/headLinkIcon.svg" alt=""> 200 <img v-if="darkMode === 'light'" src="./image/headLinkIcon.svg" alt="">
201 <img v-if="darkMode === 'dark'" src="./image/dark/headLinkIcon.svg" alt=""> 201 <img v-if="darkMode === 'dark'" src="./image/dark/headLinkIcon.svg" alt="">
202 - <span class="head-link-block-str" v-html="details.newLinkObject.newsTitle"></span> 202 + <span class="head-link-block-str" v-html="details.newLinkObject ? details.newLinkObject.newsTitle : ''"></span>
203 </div> 203 </div>
204 <!-- 导读 --> 204 <!-- 导读 -->
205 <div class="new-intro-box droidSerif" v-if="details.newIntroduction"> 205 <div class="new-intro-box droidSerif" v-if="details.newIntroduction">
@@ -219,7 +219,7 @@ @@ -219,7 +219,7 @@
219 <div class="cdescrip_text" v-if="details.rmhDesc" @click="skipCustomerNumberPage">{{details.rmhDesc}}</div> 219 <div class="cdescrip_text" v-if="details.rmhDesc" @click="skipCustomerNumberPage">{{details.rmhDesc}}</div>
220 </div> 220 </div>
221 <!-- @click.stop阻止事件冒泡 --> 221 <!-- @click.stop阻止事件冒泡 -->
222 - <template v-if="!isOwer && showButton"> 222 + <template v-if="!isOwer">
223 <div class="clook-btn clook" @click.stop="clookBtn" v-if="clookStatusSee || showClook"> 223 <div class="clook-btn clook" @click.stop="clookBtn" v-if="clookStatusSee || showClook">
224 <template v-if="clookBtnActive"> 224 <template v-if="clookBtnActive">
225 <img class="clook-loading anticon-spin" src="./image/loading_clock.svg" alt=""> 225 <img class="clook-loading anticon-spin" src="./image/loading_clock.svg" alt="">
@@ -276,14 +276,8 @@ @@ -276,14 +276,8 @@
276 <div class="aft anmite-vote" v-if="voteState.status == 1 || !details.endTimePoint"> 276 <div class="aft anmite-vote" v-if="voteState.status == 1 || !details.endTimePoint">
277 <div class="jdat" v-if="optionList.length"> 277 <div class="jdat" v-if="optionList.length">
278 <div class="pkjd-box" v-if="optionList[0].votesBf != 0 || optionList[1].votesBf != 0"> 278 <div class="pkjd-box" v-if="optionList[0].votesBf != 0 || optionList[1].votesBf != 0">
279 - <span  
280 - class="s s1"  
281 - :style="optionList.length ? optionList[0].oneStyleAfter : undefined"  
282 - ></span>  
283 - <spsn  
284 - class="s s2"  
285 - :style="optionList.length ? optionList[1].twoStyleAfter : undefined"  
286 - ></spsn> 279 + <span class="s s1" :style="optionList.length ? optionList[0].oneStyleAfter : undefined"></span>
  280 + <spsn class="s s2" :style="optionList.length ? optionList[1].twoStyleAfter : undefined"></spsn>
287 </div> 281 </div>
288 <span 282 <span
289 v-if="optionList[0].votesBf === 0 && optionList[1].votesBf === 0" 283 v-if="optionList[0].votesBf === 0 && optionList[1].votesBf === 0"
@@ -427,7 +421,7 @@ @@ -427,7 +421,7 @@
427 </div> 421 </div>
428 422
429 <!-- 分享 --> 423 <!-- 分享 -->
430 - <!-- <div class="share" v-if="shareOpen" :style="{ marginTop: actieInfo.show ? '0.64rem' : undefined }"> 424 + <div class="share" v-if="shareOpen" :style="{ marginTop: actieInfo.show ? '0.64rem' : undefined }">
431 <div 425 <div
432 v-if="details.shareInfo.sharePosterOpen == 1" 426 v-if="details.shareInfo.sharePosterOpen == 1"
433 class="sharePoster share-wrapper share-box" 427 class="sharePoster share-wrapper share-box"
@@ -506,7 +500,7 @@ @@ -506,7 +500,7 @@
506 <span>微博</span> 500 <span>微博</span>
507 </div> 501 </div>
508 </div> 502 </div>
509 - </div> --> 503 + </div>
510 <div class="reload-page" v-if="baseNode == 'dev'" @click="mockAppClearData">模拟app复用重新加载</div> 504 <div class="reload-page" v-if="baseNode == 'dev'" @click="mockAppClearData">模拟app复用重新加载</div>
511 </div> 505 </div>
512 506
@@ -533,6 +527,7 @@ @@ -533,6 +527,7 @@
533 <div id="hidden"></div> 527 <div id="hidden"></div>
534 <div id="hiddenArticle"></div> 528 <div id="hiddenArticle"></div>
535 <!-- Plugin 的 JS 文件 --> 529 <!-- Plugin 的 JS 文件 -->
  530 +<script src="./js/plugin/error-stack-parser.min.js"></script>
536 <script src="./js/plugin/jquery.min.js"></script> 531 <script src="./js/plugin/jquery.min.js"></script>
537 <script src="./js/plugin/vue3.min.js"></script> 532 <script src="./js/plugin/vue3.min.js"></script>
538 <script src="./js/plugin/day.min.js"></script> 533 <script src="./js/plugin/day.min.js"></script>
@@ -18,7 +18,7 @@ function useAudio(audioState, details) { @@ -18,7 +18,7 @@ function useAudio(audioState, details) {
18 play: [], 18 play: [],
19 pause: [], 19 pause: [],
20 error: [], 20 error: [],
21 - ended: [], 21 + ended: []
22 } 22 }
23 23
24 const start = () => { 24 const start = () => {
@@ -69,7 +69,6 @@ function useAudio(audioState, details) { @@ -69,7 +69,6 @@ function useAudio(audioState, details) {
69 audioEvent.error.push(errorFun) 69 audioEvent.error.push(errorFun)
70 audioEvent.ended.push(endedFun) 70 audioEvent.ended.push(endedFun)
71 71
72 -  
73 const playFun = function () { 72 const playFun = function () {
74 if (item_audio) { 73 if (item_audio) {
75 audioPlayNum.value += 1 74 audioPlayNum.value += 1
@@ -150,32 +149,39 @@ function useAudio(audioState, details) { @@ -150,32 +149,39 @@ function useAudio(audioState, details) {
150 audioStylePlay.style.display = 'block' 149 audioStylePlay.style.display = 'block'
151 } 150 }
152 151
153 - if (audioEvent.duration.length) { 152 + if (audioEvent.duration && audioEvent.duration.length) {
154 item_audio.removeEventListener('durationchange', audioEvent.duration[key]) 153 item_audio.removeEventListener('durationchange', audioEvent.duration[key])
155 } 154 }
156 155
157 - if (audioEvent.time.length) { 156 + if (audioEvent.time && audioEvent.time.length) {
158 item_audio.removeEventListener('timeupdate', audioEvent.time[key]) 157 item_audio.removeEventListener('timeupdate', audioEvent.time[key])
159 } 158 }
160 159
161 - if (audioEvent.ended.length) { 160 + if (audioEvent.ended && audioEvent.ended.length) {
162 item_audio.removeEventListener('ended', audioEvent.ended[key]) 161 item_audio.removeEventListener('ended', audioEvent.ended[key])
163 } 162 }
164 163
165 - if (audioEvent.error.length) { 164 + if (audioEvent.error && audioEvent.error.length) {
166 item_audio.removeEventListener('error', audioEvent.error[key]) 165 item_audio.removeEventListener('error', audioEvent.error[key])
167 } 166 }
168 167
169 - if (audioEvent.play.length) { 168 + if (audioEvent.play && audioEvent.play.length) {
170 audioStylePlay.removeEventListener('click', audioEvent.play[key]) 169 audioStylePlay.removeEventListener('click', audioEvent.play[key])
171 } 170 }
172 171
173 - if (audioEvent.pause.length) { 172 + if (audioEvent.pause && audioEvent.pause.length) {
174 audioStylePause.removeEventListener('click', audioEvent.pause[key]) 173 audioStylePause.removeEventListener('click', audioEvent.pause[key])
175 } 174 }
176 175
177 }) 176 })
178 - audioEvent = {} 177 + audioEvent = {
  178 + duration: [],
  179 + time: [],
  180 + play: [],
  181 + pause: [],
  182 + error: [],
  183 + ended: []
  184 + }
179 } 185 }
180 186
181 return { 187 return {
@@ -189,7 +189,6 @@ function useEditorContent(details, netstutas, audioState, loadlmageOnlyWifiSwitc @@ -189,7 +189,6 @@ function useEditorContent(details, netstutas, audioState, loadlmageOnlyWifiSwitc
189 str = str.replace(/<VIDEO(.*?)poster="(.*?)"(.*?)>/g, '<VIDEO$1poster="" data-poster="$2"$3>') 189 str = str.replace(/<VIDEO(.*?)poster="(.*?)"(.*?)>/g, '<VIDEO$1poster="" data-poster="$2"$3>')
190 str = str.replace(/<p>\s*<\/p>/g, '') 190 str = str.replace(/<p>\s*<\/p>/g, '')
191 str = str.replace(/[\u200B-\u200D\uFEFF]/g, '') 191 str = str.replace(/[\u200B-\u200D\uFEFF]/g, '')
192 - str = str.replace(/‘/g, '\'')  
193 str = htmlDecode(str) 192 str = htmlDecode(str)
194 // 这一步去除元素与元素之间的空格 193 // 这一步去除元素与元素之间的空格
195 str = str.replace(/>\s+</g, '><') 194 str = str.replace(/>\s+</g, '><')
@@ -220,6 +219,10 @@ function useEditorContent(details, netstutas, audioState, loadlmageOnlyWifiSwitc @@ -220,6 +219,10 @@ function useEditorContent(details, netstutas, audioState, loadlmageOnlyWifiSwitc
220 jqHtml('#newsContent', { type: 'set', str }) 219 jqHtml('#newsContent', { type: 'set', str })
221 const realHtml = jqHtml('#newsContent', { type: 'get' }) 220 const realHtml = jqHtml('#newsContent', { type: 'get' })
222 jqHtml('#newsContent', { type: 'set', str: '' }) 221 jqHtml('#newsContent', { type: 'set', str: '' })
  222 + mainProcessProgress['8'] = {
  223 + status:'success',
  224 + message: '准备调用:handleArticleStr方法'
  225 + }
223 domUtil.handleArticleStr(realHtml, (type, option) => { 226 domUtil.handleArticleStr(realHtml, (type, option) => {
224 if (type === 1) { 227 if (type === 1) {
225 addPreview() 228 addPreview()
@@ -235,13 +238,23 @@ function useEditorContent(details, netstutas, audioState, loadlmageOnlyWifiSwitc @@ -235,13 +238,23 @@ function useEditorContent(details, netstutas, audioState, loadlmageOnlyWifiSwitc
235 }, details.value, netstutas.value, loadlmageOnlyWifiSwitch.value) 238 }, details.value, netstutas.value, loadlmageOnlyWifiSwitch.value)
236 239
237 clearEmptyPel() 240 clearEmptyPel()
238 - // errorBlock(  
239 - // './image/content_fail.svg',  
240 - // '获取内容失败,请重试',  
241 - // true  
242 - // )  
243 changeContentHtmlHeight({ type: 'done-before' }) 241 changeContentHtmlHeight({ type: 'done-before' })
  242 + // setTimeout(() => {
  243 + // if (document.querySelector('.error-block').style.display !== 'block') {
  244 + // mainProcessProgress['9'] = {
  245 + // status:'success',
  246 + // message: '页面开始展示,去除骨架屏'
  247 + // }
  248 + // appBlock(true)
  249 + // mobileApp(true)
  250 + // startShowArticle = true
  251 + // }
  252 + // }, 4000)
244 if (document.querySelector('.error-block').style.display !== 'block') { 253 if (document.querySelector('.error-block').style.display !== 'block') {
  254 + mainProcessProgress['9'] = {
  255 + status:'success',
  256 + message: '页面开始展示,去除骨架屏'
  257 + }
245 appBlock(true) 258 appBlock(true)
246 mobileApp(true) 259 mobileApp(true)
247 startShowArticle = true 260 startShowArticle = true
@@ -306,8 +319,6 @@ function useEditorContent(details, netstutas, audioState, loadlmageOnlyWifiSwitc @@ -306,8 +319,6 @@ function useEditorContent(details, netstutas, audioState, loadlmageOnlyWifiSwitc
306 const inner = dataInfo && (typeof dataInfo === 'undefined' 319 const inner = dataInfo && (typeof dataInfo === 'undefined'
307 ? 'undefined' 320 ? 'undefined'
308 : typeof dataInfo === 'object' && dataInfo.jumpType && dataInfo.jumpType == 'internal') 321 : typeof dataInfo === 'object' && dataInfo.jumpType && dataInfo.jumpType == 'internal')
309 - console.log(inner)  
310 - console.log(dataInfo)  
311 if (inner && url) { 322 if (inner && url) {
312 jumpAppInnerFun(dataInfo, url) 323 jumpAppInnerFun(dataInfo, url)
313 } else if (url) { 324 } else if (url) {
@@ -20,7 +20,7 @@ function useImage(details, netstutas, loadlmageOnlyWifiSwitch) { @@ -20,7 +20,7 @@ function useImage(details, netstutas, loadlmageOnlyWifiSwitch) {
20 imageLoadedLen.value += 1 20 imageLoadedLen.value += 1
21 } 21 }
22 22
23 - if (hasPreview) { 23 + if (hasPreview && record.parentNode) {
24 record.parentNode.setAttribute('status', 'success') 24 record.parentNode.setAttribute('status', 'success')
25 record.parentNode.classList.remove('error') 25 record.parentNode.classList.remove('error')
26 record.parentNode.classList.remove('minHeight') 26 record.parentNode.classList.remove('minHeight')
@@ -43,7 +43,7 @@ function useImage(details, netstutas, loadlmageOnlyWifiSwitch) { @@ -43,7 +43,7 @@ function useImage(details, netstutas, loadlmageOnlyWifiSwitch) {
43 } 43 }
44 44
45 45
46 - if (hasPreview) { 46 + if (hasPreview && record.parentNode) {
47 record.parentNode.setAttribute('status', 'error') 47 record.parentNode.setAttribute('status', 'error')
48 record.parentNode.classList.remove('success') 48 record.parentNode.classList.remove('success')
49 record.parentNode.classList.remove('loading') 49 record.parentNode.classList.remove('loading')
@@ -82,7 +82,7 @@ function useImage(details, netstutas, loadlmageOnlyWifiSwitch) { @@ -82,7 +82,7 @@ function useImage(details, netstutas, loadlmageOnlyWifiSwitch) {
82 imageLoadedLen.value += 1 82 imageLoadedLen.value += 1
83 } 83 }
84 84
85 - if (hasPreview) { 85 + if (hasPreview && record.parentNode) {
86 record.parentNode.setAttribute('status', 'error') 86 record.parentNode.setAttribute('status', 'error')
87 record.parentNode.classList.remove('success') 87 record.parentNode.classList.remove('success')
88 record.parentNode.classList.remove('loading') 88 record.parentNode.classList.remove('loading')
@@ -61,8 +61,10 @@ function useVideo() { @@ -61,8 +61,10 @@ function useVideo() {
61 61
62 const isGiveWidth = !!height 62 const isGiveWidth = !!height
63 63
64 - videoItem.setAttribute('data-height', `${styleHeight}px`)  
65 - videoItem.style.height = `${styleHeight}px` 64 + if (videoItem) {
  65 + videoItem.setAttribute('data-height', `${styleHeight}px`)
  66 + videoItem.style.height = `${styleHeight}px`
  67 + }
66 videoItem.parentNode.style.width = `100%` 68 videoItem.parentNode.style.width = `100%`
67 videoItem.parentNode.style.height = `${styleHeight}px` 69 videoItem.parentNode.style.height = `${styleHeight}px`
68 70
@@ -87,8 +89,10 @@ function useVideo() { @@ -87,8 +89,10 @@ function useVideo() {
87 if (isGiveWidth) return 89 if (isGiveWidth) return
88 const newHeight = !!playerWdith && !!playerHieght ? Number(width) * Number(playerHieght) / Number( 90 const newHeight = !!playerWdith && !!playerHieght ? Number(width) * Number(playerHieght) / Number(
89 playerWdith) : 300 91 playerWdith) : 300
90 - videoItem.setAttribute('data-height', `${newHeight}px`)  
91 - videoItem.style.height = `${newHeight}px` 92 + if (videoItem) {
  93 + videoItem.setAttribute('data-height', `${newHeight}px`)
  94 + videoItem.style.height = `${newHeight}px`
  95 + }
92 videoItem.parentNode.style.width = `100%` 96 videoItem.parentNode.style.width = `100%`
93 videoItem.parentNode.style.height = `${newHeight}px` 97 videoItem.parentNode.style.height = `${newHeight}px`
94 callback(newHeight) 98 callback(newHeight)
1 dayjs.extend(dayjs_plugin_localizedFormat) 1 dayjs.extend(dayjs_plugin_localizedFormat)
2 dayjs.extend(dayjs_plugin_relativeTime) 2 dayjs.extend(dayjs_plugin_relativeTime)
3 3
4 -const { onMounted, onUnmounted, toRefs, nextTick, watchEffect, toRef } = Vue 4 +const { toRefs, nextTick, toRef } = Vue
5 5
6 function compareTimeArray(obj1, obj2, key, sort) { 6 function compareTimeArray(obj1, obj2, key, sort) {
7 const val1 = obj1[key] 7 const val1 = obj1[key]
@@ -50,7 +50,6 @@ const app = Vue.createApp({ @@ -50,7 +50,6 @@ const app = Vue.createApp({
50 const isRmh = ref(null) 50 const isRmh = ref(null)
51 const isNewspaper = ref(null) 51 const isNewspaper = ref(null)
52 const browseStr = ref('') 52 const browseStr = ref('')
53 - const showButton = ref(false)  
54 53
55 const state = reactive({ 54 const state = reactive({
56 clientHeight: 0, 55 clientHeight: 0,
@@ -217,8 +216,8 @@ const app = Vue.createApp({ @@ -217,8 +216,8 @@ const app = Vue.createApp({
217 // document.documentElement.setAttribute('data-size', state.appFontSize) 216 // document.documentElement.setAttribute('data-size', state.appFontSize)
218 state.environment = window.config.VUE_BASE_HEADER.environment 217 state.environment = window.config.VUE_BASE_HEADER.environment
219 // channelId.value = 2038 218 // channelId.value = 2038
220 - state.relId = 500004384175  
221 - state.contentId = 30037827178 219 + // state.relId = 500005771692
  220 + state.contentId = 30037846595
222 contentId = state.contentId 221 contentId = state.contentId
223 clearInterval(time.value) 222 clearInterval(time.value)
224 setTimeout(() => { 223 setTimeout(() => {
@@ -235,16 +234,13 @@ const app = Vue.createApp({ @@ -235,16 +234,13 @@ const app = Vue.createApp({
235 } 234 }
236 document.querySelector('.error-block').style.display = 'none' 235 document.querySelector('.error-block').style.display = 'none'
237 setRemUnit() 236 setRemUnit()
238 - /*config数据是由H5预埋,App加载完成后 app主动传递的方法名请求数据 */ 237 + /* config数据是由H5预埋,App加载完成后 app主动传递的方法名请求数据 */
239 const config = window.config.VUE_CONTENT_CONFIG 238 const config = window.config.VUE_CONTENT_CONFIG
240 try { 239 try {
241 const data = 240 const data =
242 typeof config === 'object' ? config : JSON.parse(config) 241 typeof config === 'object' ? config : JSON.parse(config)
243 - if (data.dataJson) {  
244 - const dataJson =  
245 - typeof data.dataJson === 'object'  
246 - ? data.dataJson  
247 - : JSON.parse(data.dataJson) 242 + const dataJson = handleAppData(config)
  243 + if (dataJson) {
248 state.sourcePage = dataJson.sourcePage 244 state.sourcePage = dataJson.sourcePage
249 clearInterval(time.value) 245 clearInterval(time.value)
250 // console.log(`详情接口完成:${dayjs().format('HH:mm:ss:SSS')} - ${dayjs() 246 // console.log(`详情接口完成:${dayjs().format('HH:mm:ss:SSS')} - ${dayjs()
@@ -269,7 +265,6 @@ const app = Vue.createApp({ @@ -269,7 +265,6 @@ const app = Vue.createApp({
269 //通用设备imei 265 //通用设备imei
270 state.deviceId = state.appHeader.device_id 266 state.deviceId = state.appHeader.device_id
271 state.userId = state.appHeader.userId 267 state.userId = state.appHeader.userId
272 - logInfo(state.userId)  
273 // App服务协议 268 // App服务协议
274 state.agreementURL = state.appHeader.agreementURL 269 state.agreementURL = state.appHeader.agreementURL
275 //0:无网 1:Wi-Fi 2:2G 3:3G 4:4G 5:5G 270 //0:无网 1:Wi-Fi 2:2G 3:3G 4:4G 5:5G
@@ -278,7 +273,6 @@ const app = Vue.createApp({ @@ -278,7 +273,6 @@ const app = Vue.createApp({
278 state.environment = state.appHeader.environment 273 state.environment = state.appHeader.environment
279 }) 274 })
280 } catch (e) { 275 } catch (e) {
281 -  
282 } 276 }
283 277
284 try { 278 try {
@@ -286,7 +280,6 @@ const app = Vue.createApp({ @@ -286,7 +280,6 @@ const app = Vue.createApp({
286 } catch (e) {} 280 } catch (e) {}
287 281
288 try { 282 try {
289 - // console.log('详情初始数据', data)  
290 if (data.dataExt) { 283 if (data.dataExt) {
291 hasAppLoginExtra = true 284 hasAppLoginExtra = true
292 285
@@ -317,12 +310,11 @@ const app = Vue.createApp({ @@ -317,12 +310,11 @@ const app = Vue.createApp({
317 } 310 }
318 311
319 // 处理详情 312 // 处理详情
320 - let initialRes = dataJson.responseMap  
321 - initialRes =  
322 - typeof initialRes === 'object'  
323 - ? initialRes  
324 - : JSON.parse(initialRes)  
325 - initData(initialRes, dataJson.contentId) 313 + mainProcessProgress['3'] = {
  314 + status:'success',
  315 + message: '准备调用:initData方法'
  316 + }
  317 + initData(handleAppDetails(dataJson.responseMap), dataJson.contentId)
326 } else { 318 } else {
327 errorResponse() 319 errorResponse()
328 errorBlock( 320 errorBlock(
@@ -331,6 +323,13 @@ const app = Vue.createApp({ @@ -331,6 +323,13 @@ const app = Vue.createApp({
331 true 323 true
332 ) 324 )
333 } 325 }
  326 + } else {
  327 + errorResponse()
  328 + errorBlock(
  329 + './image/no_net.svg',
  330 + '网络出小差了,请检查网络后重试',
  331 + true
  332 + )
334 } 333 }
335 } catch (e) { } 334 } catch (e) { }
336 } 335 }
@@ -339,7 +338,16 @@ const app = Vue.createApp({ @@ -339,7 +338,16 @@ const app = Vue.createApp({
339 if (window.config.VUE_BASE_NODE === 'dev') { 338 if (window.config.VUE_BASE_NODE === 'dev') {
340 if (devApp || window.config.devApp) { 339 if (devApp || window.config.devApp) {
341 const details = res.data ? res.data.length > 0 ? res.data[0] : {} : {} 340 const details = res.data ? res.data.length > 0 ? res.data[0] : {} : {}
  341 + mainProcessProgress['1'] = {
  342 + status:'success',
  343 + message: 'App给到的数据',
  344 + appData: res
  345 + }
342 hasDetails = true 346 hasDetails = true
  347 + mainProcessProgress['4'] = {
  348 + status:'success',
  349 + message: '准备调用:handleArticle方法'
  350 + }
343 handleArticle(details) 351 handleArticle(details)
344 352
345 return 353 return
@@ -347,9 +355,9 @@ const app = Vue.createApp({ @@ -347,9 +355,9 @@ const app = Vue.createApp({
347 355
348 const response = await axiosRequest({ 356 const response = await axiosRequest({
349 url: '/content/zh/c/content/detail', 357 url: '/content/zh/c/content/detail',
350 - methot: 'post', 358 + methot: 'get',
351 appStatus: false, 359 appStatus: false,
352 - isMock: true, 360 + // isMock: true,
353 // weakNetwork: true, 361 // weakNetwork: true,
354 // mockTimeOut: 10, 362 // mockTimeOut: 10,
355 //环境 363 //环境
@@ -357,14 +365,9 @@ const app = Vue.createApp({ @@ -357,14 +365,9 @@ const app = Vue.createApp({
357 //接口前缀 365 //接口前缀
358 prefix: '/api/rmrb-bff-display-zh', 366 prefix: '/api/rmrb-bff-display-zh',
359 //给接口传的数据 367 //给接口传的数据
360 - data: {  
361 - contents: [  
362 - {  
363 - //内容id  
364 - contentId: id,  
365 - relId: state.relId  
366 - }  
367 - ] 368 + params: {
  369 + contentId: id,
  370 + relId: state.relId
368 }, 371 },
369 //请求头信息 372 //请求头信息
370 headers: state.appHeader 373 headers: state.appHeader
@@ -375,7 +378,16 @@ const app = Vue.createApp({ @@ -375,7 +378,16 @@ const app = Vue.createApp({
375 if (response.success) { 378 if (response.success) {
376 if (response.data) { 379 if (response.data) {
377 const details = response.data.length > 0 ? response.data[0] : {} 380 const details = response.data.length > 0 ? response.data[0] : {}
  381 + mainProcessProgress['1'] = {
  382 + status:'success',
  383 + message: 'App给到的数据',
  384 + appData: response
  385 + }
378 hasDetails = true 386 hasDetails = true
  387 + mainProcessProgress['4'] = {
  388 + status:'success',
  389 + message: '准备调用:handleArticle方法'
  390 + }
379 handleArticle(details) 391 handleArticle(details)
380 } else { 392 } else {
381 errorResponse() 393 errorResponse()
@@ -399,6 +411,10 @@ const app = Vue.createApp({ @@ -399,6 +411,10 @@ const app = Vue.createApp({
399 hasDetails = true 411 hasDetails = true
400 // 获取用户登录状态 412 // 获取用户登录状态
401 if (hasAppLoginExtra) { 413 if (hasAppLoginExtra) {
  414 + mainProcessProgress['4'] = {
  415 + status:'success',
  416 + message: '准备调用:handleArticle方法'
  417 + }
402 handleArticle(details) 418 handleArticle(details)
403 } else { 419 } else {
404 // const nowDate = dayjs() 420 // const nowDate = dayjs()
@@ -413,6 +429,10 @@ const app = Vue.createApp({ @@ -413,6 +429,10 @@ const app = Vue.createApp({
413 state.creatorID = loginStatusResponse && loginStatusResponse.creatorID 429 state.creatorID = loginStatusResponse && loginStatusResponse.creatorID
414 state.isLogined = 430 state.isLogined =
415 loginStatusResponse && loginStatusResponse.isLogined 431 loginStatusResponse && loginStatusResponse.isLogined
  432 + mainProcessProgress['4'] = {
  433 + status:'success',
  434 + message: '准备调用:handleArticle方法'
  435 + }
416 handleArticle(details) 436 handleArticle(details)
417 }) 437 })
418 } catch (e) { } 438 } catch (e) { }
@@ -453,8 +473,16 @@ const app = Vue.createApp({ @@ -453,8 +473,16 @@ const app = Vue.createApp({
453 state.details = deepCopy(details) 473 state.details = deepCopy(details)
454 state.originDataSource = deepCopy(details) 474 state.originDataSource = deepCopy(details)
455 if (window.config.VUE_BASE_NODE === 'dev') { 475 if (window.config.VUE_BASE_NODE === 'dev') {
  476 + mainProcessProgress['5'] = {
  477 + status:'success',
  478 + message: '准备调用:initApp方法'
  479 + }
456 initApp(details) 480 initApp(details)
457 } else { 481 } else {
  482 + mainProcessProgress['5'] = {
  483 + status:'success',
  484 + message: '准备调用:initApp方法'
  485 + }
458 initApp(details) 486 initApp(details)
459 try { 487 try {
460 // H5传递数据至App 488 // H5传递数据至App
@@ -531,6 +559,10 @@ const app = Vue.createApp({ @@ -531,6 +559,10 @@ const app = Vue.createApp({
531 if (pageError) { 559 if (pageError) {
532 changeAppError() 560 changeAppError()
533 } 561 }
  562 + mainProcessProgress['7'] = {
  563 + status:'success',
  564 + message: '准备调用:initEditorStr方法'
  565 + }
534 initEditorStr(isNewspaper.value) 566 initEditorStr(isNewspaper.value)
535 }) 567 })
536 } 568 }
@@ -642,13 +674,11 @@ const app = Vue.createApp({ @@ -642,13 +674,11 @@ const app = Vue.createApp({
642 if (state.isLogined == 1) { 674 if (state.isLogined == 1) {
643 // 已登录 675 // 已登录
644 if (window.config.VUE_BASE_NODE === 'dev') { 676 if (window.config.VUE_BASE_NODE === 'dev') {
645 - showButton.value = true  
646 showClook.value = true 677 showClook.value = true
647 } else { 678 } else {
648 clookStatus(true) // 查"关注"状态 , 更新按钮上的文字 679 clookStatus(true) // 查"关注"状态 , 更新按钮上的文字
649 } 680 }
650 } else { 681 } else {
651 - showButton.value = true  
652 showClook.value = true 682 showClook.value = true
653 } 683 }
654 } 684 }
@@ -674,6 +704,10 @@ const app = Vue.createApp({ @@ -674,6 +704,10 @@ const app = Vue.createApp({
674 if (actieInfo.title) { actieInfo.show = true } 704 if (actieInfo.title) { actieInfo.show = true }
675 } 705 }
676 706
  707 + mainProcessProgress['6'] = {
  708 + status:'success',
  709 + message: '准备调用:getOthersStatus回调方法'
  710 + }
677 if (callBack) callBack() 711 if (callBack) callBack()
678 } 712 }
679 713
@@ -1052,13 +1086,11 @@ const app = Vue.createApp({ @@ -1052,13 +1086,11 @@ const app = Vue.createApp({
1052 headers: state.appHeader, 1086 headers: state.appHeader,
1053 showError: false 1087 showError: false
1054 }) 1088 })
1055 - showButton.value = true  
1056 if (response.success) { 1089 if (response.success) {
1057 clookStatusSee.value = response.data[0].status == '1' ? false : true // '1' 是已关注 '0'是未关注 1090 clookStatusSee.value = response.data[0].status == '1' ? false : true // '1' 是已关注 '0'是未关注
1058 } 1091 }
1059 } else { 1092 } else {
1060 if (state.creatorID == state.details.rmhId) { 1093 if (state.creatorID == state.details.rmhId) {
1061 - showButton.value = true  
1062 isOwer.value = true 1094 isOwer.value = true
1063 clookStatusSee.value = false 1095 clookStatusSee.value = false
1064 nextTick(() => { 1096 nextTick(() => {
@@ -1093,7 +1125,6 @@ const app = Vue.createApp({ @@ -1093,7 +1125,6 @@ const app = Vue.createApp({
1093 const code = statusResponseMap.code 1125 const code = statusResponseMap.code
1094 const data = statusResponseMap.data 1126 const data = statusResponseMap.data
1095 if ([ 200, '0' ].includes(code)) { 1127 if ([ 200, '0' ].includes(code)) {
1096 - showButton.value = true  
1097 if (data) { 1128 if (data) {
1098 if (data[0].status == '1') { 1129 if (data[0].status == '1') {
1099 state.initClockStatus = !initStatus 1130 state.initClockStatus = !initStatus
@@ -1356,24 +1387,7 @@ const app = Vue.createApp({ @@ -1356,24 +1387,7 @@ const app = Vue.createApp({
1356 data: [ 1387 data: [
1357 { 1388 {
1358 voteInfo: shallowMergeObj(state.originDataSource.voteInfo, { 1389 voteInfo: shallowMergeObj(state.originDataSource.voteInfo, {
1359 - options: [  
1360 - {  
1361 - backColor: '#486FFF',  
1362 - index: 1,  
1363 - optionId: 8537,  
1364 - summary: 2,  
1365 - totalVotes: 1,  
1366 - wordColor: '#FFFFFF'  
1367 - },  
1368 - {  
1369 - backColor: '#486FFF',  
1370 - index: 2,  
1371 - optionId: 8538,  
1372 - summary: 1,  
1373 - totalVotes: 0,  
1374 - wordColor: '#FFFFFF'  
1375 - }  
1376 - ] 1390 + options: voteOtions.value
1377 }) 1391 })
1378 } 1392 }
1379 ] 1393 ]
@@ -1407,16 +1421,14 @@ const app = Vue.createApp({ @@ -1407,16 +1421,14 @@ const app = Vue.createApp({
1407 sendNative( 1421 sendNative(
1408 'jsCall_callAppService', 1422 'jsCall_callAppService',
1409 { 1423 {
1410 - method: 'post', 1424 + method: 'get',
1411 url: '/api/rmrb-bff-display-zh/content/zh/c/content/detail', 1425 url: '/api/rmrb-bff-display-zh/content/zh/c/content/detail',
1412 parameters: { 1426 parameters: {
1413 - contents: shallowMergeObj({  
1414 - contentId: eq  
1415 - }, reLInfo) 1427 + contentId: eq,
  1428 + ...reLInfo
1416 } 1429 }
1417 }, 1430 },
1418 (res) => { 1431 (res) => {
1419 - logInfo('res', res)  
1420 try { 1432 try {
1421 const refResponse = 1433 const refResponse =
1422 typeof res === 'object' ? res : JSON.parse(res) 1434 typeof res === 'object' ? res : JSON.parse(res)
@@ -1456,6 +1468,7 @@ const app = Vue.createApp({ @@ -1456,6 +1468,7 @@ const app = Vue.createApp({
1456 const voteStatus = async (vId, index, callBack) => { 1468 const voteStatus = async (vId, index, callBack) => {
1457 if (window.config.VUE_BASE_NODE === 'dev') { 1469 if (window.config.VUE_BASE_NODE === 'dev') {
1458 voteInit.value = true 1470 voteInit.value = true
  1471 + state.voteState.optionId = voteOtions.value[0].optionId
1459 state.voteState.status = 1 // 决定是投票前0 还是 投票后1 1472 state.voteState.status = 1 // 决定是投票前0 还是 投票后1
1460 nextTick(() => handleVoteList()) 1473 nextTick(() => handleVoteList())
1461 if (state.details.voteInfo.style === 1) { 1474 if (state.details.voteInfo.style === 1) {
@@ -1493,10 +1506,12 @@ const app = Vue.createApp({ @@ -1493,10 +1506,12 @@ const app = Vue.createApp({
1493 if ([ 200, '0' ].includes(code) && data) { 1506 if ([ 200, '0' ].includes(code) && data) {
1494 if (Object.keys(data).length > 0) { 1507 if (Object.keys(data).length > 0) {
1495 try { 1508 try {
  1509 + voteInit.value = true
1496 state.voteState.status = data.status // 决定是投票前0 还是 投票后1 1510 state.voteState.status = data.status // 决定是投票前0 还是 投票后1
1497 state.voteState.optionId = data.optionId // 返回的是 被投票项的 optionId ,没投就是 '' 1511 state.voteState.optionId = data.optionId // 返回的是 被投票项的 optionId ,没投就是 ''
1498 nextTick(() => handleVoteList()) 1512 nextTick(() => handleVoteList())
1499 - } catch (e) {} 1513 + } catch (e) {
  1514 + }
1500 if (state.details.voteInfo.style === 1) { 1515 if (state.details.voteInfo.style === 1) {
1501 // 展示对 √ 1516 // 展示对 √
1502 if (index) { 1517 if (index) {
@@ -1914,6 +1929,7 @@ const app = Vue.createApp({ @@ -1914,6 +1929,7 @@ const app = Vue.createApp({
1914 document.querySelector('.skeleton-loading').classList.add('active') 1929 document.querySelector('.skeleton-loading').classList.add('active')
1915 appBlock(false) 1930 appBlock(false)
1916 1931
  1932 + mainProcessProgress = {}
1917 time.value = '' 1933 time.value = ''
1918 deviceType.value = judgTerminal() === 1 ? 'ad' : 'ios' 1934 deviceType.value = judgTerminal() === 1 ? 'ad' : 'ios'
1919 statrTime.value = dayjs() 1935 statrTime.value = dayjs()
@@ -1928,7 +1944,6 @@ const app = Vue.createApp({ @@ -1928,7 +1944,6 @@ const app = Vue.createApp({
1928 isNewspaper.value = false 1944 isNewspaper.value = false
1929 voteInit.value = false 1945 voteInit.value = false
1930 showClook.value = false 1946 showClook.value = false
1931 - showButton.value = false  
1932 optionList.value = [] 1947 optionList.value = []
1933 subjectList.value = [] 1948 subjectList.value = []
1934 channelList.value = [] 1949 channelList.value = []
@@ -2054,7 +2069,6 @@ const app = Vue.createApp({ @@ -2054,7 +2069,6 @@ const app = Vue.createApp({
2054 optionList, 2069 optionList,
2055 showClook, 2070 showClook,
2056 clookStatusSee, 2071 clookStatusSee,
2057 - showButton,  
2058 timeLine, 2072 timeLine,
2059 shareOpen, 2073 shareOpen,
2060 hasReadCount, 2074 hasReadCount,
@@ -2092,5 +2106,6 @@ const app = Vue.createApp({ @@ -2092,5 +2106,6 @@ const app = Vue.createApp({
2092 app.mount('#app') 2106 app.mount('#app')
2093 2107
2094 app.config.errorHandler = (err) => { 2108 app.config.errorHandler = (err) => {
2095 - h5ErrorPage(err.toString()) 2109 + const ev = handleJsError('vue-errorHandler', err, err.message)
  2110 + h5ErrorPage(ev, err)
2096 } 2111 }
  1 +!function(e,t){"use strict";"function"==typeof define&&define.amd?define("stackframe",[],t):"object"==typeof exports?module.exports=t():e.StackFrame=t()}(this,function(){"use strict";function e(e){return e.charAt(0).toUpperCase()+e.substring(1)}function t(e){return function(){return this[e]}}var r=["isConstructor","isEval","isNative","isToplevel"],n=["columnNumber","lineNumber"],i=["fileName","functionName","source"],a=r.concat(n,i,["args"],["evalOrigin"]);function o(t){if(t)for(var r=0;r<a.length;r++)void 0!==t[a[r]]&&this["set"+e(a[r])](t[a[r]])}o.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof o)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new o(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",n=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:n?n+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},o.fromString=function(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),n=e.substring(0,t),i=e.substring(t+1,r).split(","),a=e.substring(r+1);if(0===a.indexOf("@"))var s=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(a,""),c=s[1],u=s[2],f=s[3];return new o({functionName:n,args:i||void 0,fileName:c,lineNumber:u||void 0,columnNumber:f||void 0})};for(var s=0;s<r.length;s++)o.prototype["get"+e(r[s])]=t(r[s]),o.prototype["set"+e(r[s])]=function(e){return function(t){this[e]=Boolean(t)}}(r[s]);for(var c=0;c<n.length;c++)o.prototype["get"+e(n[c])]=t(n[c]),o.prototype["set"+e(n[c])]=function(e){return function(t){if(r=t,isNaN(parseFloat(r))||!isFinite(r))throw new TypeError(e+" must be a Number");var r;this[e]=Number(t)}}(n[c]);for(var u=0;u<i.length;u++)o.prototype["get"+e(i[u])]=t(i[u]),o.prototype["set"+e(i[u])]=function(e){return function(t){this[e]=String(t)}}(i[u]);return o}),function(e,t){"use strict";"function"==typeof define&&define.amd?define("error-stack-parser",["stackframe"],t):"object"==typeof exports?module.exports=t(require("stackframe")):e.ErrorStackParser=t(e.StackFrame)}(this,function(e){"use strict";var t=/(^|@)\S+:\d+/,r=/^\s*at .*(\S+:\d+|\(native\))/m,n=/^(eval@)?(\[native code])?$/;return{parse:function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return this.parseOpera(e);if(e.stack&&e.stack.match(r))return this.parseV8OrIE(e);if(e.stack)return this.parseFFOrSafari(e);throw new Error("Cannot parse given Error object")},extractLocation:function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]},parseV8OrIE:function(t){return t.stack.split("\n").filter(function(e){return!!e.match(r)},this).map(function(t){t.indexOf("(eval ")>-1&&(t=t.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var r=t.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),n=r.match(/ (\(.+\)$)/);r=n?r.replace(n[0],""):r;var i=this.extractLocation(n?n[1]:r),a=n&&r||void 0,o=["eval","<anonymous>"].indexOf(i[0])>-1?void 0:i[0];return new e({functionName:a,fileName:o,lineNumber:i[1],columnNumber:i[2],source:t})},this)},parseFFOrSafari:function(t){return t.stack.split("\n").filter(function(e){return!e.match(n)},this).map(function(t){if(t.indexOf(" > eval")>-1&&(t=t.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===t.indexOf("@")&&-1===t.indexOf(":"))return new e({functionName:t});var r=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=t.match(r),i=n&&n[1]?n[1]:void 0,a=this.extractLocation(t.replace(r,""));return new e({functionName:i,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:t})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(t){for(var r=/Line (\d+).*script (?:in )?(\S+)/i,n=t.message.split("\n"),i=[],a=2,o=n.length;a<o;a+=2){var s=r.exec(n[a]);s&&i.push(new e({fileName:s[2],lineNumber:s[1],source:n[a]}))}return i},parseOpera10:function(t){for(var r=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=t.stacktrace.split("\n"),i=[],a=0,o=n.length;a<o;a+=2){var s=r.exec(n[a]);s&&i.push(new e({functionName:s[3]||void 0,fileName:s[2],lineNumber:s[1],source:n[a]}))}return i},parseOpera11:function(r){return r.stack.split("\n").filter(function(e){return!!e.match(t)&&!e.match(/^Error created at/)},this).map(function(t){var r,n=t.split("@"),i=this.extractLocation(n.pop()),a=n.shift()||"",o=a.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;a.match(/\(([^)]*)\)/)&&(r=a.replace(/^[^(]+\(([^)]*)\)$/,"$1"));var s=void 0===r||"[arguments not available]"===r?void 0:r.split(",");return new e({functionName:o,args:s,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:t})},this)}}});
  2 +//# sourceMappingURL=error-stack-parser.min.js.map
@@ -15,7 +15,7 @@ function playerVideo(player, events) { @@ -15,7 +15,7 @@ function playerVideo(player, events) {
15 const top = player.container.parentNode.offsetTop 15 const top = player.container.parentNode.offsetTop
16 const left = player.container.parentNode.getBoundingClientRect().left 16 const left = player.container.parentNode.getBoundingClientRect().left
17 const videoLandscape = width > height ? '1' : (width < height ? '2' : '') 17 const videoLandscape = width > height ? '1' : (width < height ? '2' : '')
18 - const videoUrl = player.options.record.url 18 + const videoUrl = player.options ? player.options.record ? player.options.record.url : '' : ''
19 19
20 if (window.config.VUE_BASE_NODE === 'dev') { 20 if (window.config.VUE_BASE_NODE === 'dev') {
21 console.log('视频播放', width, height, left, top, videoLandscape) 21 console.log('视频播放', width, height, left, top, videoLandscape)
@@ -31,7 +31,7 @@ class videoEnPlayer extends Emitter { @@ -31,7 +31,7 @@ class videoEnPlayer extends Emitter {
31 31
32 initOhtersPlayer() { 32 initOhtersPlayer() {
33 const domId = this.container.getAttribute('id') 33 const domId = this.container.getAttribute('id')
34 - const url = this.options.record.url 34 + const url = this.options ? this.options.record ? this.options.record.url : '' : ''
35 const isDark = document.querySelector('html').getAttribute('dark-mode') === 'true' 35 const isDark = document.querySelector('html').getAttribute('dark-mode') === 'true'
36 this.originPoster = this.options.record.poster 36 this.originPoster = this.options.record.poster
37 this.previewPoster = this.options.record.poster 37 this.previewPoster = this.options.record.poster
@@ -157,7 +157,9 @@ class DomUtil { @@ -157,7 +157,9 @@ class DomUtil {
157 157
158 // 处理所有表格属性 158 // 处理所有表格属性
159 for (let i = 0; i < tableAllDom.length; i++) { 159 for (let i = 0; i < tableAllDom.length; i++) {
160 - tableAllDom[i].setAttribute('width', '') 160 + if (tableAllDom[i]) {
  161 + tableAllDom[i].setAttribute('width', '')
  162 + }
161 } 163 }
162 164
163 // 处理图片点亮 165 // 处理图片点亮
@@ -833,7 +835,7 @@ class DomUtil { @@ -833,7 +835,7 @@ class DomUtil {
833 const isInline = style && style.display ? style.display.indexOf('inline') > -1 : false 835 const isInline = style && style.display ? style.display.indexOf('inline') > -1 : false
834 if (!classList.includes('not-preview-image') && name !== 'people' && !isInline) { 836 if (!classList.includes('not-preview-image') && name !== 'people' && !isInline) {
835 effectImage.push(imageDom[i]) 837 effectImage.push(imageDom[i])
836 - } else { 838 + } else if (imageDom[i]) {
837 imageDom[i].setAttribute('status', 'loading') 839 imageDom[i].setAttribute('status', 'loading')
838 } 840 }
839 } else { 841 } else {
@@ -959,8 +961,10 @@ class DomUtil { @@ -959,8 +961,10 @@ class DomUtil {
959 let height = 0 961 let height = 0
960 const videoEl = videoDomList[i] 962 const videoEl = videoDomList[i]
961 const videoElId = `origin-video-${i}` 963 const videoElId = `origin-video-${i}`
962 - videoEl.setAttribute('id', videoElId)  
963 - videoEl.setAttribute('class', 'en-origin-video') 964 + if (videoEl) {
  965 + videoEl.setAttribute('id', videoElId)
  966 + videoEl.setAttribute('class', 'en-origin-video')
  967 + }
964 const src = videoDomList[i].getAttribute('src') 968 const src = videoDomList[i].getAttribute('src')
965 if (!src) break 969 if (!src) break
966 if (videoEl && videoEl.style.display === 'none') break 970 if (videoEl && videoEl.style.display === 'none') break
@@ -1034,7 +1038,9 @@ class DomUtil { @@ -1034,7 +1038,9 @@ class DomUtil {
1034 const aEl = document.querySelectorAll('#newsContent a') 1038 const aEl = document.querySelectorAll('#newsContent a')
1035 for (let i = 0; i < aEl.length; i++) { 1039 for (let i = 0; i < aEl.length; i++) {
1036 const url = aEl[i].getAttribute('href') 1040 const url = aEl[i].getAttribute('href')
1037 - aEl[i].setAttribute('data-href', url || '') 1041 + if (aEl[i]) {
  1042 + aEl[i].setAttribute('data-href', url || '')
  1043 + }
1038 aEl[i].removeAttribute('href') 1044 aEl[i].removeAttribute('href')
1039 aEl[i].style.textDecoration = 'underline' 1045 aEl[i].style.textDecoration = 'underline'
1040 } 1046 }
1 -function h5ErrorPage(message) { 1 +const ERROR_ID = []
  2 +
  3 +function h5ErrorPage(message, error) {
  4 + if (error && !getIsReportId(error)) return
  5 +
2 pageErrorTypePoint({ errorMessage: message }) 6 pageErrorTypePoint({ errorMessage: message })
3 errorBlock( 7 errorBlock(
4 './image/content_fail.svg', 8 './image/content_fail.svg',
@@ -6,13 +10,49 @@ function h5ErrorPage(message) { @@ -6,13 +10,49 @@ function h5ErrorPage(message) {
6 ) 10 )
7 } 11 }
8 12
  13 +function getErrorId(val) {
  14 + return window.btoa(decodeURIComponent(encodeURIComponent(val)))
  15 +}
  16 +
  17 +function getIsReportId(error) {
  18 + const id = getErrorId(error?.message || error?.fileName)
  19 + const even = item => item === id
  20 + if (ERROR_ID.some(even)) {
  21 + console.warn(`Duplicate error, not reported, ${error?.message}`)
  22 + return false
  23 + } else {
  24 + ERROR_ID.push(id)
  25 + return true
  26 + }
  27 +}
  28 +
  29 +function handleJsError(type, ev, message) {
  30 + let stackFrame = ErrorStackParser.parse(ev)[0]
  31 + // 错误文件、行号、列号、源文件、堆栈等等
  32 + let { source } = stackFrame
  33 + const stack = `${type}: ` + message + ` ${trim(source)}`
  34 + return stack
  35 +}
9 36
10 window.onerror = function (message, source, lineno, colno, error) { 37 window.onerror = function (message, source, lineno, colno, error) {
11 - h5ErrorPage(message) 38 + console.log(111)
  39 + const ev = handleJsError('window-onerror', error, error.message)
  40 + h5ErrorPage(ev, error)
12 } 41 }
13 42
  43 +window.addEventListener('error', function (error) {
  44 + const ev = handleJsError('addEventListener-error', error.error, error.message)
  45 + h5ErrorPage(ev, error)
  46 +})
  47 +
14 window.addEventListener('unhandledrejection', function (e) { 48 window.addEventListener('unhandledrejection', function (e) {
15 e.preventDefault() 49 e.preventDefault()
16 - h5ErrorPage(e.reason.stack) 50 + const ev = handleJsError('unhandledrejection-error', e.reason, e.reason.message)
  51 + h5ErrorPage(ev, e.reason)
  52 + // 唯一id判断
  53 + // const error = e.reason.stack
  54 + // const errorSource = extractParenthesesContent(error || '')
  55 + // const first = error ? error.split('\n')[0] : error
  56 + // h5ErrorPage(first + ` (${errorSource.map(el => `"${el}"`).join('、')})`)
17 return true 57 return true
18 }) 58 })
@@ -21,6 +21,8 @@ const userAgent = navigator.userAgent @@ -21,6 +21,8 @@ const userAgent = navigator.userAgent
21 // 页面加载模式 21 // 页面加载模式
22 var darkMode = 'light' 22 var darkMode = 'light'
23 // var darkMode = 'dark' 23 // var darkMode = 'dark'
  24 +// 页面主进程进度
  25 +var mainProcessProgress = {}
24 26
25 /** 27 /**
26 * @Author gx12358 28 * @Author gx12358
@@ -266,6 +266,81 @@ function setHtmlBaseOptions(appData) { @@ -266,6 +266,81 @@ function setHtmlBaseOptions(appData) {
266 } 266 }
267 } 267 }
268 268
  269 +/**
  270 + * @Author gx12358
  271 + * @DateTime 2024/9/23
  272 + * @lastTime 2024/9/23
  273 + * @description 处理客户端给到的数据
  274 + */
  275 +function handleAppData(appData) {
  276 + const data =
  277 + typeof appData === 'object' ? appData : JSON.parse(appData)
  278 + if (data.dataJson) {
  279 + const dataJson =
  280 + typeof data.dataJson === 'object'
  281 + ? data.dataJson
  282 + : JSON.parse(data.dataJson)
  283 + return dataJson
  284 + }
  285 +
  286 + return null
  287 +}
  288 +
  289 +/**
  290 + * @Author gx12358
  291 + * @DateTime 2024/9/23
  292 + * @lastTime 2024/9/23
  293 + * @description 拿到详情接口数据
  294 + */
  295 +function handleAppDetails(responseMap) {
  296 + let initialRes = responseMap
  297 + initialRes =
  298 + typeof initialRes === 'object'
  299 + ? initialRes
  300 + : JSON.parse(initialRes)
  301 +
  302 + return initialRes
  303 +}
  304 +
  305 +/**
  306 + * @Author gx12358
  307 + * @DateTime 2024/9/23
  308 + * @lastTime 2024/9/23
  309 + * @description appData - init
  310 + */
  311 +function detailsChange(appData, responseCallback) {
  312 + // const data =
  313 + // typeof appData === 'object' ? appData : JSON.parse(appData)
  314 + const dataJson = handleAppData(appData)
  315 + // try {
  316 + // sendNative(
  317 + // 'jsCall_h5TrackingEvent',
  318 + // {
  319 + // eventId: 'h5_article_page_browse',
  320 + // parameters: {
  321 + // appData: JSON.stringify(data)
  322 + // }
  323 + // }
  324 + // )
  325 + // } catch (e) {}
  326 + mainProcessProgress = {}
  327 + mainProcessProgress['1'] = {
  328 + status:'success',
  329 + message: 'App给到的数据',
  330 + appData: JSON.stringify(handleAppDetails(dataJson))
  331 + }
  332 + window.config.VUE_CONTENT_CONFIG = appData
  333 + setHtmlBaseOptions(appData)
  334 + if (document.querySelector('#detail-change')) {
  335 + mainProcessProgress['2'] = {
  336 + status:'success',
  337 + message: '准备调用:requestApp方法'
  338 + }
  339 + document.querySelector('#detail-change').click()
  340 + }
  341 + if (responseCallback) responseCallback(appData)
  342 +}
  343 +
269 /* 该方法由H5预埋,App加载完成后 app主动传递数据用。 */ 344 /* 该方法由H5预埋,App加载完成后 app主动传递数据用。 */
270 document.addEventListener('DOMContentLoaded', function () { 345 document.addEventListener('DOMContentLoaded', function () {
271 if (window.config.VUE_BASE_NODE === 'dev') { 346 if (window.config.VUE_BASE_NODE === 'dev') {
@@ -325,23 +400,13 @@ document.addEventListener('DOMContentLoaded', function () { @@ -325,23 +400,13 @@ document.addEventListener('DOMContentLoaded', function () {
325 if (judgTerminal() === 1) { 400 if (judgTerminal() === 1) {
326 connectWebViewJavascriptBridge(function (bridge) { 401 connectWebViewJavascriptBridge(function (bridge) {
327 bridge.registerHandler('jsCall_receiveAppData', function (appData, responseCallback) { 402 bridge.registerHandler('jsCall_receiveAppData', function (appData, responseCallback) {
328 - window.config.VUE_CONTENT_CONFIG = appData  
329 - setHtmlBaseOptions(appData)  
330 - if (document.querySelector('#detail-change')) {  
331 - document.querySelector('#detail-change').click()  
332 - }  
333 - if (responseCallback) responseCallback(appData) 403 + detailsChange(appData, responseCallback)
334 }) 404 })
335 }) 405 })
336 } else { 406 } else {
337 setupWebViewJavascriptBridge(function (bridge) { 407 setupWebViewJavascriptBridge(function (bridge) {
338 bridge.registerHandler('jsCall_receiveAppData', function (appData, responseCallback) { 408 bridge.registerHandler('jsCall_receiveAppData', function (appData, responseCallback) {
339 - window.config.VUE_CONTENT_CONFIG = appData  
340 - setHtmlBaseOptions(appData)  
341 - if (document.querySelector('#detail-change')) {  
342 - document.querySelector('#detail-change').click()  
343 - }  
344 - if (responseCallback) responseCallback(appData) 409 + detailsChange(appData, responseCallback)
345 }) 410 })
346 }) 411 })
347 } 412 }
@@ -1019,8 +1019,16 @@ function pageErrorTypePoint({ @@ -1019,8 +1019,16 @@ function pageErrorTypePoint({
1019 newsId, 1019 newsId,
1020 errorMessage 1020 errorMessage
1021 }) { 1021 }) {
1022 - logInfo('contentId', newsId || contentId)  
1023 - logInfo('error', errorMessage) 1022 + const parameters = {
  1023 + newsId: newsId || contentId,
  1024 + errorMessage,
  1025 + userAgent,
  1026 + date: dayjs().format('YYYY-MM-DD HH:mm:ss'),
  1027 + mainProcessProgress: JSON.stringify(mainProcessProgress)
  1028 + }
  1029 + logInfo(Object.assign(parameters, {
  1030 + mainProcessProgress
  1031 + }))
1024 try { 1032 try {
1025 sendNative('jsCall_currentPageOperate', { 1033 sendNative('jsCall_currentPageOperate', {
1026 operateType: '50' 1034 operateType: '50'
@@ -1032,10 +1040,7 @@ function pageErrorTypePoint({ @@ -1032,10 +1040,7 @@ function pageErrorTypePoint({
1032 'jsCall_h5TrackingEvent', 1040 'jsCall_h5TrackingEvent',
1033 { 1041 {
1034 eventId: 'h5_article_page_error', 1042 eventId: 'h5_article_page_error',
1035 - parameters: {  
1036 - newsId: newsId || contentId,  
1037 - errorMessage  
1038 - } 1043 + parameters
1039 } 1044 }
1040 ) 1045 )
1041 } catch (e) {} 1046 } catch (e) {}
@@ -1381,7 +1386,7 @@ function jumpAppInnerFun(record, url) { @@ -1381,7 +1386,7 @@ function jumpAppInnerFun(record, url) {
1381 if (window.config.VUE_BASE_NODE === 'dev') { 1386 if (window.config.VUE_BASE_NODE === 'dev') {
1382 axiosRequest({ 1387 axiosRequest({
1383 url: '/content/zh/c/content/detail', 1388 url: '/content/zh/c/content/detail',
1384 - methot: 'post', 1389 + methot: 'get',
1385 appStatus: false, 1390 appStatus: false,
1386 // isMock: true, 1391 // isMock: true,
1387 // weakNetwork: true, 1392 // weakNetwork: true,
@@ -1391,14 +1396,11 @@ function jumpAppInnerFun(record, url) { @@ -1391,14 +1396,11 @@ function jumpAppInnerFun(record, url) {
1391 //接口前缀 1396 //接口前缀
1392 prefix: '/api/rmrb-bff-display-zh', 1397 prefix: '/api/rmrb-bff-display-zh',
1393 //给接口传的数据 1398 //给接口传的数据
1394 - data: {  
1395 - contents: [  
1396 - {  
1397 - //内容id  
1398 - contentId: record.contentId,  
1399 - relId: record.relId  
1400 - }  
1401 - ] 1399 + params: {
  1400 + //内容id
  1401 + contentId: record.contentId,
  1402 + relId: record.relId,
  1403 + relType: record.relType,
1402 }, 1404 },
1403 //请求头信息 1405 //请求头信息
1404 headers: shallowMerge({ 1406 headers: shallowMerge({
@@ -1425,16 +1427,13 @@ function jumpAppInnerFun(record, url) { @@ -1425,16 +1427,13 @@ function jumpAppInnerFun(record, url) {
1425 sendNative( 1427 sendNative(
1426 'jsCall_callAppService', 1428 'jsCall_callAppService',
1427 { 1429 {
1428 - method: 'post', 1430 + method: 'get',
1429 url: '/api/rmrb-bff-display-zh/content/zh/c/content/detail', 1431 url: '/api/rmrb-bff-display-zh/content/zh/c/content/detail',
1430 - parameters: {  
1431 - contents: [  
1432 - {  
1433 - //内容id  
1434 - contentId: record.contentId,  
1435 - relId: record.relId  
1436 - }  
1437 - ] 1432 + parameters: {
  1433 + //内容id
  1434 + contentId: record.contentId,
  1435 + relId: record.relId,
  1436 + relType: record.relType,
1438 } 1437 }
1439 }, 1438 },
1440 (res) => { 1439 (res) => {