From df1d1e78b464cf98bb1cd3bacaf292ad16d5d5c3 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Sat, 5 Sep 2020 12:07:47 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pageD/privateChat/privateChat.vue | 15 +++++++++++---- pages.json | 2 +- pages/information/information.vue | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pageD/privateChat/privateChat.vue b/pageD/privateChat/privateChat.vue index 2cf173c..efa5f93 100644 --- a/pageD/privateChat/privateChat.vue +++ b/pageD/privateChat/privateChat.vue @@ -132,10 +132,8 @@ this.messages = privateMessages.sentMessages; this.pendingMessages = privateMessages.pendingMessages; - - uni.setNavigationBarTitle({ - title : this.friend.name - }); + console.log(this.friend.name) + this.setTitle(this.friend.name) setTimeout(() => { uni.setNavigationBarColor({ backgroundColor : '#FF780F', @@ -158,6 +156,15 @@ this.imService.uid = 0; }, methods: { + setTitle(title){ + let that = this + uni.setNavigationBarTitle({ + title : title, + fail(){ + that.setTitle(title) + } + }); + }, bindtapInput(){ console.log("222") var _that = this; diff --git a/pages.json b/pages.json index b479026..c1cbc0b 100644 --- a/pages.json +++ b/pages.json @@ -497,7 +497,7 @@ { "path": "privateChat/privateChat", "style": { - "navigationBarTitleText": "uni-app", + "navigationBarTitleText": "商家", "app-plus": { "titleNView": true } diff --git a/pages/information/information.vue b/pages/information/information.vue index dd28c8c..a0eabdb 100644 --- a/pages/information/information.vue +++ b/pages/information/information.vue @@ -149,6 +149,7 @@ }, gochat(id){ + console.log(id) this.$u.route({ url:"/pageD/privateChat/privateChat", params:{ From a3adc35372ca31a43a0c57678501d97f27443003 Mon Sep 17 00:00:00 2001 From: luyuan <1162963624@qq.com> Date: Sat, 5 Sep 2020 12:10:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=A4=E8=AF=BB=E6=98=AF=E4=B8=8D?= =?UTF-8?q?=E6=98=AF=E7=A9=BA=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pageD/privateChat/privateChat.vue | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pageD/privateChat/privateChat.vue b/pageD/privateChat/privateChat.vue index efa5f93..307c0b6 100644 --- a/pageD/privateChat/privateChat.vue +++ b/pageD/privateChat/privateChat.vue @@ -158,6 +158,9 @@ methods: { setTitle(title){ let that = this + if(title == ""){ + title = "这是空的" + } uni.setNavigationBarTitle({ title : title, fail(){