diff --git a/lib/pages/life_pay/life_pay_page.dart b/lib/pages/life_pay/life_pay_page.dart index f81a99fe..939160dd 100644 --- a/lib/pages/life_pay/life_pay_page.dart +++ b/lib/pages/life_pay/life_pay_page.dart @@ -260,7 +260,7 @@ class _LifePayPageState extends State { Future _dailyPaymentPrePay() async { BaseModel baseModel = await NetUtil().get(API.manager.dailyPaymentPrePay, params: { - "estateId": UserTool.appProveider.selectedHouse!.estateId, + "estateId": UserTool.appProvider.selectedHouse!.estateId, }); if (baseModel.success) { return (baseModel.data as num).toDouble(); diff --git a/lib/pages/life_pay/life_pay_record_page.dart b/lib/pages/life_pay/life_pay_record_page.dart index 539160d8..485ea014 100644 --- a/lib/pages/life_pay/life_pay_record_page.dart +++ b/lib/pages/life_pay/life_pay_record_page.dart @@ -44,9 +44,7 @@ class _LifePayRecordPageState extends State { title: '生活缴费', body: BeeListView( path: API.manager.paymentRecord, - extraParams: { - "estateId": UserTool.appProveider.selectedHouse!.estateId - }, + extraParams: {"estateId": UserTool.appProvider.selectedHouse!.estateId}, controller: _refreshController, convert: (models) { return models.rows diff --git a/lib/pages/life_pay/life_pre_pay_page.dart b/lib/pages/life_pay/life_pre_pay_page.dart index 2124652c..a70b38eb 100644 --- a/lib/pages/life_pay/life_pre_pay_page.dart +++ b/lib/pages/life_pay/life_pre_pay_page.dart @@ -157,7 +157,7 @@ class _LifePrePayPageState extends State { try { BaseModel baseModel = await NetUtil().post(API.pay.dailPaymentPrePay, params: { - "estateId": UserTool.appProveider.selectedHouse!.estateId, + "estateId": UserTool.appProvider.selectedHouse!.estateId, "payType": 1, "payPrice": _editingController.text }); diff --git a/lib/pages/property/property_func.dart b/lib/pages/property/property_func.dart index 3a88eb57..48493655 100644 --- a/lib/pages/property/property_func.dart +++ b/lib/pages/property/property_func.dart @@ -8,7 +8,7 @@ class PropertyFunc { static Future getDailyPaymentPrePay() async { BaseModel baseModel = await NetUtil().get(API.manager.dailyPaymentPrePay, params: { - "estateId": UserTool.appProveider.selectedHouse!.estateId, + "estateId": UserTool.appProvider.selectedHouse!.estateId, }); if (baseModel.success) { return (baseModel.data as num).toDouble(); @@ -21,7 +21,7 @@ class PropertyFunc { static Future getFindUnpaidAmount() async { BaseModel baseModel = await NetUtil().get(API.manager.findUnpaidAmount, params: { - "estateId": UserTool.appProveider.selectedHouse!.estateId, + "estateId": UserTool.appProvider.selectedHouse!.estateId, }); if (baseModel.success) { return (baseModel.data as num).toDouble(); diff --git a/lib/pages/renovation_manage/new_renovation/new_renovation_add_page.dart b/lib/pages/renovation_manage/new_renovation/new_renovation_add_page.dart index 9158f169..c4679b0d 100644 --- a/lib/pages/renovation_manage/new_renovation/new_renovation_add_page.dart +++ b/lib/pages/renovation_manage/new_renovation/new_renovation_add_page.dart @@ -58,12 +58,12 @@ class _NewRenovationAddPageState extends State { ), bottomNavi: BottomButton( onPressed: () async { - if (UserTool.appProveider.selectedHouse != null) { + if (UserTool.appProvider.selectedHouse != null) { BaseModel baseModel = await NetUtil().post(API.manager.insertNewRenovation, params: { "estateId": - UserTool.appProveider.selectedHouse!.estateId, + UserTool.appProvider.selectedHouse!.estateId, "constructionUnit": _unitController.text, "director": _directorController.text, "directorTel": _telController.text, diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index 0b8ed1f5..3fc428bf 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -1,11 +1,3 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; -import 'package:velocity_x/velocity_x.dart'; - import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/num_ext.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; @@ -20,6 +12,12 @@ import 'package:aku_new_community/utils/developer_util.dart'; import 'package:aku_new_community/utils/websocket/web_socket_util.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; +import 'package:velocity_x/velocity_x.dart'; class SettingsPage extends StatefulWidget { SettingsPage({Key? key}) : super(key: key); @@ -179,7 +177,7 @@ class _SettingsPageState extends State { children: [ '接收火灾报警通知'.text.size(28.sp).color(ktextPrimary).bold.make().expand(), CupertinoSwitch( - value: UserTool.appProveider.fireAlert, + value: UserTool.appProvider.fireAlert, onChanged: (value) { if (value) { WebSocketUtil().startWebSocket(); diff --git a/lib/pages/share_pay_page/share_pay_page.dart b/lib/pages/share_pay_page/share_pay_page.dart index 728c1e44..6586ef14 100644 --- a/lib/pages/share_pay_page/share_pay_page.dart +++ b/lib/pages/share_pay_page/share_pay_page.dart @@ -281,7 +281,7 @@ class _SharePayPageState extends State { onRefresh: () async { BaseModel baseModel = await NetUtil().get(API.manager.sharePayList, params: { - 'estateId': UserTool.appProveider.selectedHouse?.estateId, + 'estateId': UserTool.appProvider.selectedHouse?.estateId, }); _models = (baseModel.data as List) .map((e) => SharePayListModel.fromJson(e)) diff --git a/lib/pages/sign/login/code_message_page.dart b/lib/pages/sign/login/code_message_page.dart index 689ce75b..80539cae 100644 --- a/lib/pages/sign/login/code_message_page.dart +++ b/lib/pages/sign/login/code_message_page.dart @@ -79,7 +79,7 @@ class _CodeMessagePageState extends State { var re = await SignFunc.loginBySms( widget.tel, code, - UserTool.appProveider.pickedCityAndCommunity! + UserTool.appProvider.pickedCityAndCommunity! .communityModel!.id); if (re.data['success']) { await UserTool.userProvider @@ -111,18 +111,18 @@ class _CodeMessagePageState extends State { onPressed: () async { var base = await SignFunc.sendMessageCode( widget.tel, - UserTool.appProveider.pickedCityAndCommunity! + UserTool.appProvider.pickedCityAndCommunity! .communityModel!.id); if (base.success) { _errorMessage = null; - UserTool.appProveider.startTimer(); + UserTool.appProvider.startTimer(); } else { BotToast.showText(text: base.msg); } }, - child: (UserTool.appProveider.second >= 60 + child: (UserTool.appProvider.second >= 60 ? '重新发送验证码' - : '${UserTool.appProveider.second}秒后可重新发送') + : '${UserTool.appProvider.second}秒后可重新发送') .text .size(28.sp) .color(Color(0xFF5096F1)) diff --git a/lib/pages/sign/login/forgot_psd_page.dart b/lib/pages/sign/login/forgot_psd_page.dart index 6f0f1f66..69035b6b 100644 --- a/lib/pages/sign/login/forgot_psd_page.dart +++ b/lib/pages/sign/login/forgot_psd_page.dart @@ -1,16 +1,15 @@ -import 'package:flutter/material.dart'; - +import 'package:aku_new_community/pages/sign/login/forgot_set_psd_page.dart'; +import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; +import 'package:aku_new_community/pages/sign/widget/tel_text_field.dart'; +import 'package:aku_new_community/widget/bee_scaffold.dart'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:common_utils/common_utils.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'; -import 'package:aku_new_community/pages/sign/login/forgot_set_psd_page.dart'; -import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; -import 'package:aku_new_community/pages/sign/widget/tel_text_field.dart'; -import 'package:aku_new_community/widget/bee_scaffold.dart'; -import 'package:aku_new_community/widget/others/user_tool.dart'; import '../sign_func.dart'; class ForgotPsdPage extends StatefulWidget { @@ -74,13 +73,13 @@ class _ForgotPsdPageState extends State { } var base = await SignFunc.sendForgotMessageCode( _telController.text, - UserTool.appProveider.pickedCityAndCommunity! + UserTool.appProvider.pickedCityAndCommunity! .communityModel!.id); if (base.success) { Get.to(() => ForgotSetPsdPage( tel: _telController.text, )); - UserTool.appProveider.startTimer(); + UserTool.appProvider.startTimer(); } else { BotToast.showText(text: base.msg); } diff --git a/lib/pages/sign/login/forgot_set_psd_page.dart b/lib/pages/sign/login/forgot_set_psd_page.dart index 6407529b..dc849f0b 100644 --- a/lib/pages/sign/login/forgot_set_psd_page.dart +++ b/lib/pages/sign/login/forgot_set_psd_page.dart @@ -1,17 +1,16 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:velocity_x/velocity_x.dart'; - import 'package:aku_new_community/pages/sign/login/psd_verify.dart'; import 'package:aku_new_community/pages/sign/sign_func.dart'; import 'package:aku_new_community/pages/sign/widget/login_button_widget.dart'; import 'package:aku_new_community/pages/sign/widget/psd_text_field.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:velocity_x/velocity_x.dart'; + import 'login_page.dart'; class ForgotSetPsdPage extends StatefulWidget { @@ -125,13 +124,13 @@ class _ForgotSetPsdPageState extends State { onTap: () async { var base = await SignFunc.sendMessageCode( widget.tel, - UserTool.appProveider.pickedCityAndCommunity! + UserTool.appProvider.pickedCityAndCommunity! .communityModel!.id); if (base.success) { Get.to(() => ForgotSetPsdPage( tel: widget.tel, )); - UserTool.appProveider.startTimer(); + UserTool.appProvider.startTimer(); } else { BotToast.showText(text: base.msg); } @@ -139,7 +138,7 @@ class _ForgotSetPsdPageState extends State { child: Row( mainAxisSize: MainAxisSize.min, children: [ - '|${UserTool.appProveider.second < 60 ? '${UserTool.appProveider.second}秒后重新获取' : '获取验证码'}' + '|${UserTool.appProvider.second < 60 ? '${UserTool.appProvider.second}秒后重新获取' : '获取验证码'}' .text .size(28.sp) .color(Color(0xFF5096F1)) diff --git a/lib/pages/sign/login/other_login_page.dart b/lib/pages/sign/login/other_login_page.dart index 90aef95f..0d173534 100644 --- a/lib/pages/sign/login/other_login_page.dart +++ b/lib/pages/sign/login/other_login_page.dart @@ -102,7 +102,7 @@ class _OtherLoginPageState extends State { _tel.text, _psd.text, UserTool - .appProveider.pickedCityAndCommunity!.communityModel!.id); + .appProvider.pickedCityAndCommunity!.communityModel!.id); if (response.data['success']) { await UserTool.userProvider.setLogin(response.data['data']); await UserTool.dataProvider.addHistories(); @@ -127,7 +127,7 @@ class _OtherLoginPageState extends State { BotToast.showText(text: '请输入正确的手机号!'); return false; } - if (UserTool.appProveider.pickedCityAndCommunity == null) { + if (UserTool.appProvider.pickedCityAndCommunity == null) { BotToast.showText(text: '请先选择小区!'); return false; } @@ -151,7 +151,7 @@ class _OtherLoginPageState extends State { TelTextField(controller: _tel), 100.w.heightBox, LoginButtonWidget( - onTap: UserTool.appProveider.second < 60 + onTap: UserTool.appProvider.second < 60 ? () {} : () async { var check = checkInput(); @@ -160,7 +160,7 @@ class _OtherLoginPageState extends State { } var base = await SignFunc.sendMessageCode( _tel.text, - UserTool.appProveider.pickedCityAndCommunity! + UserTool.appProvider.pickedCityAndCommunity! .communityModel!.id); if (base.success) { Get.to(() => CodeMessagePage(tel: _tel.text)); diff --git a/lib/pages/sign/login/select_community_page.dart b/lib/pages/sign/login/select_community_page.dart index 501b4771..2dde58ab 100644 --- a/lib/pages/sign/login/select_community_page.dart +++ b/lib/pages/sign/login/select_community_page.dart @@ -1,11 +1,3 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:bot_toast/bot_toast.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:velocity_x/velocity_x.dart'; - -import 'package:aku_new_community/constants/api.dart'; import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/models/login/community_model.dart'; import 'package:aku_new_community/models/login/history_login_model.dart'; @@ -14,6 +6,11 @@ import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/bee_city_picker.dart'; import 'package:aku_new_community/widget/picker/bee_community_picker.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; class SelectCommunity extends StatefulWidget { const SelectCommunity({ @@ -26,7 +23,7 @@ class SelectCommunity extends StatefulWidget { class _SelectCommunityState extends State { String get cityName { - var _model = UserTool.appProveider.pickedCityAndCommunity; + var _model = UserTool.appProvider.pickedCityAndCommunity; if (_model == null) { return '请选择省、市、县/区'; } else { @@ -38,7 +35,7 @@ class _SelectCommunityState extends State { String get communityName { var _community = - UserTool.appProveider.pickedCityAndCommunity?.communityModel; + UserTool.appProvider.pickedCityAndCommunity?.communityModel; if (_community == null) { return '请选择小区'; } else { @@ -54,10 +51,9 @@ class _SelectCommunityState extends State { @override void deactivate() { Future.delayed(Duration(milliseconds: 0), () async { - if (UserTool.appProveider.pickedCityAndCommunity != null && - UserTool.appProveider.pickedCityAndCommunity?.communityModel == - null) { - UserTool.appProveider.resetPickedCity(); + if (UserTool.appProvider.pickedCityAndCommunity != null && + UserTool.appProvider.pickedCityAndCommunity?.communityModel == null) { + UserTool.appProvider.resetPickedCity(); } }); super.deactivate(); @@ -69,7 +65,7 @@ class _SelectCommunityState extends State { onTap: () async { var _city = await BeeCityPicker.pick(context); if (_city != null) { - UserTool.appProveider.setPickedCity(city: _city); + UserTool.appProvider.setPickedCity(city: _city); } setState(() {}); }, @@ -98,7 +94,7 @@ class _SelectCommunityState extends State { List _communities = []; var base = await NetUtil().get(SAASAPI.login.allCommunity, params: { 'cityId': UserTool - .appProveider.pickedCityAndCommunity!.cityModel.district.id, + .appProvider.pickedCityAndCommunity!.cityModel.district.id, }); if (base.success) { _communities = (base.data as List) @@ -109,7 +105,7 @@ class _SelectCommunityState extends State { var _community = await BeeCommunityPicker.pick(context, _communities); print(_community?.name); if (_community != null) { - UserTool.appProveider.setPickedCity(community: _community); + UserTool.appProvider.setPickedCity(community: _community); } setState(() {}); }, @@ -152,9 +148,8 @@ class _SelectCommunityState extends State { ); return WillPopScope( onWillPop: () async { - var bool = UserTool.appProveider.pickedCityAndCommunity != null && - UserTool.appProveider.pickedCityAndCommunity?.communityModel == - null; + var bool = UserTool.appProvider.pickedCityAndCommunity != null && + UserTool.appProvider.pickedCityAndCommunity?.communityModel == null; if (bool) { BotToast.showText(text: '请选择小区'); return false; diff --git a/lib/pages/sign/sign_func.dart b/lib/pages/sign/sign_func.dart index b0e46cca..0f1836d8 100644 --- a/lib/pages/sign/sign_func.dart +++ b/lib/pages/sign/sign_func.dart @@ -146,7 +146,7 @@ class SignFunc { 'tel': tel, 'telCode': telcode, 'communityId': - UserTool.appProveider.pickedCityAndCommunity!.communityModel!.id + UserTool.appProvider.pickedCityAndCommunity!.communityModel!.id }, showMessage: true); if (baseModel.data == null || !baseModel.success) return false; diff --git a/lib/pages/splash/splash_page.dart b/lib/pages/splash/splash_page.dart index 291eae87..5c182fca 100644 --- a/lib/pages/splash/splash_page.dart +++ b/lib/pages/splash/splash_page.dart @@ -9,6 +9,7 @@ import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:amap_flutter_location/amap_flutter_location.dart'; +import 'package:equatable/equatable.dart'; // import 'package:amap_search_fluttify/amap_search_fluttify.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/gestures.dart'; @@ -108,13 +109,14 @@ class _SplashPageState extends State { await Permission.locationWhenInUse.request(); } //第三方加载 + EquatableConfig.stringify = true; AMapFlutterLocation.updatePrivacyShow(true, true); AMapFlutterLocation.updatePrivacyAgree(true); MainInitialize.initTheme(); MainInitialize.initWechat(); MainInitialize.initWebSocket(); - UserTool.appProveider.startLocation(); - UserTool.appProveider.initApplications(); + UserTool.appProvider.startLocation(); + UserTool.appProvider.initApplications(); //获取城市列表等信息 await UserTool.dataProvider.init(); //从本地获取是否登录记录 diff --git a/lib/provider/app_provider.dart b/lib/provider/app_provider.dart index b454104a..293d3c74 100644 --- a/lib/provider/app_provider.dart +++ b/lib/provider/app_provider.dart @@ -330,6 +330,7 @@ class AppProvider extends ChangeNotifier { notifyListeners(); } + ///记录历史登录信息 HistoryLoginModel? _pickedCityAndCommunity; HistoryLoginModel? get pickedCityAndCommunity => _pickedCityAndCommunity; diff --git a/lib/provider/data_provider.dart b/lib/provider/data_provider.dart index 7a973901..987eda48 100644 --- a/lib/provider/data_provider.dart +++ b/lib/provider/data_provider.dart @@ -43,7 +43,7 @@ class DataProvider extends ChangeNotifier { List get loginHistories => _loginHistories; Future addHistories() async { - _loginHistories.insert(0, UserTool.appProveider.pickedCityAndCommunity!); + _loginHistories.insert(0, UserTool.appProvider.pickedCityAndCommunity!); if (_loginHistories.length > 4) { _loginHistories.removeAt(_loginHistories.length - 1); } diff --git a/lib/ui/function_and_service/task/location_view.dart b/lib/ui/function_and_service/task/location_view.dart index c07ffb1e..d242753b 100644 --- a/lib/ui/function_and_service/task/location_view.dart +++ b/lib/ui/function_and_service/task/location_view.dart @@ -27,8 +27,8 @@ class _LocationViewState extends State { await Permission.locationWhenInUse.request(); } _target = LatLng( - (UserTool.appProveider.location?['latitude'] ?? 0) as double, - (UserTool.appProveider.location?['longitude'] ?? 0) as double, + (UserTool.appProvider.location?['latitude'] ?? 0) as double, + (UserTool.appProvider.location?['longitude'] ?? 0) as double, ); // poiList = await search.AmapSearch.instance.searchAround(search.LatLng( // (UserTool.appProveider.location?['latitude'] ?? 0) as double, diff --git a/lib/ui/manager/house_keeping/add_house_keeping_page.dart b/lib/ui/manager/house_keeping/add_house_keeping_page.dart index 9b89461d..f78e2d2a 100644 --- a/lib/ui/manager/house_keeping/add_house_keeping_page.dart +++ b/lib/ui/manager/house_keeping/add_house_keeping_page.dart @@ -65,7 +65,7 @@ class _AddHouseKeepingPageState extends State { List urls = await NetUtil() .uploadFiles(_files, API.upload.uploadHouseKeepingPhotos); bool result = await HouseKeepingFunc.submitHouseKeeping( - UserTool.appProveider.selectedHouse!.estateId, + UserTool.appProvider.selectedHouse!.estateId, _selectType! + 1, _editingController.text, urls); diff --git a/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart b/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart index e16089f1..859ab06c 100644 --- a/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart +++ b/lib/ui/profile/house/contract_stop/upload_empty_list_page.dart @@ -1,15 +1,5 @@ import 'dart:io'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:open_file/open_file.dart'; -import 'package:velocity_x/velocity_x.dart'; - import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/ui/profile/house/house_func.dart'; @@ -21,6 +11,14 @@ import 'package:aku_new_community/widget/others/upload_widget.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/picker/bee_date_picker.dart'; import 'package:aku_new_community/widget/views/doc_view.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:open_file/open_file.dart'; +import 'package:velocity_x/velocity_x.dart'; class UploadEmptyListPage extends StatefulWidget { UploadEmptyListPage({Key? key}) : super(key: key); @@ -33,7 +31,7 @@ class _UploadEmptyListPageState extends State { List _files = []; List _urls = []; - int get sysLeaseId => UserTool.appProveider.selectedHouse!.sysLeaseId ?? 0; + int get sysLeaseId => UserTool.appProvider.selectedHouse!.sysLeaseId ?? 0; DateTime? _date = DateTime.now(); @override diff --git a/lib/ui/profile/house/house_owners_page.dart b/lib/ui/profile/house/house_owners_page.dart index 474dea76..d1b195b8 100644 --- a/lib/ui/profile/house/house_owners_page.dart +++ b/lib/ui/profile/house/house_owners_page.dart @@ -1,13 +1,3 @@ -import 'package:flutter/material.dart'; - -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:flutter_easyrefresh/easy_refresh.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; -import 'package:provider/provider.dart'; - import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/const/resource.dart'; import 'package:aku_new_community/models/house/lease_detail_model.dart'; @@ -26,6 +16,14 @@ import 'package:aku_new_community/ui/profile/house/my_house_list.dart'; import 'package:aku_new_community/utils/headers.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.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:power_logger/power_logger.dart'; +import 'package:provider/provider.dart'; class HouseOwnersPage extends StatefulWidget { final int identify; @@ -45,11 +43,11 @@ class _HouseOwnersPageState extends State { } int get currentSysLeaseId { - if (UserTool.appProveider.selectedHouse!.sysLeaseId == null) { + if (UserTool.appProvider.selectedHouse!.sysLeaseId == null) { BotToast.showText(text: '无租赁合同!请先签订租赁合同'); return -1; } - return UserTool.appProveider.selectedHouse!.sysLeaseId!; + return UserTool.appProvider.selectedHouse!.sysLeaseId!; } ///存在已认证的房屋 @@ -109,7 +107,7 @@ class _HouseOwnersPageState extends State { Function cancel = BotToast.showLoading(); try { await UserTool.userProvider.updateMyHouseInfo(); - UserTool.appProveider.updateHouses(await HouseFunc.passedHouses); + UserTool.appProvider.updateHouses(await HouseFunc.passedHouses); } catch (e) { LoggerData.addData(e); } diff --git a/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart b/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart index 9a9796ed..be9f5403 100644 --- a/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart +++ b/lib/ui/profile/house/lease_pay_query/lease_pay_query_detail_page.dart @@ -1,13 +1,5 @@ -import 'package:flutter/material.dart'; - -import 'package:bot_toast/bot_toast.dart'; -import 'package:common_utils/common_utils.dart'; -import 'package:get/get.dart'; -import 'package:power_logger/power_logger.dart'; - import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/api.dart'; -import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/models/house/lease_fee_list_model.dart'; import 'package:aku_new_community/pages/life_pay/pay_finish_page.dart'; import 'package:aku_new_community/pages/life_pay/pay_util.dart'; @@ -17,6 +9,11 @@ import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/buttons/bottom_button.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; +import 'package:bot_toast/bot_toast.dart'; +import 'package:common_utils/common_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; class LeasePayQueryDetailPage extends StatefulWidget { final LeaseFeeListModel model; @@ -62,7 +59,7 @@ class _LeasePayQueryDetailPageState extends State { bool result = false; try { String code = await HouseFunc().leaseRentBillOrder( - UserTool.appProveider.selectedHouse!.sysLeaseId!, + UserTool.appProvider.selectedHouse!.sysLeaseId!, 1, //写死为支付宝 widget.model.price.toDouble()); result = await PayUtil() @@ -133,7 +130,7 @@ class _LeasePayQueryDetailPageState extends State { children: [ '对应房屋'.text.size(28.sp).color(ktextSubColor).make(), Spacer(), - '${S.of(context)!.tempPlotName}·${UserTool.appProveider.selectedHouse!.roomName}' + '${S.of(context)!.tempPlotName}·${UserTool.appProvider.selectedHouse!.roomName}' .text .size(28.sp) .black diff --git a/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart b/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart index 7ad707ef..4759985d 100644 --- a/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart +++ b/lib/ui/profile/house/lease_pay_query/lease_pay_query_page.dart @@ -186,7 +186,7 @@ class _LeasePayQueryPageState extends State { children: [ model.typeString.text.size(28.sp).black.bold.make(), Spacer(), - '${S.of(context)!.tempPlotName} ${UserTool.appProveider.selectedHouse!.roomName}' + '${S.of(context)!.tempPlotName} ${UserTool.appProvider.selectedHouse!.roomName}' .text .size(24.sp) .color(ktextSubColor) diff --git a/lib/utils/websocket/web_socket_util.dart b/lib/utils/websocket/web_socket_util.dart index efad391a..cbc0ec35 100644 --- a/lib/utils/websocket/web_socket_util.dart +++ b/lib/utils/websocket/web_socket_util.dart @@ -1,12 +1,11 @@ import 'dart:async'; +import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:bot_toast/bot_toast.dart'; import 'package:power_logger/power_logger.dart'; import 'package:web_socket_channel/io.dart'; import 'package:web_socket_channel/web_socket_channel.dart'; -import 'package:aku_new_community/widget/others/user_tool.dart'; - const String baseUri = 'wss://shop.kaidalai.cn/websocket/app'; enum SOCKETSTATUS { CONNECTED, //已连接 @@ -108,7 +107,7 @@ class WebSocketUtil { } WebSocketUtil().setPrintHeart(true); - UserTool.appProveider.setFireAlert(true); + UserTool.appProvider.setFireAlert(true); } //接收消息回调 @@ -183,7 +182,7 @@ class WebSocketUtil { } endReconnect(); destoryHeart(); - UserTool.appProveider.setFireAlert(false); + UserTool.appProvider.setFireAlert(false); _socketStatus = SOCKETSTATUS.CLOSED; } diff --git a/lib/widget/others/user_tool.dart b/lib/widget/others/user_tool.dart index 9ea60065..821a7296 100644 --- a/lib/widget/others/user_tool.dart +++ b/lib/widget/others/user_tool.dart @@ -1,15 +1,14 @@ -import 'package:get/get.dart'; -import 'package:provider/provider.dart'; - import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/provider/data_provider.dart'; import 'package:aku_new_community/provider/user_provider.dart'; +import 'package:get/get.dart'; +import 'package:provider/provider.dart'; class UserTool { static UserProvider get userProvider => Provider.of(Get.context!, listen: false); - static AppProvider get appProveider => + static AppProvider get appProvider => Provider.of(Get.context!, listen: false); static DataProvider get dataProvider => Provider.of(Get.context!, listen: false);