rename(app): 将应用名称从"干杯日记"更改为"碰盏日记"

- 替换所有文件中的品牌名称引用,包括App.vue、pages.json、uni.scss等
- 更新全局样式、导航栏标题和组件中的文案显示
- 修改分享功能中的应用名称显示
- 调整聊天页面的输入栏键盘适配逻辑
- 在多个页面组件中添加事件发射声明以支持交互功能
This commit is contained in:
cg
2026-07-21 22:20:08 +08:00
parent c4d30b8990
commit 99723497fa
25 changed files with 81 additions and 44 deletions
+30 -2
View File
@@ -90,7 +90,7 @@
</scroll-view>
<!-- 底部输入栏 -->
<view class="chat-input-bar">
<view class="chat-input-bar" :style="inputBarStyle">
<view class="chat-input-wrap">
<input
class="chat-input"
@@ -98,7 +98,9 @@
placeholder="说点什么..."
placeholder-class="chat-input-ph"
confirm-type="send"
:adjust-position="true"
:adjust-position="false"
:focus="inputFocus"
:hold-keyboard="true"
@confirm="sendMessage"
@input="onInput"
/>
@@ -130,6 +132,8 @@ export default {
conversationId: '',
messages: [],
inputText: '',
inputFocus: false,
keyboardHeight: 0,
scrollToId: '',
isOnline: false,
peerTyping: false,
@@ -145,12 +149,28 @@ export default {
this.loadMessages()
this.markRead()
this.bindWsEvents()
// 监听键盘高度变化,动态调整输入栏位置(避免键盘顶起整个页面)
uni.onKeyboardHeightChange(res => {
this.keyboardHeight = res.height
if (res.height > 0) {
this.$nextTick(() => this.scrollToBottom())
}
})
},
onUnload() {
this.unbindWsEvents()
if (this.typingTimer) {
clearTimeout(this.typingTimer)
}
uni.offKeyboardHeightChange()
},
computed: {
inputBarStyle() {
if (this.keyboardHeight > 0) {
return { paddingBottom: this.keyboardHeight + 'px' }
}
return {}
}
},
methods: {
// === 数据加载 ===
@@ -258,6 +278,12 @@ export default {
this.inputText = ''
this.$nextTick(() => this.scrollToBottom())
// 保持键盘不收起:先失焦再重新聚焦输入框(仿微信发送后键盘保留)
this.inputFocus = false
this.$nextTick(() => {
this.inputFocus = true
})
// 通过 WebSocket 发送
wsManager.send('chat', {
receiverId: this.friendId,
@@ -288,6 +314,7 @@ export default {
/** 输入时通知对方 */
onInput() {
this.inputFocus = true
wsManager.send('typing', { receiverId: this.friendId })
},
@@ -549,6 +576,7 @@ export default {
padding-bottom: calc(env(safe-area-inset-bottom) + #{$sp-md});
background: $bg-base;
border-top: 1rpx solid var(--border-faint, rgba(255,255,255,0.08));
transition: padding-bottom 0.15s ease-out;
}
.chat-input-wrap {