修改广告跳转页面异常的问题

This commit is contained in:
赵毅 2025-08-05 09:39:45 +08:00
parent d64fa80c13
commit f52d8cbcc6

View File

@ -427,26 +427,27 @@ export default {
headerServerClick(e) { headerServerClick(e) {
console.log("当前点击内容", e); console.log("当前点击内容", e);
if (!e.link_url) { if (!e.target_page) {
this.NotOpen(); this.NotOpen();
return; return;
} }
if (e.link_url) { if (e.target_page) {
// #ifdef APP-PLUS // #ifdef APP-PLUS
uni.navigateTo({ uni.navigateTo({
url: "/pages/webview/webview?url=" + encodeURIComponent(e.link_url), url:
"/pages/webview/webview?url=" + encodeURIComponent(e.target_page),
}); });
// #endif // #endif
// #ifdef H5 // #ifdef H5
window.open(e.link_url, "_blank"); window.open(e.target_page, "_blank");
// #endif // #endif
// #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU // #ifdef MP-WEIXIN || MP-ALIPAY || MP-BAIDU
if (e.appid) { if (e.appid) {
uni.navigateToMiniProgram({ uni.navigateToMiniProgram({
appId: e.appid, appId: e.appid,
path: e.link_url, path: e.target_page,
// //
extraData: { extraData: {
data1: "test", data1: "test",
@ -456,18 +457,23 @@ export default {
}, },
}); });
} else { } else {
NavgateTo(e.link_url); //
let targetPage = e.target_page;
if (!targetPage.startsWith("/")) {
targetPage = "/" + targetPage;
}
NavgateTo(targetPage);
// NavgateTo('/packages/localLife/index/index') // NavgateTo('/packages/localLife/index/index')
} }
// 使web-view // 使web-view
// uni.showModal({ // uni.showModal({
// title: '', // title: '',
// content: ': ' + e.link_url, // content: ': ' + e.target_page,
// confirmText: '', // confirmText: '',
// success(res) { // success(res) {
// if (res.confirm) { // if (res.confirm) {
// uni.setClipboardData({ // uni.setClipboardData({
// data: e.link_url, // data: e.target_page,
// success() { // success() {
// uni.showToast({ // uni.showToast({
// title: '', // title: '',