Merge remote-tracking branch 'origin/main'
commit
b5c31a5afe
|
@ -282,7 +282,11 @@ class _HazardRegistrationPageState extends State<HazardRegistrationPage> {
|
|||
mediaType: MediaType.video,
|
||||
initialMediaPaths: _yinHuanVido.map((item) => item.path).toList(),
|
||||
onMediaAdded: (value) {
|
||||
_yinHuanVido.add(ImgData(path: value, id: ''));
|
||||
try{
|
||||
_yinHuanVido.add(ImgData(path: value, id: ''));
|
||||
}catch(e){
|
||||
print("获取视频错误:${e.toString()}");
|
||||
}
|
||||
},
|
||||
onMediaRemoved: (value){
|
||||
_yinHuanVido.remove(value);
|
||||
|
|
|
@ -162,9 +162,16 @@ class _QuickReportPageState extends State<QuickReportPage> {
|
|||
maxCount: 1,
|
||||
mediaType: MediaType.video,
|
||||
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: () {
|
||||
// AI 视频识别逻辑
|
||||
},
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:fluttertoast/fluttertoast.dart';
|
|||
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
||||
import 'package:qhd_prevention/pages/mine/mine_set_pwd_page.dart';
|
||||
import 'package:qhd_prevention/services/auth_service.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import '../tools/tools.dart';
|
||||
import 'main_tab.dart';
|
||||
import 'mine/webViewPage.dart';
|
||||
|
@ -56,10 +57,33 @@ class _LoginPageState extends State<LoginPage> {
|
|||
super.initState();
|
||||
_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();
|
||||
}
|
||||
|
||||
|
||||
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() {
|
||||
_phoneController.removeListener(_onTextChanged);
|
||||
_phoneController.dispose();
|
||||
|
@ -373,8 +397,9 @@ class _LoginPageState extends State<LoginPage> {
|
|||
final userName = _phoneController.text.trim();
|
||||
final userPwd = _passwordController.text;
|
||||
|
||||
SessionService.instance.setSavePhone(userName);
|
||||
SessionService.instance.setSavePass(userPwd);
|
||||
_saveData(userName,userPwd);
|
||||
// SessionService.instance.setSavePhone(userName);
|
||||
// SessionService.instance.setSavePass(userPwd);
|
||||
|
||||
setState(() => _isLoading = true);
|
||||
showDialog(
|
||||
|
|
Loading…
Reference in New Issue