fix some issues

hmxc
张萌 3 years ago
parent e569acb21b
commit 8b578b7c83

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

@ -76,11 +76,14 @@ class _ContractPayPageState extends State<ContractPayPage> {
bottomNavi: BottomButton( bottomNavi: BottomButton(
child: '点击支付'.text.size(32.sp).bold.color(ktextPrimary).make(), child: '点击支付'.text.size(32.sp).bold.color(ktextPrimary).make(),
onPressed: () async { onPressed: () async {
String code = await HouseFunc().leaseAlipay(widget.id, 1, 0.01); String code = await HouseFunc()
bool result = .leaseAlipay(widget.id, 1, _model!.margin.toDouble());
await PayUtil().callAliPay(code, API.pay.leaseCheckAlipay); if (code.isNotEmpty) {
if (result) { bool result =
Get.off(() => PayFinishPage()); await PayUtil().callAliPay(code, API.pay.leaseCheckAlipay);
if (result) {
Get.off(() => PayFinishPage());
}
} }
}, },
), ),

@ -77,7 +77,7 @@ class HouseFunc {
BaseFileModel baseFileModel = BaseFileModel baseFileModel =
await NetUtil().upload(API.upload.uploadCardFront, file); await NetUtil().upload(API.upload.uploadCardFront, file);
if (baseFileModel.status ?? false) { if (baseFileModel.status ?? false) {
return baseFileModel.url!; return baseFileModel.url??'';
} else { } else {
return ''; return '';
} }
@ -88,7 +88,7 @@ class HouseFunc {
BaseFileModel baseFileModel = BaseFileModel baseFileModel =
await NetUtil().upload(API.upload.uploadCardBack, file); await NetUtil().upload(API.upload.uploadCardBack, file);
if (baseFileModel.status ?? false) { if (baseFileModel.status ?? false) {
return baseFileModel.url!; return baseFileModel.url??'';
} else { } else {
return ''; return '';
} }
@ -124,7 +124,7 @@ class HouseFunc {
); );
if (baseFileModel.status ?? false) { if (baseFileModel.status ?? false) {
BotToast.showText(text: baseFileModel.message!); BotToast.showText(text: baseFileModel.message!);
return baseFileModel.url!; return baseFileModel.url??'';
} else { } else {
BotToast.showText(text: baseFileModel.message!); BotToast.showText(text: baseFileModel.message!);
return ''; return '';
@ -152,7 +152,7 @@ class HouseFunc {
BaseFileModel baseModel = BaseFileModel baseModel =
await NetUtil().upload(API.upload.uploadFormalContract, file); await NetUtil().upload(API.upload.uploadFormalContract, file);
if (baseModel.status ?? false) { if (baseModel.status ?? false) {
return baseModel.url!; return baseModel.url??'';
} else { } else {
return ''; return '';
} }
@ -178,7 +178,7 @@ class HouseFunc {
"payPrice": price, "payPrice": price,
}); });
if (baseModel.status ?? false) { if (baseModel.status ?? false) {
return baseModel.message!; return baseModel.message??'';
} else { } else {
return ''; return '';
} }

@ -169,12 +169,14 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
crossAxisSpacing: 32.w, crossAxisSpacing: 32.w,
children: [ children: [
_cardBuild( _cardBuild(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP, '缴费查询', '查看租金及保证金情况', () {}), R.ASSETS_ICONS_PAY_PNG, '缴费查询', '查看租金及保证金情况', () {}),
_cardBuild( _cardBuild(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP, '合同变更', '变更合同信息、重新签约', () {}), R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}),
_cardBuild( _cardBuild(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP, '合同续签', '到期前线上办理续签手续', () {}), R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}),
_cardBuild(R.ASSETS_IMAGES_PLACEHOLDER_WEBP, '合同终止', '线上申请终止合同', () {}) _cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () {
})
], ],
); );
} }

@ -1,15 +1,13 @@
import 'dart:io'; import 'dart:io';
import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/painters/upload_painter.dart';
import 'package:aku_community/ui/profile/house/contract_pay_page.dart'; import 'package:aku_community/ui/profile/house/contract_pay_page.dart';
import 'package:aku_community/ui/profile/house/house_func.dart'; import 'package:aku_community/ui/profile/house/house_func.dart';
import 'package:aku_community/widget/bee_scaffold.dart'; import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart'; import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:aku_community/widget/picker/bee_image_picker.dart'; import 'package:aku_community/widget/others/upload_widget.dart';
import 'package:aku_community/widget/views/doc_view.dart'; import 'package:aku_community/widget/views/doc_view.dart';
import 'package:bot_toast/bot_toast.dart'; import 'package:bot_toast/bot_toast.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -37,7 +35,12 @@ class _UploadContractsPageState extends State<UploadContractsPage> {
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w), padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
children: [ children: [
100.w.heightBox, 100.w.heightBox,
_uploadWidget(), UploadWidget(
sheetTitle: '选择合同照片',
onPressed: (file) {
_files.add(file);
setState(() {});
}),
64.w.heightBox, 64.w.heightBox,
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 60.w), padding: EdgeInsets.symmetric(horizontal: 60.w),
@ -92,12 +95,13 @@ class _UploadContractsPageState extends State<UploadContractsPage> {
bottomNavi: BottomButton( bottomNavi: BottomButton(
onPressed: () async { onPressed: () async {
Function cancel = BotToast.showLoading(); Function cancel = BotToast.showLoading();
await _files.map((e) async { _urls.clear();
String result = await HouseFunc().uploadFormalContract(e); for (var item in _files) {
String result = await HouseFunc().uploadFormalContract(item);
if (result.isNotEmpty) { if (result.isNotEmpty) {
_urls.add(result); _urls.add(result);
} }
}); }
bool result = bool result =
await HouseFunc().submitFormalContract(widget.id, _urls); await HouseFunc().submitFormalContract(widget.id, _urls);
if (result) { if (result) {
@ -110,53 +114,4 @@ class _UploadContractsPageState extends State<UploadContractsPage> {
child: '提交审核'.text.size(32.sp).color(ktextPrimary).bold.make()), child: '提交审核'.text.size(32.sp).color(ktextPrimary).bold.make()),
); );
} }
Widget _uploadWidget() {
return GestureDetector(
onTap: () async {
File? _file = await BeeImagePicker.pick(title: '选择合同照片');
if (_file != null) {
_files.add(_file);
setState(() {});
}
},
child: Center(
child: DottedBorder(
dashPattern: [6, 4],
child: Container(
width: 500.w,
height: 500.w,
color: Color(0x19C4C4C4),
alignment: Alignment.center,
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
87.w.heightBox,
SizedBox(
width: 200.w,
height: 200.w,
child: CustomPaint(
painter: UploadPainter(),
),
),
43.w.heightBox,
'点击上传文件'
.text
.size(32.sp)
.color(Color(0xFFADB2C4))
.bold
.make(),
43.w.heightBox,
'仅支持PDF、PNG、JPG格式的文件'
.text
.size(28.sp)
.color(Color(0x999999))
.make(),
],
),
)),
),
);
}
} }

@ -0,0 +1,25 @@
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/material.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: [
],
),
),
);
}
}

@ -0,0 +1,64 @@
import 'dart:io';
import 'package:aku_community/painters/upload_painter.dart';
import 'package:aku_community/widget/picker/bee_image_picker.dart';
import 'package:dotted_border/dotted_border.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class UploadWidget extends StatelessWidget {
final String sheetTitle;
final Function(File file) onPressed;
const UploadWidget(
{Key? key, required this.sheetTitle, required this.onPressed})
: super(key: key);
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () async {
File? _file = await BeeImagePicker.pick(title: sheetTitle);
if (_file != null) {
onPressed(_file);
}
},
child: Center(
child: DottedBorder(
dashPattern: [6, 4],
child: Container(
width: 500.w,
height: 500.w,
color: Color(0x19C4C4C4),
alignment: Alignment.center,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
87.w.heightBox,
SizedBox(
width: 200.w,
height: 200.w,
child: CustomPaint(
painter: UploadPainter(),
),
),
40.w.heightBox,
'点击上传文件'
.text
.size(32.sp)
.color(Color(0xFFADB2C4))
.bold
.make(),
40.w.heightBox,
'仅支持PDF、PNG、JPG格式的文件'
.text
.size(28.sp)
.color(Color(0xFFADB2C4))
.make(),
],
),
)),
),
);
}
}
Loading…
Cancel
Save