王子贤 4 months ago
parent
commit
6800ba8079
12 changed files with 944 additions and 753 deletions
  1. 67
      lib/controller/home/user_information_controller.dart
  2. 113
      lib/controller/mine/edit_info_controller.dart
  3. 2
      lib/network/api_urls.dart
  4. 7
      lib/network/user_api.dart
  5. 32
      lib/network/user_api.g.dart
  6. 2
      lib/pages/home/content_card.dart
  7. 743
      lib/pages/home/user_information_page.dart
  8. 101
      lib/pages/mine/edit_info_page.dart
  9. 459
      lib/pages/mine/my_wallet_page.dart
  10. 44
      lib/pages/mine/pay_fail_page.dart
  11. 123
      lib/pages/mine/rose_history_page.dart
  12. 4
      lib/pages/mine/withdraw_history_page.dart

67
lib/controller/home/user_information_controller.dart

@ -0,0 +1,67 @@
import 'package:dating_touchme_app/controller/global.dart';
import 'package:dating_touchme_app/model/home/user_info_data.dart';
import 'package:dating_touchme_app/network/user_api.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
class UserInformationController extends GetxController {
final String miId;
final String userId;
UserInformationController({required this.miId, required this.userId});
final nowSelect = 0.obs;
final userData = UserInfoData().obs;
List<String> tagList = [
"北京", "160cm", "想要甜甜的恋爱", "本科", "朋友圈摄影师", "英雄联盟", "流放之路",
"CF", "DNA", "堡垒之夜", "SCP"
];
late UserApi _userApi;
@override
void onInit() {
super.onInit();
_userApi = Get.find<UserApi>();
getUserData();
}
int calculateAge(String birthdayStr) {
final birthday = DateTime.parse(birthdayStr); // 1996-1-20
final today = DateTime.now();
int age = today.year - birthday.year;
// 1
if (today.month < birthday.month ||
(today.month == birthday.month && today.day < birthday.day)) {
age--;
}
return age;
}
final myUserData = GlobalData().userData.obs;
getUserData() async {
try {
final response = await _userApi.getDongwoMarriageInformationDetail(miId: miId);
if (response.data.isSuccess && response.data.data != null) {
userData.value = response.data.data ?? UserInfoData();
} else {
//
throw Exception(response.data.message ?? '获取数据失败');
}
} catch(e){
print('钱包数据获取失败: $e');
SmartDialog.showToast('钱包数据获取失败');
rethrow;
}
}
}

113
lib/controller/mine/edit_info_controller.dart

@ -31,6 +31,17 @@ class EditInfoController extends GetxController {
final menuActive = 1.obs; final menuActive = 1.obs;
final birthday = ''.obs;
//
void selectBirthday(String selectedDate) {
birthday.value = selectedDate;
//
print('选择的出生日期: $selectedDate');
//
SmartDialog.showToast('出生日期已选择');
}
@ -104,7 +115,7 @@ class EditInfoController extends GetxController {
_userApi = Get.find<UserApi>(); _userApi = Get.find<UserApi>();
getEducationList();
getIncomeList(); getIncomeList();
getMaritalList(); getMaritalList();
getPropertyList(); getPropertyList();
@ -281,27 +292,10 @@ class EditInfoController extends GetxController {
final data = response.data.data; 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(),
)));
Get.to(() => UserInformationPage(
miId: userData.value?.id ?? "",
userId: GlobalData().userId ?? "",
));
} else { } else {
// //
throw Exception(response.data.message ?? '获取数据失败'); throw Exception(response.data.message ?? '获取数据失败');
@ -415,17 +409,27 @@ class EditInfoController extends GetxController {
final List<XFile>? image = await picker.pickMultiImage(limit: 9 - imgList.length); final List<XFile>? image = await picker.pickMultiImage(limit: 9 - imgList.length);
if (image != null) { 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();
}
}
final futures = image.map((e){
return processSelectedMoreImage(File(e.path), type);;
});
final list = await Future.wait(futures);
imgList.addAll(list);
print(imgList);
SmartDialog.dismiss();
SmartDialog.showToast('上传相册成功');
// savaImgList();
// 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) { } catch (e) {
print('选择图片失败: $e'); print('选择图片失败: $e');
@ -499,36 +503,19 @@ class EditInfoController extends GetxController {
} }
} }
// //
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('上传相册失败,请重试');
}
Future<String> processSelectedMoreImage(File imageFile, int type) async {
try {
//
SmartDialog.showLoading(msg: '上传相册中...');
String objectName = '${DateUtil.getNowDateMs()}.${imageFile.path.split('.').last}';
String imageUrl = await OSSManager.instance.uploadFile(imageFile.readAsBytesSync(), objectName);
print('上传成功,图片URL: $imageUrl');
return imageUrl;
} catch (e) {
SmartDialog.dismiss();
print('处理图片失败: $e');
SmartDialog.showToast('上传相册失败,请重试');
return "";
} }
} }

2
lib/network/api_urls.dart

@ -76,6 +76,8 @@ class ApiUrls {
'dating-agency-mall/user/get/wallet-account'; 'dating-agency-mall/user/get/wallet-account';
static const String getWalletAccountRecord = static const String getWalletAccountRecord =
'dating-agency-mall/user/page/wallet-account-record'; 'dating-agency-mall/user/page/wallet-account-record';
static const String getDongwoMarriageInformationDetail =
'dating-agency-service/user/get/dongwo/marriage-information-detail';
// //
static const String getMarriageList = static const String getMarriageList =

7
lib/network/user_api.dart

@ -178,4 +178,11 @@ abstract class UserApi {
@Query('recordTimeTo') required String recordTimeTo, @Query('recordTimeTo') required String recordTimeTo,
} }
); );
@GET(ApiUrls.getDongwoMarriageInformationDetail)
Future<HttpResponse<BaseResponse<UserInfoData>>> getDongwoMarriageInformationDetail(
{
@Query('miId') required String miId,
}
);
} }

32
lib/network/user_api.g.dart

@ -1097,6 +1097,38 @@ class _UserApi implements UserApi {
return httpResponse; return httpResponse;
} }
@override
Future<HttpResponse<BaseResponse<UserInfoData>>>
getDongwoMarriageInformationDetail({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/dongwo/marriage-information-detail',
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) { RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic && if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes || !(requestOptions.responseType == ResponseType.bytes ||

2
lib/pages/home/content_card.dart

@ -270,7 +270,7 @@ class ContentCard extends StatelessWidget {
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
// //
Get.to(() => UserInformationPage(userData: item));
Get.to(() => UserInformationPage(miId: item.miId, userId: item.userId,));
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(

743
lib/pages/home/user_information_page.dart

@ -1,5 +1,6 @@
import 'package:cached_network_image/cached_network_image.dart'; import 'package:cached_network_image/cached_network_image.dart';
import 'package:dating_touchme_app/controller/global.dart'; import 'package:dating_touchme_app/controller/global.dart';
import 'package:dating_touchme_app/controller/home/user_information_controller.dart';
import 'package:dating_touchme_app/generated/assets.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/home/marriage_data.dart';
import 'package:dating_touchme_app/pages/home/report_page.dart'; import 'package:dating_touchme_app/pages/home/report_page.dart';
@ -9,457 +10,417 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/get_core/src/get_main.dart'; import 'package:get/get_core/src/get_main.dart';
class UserInformationPage extends StatefulWidget {
final MarriageData userData;
class UserInformationPage extends StatelessWidget {
final String miId;
final String userId;
const UserInformationPage({super.key, required this.miId, required this.userId});
const UserInformationPage({super.key, required this.userData});
@override
State<UserInformationPage> createState() => _UserInformationPageState();
}
class _UserInformationPageState extends State<UserInformationPage> {
List<String> imgList = [
"https://fastly.picsum.photos/id/64/800/800.jpg?hmac=NBZ4_-vqzD6p25oCeaW0H5vH-ql9zzei-SqJNeUo1QU",
"https://fastly.picsum.photos/id/985/800/800.jpg?hmac=DfRt99HFbMJ96DlN-poOhruWYRsexESE94ilLC3g1rU",
"https://fastly.picsum.photos/id/703/800/800.jpg?hmac=-bRTkPxnsiQ5kCo2tfXj6tFrXMD7YnVx7bQ0STno3Tg"
];
int nowSelect = 0;
List<String> tagList = [
"北京", "160cm", "想要甜甜的恋爱", "本科", "朋友圈摄影师", "英雄联盟", "流放之路",
"CF", "DNA", "堡垒之夜", "SCP"
];
int calculateAge(String birthdayStr) {
final birthday = DateTime.parse(birthdayStr); // 1996-1-20
final today = DateTime.now();
int age = today.year - birthday.year;
// 1
if (today.month < birthday.month ||
(today.month == birthday.month && today.day < birthday.day)) {
age--;
}
return age;
}
final userData = GlobalData().userData.obs;
@override
void initState() {
super.initState();
userData.value = GlobalData().userData;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: [
widget.userData.photoList.isNotEmpty ? CachedNetworkImage(
imageUrl: "${widget.userData.photoList[nowSelect].photoUrl}?x-oss-process=image/format,webp",
width: 375.w,
height: 384.w,
fit: BoxFit.cover,
) : CachedNetworkImage(
imageUrl: "${widget.userData.avatar}?x-oss-process=image/format,webp",
width: 375.w,
height: 384.w,
fit: BoxFit.cover,
),
SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 361.w),
child: Container(
height: 812.h - 361.w,
return GetX<UserInformationController>(
init: UserInformationController(miId: miId, userId: userId),
builder: (controller){
return controller.userData.value.id != null ? Scaffold(
body: Stack(
children: [
controller.userData.value.photoList!.isNotEmpty ? CachedNetworkImage(
imageUrl: "${controller.userData.value.photoList![controller.nowSelect.value].photoUrl}?x-oss-process=image/format,webp",
width: 375.w, width: 375.w,
padding: EdgeInsets.only(
top: 31.w,
left: 15.w,
right: 24.w
),
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(23.w)
height: 384.w,
fit: BoxFit.cover,
) : CachedNetworkImage(
imageUrl: "${controller.userData.value.profilePhoto}?x-oss-process=image/format,webp",
width: 375.w,
height: 384.w,
fit: BoxFit.cover,
),
SingleChildScrollView(
child: Container(
padding: EdgeInsets.only(top: 361.w),
child: Container(
height: 812.h - 361.w,
width: 375.w,
padding: EdgeInsets.only(
top: 31.w,
left: 15.w,
right: 24.w
), ),
color: Colors.white
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
decoration: BoxDecoration(
borderRadius: BorderRadius.vertical(
top: Radius.circular(23.w)
),
color: Colors.white
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Text(
widget.userData.nickName,
style: TextStyle(
fontSize: 19.w,
color: const Color.fromRGBO(51, 51, 51, 1),
fontWeight: FontWeight.w600
),
),
SizedBox(width: 13.w,),
if(userData.value?.genderCode == 0) Container(
width: 33.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(255, 237, 255, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesFemale,
width: 8.w,
height: 8.w,
Row(
children: [
Text(
controller.userData.value.nickName ?? "",
style: TextStyle(
fontSize: 19.w,
color: const Color.fromRGBO(51, 51, 51, 1),
fontWeight: FontWeight.w600
), ),
SizedBox(width: 2.w,),
Text(
"${widget.userData.age}",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(255, 66, 236, 1)
),
SizedBox(width: 13.w,),
if(controller.myUserData.value?.genderCode == 0) Container(
width: 33.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(255, 237, 255, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesFemale,
width: 8.w,
height: 8.w,
),
SizedBox(width: 2.w,),
Text(
"${controller.userData.value.age}",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(255, 66, 236, 1)
),
)
],
),
),
SizedBox(width: 3.w,),
Container(
width: 33.w,
height: 13.w,
margin: EdgeInsets.only(right: 2.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(234, 255, 219, 1)
),
child: Center(
child: Text(
"在线",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(38, 199, 124, 1)
),
), ),
)
],
),
),
SizedBox(width: 3.w,),
Container(
width: 33.w,
height: 13.w,
margin: EdgeInsets.only(right: 2.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(234, 255, 219, 1)
),
child: Center(
child: Text(
"在线",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(38, 199, 124, 1)
), ),
), ),
),
SizedBox(width: 4.w,),
if (controller.userData.value.identityCard != "" && controller.userData.value.identityCard != null) Container(
width: 43.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(246, 237, 255, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesRealName,
width: 8.w,
height: 7.w,
),
SizedBox(width: 2.w,),
Text(
"实名",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(160, 92, 255, 1)
),
)
],
),
),
SizedBox(width: 4.w,),
if(controller.myUserData.value?.genderCode == 1) Container(
width: 33.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(237, 245, 255, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesMale,
width: 8.w,
height: 8.w,
),
SizedBox(width: 2.w,),
Text(
"${controller.userData.value.age}",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(120, 140, 255, 1)
),
)
],
),
),
],
), ),
SizedBox(width: 4.w,),
if (widget.userData.isRealNameCertified) Container(
width: 43.w,
height: 13.w,
Container(
width: 63.w,
height: 27.w,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(246, 237, 255, 1)
borderRadius: BorderRadius.all(Radius.circular(27.w)),
color: const Color.fromRGBO(117, 98, 249, .1)
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Image.asset( Image.asset(
Assets.imagesRealName,
width: 8.w,
height: 7.w,
Assets.imagesPlayer,
width: 15.w,
height: 15.w,
), ),
SizedBox(width: 2.w,),
Text(
"实名",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(160, 92, 255, 1)
),
)
],
),
),
SizedBox(width: 4.w,),
if(userData.value?.genderCode == 1) Container(
width: 33.w,
height: 13.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(13.w)),
color: const Color.fromRGBO(237, 245, 255, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SizedBox(width: 4.w,),
Image.asset( Image.asset(
Assets.imagesMale,
width: 8.w,
height: 8.w,
Assets.imagesVoice,
width: 15.w,
height: 13.w,
), ),
SizedBox(width: 2.w,),
SizedBox(width: 4.w,),
Text( Text(
"${widget.userData.age}",
"6'",
style: TextStyle( style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(120, 140, 255, 1)
fontSize: 11.w,
color: const Color.fromRGBO(117, 98, 249, 1)
), ),
) )
], ],
), ),
),
)
], ],
), ),
Container(
width: 63.w,
height: 27.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(27.w)),
color: const Color.fromRGBO(117, 98, 249, .1)
SizedBox(height: 8.w,),
Text(
"父母催婚找个结婚的",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(144, 144, 144, 1)
), ),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesPlayer,
width: 15.w,
height: 15.w,
),
SizedBox(width: 4.w,),
Image.asset(
Assets.imagesVoice,
width: 15.w,
height: 13.w,
),
SizedBox(width: 4.w,),
Text(
"6'",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(117, 98, 249, 1)
),
)
],
),
SizedBox(height: 11.w,),
Wrap(
spacing: 7.w,
runSpacing: 7.w,
children: [
...controller.tagList.map((e){
return TagItem(label: e);
}),
],
),
SizedBox(height: 16.w,),
if ((controller.userData.value.provinceName?.isNotEmpty ?? false)) Text(
"IP属地:${controller.userData.value.provinceName}",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(144, 144, 144, 1)
), ),
)
],
),
SizedBox(height: 8.w,),
Text(
"父母催婚找个结婚的",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
SizedBox(height: 11.w,),
Wrap(
spacing: 7.w,
runSpacing: 7.w,
children: [
...tagList.map((e){
return TagItem(label: e);
}),
],
),
SizedBox(height: 16.w,),
if (widget.userData.provinceName.isNotEmpty) Text(
"IP属地:${widget.userData.provinceName}",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Text(
"动我ID:${widget.userData.userId}",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
// ID和用户数据模型
Get.to(() => ChatPage(
userId: widget.userData.userId,
userData: widget.userData,
));
},
child: Container(
width: 246.w,
height: 38.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(38.w)),
color: const Color.fromRGBO(51, 51, 51, 1)
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesChatBtn,
width: 13.w,
height: 12.w,
),
Text(
"动我ID:${controller.userData.value.userId}",
style: TextStyle(
fontSize: 9.w,
color: const Color.fromRGBO(144, 144, 144, 1)
),
),
Spacer(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
// ID和用户数据模型
// Get.to(() => ChatPage(
// userId: userId,
// userData: controller.userData.value,
// ));
},
child: Container(
width: 246.w,
height: 38.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(38.w)),
color: const Color.fromRGBO(51, 51, 51, 1)
), ),
SizedBox(width: 4.w,),
Text(
"发消息",
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesChatBtn,
width: 13.w,
height: 12.w,
),
SizedBox(width: 4.w,),
Text(
"发消息",
style: TextStyle(
fontSize: 15.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
)
],
),
),
),
Container(
width: 81.w,
height: 38.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(38.w)),
color: const Color.fromRGBO(117, 98, 249, 1)
),
child: Center(
child: Text(
"关注",
style: TextStyle( style: TextStyle(
fontSize: 15.w, fontSize: 15.w,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500
), ),
)
],
),
),
), ),
),
),
Container(
width: 81.w,
height: 38.w,
],
)
],
),
),
),
),
Positioned(
left: 0,
top: MediaQuery.of(context).padding.top + 23,
child: Container(
width: 375.w,
padding: EdgeInsets.symmetric(horizontal: 19.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: (){
Get.back();
},
child: Container(
width: 31.w,
height: 31.w,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(38.w)),
color: const Color.fromRGBO(117, 98, 249, 1)
borderRadius: BorderRadius.all(Radius.circular(31.w)),
color: const Color.fromRGBO(51, 51, 51, .5)
), ),
child: Center( child: Center(
child: Text(
"关注",
style: TextStyle(
fontSize: 15.w,
color: Colors.white,
fontWeight: FontWeight.w500
),
child: Icon(
Icons.keyboard_arrow_left,
size: 23.w,
color: Colors.white,
), ),
), ),
), ),
],
)
],
),
),
),
),
Positioned(
left: 0,
top: MediaQuery.of(context).padding.top + 23,
child: Container(
width: 375.w,
padding: EdgeInsets.symmetric(horizontal: 19.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: (){
Get.back();
},
child: Container(
width: 31.w,
height: 31.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(31.w)),
color: const Color.fromRGBO(51, 51, 51, .5)
), ),
child: Center(
child: Icon(
Icons.keyboard_arrow_left,
size: 23.w,
color: Colors.white,
),
PopupMenuButton<String>(
tooltip: "",
padding: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
color: Colors.white,
elevation: 8,
offset: Offset(0, 32.w), //
itemBuilder: (context) => [
const PopupMenuItem(value: 'report', child: Text('举报')),
const PopupMenuItem(value: 'block', child: Text('拉黑')),
],
onSelected: (v) {
if (v == 'report') {
print("举报");
Get.to(() => ReportPage());
} else if (v == 'block') {
print("拉黑");
}
},
child: Container(
width: 31.w,
height: 31.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(62.w)),
color: const Color.fromRGBO(51, 51, 51, .5)
),
child: Center(
child: Icon(
Icons.keyboard_control,
size: 23.w,
color: Colors.white,
),
),
), //
), ),
),
),
PopupMenuButton<String>(
tooltip: "",
padding: EdgeInsets.zero,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)),
color: Colors.white,
elevation: 8,
offset: Offset(0, 32.w), //
itemBuilder: (context) => [
const PopupMenuItem(value: 'report', child: Text('举报')),
const PopupMenuItem(value: 'block', child: Text('拉黑')),
], ],
onSelected: (v) {
if (v == 'report') {
print("举报");
Get.to(() => ReportPage());
} else if (v == 'block') {
print("拉黑");
}
},
child: Container(
width: 31.w,
height: 31.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(62.w)),
color: const Color.fromRGBO(51, 51, 51, .5)
),
child: Center(
child: Icon(
Icons.keyboard_control,
size: 23.w,
color: Colors.white,
),
),
), //
), ),
],
),
), ),
),
),
Positioned(
left: 15.w,
top: 310.w,
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: CachedNetworkImage(
imageUrl: "${entry.value.photoUrl}?x-oss-process=image/format,webp/resize,w_76",
width: 38.w,
height: 38.w,
fit: BoxFit.cover,
Positioned(
left: 15.w,
top: 310.w,
width: 345.w,
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
...controller.userData.value.photoList!.asMap().entries.map((entry){
return Container(
margin: EdgeInsets.only(right: 7.w),
child: InkWell(
onTap: (){
controller.nowSelect.value = entry.key;
},
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: controller.nowSelect.value == entry.key ? Border.all(width: 2.w, color: Colors.white) : null
),
child: Center(
child: CachedNetworkImage(
imageUrl: "${entry.value.photoUrl}?x-oss-process=image/format,webp/resize,w_76",
width: 38.w,
height: 38.w,
fit: BoxFit.cover,
),
),
), ),
), ),
), ),
),
),
);
}),
],
);
}),
],
),
),
), ),
),
],
), ),
],
),
) : SizedBox();
},
); );
} }
} }
class TagItem extends StatelessWidget { class TagItem extends StatelessWidget {
final String label; final String label;
const TagItem({super.key, required this.label}); const TagItem({super.key, required this.label});

101
lib/pages/mine/edit_info_page.dart

@ -82,6 +82,93 @@ class _EditInfoPageState extends State<EditInfoPage> {
); );
} }
//
Future _showDatePicker(EditInfoController controller) async {
//
final now = DateTime.now();
final maxDate = DateTime(now.year - 18); // 18
final minDate = DateTime(now.year - 80); // 80
// 25
DateTime initialDate = DateTime(now.year - 25);
if (controller.birthday.value.isNotEmpty) {
try {
final List<String> dateParts = controller.birthday.value.split('-');
if (dateParts.length == 3) {
initialDate = DateTime(
int.parse(dateParts[0]),
int.parse(dateParts[1]),
int.parse(dateParts[2]),
);
//
if (initialDate.isBefore(minDate)) initialDate = minDate;
if (initialDate.isAfter(maxDate)) initialDate = maxDate;
}
} catch (e) {
print('解析日期失败: $e');
}
}
//
DateTime? selectedDate = initialDate;
await showCupertinoModalPopup(
context: Get.context!,
builder: (BuildContext context) {
return Container(
height: 300,
color: CupertinoColors.white,
child: Column(
children: [
//
Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
CupertinoButton(
child: const Text('取消'),
onPressed: () {
Navigator.pop(context);
},
),
CupertinoButton(
child: const Text('确定'),
onPressed: () {
Navigator.pop(context);
if (selectedDate != null) {
// YYYY-MM-DD
final formattedDate = '${selectedDate!.year}-'
'${selectedDate!.month.toString().padLeft(2, '0')}-'
'${selectedDate!.day.toString().padLeft(2, '0')}';
controller.selectBirthday(formattedDate);
}
},
),
],
),
),
//
Expanded(
child: CupertinoDatePicker(
mode: CupertinoDatePickerMode.date,
initialDateTime: initialDate,
minimumDate: minDate,
maximumDate: maxDate,
onDateTimeChanged: (DateTime dateTime) {
selectedDate = dateTime;
},
use24hFormat: true,
backgroundColor: CupertinoColors.white,
),
),
],
),
);
},
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GetX<EditInfoController>( return GetX<EditInfoController>(
@ -251,7 +338,7 @@ class _EditInfoPageState extends State<EditInfoPage> {
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
if(controller.userData.value!.photoList![entry.key].auditStatus == 1 || controller.userData.value!.photoList![entry.key].auditStatus == null)Positioned(
if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length >= entry.key && (controller.userData.value!.photoList![entry.key].auditStatus == 1 || controller.userData.value!.photoList![entry.key].auditStatus == null))Positioned(
right: 5.w, right: 5.w,
top: 5.w, top: 5.w,
child: Container( child: Container(
@ -269,7 +356,7 @@ class _EditInfoPageState extends State<EditInfoPage> {
controller.imgList.removeAt(entry.key); controller.imgList.removeAt(entry.key);
}), }),
), ),
if(controller.userData.value!.photoList![entry.key].auditStatus == 0)Positioned(
if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length >= entry.key && controller.userData.value!.photoList![entry.key].auditStatus == 0)Positioned(
top: 0, top: 0,
right: 0, right: 0,
child: Container( child: Container(
@ -422,11 +509,11 @@ class _EditInfoPageState extends State<EditInfoPage> {
Row( Row(
children: [ children: [
Text( Text(
"${controller.userData.value?.birthDate ?? ""}",
"${controller.birthday.value != "" ? controller.birthday.value : (controller.userData.value?.birthDate != null && controller.userData.value?.birthDate != "") ? controller.userData.value?.birthDate : "请选择"}",
style: TextStyle( style: TextStyle(
fontSize: 13.w, fontSize: 13.w,
fontWeight: FontWeight.w500,
color: const Color.fromRGBO(51, 51, 51, 1)
fontWeight: (controller.birthday.value != "" && controller.userData.value?.birthDate != null && controller.userData.value?.birthDate != "") ? FontWeight.w500 : null,
color: (controller.birthday.value != "" && controller.userData.value?.birthDate != null && controller.userData.value?.birthDate != "") ? const Color.fromRGBO(51, 51, 51, 1) : const Color.fromRGBO(191, 191, 191, 1)
), ),
), ),
SizedBox(width: 15.w,), SizedBox(width: 15.w,),
@ -438,7 +525,9 @@ class _EditInfoPageState extends State<EditInfoPage> {
], ],
) )
], ],
),
).onTap((){
_showDatePicker(controller);
}),
], ],
), ),
), ),

459
lib/pages/mine/my_wallet_page.dart

@ -58,249 +58,254 @@ class MyWalletPage extends StatelessWidget {
controller.getHistoryList(); controller.getHistoryList();
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
child: Column(
children: [
Container(
height: 44.w,
margin: EdgeInsets.only(
top: 9.w,
bottom: 16.w
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 72.w,
height: 44.w,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 1,
color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 1 ? 1 : 0)
)
)
),
child: Center(
child: Text(
"最近一个月",
style: TextStyle(
fontSize: 14.w,
color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 1 ? 1 : .5),
fontWeight: controller.timeActive.value == 1 ? FontWeight.w700 : FontWeight.w400
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: MediaQuery.of(context).size.height - MediaQuery.of(context).padding.top,
),
child: Column(
children: [
Container(
height: 44.w,
margin: EdgeInsets.only(
top: 9.w,
bottom: 16.w
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 72.w,
height: 44.w,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 1,
color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 1 ? 1 : 0)
)
)
),
child: Center(
child: Text(
"最近一个月",
style: TextStyle(
fontSize: 14.w,
color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 1 ? 1 : .5),
fontWeight: controller.timeActive.value == 1 ? FontWeight.w700 : FontWeight.w400
),
), ),
), ),
),
).onTap(() async {
controller.timeActive.value = 1;
controller.page.value = 1;
controller.walletHistoryList.clear();
await controller.getHistoryList();
controller.listRefreshController.finishRefresh(IndicatorResult.success);
controller.listRefreshController.finishLoad(IndicatorResult.none);
}),
Container(
width: 72.w,
height: 44.w,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 1,
color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 2 ? 1 : 0)
)
)
),
child: Center(
child: Text(
"3个月",
style: TextStyle(
fontSize: 14.w,
color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 2 ? 1 : .5),
fontWeight: controller.timeActive.value == 2 ? FontWeight.w700 : FontWeight.w400
).onTap(() async {
controller.timeActive.value = 1;
controller.page.value = 1;
controller.walletHistoryList.clear();
await controller.getHistoryList();
controller.listRefreshController.finishRefresh(IndicatorResult.success);
controller.listRefreshController.finishLoad(IndicatorResult.none);
}),
Container(
width: 72.w,
height: 44.w,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 1,
color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 2 ? 1 : 0)
)
)
),
child: Center(
child: Text(
"3个月",
style: TextStyle(
fontSize: 14.w,
color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 2 ? 1 : .5),
fontWeight: controller.timeActive.value == 2 ? FontWeight.w700 : FontWeight.w400
),
), ),
), ),
),
).onTap(() async {
controller.timeActive.value = 2;
controller.page.value = 1;
controller.walletHistoryList.clear();
await controller.getHistoryList();
controller.listRefreshController.finishRefresh(IndicatorResult.success);
controller.listRefreshController.finishLoad(IndicatorResult.none);
}),
Container(
width: 72.w,
height: 44.w,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 1,
color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 3 ? 1 : 0)
)
)
),
child: Center(
child: Text(
"6个月",
style: TextStyle(
fontSize: 14.w,
color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 13 ? 1 : .5),
fontWeight: controller.timeActive.value == 3 ? FontWeight.w700 : FontWeight.w400
).onTap(() async {
controller.timeActive.value = 2;
controller.page.value = 1;
controller.walletHistoryList.clear();
await controller.getHistoryList();
controller.listRefreshController.finishRefresh(IndicatorResult.success);
controller.listRefreshController.finishLoad(IndicatorResult.none);
}),
Container(
width: 72.w,
height: 44.w,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 1,
color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 3 ? 1 : 0)
)
)
),
child: Center(
child: Text(
"6个月",
style: TextStyle(
fontSize: 14.w,
color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 13 ? 1 : .5),
fontWeight: controller.timeActive.value == 3 ? FontWeight.w700 : FontWeight.w400
),
), ),
), ),
),
).onTap(() async {
controller.timeActive.value = 3;
controller.page.value = 1;
controller.walletHistoryList.clear();
await controller.getHistoryList();
controller.listRefreshController.finishRefresh(IndicatorResult.success);
controller.listRefreshController.finishLoad(IndicatorResult.none);
}),
Container(
width: 72.w,
height: 44.w,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 1,
color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 4 ? 1 : 0)
)
)
),
child: Center(
child: Text(
"全部",
style: TextStyle(
fontSize: 14.w,
color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 4 ? 1 : .5),
fontWeight: controller.timeActive.value == 4 ? FontWeight.w700 : FontWeight.w400
).onTap(() async {
controller.timeActive.value = 3;
controller.page.value = 1;
controller.walletHistoryList.clear();
await controller.getHistoryList();
controller.listRefreshController.finishRefresh(IndicatorResult.success);
controller.listRefreshController.finishLoad(IndicatorResult.none);
}),
Container(
width: 72.w,
height: 44.w,
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 1,
color: Color.fromRGBO(117, 98, 249, controller.timeActive.value == 4 ? 1 : 0)
)
)
),
child: Center(
child: Text(
"全部",
style: TextStyle(
fontSize: 14.w,
color: Color.fromRGBO(51, 51, 51, controller.timeActive.value == 4 ? 1 : .5),
fontWeight: controller.timeActive.value == 4 ? FontWeight.w700 : FontWeight.w400
),
), ),
), ),
),
).onTap(() async {
controller.timeActive.value = 4;
controller.page.value = 1;
controller.walletHistoryList.clear();
await controller.getHistoryList();
controller.listRefreshController.finishRefresh(IndicatorResult.success);
controller.listRefreshController.finishLoad(IndicatorResult.none);
}),
],
),
),
Container(
width: 355.w,
height: 129.w,
margin: EdgeInsets.only(
bottom: 24.w
),
padding: EdgeInsets.symmetric(
vertical: 12.w
).onTap(() async {
controller.timeActive.value = 4;
controller.page.value = 1;
controller.walletHistoryList.clear();
await controller.getHistoryList();
controller.listRefreshController.finishRefresh(IndicatorResult.success);
controller.listRefreshController.finishLoad(IndicatorResult.none);
}),
],
),
), ),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.w)),
color: const Color.fromRGBO(247, 247, 247, 1)
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 255.w,
padding: EdgeInsets.symmetric(
horizontal: 16.w
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${controller.walletData.value.totalBalance ?? ""}",
style: TextStyle(
fontSize: 20.w,
fontWeight: FontWeight.w500
),
),
SizedBox(height: 6.w,),
Text(
"总余额(元)",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(102, 102, 102, 1)
),
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${controller.walletData.value.settlementBalance ?? ""}",
style: TextStyle(
fontSize: 20.w,
fontWeight: FontWeight.w500,
color: const Color.fromRGBO(117, 98, 249, 1)
Container(
width: 355.w,
height: 129.w,
margin: EdgeInsets.only(
bottom: 24.w
),
padding: EdgeInsets.symmetric(
vertical: 12.w
),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.w)),
color: const Color.fromRGBO(247, 247, 247, 1)
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 255.w,
padding: EdgeInsets.symmetric(
horizontal: 16.w
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${controller.walletData.value.totalBalance ?? ""}",
style: TextStyle(
fontSize: 20.w,
fontWeight: FontWeight.w500
),
), ),
),
SizedBox(height: 6.w,),
Text(
"结算中金额(元)",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(102, 102, 102, 1)
SizedBox(height: 6.w,),
Text(
"总余额(元)",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(102, 102, 102, 1)
),
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"${controller.walletData.value.settlementBalance ?? ""}",
style: TextStyle(
fontSize: 20.w,
fontWeight: FontWeight.w500,
color: const Color.fromRGBO(117, 98, 249, 1)
),
), ),
)
],
),
],
),
),
Container(
width: 255.w,
height: 42.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(42.w)),
color: const Color.fromRGBO(117, 98, 249, 1)
SizedBox(height: 6.w,),
Text(
"an>结算中金额(元)",
style: TextStyle(
fontSize: 13.w,
color: const Color.fromRGBO(102, 102, 102, 1)
),
)
],
),
],
),
), ),
child: Center(
child: Text(
"提现",
style: TextStyle(
fontSize: 14.w,
fontWeight: FontWeight.w500,
color: Colors.white
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,
fontWeight: FontWeight.w500,
color: Colors.white
),
), ),
), ),
),
).onTap(() {
Get.to(() => WithdrawPage(availableWithdrawBalance: controller.walletData.value.availableWithdrawBalance ?? 0));
})
],
),
),
Padding(
padding: EdgeInsetsGeometry.symmetric(
horizontal: 10.w
).onTap(() {
Get.to(() => WithdrawPage(availableWithdrawBalance: controller.walletData.value.availableWithdrawBalance ?? 0));
})
],
),
), ),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"流水明细",
style: TextStyle(
fontSize: 13.w,
fontWeight: FontWeight.w500
),
)
],
Padding(
padding: EdgeInsetsGeometry.symmetric(
horizontal: 10.w
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"流水明细",
style: TextStyle(
fontSize: 13.w,
fontWeight: FontWeight.w500
),
)
],
),
), ),
),
SizedBox(height: 22.w,),
...controller.walletHistoryList.map((e){
return InfoItem(item: e,);
}),
],
SizedBox(height: 22.w,),
...controller.walletHistoryList.map((e){
return InfoItem(item: e,);
}),
],
),
), ),
), ),
), ),

44
lib/pages/mine/pay_fail_page.dart

@ -1,4 +1,5 @@
import 'package:dating_touchme_app/components/page_appbar.dart'; import 'package:dating_touchme_app/components/page_appbar.dart';
import 'package:dating_touchme_app/extension/ex_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -10,6 +11,31 @@ class PayFailPage extends StatefulWidget {
} }
class _PayFailPageState extends State<PayFailPage> { class _PayFailPageState extends State<PayFailPage> {
int startTime = 0;
Future f1() async {
await Future.delayed(Duration(milliseconds: 500));
print("任务1完成,耗时${DateTime.now().millisecondsSinceEpoch - startTime}毫秒");
print("开始时间:${startTime}");
print("当前时间:${DateTime.now().millisecondsSinceEpoch}");
}
Future f2() async {
await Future.delayed(Duration(milliseconds: 500));
print("任务2完成,耗时${DateTime.now().millisecondsSinceEpoch - startTime}毫秒");
print("开始时间:${startTime}");
print("当前时间:${DateTime.now().millisecondsSinceEpoch}");
}
Future f3() async {
await Future.delayed(Duration(milliseconds: 500));
print("任务3完成,耗时${DateTime.now().millisecondsSinceEpoch - startTime}毫秒");
print("开始时间:${startTime}");
print("当前时间:${DateTime.now().millisecondsSinceEpoch}");
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -44,7 +70,13 @@ class _PayFailPageState extends State<PayFailPage> {
fontSize: 13.w, fontSize: 13.w,
fontWeight: FontWeight.w500 fontWeight: FontWeight.w500
), ),
),
).onTap((){
startTime = DateTime.now().millisecondsSinceEpoch;
print("顺序写");
f1();
f2();
f3();
}),
SizedBox(height: 292.w,), SizedBox(height: 292.w,),
Container( Container(
width: 150.w, width: 150.w,
@ -62,7 +94,15 @@ class _PayFailPageState extends State<PayFailPage> {
), ),
), ),
), ),
),
).onTap((){
startTime = DateTime.now().millisecondsSinceEpoch;
print("Future.wait");
Future.wait([
f1(),
f2(),
f3(),
]);
}),
SizedBox(height: 18.w,), SizedBox(height: 18.w,),
Text( Text(
"返回", "返回",

123
lib/pages/mine/rose_history_page.dart

@ -62,76 +62,73 @@ class RoseHistoryPage extends StatelessWidget {
vertical: 6.w, vertical: 6.w,
horizontal: 15.w horizontal: 15.w
), ),
child: Column(
children: [
Row(
children: [
...controller.friendNavList.asMap().entries.map((entry){
return Container(
margin: EdgeInsets.only(right: 25.w),
child: InkWell(
onTap: (){
controller.changeNavTab(entry.key);
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: MediaQuery.of(context).size.height - MediaQuery.of(context).padding.top,
),
child: Column(
children: [
Row(
children: [
...controller.friendNavList.asMap().entries.map((entry){
return Container(
margin: EdgeInsets.only(right: 25.w),
child: InkWell(
onTap: (){
controller.changeNavTab(entry.key);
},
child: Container(
padding: entry.key == controller.friendNavActive.value ? EdgeInsets.symmetric(vertical: 2.w, horizontal: 26.w) : EdgeInsets.zero,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(21.w)),
color: entry.key == controller.friendNavActive.value ? const Color.fromRGBO(117, 98, 249, 1) : Colors.transparent
),
child: Text(
entry.value,
style: TextStyle(
fontSize: 12.w,
color: entry.key == controller.friendNavActive.value ? Colors.white : const Color.fromRGBO(51, 51, 51, .7),
fontWeight: entry.key == controller.friendNavActive.value ? FontWeight.w700 : FontWeight.w500
},
child: Container(
padding: entry.key == controller.friendNavActive.value ? EdgeInsets.symmetric(vertical: 2.w, horizontal: 26.w) : EdgeInsets.zero,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(21.w)),
color: entry.key == controller.friendNavActive.value ? const Color.fromRGBO(117, 98, 249, 1) : Colors.transparent
),
child: Text(
entry.value,
style: TextStyle(
fontSize: 12.w,
color: entry.key == controller.friendNavActive.value ? Colors.white : const Color.fromRGBO(51, 51, 51, .7),
fontWeight: entry.key == controller.friendNavActive.value ? FontWeight.w700 : FontWeight.w500
),
), ),
), ),
), ),
),
);
}),
);
}),
],
),
SizedBox(height: 4.w,),
if(controller.friendNavActive.value != 2) ...[
...controller.roseHistoryList.map((e){
return SendItem(item: e);
})
],
if(controller.friendNavActive.value == 2) ...[
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
], ],
),
SizedBox(height: 4.w,),
if(controller.friendNavActive.value != 2) ...[
...controller.roseHistoryList.map((e){
return SendItem(item: e);
})
],
if(controller.friendNavActive.value == 2) ...[
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
ChatCouponItem(),
], ],
SizedBox(height: 6.w,),
Text(
"没有更多了",
style: TextStyle(
fontSize: 11.w,
color: const Color.fromRGBO(144, 144, 144, 1),
),
)
],
),
), ),
), ),
), ),

4
lib/pages/mine/withdraw_history_page.dart

@ -58,10 +58,14 @@ class WithdrawHistoryPage extends StatelessWidget {
}, },
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
width: 375.w,
padding: EdgeInsetsGeometry.symmetric( padding: EdgeInsetsGeometry.symmetric(
vertical: 11.w, vertical: 11.w,
horizontal: 16.w horizontal: 16.w
), ),
constraints: BoxConstraints(
minHeight: MediaQuery.of(context).size.height - MediaQuery.of(context).padding.top,
),
child: Column( child: Column(
children: [ children: [
...controller.historyList.map((e){ ...controller.historyList.map((e){

Loading…
Cancel
Save