diff --git a/lib/controller/mine/edit_info_controller.dart b/lib/controller/mine/edit_info_controller.dart index b872dc5..dd7f9d9 100644 --- a/lib/controller/mine/edit_info_controller.dart +++ b/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 { diff --git a/lib/model/home/marriage_data.dart b/lib/model/home/marriage_data.dart index edbf7fc..32fd9d1 100644 --- a/lib/model/home/marriage_data.dart +++ b/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'], ); } } \ No newline at end of file diff --git a/lib/network/api_urls.dart b/lib/network/api_urls.dart index eb91e0d..4c7da72 100644 --- a/lib/network/api_urls.dart +++ b/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 = diff --git a/lib/network/user_api.dart b/lib/network/user_api.dart index eff0898..0866a8f 100644 --- a/lib/network/user_api.dart +++ b/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>> userDelPhotos( + @Body() Map data, + ); + } diff --git a/lib/network/user_api.g.dart b/lib/network/user_api.g.dart index 7dc169b..084d23d 100644 --- a/lib/network/user_api.g.dart +++ b/lib/network/user_api.g.dart @@ -1601,6 +1601,40 @@ class _UserApi implements UserApi { return httpResponse; } + @override + Future>> userDelPhotos( + Map data, + ) async { + final _extra = {}; + final queryParameters = {}; + final _headers = {}; + final _data = {}; + _data.addAll(data); + final _options = _setStreamType>>( + Options(method: 'POST', headers: _headers, extra: _extra) + .compose( + _dio.options, + '/dating-agency-service/user/del/photos', + queryParameters: queryParameters, + data: _data, + ) + .copyWith(baseUrl: _combineBaseUrls(_dio.options.baseUrl, baseUrl)), + ); + final _result = await _dio.fetch>(_options); + late BaseResponse _value; + try { + _value = BaseResponse.fromJson( + _result.data!, + (json) => json as dynamic, + ); + } on Object catch (e, s) { + errorLogger?.logError(e, s, _options); + rethrow; + } + final httpResponse = HttpResponse(_value, _result); + return httpResponse; + } + RequestOptions _setStreamType(RequestOptions requestOptions) { if (T != dynamic && !(requestOptions.responseType == ResponseType.bytes || diff --git a/lib/pages/mine/edit_info_page.dart b/lib/pages/mine/edit_info_page.dart index 681110a..a4b9de0 100644 --- a/lib/pages/mine/edit_info_page.dart +++ b/lib/pages/mine/edit_info_page.dart @@ -78,7 +78,18 @@ class _EditInfoPageState extends State { ), onClick: (cell) async{ Navigator.pop(context); - await controller.handleCameraCapture(type); + + if(type == 1 || 9 - controller.imgList.length == 1){ + + await controller.handleCameraCapture(type); + } else { + if(controller.imgList.length >= 9){ + + SmartDialog.showToast('超出数量限制,请先删除再尝试上传'); + return; + } + await controller.handleCameraCapture(type); + } }, ), ), @@ -230,943 +241,887 @@ class _EditInfoPageState extends State { ), ), ),), + + backgroundColor: const Color.fromRGBO(243, 243, 243, 1.0), body: SingleChildScrollView( - child: Column( - children: [ - if(false) Row( - children: [ - Expanded( - child: InkWell( - onTap: (){ - controller.menuActive.value = 1; - setState(() { + child: Container( + padding: EdgeInsets.symmetric(horizontal: 15.w), + child: Column( + children: [ + if(false) Row( + children: [ + Expanded( + child: InkWell( + onTap: (){ + controller.menuActive.value = 1; + setState(() { - }); - }, - child: Container( - height: 49.w, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 1, - color: controller.menuActive.value == 1 ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(242, 242, 242, 1)) - ) - ), - child: Center( - child: Text( - "编辑", - style: TextStyle( - fontSize: 13.w, - color: controller.menuActive.value == 1 ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(144, 144, 144, 1) + }); + }, + child: Container( + height: 49.w, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 1, + color: controller.menuActive.value == 1 ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(242, 242, 242, 1)) + ) + ), + child: Center( + child: Text( + "编辑", + style: TextStyle( + fontSize: 13.w, + color: controller.menuActive.value == 1 ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(144, 144, 144, 1) + ), ), ), ), ), ), - ), - Expanded( - child: InkWell( - onTap: (){ - controller.menuActive.value = 2; - setState(() { + Expanded( + child: InkWell( + onTap: (){ + controller.menuActive.value = 2; + setState(() { - }); - }, - child: Container( - height: 49.w, - decoration: BoxDecoration( - border: Border( - bottom: BorderSide( - width: 1, - color: controller.menuActive.value == 2 ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(242, 242, 242, 1)) - ) - ), - child: Center( - child: Text( - "预览", - style: TextStyle( - fontSize: 13.w, - color: controller.menuActive.value == 2 ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(144, 144, 144, 1) + }); + }, + child: Container( + height: 49.w, + decoration: BoxDecoration( + border: Border( + bottom: BorderSide( + width: 1, + color: controller.menuActive.value == 2 ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(242, 242, 242, 1)) + ) + ), + child: Center( + child: Text( + "预览", + style: TextStyle( + fontSize: 13.w, + color: controller.menuActive.value == 2 ? const Color.fromRGBO(117, 98, 249, 1) : const Color.fromRGBO(144, 144, 144, 1) + ), ), ), ), ), ), - ), - ], - ), - if(controller.menuActive.value == 1) ...[ - SizedBox(height: 26.w,), - Stack( - children: [ - SizedBox( - child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(85.w)), - child: controller.avatarLocalPath.value != "" ? Image.file( - File(controller.avatarLocalPath.value), - width: 85.w, - height: 85.w, - ) : (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ? CachedNetworkImage( - imageUrl: "${controller.userData.value?.profilePhoto ?? ""}?x-oss-process=image/format,webp/resize,w_170", - width: 85.w, - height: 85.w, - fit: BoxFit.cover, - ) : Image.asset( - Assets.imagesUserAvatar, - width: 85.w, - height: 85.w, + ], + ), + if(controller.menuActive.value == 1) ...[ + SizedBox(height: 26.w,), + Stack( + children: [ + SizedBox( + child: ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(85.w)), + child: controller.avatarLocalPath.value != "" ? Image.file( + File(controller.avatarLocalPath.value), + width: 85.w, + height: 85.w, + ) : (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ? CachedNetworkImage( + imageUrl: "${controller.userData.value?.profilePhoto ?? ""}?x-oss-process=image/format,webp/resize,w_170", + width: 85.w, + height: 85.w, + fit: BoxFit.cover, + ) : Image.asset( + Assets.imagesUserAvatar, + width: 85.w, + height: 85.w, + ), ), ), + Positioned( + right: 8.w, + bottom: 1.w, + child: Image.asset( + Assets.imagesEditAvatar, + width: 17.w, + height: 17.w, + ), + ) + ], + ).onTap(() { + if(controller.userData.value?.auditProfilePhoto != null){ + + SmartDialog.showToast('当前头像正在审核中,请勿重复提交'); + return; + } + _showAvatarPopup(controller, 1); + }), + SizedBox(height: 20.w,), + Container( + width: 375.w, + padding: EdgeInsets.only( + left: 14.w, + right: 20.w, + top: 14.w, + bottom: 14.w ), - Positioned( - right: 8.w, - bottom: 1.w, - child: Image.asset( - Assets.imagesEditAvatar, - width: 17.w, - height: 17.w, - ), - ) - ], - ).onTap(() { - if(controller.userData.value?.auditProfilePhoto != null){ + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(9.w)) + ), + child: Column( + children: [ - SmartDialog.showToast('当前头像正在审核中,请勿重复提交'); - return; - } - _showAvatarPopup(controller, 1); - }), - SizedBox(height: 20.w,), - Container( - width: 375.w, - padding: EdgeInsets.only( - left: 14.w, - right: 20.w - ), - child: Column( - children: [ - Row( - children: [ - Text( - "个人相册", - style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(144, 144, 144, 1) - ), - ) - ], - ), - SizedBox(height: 5.w,), - Container( - width: 340.w, - margin: EdgeInsets.only(bottom: 35.w), - child: Wrap( - spacing: 5.w, - runSpacing: 5.w, + Row( children: [ - ...controller.imgList.asMap().entries.map((entry){ - return Stack( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(9.w)), - child: CachedNetworkImage( - imageUrl: "${entry.value}?x-oss-process=image/format,webp/resize,w_140", - width: 70.w, - height: 70.w, - fit: BoxFit.cover, - ), - ), - 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, - top: 5.w, - child: Container( - width: 20.w, - height: 20.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(20.w)), - color: const Color.fromRGBO(0, 0, 0, .3) - ), - child: Icon( - Icons.close, - size: 20.w, + Text( + "个人相册", + style: TextStyle( + fontSize: 15.w, + fontWeight: FontWeight.w500 + ), + ) + ], + ), + SizedBox(height: 5.w,), + Container( + width: 340.w, + margin: EdgeInsets.only(bottom: 35.w), + child: Wrap( + spacing: 5.w, + runSpacing: 5.w, + children: [ + ...controller.imgList.asMap().entries.map((entry){ + return Stack( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(9.w)), + child: CachedNetworkImage( + imageUrl: "${entry.value}?x-oss-process=image/format,webp/resize,w_140", + width: 70.w, + height: 70.w, + fit: BoxFit.cover, ), - ).onTap((){ - controller.imgList.removeAt(entry.key); - }), - ), - if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length >= entry.key && 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) + ), + if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length > entry.key)Positioned( + left: 5.w, + top: 5.w, + child: Container( + width: 20.w, + height: 20.w, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(20.w)), + color: const Color.fromRGBO(0, 0, 0, .3) ), - color: const Color.fromRGBO(0, 0, 0, .4) - ), - child: Center( - child: Text( - "审核中", - style: TextStyle( - fontSize: 8.w, - color: Colors.white, - fontWeight: FontWeight.w500 - ), + child: Icon( + Icons.close, + size: 20.w, ), - ), + ).onTap((){ + controller.deleteImgList(entry.key); + }), ), - ) - ], - ); - }), - - 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: 15.w, - color: const Color.fromRGBO(144, 144, 144, 1), - ), - ), - ).onTap(() { - _showAvatarPopup(controller, 2); - }) - ], - ), - ), - Row( - children: [ - Text( - "基本信息", - style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(144, 144, 144, 1) - ), - ) - ], - ), - SizedBox(height: 2.w,), - SetItem(label: "昵称", child: Text( - controller.userData.value?.nickName ?? "", - style: TextStyle( - fontSize: 13.w, - fontWeight: FontWeight.w500 - ), - ), hideArrow: true,), - Container( - margin: EdgeInsets.only(bottom: 3.w), - decoration: BoxDecoration( - border: Border( - bottom: BorderSide(width: 1, color: const Color.fromRGBO(245, 245, 245, 1)) - ) - ), - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - children: [ - TextSpan( - text: "性别", - style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(51, 51, 51, 1), - fontWeight: FontWeight.w500 - ) + if(controller.userData.value!.photoList!.isNotEmpty && controller.userData.value!.photoList!.length > entry.key && 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) ), - TextSpan( - text: "*", + child: Center( + child: Text( + "审核中", style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(224, 54, 54, 1), + fontSize: 8.w, + color: Colors.white, fontWeight: FontWeight.w500 - ) + ), + ), ), - ] - ), - ), - Row( - children: [ - Text( - "${controller.userData.value?.genderCode == 0 ? "男" : "女"}", - style: TextStyle( - fontSize: 13.w, - fontWeight: FontWeight.w500, - color: const Color.fromRGBO(51, 51, 51, 1) ), - ), - SizedBox(width: 15.w,), - Image.asset( - controller.userData.value?.genderCode == 0 ? - Assets.imagesMale : Assets.imagesFemale, - width: 13.w, - height: 13.w, - color: const Color.fromRGBO(218, 218, 218, 1) ) ], - ) + ); + }), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - children: [ - TextSpan( - text: "生日", - style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(51, 51, 51, 1), - fontWeight: FontWeight.w500 - ) - ), - TextSpan( - text: "*", - style: TextStyle( - fontSize: 13.w, - color: const Color.fromRGBO(224, 54, 54, 1), - fontWeight: FontWeight.w500 - ) - ), - ] + 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: 15.w, + color: const Color.fromRGBO(144, 144, 144, 1), ), ), - Row( - children: [ - Text( - "${controller.birthday.value != "" ? controller.birthday.value : (controller.userData.value?.birthDate != null && controller.userData.value?.birthDate != "") ? controller.userData.value?.birthDate : "请选择"}", - style: TextStyle( - fontSize: 13.w, - 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,), - Icon( - Icons.keyboard_arrow_right, - size: 13.w, - color: Color.fromRGBO(191, 191, 191, (controller.userData.value?.identityCard != null && controller.userData.value?.identityCard != "") ? 0 : 1) - ) - ], - ) - ], - ).onTap((){ - // if(controller.userData.value?.identityCard != null && controller.userData.value?.identityCard != ""){ - // return; - // } - _showDatePicker(controller); - }), - ], + ).onTap(() { + _showAvatarPopup(controller, 2); + }) + ], + ), ), - ), - InkWell( - onTap: () { - TDPicker.showMultiPicker(context, title: '', - initialIndexes: [30], - onConfirm: (selected) { - print(selected); - print(controller.heightList[selected[0]]); - controller.heightSelect.value = selected[0]; - setState(() { + ], + ), + ), - }); - Navigator.of(context).pop(); - controller.saveData(); - }, data: [controller.heightList]); - }, - child: SetItem(label: "身高", child: Text( - controller.heightSelect.value != -1 ? controller.heightList[controller.heightSelect.value] ?? "" : "请选择", + SizedBox(height: 15.w,), + Container( + width: 375.w, + padding: EdgeInsets.only( + left: 14.w, + right: 20.w, + top: 14.w, + bottom: 14.w + ), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(9.w)) + ), + child: Column( + children: [ + Row( + children: [ + Text( + "基本信息", + style: TextStyle( + fontSize: 15.w, + fontWeight: FontWeight.w500 + ), + ) + ], + ), + SizedBox(height: 2.w,), + SetItem(label: "昵称", child: Text( + controller.userData.value?.nickName ?? "", 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 + fontWeight: FontWeight.w500 ), - ),), - ), + ), hideArrow: true,), + SetItem(label: "性别", child: Text( + "${controller.userData.value?.genderCode == 0 ? "男" : "女"}", + style: TextStyle( + fontSize: 13.w, + fontWeight: FontWeight.w500 + ), + ), hideArrow: true,), + InkWell( + onTap: () { + if(controller.userData.value?.identityCard != null && controller.userData.value?.identityCard != ""){ + return; + } + _showDatePicker(controller); + }, + child: SetItem(label: "生日", child: Text( + "${controller.birthday.value != "" ? controller.birthday.value : (controller.userData.value?.birthDate != null && controller.userData.value?.birthDate != "") ? controller.userData.value?.birthDate : "请选择"}", + style: TextStyle( + fontSize: 13.w, + 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) + ), + ), hideArrow: (controller.userData.value?.identityCard != null && controller.userData.value?.identityCard != "") ? true : false,), + ), + InkWell( + onTap: () { + TDPicker.showMultiPicker(context, title: '', + initialIndexes: [30], + onConfirm: (selected) { + print(selected); + print(controller.heightList[selected[0]]); + controller.heightSelect.value = selected[0]; + setState(() { - InkWell( - onTap: () { - TDPicker.showMultiLinkedPicker(context, title: '', - onConfirm: (selected) { - print(selected); - controller.location.value = selected.join("-"); - Map province = address.firstWhere( - (e) => e["label"] == selected[0], - orElse: () => {}, - ); - if(province.isNotEmpty){ - Map city = province["children"].firstWhere( - (e) => e["label"] == selected[1], + }); + 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 + ), + ),), + ), + + InkWell( + onTap: () { + TDPicker.showMultiLinkedPicker(context, title: '', + onConfirm: (selected) { + print(selected); + controller.location.value = selected.join("-"); + Map province = address.firstWhere( + (e) => e["label"] == selected[0], orElse: () => {}, ); - if(city.isNotEmpty){ - Map district = city["children"].firstWhere( - (e) => e["label"] == selected[2], + if(province.isNotEmpty){ + Map city = province["children"].firstWhere( + (e) => e["label"] == selected[1], orElse: () => {}, ); if(city.isNotEmpty){ - controller.locationValue.value = [province["value"], city["value"], district["value"]]; - print([province["value"], city["value"], district["value"]]); + Map district = city["children"].firstWhere( + (e) => e["label"] == selected[2], + orElse: () => {}, + ); + if(city.isNotEmpty){ + controller.locationValue.value = [province["value"], city["value"], district["value"]]; + print([province["value"], city["value"], district["value"]]); + } } } - } - setState(() { + setState(() { - }); - Navigator.of(context).pop(); - controller.saveData(); - }, - data: controller.areaShowData, - columnNum: 3, - initialData:[]); - }, - 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), - fontWeight: controller.location.value != "" ? FontWeight.w500 : null, - ), - ),), - ), + }); + Navigator.of(context).pop(); + controller.saveData(); + }, + data: controller.areaShowData, + columnNum: 3, + initialData:[]); + }, + 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), + fontWeight: controller.location.value != "" ? FontWeight.w500 : null, + ), + ),), + ), - InkWell( - onTap: () { - TDPicker.showMultiLinkedPicker(context, title: '', - onConfirm: (selected) { - print(selected); - controller.homeLocation.value = selected.join("-"); - Map province = address.firstWhere( - (e) => e["label"] == selected[0], - orElse: () => {}, - ); - if(province.isNotEmpty){ - Map city = province["children"].firstWhere( - (e) => e["label"] == selected[1], + InkWell( + onTap: () { + TDPicker.showMultiLinkedPicker(context, title: '', + onConfirm: (selected) { + print(selected); + controller.homeLocation.value = selected.join("-"); + Map province = address.firstWhere( + (e) => e["label"] == selected[0], orElse: () => {}, ); - controller.homeLocationValue.value = [province["value"], city["value"]]; - print([province["value"], city["value"]]); - } - setState(() { + if(province.isNotEmpty){ + Map city = province["children"].firstWhere( + (e) => e["label"] == selected[1], + orElse: () => {}, + ); + controller.homeLocationValue.value = [province["value"], city["value"]]; + print([province["value"], city["value"]]); + } + setState(() { - }); - Navigator.of(context).pop(); - controller.saveData(); - }, - data: controller.areaShowData, - columnNum: 2, - initialData:[]); - }, - 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, - ), - )), - ), + }); + Navigator.of(context).pop(); + controller.saveData(); + }, + data: controller.areaShowData, + columnNum: 2, + initialData:[]); + }, + 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, + ), + )), + ), - InkWell( - onTap: () { - TDPicker.showMultiPicker(context, title: '', - onConfirm: (selected) { - print(selected); - print(controller.educationList[selected[0]]); - controller.educationSelect.value = selected[0]; - setState(() { + InkWell( + onTap: () { + TDPicker.showMultiPicker(context, title: '', + onConfirm: (selected) { + print(selected); + print(controller.educationList[selected[0]]); + controller.educationSelect.value = selected[0]; + setState(() { - }); - Navigator.of(context).pop(); - controller.saveData(); - }, data: [controller.educationList.map((e) => e.desc ?? "").toList()]); - }, - 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 - ), - ),), - ), + }); + Navigator.of(context).pop(); + controller.saveData(); + }, data: [controller.educationList.map((e) => e.desc ?? "").toList()]); + }, + 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 + ), + ),), + ), - 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], - ); - OccupationList second = first.occupationList?.firstWhere( - (e) => e.occupation == selected[1] - ) ?? OccupationList(); - print([first.industryCode, second.occupationCode]); - controller.occupationValue.value = [first.industryCode, second.occupationCode]; - setState(() { + 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], + ); + OccupationList second = first.occupationList?.firstWhere( + (e) => e.occupation == selected[1] + ) ?? OccupationList(); + print([first.industryCode, second.occupationCode]); + controller.occupationValue.value = [first.industryCode, second.occupationCode]; + setState(() { - }); - Navigator.of(context).pop(); - controller.saveData(); - }, - data: controller.occupationShowData, - columnNum: 2, - initialData:[]); - }, - 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 - ), - ),), - ), + }); + Navigator.of(context).pop(); + controller.saveData(); + }, + data: controller.occupationShowData, + columnNum: 2, + initialData:[]); + }, + 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 + ), + ),), + ), - InkWell( - onTap: () { - TDPicker.showMultiPicker(context, title: '', - onConfirm: (selected) { - print(selected); - print(controller.incomeList[selected[0]]); - controller.incomeSelect.value = selected[0]; - setState(() { + InkWell( + onTap: () { + TDPicker.showMultiPicker(context, title: '', + onConfirm: (selected) { + print(selected); + print(controller.incomeList[selected[0]]); + controller.incomeSelect.value = selected[0]; + setState(() { - }); - Navigator.of(context).pop(); - controller.saveData(); - }, data: [controller.incomeList.map((e) => e.desc ?? "").toList()]); - }, - 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 - ), - ),), - ), + }); + Navigator.of(context).pop(); + controller.saveData(); + }, data: [controller.incomeList.map((e) => e.desc ?? "").toList()]); + }, + 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 + ), + ),), + ), - // SetItem(label: "公司", showRequired: false,), + // SetItem(label: "公司", showRequired: false,), - InkWell( - onTap: () { - TDPicker.showMultiPicker(context, title: '', - onConfirm: (selected) { - print(selected); - print(controller.maritalList[selected[0]]); - controller.maritalSelect.value = selected[0]; - setState(() { + InkWell( + onTap: () { + TDPicker.showMultiPicker(context, title: '', + onConfirm: (selected) { + print(selected); + print(controller.maritalList[selected[0]]); + controller.maritalSelect.value = selected[0]; + setState(() { - }); - Navigator.of(context).pop(); - controller.saveData(); - }, data: [controller.maritalList.map((e) => e.desc ?? "").toList()]); - }, - 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 - ), - ),), - ), + }); + Navigator.of(context).pop(); + controller.saveData(); + }, data: [controller.maritalList.map((e) => e.desc ?? "").toList()]); + }, + 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 + ), + ),), + ), - InkWell( - onTap: () { - TDPicker.showMultiPicker(context, title: '', - onConfirm: (selected) { - print(selected); - print(controller.propertyList[selected[0]]); - controller.propertySelect.value = selected[0]; - setState(() { + InkWell( + onTap: () { + TDPicker.showMultiPicker(context, title: '', + onConfirm: (selected) { + print(selected); + print(controller.propertyList[selected[0]]); + controller.propertySelect.value = selected[0]; + setState(() { - }); - Navigator.of(context).pop(); - controller.saveData(); - }, data: [controller.propertyList.map((e) => e.desc ?? "").toList()]); - }, - 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 - ), - ),), - ), + }); + Navigator.of(context).pop(); + controller.saveData(); + }, data: [controller.propertyList.map((e) => e.desc ?? "").toList()]); + }, + 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 + ), + ),), + ), - if(false) Container( - margin: EdgeInsets.symmetric( - vertical: 30.w - ), - child: Container( - width: 255.w, - height: 42.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(42.w)), - color: const Color.fromRGBO(117, 98, 249, 1) + if(false) Container( + margin: EdgeInsets.symmetric( + vertical: 30.w ), - child: Center( - child: Text( - "保存修改", - style: TextStyle( - fontSize: 14.w, - color: Colors.white, - fontWeight: FontWeight.w500 + child: 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.saveData(); - }), - ) - ], - ), - ), - ], - if(false && controller.menuActive.value == 2) ...[ - Stack( - children: [ - controller.imgList.length > 0 ? Image.network( - controller.imgList[controller.nowSelect.value], - width: 375.w, - height: 384.w, - fit: BoxFit.cover, - ) : controller.avatarLocalPath.value != "" ? Image.file( - File(controller.avatarLocalPath.value), - width: 375.w, - height: 384.w, - ) : (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ? Image.network( - "${controller.userData.value?.profilePhoto ?? ""}", - width: 375.w, - height: 384.w, - ) : Image.asset( - Assets.imagesUserAvatar, - width: 375.w, - height: 384.w, + ).onTap((){ + controller.saveData(); + }), + ) + ], ), - SingleChildScrollView( - child: Container( - padding: EdgeInsets.only(top: 361.w), + ), + ], + if(false && controller.menuActive.value == 2) ...[ + Stack( + children: [ + controller.imgList.length > 0 ? Image.network( + controller.imgList[controller.nowSelect.value], + width: 375.w, + height: 384.w, + fit: BoxFit.cover, + ) : controller.avatarLocalPath.value != "" ? Image.file( + File(controller.avatarLocalPath.value), + width: 375.w, + height: 384.w, + ) : (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ? Image.network( + "${controller.userData.value?.profilePhoto ?? ""}", + width: 375.w, + height: 384.w, + ) : Image.asset( + Assets.imagesUserAvatar, + width: 375.w, + height: 384.w, + ), + SingleChildScrollView( child: Container( - height: 812.h - 361.w - 49.w - MediaQuery.of(context).padding.top - 54.w, - width: 375.w, - padding: EdgeInsets.only( - top: 31.w, - left: 15.w, - right: 12.w - ), - decoration: BoxDecoration( - borderRadius: BorderRadius.vertical( - top: Radius.circular(23.w) - ), - color: Colors.white - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - 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: 13.w,), - if(controller.userData.value?.genderCode == 1) Container( - width: 33.w, - height: 13.w, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(13.w)), - color: const Color.fromRGBO(255, 237, 255, 1) + padding: EdgeInsets.only(top: 361.w), + child: Container( + height: 812.h - 361.w - 49.w - MediaQuery.of(context).padding.top - 54.w, + width: 375.w, + padding: EdgeInsets.only( + top: 31.w, + left: 15.w, + right: 12.w + ), + decoration: BoxDecoration( + borderRadius: BorderRadius.vertical( + top: Radius.circular(23.w) + ), + color: Colors.white + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Text( + controller.userData.value?.nickName ?? "", + style: TextStyle( + fontSize: 19.w, + color: const Color.fromRGBO(51, 51, 51, 1), + fontWeight: FontWeight.w600 + ), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - Assets.imagesFemale, - width: 8.w, - height: 8.w, - ), - SizedBox(width: 1.w,), - Text( - controller.calculateAge(controller.userData.value?.birthDate ?? "1970-1-1").toString(), - style: TextStyle( - fontSize: 9.w, - color: const Color.fromRGBO(255, 66, 236, 1) + SizedBox(width: 13.w,), + if(controller.userData.value?.genderCode == 1) 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: 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: 1.w,), + Text( + controller.calculateAge(controller.userData.value?.birthDate ?? "1970-1-1").toString(), + style: TextStyle( + fontSize: 9.w, + color: const Color.fromRGBO(255, 66, 236, 1) + ), + ) + ], ), ), - ), - SizedBox(width: 4.w,), - if(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( - "实名", + 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(160, 92, 255, 1) + color: const Color.fromRGBO(38, 199, 124, 1) ), - ) - ], - ), - ), - SizedBox(width: 4.w,), - if(controller.userData.value?.genderCode == 0) 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: 1.w,), - Text( - controller.calculateAge(controller.userData.value?.birthDate ?? "").toString(), - style: TextStyle( - fontSize: 9.w, - color: const Color.fromRGBO(120, 140, 255, 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) - ), - 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, + if(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,), - Text( - "6'", - style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(117, 98, 249, 1) + if(controller.userData.value?.genderCode == 0) 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: 1.w,), + Text( + controller.calculateAge(controller.userData.value?.birthDate ?? "").toString(), + style: TextStyle( + fontSize: 9.w, + color: const Color.fromRGBO(120, 140, 255, 1) + ), + ) + ], ), - ) + ), ], ), - ) - ], - ), - SizedBox(height: 8.w,), - Text( - "父母催婚找个结婚的", - style: TextStyle( - fontSize: 11.w, - color: const Color.fromRGBO(144, 144, 144, 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) + ), + 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,), - Text( - "IP属地:${controller.location.value == '' ? controller.userData.value?.provinceName : controller.location.value.split("-")[0]}", - 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) + ), ), - ), - Text( - "趣恋恋ID:${controller.userData.value?.id}", - style: TextStyle( - fontSize: 9.w, - color: const Color.fromRGBO(144, 144, 144, 1) + SizedBox(height: 11.w,), + Wrap( + spacing: 7.w, + runSpacing: 7.w, + children: [ + ...controller.tagList.map((e){ + return TagItem(label: e); + }), + ], ), - ), - Spacer(), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - 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(height: 16.w,), + Text( + "IP属地:${controller.location.value == '' ? controller.userData.value?.provinceName : controller.location.value.split("-")[0]}", + style: TextStyle( + fontSize: 9.w, + color: const Color.fromRGBO(144, 144, 144, 1) + ), + ), + Text( + "趣恋恋ID:${controller.userData.value?.id}", + style: TextStyle( + fontSize: 9.w, + color: const Color.fromRGBO(144, 144, 144, 1) + ), + ), + Spacer(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + 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, + ), + SizedBox(width: 4.w,), + Text( + "发消息", + style: TextStyle( + fontSize: 15.w, + color: Colors.white, + fontWeight: FontWeight.w500 + ), + ) + ], + ), ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - Assets.imagesChatBtn, - width: 13.w, - height: 12.w, - ), - SizedBox(width: 4.w,), - Text( - "发消息", + 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( 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( - fontSize: 15.w, - color: Colors.white, - fontWeight: FontWeight.w500 ), ), ), - ), - ], - ) - ], + ], + ) + ], + ), ), ), ), - ), - if(controller.imgList.length > 0) Positioned( - left: 15.w, - top: 313.w, - child: Row( - children: [ - ...controller.imgList.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: 1.w, color: Colors.white) : null - ), - child: Center( - child: Image.network( - entry.value, - width: 38.w, - height: 38.w, - fit: BoxFit.cover, + if(controller.imgList.length > 0) Positioned( + left: 15.w, + top: 313.w, + child: Row( + children: [ + ...controller.imgList.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: 1.w, color: Colors.white) : null + ), + child: Center( + child: Image.network( + entry.value, + width: 38.w, + height: 38.w, + fit: BoxFit.cover, + ), ), ), ), ), - ), - ); - }), - ], + ); + }), + ], + ), ), - ), - ], - ) - ] - ], + ], + ) + ] + ], + ), ), ), ); diff --git a/lib/pages/mine/feedback_page.dart b/lib/pages/mine/feedback_page.dart index 7566979..5a1e2ba 100644 --- a/lib/pages/mine/feedback_page.dart +++ b/lib/pages/mine/feedback_page.dart @@ -214,29 +214,12 @@ class _FeedbackPageState extends State { 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) + ), ), ), ], diff --git a/lib/pages/mine/my_wallet_page.dart b/lib/pages/mine/my_wallet_page.dart index 385e3c7..e785f68 100644 --- a/lib/pages/mine/my_wallet_page.dart +++ b/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,