|
|
|
@ -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<UserApi>(); |
|
|
|
|
|
|
|
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){ |
|
|
|
|