diff --git a/lib/widgets/mine/mine_data/mine_data_widget.dart b/lib/widgets/mine/mine_data/mine_data_widget.dart index 8bab92a..a1e6e2e 100644 --- a/lib/widgets/mine/mine_data/mine_data_widget.dart +++ b/lib/widgets/mine/mine_data/mine_data_widget.dart @@ -123,12 +123,7 @@ class MineDataWidget extends StatelessWidget { ), ), onTap: () { - SkipModel skipModel = SkipModel( - skipIdentifier: 'pub.flutter.cash_out', - requiredLogin: '1', - requiredTaobaoAuth: '0', - ); - RouterUtil.route(skipModel, skipModel.toJson(), context); + RouterUtil.route(_style, _style.toJson(), context); }, ) ], diff --git a/lib/widgets/mine/mine_data/model/mine_data_model.dart b/lib/widgets/mine/mine_data/model/mine_data_model.dart index 93cc50b..918b6ff 100644 --- a/lib/widgets/mine/mine_data/model/mine_data_model.dart +++ b/lib/widgets/mine/mine_data/model/mine_data_model.dart @@ -1,15 +1,13 @@ import 'package:zhiying_base_widget/widgets/mine/mine_header/model/mine_profile_model.dart'; +import 'package:zhiying_comm/models/base/skip_model.dart'; -class MineDataModel { +class MineDataModel extends SkipModel { String accumulatedEarningsNameColor; String accumulatedEarningsColor; String accumulatedEarningsBgImg; String btnText; String btnTextColor; String btnImg; - String requiredLogin; - String requiredTaobaoAuth; - String skipIdentifier; String gridViewBgColor; String gridViewNameColor; String gridViewValueColor; @@ -17,20 +15,18 @@ class MineDataModel { MineDataModel( {this.accumulatedEarningsNameColor, - this.accumulatedEarningsColor, - this.accumulatedEarningsBgImg, - this.btnText, - this.btnTextColor, - this.btnImg, - this.requiredLogin, - this.requiredTaobaoAuth, - this.skipIdentifier, - this.gridViewBgColor, - this.gridViewNameColor, - this.gridViewValueColor, - this.gridView}); + this.accumulatedEarningsColor, + this.accumulatedEarningsBgImg, + this.btnText, + this.btnTextColor, + this.btnImg, + this.gridViewBgColor, + this.gridViewNameColor, + this.gridViewValueColor, + this.gridView}); MineDataModel.fromJson(Map json) { + super.fromJson(json); accumulatedEarningsNameColor = json['accumulated_earnings_name_color']; accumulatedEarningsColor = json['accumulated_earnings_color']; accumulatedEarningsBgImg = json['accumulated_earnings_bg_img']; @@ -52,7 +48,7 @@ class MineDataModel { } Map toJson() { - final Map data = new Map(); + final Map data = super.toJson(); data['accumulated_earnings_name_color'] = this.accumulatedEarningsNameColor; data['accumulated_earnings_color'] = this.accumulatedEarningsColor; data['accumulated_earnings_bg_img'] = this.accumulatedEarningsBgImg; diff --git a/lib/widgets/wallet/wallet_data/model/wallet_header_model.dart b/lib/widgets/wallet/wallet_data/model/wallet_header_model.dart index 68cb2d0..adcce00 100644 --- a/lib/widgets/wallet/wallet_data/model/wallet_header_model.dart +++ b/lib/widgets/wallet/wallet_data/model/wallet_header_model.dart @@ -1,4 +1,6 @@ -class WalletHeaderModel { +import 'package:zhiying_comm/zhiying_comm.dart'; + +class WalletHeaderModel extends SkipModel { String headerImg; String headerAvatar; String headerCashOutText; @@ -9,14 +11,15 @@ class WalletHeaderModel { WalletHeaderModel( {this.headerImg, - this.headerAvatar, - this.headerCashOutText, - this.headerCashOutTextColor, - this.headerCashOutKey, - this.headerCashOutBtnImg, - this.headerBottomList}); + this.headerAvatar, + this.headerCashOutText, + this.headerCashOutTextColor, + this.headerCashOutKey, + this.headerCashOutBtnImg, + this.headerBottomList}); WalletHeaderModel.fromJson(Map json) { + super.fromJson(json); headerImg = json['header_img']; headerAvatar = json['header_avatar']; headerCashOutText = json['header_cash_out_text']; @@ -32,7 +35,7 @@ class WalletHeaderModel { } Map toJson() { - final Map data = new Map(); + final Map data = super.toJson(); data['header_img'] = this.headerImg; data['header_avatar'] = this.headerAvatar; data['header_cash_out_text'] = this.headerCashOutText; diff --git a/lib/widgets/wallet/wallet_data/wallet_data.dart b/lib/widgets/wallet/wallet_data/wallet_data.dart index c221c65..789f0b0 100644 --- a/lib/widgets/wallet/wallet_data/wallet_data.dart +++ b/lib/widgets/wallet/wallet_data/wallet_data.dart @@ -107,13 +107,8 @@ class _WalletDataState extends State { ), GestureDetector( onTap: () { - SkipModel skipModel = SkipModel( - skipIdentifier: 'pub.flutter.cash_out', - requiredLogin: '1', - requiredTaobaoAuth: '0', - ); RouterUtil.route( - skipModel, skipModel.toJson(), context); + model, model.toJson(), context); }, child: Container( decoration: BoxDecoration(