|
@@ -13,9 +13,30 @@ import { t } from '@/locale'
|
|
|
|
|
|
|
|
const params = ref({})
|
|
const params = ref({})
|
|
|
|
|
|
|
|
|
|
+function openInNewTabAndClose(url) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ if (typeof window !== 'undefined') {
|
|
|
|
|
+ const win = window.open(url, '_blank')
|
|
|
|
|
+ if (!win)
|
|
|
|
|
+ window.location.href = url
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ finally {
|
|
|
|
|
+ uni.navigateBack()
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
onLoad((options) => {
|
|
onLoad((options) => {
|
|
|
params.value = options
|
|
params.value = options
|
|
|
params.value.link = decodeURIComponent(params.value.link)
|
|
params.value.link = decodeURIComponent(params.value.link)
|
|
|
|
|
+
|
|
|
|
|
+ // #ifdef H5
|
|
|
|
|
+ if (typeof params.value.link === 'string' && params.value.link.startsWith('http://')) {
|
|
|
|
|
+ openInNewTabAndClose(params.value.link)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ // #endif
|
|
|
|
|
+
|
|
|
uni.setNavigationBarTitle({
|
|
uni.setNavigationBarTitle({
|
|
|
title: decodeURIComponent(params.value.title) || t('webLink.title'),
|
|
title: decodeURIComponent(params.value.title) || t('webLink.title'),
|
|
|
})
|
|
})
|