添加合同终止-提交申请相关页面

对接其接口
hmxc
张萌 3 years ago
parent 2016da3db7
commit 55e56c47bc

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 KiB

@ -478,6 +478,10 @@ class R {
static const String ASSETS_IMAGES_COMMITMENT_PNG =
'assets/images/commitment.png';
/// ![preview](file:///Users/zhangmeng/aku_community/assets/images/contact_manager.png)
static const String ASSETS_IMAGES_CONTACT_MANAGER_PNG =
'assets/images/contact_manager.png';
/// ![preview](file:///Users/zhangmeng/aku_community/assets/images/drawings.png)
static const String ASSETS_IMAGES_DRAWINGS_PNG = 'assets/images/drawings.png';

@ -392,6 +392,9 @@ class _Upload {
///pdf
String get uploadFormalContract => '/user/upload/uploadLeaseContractValidPdf';
///
String get uploadClearingSingle => '/user/upload/uploadAppClearingSingle';
}
class _Message {
@ -487,4 +490,8 @@ class _House {
///
String get submitFormalContract => '/user/myHouse/submitAudit';
///-
String get submitTerminateApplication =>
'/user/myHouse/submitTerminateApplication';
}

@ -6,12 +6,13 @@
import 'package:device_info_plus_web/device_info_plus_web.dart';
import 'package:firebase_core_web/firebase_core_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:package_info_plus_web/package_info_plus_web.dart';
import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
DeviceInfoPlusPlugin.registerWith(registrar);

@ -34,6 +34,10 @@ class LeaseDetailModel extends Equatable {
final String? payBank;
final String? bankAccountName;
final String? bankAccount;
final String? takeDate;
final String? notMeterRentDate;
final num? requiredRent;
final String? depositRefundReviewRemake;
LeaseDetailModel({
required this.id,
required this.code,
@ -62,6 +66,10 @@ class LeaseDetailModel extends Equatable {
required this.payBank,
required this.bankAccountName,
required this.bankAccount,
this.takeDate,
this.notMeterRentDate,
this.requiredRent,
this.depositRefundReviewRemake,
});
factory LeaseDetailModel.fromJson(Map<String, dynamic> json) =>
@ -95,4 +103,37 @@ class LeaseDetailModel extends Equatable {
bankAccount,
];
}
String get statusString {
switch (this.status) {
case 1:
return '待签署';
case 2:
return '待提交';
case 3:
return '审核中';
case 4:
return '已驳回';
case 5:
return '待支付';
case 6:
return '已完成';
case 11:
return '申请终止合同';
case 12:
return '申请终止失败';
case 13:
return '申请终止成功';
case 14:
return '已支付剩余租金';
case 15:
return '申请退还保证金';
case 16:
return '申请保证金退回';
case 17:
return '申请退换保证金成功';
default:
return '未知';
}
}
}

@ -37,5 +37,9 @@ LeaseDetailModel _$LeaseDetailModelFromJson(Map<String, dynamic> json) {
payBank: json['payBank'] as String?,
bankAccountName: json['bankAccountName'] as String?,
bankAccount: json['bankAccount'] as String?,
takeDate: json['takeDate'] as String?,
notMeterRentDate: json['notMeterRentDate'] as String?,
requiredRent: json['requiredRent'] as num?,
depositRefundReviewRemake: json['depositRefundReviewRemake'] as String?,
);
}

@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:equatable/equatable.dart';
import 'package:flutter/material.dart';
import 'package:json_annotation/json_annotation.dart';
part 'passed_house_list_model.g.dart';
@ -13,6 +12,7 @@ class PassedHouseListModel extends Equatable {
final int type;
final String? effectiveTimeStart;
final String? effectiveTimeEnd;
final int? sysLeaseId;
PassedHouseListModel({
required this.id,
required this.estateId,
@ -20,6 +20,7 @@ class PassedHouseListModel extends Equatable {
required this.type,
this.effectiveTimeStart,
this.effectiveTimeEnd,
this.sysLeaseId,
});
@override

@ -14,5 +14,6 @@ PassedHouseListModel _$PassedHouseListModelFromJson(Map<String, dynamic> json) {
type: json['type'] as int,
effectiveTimeStart: json['effectiveTimeStart'] as String?,
effectiveTimeEnd: json['effectiveTimeEnd'] as String?,
sysLeaseId: json['sysLeaseId'] as int?,
);
}

@ -301,7 +301,11 @@ class _LifePayPageState extends State<LifePayPage> {
if (items != null) _models = items as List<LifePayModel?>;
return Column(
children: [
HouseHeadCard(controller: _controller, context: context),
HouseHeadCard(
onChanged: () {
_controller!.callRefresh();
},
context: context),
16.w.heightBox,
Container(
padding: EdgeInsets.all(32.w),

@ -19,6 +19,15 @@ class ContactManagerPainter extends CustomPainter {
colors: [Color(0xFFF9F9F9), Color(0xFF4AFD71)]);
paint.shader = gradient.createShader(rect);
canvas.drawPath(path, paint);
rect= Rect.fromCircle(center: Offset(200.w, 200.w), radius: 150.w);
gradient = LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [Color(0xFFF9F9F9), Color(0xFF4AFD71)]);
Path path2 = Path();
path2.addArc(rect, 0, pi * 2);
paint.shader = gradient.createShader(rect);
canvas.drawPath(path2, paint);
}
@override

@ -40,7 +40,6 @@ class UserProvider extends ChangeNotifier {
await appProvider.updateHouses(await HouseFunc.passedHouses);
WebSocketUtil().setUser(userInfoModel!.id.toString());
WebSocketUtil().startWebSocket();
AppProvider().setFireAlert(true);
notifyListeners();
} catch (e) {
LoggerData.addData(e);

@ -23,7 +23,7 @@ class SubmitComplishPage extends StatelessWidget {
child: Column(
children: [
76.w.heightBox,
FinishResultImage(status: status),
FinishResultImage(status: status!),
48.w.heightBox,
(this.status! ? '提交成功' : '提交失败').text.size(36.sp).black.bold.make(),
16.w.heightBox,

@ -0,0 +1,50 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/ui/profile/house/upload_empty_list_page.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:get/get.dart';
class ContractStopPage extends StatefulWidget {
ContractStopPage({Key? key,}) : super(key: key);
@override
_ContractStopPageState createState() => _ContractStopPageState();
}
class _ContractStopPageState extends State<ContractStopPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '联系物业',
body: Center(
child: Column(
children: [
192.w.heightBox,
Image.asset(
R.ASSETS_IMAGES_CONTACT_MANAGER_PNG,
width: 400.w,
height: 400.w,
),
40.w.heightBox,
'物业中心电话'.text.size(44.sp).color(ktextPrimary).bold.make(),
32.w.heightBox,
'需沟通物业人员检查房屋\n并填写腾空单后拍照\n方可进行下一步'
.text
.size(30.w)
.color(ktextSubColor)
.align(TextAlign.center)
.make(),
],
),
),
bottomNavi: BottomButton(
onPressed: () {
Get.off(() => UploadEmptyListPage());
},
child: '检查完成,上传腾空单'.text.size(32.sp).bold.color(ktextPrimary).make()),
);
}
}

@ -185,6 +185,33 @@ class HouseFunc {
}
}
///
Future<String> uploadClearingSingle(File file) async {
BaseFileModel baseFileModel =
await NetUtil().upload(API.upload.uploadClearingSingle, file);
if (baseFileModel.status ?? false) {
return baseFileModel.url!;
} else {
return '';
}
}
///
Future<bool> submitTerminationApplication(
int id,
String takeDate,
List<String> urls,
) async {
BaseModel baseModel = await NetUtil().post(
API.house.submitTerminateApplication,
params: {"id": id, "takeDate": takeDate, "clearingSingleImgUrl": urls});
if (baseModel.status ?? false) {
return true;
} else {
return false;
}
}
static Map<String, int> getSex = {
'': 1,
'': 2,

@ -1,3 +1,6 @@
import 'package:aku_community/models/house/lease_detail_model.dart';
import 'package:aku_community/ui/profile/house/contract_stop_page.dart';
import 'package:aku_community/ui/profile/house/submit_finish_page.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
@ -16,7 +19,6 @@ import 'package:aku_community/ui/profile/house/house_func.dart';
import 'package:aku_community/ui/profile/house/identify_selection_page.dart';
import 'package:aku_community/ui/profile/house/my_house_list.dart';
import 'package:aku_community/ui/profile/house/tenant_house_list_page.dart';
import 'package:aku_community/ui/profile/house/upload_empty_form_page.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart';
@ -173,8 +175,7 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
child: Text('添加房屋'),
),
),
if (!isOwner && !_emptyHouse)
_contractRelevant().expand()
if (!isOwner && !_emptyHouse) _contractRelevant()
],
),
),
@ -192,50 +193,77 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
///
Widget _contractRelevant() {
return GridView.count(
crossAxisCount: 2,
childAspectRatio: 326 / 241,
mainAxisSpacing: 32.w,
crossAxisSpacing: 32.w,
children: [
_cardBuild(R.ASSETS_ICONS_PAY_PNG, '缴费查询', '查看租金及保证金情况', () {}),
_cardBuild(R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}),
_cardBuild(R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}),
_cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () {
Get.to(() => UploadEmptyFormPage());
})
],
return Container(
width: double.infinity,
height: 550.w,
padding: EdgeInsets.symmetric(horizontal: 32.w),
child: GridView.count(
crossAxisCount: 2,
childAspectRatio: 330 / 250,
mainAxisSpacing: 32.w,
crossAxisSpacing: 32.w,
children: [
_cardBuild(R.ASSETS_ICONS_PAY_PNG, '缴费查询', '查看租金及保证金情况', () {}),
_cardBuild(R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}),
_cardBuild(R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}),
_cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () async {})
],
),
);
}
Future stopContract() async {
LeaseDetailModel? model = await HouseFunc()
.leaseDetail(UserTool.appProveider.selectedHouse!.sysLeaseId!);
if (model != null) {
switch (model.status) {
case 1:
case 2:
case 3:
case 4:
case 5:
case 6:
Get.to(() => ContractStopPage());
break;
case 11:
case 12:
case 13:
Get.to(
() => SubmitFinishPage(status: model.status, leaseId: model.id));
break;
default:
}
}
}
Widget _cardBuild(
String assetPath, String title, String subTitle, VoidCallback onPressed) {
return MaterialButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16.w)),
color: Colors.white,
elevation: 0,
minWidth: 326.w,
height: 241.w,
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
onPressed: onPressed,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
width: 88.w,
height: 88.w,
),
16.w.heightBox,
title.text.size(28.sp).color(ktextPrimary).bold.make(),
16.w.heightBox,
subTitle.text
.size(24.sp)
.color(ktextSubColor)
.maxLines(2)
.ellipsis
.make()
],
return GestureDetector(
onTap: onPressed,
child: Container(
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
padding: EdgeInsets.only(left: 30.w, top: 24.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Image.asset(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
fit: BoxFit.fill,
width: 88.w,
height: 88.w,
),
16.w.heightBox,
title.text.size(28.sp).color(ktextPrimary).bold.make(),
16.w.heightBox,
subTitle.text
.size(24.sp)
.color(ktextSubColor)
.maxLines(2)
.ellipsis
.make()
],
),
),
);
}

@ -0,0 +1,70 @@
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/widget/bee_scaffold.dart';
import 'package:aku_community/widget/others/finish_result_image.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class SubmitFinishPage extends StatefulWidget {
final int status;
final int leaseId;
SubmitFinishPage({Key? key, required this.status, required this.leaseId})
: super(key: key);
@override
_SubmitFinishPageState createState() => _SubmitFinishPageState();
}
class _SubmitFinishPageState extends State<SubmitFinishPage> {
String get statusString {
switch (widget.status) {
case 11:
return '审核中';
case 12:
return '审核失败';
case 13:
return '审核通过';
default:
return '未知';
}
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
body: Center(
child: Column(
children: [
76.w.heightBox,
FinishResultImage(
status: widget.status == 12 ? false : true,
haveInHandStatus: widget.status == 11 ? true : false,
),
48.w.heightBox,
statusString.text.black.size(36.sp).make(),
96.w.heightBox,
widget.status != 13
? SizedBox()
: MaterialButton(
elevation: 0,
minWidth: 702.w,
height: 98.w,
color: kPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w)),
onPressed: () async {
LeaseDetailModel? model =
await HouseFunc().leaseDetail(widget.leaseId);
Get.back();
},
child: '去支付'.text.color(ktextPrimary).size(36.sp).make(),
),
],
),
),
);
}
}

@ -38,7 +38,7 @@ class _UploadContractsPageState extends State<UploadContractsPage> {
100.w.heightBox,
UploadWidget(
sheetTitle: '选择合同照片',
onPressed: (file) {
onPicked: (file) {
_files.add(file);
setState(() {});
}),

@ -1,29 +0,0 @@
import 'package:flutter/material.dart';
import 'package:aku_community/painters/contact_manager_painter.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
class UploadEmptyFormPage extends StatefulWidget {
UploadEmptyFormPage({Key? key}) : super(key: key);
@override
_UploadEmptyFormPageState createState() => _UploadEmptyFormPageState();
}
class _UploadEmptyFormPageState extends State<UploadEmptyFormPage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '联系物业',
body: Center(
child: Column(
children: [
CustomPaint(
painter: ContactManagerPainter(),
)
],
),
),
);
}
}

@ -0,0 +1,91 @@
import 'dart:io';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/ui/profile/house/house_func.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/house_head_card.dart';
import 'package:aku_community/widget/others/upload_widget.dart';
import 'package:aku_community/widget/others/user_tool.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart';
class UploadEmptyListPage extends StatefulWidget {
UploadEmptyListPage({Key? key}) : super(key: key);
@override
_UploadEmptyListPageState createState() => _UploadEmptyListPageState();
}
class _UploadEmptyListPageState extends State<UploadEmptyListPage> {
File? _file;
List<String> _urls = [];
int get sysLeaseId => UserTool.appProveider.selectedHouse!.sysLeaseId ?? 0;
late TextEditingController _editingController;
@override
void initState() {
super.initState();
_editingController = TextEditingController();
}
@override
void dispose() {
_editingController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '提交终止申请',
body: ListView(
children: [
HouseHeadCard(context: context),
40.w.heightBox,
BeeInputRow(
title: '收房时间',
controller: _editingController,
hintText: '请填写收房时间'),
40.w.heightBox,
'上传腾空单'.text.size(28.sp).color(ktextPrimary).make(),
24.w.heightBox,
_file != null
? Image.file(
_file!,
width: 480.w,
height: 480.w,
fit: BoxFit.cover,
)
: UploadWidget(
sheetTitle: '上传腾空单',
onPicked: (file) {
_file = file;
setState(() {});
}),
],
),
bottomNavi: BottomButton(
onPressed: () async {
Function cancel = BotToast.showLoading();
if (_file != null) {
_urls.add(await HouseFunc().uploadClearingSingle(_file!));
} else {
BotToast.showText(text: '请先选择腾空单');
}
bool result = await HouseFunc().submitTerminationApplication(
sysLeaseId, _editingController.text, _urls);
if (result) {
Get.back();
} else {
BotToast.showText(text: '提交失败');
}
cancel();
},
child: '提交审核'.text.size(32.sp).bold.color(ktextPrimary).make()),
);
}
}

@ -107,6 +107,7 @@ class WebSocketUtil {
}
WebSocketUtil().setPrintHeart(true);
UserTool.appProveider.setFireAlert(true);
}
//

@ -9,10 +9,11 @@ class FinishResultImage extends StatelessWidget {
const FinishResultImage({
Key? key,
required this.status,
this.haveInHandStatus = false,
}) : super(key: key);
final bool? status;
final bool status;
final bool haveInHandStatus;
@override
Widget build(BuildContext context) {
return Container(
@ -21,10 +22,18 @@ class FinishResultImage extends StatelessWidget {
height: 110.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(55.w),
color: this.status! ? kPrimaryColor : kDangerColor,
color: this.haveInHandStatus
? Colors.yellow.shade900
: this.status
? kPrimaryColor
: kDangerColor,
),
child: Icon(
this.status! ? CupertinoIcons.checkmark : CupertinoIcons.multiply,
this.haveInHandStatus
? CupertinoIcons.exclamationmark
: this.status
? CupertinoIcons.checkmark
: CupertinoIcons.multiply,
size: 70.w,
color: Colors.white,
),

@ -1,7 +1,6 @@
import 'package:flutter/cupertino.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:provider/provider.dart';
@ -17,12 +16,11 @@ class HouseHeadCard extends StatelessWidget {
const HouseHeadCard({
Key? key,
required this.context,
required EasyRefreshController? controller,
}) : controller = controller,
super(key: key);
this.onChanged,
}) : super(key: key);
final BuildContext context;
final EasyRefreshController? controller;
final VoidCallback? onChanged;
@override
Widget build(BuildContext context) {
@ -39,7 +37,7 @@ class HouseHeadCard extends StatelessWidget {
GestureDetector(
onTap: () {
Get.to(() => PickMyHousePage());
controller!.callRefresh();
if (onChanged != null) onChanged!();
},
child: Row(
children: [

@ -11,9 +11,9 @@ import 'package:aku_community/widget/picker/bee_image_picker.dart';
class UploadWidget extends StatelessWidget {
final String sheetTitle;
final Function(File file) onPressed;
final Function(File file) onPicked;
const UploadWidget(
{Key? key, required this.sheetTitle, required this.onPressed})
{Key? key, required this.sheetTitle, required this.onPicked})
: super(key: key);
@override
@ -22,7 +22,7 @@ class UploadWidget extends StatelessWidget {
onTap: () async {
File? _file = await BeeImagePicker.pick(title: sheetTitle);
if (_file != null) {
onPressed(_file);
onPicked(_file);
}
},
child: Center(

Loading…
Cancel
Save