Browse Source

fix(live): 修复直播间性别判断逻辑错误

- 修改了直播间加入频道的ID参数
- 调整了性别判断条件,男性代码从1改为0,女性代码从2改为1
- 更新了聊天室加入逻辑中的性别角色分配
- 添加了调试日志以方便追踪rtc频道详情和用户性别信息
ios
Jolie 4 months ago
parent
commit
dc0ad55c04
2 changed files with 8 additions and 4 deletions
  1. 2
      lib/pages/discover/discover_page.dart
  2. 10
      lib/widget/live/live_room_notice_chat_panel.dart

2
lib/pages/discover/discover_page.dart

@ -166,7 +166,7 @@ class _LiveItemState extends State<LiveItem> {
return InkWell(
onTap: () async{
// Get.to(() => LiveRoomPage(id: 0));
await roomController.joinChannel('1189028638616588288');
await roomController.joinChannel('1190111071629873152');
},
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(10.w)),

10
lib/widget/live/live_room_notice_chat_panel.dart

@ -76,8 +76,12 @@ class _LiveRoomNoticeChatPanelState extends State<LiveRoomNoticeChatPanel> {
),
SizedBox(width: 18.w),
Obx((){
if(controller.rtcChannelDetail.value?.maleInfo == null && GlobalData().userData?.genderCode == 1 && controller.currentRole != CurrentRole.broadcaster ||
controller.rtcChannelDetail.value?.femaleInfo == null && GlobalData().userData?.genderCode == 2 && controller.currentRole != CurrentRole.broadcaster){
Get.log("${controller.rtcChannelDetail.value?.maleInfo}");
Get.log("${controller.rtcChannelDetail.value?.femaleInfo}");
Get.log("${controller.currentRole}");
Get.log("${GlobalData().userData?.genderCode}");
if(controller.rtcChannelDetail.value?.maleInfo == null && GlobalData().userData?.genderCode == 0 && controller.currentRole != CurrentRole.broadcaster ||
controller.rtcChannelDetail.value?.femaleInfo == null && GlobalData().userData?.genderCode == 1 && controller.currentRole != CurrentRole.broadcaster){
return Container(
width: 120.w,
height: 55.w,
@ -125,7 +129,7 @@ class _LiveRoomNoticeChatPanelState extends State<LiveRoomNoticeChatPanel> {
if(controller.isLive){
await controller.leaveChat();
}else{
await controller.joinChat(GlobalData().userData?.genderCode == 1 ? CurrentRole.maleAudience : CurrentRole.femaleAudience);
await controller.joinChat(GlobalData().userData?.genderCode == 0 ? CurrentRole.maleAudience : CurrentRole.femaleAudience);
}
});
}

Loading…
Cancel
Save