refactor(components): 统一组件点击事件命名规范

- 将 EventCard、FeedCard、FriendItem 组件的点击事件从 'tap' 改为 'item-click'
- 更新相关页面中的事件监听器以匹配新的事件名称
- 在聊天页面优化键盘处理逻辑,添加输入框失焦时的键盘保持功能
- 为圆圈页面添加导航防抖锁,防止页面重复打开
- 调整聊天输入框样式,增加10px缓冲避免与键盘贴合
This commit is contained in:
cg
2026-07-21 22:48:35 +08:00
parent 99723497fa
commit 9052a6f4da
5 changed files with 34 additions and 16 deletions
+7 -3
View File
@@ -43,7 +43,7 @@
:feed="feed"
@like="handleLike"
@comment="goDetail"
@tap="goDetail"
@item-click="goDetail"
/>
<view v-if="loading" class="circle-loading">
<text class="circle-loading-text">加载中...</text>
@@ -75,7 +75,7 @@
v-for="f in friends"
:key="f.id"
:friend="f"
@tap="goChat(f)"
@item-click="goChat(f)"
/>
<EmptyState
v-if="!friends.length"
@@ -95,7 +95,7 @@
v-for="evt in events"
:key="evt.id"
:event="evt"
@tap="goEventDetail"
@item-click="goEventDetail"
/>
<EmptyState
v-if="!events.length"
@@ -226,6 +226,10 @@ export default {
uni.navigateTo({ url: '/pages/friends/friends' })
},
goChat(friend) {
// 导航防抖锁:防止事件重复触发导致页面打开两次
if (this._navLock) return
this._navLock = true
setTimeout(() => { this._navLock = false }, 600)
// 根据 friendId 查找对应会话 (f001 -> conv_001)
const convId = 'conv_' + friend.id.replace('f', '')
uni.navigateTo({