diff --git a/lib/models/house/lease_detail_model.dart b/lib/models/house/lease_detail_model.dart new file mode 100644 index 00000000..c7bed482 --- /dev/null +++ b/lib/models/house/lease_detail_model.dart @@ -0,0 +1,91 @@ +import 'package:equatable/equatable.dart'; +import 'package:json_annotation/json_annotation.dart'; +import 'package:aku_community/model/common/img_model.dart'; +part 'lease_detail_model.g.dart'; + +@JsonSerializable() +class LeaseDetailModel extends Equatable { + final int id; + final String code; + final String name; + final int sex; + final String idCard; + final String roomName; + final int type; + final String estateType; + final num rentStandard; + final num margin; + final String leaseDateStart; + final String leaseDateEnd; + final List? imgUrls; + final int status; + final String? reviewerName; + final String? auditDate; + final String createName; + final String? emergencyContact; + final String? emergencyContactNumber; + final String? correspondenceAddress; + final String? workUnits; + final String? payBank; + final String? bankAccountName; + final String? bankAccount; + LeaseDetailModel({ + required this.id, + required this.code, + required this.name, + required this.sex, + required this.idCard, + required this.roomName, + required this.type, + required this.estateType, + required this.rentStandard, + required this.margin, + required this.leaseDateStart, + required this.leaseDateEnd, + required this.imgUrls, + required this.status, + required this.reviewerName, + required this.auditDate, + required this.createName, + required this.emergencyContact, + required this.emergencyContactNumber, + required this.correspondenceAddress, + required this.workUnits, + required this.payBank, + required this.bankAccountName, + required this.bankAccount, + }); + + factory LeaseDetailModel.fromJson(Map json) => + _$LeaseDetailModelFromJson(json); + @override + List get props { + return [ + id, + code, + name, + sex, + idCard, + roomName, + type, + estateType, + rentStandard, + margin, + leaseDateStart, + leaseDateEnd, + imgUrls, + status, + reviewerName, + auditDate, + createName, + emergencyContact, + emergencyContactNumber, + correspondenceAddress, + workUnits, + payBank, + bankAccountName, + bankAccount, + ]; + } + +} diff --git a/lib/models/house/lease_detail_model.g.dart b/lib/models/house/lease_detail_model.g.dart new file mode 100644 index 00000000..bbf56f40 --- /dev/null +++ b/lib/models/house/lease_detail_model.g.dart @@ -0,0 +1,38 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'lease_detail_model.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +LeaseDetailModel _$LeaseDetailModelFromJson(Map json) { + return LeaseDetailModel( + id: json['id'] as int, + code: json['code'] as String, + name: json['name'] as String, + sex: json['sex'] as int, + idCard: json['idCard'] as String, + roomName: json['roomName'] as String, + type: json['type'] as int, + estateType: json['estateType'] as String, + rentStandard: json['rentStandard'] as num, + margin: json['margin'] as num, + leaseDateStart: json['leaseDateStart'] as String, + leaseDateEnd: json['leaseDateEnd'] as String, + imgUrls: (json['imgUrls'] as List?) + ?.map((e) => ImgModel.fromJson(e as Map)) + .toList(), + status: json['status'] as int, + reviewerName: json['reviewerName'] as String?, + auditDate: json['auditDate'] as String?, + createName: json['createName'] as String, + emergencyContact: json['emergencyContact'] as String?, + emergencyContactNumber: json['emergencyContactNumber'] as String?, + correspondenceAddress: json['correspondenceAddress'] as String?, + workUnits: json['workUnits'] as String?, + payBank: json['payBank'] as String?, + bankAccountName: json['bankAccountName'] as String?, + bankAccount: json['bankAccount'] as String?, + ); +} diff --git a/lib/ui/profile/house/house_func.dart b/lib/ui/profile/house/house_func.dart index 5a816518..5d6438a0 100644 --- a/lib/ui/profile/house/house_func.dart +++ b/lib/ui/profile/house/house_func.dart @@ -1,5 +1,6 @@ import 'package:aku_community/constants/api.dart'; import 'package:aku_community/model/user/house_model.dart'; +import 'package:aku_community/models/house/lease_detail_model.dart'; import 'package:aku_community/models/house/lease_echo_model.dart'; import 'package:aku_community/models/user/passed_house_list_model.dart'; import 'package:aku_community/utils/network/base_model.dart'; @@ -54,9 +55,25 @@ class HouseFunc { } } + ///获得租赁详情信息 + Future leaseDetail(int leaseId) async { + BaseModel baseModel = await NetUtil().get(API.house.leaseFindByld, params: { + "leaseId": leaseId, + }); + if (baseModel.status ?? false) { + return LeaseDetailModel.fromJson(baseModel.data); + } else { + return null; + } + } - Map getSex = { + static Map getSex = { '男': 1, '女': 2, }; + + static Map toSex = { + 1: '男', + 2: '女', + }; } diff --git a/lib/ui/profile/house/lease_house_card.dart b/lib/ui/profile/house/lease_house_card.dart new file mode 100644 index 00000000..67fee5ef --- /dev/null +++ b/lib/ui/profile/house/lease_house_card.dart @@ -0,0 +1,196 @@ + +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/models/house/lease_list_model.dart'; +import 'package:aku_community/ui/profile/house/contract_pay_page.dart'; +import 'package:aku_community/ui/profile/house/download_contract_page.dart'; +import 'package:aku_community/ui/profile/house/supplement_information_page.dart'; +import 'package:aku_community/ui/profile/house/upload_contracts_page.dart'; +import 'package:aku_community/widget/buttons/card_bottom_button.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; +import 'package:aku_community/const/resource.dart'; + + +class LeaseHouseCard extends StatelessWidget { + final LeaseListModel model; + const LeaseHouseCard({Key? key, required this.model}) : super(key: key); + + @override + Widget build(BuildContext context) { + var buttons = getButtons(model.status); + var bottom = Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.end, + children: [ + model.getTypeString.text.size(28.sp).color(ktextSubColor).make(), + 8.w.heightBox, + model.estateType.text.size(28.sp).color(ktextSubColor).make(), + ], + ).expand(), + buttons + ], + ); + return Container( + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(16.w), + gradient: LinearGradient( + colors: _getColors(1), + begin: Alignment.topLeft, + end: Alignment.bottomRight), + ), + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Image.asset( + R.ASSETS_ICONS_LEASE_HOUSE_PNG, + width: 40.w, + height: 40.w, + ), + 16.w.widthBox, + '南宁金融人才公寓'.text.size(32.sp).color(ktextPrimary).make().expand(), + model.statusString.text + .size(32.sp) + .color(ktextPrimary) + .bold + .make(), + ], + ), + 12.w.heightBox, + Row( + children: [ + model.roomName.text + .size(40.sp) + .color(ktextPrimary) + .bold + .make() + .expand(), + ], + ), + 56.w.heightBox, + bottom, + ], + ), + ); + } + + Row getButtons(int status) { + switch (status) { + case 1: + return Row( + children: [ + CardBottomButton.yellow( + text: '填写信息', + onPressed: () { + Get.to(() => SupplementInformationPage(leaseId: model.id,)); + }) + ], + ); + case 2: + return Row( + children: [ + CardBottomButton.yellow( + text: '重新填写', + onPressed: () { + Get.to(() => SupplementInformationPage(leaseId: model.id,)); + }), + CardBottomButton.yellow( + text: '上传合同', + onPressed: () { + Get.to(() => UploadContractsPage()); + }), + CardBottomButton.white( + text: '下载合同', + onPressed: () { + Get.to(() => DownLoadContractPage(firstRoute: false)); + }), + ], + ); + + case 3: + return Row( + children: [], + ); + case 4: + return Row( + children: [ + CardBottomButton.yellow( + text: '重新上传', + onPressed: () { + Get.to(() => UploadContractsPage()); + }), + CardBottomButton.white( + text: '修改信息', + onPressed: () { + Get.to(() => SupplementInformationPage(leaseId: model.id,)); + }), + ], + ); + case 5: + return Row( + children: [ + CardBottomButton.yellow( + text: '去支付', + onPressed: () { + Get.to(() => ContractPayPage()); + }) + ], + ); + case 6: + return Row( + children: [ + CardBottomButton.yellow( + text: '租户页面', + onPressed: () { + Get.back(); + }) + ], + ); + default: + return Row(); + } + } + List _getColors(int type) { + switch (type) { + case 1: + return [ + Color(0xFFFFE5D2), + Color(0xFFFFFFFF), + ]; + case 2: + return [ + Color(0xFFFFEEBB), + Color(0xFFFFF4D2), + ]; + case 3: + return [ + Color(0xFFFFEEBB), + Color(0xFFFFF4D2), + ]; + case 4: + return [ + Color(0xFFFFEEBB), + Color(0xFFFFF4D2), + ]; + case 5: + return [ + Color(0xFFFFEEBB), + Color(0xFFFFF4D2), + ]; + case 6: + return [ + Color(0xFFFFEEBB), + Color(0xFFFFF4D2), + ]; + default: + return [Colors.white, Colors.white]; + } + } +} \ No newline at end of file diff --git a/lib/ui/profile/house/supplement_information_page.dart b/lib/ui/profile/house/supplement_information_page.dart index d8729189..d8733a7f 100644 --- a/lib/ui/profile/house/supplement_information_page.dart +++ b/lib/ui/profile/house/supplement_information_page.dart @@ -1,9 +1,15 @@ +import 'dart:io'; + import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/models/house/lease_detail_model.dart'; +import 'package:aku_community/ui/profile/house/house_func.dart'; import 'package:aku_community/ui/profile/house/house_information_check_page.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/buttons/bottom_button.dart'; import 'package:aku_community/widget/others/bee_input_row.dart'; +import 'package:aku_community/widget/others/user_tool.dart'; import 'package:aku_community/widget/picker/identify_card_picker.dart'; +import 'package:bot_toast/bot_toast.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:aku_community/extensions/widget_list_ext.dart'; @@ -12,7 +18,9 @@ import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; class SupplementInformationPage extends StatefulWidget { - SupplementInformationPage({Key? key}) : super(key: key); + final int leaseId; + SupplementInformationPage({Key? key, required this.leaseId}) + : super(key: key); @override _SupplementInformationPageState createState() => @@ -20,19 +28,61 @@ class SupplementInformationPage extends StatefulWidget { } class _SupplementInformationPageState extends State { + ///姓名 TextEditingController _nameController = TextEditingController(); String _sex = '请选择性别'; - TextEditingController _phoneController = TextEditingController(); + + ///电话 + String _tel = UserTool.userProvider.userInfoModel!.tel!; + + ///身份证号 TextEditingController _codeController = TextEditingController(); + + ///紧急联系人 TextEditingController _emergencyContactController = TextEditingController(); + + ///紧急联系人电话 TextEditingController _emergencyPhoneController = TextEditingController(); + + ///通讯地址 TextEditingController _addressController = TextEditingController(); + + ///工作单位 TextEditingController _workUnitController = TextEditingController(); + + ///代缴银行名称 + TextEditingController _bankNameController = TextEditingController(); + + ///代缴银行账户 + TextEditingController _bankCodeController = TextEditingController(); + + ///身份证照片正面 + File? _idCardFront; + ///身份证照片反面 + File? _idCardBack; @override void initState() { + Future.delayed(Duration(milliseconds: 300), () async { + LeaseDetailModel? model = await HouseFunc().leaseDetail(widget.leaseId); + if (model != null) { + initModel(model); + setState(() {}); + } + }); super.initState(); } + @override + void dispose() { + _nameController.dispose(); + _codeController.dispose(); + _emergencyContactController.dispose(); + _emergencyPhoneController.dispose(); + _addressController.dispose(); + _workUnitController.dispose(); + super.dispose(); + } + @override Widget build(BuildContext context) { return BeeScaffold( @@ -44,7 +94,7 @@ class _SupplementInformationPageState extends State { BeeInputRow( title: '承租人', controller: _nameController, - hintText: '杨赟', + hintText: '', isRequire: true, ), BeeInputRow.button( @@ -56,46 +106,90 @@ class _SupplementInformationPageState extends State { hintText: _sex, isRequire: true, ), - BeeInputRow( + BeeInputRow.button( title: '手机号码', - controller: _phoneController, - hintText: '13742494159', + hintText: _tel, + onPressed: () {}, isRequire: true, ), BeeInputRow( title: '身份证号', controller: _codeController, - hintText: 'hintText', + hintText: '', isRequire: true, ), BeeInputRow( title: '紧急联系人', controller: _emergencyContactController, - hintText: 'hintText'), + hintText: '填写紧急联系人'), BeeInputRow( title: '紧急联系人电话', controller: _emergencyPhoneController, - hintText: 'hintText'), + hintText: '填写紧急联系人电话'), BeeInputRow( title: '通讯地址(含诉讼送达地址)', controller: _addressController, - hintText: 'hintText'), + hintText: '填写地址'), BeeInputRow( title: '工作单位', controller: _workUnitController, - hintText: 'hintText'), - IdentifyCardPicker.front((file) => () {}), - IdentifyCardPicker.back((file) => () {}), + hintText: '填写工作单位'), + BeeInputRow( + title: '代缴银行', + controller: _bankNameController, + hintText: '填写代缴银行'), + BeeInputRow( + title: '代缴银行账户', + controller: _bankCodeController, + hintText: '填写代缴银行账户'), + IdentifyCardPicker.front((file) => () { + _idCardFront = file; + }), + IdentifyCardPicker.back((file) => () { + _idCardBack = file; + }), ].sepWidget(separate: 24.w.heightBox), ), bottomNavi: BottomButton( onPressed: () { - Get.to(() => HouseInformationCheckPage()); + if (canSubmit) { + + Get.to(() => HouseInformationCheckPage()); + } }, child: '下一步'.text.size(32.sp).bold.color(ktextPrimary).make()), ); } + //初始化model,基本信息回显 + initModel(LeaseDetailModel? model) { + if (model != null) { + _nameController.text = model.name; + _sex = HouseFunc.toSex[model.sex]!; + _codeController.text = model.idCard; + if (!model.emergencyContact.isEmptyOrNull) { + _emergencyContactController.text = model.emergencyContact!; + } + if (!model.emergencyContactNumber.isEmptyOrNull) { + _emergencyPhoneController.text = model.emergencyContactNumber!; + } + if (!model.bankAccountName.isEmptyOrNull) { + _bankNameController.text = model.bankAccountName!; + } + if (!model.bankAccount.isEmptyOrNull) { + _bankCodeController.text = model.bankAccount!; + } + if (!model.workUnits.isEmptyOrNull) { + _workUnitController.text = model.workUnits!; + } + if (!model.correspondenceAddress.isEmptyOrNull) { + _addressController.text = model.correspondenceAddress!; + } + } + } + + + Widget _sexBottomSheet() { return CupertinoActionSheet( title: @@ -119,4 +213,55 @@ class _SupplementInformationPageState extends State { ], ); } + + bool get canSubmit { + if (_nameController.text.isEmpty) { + BotToast.showText(text: '姓名不能为空!'); + return false; + } + if (_codeController.text.isEmpty) { + BotToast.showText(text: '身份证号码不能为空!'); + return false; + } + if (_sex == '请选择性别') { + BotToast.showText(text: '请先选择性别'); + return false; + } + if (_addressController.text.isEmpty) { + BotToast.showText(text: '请填写地址'); + return false; + } + if (_bankNameController.text.isEmpty) { + BotToast.showText(text: '请填写代缴银行名称'); + return false; + } + if (_bankCodeController.text.isEmpty) { + BotToast.showText(text: '请填写代缴银行账户'); + return false; + } + if (_addressController.text.isEmpty) { + BotToast.showText(text: '请填写地址'); + return false; + } + if (_workUnitController.text.isEmpty) { + BotToast.showText(text: '请填写单位名称'); + } + if (_emergencyContactController.text.isEmpty) { + BotToast.showText(text: '请填写紧急联系人'); + return false; + } + if (_emergencyPhoneController.text.isEmpty) { + BotToast.showText(text: '请填写紧急联系人电话'); + return false; + } + if (_idCardFront == null) { + BotToast.showText(text: '请选择身份证正面照片'); + return false; + } + if (_idCardBack == null) { + BotToast.showText(text: '请选择身份证背面照片'); + return false; + } + return true; + } } diff --git a/lib/ui/profile/house/tenant_house_list_page.dart b/lib/ui/profile/house/tenant_house_list_page.dart index 3b0a313a..31f19f69 100644 --- a/lib/ui/profile/house/tenant_house_list_page.dart +++ b/lib/ui/profile/house/tenant_house_list_page.dart @@ -1,18 +1,11 @@ -import 'package:aku_community/base/base_style.dart'; -import 'package:aku_community/const/resource.dart'; import 'package:aku_community/constants/api.dart'; import 'package:aku_community/models/house/lease_list_model.dart'; import 'package:aku_community/pages/things_page/widget/bee_list_view.dart'; -import 'package:aku_community/ui/profile/house/contract_pay_page.dart'; -import 'package:aku_community/ui/profile/house/download_contract_page.dart'; -import 'package:aku_community/ui/profile/house/supplement_information_page.dart'; -import 'package:aku_community/ui/profile/house/upload_contracts_page.dart'; +import 'package:aku_community/ui/profile/house/lease_house_card.dart'; import 'package:aku_community/widget/bee_scaffold.dart'; -import 'package:aku_community/widget/buttons/card_bottom_button.dart'; import 'package:flutter/material.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; class TenantHouseListPage extends StatefulWidget { @@ -23,7 +16,6 @@ class TenantHouseListPage extends StatefulWidget { } class _TenantHouseListPageState extends State { - bool _onload = true; late EasyRefreshController _refreshController; @override void initState() { @@ -41,21 +33,6 @@ class _TenantHouseListPageState extends State { Widget build(BuildContext context) { return BeeScaffold( title: '可选房屋', - // body: EasyRefresh( - // firstRefresh: true, - // header: MaterialHeader(), - // controller: _refreshController, - // onRefresh: () async { - // _onload = false; - // setState(() {}); - // }, - // child: _onload - // ? Container() - // : ListView( - // padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), - // children: [houseCard()], - // ), - // ), body: BeeListView( path: API.house.leaseList, controller: _refreshController, @@ -68,7 +45,7 @@ class _TenantHouseListPageState extends State { return ListView.separated( padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), itemBuilder: (context, index) { - return houseCard(items[index]); + return LeaseHouseCard(model:items[index]); }, separatorBuilder: (_, __) { return 24.w.heightBox; @@ -78,175 +55,5 @@ class _TenantHouseListPageState extends State { ); } - List _getColors(int type) { - switch (type) { - case 1: - return [ - Color(0xFFFFE5D2), - Color(0xFFFFFFFF), - ]; - case 2: - return [ - Color(0xFFFFEEBB), - Color(0xFFFFF4D2), - ]; - case 3: - return [ - Color(0xFFFFEEBB), - Color(0xFFFFF4D2), - ]; - case 4: - return [ - Color(0xFFFFEEBB), - Color(0xFFFFF4D2), - ]; - case 5: - return [ - Color(0xFFFFEEBB), - Color(0xFFFFF4D2), - ]; - case 6: - return [ - Color(0xFFFFEEBB), - Color(0xFFFFF4D2), - ]; - default: - return [Colors.white, Colors.white]; - } - } - Widget houseCard(LeaseListModel model) { - var buttons = getButtons(model.status); - var bottom = Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.end, - children: [ - model.getTypeString.text.size(28.sp).color(ktextSubColor).make(), - 8.w.heightBox, - model.estateType.text.size(28.sp).color(ktextSubColor).make(), - ], - ).expand(), - buttons - ], - ); - return Container( - padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(16.w), - gradient: LinearGradient( - colors: _getColors(1), - begin: Alignment.topLeft, - end: Alignment.bottomRight), - ), - width: double.infinity, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Image.asset( - R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - width: 40.w, - height: 40.w, - ), - 16.w.widthBox, - '南宁金融人才公寓'.text.size(32.sp).color(ktextPrimary).make().expand(), - model.statusString.text - .size(32.sp) - .color(ktextPrimary) - .bold - .make(), - ], - ), - 12.w.heightBox, - Row( - children: [ - model.roomName.text - .size(40.sp) - .color(ktextPrimary) - .bold - .make() - .expand(), - ], - ), - 56.w.heightBox, - bottom, - ], - ), - ); - } - - Row getButtons(int status) { - switch (status) { - case 1: - return Row( - children: [ - CardBottomButton.yellow( - text: '填写信息', - onPressed: () { - Get.to(() => SupplementInformationPage()); - }) - ], - ); - case 2: - return Row( - children: [ - CardBottomButton.yellow( - text: '上传合同', - onPressed: () { - Get.to(() => UploadContractsPage()); - }), - CardBottomButton.white( - text: '下载合同', - onPressed: () { - Get.to(() => DownLoadContractPage(firstRoute: false)); - }), - ], - ); - - case 3: - return Row( - children: [], - ); - case 4: - return Row( - children: [ - CardBottomButton.yellow( - text: '重新上传', - onPressed: () { - Get.to(() => UploadContractsPage()); - }), - CardBottomButton.white( - text: '修改信息', - onPressed: () { - Get.to(() => SupplementInformationPage()); - }), - ], - ); - case 5: - return Row( - children: [ - CardBottomButton.yellow( - text: '去支付', - onPressed: () { - Get.to(() => ContractPayPage()); - }) - ], - ); - case 6: - return Row( - children: [ - CardBottomButton.yellow( - text: '租户页面', - onPressed: () { - Get.back(); - }) - ], - ); - default: - return Row(); - } - } } diff --git a/lib/ui/profile/house/user_identify_page.dart b/lib/ui/profile/house/user_identify_page.dart index 15288be2..5fab0a78 100644 --- a/lib/ui/profile/house/user_identify_page.dart +++ b/lib/ui/profile/house/user_identify_page.dart @@ -36,16 +36,7 @@ class _UserIdentifyPageState extends State { _nameController.text = _model.name!; } if (_model.sex != null) { - switch (_model.sex) { - case 1: - _sex = '男'; - break; - case 2: - _sex = '女'; - break; - default: - break; - } + HouseFunc.toSex[_model.sex]; } if (_model.tel.isNotEmpty) { _tel = _model.tel; diff --git a/lib/widget/others/sign_name_board.dart b/lib/widget/others/sign_name_board.dart index e04daaba..cad75936 100644 --- a/lib/widget/others/sign_name_board.dart +++ b/lib/widget/others/sign_name_board.dart @@ -10,7 +10,7 @@ class SignNameBoard extends StatefulWidget { SignatureController _signatureController = SignatureController( penColor: Colors.black, penStrokeWidth: 5.w, - exportBackgroundColor: Colors.white, + exportBackgroundColor: Colors.transparent, ); return await navigator!.push( PageRouteBuilder( diff --git a/lib/widget/picker/identify_card_picker.dart b/lib/widget/picker/identify_card_picker.dart index d70d7c4a..b3dff77e 100644 --- a/lib/widget/picker/identify_card_picker.dart +++ b/lib/widget/picker/identify_card_picker.dart @@ -16,7 +16,7 @@ class IdentifyCardPicker extends StatefulWidget { 24.w.heightBox, IdentifyCardPicker( onChange: onChange, - path: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + path: R.ASSETS_STATIC_ID_CARD_FRONT_PNG, ) ], ); @@ -29,7 +29,7 @@ class IdentifyCardPicker extends StatefulWidget { '上传身份证背面'.text.size(28.sp).color(ktextPrimary).make(), 24.w.heightBox, IdentifyCardPicker( - onChange: onChange, path: R.ASSETS_IMAGES_PLACEHOLDER_WEBP) + onChange: onChange, path: R.ASSETS_STATIC_ID_CARD_BACK_PNG) ], ); } @@ -50,8 +50,10 @@ class _IdentifyCardPickerState extends State { return GestureDetector( onTap: () async { _file = await BeeImagePicker.pick(title: '选择身份证照片'); - setState(() {}); - widget.onChange(_file); + if (_file != null) { + setState(() {}); + widget.onChange(_file); + } }, child: Container( width: 350.w,