Browse Source

1、添加不跳转参数

tags/0.0.3+6^0
PH2 3 years ago
parent
commit
fe2f6fb25f
2 changed files with 14 additions and 5 deletions
  1. +10
    -5
      lib/models/base/skip_model.dart
  2. +4
    -0
      lib/util/router_util.dart

+ 10
- 5
lib/models/base/skip_model.dart View File

@@ -3,12 +3,15 @@ class SkipModel {
String requiredLogin; String requiredLogin;
String requiredTaobaoAuth; String requiredTaobaoAuth;
String skipIdentifier; String skipIdentifier;
String isJump;


SkipModel(
{this.url,
this.requiredLogin,
this.requiredTaobaoAuth,
this.skipIdentifier});
SkipModel({
this.url,
this.requiredLogin,
this.requiredTaobaoAuth,
this.skipIdentifier,
this.isJump
});


SkipModel.fromJson(Map<String, dynamic> json) { SkipModel.fromJson(Map<String, dynamic> json) {
fromJson(json); fromJson(json);
@@ -19,6 +22,7 @@ class SkipModel {
requiredLogin = json['required_login']?.toString(); requiredLogin = json['required_login']?.toString();
requiredTaobaoAuth = json['required_taobao_auth']?.toString(); requiredTaobaoAuth = json['required_taobao_auth']?.toString();
skipIdentifier = json['skip_identifier']; skipIdentifier = json['skip_identifier'];
isJump = json['is_jump']?.toString();
} }


Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@@ -27,6 +31,7 @@ class SkipModel {
data['required_login'] = this.requiredLogin; data['required_login'] = this.requiredLogin;
data['required_taobao_auth'] = this.requiredTaobaoAuth; data['required_taobao_auth'] = this.requiredTaobaoAuth;
data['skip_identifier'] = this.skipIdentifier; data['skip_identifier'] = this.skipIdentifier;
data['is_jump'] = this.isJump;
return data; return data;
} }
} }

+ 4
- 0
lib/util/router_util.dart View File

@@ -21,6 +21,10 @@ class RouterUtil {
print('skipIdentifier 参数不存在,无法跳转页面'); print('skipIdentifier 参数不存在,无法跳转页面');
return Future.error('skipIdentifier 参数不存在,无法跳转页面'); return Future.error('skipIdentifier 参数不存在,无法跳转页面');
} }
// is_jump等于0不跳转
if(!EmptyUtil.isEmpty(skipModel.isJump) && skipModel.isJump == '0') {
return;
}
print('skipIdentifier: ${skipModel.skipIdentifier}'); print('skipIdentifier: ${skipModel.skipIdentifier}');
hideKeyboard(context); hideKeyboard(context);
if (skipModel?.requiredLogin == '1') { if (skipModel?.requiredLogin == '1') {


Loading…
Cancel
Save