2 Commits
fbb84fdf0f
...
dde5bc76db
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
dde5bc76db |
feat(call): 实现通话类型图标区分和RTC频道管理功能
- 根据通话类型显示不同的图标:视频通话显示视频图标,语音通话显示语音图标 - 为通话项添加颜色区分,发送方显示白色,接收方显示橙色 - 新增消费一对一RTC频道响应模型定义 - 实现观众离开时断开RTC频道连接功能 - 优化主播离开时的RTC频道销毁逻辑 - 为语音和视频通话分别显示对应的价格信息 |
2 months ago |
|
|
832dc1a21d |
feat(call): 添加RTC通话消费响应处理和玫瑰余额显示
- 引入ConsumeRtcChannelResponse模型用于处理消费响应数据 - 在CallController中添加consumeResponse响应变量存储消费信息 - 移除延迟调用消费接口改为直接启动定时器 - 实现消费响应数据更新和状态检查逻辑 - 添加status为3时自动挂断通话的功能 - 实现免费通话检测和定时器停止机制 - 在视频通话页面显示玫瑰剩余数量和每分钟价格信息 - 优化通话界面UI布局添加余额显示组件 |
2 months ago |
8 changed files with 156 additions and 34 deletions
Unified View
Diff Options
-
17lib/controller/discover/room_controller.dart
-
32lib/controller/message/call_controller.dart
-
42lib/model/rtc/consume_rtc_channel_response.dart
-
3lib/network/rtc_api.dart
-
35lib/network/rtc_api.g.dart
-
46lib/pages/message/video_call_page.dart
-
8lib/widget/message/call_item.dart
-
7lib/widget/message/call_type_selection_dialog.dart
@ -0,0 +1,42 @@ |
|||||
|
/// 消费一对一RTC频道响应模型 |
||||
|
class ConsumeRtcChannelResponse { |
||||
|
final bool isFree; |
||||
|
final int status; |
||||
|
final int availableBalance; |
||||
|
final int unitSellingBalance; |
||||
|
final String? code; |
||||
|
|
||||
|
ConsumeRtcChannelResponse({ |
||||
|
required this.isFree, |
||||
|
required this.status, |
||||
|
required this.availableBalance, |
||||
|
required this.unitSellingBalance, |
||||
|
this.code, |
||||
|
}); |
||||
|
|
||||
|
factory ConsumeRtcChannelResponse.fromJson(Map<String, dynamic> json) { |
||||
|
return ConsumeRtcChannelResponse( |
||||
|
isFree: json['isFree'] as bool? ?? false, |
||||
|
status: json['status'] as int? ?? 0, |
||||
|
availableBalance: json['availableBalance'] as int? ?? 0, |
||||
|
unitSellingBalance: json['unitSellingBalance'] as int? ?? 0, |
||||
|
code: json['code'] as String?, |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
Map<String, dynamic> toJson() { |
||||
|
return { |
||||
|
'isFree': isFree, |
||||
|
'status': status, |
||||
|
'availableBalance': availableBalance, |
||||
|
'unitSellingBalance': unitSellingBalance, |
||||
|
'code': code, |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
@override |
||||
|
String toString() { |
||||
|
return 'ConsumeRtcChannelResponse(isFree: $isFree, status: $status, availableBalance: $availableBalance, unitSellingBalance: $unitSellingBalance, code: $code)'; |
||||
|
} |
||||
|
} |
||||
|
|
||||
Write
Preview
Loading…
Cancel
Save