pull/1/head
章文轩 3 years ago
commit fb387a16cc

@ -7,6 +7,9 @@ class _ProfileApi {
} }
class _MyHouse { class _MyHouse {
///
String get switchDefaultEstate => '/app/user/myEstate/checkEstate';
/// ///
String get userHouse => '/app/user/myEstate/findAllMyEstate'; String get userHouse => '/app/user/myEstate/findAllMyEstate';

@ -153,6 +153,7 @@ class SignFunc {
return true; return true;
} }
///
static Future<List<MyHouseModel>> getMyHouseInfo() async { static Future<List<MyHouseModel>> getMyHouseInfo() async {
BaseModel baseModel = await NetUtil().get( BaseModel baseModel = await NetUtil().get(
SAASAPI.profile.house.userHouse, SAASAPI.profile.house.userHouse,

@ -30,6 +30,7 @@ class UserProvider extends ChangeNotifier {
await updateUserInfo(); await updateUserInfo();
WebSocketUtil().setUser(userInfoModel!.id.toString()); WebSocketUtil().setUser(userInfoModel!.id.toString());
WebSocketUtil().startWebSocket(); WebSocketUtil().startWebSocket();
await updateMyHouseInfo();
/// ///
_userConfig = await HiveStore.userBox!.get('${_userInfoModel!.id}') ?? _userConfig = await HiveStore.userBox!.get('${_userInfoModel!.id}') ??
@ -77,6 +78,7 @@ class UserProvider extends ChangeNotifier {
notifyListeners(); notifyListeners();
} }
///
Future updateMyHouseInfo() async { Future updateMyHouseInfo() async {
_myHouses = await SignFunc.getMyHouseInfo(); _myHouses = await SignFunc.getMyHouseInfo();
if (_myHouses.isEmpty) { if (_myHouses.isEmpty) {
@ -99,6 +101,7 @@ class UserProvider extends ChangeNotifier {
UserInfoModel? get userInfoModel => _userInfoModel; UserInfoModel? get userInfoModel => _userInfoModel;
///
List<MyHouseModel> _myHouses = []; List<MyHouseModel> _myHouses = [];
List<MyHouseModel> get myHouses => _myHouses; List<MyHouseModel> get myHouses => _myHouses;

@ -80,51 +80,20 @@ class _TaskEvaluationDialogState extends State<TaskEvaluationDialog> {
), ),
), ),
80.hb, 80.hb,
Row( BottomPluralButtonWidget(
children: [ leftTitle: '暂不评价',
MaterialButton( onLeftTap: () {},
onPressed: () {}, rightTitle: '确认提交',
minWidth: 330.w, onRightTap: () async {
height: 80.w,
elevation: 0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
side: BorderSide(color: Colors.black.withOpacity(0.25)),
),
child: Text(
'暂不评价',
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.65)),
),
),
Spacer(),
MaterialButton(
onPressed: () async {
if (_currentIndex == null) { if (_currentIndex == null) {
BotToast.showText(text: '请选择评价满意度'); BotToast.showText(text: '请选择评价满意度');
return; return;
} }
var re = var re = await widget.evaluate(_currentIndex!, _controller.text);
await widget.evaluate(_currentIndex!, _controller.text);
if (re) { if (re) {
Get.back(); Get.back();
} }
}, },
minWidth: 330.w,
height: 80.w,
elevation: 0,
color: kPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
),
child: Text(
'确认提交',
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.85)),
),
)
],
) )
], ],
), ),
@ -159,3 +128,69 @@ class _TaskEvaluationDialogState extends State<TaskEvaluationDialog> {
); );
} }
} }
class BottomPluralButtonWidget extends StatelessWidget {
const BottomPluralButtonWidget({
Key? key,
required this.onLeftTap,
required this.onRightTap,
required this.leftTitle,
required this.rightTitle,
this.padding = false,
}) : super(key: key);
final VoidCallback onLeftTap;
final VoidCallback onRightTap;
final String leftTitle;
final String rightTitle;
final bool padding;
@override
Widget build(BuildContext context) {
return Container(
padding: padding
? EdgeInsets.only(
left: 32.w,
top: 32.w,
bottom: 32.w + MediaQuery.of(context).padding.bottom,
right: 32.w)
: EdgeInsets.zero,
color: padding ? Colors.white : Colors.transparent,
child: Row(
children: [
MaterialButton(
onPressed: onLeftTap,
minWidth: 330.w,
height: 80.w,
elevation: 0,
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
side: BorderSide(color: Colors.black.withOpacity(0.25)),
),
child: Text(
leftTitle,
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.65)),
),
),
Spacer(),
MaterialButton(
onPressed: onRightTap,
minWidth: 330.w,
height: 80.w,
elevation: 0,
color: kPrimaryColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(40.w),
),
child: Text(
rightTitle,
style: TextStyle(
fontSize: 28.sp, color: Colors.black.withOpacity(0.85)),
),
)
],
),
);
}
}

@ -5,6 +5,7 @@ import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/buttons/bee_long_button.dart'; import 'package:aku_new_community/widget/buttons/bee_long_button.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';
import 'package:get/get.dart';
import 'package:velocity_x/src/extensions/string_ext.dart'; import 'package:velocity_x/src/extensions/string_ext.dart';
class WorkOrderBillDialog extends StatelessWidget { class WorkOrderBillDialog extends StatelessWidget {
@ -76,7 +77,11 @@ class WorkOrderBillDialog extends StatelessWidget {
], ],
), ),
80.hb, 80.hb,
BeeLongButton(onPressed: () {}, text: '确认支付'), BeeLongButton(
onPressed: () {
Get.back();
},
text: '确认支付'),
], ],
), ),
); );

@ -2,12 +2,10 @@ import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/extensions/num_ext.dart'; import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_detail_model.dart'; import 'package:aku_new_community/saas_model/work_order/work_order_detail_model.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_progress_model.dart';
import 'package:aku_new_community/ui/function_and_service/task/dialogs/task_evaluation_dialog.dart'; import 'package:aku_new_community/ui/function_and_service/task/dialogs/task_evaluation_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/urge_dialog.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/urge_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_bill_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_finish_dialog.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_finish_dialog.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/dialogs/work_order_progress_dialog.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/history_report_page.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/team_list_page.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/team_list_page.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_func.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/work_order_func.dart';
import 'package:aku_new_community/ui/function_and_service/work_order/work_order_map.dart'; import 'package:aku_new_community/ui/function_and_service/work_order/work_order_map.dart';
@ -78,21 +76,8 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
children: [ children: [
GestureDetector( GestureDetector(
onTap: () async { onTap: () async {
var base = await NetUtil().get( await WorkOrderFuc.getProgress(
SAASAPI.workOrder.findScheduleById, workOrderId: widget.id);
params: {'workOrderId': widget.id});
if (base.success) {
var models = (base.data as List)
.map((e) =>
WorkOrderProgressModel.fromJson(
e))
.toList();
await Get.bottomSheet(
WorkOrderProgressDialog(
models: models));
} else {
BotToast.showText(text: base.msg);
}
}, },
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,
@ -147,6 +132,14 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
padding: padding:
EdgeInsets.only(top: 120.w, left: 32.w, right: 32.w), EdgeInsets.only(top: 120.w, left: 32.w, right: 32.w),
children: [ children: [
Offstage(
offstage: _model!.status < 5,
child: Column(
children: [
_historyReport(),
24.hb,
],
)),
Offstage( Offstage(
offstage: _model!.servicePersonnelImgList == null || offstage: _model!.servicePersonnelImgList == null ||
_model!.servicePersonnelImgList!.isEmpty, _model!.servicePersonnelImgList!.isEmpty,
@ -242,8 +235,8 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
case 6: case 6:
return BeeLongButton( return BeeLongButton(
onPressed: () async { onPressed: () async {
var bills = await WorkOrderFuc.getBill(workOrderId: widget.id); await WorkOrderFuc.getBill(workOrderId: widget.id);
await Get.bottomSheet(WorkOrderBillDialog(models: bills)); _refreshController.callRefresh();
}, },
text: '确认支付'); text: '确认支付');
case 7: case 7:
@ -268,7 +261,9 @@ class _WorkOrderDetailPageState extends State<WorkOrderDetailPage> {
Widget _historyReport() { Widget _historyReport() {
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: () {
Get.to(HistoryReportPage(id: widget.id));
},
child: Material( child: Material(
color: Colors.transparent, color: Colors.transparent,
child: Container( child: Container(

@ -1,7 +1,14 @@
import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_bill_model.dart'; import 'package:aku_new_community/saas_model/work_order/work_order_bill_model.dart';
import 'package:aku_new_community/saas_model/work_order/work_order_progress_model.dart';
import 'package:aku_new_community/utils/network/base_model.dart'; import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:get/get_core/src/get_main.dart';
import 'package:get/get_navigation/src/extension_navigation.dart';
import 'dialogs/work_order_bill_dialog.dart';
import 'dialogs/work_order_progress_dialog.dart';
class WorkOrderFuc { class WorkOrderFuc {
/// ///
@ -48,20 +55,36 @@ class WorkOrderFuc {
return base.success; return base.success;
} }
/// ///
static Future<List<WorkOrderBillModel>> getBill({ static Future getProgress({
required int workOrderId, required int workOrderId,
}) async { }) async {
var models = <WorkOrderBillModel>[]; var base = await NetUtil().get(SAASAPI.workOrder.findScheduleById,
var base = await NetUtil().get(SAASAPI.workOrder.cancel, params: { params: {'workOrderId': workOrderId});
'workOrderId': workOrderId, if (base.success) {
}); var models = (base.data as List)
.map((e) => WorkOrderProgressModel.fromJson(e))
.toList();
await Get.bottomSheet(WorkOrderProgressDialog(models: models));
} else {
BotToast.showText(text: base.msg);
}
}
///
static Future getBill({
required int workOrderId,
}) async {
var base = await NetUtil().get(SAASAPI.workOrder.workOrderBill,
params: {'workOrderId': workOrderId});
if (base.success) { if (base.success) {
models = (base.data as List) var models = (base.data as List)
.map((e) => WorkOrderBillModel.fromJson(e)) .map((e) => WorkOrderBillModel.fromJson(e))
.toList(); .toList();
await Get.bottomSheet(WorkOrderBillDialog(models: models));
} else {
BotToast.showText(text: base.msg);
} }
return models;
} }
/// ///

@ -76,7 +76,7 @@ class _OrderCardState extends State<OrderCard> {
"payType": 1, // "payType": 1, //
"payPrice": widget.model.payPrice, "payPrice": widget.model.payPrice,
"residentId": UserTool.userProvider.userInfoModel!.id, "residentId": UserTool.userProvider.userInfoModel!.id,
"payname": UserTool.userProvider.userInfoModel!.name, "payName": UserTool.userProvider.userInfoModel!.name,
"payTel": UserTool.userProvider.userInfoModel!.tel, "payTel": UserTool.userProvider.userInfoModel!.tel,
}); });
if (baseModel.success) { if (baseModel.success) {

@ -197,7 +197,7 @@ class _SubmitOrderNormalPageState extends State<SubmitOrderNormalPage> {
"payPrice": totalPrice, "payPrice": totalPrice,
// 'points': widget.integral, // 'points': widget.integral,
"residentId": UserTool.userProvider.userInfoModel!.id, "residentId": UserTool.userProvider.userInfoModel!.id,
"payname": UserTool.userProvider.userInfoModel!.name, "payName": UserTool.userProvider.userInfoModel!.name,
"payTel": UserTool.userProvider.userInfoModel!.tel, "payTel": UserTool.userProvider.userInfoModel!.tel,
}, },
showMessage: true); showMessage: true);

@ -1,16 +1,20 @@
import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/user/my_house_model.dart'; import 'package:aku_new_community/models/user/my_house_model.dart';
import 'package:aku_new_community/ui/profile/new_house/add_house_page.dart'; import 'package:aku_new_community/ui/profile/new_house/add_house_page.dart';
import 'package:aku_new_community/ui/profile/new_house/apply_record_page.dart'; import 'package:aku_new_community/ui/profile/new_house/apply_record_page.dart';
import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button.dart'; import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/dialog/certification_dialog.dart'; import 'package:aku_new_community/widget/dialog/certification_dialog.dart';
import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/others/user_tool.dart';
import 'package:aku_new_community/widget/tag/bee_tag.dart'; import 'package:aku_new_community/widget/tag/bee_tag.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
@ -23,15 +27,19 @@ class MyHousePage extends StatefulWidget {
} }
class _MyHousePageState extends State<MyHousePage> { class _MyHousePageState extends State<MyHousePage> {
EasyRefreshController _refreshController = EasyRefreshController();
@override @override
void initState() { void initState() {
Future.delayed(Duration(milliseconds: 0), () async {
await UserTool.userProvider.updateMyHouseInfo();
setState(() {});
});
super.initState(); super.initState();
} }
@override
void dispose() {
_refreshController.dispose();
super.dispose();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
@ -46,7 +54,15 @@ class _MyHousePageState extends State<MyHousePage> {
body: SafeArea( body: SafeArea(
child: UserTool.userProvider.myHouses.isEmpty child: UserTool.userProvider.myHouses.isEmpty
? HouseEmptyWidget() ? HouseEmptyWidget()
: ListView( : EasyRefresh(
controller: _refreshController,
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
await UserTool.userProvider.updateMyHouseInfo();
setState(() {});
},
child: ListView(
padding: padding:
EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
children: <Widget>[ children: <Widget>[
@ -54,6 +70,7 @@ class _MyHousePageState extends State<MyHousePage> {
.map((e) => _houseCard(e)) .map((e) => _houseCard(e))
.toList() .toList()
].sepWidget(separate: 24.w.heightBox), ].sepWidget(separate: 24.w.heightBox),
),
)), )),
bottomNavi: Padding( bottomNavi: Padding(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 32.w),
@ -74,11 +91,25 @@ class _MyHousePageState extends State<MyHousePage> {
Widget _houseCard(MyHouseModel model) { Widget _houseCard(MyHouseModel model) {
return Stack( return Stack(
children: [ children: [
Container( GestureDetector(
onTap: () async {
var base = await NetUtil().get(
SAASAPI.profile.house.switchDefaultEstate,
params: {'estateId': model.isDefault});
if (base.success) {
await UserTool.userProvider.updateMyHouseInfo();
_refreshController.callRefresh();
} else {
BotToast.showText(text: '切换默认房屋失败');
}
},
child: Material(
child: Container(
width: 686.w, width: 686.w,
padding: EdgeInsets.all(24.w), padding: EdgeInsets.all(24.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(8.w)), color: Colors.white,
borderRadius: BorderRadius.circular(8.w)),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -127,6 +158,8 @@ class _MyHousePageState extends State<MyHousePage> {
], ],
), ),
), ),
),
),
if (model.isDefault == 1) if (model.isDefault == 1)
Positioned( Positioned(
top: 0, top: 0,

Loading…
Cancel
Save