Merge remote-tracking branch 'origin/main'

main
hs 2025-09-16 08:28:15 +08:00
commit b5c31a5afe
3 changed files with 43 additions and 7 deletions

View File

@ -282,7 +282,11 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
mediaType: MediaType.video, mediaType: MediaType.video,
initialMediaPaths: _yinHuanVido.map((item) => item.path).toList(), initialMediaPaths: _yinHuanVido.map((item) => item.path).toList(),
onMediaAdded: (value) { onMediaAdded: (value) {
_yinHuanVido.add(ImgData(path: value, id: '')); try{
_yinHuanVido.add(ImgData(path: value, id: ''));
}catch(e){
print("获取视频错误:${e.toString()}");
}
}, },
onMediaRemoved: (value){ onMediaRemoved: (value){
_yinHuanVido.remove(value); _yinHuanVido.remove(value);

View File

@ -162,9 +162,16 @@ class _QuickReportPageState extends State<QuickReportPage> {
maxCount: 1, maxCount: 1,
mediaType: MediaType.video, mediaType: MediaType.video,
onChanged: (List<File> files) { onChanged: (List<File> files) {
// files // _yinHuanVido=files[0].path;
_yinHuanVido=files[0].path;
}, },
onMediaAdded:(value) {
// files
try{
_yinHuanVido=value;
}catch(e){
print("获取视频失败:${e.toString()}");
}
},
onAiIdentify: () { onAiIdentify: () {
// AI // AI
}, },

View File

@ -5,6 +5,7 @@ import 'package:fluttertoast/fluttertoast.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart'; import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/pages/mine/mine_set_pwd_page.dart'; import 'package:qhd_prevention/pages/mine/mine_set_pwd_page.dart';
import 'package:qhd_prevention/services/auth_service.dart'; import 'package:qhd_prevention/services/auth_service.dart';
import 'package:shared_preferences/shared_preferences.dart';
import '../tools/tools.dart'; import '../tools/tools.dart';
import 'main_tab.dart'; import 'main_tab.dart';
import 'mine/webViewPage.dart'; import 'mine/webViewPage.dart';
@ -56,10 +57,33 @@ class _LoginPageState extends State<LoginPage> {
super.initState(); super.initState();
_phoneController.addListener(_onTextChanged); _phoneController.addListener(_onTextChanged);
_phoneController.text= SessionService.instance.loginPhone ?? "";
_passwordController.text= SessionService.instance.loginPass?? ""; _getData();
// _phoneController.text= SessionService.instance.loginPhone ?? "";
// _passwordController.text= SessionService.instance.loginPass?? "";
_checkUpdata(); _checkUpdata();
} }
Future<void> _getData() async {
final prefs = await SharedPreferences.getInstance();
setState(() {
_phoneController.text= prefs.getString('savePhone') ?? '';
_passwordController.text=prefs.getString('savePass') ?? '';
});
}
Future<void> _saveData(String phone,String pass) async {
final prefs = await SharedPreferences.getInstance();
await prefs.setString("savePhone", phone);
await prefs.setString("savePass", pass);
}
void dispose() { void dispose() {
_phoneController.removeListener(_onTextChanged); _phoneController.removeListener(_onTextChanged);
_phoneController.dispose(); _phoneController.dispose();
@ -373,8 +397,9 @@ class _LoginPageState extends State<LoginPage> {
final userName = _phoneController.text.trim(); final userName = _phoneController.text.trim();
final userPwd = _passwordController.text; final userPwd = _passwordController.text;
SessionService.instance.setSavePhone(userName); _saveData(userName,userPwd);
SessionService.instance.setSavePass(userPwd); // SessionService.instance.setSavePhone(userName);
// SessionService.instance.setSavePass(userPwd);
setState(() => _isLoading = true); setState(() => _isLoading = true);
showDialog( showDialog(