zhb 2 недель назад
Родитель
Сommit
c11fff20d2
2 измененных файлов с 2 добавлено и 2 удалено
  1. 1 1
      pages/common/webview.vue
  2. 1 1
      utils/openExternalUrl.js

+ 1 - 1
pages/common/webview.vue

@@ -48,7 +48,7 @@ onLoad((options) => {
   console.log('webview 接收参数:', options)
 
   title.value = options.title || '文件预览'
-  const realUrl = options.url || ''
+  const realUrl = decodeURIComponent(options.url || '')
   fileType.value = getFileExt(realUrl)
 
   // ✅ 核心修复:PDF 只编码一次,不再二次编码

+ 1 - 1
utils/openExternalUrl.js

@@ -13,7 +13,7 @@ export function openExternalUrl(url, type, options = {}) {
 
   if (type === 'pay') {
     // #ifdef APP-PLUS
-    const webviewUrl = `/pages/common/webview?url=${url}&title=${encodeURIComponent(title)}`
+    const webviewUrl = `/pages/common/webview?url=${encodeURIComponent(url)}&title=${encodeURIComponent(title)}`
     uni.navigateTo({ url: webviewUrl })
     // #endif