From 835a2661947f8e782f92c9b5f61ed00f9dc2ce61 Mon Sep 17 00:00:00 2001 From: datang Date: Fri, 6 May 2022 11:34:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=B4=A7=E5=9C=B0=E5=9D=80=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=EF=BC=9B=E5=AE=B6=E5=BA=AD=E6=88=90=E5=91=98=E5=A4=B4?= =?UTF-8?q?=E5=83=8F=E6=98=BE=E7=A4=BA=EF=BC=9B=E7=BC=B4=E8=B4=B9=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/life_pay/life_pay_record_page.dart | 116 ++++++++++-------- lib/pages/personal/item_my_address.dart | 1 + .../my_house/my_family_member_list_model.dart | 4 + .../my_family_member_list_model.g.dart | 3 + lib/ui/market/search/good_detail_page.dart | 54 ++++---- lib/ui/profile/new_house/member_view.dart | 15 ++- 6 files changed, 109 insertions(+), 84 deletions(-) diff --git a/lib/pages/life_pay/life_pay_record_page.dart b/lib/pages/life_pay/life_pay_record_page.dart index ef51c6a8..917ad927 100644 --- a/lib/pages/life_pay/life_pay_record_page.dart +++ b/lib/pages/life_pay/life_pay_record_page.dart @@ -101,66 +101,74 @@ class _LifePayRecordPageState extends State { borderRadius: BorderRadius.circular(8.w), ), child: DateUtil.formatDate(DateUtil.getDateTime(model.createDate), - format: 'MM-dd HH-mm') + format: 'MM-dd HH:mm') .text .size(24.sp) .color(Colors.black.withOpacity(0.45)) .make(), ), - Row( + Column( children: [ - model.chargesName.text - .size(30.sp) - .color(ktextPrimary) - .bold - .make(), - Spacer(), - '${model.buildingName + '栋' + model.unitName + '单元' + model.estateName}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make() - ], - ), - 16.w.heightBox, - Row( - children: [ - '缴纳金额'.text.color(ktextSubColor).size(28.sp).make(), - Spacer(), - '${model.payAmount}'.text.color(ktextPrimary).size(28.sp).make(), - ], - ), - Row( - children: [ - '付款方式'.text.color(ktextSubColor).size(28.sp).make(), - Spacer(), - '${getPayType[model.payType]}' - .text - .color(ktextPrimary) - .size(28.sp) - .make(), - ], - ), - Row( - children: [ - '流水号'.text.color(ktextSubColor).size(28.sp).make(), - Spacer(), - '${model.code}'.text.color(ktextPrimary).size(28.sp).make(), - ], - ), - Row( - children: [ - '流水号'.text.color(ktextSubColor).size(28.sp).make(), - Spacer(), - '${model.code}'.text.color(ktextPrimary).size(28.sp).make(), - ], - ), - ].sepWidget(separate: 24.w.heightBox), - ) - .box - .color(Colors.white) - .padding(EdgeInsets.symmetric(vertical: 32.w, horizontal: 20.w)) - .make(), + Row( + children: [ + model.chargesName.text + .size(30.sp) + .color(ktextPrimary) + .bold + .make(), + Spacer(), + '${model.buildingName + '栋' + model.unitName + '单元' + model.estateName}' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make() + ], + ), + 16.w.heightBox, + Row( + children: [ + '缴纳金额'.text.color(ktextSubColor).size(28.sp).make(), + Spacer(), + '${model.payAmount}' + .text + .color(ktextPrimary) + .size(28.sp) + .make(), + ], + ), + Row( + children: [ + '付款方式'.text.color(ktextSubColor).size(28.sp).make(), + Spacer(), + '${getPayType[model.payType]}' + .text + .color(ktextPrimary) + .size(28.sp) + .make(), + ], + ), + Row( + children: [ + '流水号'.text.color(ktextSubColor).size(28.sp).make(), + Spacer(), + '${model.code}'.text.color(ktextPrimary).size(28.sp).make(), + ], + ), + Row( + children: [ + '流水号'.text.color(ktextSubColor).size(28.sp).make(), + Spacer(), + '${model.code}'.text.color(ktextPrimary).size(28.sp).make(), + ], + ), + ].sepWidget(separate: 24.w.heightBox), + ) + .box + .color(Colors.white) + .padding(EdgeInsets.symmetric(vertical: 32.w, horizontal: 20.w)) + .make(), + ], + ), ); } } diff --git a/lib/pages/personal/item_my_address.dart b/lib/pages/personal/item_my_address.dart index 7d2f6524..93330f29 100644 --- a/lib/pages/personal/item_my_address.dart +++ b/lib/pages/personal/item_my_address.dart @@ -68,6 +68,7 @@ class _MyAddressItemState extends State { if (result) { await appProvider.getMyAddress(); widget.refreshController!.callRefresh(); + Get.back(); } }, child: Container( diff --git a/lib/saas_model/my_house/my_family_member_list_model.dart b/lib/saas_model/my_house/my_family_member_list_model.dart index 25f3c98a..81ccad45 100644 --- a/lib/saas_model/my_house/my_family_member_list_model.dart +++ b/lib/saas_model/my_house/my_family_member_list_model.dart @@ -1,5 +1,7 @@ import 'package:json_annotation/json_annotation.dart'; +import '../../model/common/img_model.dart'; + part 'my_family_member_list_model.g.dart'; @JsonSerializable() @@ -29,6 +31,7 @@ class Member { final int id; final String name; final int identity; + final List avatarImgList; factory Member.fromJson(Map json) => _$MemberFromJson(json); @@ -36,5 +39,6 @@ class Member { required this.id, required this.name, required this.identity, + required this.avatarImgList, }); } diff --git a/lib/saas_model/my_house/my_family_member_list_model.g.dart b/lib/saas_model/my_house/my_family_member_list_model.g.dart index 6eada3da..4448b7e5 100644 --- a/lib/saas_model/my_house/my_family_member_list_model.g.dart +++ b/lib/saas_model/my_house/my_family_member_list_model.g.dart @@ -23,4 +23,7 @@ Member _$MemberFromJson(Map json) => Member( id: json['id'] as int, name: json['name'] as String, identity: json['identity'] as int, + avatarImgList: (json['imgList'] as List) + .map((e) => ImgModel.fromJson(e as Map)) + .toList(), ); diff --git a/lib/ui/market/search/good_detail_page.dart b/lib/ui/market/search/good_detail_page.dart index 4b8bd85e..8847e21c 100644 --- a/lib/ui/market/search/good_detail_page.dart +++ b/lib/ui/market/search/good_detail_page.dart @@ -74,8 +74,9 @@ class _GoodDetailPageState extends State { if (appProvider.defaultAddressModel == null) { return '选择收货地址'; } else { - return (appProvider.defaultAddressModel!.locationName ?? '') + - (appProvider.defaultAddressModel!.addressDetail ?? ''); + return (_goodDetail!.stockStatus == 1) ? '有货' : '无货'; + // (appProvider.defaultAddressModel!.locationName ?? '') + + // (appProvider.defaultAddressModel!.addressDetail ?? ''); } } else { return (_addressModel!.locationName ?? '') + @@ -393,6 +394,7 @@ class _GoodDetailPageState extends State { var result = await Get.to(() => AddressListPage( canBack: true, )); + _addressModel = null; if (result != null) { _addressModel = result; _refreshController.callRefresh(); @@ -418,8 +420,9 @@ class _GoodDetailPageState extends State { width: 430.w, child: Text( receiveAddress, - style: - TextStyle(fontSize: 24.sp, color: ktextPrimary), + style: receiveAddress == '无货' + ? TextStyle(fontSize: 24.sp, color: kDangerColor) + : TextStyle(fontSize: 24.sp, color: ktextPrimary), maxLines: 1, overflow: TextOverflow.ellipsis, ), @@ -433,27 +436,27 @@ class _GoodDetailPageState extends State { 16.wb, ], ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - 120.wb, - 20.hb, - Offstage( - offstage: receiveAddress == '选择收货地址', - child: (_goodDetail!.stockStatus == 1) - ? '有货' - .text - .color(Color(0xFFE52E2E)) - .size(28.sp) - .make() - : '无货' - .text - .color(Color(0xFFE52E2E)) - .size(28.sp) - .make(), - ) - ], - ), + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // 120.wb, + // 20.hb, + // Offstage( + // offstage: receiveAddress == '选择收货地址', + // child: (_goodDetail!.stockStatus == 1) + // ? '有货' + // .text + // .color(Color(0xFFE52E2E)) + // .size(28.sp) + // .make() + // : '无货' + // .text + // .color(Color(0xFFE52E2E)) + // .size(28.sp) + // .make(), + // ) + // ], + // ), ], ), ), @@ -779,5 +782,4 @@ class _GoodDetailPageState extends State { return count + '折'; } - } diff --git a/lib/ui/profile/new_house/member_view.dart b/lib/ui/profile/new_house/member_view.dart index 6b77c1c8..1a3e8347 100644 --- a/lib/ui/profile/new_house/member_view.dart +++ b/lib/ui/profile/new_house/member_view.dart @@ -12,6 +12,9 @@ import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import '../../../model/common/img_model.dart'; +import '../../../widget/bee_avatar_widget.dart'; + class MemberView extends StatefulWidget { const MemberView({Key? key}) : super(key: key); @@ -65,7 +68,7 @@ class _MemberViewState extends State { children: [ Padding( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), - child: '${model.buildingName}栋${model.unitName}单元${model.estateName}房间' + child: '${model.buildingName}栋${model.unitName}单元${model.estateName}' .text .size(32.sp) .color(Colors.black.withOpacity(0.85)) @@ -79,7 +82,7 @@ class _MemberViewState extends State { crossAxisCount: 4, children: [ ...model.members - .map((e) => _avatar(Identify.values[e.identity], e.name)) + .map((e) => _avatar(e.avatarImgList,Identify.values[e.identity], e.name)) .toList() ], shrinkWrap: true, @@ -92,6 +95,7 @@ class _MemberViewState extends State { } Widget _avatar( + List imgModel, Identify identify, String name, ) { @@ -108,8 +112,11 @@ class _MemberViewState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.circular(40.w), border: Border.all(color: kPrimaryColor, width: 4.w)), - child: Assets.newIcon.avatarPlaceholder - .image(width: 80.w, height: 80.w), + child: BeeAvatarWidget( + width: 80.w, + height: 80.w, + imgs: imgModel, + ), ), Positioned( bottom: -20.w,