feat(sdk): 更新 SDK 设计文档和 API 重构
- 添加 expiresAt 和 refreshUserSig 参数支持自动续签 - 修改 PushSDK 初始化方式,自动完成设备注册和厂商初始化 - 调整过期续签策略,从提前 15 分钟改为提前 5 分钟触发 - 重构 RN SDK 文档结构,简化安装和使用方式 - 更新统一登录流程,支持 profile 信息传递 - 添加 IM 数据库自动隔离功能 - 修复 Android 群消息聚合问题 - 补充自动化测试验证和错误处理机制
这个提交包含在:
父节点
5ec928da81
当前提交
ac72012443
@ -7,6 +7,7 @@ Page({
|
|||||||
activeTab: 'conv',
|
activeTab: 'conv',
|
||||||
conversations: [],
|
conversations: [],
|
||||||
friends: [],
|
friends: [],
|
||||||
|
groups: [],
|
||||||
messages: [],
|
messages: [],
|
||||||
currentTarget: '',
|
currentTarget: '',
|
||||||
currentChatType: 'SINGLE',
|
currentChatType: 'SINGLE',
|
||||||
@ -25,6 +26,7 @@ Page({
|
|||||||
|
|
||||||
this.loadConversations()
|
this.loadConversations()
|
||||||
this.loadFriends()
|
this.loadFriends()
|
||||||
|
this.loadGroups()
|
||||||
},
|
},
|
||||||
|
|
||||||
onUnload() {
|
onUnload() {
|
||||||
@ -65,6 +67,21 @@ Page({
|
|||||||
this.setData({ activeTab: e.currentTarget.dataset.tab })
|
this.setData({ activeTab: e.currentTarget.dataset.tab })
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async loadGroups() {
|
||||||
|
try {
|
||||||
|
const groups = await app.globalData.sdk.listGroups()
|
||||||
|
this.setData({ groups })
|
||||||
|
} catch (err) {
|
||||||
|
console.error('loadGroups failed', err)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
startGroupChat(e) {
|
||||||
|
const id = e.currentTarget.dataset.id
|
||||||
|
this.setData({ currentTarget: id, currentChatType: 'GROUP', messages: [] })
|
||||||
|
this.loadHistory(id, 'GROUP')
|
||||||
|
},
|
||||||
|
|
||||||
selectConv(e) {
|
selectConv(e) {
|
||||||
const { id, type } = e.currentTarget.dataset
|
const { id, type } = e.currentTarget.dataset
|
||||||
this.setData({ currentTarget: id, currentChatType: type, messages: [] })
|
this.setData({ currentTarget: id, currentChatType: type, messages: [] })
|
||||||
|
|||||||
@ -8,6 +8,7 @@
|
|||||||
<view class="tab-bar">
|
<view class="tab-bar">
|
||||||
<view class="tab {{activeTab==='conv'?'active':''}}" bindtap="switchTab" data-tab="conv">会话</view>
|
<view class="tab {{activeTab==='conv'?'active':''}}" bindtap="switchTab" data-tab="conv">会话</view>
|
||||||
<view class="tab {{activeTab==='friend'?'active':''}}" bindtap="switchTab" data-tab="friend">好友</view>
|
<view class="tab {{activeTab==='friend'?'active':''}}" bindtap="switchTab" data-tab="friend">好友</view>
|
||||||
|
<view class="tab {{activeTab==='group'?'active':''}}" bindtap="switchTab" data-tab="group">群组</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<scroll-view scroll-y class="list">
|
<scroll-view scroll-y class="list">
|
||||||
@ -25,6 +26,14 @@
|
|||||||
</view>
|
</view>
|
||||||
<view wx:if="{{friends.length===0}}" class="empty">暂无好友</view>
|
<view wx:if="{{friends.length===0}}" class="empty">暂无好友</view>
|
||||||
</block>
|
</block>
|
||||||
|
|
||||||
|
<block wx:if="{{activeTab==='group'}}">
|
||||||
|
<view wx:for="{{groups}}" wx:key="id" class="item" bindtap="startGroupChat" data-id="{{item.id}}">
|
||||||
|
<view class="item-title">{{item.name}}</view>
|
||||||
|
<view class="item-meta">{{item.memberIds ? JSON.parse(item.memberIds).length : 0}} 人</view>
|
||||||
|
</view>
|
||||||
|
<view wx:if="{{groups.length===0}}" class="empty">暂无群组</view>
|
||||||
|
</block>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
|||||||
正在加载...
在新工单中引用
屏蔽一个用户