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
+2 -2
View File
@@ -1,5 +1,5 @@
<template>
<view class="event-card" @click="$emit('tap', event)">
<view class="event-card" @click="$emit('item-click', event)">
<!-- 状态标签 -->
<view class="event-status" :class="'status-' + event.status">
<text class="event-status-text">{{ statusLabel }}</text>
@@ -46,7 +46,7 @@ export default {
props: {
event: { type: Object, default: () => ({}) }
},
emits: ['tap'],
emits: ['item-click'],
computed: {
statusLabel() {
const map = { open: '报名中', ongoing: '进行中', ended: '已结束' }
+2 -2
View File
@@ -1,5 +1,5 @@
<template>
<view class="feed-card" @click="$emit('tap', feed)">
<view class="feed-card" @click="$emit('item-click', feed)">
<!-- 头部头像+昵称+时间 -->
<view class="feed-header">
<view class="feed-avatar-wrap">
@@ -68,7 +68,7 @@ export default {
props: {
feed: { type: Object, default: () => ({}) }
},
emits: ['tap', 'like', 'comment', 'share'],
emits: ['item-click', 'like', 'comment', 'share'],
methods: {
getCatIcon,
isIconPath,
+2 -2
View File
@@ -1,5 +1,5 @@
<template>
<view class="friend-item" @click="$emit('tap', friend)">
<view class="friend-item" @click="$emit('item-click', friend)">
<view class="friend-avatar-wrap">
<image v-if="friend.avatar" class="friend-avatar" :src="friend.avatar" mode="aspectFill"></image>
<view v-else class="friend-avatar friend-avatar-ph">
@@ -21,7 +21,7 @@ export default {
props: {
friend: { type: Object, default: () => ({}) }
},
emits: ['tap']
emits: ['item-click']
}
</script>