Browse Source

优化修改信息样式,优化删除相册逻辑,优化反馈页面样式,优化钱包页面展示

ios
王子贤 3 months ago
parent
commit
f0da880f2f
8 changed files with 878 additions and 857 deletions
  1. 33
      lib/controller/mine/edit_info_controller.dart
  2. 8
      lib/model/home/marriage_data.dart
  3. 2
      lib/network/api_urls.dart
  4. 6
      lib/network/user_api.dart
  5. 34
      lib/network/user_api.g.dart
  6. 1615
      lib/pages/mine/edit_info_page.dart
  7. 29
      lib/pages/mine/feedback_page.dart
  8. 8
      lib/pages/mine/my_wallet_page.dart

33
lib/controller/mine/edit_info_controller.dart

@ -555,6 +555,39 @@ class EditInfoController extends GetxController {
}
}
deleteImgList(int index) async {
if(userData.value!.photoList!.length > index){
try {
final avatarPayload = {
'miId': userData.value!.photoList![index].miId,
'id': userData.value!.photoList![index].id,
'photoUrl': userData.value!.photoList![index].photoUrl,
};
final res = await _userApi.userDelPhotos(avatarPayload);
if (res.data.isSuccess) {
imgList.removeAt(index);
userData.value!.photoList!.removeAt(index);
} else{
SmartDialog.showToast(res.data.message);
return;
}
} catch(e){
print('图片删除失败: $e');
SmartDialog.showToast('图片删除失败,请重试');
return;
}
} else {
imgList.removeAt(index);
}
}
saveData() async {

8
lib/model/home/marriage_data.dart

@ -95,6 +95,8 @@ class MarriageData {
photoList: (userInfo.photoList ?? []).map((photo) => PhotoItem(
photoUrl: photo.photoUrl ?? '',
auditStatus: photo.auditStatus,
id: photo.id ?? '',
miId: photo.miId ?? 0,
)).toList(),
);
}
@ -103,10 +105,14 @@ class MarriageData {
//
class PhotoItem {
final String photoUrl;
final String? id;
final num? miId;
final dynamic auditStatus;
PhotoItem({
required this.photoUrl,
this.id,
this.miId,
this.auditStatus,
});
@ -114,6 +120,8 @@ class PhotoItem {
return PhotoItem(
photoUrl: json['photoUrl'] ?? '',
auditStatus: json['auditStatus'],
id: json['id'],
miId: json['miId'],
);
}
}

2
lib/network/api_urls.dart

@ -100,6 +100,8 @@ class ApiUrls {
'dating-agency-chat-audio/user/page/user-prop';
static const String userPageUserPropConsumeRecord =
'dating-agency-chat-audio/user/page/user-prop-consume-record';
static const String userDelPhotos =
'/dating-agency-service/user/del/photos';
//
static const String getMarriageList =

6
lib/network/user_api.dart

@ -263,4 +263,10 @@ abstract class UserApi {
@Query('pageNum') required int pageNum,
@Query('pageSize') required int pageSize,
});
@POST(ApiUrls.userDelPhotos)
Future<HttpResponse<BaseResponse<dynamic>>> userDelPhotos(
@Body() Map<String, dynamic> data,
);
}

34
lib/network/user_api.g.dart

@ -1601,6 +1601,40 @@ class _UserApi implements UserApi {
return httpResponse;
}
@override
Future<HttpResponse<BaseResponse<dynamic>>> userDelPhotos(
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-service/user/del/photos',
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;
}
RequestOptions _setStreamType<T>(RequestOptions requestOptions) {
if (T != dynamic &&
!(requestOptions.responseType == ResponseType.bytes ||

1615
lib/pages/mine/edit_info_page.dart
File diff suppressed because it is too large
View File

29
lib/pages/mine/feedback_page.dart

@ -214,29 +214,12 @@ class _FeedbackPageState extends State<FeedbackPage> {
borderRadius: BorderRadius.all(Radius.circular(9.w)),
border: Border.all(width: 1, color: const Color.fromRGBO(224, 224, 224, 1))
),
),
Container(
width: 70.w,
height: 70.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(9.w)),
border: Border.all(width: 1, color: const Color.fromRGBO(224, 224, 224, 1))
),
),
Container(
width: 70.w,
height: 70.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(9.w)),
border: Border.all(width: 1, color: const Color.fromRGBO(224, 224, 224, 1))
),
),
Container(
width: 70.w,
height: 70.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(9.w)),
border: Border.all(width: 1, color: const Color.fromRGBO(224, 224, 224, 1))
child: Center(
child: Icon(
Icons.add,
size: 18.w,
color: const Color.fromRGBO(224, 224, 224, 1)
),
),
),
],

8
lib/pages/mine/my_wallet_page.dart

@ -113,7 +113,7 @@ class MyWalletPage extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
if(controller.walletData.value.id != null) Text(
controller.visibility.value ? "${controller.walletData.value.totalBalance}" : controller.walletData.value.totalBalance.toString().replaceAll(RegExp(r'\d'), '*'),
controller.visibility.value ? "${controller.walletData.value.totalBalance?.toStringAsFixed(2)}" : controller.walletData.value.totalBalance!.toStringAsFixed(2).replaceAll(RegExp(r'\d'), '*'),
style: TextStyle(
fontSize: 30.w,
color: Colors.white,
@ -172,7 +172,7 @@ class MyWalletPage extends StatelessWidget {
),
),
Text(
"${controller.walletData.value.id != null ? controller.walletData.value.availableWithdrawBalance : "0.00"}",
"${controller.walletData.value.id != null ? controller.walletData.value.availableWithdrawBalance?.toStringAsFixed(2) : "0.00"}",
style: TextStyle(
fontSize: 13.w,
color: Colors.white,
@ -201,7 +201,7 @@ class MyWalletPage extends StatelessWidget {
),
),
Text(
"${controller.walletData.value.id != null ? controller.walletData.value.settlementBalance : "0.00"}",
"${controller.walletData.value.id != null ? controller.walletData.value.settlementBalance?.toStringAsFixed(2) : "0.00"}",
style: TextStyle(
fontSize: 13.w,
color: Colors.white,
@ -230,7 +230,7 @@ class MyWalletPage extends StatelessWidget {
),
),
Text(
"${controller.walletData.value.id != null ? controller.walletData.value.frozenBalance : "0.00"}",
"${controller.walletData.value.id != null ? controller.walletData.value.frozenBalance?.toStringAsFixed(2) : "0.00"}",
style: TextStyle(
fontSize: 13.w,
color: Colors.white,

Loading…
Cancel
Save