From 44727015e9d6f420bc7e0535be0b8506e1d67f21 Mon Sep 17 00:00:00 2001 From: xufei <727302827@qq.com> Date: Mon, 8 Jun 2026 10:18:43 +0800 Subject: [PATCH] =?UTF-8?q?2026.6.8=20=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF?= =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../home/unit/unit_service_list_page.dart | 10 +-- lib/pages/user/full_userinfo_page.dart | 74 +++++++++++++++---- 2 files changed, 66 insertions(+), 18 deletions(-) diff --git a/lib/pages/home/unit/unit_service_list_page.dart b/lib/pages/home/unit/unit_service_list_page.dart index 2b05311..1c300e0 100644 --- a/lib/pages/home/unit/unit_service_list_page.dart +++ b/lib/pages/home/unit/unit_service_list_page.dart @@ -110,11 +110,11 @@ class _UnitServiceListPageState extends State { //查看 void _goToDetail(Map item) async { - await pushPage( - UnitJoinDetailPage(firmId: item['id'],), - context, - ); - _fetchData(); + // await pushPage( + // UnitJoinDetailPage(firmId: item['id'],), + // context, + // ); + // _fetchData(); } diff --git a/lib/pages/user/full_userinfo_page.dart b/lib/pages/user/full_userinfo_page.dart index 1bd9d53..6014644 100644 --- a/lib/pages/user/full_userinfo_page.dart +++ b/lib/pages/user/full_userinfo_page.dart @@ -252,7 +252,7 @@ class _FullUserinfoPageState extends State { _birthText = idInfo.birth ?? ''; } - if (idPhotos.length < 2 && !_isChange) { + if (_idCardImgList.length < 2 && _isChange) { ToastUtil.showNormal(context, '请上传2张身份证照片'); return; } @@ -547,33 +547,81 @@ class _FullUserinfoPageState extends State { onTap: () {}, ), const Divider(), - if (_isEdit || _idCardImgList.isNotEmpty) + if (!_isEdit&&_idCardImgList.isNotEmpty)//_isEdit||_idCardImgList.isNotEmpty RepairedPhotoSection( title: '身份证照片', - isRequired: _isEdit, + isRequired: false, maxCount: 2, initialMediaPaths: _idCardImgList .map( (item) => ApiService.baseImgPath + item, ) .toList(), - isEdit: _isEdit, - horizontalPadding: _isEdit ? 12 : 0, + isEdit: false, + horizontalPadding: false ? 12 : 0, inlineImageWidth: 60, onChanged: (files) { - idPhotos = files.map((file) => file.path).toList(); + // idPhotos = files.map((file) => file.path).toList(); }, onMediaRemovedForIndex: (index) async { - final deleFile = _idCardImgList[index]; - final deleId = _idCartImgIds[index]; - if (deleFile.contains(UploadFileType.idCardPhoto.path)) { - _idCardImgList.removeAt(index); - _idCartImgIds.removeAt(index); - _idCardImgRemoveList.add(deleId); - } + // final deleFile = _idCardImgList[index]; + // final deleId = _idCartImgIds[index]; + // if (deleFile.contains(UploadFileType.idCardPhoto.path)) { + // _idCardImgList.removeAt(index); + // _idCartImgIds.removeAt(index); + // _idCardImgRemoveList.add(deleId); + // } }, onAiIdentify: () {}, ), + + if (_isEdit ) + RepairedPhotoSection( + title: '身份证照片', + isRequired: true, + maxCount: 2, + followInitialUpdates:true, + initialMediaPaths: _idCardImgList + .map( + (item) => ApiService.baseImgPath + item, + ) + .toList(), + isEdit: true, + horizontalPadding: true ? 12 : 0, + inlineImageWidth: 60, + onChanged: (files) { + // idPhotos = files.map((file) => file.path).toList(); + }, + onMediaAdded: (value) { + setState(() { + idPhotos.add(value); + _idCardImgList.add(value); + }); + }, + onMediaRemovedForIndex: (index) async { + final deleFile = _idCardImgList[index]; + try{ + final deleId = _idCartImgIds[index]; + if (deleFile.contains(UploadFileType.idCardPhoto.path)) { + setState(() { + _idCardImgList.removeAt(index); + _idCartImgIds.removeAt(index); + _idCardImgRemoveList.add(deleId); + }); + } + }catch(e){ + setState(() { + _idCardImgList.removeAt(index); + // 删除匹配的文件路径 + idPhotos.removeWhere((path) => path == deleFile); + }); + debugPrint('$e'); + } + + }, + onAiIdentify: () {}, + ), + if (_isEdit) ItemListWidget.itemContainer( const Text(