diff --git a/lib/login/login_page.dart b/lib/login/login_page.dart index c587559..39b7e3f 100644 --- a/lib/login/login_page.dart +++ b/lib/login/login_page.dart @@ -52,7 +52,8 @@ class LoginPage extends StatelessWidget { Image.asset( 'wow_logo'.assetPng, height: 81.h, - width: 139.w,), + width: 131.w, + ), Offstage( offstage: bloc.loginType == LoginType.pwd, child: _buildSmsViewWidget(), @@ -61,7 +62,6 @@ class LoginPage extends StatelessWidget { offstage: bloc.loginType == LoginType.sms, child: _buildPwdViewWidget(), ), - 20.verticalSpace, Row( mainAxisAlignment: MainAxisAlignment.center, children: [ @@ -75,9 +75,12 @@ class LoginPage extends StatelessWidget { const Text('我已阅读并同意《用户隐私协议》,《儿童隐私策略》') ], ), - 14.5.verticalSpace, GestureDetector( - onTap: () => bloc.add(ChangeLoginTypeEvent()), + onTap: () { + if (bloc.canLogin) { + bloc.add(RequestLoginEvent()); + } + }, child: Container( decoration: BoxDecoration( image: DecorationImage( @@ -113,12 +116,12 @@ class LoginPage extends StatelessWidget { builder: (context,state){ final bloc = BlocProvider.of(context); return Padding( - padding: const EdgeInsets.symmetric(horizontal: 340), + padding: EdgeInsets.symmetric(horizontal: 135.w), child: Column( children: [ 15.verticalSpace, Container( - height: 55, + height: 55.h, width: double.infinity, alignment: Alignment.center, decoration: BoxDecoration( @@ -126,9 +129,8 @@ class LoginPage extends StatelessWidget { image: AssetImage( 'Input_layer_up'.assetPng ), - fit: BoxFit.fitHeight + fit: BoxFit.fitWidth ), - color: Colors.red ), child: TextField( controller: bloc.phoneNumController, @@ -150,30 +152,32 @@ class LoginPage extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - width: 257, - height: 50, - alignment: Alignment.center, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - 'Input_layer_down'.assetPng - ) - ) - ), - child: TextField( - controller: bloc.checkNumController, - textAlign: TextAlign.center, - textInputAction: TextInputAction.done, - keyboardType: TextInputType.number, - decoration: const InputDecoration( - hintText: '请输入验证码', - border: InputBorder.none, + Expanded( + child: Container( + height: 50.h, + width: double.infinity, + alignment: Alignment.center, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'Input_layer_down'.assetPng, + ), + ) ), - onChanged: (String value) { - bloc.add(CheckFieldChangeEvent()); - }, - ) + child: TextField( + controller: bloc.checkNumController, + textAlign: TextAlign.center, + textInputAction: TextInputAction.done, + keyboardType: TextInputType.number, + decoration: const InputDecoration( + hintText: '请输入验证码', + border: InputBorder.none, + ), + onChanged: (String value) { + bloc.add(CheckFieldChangeEvent()); + }, + ) + ), ), GestureDetector( onTap: () { @@ -206,101 +210,104 @@ class LoginPage extends StatelessWidget { Widget _buildPwdViewWidget()=> BlocBuilder( builder: (context,state){ final bloc = BlocProvider.of(context); - return Column( - children: [ - 15.verticalSpace, - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - 'phone'.assetPng, - height: 45, - width: 35, - ), - 10.5.horizontalSpace, - Container( - height: 55, - width: double.infinity, - alignment: Alignment.center, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - 'Input_layer_up'.assetPng + return Padding( + padding: EdgeInsets.symmetric(horizontal: 90.w), + child: Column( + children: [ + 15.verticalSpace, + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'phone'.assetPng, + height: 45.h, + width: 35.w, + ), + 10.5.horizontalSpace, + Expanded( + child: Container( + height: 55.h, + width: double.infinity, + alignment: Alignment.center, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'Input_layer_up'.assetPng + ), + fit: BoxFit.fitWidth, + ) ), - fit: BoxFit.fill, - ) - ), - child: TextField( - controller: bloc.phoneNumController, - textAlign: TextAlign.center, - textInputAction: TextInputAction.done, - decoration: const InputDecoration( - hintText: '请输入手机号', - border: InputBorder.none, - ), - keyboardType: TextInputType.phone, - onChanged: (String value) { - bloc.add(PhoneNumChangeEvent()); - }, - ) - ), - 5.horizontalSpace, - const SizedBox( - width: 100, - height: 55.0, - ) - ], - ), - 12.verticalSpace, - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Image.asset( - 'lock'.assetPng, - height: 34, - width: 31, - ), - 10.5.horizontalSpace, - Container( - width: 397.5, - height: 55, - alignment: Alignment.center, - decoration: BoxDecoration( - image: DecorationImage( - image: AssetImage( - 'Input_layer_down'.assetPng + child: TextField( + controller: bloc.phoneNumController, + textAlign: TextAlign.center, + textInputAction: TextInputAction.done, + decoration: const InputDecoration( + hintText: '请输入手机号', + border: InputBorder.none, + ), + keyboardType: TextInputType.phone, + onChanged: (String value) {bloc.add(PhoneNumChangeEvent());},) + )), + 5.horizontalSpace, + SizedBox( + width: 100.w, + height: 55.h, + ) + ], + ), + 12.verticalSpace, + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'lock'.assetPng, + height: 34.h, + width: 31.w, + ), + 10.5.horizontalSpace, + Expanded( + child: Container( + width: 397.5, + height: 55, + alignment: Alignment.center, + decoration: BoxDecoration( + image: DecorationImage( + image: AssetImage( + 'Input_layer_down'.assetPng + ), + fit: BoxFit.fill, + ) + ), + child: TextField( + controller: bloc.checkNumController, + textAlign: TextAlign.center, + textInputAction: TextInputAction.done, + decoration: const InputDecoration( + hintText: '请输入密码', + border: InputBorder.none, ), - fit: BoxFit.fill, + onChanged: (String value) { + bloc.add(CheckFieldChangeEvent()); + }, ) ), - child: TextField( - controller: bloc.checkNumController, - textAlign: TextAlign.center, - textInputAction: TextInputAction.done, - decoration: const InputDecoration( - hintText: '请输入密码', - border: InputBorder.none, + ), + 5.horizontalSpace, + GestureDetector( + onTap: () => bloc.add(ForgetPasswordEvent()), + child: Container( + width: 100.w, + height: 55.h, + alignment: Alignment.centerLeft, + child: const Text( + '忘记密码 ?' ), - onChanged: (String value) { - bloc.add(CheckFieldChangeEvent()); - }, - ) - ), - 5.horizontalSpace, - GestureDetector( - onTap: () => bloc.add(ForgetPasswordEvent()), - child: Container( - width: 100, - height: 55.0, - alignment: Alignment.centerLeft, - child: const Text( - '忘记密码 ?' ), - ), - ) - ], - ) - ], + ) + ], + ) + ], + ), ); });