408249787@qq.com преди 3 дни
родител
ревизия
d7393cd7cb
променени са 1 файла, в които са добавени 9 реда и са изтрити 2 реда
  1. 9 2
      pages/catalog/web-view.uvue

+ 9 - 2
pages/catalog/web-view.uvue

@@ -9,6 +9,7 @@ onMounted(() => {
   webviewSrc.value = router.query().src
   progress.value = router.query().progress
 })
+
 function handleMessage(e) {
   var pages = getCurrentPages();
   const prevPage = pages[pages.length - 2];
@@ -16,7 +17,12 @@ function handleMessage(e) {
 }
 function handleLoad() {
   isLoading.value = false
-  console.log('handleLoad')
+
+}
+function onWebError() {
+  const t = Date.now()
+  webviewSrc.value = router.query().src + '?t=' + t
+  console.log('onWebError')
 }
 onShow(() => {
   var pages = getCurrentPages();
@@ -26,6 +32,7 @@ onShow(() => {
 </script>
 <template>
   <Loading v-show="isLoading" />
-  <web-view :src="webviewSrc" class="w-full h-full" @message="handleMessage" @load="handleLoad"></web-view>
+  <web-view :src="webviewSrc" id="web-view" class="w-full h-full" @message="handleMessage" @load="handleLoad"
+    @error="onWebError"></web-view>
 </template>
 <style lang="less" scoped></style>