瀏覽代碼

1、添加不跳转参数

tags/0.0.3+6^0
PH2 3 年之前
父節點
當前提交
fe2f6fb25f
共有 2 個檔案被更改,包括 14 行新增5 行删除
  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 查看文件

@@ -3,12 +3,15 @@ class SkipModel {
String requiredLogin;
String requiredTaobaoAuth;
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) {
fromJson(json);
@@ -19,6 +22,7 @@ class SkipModel {
requiredLogin = json['required_login']?.toString();
requiredTaobaoAuth = json['required_taobao_auth']?.toString();
skipIdentifier = json['skip_identifier'];
isJump = json['is_jump']?.toString();
}

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

+ 4
- 0
lib/util/router_util.dart 查看文件

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


Loading…
取消
儲存