Pārlūkot izejas kodu

1.优化登录页

tags/0.0.8+1
“yanghuaxuan” pirms 3 gadiem
vecāks
revīzija
172ded1bb9
4 mainītis faili ar 44 papildinājumiem un 15 dzēšanām
  1. +28
    -15
      lib/pages/login_page/login_page.dart
  2. +2
    -0
      lib/pages/login_page/model/login_style_model.dart
  3. +12
    -0
      lib/util/net_util.dart
  4. +2
    -0
      lib/zhiying_comm.dart

+ 28
- 15
lib/pages/login_page/login_page.dart Parādīt failu

@@ -89,7 +89,7 @@ class _LoginPageContainerState extends State<LoginPageContainer> {

/// 微信or手机登陆
void _loginClick(String type, LoginStyleModel model) {
if(!isCheck()){
if (!isCheck()) {
return;
}
print('登陆$type');
@@ -147,7 +147,7 @@ class _LoginPageContainerState extends State<LoginPageContainer> {

/// 第三方登陆
void _otherLoginClick(BottomIcons model) async {
if(!isCheck()){
if (!isCheck()) {
return;
}
print('第三方登陆${model.type}');
@@ -357,9 +357,11 @@ class _LoginPageContainerState extends State<LoginPageContainer> {
/// 按钮
_buttonsWidget(model),
_sizedHeight9,

///账号密码登录
_buildOrderLogin(),
_sizedHeight9,
_buildOrderLogin(),
_sizedHeight9,

/// 协议
_protocolWidget(model),

@@ -415,10 +417,18 @@ class _LoginPageContainerState extends State<LoginPageContainer> {
),

/// logo 名字
CachedNetworkImage(
imageUrl: model?.main?.appNameImg ?? '',
width: 90,
),
// CachedNetworkImage(
// imageUrl: model?.main?.appNameImg ?? '',
// width: 90,
// ),
Container(
margin: EdgeInsets.only(top: 0, bottom: 6),
child: Center(
child: Text(
model?.main?.appName ?? "",
style: TextStyle(color: HexColor.fromHex("#FF333333"), fontSize: 20,fontWeight: FontWeight.bold),
)),
)
],
),
],
@@ -465,7 +475,7 @@ class _LoginPageContainerState extends State<LoginPageContainer> {
child: Icon(
checkBool ? Icons.check_box : Icons.check_box_outline_blank,
size: 16,
color: checkBool?Colors.red:Colors.black12,
color: checkBool ? Colors.red : Colors.black12,
),
),
),
@@ -571,21 +581,24 @@ class _LoginPageContainerState extends State<LoginPageContainer> {
return Center(
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: (){
if(isCheck()){
onTap: () {
if (isCheck()) {
Navigator.push(context, CupertinoPageRoute(builder: (_) => LoginAccountPage(null)));
}
},
child: Text("使用账号密码登录",style: TextStyle(color: HexColor.fromHex("#FFFF4242"),fontSize: 14),),
child: Text(
"使用账号密码登录",
style: TextStyle(color: HexColor.fromHex("#FFFF4242"), fontSize: 14),
),
),
);
}

bool isCheck(){
if(!checkBool){
bool isCheck() {
if (!checkBool) {
Fluttertoast.showToast(msg: "请阅读并勾选同意用户协议选项");
return false;
}else{
} else {
return true;
}
}


+ 2
- 0
lib/pages/login_page/model/login_style_model.dart Parādīt failu

@@ -65,6 +65,7 @@ class Main {
String appBarTitleColor;
String appBarBgColor;
String appNameImg;
String appName;
String backgroundImg;
List<Agreements> agreements;
List<ImportanceLogin> importanceLogin;
@@ -92,6 +93,7 @@ class Main {
appBarBgColor = json['app_bar_bg_color'];
appNameImg = json['app_name_img'];
backgroundImg = json['background_img'];
appName=json['app_name_cn'];
if (json['agreements'] != null) {
agreements = new List<Agreements>();
json['agreements'].forEach((v) {


+ 12
- 0
lib/util/net_util.dart Parādīt failu

@@ -167,6 +167,18 @@ class NetUtil {
}
}

///非法用户
if (result[GlobalConfig.HTTP_RESPONSE_KEY_CODE]?.toString() == '401000') {
try {
Future.delayed(Duration(seconds: 0)).then((onValue) {
BuildContext context = navigatorKey.currentState.overlay.context;
Provider.of<UserInfoNotifier>(context, listen: false).unLogin();
});
} catch (e, s) {
Logger.error(e, s);
}
}

///
/// 403028 账号被冻结
/// 403029 账号被禁用


+ 2
- 0
lib/zhiying_comm.dart Parādīt failu

@@ -50,3 +50,5 @@ export 'package:path_provider/path_provider.dart';
export 'package:dio/dio.dart';
export 'package:fluwx/fluwx.dart';
export 'package:permission_handler/permission_handler.dart';
export 'package:zhiying_comm/util/shared_prefe_util.dart';
export 'package:fluttertoast/fluttertoast.dart';

Notiek ielāde…
Atcelt
Saglabāt