feat(chat): 添加私信功能和WebSocket实时通信

- 集成WebSocket管理器,支持心跳、自动重连、消息队列
- 实现私信相关API接口,包括会话列表、历史消息、已读标记等
- 添加聊天页面和会话列表页面,支持实时消息收发
- 配置地图权限和腾讯地图SDK用于酒局定位功能
- 修改应用名称为"喝酒了么"并更新应用描述
- 在App.vue中初始化WebSocket连接和私信功能
- 添加详细的私信模块接口文档和Mock数据
- 优化单图片动态高度计算和预加载逻辑
This commit is contained in:
cg
2026-07-21 21:27:01 +08:00
parent 0332aabba0
commit eaa0d7101f
14 changed files with 2112 additions and 38 deletions
+75
View File
@@ -53,6 +53,22 @@
</view>
</view>
<!-- 地图展示 -->
<view class="evt-map-section" v-if="event.latitude">
<map
class="evt-map"
:latitude="event.latitude"
:longitude="event.longitude"
:markers="eventMarkers"
:scale="15"
:show-location="true"
></map>
<view class="evt-map-nav-btn" @click="openNavigation">
<text class="evt-map-nav-icon">🧭</text>
<text class="evt-map-nav-text">导航到这里</text>
</view>
</view>
<!-- 发起人 -->
<view class="evt-organizer">
<text class="evt-section-label">发起人</text>
@@ -131,6 +147,17 @@ export default {
if (!this.event) return ''
const map = { open: '报名中', ongoing: '进行中', ended: '已结束' }
return map[this.event.status] || '报名中'
},
eventMarkers() {
if (!this.event || !this.event.latitude) return []
return [{
id: 1,
latitude: this.event.latitude,
longitude: this.event.longitude,
title: this.event.location,
width: 28,
height: 38
}]
}
},
onLoad(options) {
@@ -186,6 +213,18 @@ export default {
} catch (e) {
uni.showToast({ title: '签到失败', icon: 'none' })
}
},
openNavigation() {
if (!this.event || !this.event.latitude) return
uni.openLocation({
latitude: this.event.latitude,
longitude: this.event.longitude,
name: this.event.location,
address: this.event.address || this.event.location,
fail: () => {
uni.showToast({ title: '无法打开地图', icon: 'none' })
}
})
}
}
}
@@ -324,6 +363,42 @@ export default {
font-weight: $fw-medium;
}
/* 地图区域 */
.evt-map-section {
margin-bottom: $sp-xl;
border-radius: $radius-xl;
overflow: hidden;
border: 1rpx solid var(--border-faint, rgba(255,255,255,0.08));
}
.evt-map {
width: 100%;
height: 320rpx;
}
.evt-map-nav-btn {
display: flex;
align-items: center;
justify-content: center;
gap: $sp-sm;
padding: $sp-md;
background: $bg-card;
&:active {
background: $bg-card-alt;
}
}
.evt-map-nav-icon {
font-size: $fs-base;
}
.evt-map-nav-text {
font-size: $fs-base;
color: $amber;
font-weight: $fw-bold;
}
/* 发起人 & 参与者 */
.evt-section-label {
display: block;