Commit 5be2fea0b6bffafe2ea439d1ce771a18f9d256c2

Authored by wdn127929
1 parent 7ce04b7a

f

@@ -12,14 +12,14 @@ if (flutterRoot == null) { @@ -12,14 +12,14 @@ if (flutterRoot == null) {
12 } 12 }
13 13
14 14
15 -def flutterVersionCode = "356" 15 +def flutterVersionCode = "358"
16 if (flutterVersionCode == null) { 16 if (flutterVersionCode == null) {
17 - flutterVersionCode = '356' 17 + flutterVersionCode = '358'
18 } 18 }
19 19
20 -def flutterVersionName = "3.5.6" 20 +def flutterVersionName = "3.5.8"
21 if (flutterVersionName == null) { 21 if (flutterVersionName == null) {
22 - flutterVersionName = '3.5.6' 22 + flutterVersionName = '3.5.8'
23 } 23 }
24 apply plugin: 'com.android.application' 24 apply plugin: 'com.android.application'
25 apply plugin: 'kotlin-android' 25 apply plugin: 'kotlin-android'
@@ -89,11 +89,11 @@ android { @@ -89,11 +89,11 @@ android {
89 signingConfig signingConfigs.release 89 signingConfig signingConfigs.release
90 } 90 }
91 debug{ 91 debug{
92 - minifyEnabled true 92 + minifyEnabled false
93 // TODO: Add your own signing config for the release build. 93 // TODO: Add your own signing config for the release build.
94 // Signing with the debug keys for now, so `flutter run --release` works. 94 // Signing with the debug keys for now, so `flutter run --release` works.
95 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 95 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
96 - signingConfig signingConfigs.release 96 + // signingConfig signingConfigs.release
97 } 97 }
98 } 98 }
99 } 99 }
@@ -60,12 +60,13 @@ Future<void> main() async { @@ -60,12 +60,13 @@ Future<void> main() async {
60 // FlutterBugly.postCatchedException(() async { 60 // FlutterBugly.postCatchedException(() async {
61 WidgetsFlutterBinding.ensureInitialized(); 61 WidgetsFlutterBinding.ensureInitialized();
62 // _requestPermissions(); 62 // _requestPermissions();
63 - Utils.changeStatusColor();  
64 - await App.initSp(); 63 + // Utils.changeStatusColor();
  64 + // await App.initSp();
65 // App.setupLocator(); 65 // App.setupLocator();
66 FluroRouter router = FluroRouter(); 66 FluroRouter router = FluroRouter();
67 Routes.configureRoutes(router); 67 Routes.configureRoutes(router);
68 App.router = router; 68 App.router = router;
  69 + await App.initSp();
69 70
70 SystemChrome.setPreferredOrientations( 71 SystemChrome.setPreferredOrientations(
71 [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]).then((_) { 72 [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]).then((_) {
@@ -134,10 +135,7 @@ class MyAppState extends State<MyApp> { @@ -134,10 +135,7 @@ class MyAppState extends State<MyApp> {
134 super.initState(); 135 super.initState();
135 136
136 _isFirst(); 137 _isFirst();
137 - Utils.changeStatusColor();  
138 - // 设置EasyRefresh的默认样式  
139 - EasyRefresh.defaultHeader = MaterialHeader();  
140 - EasyRefresh.defaultFooter = BallPulseFooter(); 138 + // Utils.changeStatusColor();
141 } 139 }
142 140
143 //初始化微信SDK 141 //初始化微信SDK
@@ -156,6 +154,20 @@ class MyAppState extends State<MyApp> { @@ -156,6 +154,20 @@ class MyAppState extends State<MyApp> {
156 LogUtil.v("is installed $result"); 154 LogUtil.v("is installed $result");
157 } 155 }
158 156
  157 + _ontherInit() async {
  158 + initDio();
  159 + await _initFluwx();
  160 + LogUtil.init(isDebug: true, tag: 'ONE_KEY');
  161 + Provider.debugCheckInvalidValueType = null;
  162 + await initializeDateFormatting();
  163 +
  164 + // 设置EasyRefresh的默认样式
  165 + EasyRefresh.defaultHeader = MaterialHeader();
  166 + EasyRefresh.defaultFooter = BallPulseFooter();
  167 + _isLogin();
  168 + // FlutterBugly.init(androidAppId: "f71a313f42", iOSAppId: "3089e4587e");
  169 + }
  170 +
159 //初始化dio 171 //初始化dio
160 initDio() { 172 initDio() {
161 DioUtil.openDebug(); 173 DioUtil.openDebug();
@@ -164,14 +176,15 @@ class MyAppState extends State<MyApp> { @@ -164,14 +176,15 @@ class MyAppState extends State<MyApp> {
164 HttpConfig config = new HttpConfig( 176 HttpConfig config = new HttpConfig(
165 options: options, status: "ret", code: "ret", msg: "msg", data: "data"); 177 options: options, status: "ret", code: "ret", msg: "msg", data: "data");
166 DioUtil().setConfig(config); 178 DioUtil().setConfig(config);
  179 + _initAmap();
167 } 180 }
168 181
169 //第一次打开应用 182 //第一次打开应用
170 _isFirst() async { 183 _isFirst() async {
171 isFirst = App.sp.getBool("isFirst") ?? true; 184 isFirst = App.sp.getBool("isFirst") ?? true;
  185 +
172 if (!isFirst) { 186 if (!isFirst) {
173 - _isLogin();  
174 - initDio(); 187 + await _ontherInit();
175 } 188 }
176 } 189 }
177 190
@@ -180,13 +193,12 @@ class MyAppState extends State<MyApp> { @@ -180,13 +193,12 @@ class MyAppState extends State<MyApp> {
180 UserModel userModel = Provider.of<UserModel>(context, listen: false); 193 UserModel userModel = Provider.of<UserModel>(context, listen: false);
181 userModel.initUser(); 194 userModel.initUser();
182 isLogin = App.sp.getBool("isLogin") ?? false; 195 isLogin = App.sp.getBool("isLogin") ?? false;
183 - if (isLogin) {  
184 - LogUtil.init(isDebug: true, tag: 'ONE_KEY');  
185 - Provider.debugCheckInvalidValueType = null;  
186 - await initializeDateFormatting(); 196 + }
187 197
188 - _initFluwx();  
189 - } 198 + _initAmap() async {
  199 + await AmapService.instance.init(
  200 + iosKey: 'e373581528f8fd901c01dfbda236159e',
  201 + androidKey: 'dbced781d0acd36184d5b4b54da7188d');
190 } 202 }
191 203
192 @override 204 @override
@@ -68,9 +68,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -68,9 +68,7 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
68 // TODO: implement initState 68 // TODO: implement initState
69 super.initState(); 69 super.initState();
70 LogUtil.v("home_initState"); 70 LogUtil.v("home_initState");
71 - // FlutterBugly.init(androidAppId: "f71a313f42", iOSAppId: "3089e4587e");  
72 - _initAmap();  
73 - 71 +
74 AzhonAppUpdate.listener( 72 AzhonAppUpdate.listener(
75 // () { 73 // () {
76 // needUpdate = false; 74 // needUpdate = false;
@@ -157,12 +155,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -157,12 +155,6 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
157 }); 155 });
158 } 156 }
159 157
160 - _initAmap() async {  
161 - await AmapService.instance.init(  
162 - iosKey: 'e373581528f8fd901c01dfbda236159e',  
163 - androidKey: 'dbced781d0acd36184d5b4b54da7188d');  
164 - }  
165 -  
166 _endTimerSeller() { 158 _endTimerSeller() {
167 if (timerSeller != null) { 159 if (timerSeller != null) {
168 timerSeller.cancel(); 160 timerSeller.cancel();
@@ -53,7 +53,7 @@ class AccountLoginPageState extends State<AccountLoginPage> @@ -53,7 +53,7 @@ class AccountLoginPageState extends State<AccountLoginPage>
53 53
54 StreamSubscription<BaseWeChatResponse> streamSubscription; 54 StreamSubscription<BaseWeChatResponse> streamSubscription;
55 OtherLoginProvider otherLoginProvider; 55 OtherLoginProvider otherLoginProvider;
56 - CreateStoreModel createStoreModel; 56 +
57 57
58 @override 58 @override
59 void initState() { 59 void initState() {
@@ -125,8 +125,7 @@ class AccountLoginPageState extends State<AccountLoginPage> @@ -125,8 +125,7 @@ class AccountLoginPageState extends State<AccountLoginPage>
125 Widget build(BuildContext context) { 125 Widget build(BuildContext context) {
126 otherLoginProvider = 126 otherLoginProvider =
127 Provider.of<OtherLoginProvider>(context, listen: false); 127 Provider.of<OtherLoginProvider>(context, listen: false);
128 - createStoreModel = Provider.of<CreateStoreModel>(context, listen: false);  
129 - 128 +
130 final double prefixIconWidth = ScreenUtil().setWidth(24); 129 final double prefixIconWidth = ScreenUtil().setWidth(24);
131 130
132 return Scaffold( 131 return Scaffold(
1 import 'dart:io'; 1 import 'dart:io';
2 2
  3 +import 'package:amap_map_fluttify/amap_map_fluttify.dart';
  4 +import 'package:common_utils/common_utils.dart';
  5 +import 'package:dio/dio.dart';
3 import 'package:flutter/material.dart'; 6 import 'package:flutter/material.dart';
  7 +import 'package:flutter_bugly/flutter_bugly.dart';
  8 +import 'package:flutter_easyrefresh/ball_pulse_footer.dart';
  9 +import 'package:flutter_easyrefresh/easy_refresh.dart';
4 import 'package:flutter_screenutil/flutter_screenutil.dart'; 10 import 'package:flutter_screenutil/flutter_screenutil.dart';
  11 +import 'package:intl/date_symbol_data_local.dart';
  12 +import 'package:fluwx/fluwx.dart';
5 import 'package:one_key/app.dart'; 13 import 'package:one_key/app.dart';
  14 +import 'package:one_key/net/dio_util.dart';
  15 +import 'package:one_key/net/http_url.dart';
6 import 'package:one_key/res/colors.dart'; 16 import 'package:one_key/res/colors.dart';
7 import 'package:one_key/route/navigator_util.dart'; 17 import 'package:one_key/route/navigator_util.dart';
8 import 'package:one_key/utils/dialog_util.dart'; 18 import 'package:one_key/utils/dialog_util.dart';
@@ -10,6 +20,7 @@ import 'package:one_key/utils/utils.dart'; @@ -10,6 +20,7 @@ import 'package:one_key/utils/utils.dart';
10 import 'package:one_key/widgets/MyDivider.dart'; 20 import 'package:one_key/widgets/MyDivider.dart';
11 import 'package:one_key/widgets/round_button.dart'; 21 import 'package:one_key/widgets/round_button.dart';
12 import 'package:one_key/widgets/v_empty_view.dart'; 22 import 'package:one_key/widgets/v_empty_view.dart';
  23 +import 'package:provider/provider.dart';
13 24
14 class FirstPage extends StatefulWidget { 25 class FirstPage extends StatefulWidget {
15 FirstPage({Key key}) : super(key: key); 26 FirstPage({Key key}) : super(key: key);
@@ -23,7 +34,56 @@ class _FirstPageState extends State<FirstPage> { @@ -23,7 +34,56 @@ class _FirstPageState extends State<FirstPage> {
23 void initState() { 34 void initState() {
24 // TODO: implement initState 35 // TODO: implement initState
25 super.initState(); 36 super.initState();
26 - Utils.changeStatusColor(color: MyColours.color_199095); 37 + // Utils.changeStatusColor(color: MyColours.color_199095);
  38 + }
  39 +
  40 + _ontherInit() async {
  41 + initDio();
  42 + await _initFluwx();
  43 + LogUtil.init(isDebug: true, tag: 'ONE_KEY');
  44 + Provider.debugCheckInvalidValueType = null;
  45 + await initializeDateFormatting();
  46 +
  47 + // 设置EasyRefresh的默认样式
  48 + EasyRefresh.defaultHeader = MaterialHeader();
  49 + EasyRefresh.defaultFooter = BallPulseFooter();
  50 + App.sp.setBool("isFirst", false);
  51 + //进入应用
  52 + NavigatorUtil.goLoginPage(context);
  53 + FlutterBugly.init(androidAppId: "f71a313f42", iOSAppId: "3089e4587e");
  54 + }
  55 +
  56 + //初始化微信SDK
  57 + _initFluwx() async {
  58 + await registerWxApi(
  59 + appId: "wx85aa3cdd0f791e65",
  60 + doOnAndroid: true,
  61 + doOnIOS: true,
  62 + universalLink: "https://xt04.colorcun.com/link/OneKey/");
  63 + var result = await isWeChatInstalled;
  64 + if (result != null && result) {
  65 + App.isInstallWx = true;
  66 + } else {
  67 + App.isInstallWx = false;
  68 + }
  69 + LogUtil.v("is installed $result");
  70 + }
  71 +
  72 +//初始化dio
  73 + initDio() {
  74 + DioUtil.openDebug();
  75 + BaseOptions options = DioUtil.getDefOptions();
  76 + options.baseUrl = HttpUrl.server_address;
  77 + HttpConfig config = new HttpConfig(
  78 + options: options, status: "ret", code: "ret", msg: "msg", data: "data");
  79 + DioUtil().setConfig(config);
  80 + _initAmap();
  81 + }
  82 +
  83 + _initAmap() async {
  84 + await AmapService.instance.init(
  85 + iosKey: 'e373581528f8fd901c01dfbda236159e',
  86 + androidKey: 'dbced781d0acd36184d5b4b54da7188d');
27 } 87 }
28 88
29 @override 89 @override
@@ -224,10 +284,8 @@ class _FirstPageState extends State<FirstPage> { @@ -224,10 +284,8 @@ class _FirstPageState extends State<FirstPage> {
224 textColor: MyColours.color_ffffff, 284 textColor: MyColours.color_ffffff,
225 gradientStart: MyColours.color_199095, 285 gradientStart: MyColours.color_199095,
226 gradientEnd: MyColours.color_199095, 286 gradientEnd: MyColours.color_199095,
227 - onPressed: () {  
228 - App.sp.setBool("isFirst", false);  
229 - //进入应用  
230 - NavigatorUtil.goLoginPage(context); 287 + onPressed: () async {
  288 + _ontherInit();
231 }), 289 }),
232 ], 290 ],
233 ), 291 ),
@@ -16,8 +16,16 @@ import 'package:one_key/models/checkbind_phone_model.dart'; @@ -16,8 +16,16 @@ import 'package:one_key/models/checkbind_phone_model.dart';
16 import 'package:one_key/models/store_info.dart'; 16 import 'package:one_key/models/store_info.dart';
17 import 'package:one_key/net/dio_util.dart'; 17 import 'package:one_key/net/dio_util.dart';
18 import 'package:one_key/net/http_url.dart'; 18 import 'package:one_key/net/http_url.dart';
  19 +import 'package:one_key/provider/coupon_provider.dart';
19 import 'package:one_key/provider/create_store_model.dart'; 20 import 'package:one_key/provider/create_store_model.dart';
  21 +import 'package:one_key/provider/customer_making_provider.dart';
  22 +import 'package:one_key/provider/message_dialog_model.dart';
  23 +import 'package:one_key/provider/message_model.dart';
  24 +import 'package:one_key/provider/notebook_detail_model.dart';
  25 +import 'package:one_key/provider/order_food_provider.dart';
20 import 'package:one_key/provider/other_login_provider.dart'; 26 import 'package:one_key/provider/other_login_provider.dart';
  27 +import 'package:one_key/provider/remark_manager_model.dart';
  28 +import 'package:one_key/provider/upload_img_provider.dart';
21 import 'package:one_key/provider/user_model.dart'; 29 import 'package:one_key/provider/user_model.dart';
22 import 'package:one_key/res/colors.dart'; 30 import 'package:one_key/res/colors.dart';
23 import 'package:one_key/route/navigate_service.dart'; 31 import 'package:one_key/route/navigate_service.dart';
@@ -67,8 +75,6 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -67,8 +75,6 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
67 // TODO: implement initState 75 // TODO: implement initState
68 super.initState(); 76 super.initState();
69 77
70 - _initFluwx();  
71 -  
72 // _initFluwx(); 78 // _initFluwx();
73 isLogin(); 79 isLogin();
74 80
@@ -167,18 +173,15 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -167,18 +173,15 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
167 NavigatorUtil.goHomePage(context); 173 NavigatorUtil.goHomePage(context);
168 }); 174 });
169 } else { 175 } else {
170 - _getWxCode(); 176 + _checkWechat();
  177 + _getWxCode();
171 } 178 }
172 } 179 }
173 180
174 ///微信登陆 181 ///微信登陆
175 182
176 _wxLogin() async { 183 _wxLogin() async {
177 - await initializeDateFormatting();  
178 sendWeChatAuth(scope: "snsapi_userinfo"); 184 sendWeChatAuth(scope: "snsapi_userinfo");
179 - await AmapService.instance.init(  
180 - iosKey: 'e373581528f8fd901c01dfbda236159e',  
181 - androidKey: 'dbced781d0acd36184d5b4b54da7188d');  
182 } 185 }
183 186
184 ///获取微信登录code 187 ///获取微信登录code
@@ -264,16 +267,6 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -264,16 +267,6 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
264 // } 267 // }
265 // } 268 // }
266 269
267 - initDio() {  
268 - _checkWechat();  
269 - DioUtil.openDebug();  
270 - BaseOptions options = DioUtil.getDefOptions();  
271 - options.baseUrl = HttpUrl.server_address;  
272 - HttpConfig config = new HttpConfig(  
273 - options: options, status: "ret", code: "ret", msg: "msg", data: "data");  
274 - DioUtil().setConfig(config);  
275 - }  
276 -  
277 /* 270 /*
278 苹果登录获取用户信息 271 苹果登录获取用户信息
279 */ 272 */
@@ -420,510 +413,510 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver { @@ -420,510 +413,510 @@ class LoginState extends State<LoginPage> with WidgetsBindingObserver {
420 final double prefixIconWidth = ScreenUtil().setWidth(24); 413 final double prefixIconWidth = ScreenUtil().setWidth(24);
421 414
422 return Scaffold( 415 return Scaffold(
423 - backgroundColor: MyColours.color_ffffff,  
424 - body: Container(  
425 - width: double.infinity,  
426 - height: double.infinity,  
427 - child: SingleChildScrollView(  
428 - controller: _scrollController,  
429 - child: Column(  
430 - crossAxisAlignment: CrossAxisAlignment.center,  
431 - children: <Widget>[  
432 - // VEmptyView(218 - App.statusBarHeight),  
433 - VEmptyView(80 + App.statusBarHeight),  
434 - Padding(  
435 - padding: EdgeInsets.symmetric(  
436 - horizontal: ScreenUtil().setWidth(40)),  
437 - child: Row(  
438 - mainAxisAlignment: MainAxisAlignment.start,  
439 - children: [  
440 - Image.asset(  
441 - "assets/logo.png",  
442 - width: ScreenUtil().setWidth(40 * 2),  
443 - height: ScreenUtil().setWidth(40 * 2),  
444 - )  
445 - ],  
446 - )),  
447 - VEmptyView(120),  
448 - Image.asset(  
449 - Utils.getImgPath('login_bg'),  
450 - ),  
451 - // Container(  
452 - // height: ScreenUtil().setHeight(84),  
453 - // width: ScreenUtil().setWidth(611),  
454 - // padding: EdgeInsets.only(left: ScreenUtil().setWidth(20)),  
455 - // alignment: Alignment.center,  
456 - // decoration: BoxDecoration(  
457 - // border: Border.all(  
458 - // color: MyColours.color_bff6f7,  
459 - // width: ScreenUtil().setWidth(2)),  
460 - // borderRadius:  
461 - // BorderRadius.circular(ScreenUtil().setWidth(8))),  
462 - // child: Row(  
463 - // crossAxisAlignment: CrossAxisAlignment.center,  
464 - // children: <Widget>[  
465 - // Image.asset(  
466 - // "assets/icon_sellercode.png",  
467 - // width: prefixIconWidth,  
468 - // ),  
469 - // HEmptyView(26),  
470 - // Center(  
471 - // child: Text(  
472 - // "商户编号",  
473 - // style: TextStyle(  
474 - // color: MyColours.color_353535,  
475 - // fontSize: ScreenUtil().setSp(28)),  
476 - // )),  
477 - // Expanded(  
478 - // child: Container(  
479 - // height: ScreenUtil().setHeight(84),  
480 - // padding: EdgeInsets.only(  
481 - // left: ScreenUtil().setWidth(20),  
482 - // right: ScreenUtil().setWidth(20),  
483 - // top: ScreenUtil().setWidth(8)),  
484 - // child: TextField(  
485 - // controller: _sellerCodeController,  
486 - // focusNode: _sellerCodeFocusNode,  
487 - // // autofocus: _sellerCodeController.text.isEmpty,  
488 - // style: TextStyle(  
489 - // color: MyColours.color_353535,  
490 - // fontSize: ScreenUtil().setSp(28),  
491 - // textBaseline: TextBaseline.alphabetic),  
492 - // // textAlignVertical: TextAlignVertical.center,  
493 - // decoration: InputDecoration(  
494 - // hintText: "请输入6位商户编码",  
495 - // hintStyle: TextStyle(  
496 - // color: MyColours.color_c1c1c1,  
497 - // fontSize: ScreenUtil().setSp(28),  
498 - // ),  
499 - // border: OutlineInputBorder(  
500 - // borderSide: BorderSide.none),  
501 - // contentPadding: EdgeInsets.zero,  
502 - // ),  
503 - // onChanged: (_) {  
504 - // setActivate();  
505 - // },  
506 - // keyboardType: TextInputType.number,  
507 - // )),  
508 - // )  
509 - // ],  
510 - // )),  
511 -  
512 - // Container(  
513 - // height: ScreenUtil().setHeight(84),  
514 - // width: ScreenUtil().setWidth(611),  
515 - // padding: EdgeInsets.only(left: ScreenUtil().setWidth(20)),  
516 - // margin: EdgeInsets.only(top: ScreenUtil().setHeight(8)),  
517 - // alignment: Alignment.center,  
518 - // decoration: BoxDecoration(  
519 - // border: Border.all(  
520 - // color: MyColours.color_bff6f7,  
521 - // width: ScreenUtil().setWidth(2)),  
522 - // borderRadius:  
523 - // BorderRadius.circular(ScreenUtil().setWidth(8))),  
524 - // child: Row(  
525 - // crossAxisAlignment: CrossAxisAlignment.center,  
526 - // children: <Widget>[  
527 - // Image.asset(  
528 - // "assets/icon_account.png",  
529 - // width: prefixIconWidth,  
530 - // ),  
531 - // HEmptyView(26),  
532 - // Text(  
533 - // "工 号",  
534 - // style: TextStyle(  
535 - // color: MyColours.color_353535,  
536 - // fontSize: ScreenUtil().setSp(28)),  
537 - // ),  
538 - // Expanded(  
539 - // child: Container(  
540 - // height: ScreenUtil().setHeight(84),  
541 - // padding: EdgeInsets.only(  
542 - // left: ScreenUtil().setWidth(20),  
543 - // right: ScreenUtil().setWidth(20),  
544 - // top: ScreenUtil().setWidth(8)),  
545 - // child: TextField(  
546 - // controller: _accountController,  
547 - // focusNode: _accountFocusNode,  
548 - // style: TextStyle(  
549 - // color: MyColours.color_353535,  
550 - // fontSize: ScreenUtil().setSp(28)),  
551 - // decoration: InputDecoration(  
552 - // hintText: "请输入4位工号",  
553 - // hintStyle: TextStyle(  
554 - // color: MyColours.color_c1c1c1,  
555 - // fontSize: ScreenUtil().setSp(28)),  
556 - // border: OutlineInputBorder(  
557 - // borderSide: BorderSide.none),  
558 - // contentPadding: EdgeInsets.zero,  
559 - // ),  
560 - // onChanged: (_) {  
561 - // setActivate();  
562 - // },  
563 - // keyboardType: TextInputType.number,  
564 - // ),  
565 - // ))  
566 - // ],  
567 - // )),  
568 - // Container(  
569 - // height: ScreenUtil().setHeight(84),  
570 - // width: ScreenUtil().setWidth(611),  
571 - // padding: EdgeInsets.only(  
572 - // left: ScreenUtil().setWidth(20),  
573 - // right: ScreenUtil().setWidth(27)),  
574 - // margin: EdgeInsets.only(top: ScreenUtil().setHeight(8)),  
575 - // alignment: Alignment.center,  
576 - // decoration: BoxDecoration(  
577 - // border: Border.all(  
578 - // color: MyColours.color_bff6f7,  
579 - // width: ScreenUtil().setWidth(2)),  
580 - // borderRadius:  
581 - // BorderRadius.circular(ScreenUtil().setWidth(8))),  
582 - // child: Row(  
583 - // crossAxisAlignment: CrossAxisAlignment.center,  
584 - // children: <Widget>[  
585 - // Image.asset(  
586 - // "assets/icon_pwd.png",  
587 - // width: prefixIconWidth,  
588 - // ),  
589 - // HEmptyView(26),  
590 - // Text(  
591 - // "密 码",  
592 - // style: TextStyle(  
593 - // color: MyColours.color_353535,  
594 - // fontSize: ScreenUtil().setSp(28)),  
595 - // ),  
596 - // Expanded(  
597 - // child: Container(  
598 - // height: ScreenUtil().setHeight(84),  
599 - // padding: EdgeInsets.only(  
600 - // left: ScreenUtil().setWidth(20),  
601 - // right: ScreenUtil().setWidth(20),  
602 - // top: ScreenUtil().setWidth(8)),  
603 - // child: TextField(  
604 - // controller: _pwdController,  
605 - // focusNode: _pwdFocusNode,  
606 - // // autofocus: _sellerCodeController.text.isNotEmpty &&  
607 - // // _accountController.text.isNotEmpty &&  
608 - // // _pwdController.text.isEmpty,  
609 - // style: TextStyle(  
610 - // color: MyColours.color_353535,  
611 - // fontSize: ScreenUtil().setSp(28)),  
612 - // decoration: InputDecoration(  
613 - // hintText: "请输入密码",  
614 - // hintStyle: TextStyle(  
615 - // color: MyColours.color_c1c1c1,  
616 - // fontSize: ScreenUtil().setSp(28)),  
617 - // border: OutlineInputBorder(  
618 - // borderSide: BorderSide.none),  
619 - // contentPadding: EdgeInsets.zero,  
620 - // ),  
621 - // onChanged: (_) {  
622 - // setActivate();  
623 - // },  
624 - // obscureText: obscureText,  
625 - // keyboardType: TextInputType.text,  
626 - // )),  
627 - // ),  
628 - // GestureDetector(  
629 - // child: Padding(  
630 - // padding: EdgeInsets.all(ScreenUtil().setWidth(10)),  
631 - // child: Image.asset(  
632 - // obscureText  
633 - // ? "assets/icon_pwd_show.png"  
634 - // : "assets/icon_pwd_hide.png",  
635 - // width: ScreenUtil().setWidth(35),  
636 - // height: ScreenUtil().setHeight(24),  
637 - // ),  
638 - // ),  
639 - // onTap: () {  
640 - // setState(() {  
641 - // obscureText = !obscureText;  
642 - // });  
643 - // },  
644 - // )  
645 - // ],  
646 - // )),  
647 -  
648 - // Container(  
649 - // width: ScreenUtil().setWidth(611),  
650 - // margin: EdgeInsets.only(top: ScreenUtil().setHeight(16)),  
651 - // alignment: Alignment.centerLeft,  
652 - // child: Text(  
653 - // errorText,  
654 - // // 'hfhfhf',  
655 - // style: TextStyle(  
656 - // color: MyColours.color_d93535,  
657 - // fontSize: ScreenUtil().setSp(16)),  
658 - // ),  
659 - // ),  
660 - VEmptyView(60),  
661 - // Consumer<UserModel>(  
662 - // builder:  
663 - // (BuildContext context, UserModel value, Widget child) {  
664 - // return GestureDetector(  
665 - // onTap: () {  
666 - // if (!isActivate) return;  
667 - // if (!_check) {  
668 - // Utils.showToast('请先仔细阅读并同意协议');  
669 - // return;  
670 - // }  
671 - // if (App.sp.containsKey('unionid')) {  
672 - // //微信登陆的时候,退出清空数据  
673 - // App.sp.remove('openid');  
674 - // App.sp.remove("unionid");  
675 - // }  
676 - // Map<String, String> params = {  
677 - // "seller_code": "${_sellerCodeController.text}",  
678 - // "alias": "ssahdahgdafgahjkhakjgh",  
679 - // "account": "${_accountController.text}",  
680 - // "password": "${_pwdController.text}"  
681 - // };  
682 - // value.login(context, params).then((value) {  
683 - // setState(() {  
684 - // errorText = value ?? "";  
685 - // });  
686 - // });  
687 - // },  
688 - // child: Container(  
689 - // height: ScreenUtil().setWidth(84),  
690 - // width: ScreenUtil().setWidth(611),  
691 - // alignment: Alignment.center,  
692 - // decoration: BoxDecoration(  
693 - // color: isActivate  
694 - // ? MyColours.color_2bb5b7  
695 - // : MyColours.color_2bb5b7,  
696 - // boxShadow: [  
697 - // BoxShadow(  
698 - // color: MyColours.color_26000000,  
699 - // offset: Offset(0, ScreenUtil().setWidth(4)),  
700 - // )  
701 - // ],  
702 - // borderRadius: BorderRadius.all(  
703 - // Radius.circular(ScreenUtil().setWidth(8)))),  
704 - // child: Text(  
705 - // "登录",  
706 - // style: TextStyle(  
707 - // color: MyColours.color_ffffff,  
708 - // fontSize: ScreenUtil().setSp(34)),  
709 - // ),  
710 - // ),  
711 - // );  
712 - // },  
713 - // ),  
714 -  
715 - Row(  
716 - // mainAxisSize: MainAxisSize.min,  
717 - crossAxisAlignment: CrossAxisAlignment.start, 416 + backgroundColor: MyColours.color_ffffff,
  417 + body: Container(
  418 + width: double.infinity,
  419 + height: double.infinity,
  420 + child: SingleChildScrollView(
  421 + controller: _scrollController,
  422 + child: Column(
  423 + crossAxisAlignment: CrossAxisAlignment.center,
718 children: <Widget>[ 424 children: <Widget>[
719 - InkWell(  
720 - onTap: () {  
721 - setState(() {  
722 - _check = !_check;  
723 - });  
724 - if (_check) {  
725 - initDio();  
726 - }  
727 - },  
728 - child: Container(  
729 - alignment: Alignment.topCenter,  
730 - // color: Colors.red,  
731 - height: ScreenUtil().setWidth(110),  
732 - padding: EdgeInsets.only(  
733 - right: ScreenUtil().setWidth(30),  
734 - left: ScreenUtil().setWidth(102),  
735 - bottom: ScreenUtil().setWidth(10)),  
736 - child: Image.asset(  
737 - _check  
738 - ? "assets/mine_radio_sel.png"  
739 - : "assets/mine_radio_nor.png",  
740 - width: ScreenUtil().setWidth(26),  
741 - height: ScreenUtil().setWidth(26)),  
742 - )),  
743 - // HEmptyView(30), 425 + // VEmptyView(218 - App.statusBarHeight),
  426 + VEmptyView(80 + App.statusBarHeight),
744 Padding( 427 Padding(
745 - padding: EdgeInsets.only(top: ScreenUtil().setWidth(2)),  
746 - child: Text(  
747 - '已阅读并同意',  
748 - style: TextStyle(  
749 - fontSize: ScreenUtil().setSp(24),  
750 - color: MyColours.color_999999),  
751 - ), 428 + padding: EdgeInsets.symmetric(
  429 + horizontal: ScreenUtil().setWidth(40)),
  430 + child: Row(
  431 + mainAxisAlignment: MainAxisAlignment.start,
  432 + children: [
  433 + Image.asset(
  434 + "assets/logo.png",
  435 + width: ScreenUtil().setWidth(40 * 2),
  436 + height: ScreenUtil().setWidth(40 * 2),
  437 + )
  438 + ],
  439 + )),
  440 + VEmptyView(120),
  441 + Image.asset(
  442 + Utils.getImgPath('login_bg'),
752 ), 443 ),
753 - InkWell(  
754 - onTap: () {  
755 - NavigatorUtil.goWebPage(context, '软件服务协议', "xy");  
756 - },  
757 - child: Padding( 444 + // Container(
  445 + // height: ScreenUtil().setHeight(84),
  446 + // width: ScreenUtil().setWidth(611),
  447 + // padding: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
  448 + // alignment: Alignment.center,
  449 + // decoration: BoxDecoration(
  450 + // border: Border.all(
  451 + // color: MyColours.color_bff6f7,
  452 + // width: ScreenUtil().setWidth(2)),
  453 + // borderRadius:
  454 + // BorderRadius.circular(ScreenUtil().setWidth(8))),
  455 + // child: Row(
  456 + // crossAxisAlignment: CrossAxisAlignment.center,
  457 + // children: <Widget>[
  458 + // Image.asset(
  459 + // "assets/icon_sellercode.png",
  460 + // width: prefixIconWidth,
  461 + // ),
  462 + // HEmptyView(26),
  463 + // Center(
  464 + // child: Text(
  465 + // "商户编号",
  466 + // style: TextStyle(
  467 + // color: MyColours.color_353535,
  468 + // fontSize: ScreenUtil().setSp(28)),
  469 + // )),
  470 + // Expanded(
  471 + // child: Container(
  472 + // height: ScreenUtil().setHeight(84),
  473 + // padding: EdgeInsets.only(
  474 + // left: ScreenUtil().setWidth(20),
  475 + // right: ScreenUtil().setWidth(20),
  476 + // top: ScreenUtil().setWidth(8)),
  477 + // child: TextField(
  478 + // controller: _sellerCodeController,
  479 + // focusNode: _sellerCodeFocusNode,
  480 + // // autofocus: _sellerCodeController.text.isEmpty,
  481 + // style: TextStyle(
  482 + // color: MyColours.color_353535,
  483 + // fontSize: ScreenUtil().setSp(28),
  484 + // textBaseline: TextBaseline.alphabetic),
  485 + // // textAlignVertical: TextAlignVertical.center,
  486 + // decoration: InputDecoration(
  487 + // hintText: "请输入6位商户编码",
  488 + // hintStyle: TextStyle(
  489 + // color: MyColours.color_c1c1c1,
  490 + // fontSize: ScreenUtil().setSp(28),
  491 + // ),
  492 + // border: OutlineInputBorder(
  493 + // borderSide: BorderSide.none),
  494 + // contentPadding: EdgeInsets.zero,
  495 + // ),
  496 + // onChanged: (_) {
  497 + // setActivate();
  498 + // },
  499 + // keyboardType: TextInputType.number,
  500 + // )),
  501 + // )
  502 + // ],
  503 + // )),
  504 +
  505 + // Container(
  506 + // height: ScreenUtil().setHeight(84),
  507 + // width: ScreenUtil().setWidth(611),
  508 + // padding: EdgeInsets.only(left: ScreenUtil().setWidth(20)),
  509 + // margin: EdgeInsets.only(top: ScreenUtil().setHeight(8)),
  510 + // alignment: Alignment.center,
  511 + // decoration: BoxDecoration(
  512 + // border: Border.all(
  513 + // color: MyColours.color_bff6f7,
  514 + // width: ScreenUtil().setWidth(2)),
  515 + // borderRadius:
  516 + // BorderRadius.circular(ScreenUtil().setWidth(8))),
  517 + // child: Row(
  518 + // crossAxisAlignment: CrossAxisAlignment.center,
  519 + // children: <Widget>[
  520 + // Image.asset(
  521 + // "assets/icon_account.png",
  522 + // width: prefixIconWidth,
  523 + // ),
  524 + // HEmptyView(26),
  525 + // Text(
  526 + // "工 号",
  527 + // style: TextStyle(
  528 + // color: MyColours.color_353535,
  529 + // fontSize: ScreenUtil().setSp(28)),
  530 + // ),
  531 + // Expanded(
  532 + // child: Container(
  533 + // height: ScreenUtil().setHeight(84),
  534 + // padding: EdgeInsets.only(
  535 + // left: ScreenUtil().setWidth(20),
  536 + // right: ScreenUtil().setWidth(20),
  537 + // top: ScreenUtil().setWidth(8)),
  538 + // child: TextField(
  539 + // controller: _accountController,
  540 + // focusNode: _accountFocusNode,
  541 + // style: TextStyle(
  542 + // color: MyColours.color_353535,
  543 + // fontSize: ScreenUtil().setSp(28)),
  544 + // decoration: InputDecoration(
  545 + // hintText: "请输入4位工号",
  546 + // hintStyle: TextStyle(
  547 + // color: MyColours.color_c1c1c1,
  548 + // fontSize: ScreenUtil().setSp(28)),
  549 + // border: OutlineInputBorder(
  550 + // borderSide: BorderSide.none),
  551 + // contentPadding: EdgeInsets.zero,
  552 + // ),
  553 + // onChanged: (_) {
  554 + // setActivate();
  555 + // },
  556 + // keyboardType: TextInputType.number,
  557 + // ),
  558 + // ))
  559 + // ],
  560 + // )),
  561 + // Container(
  562 + // height: ScreenUtil().setHeight(84),
  563 + // width: ScreenUtil().setWidth(611),
  564 + // padding: EdgeInsets.only(
  565 + // left: ScreenUtil().setWidth(20),
  566 + // right: ScreenUtil().setWidth(27)),
  567 + // margin: EdgeInsets.only(top: ScreenUtil().setHeight(8)),
  568 + // alignment: Alignment.center,
  569 + // decoration: BoxDecoration(
  570 + // border: Border.all(
  571 + // color: MyColours.color_bff6f7,
  572 + // width: ScreenUtil().setWidth(2)),
  573 + // borderRadius:
  574 + // BorderRadius.circular(ScreenUtil().setWidth(8))),
  575 + // child: Row(
  576 + // crossAxisAlignment: CrossAxisAlignment.center,
  577 + // children: <Widget>[
  578 + // Image.asset(
  579 + // "assets/icon_pwd.png",
  580 + // width: prefixIconWidth,
  581 + // ),
  582 + // HEmptyView(26),
  583 + // Text(
  584 + // "密 码",
  585 + // style: TextStyle(
  586 + // color: MyColours.color_353535,
  587 + // fontSize: ScreenUtil().setSp(28)),
  588 + // ),
  589 + // Expanded(
  590 + // child: Container(
  591 + // height: ScreenUtil().setHeight(84),
  592 + // padding: EdgeInsets.only(
  593 + // left: ScreenUtil().setWidth(20),
  594 + // right: ScreenUtil().setWidth(20),
  595 + // top: ScreenUtil().setWidth(8)),
  596 + // child: TextField(
  597 + // controller: _pwdController,
  598 + // focusNode: _pwdFocusNode,
  599 + // // autofocus: _sellerCodeController.text.isNotEmpty &&
  600 + // // _accountController.text.isNotEmpty &&
  601 + // // _pwdController.text.isEmpty,
  602 + // style: TextStyle(
  603 + // color: MyColours.color_353535,
  604 + // fontSize: ScreenUtil().setSp(28)),
  605 + // decoration: InputDecoration(
  606 + // hintText: "请输入密码",
  607 + // hintStyle: TextStyle(
  608 + // color: MyColours.color_c1c1c1,
  609 + // fontSize: ScreenUtil().setSp(28)),
  610 + // border: OutlineInputBorder(
  611 + // borderSide: BorderSide.none),
  612 + // contentPadding: EdgeInsets.zero,
  613 + // ),
  614 + // onChanged: (_) {
  615 + // setActivate();
  616 + // },
  617 + // obscureText: obscureText,
  618 + // keyboardType: TextInputType.text,
  619 + // )),
  620 + // ),
  621 + // GestureDetector(
  622 + // child: Padding(
  623 + // padding: EdgeInsets.all(ScreenUtil().setWidth(10)),
  624 + // child: Image.asset(
  625 + // obscureText
  626 + // ? "assets/icon_pwd_show.png"
  627 + // : "assets/icon_pwd_hide.png",
  628 + // width: ScreenUtil().setWidth(35),
  629 + // height: ScreenUtil().setHeight(24),
  630 + // ),
  631 + // ),
  632 + // onTap: () {
  633 + // setState(() {
  634 + // obscureText = !obscureText;
  635 + // });
  636 + // },
  637 + // )
  638 + // ],
  639 + // )),
  640 +
  641 + // Container(
  642 + // width: ScreenUtil().setWidth(611),
  643 + // margin: EdgeInsets.only(top: ScreenUtil().setHeight(16)),
  644 + // alignment: Alignment.centerLeft,
  645 + // child: Text(
  646 + // errorText,
  647 + // // 'hfhfhf',
  648 + // style: TextStyle(
  649 + // color: MyColours.color_d93535,
  650 + // fontSize: ScreenUtil().setSp(16)),
  651 + // ),
  652 + // ),
  653 + VEmptyView(60),
  654 + // Consumer<UserModel>(
  655 + // builder:
  656 + // (BuildContext context, UserModel value, Widget child) {
  657 + // return GestureDetector(
  658 + // onTap: () {
  659 + // if (!isActivate) return;
  660 + // if (!_check) {
  661 + // Utils.showToast('请先仔细阅读并同意协议');
  662 + // return;
  663 + // }
  664 + // if (App.sp.containsKey('unionid')) {
  665 + // //微信登陆的时候,退出清空数据
  666 + // App.sp.remove('openid');
  667 + // App.sp.remove("unionid");
  668 + // }
  669 + // Map<String, String> params = {
  670 + // "seller_code": "${_sellerCodeController.text}",
  671 + // "alias": "ssahdahgdafgahjkhakjgh",
  672 + // "account": "${_accountController.text}",
  673 + // "password": "${_pwdController.text}"
  674 + // };
  675 + // value.login(context, params).then((value) {
  676 + // setState(() {
  677 + // errorText = value ?? "";
  678 + // });
  679 + // });
  680 + // },
  681 + // child: Container(
  682 + // height: ScreenUtil().setWidth(84),
  683 + // width: ScreenUtil().setWidth(611),
  684 + // alignment: Alignment.center,
  685 + // decoration: BoxDecoration(
  686 + // color: isActivate
  687 + // ? MyColours.color_2bb5b7
  688 + // : MyColours.color_2bb5b7,
  689 + // boxShadow: [
  690 + // BoxShadow(
  691 + // color: MyColours.color_26000000,
  692 + // offset: Offset(0, ScreenUtil().setWidth(4)),
  693 + // )
  694 + // ],
  695 + // borderRadius: BorderRadius.all(
  696 + // Radius.circular(ScreenUtil().setWidth(8)))),
  697 + // child: Text(
  698 + // "登录",
  699 + // style: TextStyle(
  700 + // color: MyColours.color_ffffff,
  701 + // fontSize: ScreenUtil().setSp(34)),
  702 + // ),
  703 + // ),
  704 + // );
  705 + // },
  706 + // ),
  707 +
  708 + Row(
  709 + // mainAxisSize: MainAxisSize.min,
  710 + crossAxisAlignment: CrossAxisAlignment.start,
  711 + children: <Widget>[
  712 + InkWell(
  713 + onTap: () {
  714 + setState(() {
  715 + _check = !_check;
  716 + });
  717 + },
  718 + child: Container(
  719 + alignment: Alignment.topCenter,
  720 + // color: Colors.red,
  721 + height: ScreenUtil().setWidth(110),
  722 + padding: EdgeInsets.only(
  723 + right: ScreenUtil().setWidth(30),
  724 + left: ScreenUtil().setWidth(102),
  725 + bottom: ScreenUtil().setWidth(10)),
  726 + child: Image.asset(
  727 + _check
  728 + ? "assets/mine_radio_sel.png"
  729 + : "assets/mine_radio_nor.png",
  730 + width: ScreenUtil().setWidth(26),
  731 + height: ScreenUtil().setWidth(26)),
  732 + )),
  733 + // HEmptyView(30),
  734 + Padding(
758 padding: 735 padding:
759 EdgeInsets.only(top: ScreenUtil().setWidth(2)), 736 EdgeInsets.only(top: ScreenUtil().setWidth(2)),
760 child: Text( 737 child: Text(
761 - '《软件服务协议》', 738 + '已阅读并同意',
762 style: TextStyle( 739 style: TextStyle(
763 fontSize: ScreenUtil().setSp(24), 740 fontSize: ScreenUtil().setSp(24),
764 - color: MyColours.color_333333),  
765 - )), 741 + color: MyColours.color_999999),
  742 + ),
  743 + ),
  744 + InkWell(
  745 + onTap: () {
  746 + NavigatorUtil.goWebPage(context, '软件服务协议', "xy");
  747 + },
  748 + child: Padding(
  749 + padding: EdgeInsets.only(
  750 + top: ScreenUtil().setWidth(2)),
  751 + child: Text(
  752 + '《软件服务协议》',
  753 + style: TextStyle(
  754 + fontSize: ScreenUtil().setSp(24),
  755 + color: MyColours.color_333333),
  756 + )),
  757 + ),
  758 + Padding(
  759 + padding:
  760 + EdgeInsets.only(top: ScreenUtil().setWidth(2)),
  761 + child: Text('及',
  762 + style: TextStyle(
  763 + fontSize: ScreenUtil().setSp(24),
  764 + color: MyColours.color_999999))),
  765 + InkWell(
  766 + onTap: () {
  767 + NavigatorUtil.goWebPage(context, '隐私政策', "zc");
  768 + },
  769 + child: Padding(
  770 + padding: EdgeInsets.only(
  771 + top: ScreenUtil().setWidth(2)),
  772 + child: Text('《隐私政策》',
  773 + style: TextStyle(
  774 + fontSize: ScreenUtil().setSp(24),
  775 + color: MyColours.color_333333))),
  776 + )
  777 + ],
766 ), 778 ),
767 - Padding(  
768 - padding: EdgeInsets.only(top: ScreenUtil().setWidth(2)),  
769 - child: Text('及',  
770 - style: TextStyle(  
771 - fontSize: ScreenUtil().setSp(24),  
772 - color: MyColours.color_999999))),  
773 - InkWell(  
774 - onTap: () {  
775 - NavigatorUtil.goWebPage(context, '隐私政策', "zc");  
776 - },  
777 - child: Padding(  
778 - padding:  
779 - EdgeInsets.only(top: ScreenUtil().setWidth(2)),  
780 - child: Text('《隐私政策》',  
781 - style: TextStyle(  
782 - fontSize: ScreenUtil().setSp(24),  
783 - color: MyColours.color_333333))),  
784 - )  
785 - ],  
786 - ),  
787 779
788 - //微信登录  
789 - Offstage(  
790 - offstage: !App.isInstallWx,  
791 - child: InkWell(  
792 - child: Container(  
793 - width: double.infinity,  
794 - height: ScreenUtil().setWidth(90),  
795 - margin: EdgeInsets.only(  
796 - bottom: ScreenUtil().setWidth(30),  
797 - right: ScreenUtil().setWidth(80),  
798 - left: ScreenUtil().setWidth(80)),  
799 - decoration: BoxDecoration(  
800 - color: MyColours.color_55AA67,  
801 - borderRadius: BorderRadius.circular(  
802 - ScreenUtil().setWidth(8))),  
803 - child: Row(  
804 - mainAxisAlignment: MainAxisAlignment.center,  
805 - children: [  
806 - Image.asset(Utils.getImgPath('icon_wechat_login'),  
807 - width: ScreenUtil().setWidth(46)),  
808 - HEmptyView(20),  
809 - Text('微信登录',  
810 - style: TextStyle(  
811 - color: MyColours.color_ffffff,  
812 - fontSize: ScreenUtil().setSp(28),  
813 - fontWeight: FontWeight.bold)),  
814 - ],  
815 - )),  
816 - onTap: () {  
817 - if (!_check) {  
818 - DialogUtil.openAlertDialogLogin(context, 500,  
819 - onTap: () {  
820 - initDio();  
821 - Navigator.pop(context); 780 + //微信登录
  781 + Offstage(
  782 + offstage: !App.isInstallWx,
  783 + child: InkWell(
  784 + child: Container(
  785 + width: double.infinity,
  786 + height: ScreenUtil().setWidth(90),
  787 + margin: EdgeInsets.only(
  788 + bottom: ScreenUtil().setWidth(30),
  789 + right: ScreenUtil().setWidth(80),
  790 + left: ScreenUtil().setWidth(80)),
  791 + decoration: BoxDecoration(
  792 + color: MyColours.color_55AA67,
  793 + borderRadius: BorderRadius.circular(
  794 + ScreenUtil().setWidth(8))),
  795 + child: Row(
  796 + mainAxisAlignment: MainAxisAlignment.center,
  797 + children: [
  798 + Image.asset(
  799 + Utils.getImgPath('icon_wechat_login'),
  800 + width: ScreenUtil().setWidth(46)),
  801 + HEmptyView(20),
  802 + Text('微信登录',
  803 + style: TextStyle(
  804 + color: MyColours.color_ffffff,
  805 + fontSize: ScreenUtil().setSp(28),
  806 + fontWeight: FontWeight.bold)),
  807 + ],
  808 + )),
  809 + onTap: () {
  810 + if (!_check) {
  811 + DialogUtil.openAlertDialogLogin(context, 500,
  812 + onTap: () {
  813 + Navigator.pop(context);
  814 + _wxLogin();
  815 + });
  816 + return;
  817 + }
822 _wxLogin(); 818 _wxLogin();
823 - });  
824 - return;  
825 - }  
826 - _wxLogin();  
827 - },  
828 - )),  
829 - //账号登录  
830 - Consumer<UserModel>(builder:  
831 - (BuildContext context, UserModel value, Widget child) {  
832 - return InkWell(  
833 - child: Container(  
834 - width: double.infinity,  
835 - height: ScreenUtil().setWidth(90),  
836 - margin: EdgeInsets.only(  
837 - bottom: ScreenUtil().setWidth(30),  
838 - right: ScreenUtil().setWidth(80),  
839 - left: ScreenUtil().setWidth(80)),  
840 - decoration: BoxDecoration(  
841 - color: MyColours.color_41444B,  
842 - borderRadius: BorderRadius.circular(  
843 - ScreenUtil().setWidth(8))),  
844 - child: Row(  
845 - mainAxisAlignment: MainAxisAlignment.center,  
846 - children: [  
847 - Text('一键订账号登录',  
848 - style: TextStyle(  
849 - color: MyColours.color_ffffff,  
850 - fontSize: ScreenUtil().setSp(28),  
851 - fontWeight: FontWeight.bold)),  
852 - ],  
853 - )),  
854 - onTap: () {  
855 - if (!_check) {  
856 - DialogUtil.openAlertDialogLogin(context, 500,  
857 - onTap: () {  
858 - initDio();  
859 - Navigator.pop(context); 819 + },
  820 + )),
  821 + //账号登录
  822 + Consumer<UserModel>(builder:
  823 + (BuildContext context, UserModel value, Widget child) {
  824 + return InkWell(
  825 + child: Container(
  826 + width: double.infinity,
  827 + height: ScreenUtil().setWidth(90),
  828 + margin: EdgeInsets.only(
  829 + bottom: ScreenUtil().setWidth(30),
  830 + right: ScreenUtil().setWidth(80),
  831 + left: ScreenUtil().setWidth(80)),
  832 + decoration: BoxDecoration(
  833 + color: MyColours.color_41444B,
  834 + borderRadius: BorderRadius.circular(
  835 + ScreenUtil().setWidth(8))),
  836 + child: Row(
  837 + mainAxisAlignment: MainAxisAlignment.center,
  838 + children: [
  839 + Text('一键订账号登录',
  840 + style: TextStyle(
  841 + color: MyColours.color_ffffff,
  842 + fontSize: ScreenUtil().setSp(28),
  843 + fontWeight: FontWeight.bold)),
  844 + ],
  845 + )),
  846 + onTap: () {
  847 + if (!_check) {
  848 + DialogUtil.openAlertDialogLogin(context, 500,
  849 + onTap: () {
  850 + Navigator.pop(context);
  851 + NavigatorUtil.goAccountLoginPage(context);
  852 + });
  853 + return;
  854 + }
860 NavigatorUtil.goAccountLoginPage(context); 855 NavigatorUtil.goAccountLoginPage(context);
861 }); 856 });
862 - return;  
863 - }  
864 - NavigatorUtil.goAccountLoginPage(context);  
865 - });  
866 - }),  
867 - // ios登录  
868 - Platform.isAndroid  
869 - ? Text('')  
870 - : Consumer<UserModel>(builder:  
871 - (BuildContext context, UserModel value, Widget child) {  
872 - return InkWell(  
873 - child: Container(  
874 - width: double.infinity,  
875 - height: ScreenUtil().setWidth(90),  
876 - margin: EdgeInsets.only(  
877 - bottom: ScreenUtil().setWidth(30),  
878 - right: ScreenUtil().setWidth(80),  
879 - left: ScreenUtil().setWidth(80)),  
880 - decoration: BoxDecoration(  
881 - color: MyColours.color_ffffff,  
882 - border: Border.all(  
883 - color: MyColours.color_E4E4E4,  
884 - width: ScreenUtil().setWidth(2)),  
885 - borderRadius: BorderRadius.circular(  
886 - ScreenUtil().setWidth(8))),  
887 - child: Row(  
888 - mainAxisAlignment: MainAxisAlignment.center,  
889 - children: [  
890 - Image.asset(  
891 - Utils.getImgPath('icon_apple_login'),  
892 - width: ScreenUtil().setWidth(46)),  
893 - HEmptyView(20),  
894 - Text('通过 Apple 登录',  
895 - style: TextStyle(  
896 - color: MyColours.color_41444B,  
897 - fontSize: ScreenUtil().setSp(28),  
898 - fontWeight: FontWeight.bold)),  
899 - ],  
900 - )),  
901 - onTap: () {  
902 - if (!_check) {  
903 - DialogUtil.openAlertDialogLogin(context, 500,  
904 - onTap: () {  
905 - initDio();  
906 - Navigator.pop(context); 857 + }),
  858 + // ios登录
  859 + Platform.isAndroid
  860 + ? Text('')
  861 + : Consumer<UserModel>(builder: (BuildContext context,
  862 + UserModel value, Widget child) {
  863 + return InkWell(
  864 + child: Container(
  865 + width: double.infinity,
  866 + height: ScreenUtil().setWidth(90),
  867 + margin: EdgeInsets.only(
  868 + bottom: ScreenUtil().setWidth(30),
  869 + right: ScreenUtil().setWidth(80),
  870 + left: ScreenUtil().setWidth(80)),
  871 + decoration: BoxDecoration(
  872 + color: MyColours.color_ffffff,
  873 + border: Border.all(
  874 + color: MyColours.color_E4E4E4,
  875 + width: ScreenUtil().setWidth(2)),
  876 + borderRadius: BorderRadius.circular(
  877 + ScreenUtil().setWidth(8))),
  878 + child: Row(
  879 + mainAxisAlignment:
  880 + MainAxisAlignment.center,
  881 + children: [
  882 + Image.asset(
  883 + Utils.getImgPath(
  884 + 'icon_apple_login'),
  885 + width: ScreenUtil().setWidth(46)),
  886 + HEmptyView(20),
  887 + Text('通过 Apple 登录',
  888 + style: TextStyle(
  889 + color: MyColours.color_41444B,
  890 + fontSize:
  891 + ScreenUtil().setSp(28),
  892 + fontWeight: FontWeight.bold)),
  893 + ],
  894 + )),
  895 + onTap: () {
  896 + if (!_check) {
  897 + DialogUtil.openAlertDialogLogin(
  898 + context, 500, onTap: () {
  899 + Navigator.pop(context);
  900 + _iosLogin(value);
  901 + });
  902 + return;
  903 + }
907 _iosLogin(value); 904 _iosLogin(value);
908 }); 905 });
909 - return;  
910 - }  
911 - _iosLogin(value);  
912 - });  
913 - }),  
914 - InkWell(  
915 - onTap: () {  
916 - Utils.goPhone("400-000-9690");  
917 - },  
918 - child: Text('联系客服',  
919 - style: TextStyle(  
920 - color: MyColours.color_333333,  
921 - fontWeight: FontWeight.bold,  
922 - fontSize: ScreenUtil().setSp(26),  
923 - decoration: TextDecoration.underline))),  
924 - ],  
925 - ),  
926 - ),  
927 - )); 906 + }),
  907 + InkWell(
  908 + onTap: () {
  909 + Utils.goPhone("400-000-9690");
  910 + },
  911 + child: Text('联系客服',
  912 + style: TextStyle(
  913 + color: MyColours.color_333333,
  914 + fontWeight: FontWeight.bold,
  915 + fontSize: ScreenUtil().setSp(26),
  916 + decoration: TextDecoration.underline))),
  917 + ],
  918 + ),
  919 + ),
  920 + ));
928 } 921 }
929 } 922 }
@@ -177,16 +177,16 @@ class _WebPageState extends State<WebPage> { @@ -177,16 +177,16 @@ class _WebPageState extends State<WebPage> {
177 webViewController = controller; 177 webViewController = controller;
178 }, 178 },
179 onLoadStart: (controller, url) { 179 onLoadStart: (controller, url) {
180 - setState(() {  
181 - this.url = url.toString();  
182 - urlController.text = this.url;  
183 - }); 180 + // setState(() {
  181 + // this.url = url.toString();
  182 + // urlController.text = this.url;
  183 + // });
184 }, 184 },
185 androidOnPermissionRequest: 185 androidOnPermissionRequest:
186 (controller, origin, resources) async { 186 (controller, origin, resources) async {
187 - return PermissionRequestResponse(  
188 - resources: resources,  
189 - action: PermissionRequestResponseAction.GRANT); 187 + // return PermissionRequestResponse(
  188 + // resources: resources,
  189 + // action: PermissionRequestResponseAction.GRANT);
190 }, 190 },
191 shouldOverrideUrlLoading: 191 shouldOverrideUrlLoading:
192 (controller, navigationAction) async { 192 (controller, navigationAction) async {
@@ -214,84 +214,84 @@ class _WebPageState extends State<WebPage> { @@ -214,84 +214,84 @@ class _WebPageState extends State<WebPage> {
214 return NavigationActionPolicy.ALLOW; 214 return NavigationActionPolicy.ALLOW;
215 }, 215 },
216 onLoadStop: (controller, url) async { 216 onLoadStop: (controller, url) async {
217 - pullToRefreshController.endRefreshing();  
218 - setState(() {  
219 - this.url = url.toString();  
220 - urlController.text = this.url;  
221 - }); 217 + // pullToRefreshController.endRefreshing();
  218 + // setState(() {
  219 + // this.url = url.toString();
  220 + // urlController.text = this.url;
  221 + // });
222 }, 222 },
223 onLoadError: (controller, url, code, message) { 223 onLoadError: (controller, url, code, message) {
224 pullToRefreshController.endRefreshing(); 224 pullToRefreshController.endRefreshing();
225 }, 225 },
226 onProgressChanged: (controller, progress) { 226 onProgressChanged: (controller, progress) {
227 - if (progress == 100) { 227 + // if (progress == 100) {
228 pullToRefreshController.endRefreshing(); 228 pullToRefreshController.endRefreshing();
229 - }  
230 - setState(() {  
231 - this.progress = progress / 100;  
232 - urlController.text = this.url;  
233 - }); 229 + // }
  230 + // setState(() {
  231 + // this.progress = progress / 100;
  232 + // urlController.text = this.url;
  233 + // });
234 }, 234 },
235 onUpdateVisitedHistory: (controller, url, androidIsReload) { 235 onUpdateVisitedHistory: (controller, url, androidIsReload) {
236 - setState(() {  
237 - this.url = url.toString();  
238 - urlController.text = this.url;  
239 - }); 236 + // setState(() {
  237 + // this.url = url.toString();
  238 + // urlController.text = this.url;
  239 + // });
240 }, 240 },
241 onConsoleMessage: (controller, consoleMessage) { 241 onConsoleMessage: (controller, consoleMessage) {
242 print(consoleMessage); 242 print(consoleMessage);
243 }, 243 },
244 onDownloadStart: (controller, url) async { 244 onDownloadStart: (controller, url) async {
245 - print("onDownloadStart $url");  
246 - Utils.showToast('开始下载...');  
247 - // final taskId = await FlutterDownloader.enqueue(  
248 - // url: url.toString(),  
249 - // savedDir: (await getExternalStorageDirectory()).path,  
250 - // showNotification:  
251 - // true, // show download progress in status bar (for Android)  
252 - // openFileFromNotification:  
253 - // true, // click on notification to open downloaded file (for Android)  
254 - // );  
255 - final dir = await getExternalStorageDirectory();  
256 - String savePath = dir.path + "/one_key"; 245 + // print("onDownloadStart $url");
  246 + // Utils.showToast('开始下载...');
  247 + // // final taskId = await FlutterDownloader.enqueue(
  248 + // // url: url.toString(),
  249 + // // savedDir: (await getExternalStorageDirectory()).path,
  250 + // // showNotification:
  251 + // // true, // show download progress in status bar (for Android)
  252 + // // openFileFromNotification:
  253 + // // true, // click on notification to open downloaded file (for Android)
  254 + // // );
  255 + // final dir = await getExternalStorageDirectory();
  256 + // String savePath = dir.path + "/one_key";
257 257
258 - Directory directory = new Directory(savePath);  
259 - if (directory.existsSync()) {  
260 - //删除历史apk  
261 - final List<FileSystemEntity> files = directory.listSync();  
262 - for (FileSystemEntity file in files) {  
263 - file.deleteSync();  
264 - }  
265 - }  
266 - DioUtil().download(url.toString(), savePath,  
267 - onProgress: (received, total) {  
268 - // if (_progress != 100) {  
269 - // int progress = ((received / total) * 100).round();  
270 - // _progress = progress;  
271 - // _setState(() {});  
272 - // }  
273 - if (received == total) {  
274 - print('object');  
275 - Utils.showToast('文件已保存在${savePath}');  
276 - // openFile(savePath);  
277 - //下载完成  
278 - // InstallPlugin.installApk(savePath, "com.naji.one_key");  
279 - }  
280 - });  
281 - // },  
282 - // DioUtil().download(url.toString(),  
283 - // (await getExternalStorageDirectory()).path,  
284 - // onProgress: (received, total) {  
285 - // // if (_progress != 100) {  
286 - // // int progress = ((received / total) * 100).round();  
287 - // // _progress = progress;  
288 - // // _setState(() {});  
289 - // // }  
290 - // if (received == total) {  
291 - // //下载完成  
292 - // // InstallPlugin.installApk(savePath, "com.naji.one_key");  
293 - // }  
294 - // }); 258 + // Directory directory = new Directory(savePath);
  259 + // if (directory.existsSync()) {
  260 + // //删除历史apk
  261 + // final List<FileSystemEntity> files = directory.listSync();
  262 + // for (FileSystemEntity file in files) {
  263 + // file.deleteSync();
  264 + // }
  265 + // }
  266 + // DioUtil().download(url.toString(), savePath,
  267 + // onProgress: (received, total) {
  268 + // // if (_progress != 100) {
  269 + // // int progress = ((received / total) * 100).round();
  270 + // // _progress = progress;
  271 + // // _setState(() {});
  272 + // // }
  273 + // if (received == total) {
  274 + // print('object');
  275 + // Utils.showToast('文件已保存在${savePath}');
  276 + // // openFile(savePath);
  277 + // //下载完成
  278 + // // InstallPlugin.installApk(savePath, "com.naji.one_key");
  279 + // }
  280 + // });
  281 + // // },
  282 + // // DioUtil().download(url.toString(),
  283 + // // (await getExternalStorageDirectory()).path,
  284 + // // onProgress: (received, total) {
  285 + // // // if (_progress != 100) {
  286 + // // // int progress = ((received / total) * 100).round();
  287 + // // // _progress = progress;
  288 + // // // _setState(() {});
  289 + // // // }
  290 + // // if (received == total) {
  291 + // // //下载完成
  292 + // // // InstallPlugin.installApk(savePath, "com.naji.one_key");
  293 + // // }
  294 + // // });
295 }, 295 },
296 )) 296 ))
297 ], 297 ],
@@ -820,7 +820,7 @@ packages: @@ -820,7 +820,7 @@ packages:
820 name: provider 820 name: provider
821 url: "https://pub.flutter-io.cn" 821 url: "https://pub.flutter-io.cn"
822 source: hosted 822 source: hosted
823 - version: "4.3.3" 823 + version: "6.0.3"
824 pub_semver: 824 pub_semver:
825 dependency: transitive 825 dependency: transitive
826 description: 826 description:
@@ -29,7 +29,8 @@ dependencies: @@ -29,7 +29,8 @@ dependencies:
29 29
30 json_annotation: ^3.1.0 30 json_annotation: ^3.1.0
31 # 状态管理 31 # 状态管理
32 - provider: ^4.0.4 32 + provider: ^6.0.3
  33 + # provider: ^4.0.4
33 # Sp存储 34 # Sp存储
34 shared_preferences: ^0.5.6+3 35 shared_preferences: ^0.5.6+3
35 # 网络 36 # 网络