feat(event): 添加酒局报名审核功能并优化前端组件
- 新增 ApproveEvent API 接口用于审核报名用户
- 在 EventCard 组件中显示待审核状态(⏳ 待审核)
- 实现酒局发起人审核报名用户的完整流程
- 添加用户协议和隐私政策页面
- 优化 FeedCard 组件中的图片展示逻辑
- 修复连续打卡天数计算问题
- 更新 HaveADrink SDK 至 1.0.15 版本
This commit is contained in:
+20
-2
@@ -131,6 +131,7 @@ export default {
|
||||
headerPaddingTop: (menuBtn.top + 8) + 'px',
|
||||
friendId: '',
|
||||
nickname: '',
|
||||
myUserId: '',
|
||||
conversationId: '',
|
||||
messages: [],
|
||||
inputText: '',
|
||||
@@ -148,6 +149,11 @@ export default {
|
||||
this.friendId = options.friendId || ''
|
||||
this.nickname = decodeURIComponent(options.nickname || '')
|
||||
this.conversationId = options.conversationId || ''
|
||||
// 读取当前用户ID(与 circle/profile 页同源:user_info.id),用于区分消息发送方
|
||||
try {
|
||||
const user = JSON.parse(uni.getStorageSync('user_info') || '{}')
|
||||
this.myUserId = user.id !== undefined && user.id !== null ? String(user.id) : ''
|
||||
} catch (e) { this.myUserId = '' }
|
||||
this.initChat()
|
||||
// 监听键盘高度变化,动态调整输入栏位置(避免键盘顶起整个页面)
|
||||
uni.onKeyboardHeightChange(res => {
|
||||
@@ -308,7 +314,7 @@ export default {
|
||||
const msg = {
|
||||
id: clientMsgId,
|
||||
conversationId: this.conversationId,
|
||||
senderId: wsManager.userId || 'self',
|
||||
senderId: this.myUserId || wsManager.userId || 'self',
|
||||
receiverId: this.friendId,
|
||||
type: 'text',
|
||||
content: text,
|
||||
@@ -370,8 +376,20 @@ export default {
|
||||
},
|
||||
|
||||
// === 辅助方法 ===
|
||||
/**
|
||||
* 判断消息是否自己发的:直接靠 senderId/receiverId 与当前用户ID(user_info.id)对比。
|
||||
* 不能用 wsManager.userId:WS 连接成功前为空,会导致历史消息全部误判。
|
||||
*/
|
||||
isSelf(msg) {
|
||||
return String(msg.senderId) === String(wsManager.userId) || msg.senderId === 'self'
|
||||
const myId = this.myUserId || (wsManager.userId ? String(wsManager.userId) : '')
|
||||
if (myId) {
|
||||
if (String(msg.senderId) === myId) return true
|
||||
if (String(msg.receiverId) === myId) return false
|
||||
}
|
||||
// 兜底(无当前用户ID时):会话内发送者只会是双方之一
|
||||
if (msg.senderId === 'self') return true
|
||||
if (this.friendId && String(msg.senderId) === String(this.friendId)) return false
|
||||
return true
|
||||
},
|
||||
|
||||
showTimeDivider(idx) {
|
||||
|
||||
Reference in New Issue
Block a user