From 4bd36db70f695743dbd0dce8aa7a0a33f8995b56 Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Sat, 25 Jul 2026 15:57:37 +0800 Subject: [PATCH 1/3] =?UTF-8?q?chore=EF=BC=9A=E5=BE=AE=E4=BF=A1=E5=B0=8F?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=87=AA=E5=AE=9A=E4=B9=89=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=B7=B2=E7=BB=8F=E5=8F=AF=E4=BB=A5=E5=BC=80=E5=A7=8B=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages_tool/vr/index.vue | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pages_tool/vr/index.vue b/pages_tool/vr/index.vue index 2dd6fe5..9fc0e49 100644 --- a/pages_tool/vr/index.vue +++ b/pages_tool/vr/index.vue @@ -1,6 +1,6 @@ @@ -27,17 +27,24 @@ export default { }); }, onShow() { - this.updateNavbarTitle(); + if (this.title) { + uni.setNavigationBarTitle({ title: this.title }); + } }, watch: { title(newVal) { - this.updateNavbarTitle(newVal); + if (newVal) { + uni.setNavigationBarTitle({ title: newVal }); + } } }, methods: { - updateNavbarTitle(newTitle) { - const title = newTitle ?? this.title; - uni.setNavigationBarTitle({title}); + onWebViewLoad() { + if (this.title) { + setTimeout(() => { + uni.setNavigationBarTitle({ title: this.title }); + }, 100); + } } } }; From a70a29eda1a74ee27d6326e74f267a9ae205c2d9 Mon Sep 17 00:00:00 2001 From: jinhhanhan <1683105490@qq.com> Date: Sat, 25 Jul 2026 17:10:32 +0800 Subject: [PATCH 2/3] =?UTF-8?q?chore=EF=BC=9A=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=A0=87=E9=A2=98=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages_tool/vr/index.vue | 62 +++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 27 deletions(-) diff --git a/pages_tool/vr/index.vue b/pages_tool/vr/index.vue index 9fc0e49..2c8e104 100644 --- a/pages_tool/vr/index.vue +++ b/pages_tool/vr/index.vue @@ -1,6 +1,6 @@ @@ -9,45 +9,53 @@ export default { data() { return { src: '', - title: '' + title: '', + titleTimer: null }; }, onLoad(option) { - this.title = option?.title ?? ''; - this.$api.sendRequest({ - url: '/api/config/defaultvr', - success: res => { - if (res.code == 0) { - this.src = res.data.url; - this.title = res.data.title; - } - }, + this.title = option?.title || '工厂展示'; + uni.setNavigationBarTitle({ title: this.title }); + this.$api.sendRequest({ + url: '/api/config/defaultvr', + success: res => { + if (res.code == 0) { + this.title = res.data.title; + uni.setNavigationBarTitle({ title: this.title }); + this.src = res.data.url; + this.startTitleGuard(); + } + }, fail: res => { } }); }, onShow() { - if (this.title) { - uni.setNavigationBarTitle({ title: this.title }); - } - }, - watch: { - title(newVal) { - if (newVal) { - uni.setNavigationBarTitle({ title: newVal }); - } - } - }, - methods: { - onWebViewLoad() { if (this.title) { - setTimeout(() => { + uni.setNavigationBarTitle({ title: this.title }); + } + }, + + methods: { + startTitleGuard() { + this.clearTitleGuard(); + let count = 0; + this.titleTimer = setInterval(() => { uni.setNavigationBarTitle({ title: this.title }); + count++; + if (count >= 10) { + this.clearTitleGuard(); + } }, 100); + }, + clearTitleGuard() { + if (this.titleTimer) { + clearInterval(this.titleTimer); + this.titleTimer = null; + } } } - } -}; + };