diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 49e68d3..fbdea2e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -4,7 +4,7 @@ In most cases you can leave this as-is, but you if you want to provide additional functionality it is fine to subclass or reimplement FlutterApplication and put your custom class here. --> - diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 5726c33..89ddd00 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -5,7 +5,7 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName - 小蜜蜂管家端 + 小蜜蜂管家 CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier diff --git a/lib/extensions/num_ext.dart b/lib/extensions/num_ext.dart new file mode 100644 index 0000000..e3157dc --- /dev/null +++ b/lib/extensions/num_ext.dart @@ -0,0 +1,9 @@ +import 'package:flutter/material.dart'; + +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +extension NumExt on num { + Widget get wb => SizedBox(width: this.w); + + Widget get hb => SizedBox(height: this.w); +} diff --git a/lib/new_ui/auth/other_login_page.dart b/lib/new_ui/auth/other_login_page.dart index 27bf7f1..2d29aac 100644 --- a/lib/new_ui/auth/other_login_page.dart +++ b/lib/new_ui/auth/other_login_page.dart @@ -10,6 +10,7 @@ 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:power_logger/power_logger.dart'; import 'package:provider/provider.dart'; import 'package:velocity_x/velocity_x.dart'; @@ -26,7 +27,7 @@ class OtherLoginPage extends StatefulWidget { class _OtherLoginPageState extends State { PageController _controller = PageController(); - List _tabs = ['账号登录', '验证码登录']; + List _tabs = ['验证码登录', '账号登录']; int _currentIndex = 0; TextEditingController _tel = TextEditingController(); TextEditingController _psd = TextEditingController(); @@ -66,7 +67,7 @@ class _OtherLoginPageState extends State { Flexible( child: PageView( controller: _controller, - children: [_accountView(), _verificationView()], + children: [_verificationView(), _accountView()], ), ), BottomTip(), @@ -102,16 +103,21 @@ class _OtherLoginPageState extends State { return; } var cancel = BotToast.showLoading(); - var response = await SignFunc.login( - _tel.text, - _psd.text, - UserTool - .appProvider.pickedCityAndCommunity!.communityModel!.id); - if (response.data['success']) { - await UserTool.userProvider.setLogin(response.data['data']); - await UserTool.dataProvider.addHistories(); - } else { - BotToast.showText(text: response.data['msg']); + try { + var response = await SignFunc.login( + _tel.text, + _psd.text, + UserTool.appProvider.pickedCityAndCommunity!.communityModel! + .id); + if (response.data['success']) { + await UserTool.userProvider.setLogin(response.data['data']); + await UserTool.dataProvider.addHistories(); + } else { + BotToast.showText(text: response.data['msg']); + } + } catch (e) { + print(e.toString()); + LoggerData.addData(e.toString()); } cancel(); }, @@ -135,7 +141,7 @@ class _OtherLoginPageState extends State { BotToast.showText(text: '请先选择小区!'); return false; } - if (_currentIndex == 0 && _psd.text.isEmpty) { + if (_currentIndex == 1 && _psd.text.isEmpty) { BotToast.showText(text: '密码不能为空'); return false; } diff --git a/lib/new_ui/auth/select_community_page.dart b/lib/new_ui/auth/select_community_page.dart index ce24d33..5f835c7 100644 --- a/lib/new_ui/auth/select_community_page.dart +++ b/lib/new_ui/auth/select_community_page.dart @@ -1,4 +1,5 @@ import 'package:aku_new_community_manager/const/saas_api.dart'; +import 'package:aku_new_community_manager/extensions/num_ext.dart'; import 'package:aku_new_community_manager/saas_models/login/community_model.dart'; import 'package:aku_new_community_manager/saas_models/login/history_login_model.dart'; import 'package:aku_new_community_manager/tools/user_tool.dart'; @@ -12,6 +13,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:velocity_x/velocity_x.dart'; +import '../../style/app_style.dart'; + class SelectCommunity extends StatefulWidget { const SelectCommunity({ Key? key, @@ -159,6 +162,25 @@ class _SelectCommunityState extends State { }, child: AkuScaffold( title: '选择登录小区', + actions: [ + Hero( + tag: 'event_add', + child: MaterialButton( + elevation: 0, + minWidth: 116.w, + padding: EdgeInsets.zero, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(4.w), + ), + color: kPrimaryColor, + onPressed: () { + Navigator.pop(context); + }, + child: '提交'.text.size(34.sp).make(), + ).centered(), + ), + 32.wb + ], body: ListView( children: [ selectCity, @@ -172,22 +194,32 @@ class _SelectCommunityState extends State { } Widget _historyTile(HistoryLoginModel model) { - return Container( - padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), - child: Row( - children: [ - Icon( - CupertinoIcons.search, - size: 30.w, - color: Colors.black.withOpacity(0.2), + return GestureDetector( + onTap: () { + UserTool.appProvider.setPickedCity( + city: model.cityModel, community: model.communityModel); + setState(() {}); + }, + child: Material( + color: Colors.transparent, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + child: Row( + children: [ + Icon( + CupertinoIcons.search, + size: 30.w, + color: Colors.black.withOpacity(0.2), + ), + 24.w.widthBox, + '${model.communityModel!.name}(${model.cityModel.province.name}·${model.cityModel.city.name}·${model.cityModel.district.name})' + .text + .size(28.sp) + .color(Colors.black.withOpacity(0.2)) + .make(), + ], ), - 24.w.widthBox, - '${model.communityModel!.name}(${model.cityModel.province.name}·${model.cityModel.city.name}·${model.cityModel.district.name})' - .text - .size(28.sp) - .color(Colors.black.withOpacity(0.2)) - .make(), - ], + ), ), ); } diff --git a/lib/new_ui/work_order/work_order_func.dart b/lib/new_ui/work_order/work_order_func.dart index 027082e..d949eb9 100644 --- a/lib/new_ui/work_order/work_order_func.dart +++ b/lib/new_ui/work_order/work_order_func.dart @@ -7,7 +7,7 @@ import 'package:aku_new_community_manager/saas_models/work_order/work_order_prog import 'package:aku_new_community_manager/saas_models/work_order/work_order_submit_model.dart'; import 'package:aku_new_community_manager/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.dart'; import 'package:get/get_navigation/src/extension_navigation.dart'; import 'dialog/work_order_bill_dialog.dart'; diff --git a/lib/provider/data_provider.dart b/lib/provider/data_provider.dart index d9a6a3d..9de2835 100644 --- a/lib/provider/data_provider.dart +++ b/lib/provider/data_provider.dart @@ -43,10 +43,13 @@ class DataProvider extends ChangeNotifier { List get loginHistories => _loginHistories; Future addHistories() async { - _loginHistories.insert(0, UserTool.appProvider.pickedCityAndCommunity!); - if (_loginHistories.length > 4) { - _loginHistories.removeAt(_loginHistories.length - 1); + if (!_loginHistories + .contains(UserTool.appProvider.pickedCityAndCommunity!)) { + _loginHistories.insert(0, UserTool.appProvider.pickedCityAndCommunity!); + if (_loginHistories.length > 4) { + _loginHistories.removeAt(_loginHistories.length - 1); + } + HiveStore.dataBox!.put('historyLogin', _loginHistories); } - HiveStore.dataBox!.put('historyLogin', _loginHistories); } } diff --git a/lib/ui/widgets/common/bee_city_picker.dart b/lib/ui/widgets/common/bee_city_picker.dart index 3b91e30..329e1bf 100644 --- a/lib/ui/widgets/common/bee_city_picker.dart +++ b/lib/ui/widgets/common/bee_city_picker.dart @@ -88,7 +88,7 @@ class _BeeCityPickerState extends State { children: [ Expanded( child: CupertinoPicker( - itemExtent: 60.w, + itemExtent: 80.w, magnification: 1.0, // offAxisFraction: -0.6, looping: true, @@ -110,7 +110,7 @@ class _BeeCityPickerState extends State { ), Expanded( child: CupertinoPicker( - itemExtent: 60.w, + itemExtent: 80.w, magnification: 1.0, looping: true, scrollController: _cityController, @@ -131,7 +131,7 @@ class _BeeCityPickerState extends State { ), Expanded( child: CupertinoPicker( - itemExtent: 60.w, + itemExtent: 80.w, magnification: 1.0, // offAxisFraction: 0.6, looping: true, @@ -145,7 +145,10 @@ class _BeeCityPickerState extends State { : districts .map((e) => Center( child: Padding( - padding: EdgeInsets.only(left: 20.w, right: 20.w), + padding: EdgeInsets.only(left: 20.w, + right: 20.w, + top: 10.w, + bottom: 10.w), child: Text(e.name, textAlign: TextAlign.center), ), ))