Browse Source

Merge branch 'master' of http://git.qniao.cn/dating-agency/dating_touchme_app

* 'master' of http://git.qniao.cn/dating-agency/dating_touchme_app:
  优化修改资料逻辑,对接提现相关接口,优化用户详情展示,优化和测试登录逻辑

# Conflicts:
#	lib/controller/mine/withdraw_history_controller.dart
ios
ZHR007 4 months ago
parent
commit
bad580d9b4
14 changed files with 902 additions and 305 deletions
  1. 212
      lib/controller/mine/edit_info_controller.dart
  2. 4
      lib/controller/mine/user_controller.dart
  3. 55
      lib/controller/mine/withdraw_controller.dart
  4. 3
      lib/controller/mine/withdraw_history_controller.dart
  5. 4
      lib/network/api_urls.dart
  6. 28
      lib/network/user_api.dart
  7. 140
      lib/network/user_api.g.dart
  8. 66
      lib/pages/home/user_information_page.dart
  9. 3
      lib/pages/mine/add_bankcard_page.dart
  10. 306
      lib/pages/mine/edit_info_page.dart
  11. 154
      lib/pages/mine/withdraw_history_page.dart
  12. 229
      lib/pages/mine/withdraw_page.dart
  13. 2
      pubspec.lock
  14. 1
      pubspec.yaml

212
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 = <EducationData>[].obs;
final incomeList = <EducationData>[].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<UserApi>();
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<void> handleMultiGallerySelection(int type) async {
try {
// /
// final ok = await _ensurePermission(
// Permission.photos,
// // Android photos storage/mediaLibrarypermission_handler
// denyToast: '相册权限被拒绝,请在设置中允许访问相册',
// );
// if (!ok) return;
//
final ImagePicker picker = ImagePicker();
final List<XFile>? image = await picker.pickMultiImage(limit: 9 - imgList.length);
if (image != null) {
for(int i = 0; i<image.length; i++){
await processSelectedMoreImage(File(image[i].path), type);
if(i == image.length - 1){
SmartDialog.dismiss();
SmartDialog.showToast('上传相册成功');
savaImgList();
}
}
}
} catch (e) {
print('选择图片失败: $e');
//
if (e.toString().contains('permission') || e.toString().contains('权限')) {
SmartDialog.showToast('相册权限被拒绝,请在设置中允许访问相册');
} else {
SmartDialog.showToast('选择图片失败,请重试');
}
}
}
//
Future<bool> _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<void> 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{

4
lib/controller/mine/user_controller.dart

@ -102,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!;
@ -109,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('转到完善信息');

55
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;
}
}
}

3
lib/controller/mine/withdraw_history_controller.dart

@ -22,7 +22,8 @@ class WithdrawHistoryController extends GetxController {
}
getHistoryList() async {try{
final response = await _userApi.pageWithdrawAudit(pageNum: page.value,
final response = await _userApi.pageWithdrawAudit(
pageNum: page.value,
pageSize: 10,
);
if (response.data.isSuccess && response.data.data != null) {

4
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';

28
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<HttpResponse<BaseResponse<BankCardOcrData>>> recognizeBankCard(
@Body() Map<String, dynamic> data,
);
@POST(ApiUrls.calculateWithdrawServiceFee)
Future<HttpResponse<BaseResponse<WithdrawData>>> calculateWithdrawServiceFee(
@Body() Map<String, dynamic> data,
);
@POST(ApiUrls.applyWalletAccountWithdraw)
Future<HttpResponse<BaseResponse<dynamic>>> applyWalletAccountWithdraw(
@Body() Map<String, dynamic> data,
);
@GET(ApiUrls.pageWithdrawAudit)
Future<HttpResponse<BaseResponse<WithdrawAuditData>>> pageWithdrawAudit(
{
@Query('pageNum') required int pageNum,
@Query('pageSize') required int pageSize,
}
);
@GET(ApiUrls.getMarriageInformationDetailsById)
Future<HttpResponse<BaseResponse<UserInfoData>>> getMarriageInformationDetailsById(
{
@Query('miId') required String miId,
}
);
}

140
lib/network/user_api.g.dart

@ -874,6 +874,146 @@ class _UserApi implements UserApi {
return httpResponse;
}
@override
Future<HttpResponse<BaseResponse<WithdrawData>>> calculateWithdrawServiceFee(
Map<String, dynamic> data,
) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(data);
final _options = _setStreamType<HttpResponse<BaseResponse<WithdrawData>>>(
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<Map<String, dynamic>>(_options);
late BaseResponse<WithdrawData> _value;
try {
_value = BaseResponse<WithdrawData>.fromJson(
_result.data!,
(json) => WithdrawData.fromJson(json as Map<String, dynamic>),
);
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
}
final httpResponse = HttpResponse(_value, _result);
return httpResponse;
}
@override
Future<HttpResponse<BaseResponse<dynamic>>> applyWalletAccountWithdraw(
Map<String, dynamic> data,
) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{};
final _headers = <String, dynamic>{};
final _data = <String, dynamic>{};
_data.addAll(data);
final _options = _setStreamType<HttpResponse<BaseResponse<dynamic>>>(
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<Map<String, dynamic>>(_options);
late BaseResponse<dynamic> _value;
try {
_value = BaseResponse<dynamic>.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<HttpResponse<BaseResponse<WithdrawAuditData>>> pageWithdrawAudit({
required int pageNum,
required int pageSize,
}) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{
r'pageNum': pageNum,
r'pageSize': pageSize,
};
final _headers = <String, dynamic>{};
const Map<String, dynamic>? _data = null;
final _options =
_setStreamType<HttpResponse<BaseResponse<WithdrawAuditData>>>(
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<Map<String, dynamic>>(_options);
late BaseResponse<WithdrawAuditData> _value;
try {
_value = BaseResponse<WithdrawAuditData>.fromJson(
_result.data!,
(json) => WithdrawAuditData.fromJson(json as Map<String, dynamic>),
);
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
}
final httpResponse = HttpResponse(_value, _result);
return httpResponse;
}
@override
Future<HttpResponse<BaseResponse<UserInfoData>>>
getMarriageInformationDetailsById({required String miId}) async {
final _extra = <String, dynamic>{};
final queryParameters = <String, dynamic>{r'miId': miId};
final _headers = <String, dynamic>{};
const Map<String, dynamic>? _data = null;
final _options = _setStreamType<HttpResponse<BaseResponse<UserInfoData>>>(
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<Map<String, dynamic>>(_options);
late BaseResponse<UserInfoData> _value;
try {
_value = BaseResponse<UserInfoData>.fromJson(
_result.data!,
(json) => UserInfoData.fromJson(json as Map<String, dynamic>),
);
} on Object catch (e, s) {
errorLogger?.logError(e, s, _options);
rethrow;
}
final httpResponse = HttpResponse(_value, _result);
return httpResponse;
}
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes ||

66
lib/pages/home/user_information_page.dart

@ -93,7 +93,7 @@ class _UserInformationPageState extends State<UserInformationPage> {
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<UserInformationPage> {
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 {
);
}
}

3
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,

306
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<EditInfoPage> {
showCupertinoModalPopup(
context: Get.context!,
builder: (context) => CupertinoActionSheet(
title: const Text('选择头像'),
title: Text(type == 1 ? '选择头像' : "选择相册"),
actions: <Widget>[
CupertinoActionSheetAction(
if(type == 1) CupertinoActionSheetAction(
child: const Text('拍照'),
onPressed: () async {
Navigator.pop(context);
@ -54,7 +57,16 @@ class _EditInfoPageState extends State<EditInfoPage> {
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<EditInfoPage> {
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<EditInfoPage> {
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<EditInfoPage> {
).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<EditInfoPage> {
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<EditInfoPage> {
],
),
),
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: () => <String, Object>{},
);
if(province.isNotEmpty){
Map city = province["children"].firstWhere(
(e) => e["label"] == selected[1],
(e) => e["label"] == selected[1],
orElse: () => <String, Object>{},
);
if(city.isNotEmpty){
@ -447,21 +491,23 @@ class _EditInfoPageState extends State<EditInfoPage> {
});
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<EditInfoPage> {
});
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<EditInfoPage> {
});
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<EditInfoPage> {
});
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<EditInfoPage> {
});
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<EditInfoPage> {
});
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<EditInfoPage> {
});
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<EditInfoPage> {
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(

154
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<WithdrawHistoryPage> createState() => _WithdrawHistoryPageState();
}
class WithdrawHistoryPage extends StatelessWidget {
const WithdrawHistoryPage({super.key});
class _WithdrawHistoryPageState extends State<WithdrawHistoryPage> {
@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<WithdrawHistoryController>(
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<WithdrawHistoryPage> {
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<WithdrawHistoryPage> {
);
}
}

229
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();
})
],
),
),
);
});
}),
);
})
],
),
)

2
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"

1
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:

Loading…
Cancel
Save