# Conflicts:
#	lib/new_ui/new_home/application_util.dart
#	lib/new_ui/work_order/work_order_func.dart
#	pubspec.lock
master
张萌 3 years ago
commit ee87661707

@ -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. -->
<application android:name="io.flutter.app.FlutterApplication" android:label="小蜜蜂管家"
<application android:label="小蜜蜂管家"
android:icon="@mipmap/ic_launcher" android:usesCleartextTraffic="true">
<service android:name="com.amap.api.location.APSService"/>
<meta-data android:name="com.amap.api.v2.apikey" android:value="0c11d9ba47089d971dc4d889b66593ab"/>

@ -5,7 +5,7 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>小蜜蜂管家</string>
<string>小蜜蜂管家</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>

@ -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);
}

@ -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<OtherLoginPage> {
PageController _controller = PageController();
List<String> _tabs = ['账号登录', '验证码登录'];
List<String> _tabs = ['验证码登录', '账号登录'];
int _currentIndex = 0;
TextEditingController _tel = TextEditingController();
TextEditingController _psd = TextEditingController();
@ -66,7 +67,7 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
Flexible(
child: PageView(
controller: _controller,
children: [_accountView(), _verificationView()],
children: [_verificationView(), _accountView()],
),
),
BottomTip(),
@ -102,17 +103,22 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
return;
}
var cancel = BotToast.showLoading();
try {
var response = await SignFunc.login(
_tel.text,
_psd.text,
UserTool
.appProvider.pickedCityAndCommunity!.communityModel!.id);
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();
},
text: '登录'),
@ -135,7 +141,7 @@ class _OtherLoginPageState extends State<OtherLoginPage> {
BotToast.showText(text: '请先选择小区!');
return false;
}
if (_currentIndex == 0 && _psd.text.isEmpty) {
if (_currentIndex == 1 && _psd.text.isEmpty) {
BotToast.showText(text: '密码不能为空');
return false;
}

@ -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<SelectCommunity> {
},
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,7 +194,15 @@ class _SelectCommunityState extends State<SelectCommunity> {
}
Widget _historyTile(HistoryLoginModel model) {
return Container(
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: [
@ -189,6 +219,8 @@ class _SelectCommunityState extends State<SelectCommunity> {
.make(),
],
),
),
),
);
}
}

@ -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';

@ -43,10 +43,13 @@ class DataProvider extends ChangeNotifier {
List<HistoryLoginModel> get loginHistories => _loginHistories;
Future addHistories() async {
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);
}
}
}

@ -88,7 +88,7 @@ class _BeeCityPickerState extends State<BeeCityPicker> {
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<BeeCityPicker> {
),
Expanded(
child: CupertinoPicker(
itemExtent: 60.w,
itemExtent: 80.w,
magnification: 1.0,
looping: true,
scrollController: _cityController,
@ -131,7 +131,7 @@ class _BeeCityPickerState extends State<BeeCityPicker> {
),
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<BeeCityPicker> {
: 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),
),
))

Loading…
Cancel
Save