chore:名片导航栏颜色改成白色”名片“这两个字改成黑色
This commit is contained in:
@@ -1477,9 +1477,9 @@
|
|||||||
{
|
{
|
||||||
"path": "card/detail",
|
"path": "card/detail",
|
||||||
"style": {
|
"style": {
|
||||||
"navigationBarTitleText": "我的名片",
|
"navigationBarTitleText": "名片",
|
||||||
"navigationBarBackgroundColor": "#2aa5ff",
|
"navigationBarBackgroundColor": "#ffffff",
|
||||||
"navigationBarTextStyle": "white"
|
"navigationBarTextStyle": "black"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -350,11 +350,19 @@ export default {
|
|||||||
},
|
},
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.cardId = decodeURIComponent(options.card_id || '');
|
this.cardId = decodeURIComponent(options.card_id || '');
|
||||||
|
this.applyPageTitle();
|
||||||
this.loadDetail();
|
this.loadDetail();
|
||||||
this.loadExchange();
|
this.loadExchange();
|
||||||
this.loadDesignEnabled();
|
this.loadDesignEnabled();
|
||||||
},
|
},
|
||||||
|
// H5 直接刷新/深链进入时, uni-page-head 可能在路由 meta 就绪前就挂载,
|
||||||
|
// 此时标题会回落到 document.title(uni-app H5 默认值 "title");
|
||||||
|
// onLoad 设得过早会被这次回落覆盖, 故 onReady(已挂载)再设一次兜死。
|
||||||
|
onReady() {
|
||||||
|
this.applyPageTitle();
|
||||||
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
this.applyPageTitle();
|
||||||
// 首次进入由 onLoad 负责加载; 从编辑页返回时(onShow 再次触发)刷新
|
// 首次进入由 onLoad 负责加载; 从编辑页返回时(onShow 再次触发)刷新
|
||||||
if (this._loadedOnce) {
|
if (this._loadedOnce) {
|
||||||
this.loadDetail();
|
this.loadDetail();
|
||||||
@@ -378,6 +386,15 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 导航栏标题统一出口: 小程序/鸿蒙/App 走原生导航栏;
|
||||||
|
// H5 额外同步 document.title, 避免 uni-page-head 标题回落到默认值 "title"。
|
||||||
|
applyPageTitle() {
|
||||||
|
const title = '名片';
|
||||||
|
uni.setNavigationBarTitle({ title });
|
||||||
|
// #ifdef H5
|
||||||
|
document.title = title;
|
||||||
|
// #endif
|
||||||
|
},
|
||||||
goEdit() {
|
goEdit() {
|
||||||
if (!this.cardId) return;
|
if (!this.cardId) return;
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
|||||||
Reference in New Issue
Block a user