From 5602aa1794d1287c7b75e636cfefbce3a4b0ef65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E8=B4=A4?= Date: Fri, 26 Dec 2025 14:08:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=8E=A7=E5=88=B6=E5=99=A8?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=EF=BC=8C=E4=BC=98=E5=8C=96=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/controller/global.dart | 2 + lib/controller/mine/edit_info_controller.dart | 48 +++++++++++------ lib/pages/mine/edit_info_page.dart | 51 ++++++++++--------- 3 files changed, 61 insertions(+), 40 deletions(-) diff --git a/lib/controller/global.dart b/lib/controller/global.dart index 046dc0c..af3933a 100644 --- a/lib/controller/global.dart +++ b/lib/controller/global.dart @@ -2,6 +2,7 @@ import 'dart:io'; import 'package:dating_touchme_app/controller/discover/discover_controller.dart'; +import 'package:dating_touchme_app/controller/discover/room_controller.dart'; import 'package:dating_touchme_app/controller/home/home_controller.dart'; import 'package:dating_touchme_app/controller/message/conversation_controller.dart'; import 'package:get/get.dart'; @@ -27,6 +28,7 @@ class GlobalData { Get.delete(force: true); Get.delete(force: true); + Get.delete(force: true); Get.delete(force: true); Get.delete(force: true); } diff --git a/lib/controller/mine/edit_info_controller.dart b/lib/controller/mine/edit_info_controller.dart index 3ad1b2e..9caabd9 100644 --- a/lib/controller/mine/edit_info_controller.dart +++ b/lib/controller/mine/edit_info_controller.dart @@ -107,7 +107,6 @@ class EditInfoController extends GetxController { @override void onInit() { super.onInit(); - userData.value = GlobalData().userData; final ImagePickerPlatform imagePickerImplementation = ImagePickerPlatform.instance; if (imagePickerImplementation is ImagePickerAndroid) { @@ -116,6 +115,13 @@ class EditInfoController extends GetxController { _userApi = Get.find(); + getBaseData(); + + + } + + getBaseData() async { + await getInfo(); getEducationList(); getIncomeList(); getMaritalList(); @@ -544,27 +550,21 @@ class EditInfoController extends GetxController { savaImgList() async { try{ - final imgPayload = { + + final originImg = userData.value!.photoList!.map((e) => e.photoUrl).toSet(); + final result = imgList + .where((e) => !originImg.contains(e)) + .toList(); + final imgPayload = { 'miId': userData.value?.id ?? 0, 'authenticationCode': '6', 'value': '0', - 'imgUrl': imgList.isNotEmpty ? imgList : ['0'], + 'imgUrl': result.isNotEmpty ? result : ['0'], }; final imgAuditResp = await _userApi.saveCertificationAudit(imgPayload); if (imgAuditResp.data.isSuccess) { - final result = await _userApi.getMarriageInformationDetail(); - // print(result.data); - if (result.data.isSuccess) { - final information = result.data.data!; - information.matchmakerFlag = userData.value?.matchmakerFlag ?? false; - information.realName = userData.value?.realName; - information.phone = userData.value?.phone; - GlobalData().userData = information; - - await storage.write('userId', GlobalData().userId); - - } + getInfo(); } else{ SmartDialog.showToast(imgAuditResp.data.message); @@ -579,6 +579,24 @@ class EditInfoController extends GetxController { } } + getInfo() async { + final result = await _userApi.getMarriageInformationDetail(); + // print(result.data); + if (result.data.isSuccess) { + final information = result.data.data!; + information.matchmakerFlag = userData.value?.matchmakerFlag ?? false; + information.realName = userData.value?.realName; + information.phone = userData.value?.phone; + GlobalData().userData = information; + + userData.value = GlobalData().userData; + + await storage.write('userId', GlobalData().userId); + setData(); + + } + } + deleteImgList(int index) async { if(userData.value!.photoList!.length > index){ diff --git a/lib/pages/mine/edit_info_page.dart b/lib/pages/mine/edit_info_page.dart index a4b9de0..70916e7 100644 --- a/lib/pages/mine/edit_info_page.dart +++ b/lib/pages/mine/edit_info_page.dart @@ -398,34 +398,15 @@ class _EditInfoPageState extends State { fit: BoxFit.cover, ), ), - if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length > entry.key)Positioned( - left: 5.w, - top: 5.w, - child: Container( - width: 20.w, - height: 20.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20.w)), - color: const Color.fromRGBO(0, 0, 0, .3) - ), - child: Icon( - Icons.close, - size: 20.w, - ), - ).onTap((){ - controller.deleteImgList(entry.key); - }), - ), if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length > entry.key && controller.userData.value!.photoList![entry.key].auditStatus == 0)Positioned( top: 0, right: 0, child: Container( - width: 33.w, - height: 17.w, + width: 70.w, + height: 70.w, decoration: BoxDecoration( - borderRadius: BorderRadius.only( - topRight: Radius.circular(9.w), - bottomLeft: Radius.circular(9.w) + borderRadius: BorderRadius.all( + Radius.circular(9.w) ), color: const Color.fromRGBO(0, 0, 0, .4) ), @@ -433,14 +414,34 @@ class _EditInfoPageState extends State { child: Text( "审核中", style: TextStyle( - fontSize: 8.w, + fontSize: 10.w, color: Colors.white, fontWeight: FontWeight.w500 ), ), ), ), - ) + ), + + if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length > entry.key)Positioned( + right: 5.w, + top: 5.w, + child: Container( + width: 20.w, + height: 20.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.w)), + color: const Color.fromRGBO(0, 0, 0, .3) + ), + child: Icon( + Icons.close, + size: 20.w, + color: Colors.white, + ), + ).onTap((){ + controller.deleteImgList(entry.key); + }), + ), ], ); }),