From 6e40453ccede6fcb0a502315d7f1ed90a073b070 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AD=90=E8=B4=A4?= Date: Thu, 20 Nov 2025 18:16:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BF=AE=E6=94=B9=E8=B5=84?= =?UTF-8?q?=E6=96=99=E9=80=BB=E8=BE=91=EF=BC=8C=E5=AF=B9=E6=8E=A5=E6=8F=90?= =?UTF-8?q?=E7=8E=B0=E7=9B=B8=E5=85=B3=E6=8E=A5=E5=8F=A3=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=94=A8=E6=88=B7=E8=AF=A6=E6=83=85=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E5=92=8C=E6=B5=8B=E8=AF=95=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/controller/mine/edit_info_controller.dart | 212 ++++++-- lib/controller/mine/user_controller.dart | 6 + lib/controller/mine/withdraw_controller.dart | 55 ++ .../mine/withdraw_history_controller.dart | 43 ++ lib/model/home/user_info_data.dart | 513 ++++++++++++++++++ lib/model/mine/withdraw_audit_data.dart | 157 ++++++ lib/model/mine/withdraw_data.dart | 28 + lib/network/api_urls.dart | 4 + lib/network/user_api.dart | 28 + lib/network/user_api.g.dart | 140 +++++ lib/pages/home/user_information_page.dart | 66 +-- lib/pages/mine/add_bankcard_page.dart | 3 - lib/pages/mine/edit_info_page.dart | 306 +++++------ lib/pages/mine/withdraw_history_page.dart | 154 +++--- lib/pages/mine/withdraw_page.dart | 229 +++++++- pubspec.lock | 2 +- pubspec.yaml | 1 + 17 files changed, 1643 insertions(+), 304 deletions(-) create mode 100644 lib/controller/mine/withdraw_history_controller.dart create mode 100644 lib/model/home/user_info_data.dart create mode 100644 lib/model/mine/withdraw_audit_data.dart create mode 100644 lib/model/mine/withdraw_data.dart diff --git a/lib/controller/mine/edit_info_controller.dart b/lib/controller/mine/edit_info_controller.dart index 05ffc7b..76988d3 100644 --- a/lib/controller/mine/edit_info_controller.dart +++ b/lib/controller/mine/edit_info_controller.dart @@ -2,12 +2,14 @@ import 'dart:io'; import 'package:dating_touchme_app/controller/global.dart'; import 'package:dating_touchme_app/generated/assets.dart'; +import 'package:dating_touchme_app/model/home/marriage_data.dart'; import 'package:dating_touchme_app/model/mine/address_data.dart'; import 'package:dating_touchme_app/model/mine/education_data.dart'; import 'package:dating_touchme_app/model/mine/occupation_data.dart'; import 'package:dating_touchme_app/model/mine/user_data.dart'; import 'package:dating_touchme_app/network/user_api.dart'; import 'package:dating_touchme_app/oss/oss_manager.dart'; +import 'package:dating_touchme_app/pages/home/user_information_page.dart'; import 'package:dating_touchme_app/pages/mine/auth_center_page.dart'; import 'package:dating_touchme_app/pages/mine/my_wallet_page.dart'; import 'package:dating_touchme_app/pages/mine/rose_page.dart'; @@ -17,7 +19,11 @@ import 'package:get/get.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get_storage/get_storage.dart'; import 'package:image_picker/image_picker.dart'; +import 'package:image_picker_android/image_picker_android.dart'; import 'package:permission_handler/permission_handler.dart'; +import 'package:image_picker_platform_interface/image_picker_platform_interface.dart'; + +import '../../model/home/user_info_data.dart'; class EditInfoController extends GetxController { @@ -40,6 +46,10 @@ class EditInfoController extends GetxController { final height = ''.obs; final heightController = TextEditingController().obs; + final heightList = [for (var i = 140; i <= 210; i++) "$i"].obs; + + final heightSelect = (-1).obs; + final educationList = [].obs; final incomeList = [].obs; @@ -80,10 +90,18 @@ class EditInfoController extends GetxController { final propertySelect = (-1).obs; + final storage = GetStorage(); + @override void onInit() { super.onInit(); + final ImagePickerPlatform imagePickerImplementation = + ImagePickerPlatform.instance; + if (imagePickerImplementation is ImagePickerAndroid) { + imagePickerImplementation.useAndroidPhotoPicker = true; + } + _userApi = Get.find(); getEducationList(); @@ -239,17 +257,58 @@ class EditInfoController extends GetxController { imgList.value = userData.value?.photoList?.map((e){ return e.photoUrl; }).toList() ?? []; - height.value = userData.value?.height.toString() ?? ""; - heightController.value.value = TextEditingValue( - text: height.value, - selection: TextSelection.fromPosition(TextPosition(offset: height.value.length)), - ); + heightSelect.value = heightList.indexWhere((e) => e == "${userData.value?.height}"); + // height.value = userData.value?.height.toString() ?? ""; + // heightController.value.value = TextEditingValue( + // text: height.value, + // selection: TextSelection.fromPosition(TextPosition(offset: height.value.length)), + // ); location.value = "${userData.value?.provinceName}-${userData.value?.cityName}-${userData.value?.districtName}"; locationValue.value = [userData.value?.provinceCode, userData.value?.cityCode, userData.value?.districtCode]; homeLocation.value = "${userData.value?.hometownProvinceName}-${userData.value?.hometownCityName}"; - locationValue.value = [userData.value?.hometownProvinceCode, userData.value?.hometownCityCode]; + homeLocationValue.value = [userData.value?.hometownProvinceCode, userData.value?.hometownCityCode]; + } + + goPreview() async { + try { + final response = await _userApi.getMarriageInformationDetailsById(miId: userData.value?.id ?? ""); + if (response.data.isSuccess && response.data.data != null) { + final data = response.data.data; + + + Get.to(() => UserInformationPage(userData: MarriageData( + miId: data?.miId ?? "", + userId: data?.userId ?? "", + profilePhoto: data?.profilePhoto ?? "", + nickName: data?.nickName ?? "", + isRealNameCertified: data?.identityCard == null, + birthYear: data?.birthYear ?? "", + birthDate: data?.birthDate ?? "", + age: int.parse(data?.age.toString() ?? "0"), + provinceCode: int.parse(data?.provinceCode.toString() ?? "0"), + provinceName: data?.provinceName ?? "", + cityCode: int.parse(data?.cityCode.toString() ?? "0"), + cityName: data?.cityName ?? "", + districtCode: int.parse(data?.districtCode.toString() ?? "0"), + districtName: data?.districtName ?? "", + describeInfo: data?.describeInfo ?? "", + createTime: data?.createTime ?? "", + photoList: data!.photoList!.map((e){ + return PhotoItem.fromJson(e.toJson()); + }).toList(), + ))); + } else { + // 响应失败,抛出异常 + throw Exception(response.data.message ?? '获取数据失败'); + } + } catch(e){ + print('收入列表获取失败: $e'); + SmartDialog.showToast('收入列表获取失败'); + rethrow; + } } + int calculateAge(String birthdayStr) { final birthday = DateTime.parse(birthdayStr); // 自动识别 1996-1-20 final today = DateTime.now(); @@ -335,6 +394,45 @@ class EditInfoController extends GetxController { } } + Future handleMultiGallerySelection(int type) async { + try { + // 请求相册/照片权限 + // final ok = await _ensurePermission( + // Permission.photos, + // // Android 上 photos 等价于 storage/mediaLibrary,permission_handler 会映射 + // denyToast: '相册权限被拒绝,请在设置中允许访问相册', + + // ); + // if (!ok) return; + + // 从相册选择图片 + final ImagePicker picker = ImagePicker(); + final List? image = await picker.pickMultiImage(limit: 9 - imgList.length); + + if (image != null) { + for(int i = 0; i _ensurePermission(Permission permission, {String? denyToast}) async { var status = await permission.status; @@ -369,6 +467,7 @@ class EditInfoController extends GetxController { avatarUrl.value = imageUrl; SmartDialog.dismiss(); SmartDialog.showToast('头像上传成功'); + saveAvatar(); } catch (e) { SmartDialog.dismiss(); print('处理图片失败: $e'); @@ -383,7 +482,10 @@ class EditInfoController extends GetxController { print('上传成功,图片URL: $imageUrl'); imgList.add(imageUrl); SmartDialog.dismiss(); - SmartDialog.showToast('上传设置成功'); + SmartDialog.showToast('相册上传成功'); + + + savaImgList(); } catch (e) { SmartDialog.dismiss(); print('处理图片失败: $e'); @@ -391,44 +493,41 @@ class EditInfoController extends GetxController { } } } - - saveData() async { - if(avatarUrl.value == ""){ - SmartDialog.showToast('请上传头像'); - return; - } - if(imgList.isEmpty){ - SmartDialog.showToast('请上传相册'); - return; - } - if(locationValue.isEmpty){ - SmartDialog.showToast('请选择所在地'); - return; - } - if(homeLocationValue.isEmpty){ - SmartDialog.showToast('请选择家乡'); - return; - } - if(educationSelect.value == -1){ - SmartDialog.showToast('请选择学历'); - return; - } - if(incomeSelect.value == -1){ - SmartDialog.showToast('请选择收入'); - return; - } - if(maritalSelect.value == -1){ - SmartDialog.showToast('请选择婚姻状况'); - return; - } - if(occupationValue.isEmpty){ - SmartDialog.showToast('请选择职业'); - return; - } - if(propertySelect.value == -1){ - SmartDialog.showToast('请选择房产状况'); - return; + // 处理选中的图片 + Future processSelectedMoreImage(File imageFile, int type) async { + if(type == 1){ + try { + // 显示加载提示 + SmartDialog.showLoading(msg: '上传头像中...'); + String objectName = '${DateUtil.getNowDateMs()}.${imageFile.path.split('.').last}'; + String imageUrl = await OSSManager.instance.uploadFile(imageFile.readAsBytesSync(), objectName); + print('上传成功,图片URL: $imageUrl'); + avatarUrl.value = imageUrl; + SmartDialog.dismiss(); + SmartDialog.showToast('头像上传成功'); + saveAvatar(); + } catch (e) { + SmartDialog.dismiss(); + print('处理图片失败: $e'); + SmartDialog.showToast('上传头像失败,请重试'); + } + } else { + try { + // 显示加载提示 + SmartDialog.showLoading(msg: '上传相册中...'); + String objectName = '${DateUtil.getNowDateMs()}.${imageFile.path.split('.').last}'; + String imageUrl = await OSSManager.instance.uploadFile(imageFile.readAsBytesSync(), objectName); + print('上传成功,图片URL: $imageUrl'); + imgList.add(imageUrl); + } catch (e) { + SmartDialog.dismiss(); + print('处理图片失败: $e'); + SmartDialog.showToast('上传相册失败,请重试'); + } } + } + + saveAvatar() async { try { final avatarPayload = { 'miId': userData.value?.id ?? 0, @@ -450,9 +549,9 @@ class EditInfoController extends GetxController { SmartDialog.showToast('头像提交审核失败,请重试'); return; } + } - - + savaImgList() async { try{ final imgPayload = { 'miId': userData.value?.id ?? 0, @@ -476,6 +575,9 @@ class EditInfoController extends GetxController { return; } + } + + saveData() async { try { @@ -489,7 +591,7 @@ class EditInfoController extends GetxController { 'districtCode': locationValue[2], 'districtName': location.value.split("-")[2], "educationCode": educationList[educationSelect.value].value, - "height": height, + "height": heightList[heightSelect.value], 'hometownProvinceCode': homeLocationValue[0], 'hometownProvinceName': homeLocation.value.split("-")[0], 'hometownCityCode': homeLocationValue[1], @@ -507,7 +609,21 @@ class EditInfoController extends GetxController { if (response.data.isSuccess) { SmartDialog.showToast('保存成功'); - Get.back(); + + 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); + + } + + } else{ diff --git a/lib/controller/mine/user_controller.dart b/lib/controller/mine/user_controller.dart index 31fc56e..be99b1a 100644 --- a/lib/controller/mine/user_controller.dart +++ b/lib/controller/mine/user_controller.dart @@ -2,6 +2,7 @@ import 'package:dating_touchme_app/im/im_manager.dart'; import 'package:dating_touchme_app/oss/oss_manager.dart'; import 'package:get/get.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; +import 'package:get_storage/get_storage.dart'; import '../../model/mine/authentication_data.dart'; import '../../model/mine/user_data.dart'; import '../../network/user_api.dart'; @@ -13,6 +14,7 @@ class UserController extends GetxController { // UserApi实例 late UserApi _userApi; + final storage = GetStorage(); @override void onInit() { @@ -100,6 +102,8 @@ class UserController extends GetxController { information.realName = baseInfo.realName; information.phone = baseInfo.phone; GlobalData().userData = information; + + await storage.write('userId', GlobalData().userId); return; } final information = result.data.data!; @@ -107,6 +111,8 @@ class UserController extends GetxController { information.realName = baseInfo.realName; information.phone = baseInfo.phone; GlobalData().userData = information; + + await storage.write('userId', GlobalData().userId); if (_checkInformation(information)) { //跳转到完善信息 SmartDialog.showToast('转到完善信息'); diff --git a/lib/controller/mine/withdraw_controller.dart b/lib/controller/mine/withdraw_controller.dart index 98c7f7a..4779bbe 100644 --- a/lib/controller/mine/withdraw_controller.dart +++ b/lib/controller/mine/withdraw_controller.dart @@ -1,5 +1,7 @@ import 'package:dating_touchme_app/model/mine/bank_card_data.dart'; +import 'package:dating_touchme_app/model/mine/withdraw_data.dart'; import 'package:dating_touchme_app/network/user_api.dart'; +import 'package:flutter/material.dart'; import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:get/get_state_manager/src/simple/get_controllers.dart'; @@ -14,6 +16,11 @@ class WithdrawController extends GetxController { final nowBankCard = BankCardData().obs; + final withdrawMoney = ''.obs; + final withdrawMoneyController = TextEditingController().obs; + + final serviceFeeData = WithdrawData().obs; + @override void onInit() { super.onInit(); @@ -40,4 +47,52 @@ class WithdrawController extends GetxController { rethrow; } } + + getServiceFee() async { + try { + final response = await _userApi.calculateWithdrawServiceFee({ + "withdrawAmount": withdrawMoney.value, + "withdrawType": 1 + }); + if (response.data.isSuccess && response.data.data != null) { + serviceFeeData.value = response.data.data ?? WithdrawData(); + } else { + + // 响应失败,抛出异常 + throw Exception(response.data.message ?? '获取数据失败'); + } + } catch(e){ + print('手续费获取失败: $e'); + SmartDialog.showToast('手续费获取失败'); + rethrow; + + } + } + + withdrawSubmit() async { + try { + final response = await _userApi.applyWalletAccountWithdraw({ + "thirdPartyFields": [ + {"key": 'bankCardId', "value": nowBankCard.value.id} + ], + "withdrawAmount": withdrawMoney.value, + "withdrawType": 1 + }); + if (response.data.isSuccess) { + + SmartDialog.showToast('提现审核提交成功'); + Get.back(); + Get.back(); + } else { + + // 响应失败,抛出异常 + throw Exception(response.data.message ?? '获取数据失败'); + } + } catch(e){ + print('提现审核提交失败: $e'); + SmartDialog.showToast('提现审核提交失败'); + rethrow; + + } + } } \ No newline at end of file diff --git a/lib/controller/mine/withdraw_history_controller.dart b/lib/controller/mine/withdraw_history_controller.dart new file mode 100644 index 0000000..8628b52 --- /dev/null +++ b/lib/controller/mine/withdraw_history_controller.dart @@ -0,0 +1,43 @@ +import 'package:dating_touchme_app/network/user_api.dart'; +import 'package:get/get.dart'; +import 'package:get/get_state_manager/src/simple/get_controllers.dart'; + +import '../../model/mine/withdraw_audit_data.dart'; + +class WithdrawHistoryController extends GetxController { + + late UserApi _userApi; + + final historyList = [].obs; + + final page = 1.obs; + + final hasMore = true.obs; + + @override + void onInit() { + super.onInit(); + _userApi = Get.find(); + getHistoryList(); + } + + getHistoryList() async {try{ + final response = await _userApi.pageWithdrawAudit( + pageNum: page.value, + pageSize: 10, + ); + if (response.data.isSuccess && response.data.data != null) { + final data = response.data.data?.records ?? []; + + historyList.addAll(data.toList()); + } else { + + // 响应失败,抛出异常 + throw Exception(response.data.message ?? '获取数据失败'); + } + } catch(e) { + + } + + } +} \ No newline at end of file diff --git a/lib/model/home/user_info_data.dart b/lib/model/home/user_info_data.dart new file mode 100644 index 0000000..5e22462 --- /dev/null +++ b/lib/model/home/user_info_data.dart @@ -0,0 +1,513 @@ +class UserInfoData { + String? id; + bool? isDelete; + String? createTime; + String? updateTime; + Null? event; + String? accountId; + String? userId; + String? nickName; + String? name; + String? profilePhoto; + bool? hasUploadProfilePhoto; + bool? photoDisplay; + String? identityCard; + num? genderCode; + String? genderValue; + String? homeCountryCode; + String? homeCountry; + num? provinceCode; + String? provinceName; + num? cityCode; + String? cityName; + num? districtCode; + String? districtName; + String? birthYear; + String? birthDate; + num? constellationCode; + String? constellation; + num? chineseZodiacCode; + String? chineseZodiac; + num? height; + num? weight; + num? educationCode; + String? education; + num? maritalStatusCode; + String? maritalStatusName; + num? minimumIncome; + num? maximumIncome; + num? incomeCode; + String? income; + String? diplomaVerificationCode; + String? describeInfo; + num? identityType; + String? identityTypeName; + num? domicilePlaceProvinceCode; + String? domicilePlaceProvinceName; + num? domicilePlaceCityCode; + String? domicilePlaceCityName; + num? nationCode; + String? nation; + num? bodilyFormCode; + String? bodilyForm; + num? accountTypeCode; + String? accountTypeName; + num? nationalityCode; + String? nationality; + num? nativePlaceCode; + String? nativePlaceName; + num? industryCode; + String? industry; + num? occupationCode; + String? occupation; + num? onlyChild; + num? carPurchaseSituationCode; + String? carPurchaseSituation; + num? propertyPermitsCode; + String? propertyPermits; + String? wechatId; + num? hometownProvinceCode; + String? hometownProvinceName; + num? hometownCityCode; + String? hometownCityName; + bool? display; + num? displayStatus; + num? inLove; + bool? hasParentsPension; + AuditProfilePhoto? auditProfilePhoto; + List? photoList; + num? describeAuditStatus; + String? describeAudit; + num? fillSerialNumber; + Null? demandMarriage; + num? mateDescriptionAuditStatus; + String? mateDescriptionAudit; + List? marriageSeekingContacts; + num? age; + bool? meLike; + num? miSessionType; + bool? consumeRight; + bool? vip; + num? dataScoring; + String? phone; + Null? guestMatchmaker; + String? miId; + bool? allowMatchmakerInviteBounty; + + UserInfoData( + {this.id, + this.isDelete, + this.createTime, + this.updateTime, + this.event, + this.accountId, + this.userId, + this.nickName, + this.name, + this.profilePhoto, + this.hasUploadProfilePhoto, + this.photoDisplay, + this.identityCard, + this.genderCode, + this.genderValue, + this.homeCountryCode, + this.homeCountry, + this.provinceCode, + this.provinceName, + this.cityCode, + this.cityName, + this.districtCode, + this.districtName, + this.birthYear, + this.birthDate, + this.constellationCode, + this.constellation, + this.chineseZodiacCode, + this.chineseZodiac, + this.height, + this.weight, + this.educationCode, + this.education, + this.maritalStatusCode, + this.maritalStatusName, + this.minimumIncome, + this.maximumIncome, + this.incomeCode, + this.income, + this.diplomaVerificationCode, + this.describeInfo, + this.identityType, + this.identityTypeName, + this.domicilePlaceProvinceCode, + this.domicilePlaceProvinceName, + this.domicilePlaceCityCode, + this.domicilePlaceCityName, + this.nationCode, + this.nation, + this.bodilyFormCode, + this.bodilyForm, + this.accountTypeCode, + this.accountTypeName, + this.nationalityCode, + this.nationality, + this.nativePlaceCode, + this.nativePlaceName, + this.industryCode, + this.industry, + this.occupationCode, + this.occupation, + this.onlyChild, + this.carPurchaseSituationCode, + this.carPurchaseSituation, + this.propertyPermitsCode, + this.propertyPermits, + this.wechatId, + this.hometownProvinceCode, + this.hometownProvinceName, + this.hometownCityCode, + this.hometownCityName, + this.display, + this.displayStatus, + this.inLove, + this.hasParentsPension, + this.auditProfilePhoto, + this.photoList, + this.describeAuditStatus, + this.describeAudit, + this.fillSerialNumber, + this.demandMarriage, + this.mateDescriptionAuditStatus, + this.mateDescriptionAudit, + this.marriageSeekingContacts, + this.age, + this.meLike, + this.miSessionType, + this.consumeRight, + this.vip, + this.dataScoring, + this.phone, + this.guestMatchmaker, + this.miId, + this.allowMatchmakerInviteBounty}); + + UserInfoData.fromJson(Map json) { + id = json['id']; + isDelete = json['isDelete']; + createTime = json['createTime']; + updateTime = json['updateTime']; + event = json['event']; + accountId = json['accountId']; + userId = json['userId']; + nickName = json['nickName']; + name = json['name']; + profilePhoto = json['profilePhoto']; + hasUploadProfilePhoto = json['hasUploadProfilePhoto']; + photoDisplay = json['photoDisplay']; + identityCard = json['identityCard']; + genderCode = json['genderCode']; + genderValue = json['genderValue']; + homeCountryCode = json['homeCountryCode']; + homeCountry = json['homeCountry']; + provinceCode = json['provinceCode']; + provinceName = json['provinceName']; + cityCode = json['cityCode']; + cityName = json['cityName']; + districtCode = json['districtCode']; + districtName = json['districtName']; + birthYear = json['birthYear']; + birthDate = json['birthDate']; + constellationCode = json['constellationCode']; + constellation = json['constellation']; + chineseZodiacCode = json['chineseZodiacCode']; + chineseZodiac = json['chineseZodiac']; + height = json['height']; + weight = json['weight']; + educationCode = json['educationCode']; + education = json['education']; + maritalStatusCode = json['maritalStatusCode']; + maritalStatusName = json['maritalStatusName']; + minimumIncome = json['minimumIncome']; + maximumIncome = json['maximumIncome']; + incomeCode = json['incomeCode']; + income = json['income']; + diplomaVerificationCode = json['diplomaVerificationCode']; + describeInfo = json['describeInfo']; + identityType = json['identityType']; + identityTypeName = json['identityTypeName']; + domicilePlaceProvinceCode = json['domicilePlaceProvinceCode']; + domicilePlaceProvinceName = json['domicilePlaceProvinceName']; + domicilePlaceCityCode = json['domicilePlaceCityCode']; + domicilePlaceCityName = json['domicilePlaceCityName']; + nationCode = json['nationCode']; + nation = json['nation']; + bodilyFormCode = json['bodilyFormCode']; + bodilyForm = json['bodilyForm']; + accountTypeCode = json['accountTypeCode']; + accountTypeName = json['accountTypeName']; + nationalityCode = json['nationalityCode']; + nationality = json['nationality']; + nativePlaceCode = json['nativePlaceCode']; + nativePlaceName = json['nativePlaceName']; + industryCode = json['industryCode']; + industry = json['industry']; + occupationCode = json['occupationCode']; + occupation = json['occupation']; + onlyChild = json['onlyChild']; + carPurchaseSituationCode = json['carPurchaseSituationCode']; + carPurchaseSituation = json['carPurchaseSituation']; + propertyPermitsCode = json['propertyPermitsCode']; + propertyPermits = json['propertyPermits']; + wechatId = json['wechatId']; + hometownProvinceCode = json['hometownProvinceCode']; + hometownProvinceName = json['hometownProvinceName']; + hometownCityCode = json['hometownCityCode']; + hometownCityName = json['hometownCityName']; + display = json['display']; + displayStatus = json['displayStatus']; + inLove = json['inLove']; + hasParentsPension = json['hasParentsPension']; + auditProfilePhoto = json['auditProfilePhoto'] != null + ? new AuditProfilePhoto.fromJson(json['auditProfilePhoto']) + : null; + if (json['photoList'] != null) { + photoList = []; + json['photoList'].forEach((v) { + photoList!.add(new PhotoList.fromJson(v)); + }); + } + describeAuditStatus = json['describeAuditStatus']; + describeAudit = json['describeAudit']; + fillSerialNumber = json['fillSerialNumber']; + demandMarriage = json['demandMarriage']; + mateDescriptionAuditStatus = json['mateDescriptionAuditStatus']; + mateDescriptionAudit = json['mateDescriptionAudit']; + if (json['marriageSeekingContacts'] != null) { + marriageSeekingContacts = []; + // json['marriageSeekingContacts'].forEach((v) { + // marriageSeekingContacts!.add(new Null.fromJson(v)); + // }); + } + age = json['age']; + meLike = json['meLike']; + miSessionType = json['miSessionType']; + consumeRight = json['consumeRight']; + vip = json['vip']; + dataScoring = json['dataScoring']; + phone = json['phone']; + guestMatchmaker = json['guestMatchmaker']; + miId = json['miId']; + allowMatchmakerInviteBounty = json['allowMatchmakerInviteBounty']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['isDelete'] = this.isDelete; + data['createTime'] = this.createTime; + data['updateTime'] = this.updateTime; + data['event'] = this.event; + data['accountId'] = this.accountId; + data['userId'] = this.userId; + data['nickName'] = this.nickName; + data['name'] = this.name; + data['profilePhoto'] = this.profilePhoto; + data['hasUploadProfilePhoto'] = this.hasUploadProfilePhoto; + data['photoDisplay'] = this.photoDisplay; + data['identityCard'] = this.identityCard; + data['genderCode'] = this.genderCode; + data['genderValue'] = this.genderValue; + data['homeCountryCode'] = this.homeCountryCode; + data['homeCountry'] = this.homeCountry; + data['provinceCode'] = this.provinceCode; + data['provinceName'] = this.provinceName; + data['cityCode'] = this.cityCode; + data['cityName'] = this.cityName; + data['districtCode'] = this.districtCode; + data['districtName'] = this.districtName; + data['birthYear'] = this.birthYear; + data['birthDate'] = this.birthDate; + data['constellationCode'] = this.constellationCode; + data['constellation'] = this.constellation; + data['chineseZodiacCode'] = this.chineseZodiacCode; + data['chineseZodiac'] = this.chineseZodiac; + data['height'] = this.height; + data['weight'] = this.weight; + data['educationCode'] = this.educationCode; + data['education'] = this.education; + data['maritalStatusCode'] = this.maritalStatusCode; + data['maritalStatusName'] = this.maritalStatusName; + data['minimumIncome'] = this.minimumIncome; + data['maximumIncome'] = this.maximumIncome; + data['incomeCode'] = this.incomeCode; + data['income'] = this.income; + data['diplomaVerificationCode'] = this.diplomaVerificationCode; + data['describeInfo'] = this.describeInfo; + data['identityType'] = this.identityType; + data['identityTypeName'] = this.identityTypeName; + data['domicilePlaceProvinceCode'] = this.domicilePlaceProvinceCode; + data['domicilePlaceProvinceName'] = this.domicilePlaceProvinceName; + data['domicilePlaceCityCode'] = this.domicilePlaceCityCode; + data['domicilePlaceCityName'] = this.domicilePlaceCityName; + data['nationCode'] = this.nationCode; + data['nation'] = this.nation; + data['bodilyFormCode'] = this.bodilyFormCode; + data['bodilyForm'] = this.bodilyForm; + data['accountTypeCode'] = this.accountTypeCode; + data['accountTypeName'] = this.accountTypeName; + data['nationalityCode'] = this.nationalityCode; + data['nationality'] = this.nationality; + data['nativePlaceCode'] = this.nativePlaceCode; + data['nativePlaceName'] = this.nativePlaceName; + data['industryCode'] = this.industryCode; + data['industry'] = this.industry; + data['occupationCode'] = this.occupationCode; + data['occupation'] = this.occupation; + data['onlyChild'] = this.onlyChild; + data['carPurchaseSituationCode'] = this.carPurchaseSituationCode; + data['carPurchaseSituation'] = this.carPurchaseSituation; + data['propertyPermitsCode'] = this.propertyPermitsCode; + data['propertyPermits'] = this.propertyPermits; + data['wechatId'] = this.wechatId; + data['hometownProvinceCode'] = this.hometownProvinceCode; + data['hometownProvinceName'] = this.hometownProvinceName; + data['hometownCityCode'] = this.hometownCityCode; + data['hometownCityName'] = this.hometownCityName; + data['display'] = this.display; + data['displayStatus'] = this.displayStatus; + data['inLove'] = this.inLove; + data['hasParentsPension'] = this.hasParentsPension; + if (this.auditProfilePhoto != null) { + data['auditProfilePhoto'] = this.auditProfilePhoto!.toJson(); + } + if (this.photoList != null) { + data['photoList'] = this.photoList!.map((v) => v.toJson()).toList(); + } + data['describeAuditStatus'] = this.describeAuditStatus; + data['describeAudit'] = this.describeAudit; + data['fillSerialNumber'] = this.fillSerialNumber; + data['demandMarriage'] = this.demandMarriage; + data['mateDescriptionAuditStatus'] = this.mateDescriptionAuditStatus; + data['mateDescriptionAudit'] = this.mateDescriptionAudit; + if (this.marriageSeekingContacts != null) { + data['marriageSeekingContacts'] = []; + // this.marriageSeekingContacts!.map((v) => v.toJson()).toList(); + } + data['age'] = this.age; + data['meLike'] = this.meLike; + data['miSessionType'] = this.miSessionType; + data['consumeRight'] = this.consumeRight; + data['vip'] = this.vip; + data['dataScoring'] = this.dataScoring; + data['phone'] = this.phone; + data['guestMatchmaker'] = this.guestMatchmaker; + data['miId'] = this.miId; + data['allowMatchmakerInviteBounty'] = this.allowMatchmakerInviteBounty; + return data; + } +} + +class AuditProfilePhoto { + String? id; + bool? isDelete; + String? createTime; + String? updateTime; + Null? event; + String? miId; + num? photoType; + String? photoUrl; + String? auditImgId; + num? auditStatus; + + AuditProfilePhoto( + {this.id, + this.isDelete, + this.createTime, + this.updateTime, + this.event, + this.miId, + this.photoType, + this.photoUrl, + this.auditImgId, + this.auditStatus}); + + AuditProfilePhoto.fromJson(Map json) { + id = json['id']; + isDelete = json['isDelete']; + createTime = json['createTime']; + updateTime = json['updateTime']; + event = json['event']; + miId = json['miId']; + photoType = json['photoType']; + photoUrl = json['photoUrl']; + auditImgId = json['auditImgId']; + auditStatus = json['auditStatus']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['isDelete'] = this.isDelete; + data['createTime'] = this.createTime; + data['updateTime'] = this.updateTime; + data['event'] = this.event; + data['miId'] = this.miId; + data['photoType'] = this.photoType; + data['photoUrl'] = this.photoUrl; + data['auditImgId'] = this.auditImgId; + data['auditStatus'] = this.auditStatus; + return data; + } +} + +class PhotoList { + String? id; + bool? isDelete; + String? createTime; + Null? updateTime; + Null? event; + num? miId; + num? photoType; + String? photoUrl; + num? auditImgId; + num? auditStatus; + + PhotoList( + {this.id, + this.isDelete, + this.createTime, + this.updateTime, + this.event, + this.miId, + this.photoType, + this.photoUrl, + this.auditImgId, + this.auditStatus}); + + PhotoList.fromJson(Map json) { + id = json['id']; + isDelete = json['isDelete']; + createTime = json['createTime']; + updateTime = json['updateTime']; + event = json['event']; + miId = json['miId']; + photoType = json['photoType']; + photoUrl = json['photoUrl']; + auditImgId = json['auditImgId']; + auditStatus = json['auditStatus']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['isDelete'] = this.isDelete; + data['createTime'] = this.createTime; + data['updateTime'] = this.updateTime; + data['event'] = this.event; + data['miId'] = this.miId; + data['photoType'] = this.photoType; + data['photoUrl'] = this.photoUrl; + data['auditImgId'] = this.auditImgId; + data['auditStatus'] = this.auditStatus; + return data; + } +} diff --git a/lib/model/mine/withdraw_audit_data.dart b/lib/model/mine/withdraw_audit_data.dart new file mode 100644 index 0000000..5104800 --- /dev/null +++ b/lib/model/mine/withdraw_audit_data.dart @@ -0,0 +1,157 @@ +class WithdrawAuditData { + List? records; + int? total; + int? size; + int? current; + int? pages; + + WithdrawAuditData( + {this.records, this.total, this.size, this.current, this.pages}); + + WithdrawAuditData.fromJson(Map json) { + if (json['records'] != null) { + records = []; + json['records'].forEach((v) { + records!.add(new Records.fromJson(v)); + }); + } + total = json['total']; + size = json['size']; + current = json['current']; + pages = json['pages']; + } + + Map toJson() { + final Map data = new Map(); + if (this.records != null) { + data['records'] = this.records!.map((v) => v.toJson()).toList(); + } + data['total'] = this.total; + data['size'] = this.size; + data['current'] = this.current; + data['pages'] = this.pages; + return data; + } +} + +class Records { + String? id; + String? walletAccountUserId; + String? walletAccountOrgId; + num? identityType; + String? walletAccountUserName; + String? walletAccountId; + num? withdrawAmount; + num? withdrawServiceFee; + num? arrivalAmount; + num? status; + bool? remitStatus; + String? remitUrl; + String? remitDateTime; + String? applyTime; + num? withdrawType; + ExtDetailsInfo? extDetailsInfo; + String? auditRemark; + String? remitRemark; + + Records( + {this.id, + this.walletAccountUserId, + this.walletAccountOrgId, + this.identityType, + this.walletAccountUserName, + this.walletAccountId, + this.withdrawAmount, + this.withdrawServiceFee, + this.arrivalAmount, + this.status, + this.remitStatus, + this.remitUrl, + this.remitDateTime, + this.applyTime, + this.withdrawType, + this.extDetailsInfo, + this.auditRemark, + this.remitRemark}); + + Records.fromJson(Map json) { + id = json['id']; + walletAccountUserId = json['walletAccountUserId']; + walletAccountOrgId = json['walletAccountOrgId']; + identityType = json['identityType']; + walletAccountUserName = json['walletAccountUserName']; + walletAccountId = json['walletAccountId']; + withdrawAmount = json['withdrawAmount']; + withdrawServiceFee = json['withdrawServiceFee']; + arrivalAmount = json['arrivalAmount']; + status = json['status']; + remitStatus = json['remitStatus']; + remitUrl = json['remitUrl']; + remitDateTime = json['remitDateTime']; + applyTime = json['applyTime']; + withdrawType = json['withdrawType']; + extDetailsInfo = json['extDetailsInfo'] != null + ? new ExtDetailsInfo.fromJson(json['extDetailsInfo']) + : null; + auditRemark = json['auditRemark']; + remitRemark = json['remitRemark']; + } + + Map toJson() { + final Map data = new Map(); + data['id'] = this.id; + data['walletAccountUserId'] = this.walletAccountUserId; + data['walletAccountOrgId'] = this.walletAccountOrgId; + data['identityType'] = this.identityType; + data['walletAccountUserName'] = this.walletAccountUserName; + data['walletAccountId'] = this.walletAccountId; + data['withdrawAmount'] = this.withdrawAmount; + data['withdrawServiceFee'] = this.withdrawServiceFee; + data['arrivalAmount'] = this.arrivalAmount; + data['status'] = this.status; + data['remitStatus'] = this.remitStatus; + data['remitUrl'] = this.remitUrl; + data['remitDateTime'] = this.remitDateTime; + data['applyTime'] = this.applyTime; + data['withdrawType'] = this.withdrawType; + if (this.extDetailsInfo != null) { + data['extDetailsInfo'] = this.extDetailsInfo!.toJson(); + } + data['auditRemark'] = this.auditRemark; + data['remitRemark'] = this.remitRemark; + return data; + } +} + +class ExtDetailsInfo { + String? cardNum; + String? ownerName; + String? bankName; + String? openingBank; + String? bankCardId; + + ExtDetailsInfo( + {this.cardNum, + this.ownerName, + this.bankName, + this.openingBank, + this.bankCardId}); + + ExtDetailsInfo.fromJson(Map json) { + cardNum = json['cardNum']; + ownerName = json['ownerName']; + bankName = json['bankName']; + openingBank = json['openingBank']; + bankCardId = json['bankCardId']; + } + + Map toJson() { + final Map data = new Map(); + data['cardNum'] = this.cardNum; + data['ownerName'] = this.ownerName; + data['bankName'] = this.bankName; + data['openingBank'] = this.openingBank; + data['bankCardId'] = this.bankCardId; + return data; + } +} diff --git a/lib/model/mine/withdraw_data.dart b/lib/model/mine/withdraw_data.dart new file mode 100644 index 0000000..6df5a5e --- /dev/null +++ b/lib/model/mine/withdraw_data.dart @@ -0,0 +1,28 @@ +class WithdrawData { + num? withdrawAmount; + num? withdrawServiceFeePct; + num? withdrawServiceFee; + num? arrivalAmount; + + WithdrawData( + {this.withdrawAmount, + this.withdrawServiceFeePct, + this.withdrawServiceFee, + this.arrivalAmount}); + + WithdrawData.fromJson(Map json) { + withdrawAmount = json['withdrawAmount']; + withdrawServiceFeePct = json['withdrawServiceFeePct']; + withdrawServiceFee = json['withdrawServiceFee']; + arrivalAmount = json['arrivalAmount']; + } + + Map toJson() { + final Map data = new Map(); + data['withdrawAmount'] = this.withdrawAmount; + data['withdrawServiceFeePct'] = this.withdrawServiceFeePct; + data['withdrawServiceFee'] = this.withdrawServiceFee; + data['arrivalAmount'] = this.arrivalAmount; + return data; + } +} diff --git a/lib/network/api_urls.dart b/lib/network/api_urls.dart index 3447f70..74a7918 100644 --- a/lib/network/api_urls.dart +++ b/lib/network/api_urls.dart @@ -30,6 +30,10 @@ class ApiUrls { static const String listBankCardByIndividual = 'dating-agency-mall/user/list/bank-card/by-individual'; static const String createBankCardByIndividual = 'dating-agency-mall/user/create/bank-card/by-individual'; static const String recognizeBankCard = 'dating-agency-uec/user/recognize/bank-card'; + static const String calculateWithdrawServiceFee = 'dating-agency-mall/user/calculate/withdraw-service-fee'; + static const String applyWalletAccountWithdraw = 'dating-agency-mall/user/apply/wallet-account/withdraw'; + static const String pageWithdrawAudit = 'dating-agency-mall/user/page/withdraw-audit'; + static const String getMarriageInformationDetailsById = 'dating-agency-service/user/get/marriage/information/details/byid'; //首页相关接口 static const String getMarriageList = 'dating-agency-service/user/page/dongwo/marriage-information'; diff --git a/lib/network/user_api.dart b/lib/network/user_api.dart index e27bfe6..3b24be6 100644 --- a/lib/network/user_api.dart +++ b/lib/network/user_api.dart @@ -1,4 +1,5 @@ import 'package:dating_touchme_app/model/common/oss_data.dart'; +import 'package:dating_touchme_app/model/home/user_info_data.dart'; import 'package:dating_touchme_app/model/mine/bank_card_data.dart'; import 'package:dating_touchme_app/model/mine/bank_card_ocr_data.dart'; import 'package:dating_touchme_app/model/mine/education_data.dart'; @@ -9,6 +10,8 @@ import 'package:dating_touchme_app/model/mine/rose_history_data.dart'; import 'package:dating_touchme_app/model/mine/user_base_data.dart'; import 'package:dating_touchme_app/model/mine/user_data.dart'; import 'package:dating_touchme_app/model/mine/user_rose_data.dart'; +import 'package:dating_touchme_app/model/mine/withdraw_audit_data.dart'; +import 'package:dating_touchme_app/model/mine/withdraw_data.dart'; import 'package:dating_touchme_app/network/response_model.dart'; import 'package:dating_touchme_app/network/api_urls.dart'; import 'package:retrofit/retrofit.dart'; @@ -133,4 +136,29 @@ abstract class UserApi { Future>> recognizeBankCard( @Body() Map data, ); + + @POST(ApiUrls.calculateWithdrawServiceFee) + Future>> calculateWithdrawServiceFee( + @Body() Map data, + ); + + @POST(ApiUrls.applyWalletAccountWithdraw) + Future>> applyWalletAccountWithdraw( + @Body() Map data, + ); + + @GET(ApiUrls.pageWithdrawAudit) + Future>> pageWithdrawAudit( + { + @Query('pageNum') required int pageNum, + @Query('pageSize') required int pageSize, + } + ); + + @GET(ApiUrls.getMarriageInformationDetailsById) + Future>> getMarriageInformationDetailsById( + { + @Query('miId') required String miId, + } + ); } diff --git a/lib/network/user_api.g.dart b/lib/network/user_api.g.dart index f190f93..9674381 100644 --- a/lib/network/user_api.g.dart +++ b/lib/network/user_api.g.dart @@ -874,6 +874,146 @@ class _UserApi implements UserApi { return httpResponse; } + @override + Future>> calculateWithdrawServiceFee( + Map data, + ) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(data); + final _options = _setStreamType>>( + Options(method: 'POST', headers: _headers, extra: _extra) + .compose( + _dio.options, + 'dating-agency-mall/user/calculate/withdraw-service-fee', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); + final _result = await _dio.fetch>(_options); + late BaseResponse _value; + try { + _value = BaseResponse.fromJson( + _result.data!, + (json) => WithdrawData.fromJson(json as Map), + ); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + final httpResponse = HttpResponse(_value, _result); + return httpResponse; + } + + @override + Future>> applyWalletAccountWithdraw( + Map data, + ) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(data); + final _options = _setStreamType>>( + Options(method: 'POST', headers: _headers, extra: _extra) + .compose( + _dio.options, + 'dating-agency-mall/user/apply/wallet-account/withdraw', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); + final _result = await _dio.fetch>(_options); + late BaseResponse _value; + try { + _value = BaseResponse.fromJson( + _result.data!, + (json) => json as dynamic, + ); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + final httpResponse = HttpResponse(_value, _result); + return httpResponse; + } + + @override + Future>> pageWithdrawAudit({ + required int pageNum, + required int pageSize, + }) async { + final _extra = {}; + final queryParameters = { + r'pageNum': pageNum, + r'pageSize': pageSize, + }; + final _headers = {}; + const Map? _data = null; + final _options = + _setStreamType>>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + 'dating-agency-mall/user/page/withdraw-audit', + queryParameters: queryParameters, + data: _data, + ) + .copyWith( + baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl), + ), + ); + final _result = await _dio.fetch>(_options); + late BaseResponse _value; + try { + _value = BaseResponse.fromJson( + _result.data!, + (json) => WithdrawAuditData.fromJson(json as Map), + ); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + final httpResponse = HttpResponse(_value, _result); + return httpResponse; + } + + @override + Future>> + getMarriageInformationDetailsById({required String miId}) async { + final _extra = {}; + final queryParameters = {r'miId': miId}; + final _headers = {}; + const Map? _data = null; + final _options = _setStreamType>>( + Options(method: 'GET', headers: _headers, extra: _extra) + .compose( + _dio.options, + 'dating-agency-service/user/get/marriage/information/details/byid', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); + final _result = await _dio.fetch>(_options); + late BaseResponse _value; + try { + _value = BaseResponse.fromJson( + _result.data!, + (json) => UserInfoData.fromJson(json as Map), + ); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + final httpResponse = HttpResponse(_value, _result); + return httpResponse; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || diff --git a/lib/pages/home/user_information_page.dart b/lib/pages/home/user_information_page.dart index 18e6273..1aba7cb 100644 --- a/lib/pages/home/user_information_page.dart +++ b/lib/pages/home/user_information_page.dart @@ -93,7 +93,7 @@ class _UserInformationPageState extends State { Row( children: [ Text( - widget.userData.nickName, + widget.userData.nickName, style: TextStyle( fontSize: 19.w, color: const Color.fromRGBO(51, 51, 51, 1), @@ -406,40 +406,45 @@ class _UserInformationPageState extends State { Positioned( left: 15.w, top: 310.w, - child: Row( - children: [ - ...widget.userData.photoList.asMap().entries.map((entry){ - return Container( - margin: EdgeInsets.only(right: 7.w), - child: InkWell( - onTap: (){ - nowSelect = entry.key; - setState(() { + width: 345.w, + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: Row( + children: [ + ...widget.userData.photoList.asMap().entries.map((entry){ + return Container( + margin: EdgeInsets.only(right: 7.w), + child: InkWell( + onTap: (){ + nowSelect = entry.key; + setState(() { - }); - }, - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(7.w)), - child: Container( - width: 40.w, - height: 40.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(7.w)), - border: nowSelect == entry.key ? Border.all(width: 2.w, color: Colors.white) : null - ), - child: Center( - child: Image.network( - entry.value.photoUrl, - width: 38.w, - height: 38.w, + }); + }, + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(7.w)), + child: Container( + width: 40.w, + height: 40.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(7.w)), + border: nowSelect == entry.key ? Border.all(width: 2.w, color: Colors.white) : null + ), + child: Center( + child: Image.network( + entry.value.photoUrl, + width: 38.w, + height: 38.w, + fit: BoxFit.cover, + ), ), ), ), ), - ), - ); - }), - ], + ); + }), + ], + ), ), ), ], @@ -473,4 +478,3 @@ class TagItem extends StatelessWidget { ); } } - diff --git a/lib/pages/mine/add_bankcard_page.dart b/lib/pages/mine/add_bankcard_page.dart index 51cb580..7001b7d 100644 --- a/lib/pages/mine/add_bankcard_page.dart +++ b/lib/pages/mine/add_bankcard_page.dart @@ -85,7 +85,6 @@ class AddBankcardPage extends StatelessWidget { ), addItem(label: "持卡人", child: TextField( controller: controller.usernameController.value, - keyboardType: TextInputType.number, style: TextStyle( fontSize: ScreenUtil().setWidth(13), height: 1, @@ -159,7 +158,6 @@ class AddBankcardPage extends StatelessWidget { })), addItem(label: "所属银行", child: TextField( controller: controller.bankNameController.value, - keyboardType: TextInputType.number, style: TextStyle( fontSize: ScreenUtil().setWidth(13), height: 1, @@ -193,7 +191,6 @@ class AddBankcardPage extends StatelessWidget { )), addItem(label: "开户行", child: TextField( controller: controller.openingBankController.value, - keyboardType: TextInputType.number, style: TextStyle( fontSize: ScreenUtil().setWidth(13), height: 1, diff --git a/lib/pages/mine/edit_info_page.dart b/lib/pages/mine/edit_info_page.dart index c2757c3..8d7abe5 100644 --- a/lib/pages/mine/edit_info_page.dart +++ b/lib/pages/mine/edit_info_page.dart @@ -4,13 +4,16 @@ import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/controller/mine/edit_info_controller.dart'; import 'package:dating_touchme_app/extension/ex_widget.dart'; import 'package:dating_touchme_app/generated/assets.dart'; +import 'package:dating_touchme_app/model/home/marriage_data.dart'; import 'package:dating_touchme_app/model/mine/address_data.dart'; import 'package:dating_touchme_app/model/mine/occupation_data.dart'; +import 'package:dating_touchme_app/pages/home/user_information_page.dart'; import 'package:dating_touchme_app/pages/mine/signature_page.dart'; import 'package:dating_touchme_app/pages/mine/tag_setting_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; import 'package:get_storage/get_storage.dart'; import 'package:tdesign_flutter/tdesign_flutter.dart'; @@ -41,9 +44,9 @@ class _EditInfoPageState extends State { showCupertinoModalPopup( context: Get.context!, builder: (context) => CupertinoActionSheet( - title: const Text('选择头像'), + title: Text(type == 1 ? '选择头像' : "选择相册"), actions: [ - CupertinoActionSheetAction( + if(type == 1) CupertinoActionSheetAction( child: const Text('拍照'), onPressed: () async { Navigator.pop(context); @@ -54,7 +57,16 @@ class _EditInfoPageState extends State { child: const Text('从相册选择'), onPressed: () async { Navigator.pop(context); - await controller.handleGallerySelection(type); + if(type == 1 || 9 - controller.imgList.length == 1){ + await controller.handleGallerySelection(type); + } else { + if(controller.imgList.length >= 9){ + + SmartDialog.showToast('超出数量限制,请先删除再尝试上传'); + return; + } + await controller.handleMultiGallerySelection(type); + } }, ), ], @@ -75,11 +87,27 @@ class _EditInfoPageState extends State { init: EditInfoController(), builder: (controller) { return Scaffold( - appBar: PageAppbar(title: "编辑资料"), + appBar: PageAppbar(title: "编辑资料", right: Container( + margin: EdgeInsets.only(right: 14.w), + child: InkWell( + onTap: (){ + // context.pushNamed(RouteNames.payHistory); + + controller.goPreview(); + }, + child: Text( + "预览", + style: TextStyle( + fontSize: 13.w, + color: const Color.fromRGBO(144, 144, 144, 1), + ), + ), + ), + ),), body: SingleChildScrollView( child: Column( children: [ - Row( + if(false) Row( children: [ Expanded( child: InkWell( @@ -217,7 +245,7 @@ class _EditInfoPageState extends State { fit: BoxFit.cover, ), ), - Positioned( + if(controller.userData.value!.photoList![entry.key].auditStatus == 1 || controller.userData.value!.photoList![entry.key].auditStatus == null)Positioned( right: 5.w, top: 5.w, child: Container( @@ -234,6 +262,31 @@ class _EditInfoPageState extends State { ).onTap((){ controller.imgList.removeAt(entry.key); }), + ), + if(controller.userData.value!.photoList![entry.key].auditStatus == 0)Positioned( + top: 0, + right: 0, + child: Container( + width: 33.w, + height: 17.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topRight: Radius.circular(9.w), + bottomLeft: Radius.circular(9.w) + ), + color: const Color.fromRGBO(0, 0, 0, .4) + ), + child: Center( + child: Text( + "审核中", + style: TextStyle( + fontSize: 8.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ), + ), + ), ) ], ); @@ -301,6 +354,14 @@ class _EditInfoPageState extends State { fontWeight: FontWeight.w500 ) ), + TextSpan( + text: "*", + style: TextStyle( + fontSize: 13.w, + color: const Color.fromRGBO(224, 54, 54, 1), + fontWeight: FontWeight.w500 + ) + ), ] ), ), @@ -375,61 +436,44 @@ class _EditInfoPageState extends State { ], ), ), - SetItem(label: "身高", child: Expanded( - child: TextField( - controller: controller.heightController.value, - keyboardType: TextInputType.number, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: ScreenUtil().setWidth(13), - height: 1 - ), - decoration: InputDecoration( - contentPadding: EdgeInsets.symmetric( - vertical: 0, - horizontal: 0.w - ), - hintText: "请输入身高", - - hintStyle: TextStyle( - color: const Color.fromRGBO(191, 191, 191, 1) - - ), + InkWell( + onTap: () { + TDPicker.showMultiPicker(context, title: '', + initialIndexes: [30], + onConfirm: (selected) { + print(selected); + print(controller.heightList[selected[0]]); + controller.heightSelect.value = selected[0]; + setState(() { - border: const OutlineInputBorder( - borderSide: BorderSide.none, // 这将移除边框 // 可选:设置圆角 - ), - // 如果你希望聚焦时和未聚焦时都没有边框,也可以设置 focusedBorder 和 enabledBorder - focusedBorder: const OutlineInputBorder( - borderSide: BorderSide.none, - borderRadius: BorderRadius.all(Radius.circular(8.0)), - ), - enabledBorder: const OutlineInputBorder( - borderSide: BorderSide.none, - borderRadius: BorderRadius.all(Radius.circular(8.0)), - ), + }); + Navigator.of(context).pop(); + controller.saveData(); + }, data: [controller.heightList]); + }, + child: SetItem(label: "身高", child: Text( + controller.heightSelect.value != -1 ? controller.heightList[controller.heightSelect.value] ?? "" : "请选择", + style: TextStyle( + fontSize: 13.w, + color: controller.heightSelect.value != -1 ? const Color.fromRGBO(51, 51, 51, 1) :const Color.fromRGBO(191, 191, 191, 1), + fontWeight: controller.heightSelect.value != -1 ? FontWeight.w500 : null ), - onChanged: (value){ - controller.height.value = value; - setState(() { + ),), + ), - }); - }, - ), - ),), - SetItem(label: "所在地", child: InkWell( + InkWell( onTap: () { TDPicker.showMultiLinkedPicker(context, title: '', onConfirm: (selected) { print(selected); controller.location.value = selected.join("-"); Map province = address.firstWhere( - (e) => e["label"] == selected[0], + (e) => e["label"] == selected[0], orElse: () => {}, ); if(province.isNotEmpty){ Map city = province["children"].firstWhere( - (e) => e["label"] == selected[1], + (e) => e["label"] == selected[1], orElse: () => {}, ); if(city.isNotEmpty){ @@ -447,21 +491,23 @@ class _EditInfoPageState extends State { }); Navigator.of(context).pop(); + controller.saveData(); }, data: controller.areaShowData, columnNum: 3, initialData:[]); }, - child: Text( + child: SetItem(label: "所在地", child: Text( controller.location.value != "" ? controller.location.value :"请选择", style: TextStyle( - fontSize: 13.w, - color: controller.location.value != "" ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1), + fontSize: 13.w, + color: controller.location.value != "" ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1), fontWeight: controller.location.value != "" ? FontWeight.w500 : null, ), - ), - ),), - SetItem(label: "家乡", child: InkWell( + ),), + ), + + InkWell( onTap: () { TDPicker.showMultiLinkedPicker(context, title: '', onConfirm: (selected) { @@ -483,21 +529,24 @@ class _EditInfoPageState extends State { }); Navigator.of(context).pop(); + controller.saveData(); }, data: controller.areaShowData, columnNum: 2, initialData:[]); }, - child: Text( + child: SetItem(label: "家乡", child: Text( controller.homeLocation.value != "" ? controller.homeLocation.value :"请选择", style: TextStyle( fontSize: 13.w, color: controller.homeLocation.value != "" ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1), fontWeight: controller.homeLocation.value != "" ? FontWeight.w500 : null, ), - ), - ),), - SetItem(label: "学历", child: InkWell( + )), + ), + + + InkWell( onTap: () { TDPicker.showMultiPicker(context, title: '', onConfirm: (selected) { @@ -508,28 +557,30 @@ class _EditInfoPageState extends State { }); Navigator.of(context).pop(); + controller.saveData(); }, data: [controller.educationList.map((e) => e.desc ?? "").toList()]); }, - child: Text( + child: SetItem(label: "学历", child: Text( controller.educationSelect.value != -1 ? controller.educationList[controller.educationSelect.value].desc ?? "" : "请选择", style: TextStyle( - fontSize: 13.w, - color: controller.educationSelect.value != -1 ? const Color.fromRGBO(51, 51, 51, 1) :const Color.fromRGBO(191, 191, 191, 1), - fontWeight: controller.educationSelect.value != -1 ? FontWeight.w500 : null + fontSize: 13.w, + color: controller.educationSelect.value != -1 ? const Color.fromRGBO(51, 51, 51, 1) :const Color.fromRGBO(191, 191, 191, 1), + fontWeight: controller.educationSelect.value != -1 ? FontWeight.w500 : null ), - ), - ),), - SetItem(label: "职业", child: InkWell( + ),), + ), + + InkWell( onTap: () { TDPicker.showMultiLinkedPicker(context, title: '', onConfirm: (selected) { print(selected); controller.occupation.value = selected.join("-"); OccupationData first = controller.occupationList.firstWhere( - (e) => e.industry == selected[0], + (e) => e.industry == selected[0], ); OccupationList second = first.occupationList?.firstWhere( - (e) => e.occupation == selected[1] + (e) => e.occupation == selected[1] ) ?? OccupationList(); print([first.industryCode, second.occupationCode]); controller.occupationValue.value = [first.industryCode, second.occupationCode]; @@ -537,22 +588,23 @@ class _EditInfoPageState extends State { }); Navigator.of(context).pop(); + controller.saveData(); }, data: controller.occupationShowData, - columnNum: 2, + columnNum: 2, initialData:[]); }, - child: Text( + child: SetItem(label: "职业", child: Text( controller.occupation.value != "" ? controller.occupation.value : "请选择", style: TextStyle( fontSize: 13.w, color: controller.occupation.value != "" ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1), - fontWeight: controller.occupation.value != "" ? FontWeight.w500 : null + fontWeight: controller.occupation.value != "" ? FontWeight.w500 : null ), - ), - ),), - // SetItem(label: "公司", showRequired: false,), - SetItem(label: "月收入", child: InkWell( + ),), + ), + + InkWell( onTap: () { TDPicker.showMultiPicker(context, title: '', onConfirm: (selected) { @@ -563,18 +615,22 @@ class _EditInfoPageState extends State { }); Navigator.of(context).pop(); + controller.saveData(); }, data: [controller.incomeList.map((e) => e.desc ?? "").toList()]); }, - child: Text( + child: SetItem(label: "月收入", child: Text( controller.incomeSelect.value != -1 ? controller.incomeList[controller.incomeSelect.value].desc ?? "" :"请选择", style: TextStyle( fontSize: 13.w, color: controller.incomeSelect.value != -1 ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1), - fontWeight: controller.incomeSelect.value != -1 ? FontWeight.w500 : null + fontWeight: controller.incomeSelect.value != -1 ? FontWeight.w500 : null ), - ), - ),), - SetItem(label: "婚姻状况", child: InkWell( + ),), + ), + + // SetItem(label: "公司", showRequired: false,), + + InkWell( onTap: () { TDPicker.showMultiPicker(context, title: '', onConfirm: (selected) { @@ -585,18 +641,20 @@ class _EditInfoPageState extends State { }); Navigator.of(context).pop(); + controller.saveData(); }, data: [controller.maritalList.map((e) => e.desc ?? "").toList()]); }, - child: Text( + child: SetItem(label: "婚姻状况", child: Text( controller.maritalSelect.value != -1 ? controller.maritalList[controller.maritalSelect.value].desc ?? "" :"请选择", style: TextStyle( fontSize: 13.w, color: controller.maritalSelect.value != -1 ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1), fontWeight: controller.maritalSelect.value != -1 ? FontWeight.w500 : null ), - ), - ),), - SetItem(label: "有无房产", child: InkWell( + ),), + ), + + InkWell( onTap: () { TDPicker.showMultiPicker(context, title: '', onConfirm: (selected) { @@ -607,20 +665,24 @@ class _EditInfoPageState extends State { }); Navigator.of(context).pop(); + controller.saveData(); }, data: [controller.propertyList.map((e) => e.desc ?? "").toList()]); }, - child: Text( + child: SetItem(label: "有无房产", child: Text( controller.propertySelect.value != -1 ? controller.propertyList[controller.propertySelect.value].desc ?? "" :"请选择", style: TextStyle( fontSize: 13.w, color: controller.propertySelect.value != -1 ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1), fontWeight: controller.propertySelect.value != -1 ? FontWeight.w500 : null ), - ), - ),), + ),), + ), - Container( + + + + if(false) Container( margin: EdgeInsets.symmetric( vertical: 30.w ), @@ -645,79 +707,11 @@ class _EditInfoPageState extends State { controller.saveData(); }), ) - // SizedBox(height: 8.w,), - // InkWell( - // onTap: (){ - // Get.to(() => SignaturePage()); - // }, - // child: Column( - // children: [ - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // children: [ - // Text( - // "交友心声", - // style: TextStyle( - // fontSize: 13.w, - // color: const Color.fromRGBO(144, 144, 144, 1) - // ), - // ), - // Icon( - // Icons.keyboard_arrow_right, - // size: 13.w, - // color: const Color.fromRGBO(191, 191, 191, 1) - // ) - // ], - // ), - // Container( - // margin: EdgeInsets.only(bottom: 3.w), - // padding: EdgeInsets.only(bottom: 12.w), - // decoration: BoxDecoration( - // border: Border( - // bottom: BorderSide(width: 1, color: const Color.fromRGBO(245, 245, 245, 1)) - // ) - // ), - // child: Text( - // "拒绝内耗,向阳而生,用热爱抵御岁月漫长,用真诚对待每一次相遇拒绝内耗,向阳而生,用热爱抵御岁月漫长,用真诚对待每一次相遇", - // style: TextStyle( - // fontSize: 13.w, - // fontWeight: FontWeight.w500, - // color: const Color.fromRGBO(51, 51, 51, 1) - // ), - // ), - // ), - // ], - // ), - // ), - // InkWell( - // onTap: (){ - // Get.to(() => TagSettingPage()); - // }, - // child: SetItem(label: "个性标签", showRequired: false,), - // ), - // SizedBox(height: 8.w,), - // Row( - // children: [ - // Text( - // "交友范围", - // style: TextStyle( - // fontSize: 13.w, - // color: const Color.fromRGBO(144, 144, 144, 1) - // ), - // ) - // ], - // ), - // SizedBox(height: 2.w,), - // SetItem(label: "所在地", showRequired: false,), - // SetItem(label: "年龄", showRequired: false,), - // SetItem(label: "身高", showRequired: false,), - // SetItem(label: "最低学历", showRequired: false,), - // SetItem(label: "最低月收入", showRequired: false,), ], ), ), ], - if(controller.menuActive.value == 2) ...[ + if(false && controller.menuActive.value == 2) ...[ Stack( children: [ controller.imgList.length > 0 ? Image.network( diff --git a/lib/pages/mine/withdraw_history_page.dart b/lib/pages/mine/withdraw_history_page.dart index 3e0b3bd..1172974 100644 --- a/lib/pages/mine/withdraw_history_page.dart +++ b/lib/pages/mine/withdraw_history_page.dart @@ -1,104 +1,129 @@ import 'package:dating_touchme_app/components/page_appbar.dart'; +import 'package:dating_touchme_app/controller/mine/withdraw_history_controller.dart'; +import 'package:dating_touchme_app/extension/ex_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; -class WithdrawHistoryPage extends StatefulWidget { - const WithdrawHistoryPage({super.key}); +import '../../model/mine/withdraw_audit_data.dart'; - @override - State createState() => _WithdrawHistoryPageState(); -} +class WithdrawHistoryPage extends StatelessWidget { + const WithdrawHistoryPage({super.key}); -class _WithdrawHistoryPageState extends State { @override Widget build(BuildContext context) { - return Scaffold( - appBar: PageAppbar(title: "提现"), - body: SingleChildScrollView( - child: Container( - padding: EdgeInsetsGeometry.symmetric( - vertical: 11.w, - horizontal: 16.w - ), - child: Column( - children: [ - historyItem(), - historyItem(), - historyItem(), - historyItem(), - historyItem(), - historyItem(), - historyItem(), - historyItem(), - ], + return GetX( + init: WithdrawHistoryController(), + builder: (controller){ + return Scaffold( + appBar: PageAppbar(title: "提现"), + body: SingleChildScrollView( + child: Container( + padding: EdgeInsetsGeometry.symmetric( + vertical: 11.w, + horizontal: 16.w + ), + child: Column( + children: [ + ...controller.historyList.map((e){ + return historyItem(e, context); + }), + ], + ), + ), ), - ), - ), + ); + }, ); } - Widget historyItem() { + Widget historyItem(Records item, BuildContext context) { return Container( padding: EdgeInsets.only( - bottom: 12.w + bottom: 12.w ), margin: EdgeInsets.only( - bottom: 16.w + bottom: 16.w ), decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 1, - color: const Color.fromRGBO(238, 238, 238, 1) + border: Border( + bottom: BorderSide( + width: 1, + color: const Color.fromRGBO(238, 238, 238, 1) + ) ) - ) ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - RichText( - text: TextSpan( - children: [ - TextSpan( - text: "提现金额:", - style: TextStyle( - fontSize: 14.w, - fontWeight: FontWeight.w500, - color: const Color.fromRGBO(51, 51, 51, 1) - ) + Row( + children: [ + RichText( + text: TextSpan( + children: [ + TextSpan( + text: "提现金额:", + style: TextStyle( + fontSize: 14.w, + fontWeight: FontWeight.w500, + color: const Color.fromRGBO(51, 51, 51, 1) + ) + ), + TextSpan( + text: "${item.withdrawAmount}", + style: TextStyle( + fontSize: 14.w, + fontWeight: FontWeight.w500, + color: const Color.fromRGBO(238, 129, 27, 1) + ) + ), + ] + ), + ), + Container( + padding: EdgeInsets.symmetric( + vertical: 2.w, + horizontal: 4.w ), - TextSpan( - text: "680.00", - style: TextStyle( - fontSize: 14.w, - fontWeight: FontWeight.w500, - color: const Color.fromRGBO(238, 129, 27, 1) - ) + margin: EdgeInsets.only( + left: 8.w ), - ] - ), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.w)), + color: (item.remitStatus ?? false) ? const Color.fromRGBO(25, 114, 248, 1) : const Color.fromRGBO(238, 129, 27, 1) + ), + child: Text( + (item.remitStatus ?? false) ? "提现成功" :"处理中", + style: TextStyle( + fontSize: 10.w, + color: Colors.white + ), + ), + ) + ], ), SizedBox(height: 8.w,), Text( - "提现到工商银行(2465)", + "${item.extDetailsInfo?.bankName}(${item.extDetailsInfo?.cardNum!.substring(item.extDetailsInfo!.cardNum!.length - 4)})", style: TextStyle( fontSize: 12.w, ), ), SizedBox(height: 8.w,), Text( - "申请时间:2024-04-23 15:23:48", + "申请时间:${item.applyTime}", style: TextStyle( - fontSize: 12.w, - color: const Color.fromRGBO(153, 153, 153, 1) + fontSize: 12.w, + color: const Color.fromRGBO(153, 153, 153, 1) ), ), SizedBox(height: 8.w,), - Row( + if(item.remitStatus ?? false) Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - "处理时间:2024-04-23 15:23:48", + "处理时间:${item.remitDateTime}", style: TextStyle( fontSize: 12.w, color: const Color.fromRGBO(153, 153, 153, 1) @@ -107,10 +132,12 @@ class _WithdrawHistoryPageState extends State { Text( "查看打款凭证", style: TextStyle( - fontSize: 12.w, - color: const Color.fromRGBO(25, 114, 248, 1) + fontSize: 12.w, + color: const Color.fromRGBO(25, 114, 248, 1) ), - ) + ).onTap(() { + TDImageViewer.showImageViewer(context: context, images: [item.remitUrl]); + }) ], ) ], @@ -118,3 +145,4 @@ class _WithdrawHistoryPageState extends State { ); } } + diff --git a/lib/pages/mine/withdraw_page.dart b/lib/pages/mine/withdraw_page.dart index c679ec8..cc5952f 100644 --- a/lib/pages/mine/withdraw_page.dart +++ b/lib/pages/mine/withdraw_page.dart @@ -7,7 +7,9 @@ import 'package:dating_touchme_app/pages/mine/add_bankcard_page.dart'; import 'package:dating_touchme_app/pages/mine/withdraw_history_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_smart_dialog/flutter_smart_dialog.dart'; import 'package:get/get.dart'; +import 'package:tdesign_flutter/tdesign_flutter.dart'; class WithdrawPage extends StatelessWidget { const WithdrawPage({super.key}); @@ -180,7 +182,6 @@ class WithdrawPage extends StatelessWidget { ), SizedBox(height: 12.w,), Row( - crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( "¥", @@ -189,6 +190,42 @@ class WithdrawPage extends StatelessWidget { color: Colors.black, fontWeight: FontWeight.w500 ), + ), + Expanded( + child: TextField( + controller: controller.withdrawMoneyController.value, + keyboardType: TextInputType.number, + style: TextStyle( + fontSize: ScreenUtil().setWidth(22), + height: 1 + ), + decoration: InputDecoration( + contentPadding: EdgeInsets.symmetric( + vertical: 0, + horizontal: 0 + ), + hintText: "请输入提现金额", + hintStyle: TextStyle( + color: Colors.grey + ), + + border: const OutlineInputBorder( + borderSide: BorderSide.none, // 这将移除边框 // 可选:设置圆角 + ), + // 如果你希望聚焦时和未聚焦时都没有边框,也可以设置 focusedBorder 和 enabledBorder + focusedBorder: const OutlineInputBorder( + borderSide: BorderSide.none, + borderRadius: BorderRadius.all(Radius.circular(4.0)), + ), + enabledBorder: const OutlineInputBorder( + borderSide: BorderSide.none, + borderRadius: BorderRadius.all(Radius.circular(4.0)), + ), + ), + onChanged: (value){ + controller.withdrawMoney.value = value; + }, + ), ) ], ), @@ -213,7 +250,195 @@ class WithdrawPage extends StatelessWidget { Get.to(() => WithdrawHistoryPage()); }) ], - ) + ), + SizedBox(height: 40.w,), + Container( + width: 350.w, + height: 42.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(42.w)), + color: const Color.fromRGBO(117, 98, 249, 1) + ), + child: Center( + child: Text( + "提现", + style: TextStyle( + fontSize: 14.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ), + ), + ).onTap(() async { + if(controller.nowBankCard.value.id == null){ + SmartDialog.showToast('请先选择到账银行卡'); + return; + } + if(controller.withdrawMoney.value == ""){ + SmartDialog.showToast('请输入提现金额'); + return; + } + await controller.getServiceFee(); + Navigator.of(context).push( + TDSlidePopupRoute( + slideTransitionFrom: SlideTransitionFrom.center, + builder: (context) { + return Obx((){ + return Material( + borderRadius: BorderRadius.circular(TDTheme.of(context).radiusLarge), + child: Container( + decoration: BoxDecoration( + color: TDTheme.of(context).bgColorContainer, + borderRadius: + BorderRadius.circular(TDTheme.of(context).radiusLarge), + ), + width: 287.w, + padding: EdgeInsets.all(12.w), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + "温馨提示", + style: TextStyle( + fontSize: 18.w, + fontWeight: FontWeight.w500 + ), + ), + SizedBox(height: 12.w,), + Text( + "提现金额", + style: TextStyle( + fontSize: 14.w, + ), + ), + RichText( + text: TextSpan( + children: [ + TextSpan( + text: "¥", + style: TextStyle( + fontSize: 14.w, + fontWeight: FontWeight.w700, + color: const Color.fromRGBO(51, 51, 51, 1) + ) + ), + TextSpan( + text: "${controller.serviceFeeData.value.withdrawAmount}", + style: TextStyle( + fontSize: 18.w, + fontWeight: FontWeight.w700, + color: const Color.fromRGBO(51, 51, 51, 1) + ) + ), + ] + ), + ), + SizedBox(height: 12.w,), + RichText( + text: TextSpan( + children: [ + TextSpan( + text: "到账银行卡:", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(51, 51, 51, .5) + ) + ), + TextSpan( + text: "${controller.nowBankCard.value.bankName}(${controller.nowBankCard.value.cardNum!.substring(controller.nowBankCard.value.cardNum!.length - 4)})", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(51, 51, 51, 1) + ) + ), + ] + ), + ), + SizedBox(height: 12.w,), + RichText( + text: TextSpan( + children: [ + TextSpan( + text: "到账金额:", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(51, 51, 51, .5) + ) + ), + TextSpan( + text: "¥${controller.serviceFeeData.value.arrivalAmount}", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(51, 51, 51, 1) + ) + ), + ] + ), + ), + SizedBox(height: 12.w,), + RichText( + text: TextSpan( + children: [ + TextSpan( + text: "提现手续费:", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(51, 51, 51, .5) + ) + ), + TextSpan( + text: "¥${controller.serviceFeeData.value.withdrawServiceFee} ", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(51, 51, 51, 1) + ) + ), + TextSpan( + text: " 费率:", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(51, 51, 51, .5) + ) + ), + TextSpan( + text: "${controller.serviceFeeData.value.withdrawServiceFeePct}%", + style: TextStyle( + fontSize: 14.w, + color: const Color.fromRGBO(51, 51, 51, 1) + ) + ), + ] + ), + ), + SizedBox(height: 40.w,), + Container( + width: 255.w, + height: 42.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(42.w)), + color: const Color.fromRGBO(117, 98, 249, 1) + ), + child: Center( + child: Text( + "确认提现", + style: TextStyle( + fontSize: 14.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ), + ), + ).onTap((){ + controller.withdrawSubmit(); + }) + ], + ), + ), + ); + }); + }), + ); + }) ], ), ) diff --git a/pubspec.lock b/pubspec.lock index 83bf62a..71f0980 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -742,7 +742,7 @@ packages: source: hosted version: "1.1.2" image_picker_android: - dependency: transitive + dependency: "direct main" description: name: image_picker_android sha256: "317a5d961cec5b34e777b9252393f2afbd23084aa6e60fcf601dcf6341b9ebeb" diff --git a/pubspec.yaml b/pubspec.yaml index a0b33f7..28cf110 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -73,6 +73,7 @@ dependencies: agora_token_generator: ^1.0.0 location_plugin: path: location_plugin + image_picker_android: ^0.8.12+23 dev_dependencies: flutter_test: