1.成员搜索框共享标识问题

2.退出两次确认
This commit is contained in:
fuenmao 2024-12-24 16:44:41 +08:00
parent 8e9e4b2812
commit 620f5067d6
4 changed files with 30 additions and 21 deletions

View File

@ -1,9 +1,11 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:signalr_core/signalr_core.dart'; import 'package:signalr_core/signalr_core.dart';
import 'package:wgshare/common/models/common/base_structure_result.dart'; import 'package:wgshare/common/models/common/base_structure_result.dart';
import 'package:wgshare/common/mixins/request_tool_mixin.dart'; import 'package:wgshare/common/mixins/request_tool_mixin.dart';
import '../../common/models/meeting_room_item.dart'; import '../../common/models/meeting_room_item.dart';
import '../../utils/toast_utils.dart';
import 'home_state.dart'; import 'home_state.dart';
class HomeLogic extends GetxController with RequestToolMixin { class HomeLogic extends GetxController with RequestToolMixin {
@ -54,4 +56,20 @@ class HomeLogic extends GetxController with RequestToolMixin {
doHttpGetMeetingRoomList(state.pageIndex.value,state.pageSize.value); doHttpGetMeetingRoomList(state.pageIndex.value,state.pageSize.value);
} }
/// 退
bool closeOnConfirm(BuildContext context) {
DateTime now = DateTime.now();
// 4, 退
if (state.currentBackPressTime == null ||
now.difference(state.currentBackPressTime!) > const Duration(seconds: 4)) {
state.currentBackPressTime = now;
ToastUtils.showInfo("再按一次退出");
return false;
}
// 退
state.currentBackPressTime = null;
return true;
}
} }

View File

@ -25,4 +25,7 @@ class HomeState {
/// ///
final RxInt totalPage = 0.obs; final RxInt totalPage = 0.obs;
/// 退
DateTime? currentBackPressTime;
} }

View File

@ -37,13 +37,15 @@ class HomePageState extends State<HomePage> with AutomaticKeepAliveClientMixin {
super.build(context); super.build(context);
return PopScope( return PopScope(
canPop: false, canPop: false,
onPopInvoked: (bool didPop) async { onPopInvoked: (bool didPop) async {
if (didPop) { if (didPop) {
return; return;
} else { }
SystemNavigator.pop(); if (logic.closeOnConfirm(context)) {
} // 退
}, SystemNavigator.pop();
}
},
child: Scaffold( child: Scaffold(
appBar: AppBar( appBar: AppBar(
surfaceTintColor: Colors.white, surfaceTintColor: Colors.white,

View File

@ -236,25 +236,11 @@ class MeetingMainLogic extends GetxController with RequestToolMixin {
// //
}else{ }else{
// //
//
var isCurrentUserIsCamera = false;
for (var i = 0; i < state.cacheUsers.value.length; i++) { for (var i = 0; i < state.cacheUsers.value.length; i++) {
if (state.remoteUid.value == state.cacheUsers.value[i].screenShareId) { if (state.remoteUid.value == state.cacheUsers.value[i].screenShareId) {
state.cacheUsers.value[i].enableShare = true; state.cacheUsers.value[i].enableShare = true;
isCurrentUserIsCamera = true;
} }
} }
if (isCurrentUserIsCamera == true) {
//
debugPrint("wgs输出===:当前会议室存在全员观看主播时,切换页面到视频状态");
changePageState(1);
} else {
// ID为空并切换页面到视频状态
debugPrint("wgs输出===当前会议室不存在全员观看主播时设置主播ID为空并切换页面到视频状态");
state.remoteUid.value = "";
changePageState(1);
}
} }
} }
} }