chore:名片导航栏颜色改成白色”名片“这两个字改成黑色

This commit is contained in:
2026-10-17 11:51:10 +08:00
parent fe3f059f58
commit 1276a44b6b
2 changed files with 20 additions and 3 deletions

View File

@@ -350,11 +350,19 @@ export default {
},
onLoad(options) {
this.cardId = decodeURIComponent(options.card_id || '');
this.applyPageTitle();
this.loadDetail();
this.loadExchange();
this.loadDesignEnabled();
},
// H5 直接刷新/深链进入时, uni-page-head 可能在路由 meta 就绪前就挂载,
// 此时标题会回落到 document.title(uni-app H5 默认值 "title");
// onLoad 设得过早会被这次回落覆盖, 故 onReady(已挂载)再设一次兜死。
onReady() {
this.applyPageTitle();
},
onShow() {
this.applyPageTitle();
// 首次进入由 onLoad 负责加载; 从编辑页返回时(onShow 再次触发)刷新
if (this._loadedOnce) {
this.loadDetail();
@@ -378,6 +386,15 @@ export default {
};
},
methods: {
// 导航栏标题统一出口: 小程序/鸿蒙/App 走原生导航栏;
// H5 额外同步 document.title, 避免 uni-page-head 标题回落到默认值 "title"。
applyPageTitle() {
const title = '名片';
uni.setNavigationBarTitle({ title });
// #ifdef H5
document.title = title;
// #endif
},
goEdit() {
if (!this.cardId) return;
uni.navigateTo({