Commit f138a761e6dc3cc0ebeafb6f4d30aff2ea430bb8

Authored by liangchengyou
1 parent bfb40cd0

feat:更新代码

lib/login/loginpage/login_page.dart
... ... @@ -304,336 +304,4 @@ class LoginPage extends StatelessWidget {
304 304 });
305 305 }
306 306  
307   -// class LoginPage extends StatefulWidget {
308   -// const LoginPage({super.key});
309   -//
310   -// @override
311   -// State<StatefulWidget> createState() {
312   -// return _LoginPageState();
313   -// }
314   -//
315   -// }
316   -//
317   -// class _LoginPageState extends State<LoginPage> {
318   -// late Timer _timer;
319   -// int _countdownTime = 0;
320   -//
321   -// void startCountdownTimer(BuildContext context) {
322   -// final bloc = BlocProvider.of<LoginBloc>(context);
323   -// if (bloc.sendSmsIng) {
324   -// return;
325   -// }
326   -// bloc.add(CancelCountDownEvent());
327   -// const oneSec = Duration(seconds: 1);
328   -// _countdownTime = 60;
329   -// _timer = Timer.periodic(oneSec,(timer) {
330   -// setState(() {
331   -// if (_countdownTime < 1) {
332   -// bloc.add(CancelCountDownEvent());
333   -// _timer.cancel();
334   -// } else {
335   -// _countdownTime = _countdownTime - 1;
336   -// }
337   -// });
338   -// if (kDebugMode) {
339   -// print(_countdownTime);
340   -// }
341   -// });
342   -// }
343   -//
344   -//
345   -//
346   -// @override
347   -// Widget build(BuildContext context) {
348   -// return BlocProvider(
349   -// create: (context) => LoginBloc(),
350   -// child: _buildLoginViewWidget(),
351   -// );
352   -// }
353   -//
354   -// Widget _buildLoginViewWidget() => BlocBuilder<LoginBloc,LoginState> (
355   -// builder: (context, state) {
356   -// final bloc = BlocProvider.of<LoginBloc>(context);
357   -// return Scaffold(
358   -// body: SafeArea(
359   -// child: ListView(
360   -// children: [
361   -// Container(
362   -// padding: EdgeInsets.only(top: 25.h),
363   -// child: Stack(
364   -// children: [
365   -// Positioned(
366   -// right: 29.w,
367   -// child: GestureDetector(
368   -// onTap: () => bloc.add(ChangeLoginTypeEvent()),
369   -// child: Container(
370   -// decoration: BoxDecoration(
371   -// image: DecorationImage(
372   -// image: AssetImage(
373   -// 'login_logo'.assetPng
374   -// ),
375   -// fit: BoxFit.fill
376   -// ),
377   -// ),
378   -// padding: const EdgeInsets.symmetric(horizontal: 18.0),
379   -// child: Text(
380   -// bloc.loginType == LoginType.sms?'密码登陆':'验证码密码'
381   -// ),
382   -// ),
383   -// )
384   -// ),
385   -// Center(
386   -// child: Column(
387   -// children: [
388   -// Image.asset(
389   -// 'wow_logo'.assetPng,
390   -// height: 81.h,
391   -// width: 131.w,
392   -// ),
393   -// Offstage(
394   -// offstage: bloc.loginType == LoginType.pwd,
395   -// child: _buildSmsViewWidget(),
396   -// ),
397   -// Offstage(
398   -// offstage: bloc.loginType == LoginType.sms,
399   -// child: _buildPwdViewWidget(),
400   -// ),
401   -// Row(
402   -// mainAxisAlignment: MainAxisAlignment.center,
403   -// children: [
404   -// GestureDetector(
405   -// onTap: () => bloc.add(AgreementChangeEvent()),
406   -// child: Icon(
407   -// bloc.agreement ? Icons.check_circle_outlined:Icons.circle_outlined,
408   -// color:bloc.agreement ? Colors.green:Colors.black),
409   -// ),
410   -// 6.horizontalSpace,
411   -// RichText(
412   -// text: TextSpan(
413   -// children:[
414   -// const TextSpan(
415   -// text: '我已阅读并同意',
416   -// style: TextStyle(
417   -// fontSize: 12,
418   -// color: Color(0xFF333333),
419   -// )
420   -// ),
421   -// TextSpan(
422   -// text: '《用户隐私协议》',
423   -// style: const TextStyle(
424   -// fontSize: 12,
425   -// color: Color(0xFF333333),
426   -// ),
427   -// recognizer: TapGestureRecognizer()..onTap = (){
428   -// Navigator.of(context).pushNamed(
429   -// AppRouteName.webView,
430   -// arguments: {
431   -// 'urlStr':'https://www.zhihu.com',
432   -// 'webViewTitle':'用户隐私协议'
433   -// });
434   -// }),
435   -// const TextSpan(
436   -// text: ',',
437   -// style: TextStyle(
438   -// fontSize: 12,
439   -// color: Color(0xFF333333)
440   -// )
441   -// ),
442   -// TextSpan(
443   -// text: '《儿童隐私政策》',
444   -// style: const TextStyle(
445   -// fontSize: 12,
446   -// color: Color(0xFF333333)
447   -// ),
448   -// recognizer: TapGestureRecognizer()..onTap = (){
449   -// Navigator.of(context).pushNamed(
450   -// AppRouteName.webView,
451   -// arguments: {
452   -// 'urlStr':'https://www.zhihu.com',
453   -// 'webViewTitle':'儿童隐私协议'
454   -// });
455   -// })
456   -// ]
457   -// ),
458   -// )
459   -// ],
460   -// ),
461   -// GestureDetector(
462   -// onTap: () {
463   -// if (bloc.canLogin) {
464   -// bloc.add(RequestLoginEvent());
465   -// }
466   -// },
467   -// child: Container(
468   -// decoration: BoxDecoration(
469   -// image: DecorationImage(
470   -// image: AssetImage(
471   -// bloc.canLogin?'login_enter'.assetPng:'login_enter_dis'.assetPng
472   -// ),
473   -// fit: BoxFit.fill
474   -// ),
475   -// ),
476   -// padding: const EdgeInsets.symmetric(
477   -// horizontal: 28.0,
478   -// vertical: 14.0
479   -// ),
480   -// child: const Text(
481   -// '登录'
482   -// ),
483   -// ),
484   -// )
485   -// ],
486   -// ),
487   -// )
488   -// ],
489   -// ),
490   -// )
491   -// ],
492   -// ),
493   -// ),
494   -// );
495   -// },
496   -// );
497   -//
498   -// Widget _buildSmsViewWidget()=> BlocBuilder<LoginBloc,LoginState>(
499   -// builder: (context,state){
500   -// final bloc = BlocProvider.of<LoginBloc>(context);
501   -// return Padding(
502   -// padding: EdgeInsets.symmetric(horizontal: 135.w),
503   -// child: Column(
504   -// children: [
505   -// 15.verticalSpace,
506   -// TextFieldCustomerWidget(
507   -// height: 55.h,
508   -// hitText: '请输入手机号',
509   -// textInputType: TextInputType.phone,
510   -// bgImageName: 'Input_layer_up',
511   -// onChangeValue: (String value) {
512   -// bloc.add(PhoneNumChangeEvent());
513   -// },
514   -// controller: bloc.phoneNumController,
515   -// ),
516   -// 6.5.verticalSpace,
517   -// const Text('未注册用户登录默认注册'),
518   -// 4.5.verticalSpace,
519   -// Row(
520   -// mainAxisAlignment: MainAxisAlignment.spaceBetween,
521   -// children: [
522   -// Expanded(
523   -// child: TextFieldCustomerWidget(
524   -// height: 50.h,
525   -// hitText: '请输入验证码',
526   -// textInputType: TextInputType.number,
527   -// bgImageName: 'Input_layer_down',
528   -// onChangeValue: (String value) {
529   -// bloc.add(CheckFieldChangeEvent());
530   -// },
531   -// controller: bloc.checkNumController,
532   -// )
533   -// ),
534   -// GestureDetector(
535   -// onTap: () {
536   -// if (bloc.canSendSms) {
537   -//
538   -// }
539   -// },
540   -// child: Container(
541   -// decoration: BoxDecoration(
542   -// image: DecorationImage(
543   -// image: AssetImage(
544   -// bloc.canSendSms?'securitycode'.assetPng:'securitycode_dis'.assetPng
545   -// ),
546   -// fit: BoxFit.fill
547   -// ),
548   -// ),
549   -// padding: const EdgeInsets.symmetric(horizontal:12.0,vertical: 15.0),
550   -// child: Text(
551   -// !bloc.sendSmsIng ? '获取验证码':'${bloc.countDown}s后在次获取'
552   -// ),
553   -// ),
554   -// )
555   -// ],
556   -// )
557   -// ],
558   -// ),
559   -// );
560   -// });
561   -
562   - // Widget _buildPwdViewWidget()=> BlocBuilder<LoginBloc,LoginState>(
563   - // builder: (context,state){
564   - // final bloc = BlocProvider.of<LoginBloc>(context);
565   - // return Padding(
566   - // padding: EdgeInsets.symmetric(horizontal: 90.w),
567   - // child: Column(
568   - // children: [
569   - // 15.verticalSpace,
570   - // Row(
571   - // mainAxisAlignment: MainAxisAlignment.center,
572   - // children: [
573   - // Image.asset(
574   - // 'phone'.assetPng,
575   - // height: 45.h,
576   - // width: 35.w,
577   - // ),
578   - // 10.5.horizontalSpace,
579   - // Expanded(
580   - // child: TextFieldCustomerWidget(
581   - // height: 50.h,
582   - // hitText: '请输入手机号',
583   - // textInputType: TextInputType.phone,
584   - // bgImageName: 'Input_layer_up',
585   - // onChangeValue: (String value) {
586   - // bloc.add(PhoneNumChangeEvent());
587   - // },
588   - // controller: bloc.phoneNumController,
589   - // )
590   - // ),
591   - // 5.horizontalSpace,
592   - // SizedBox(
593   - // width: 100.w,
594   - // height: 55.h,
595   - // )
596   - // ],
597   - // ),
598   - // 12.verticalSpace,
599   - // Row(
600   - // mainAxisAlignment: MainAxisAlignment.center,
601   - // children: [
602   - // Image.asset(
603   - // 'lock'.assetPng,
604   - // height: 34.h,
605   - // width: 31.w,
606   - // ),
607   - // 10.5.horizontalSpace,
608   - // Expanded(
609   - // child: TextFieldCustomerWidget(
610   - // hitText: '请输入密码',
611   - // bgImageName: 'Input_layer_down',
612   - // onChangeValue: (String value) {
613   - // bloc.add(CheckFieldChangeEvent());
614   - // },
615   - // controller: bloc.checkNumController,
616   - // )
617   - // ),
618   - // 5.horizontalSpace,
619   - // GestureDetector(
620   - // onTap: () {
621   - // Navigator.of(context).pushNamed(AppRouteName.fogPwd);
622   - // },
623   - // child: Container(
624   - // width: 100.w,
625   - // height: 55.h,
626   - // alignment: Alignment.centerLeft,
627   - // child: const Text(
628   - // '忘记密码 ?'
629   - // ),
630   - // ),
631   - // )
632   - // ],
633   - // )
634   - // ],
635   - // ),
636   - // );
637   - // });
638   -
639 307  
... ...