import 'package:zhiying_base_widget/dialog/global_dialog/intellect_search_goods_dialog/model/no_goods_dialog_style_model.dart';
import 'package:zhiying_comm/zhiying_comm.dart';

class HomeAuthModel {
  String name;
  String desc;
  String moduleType;
  String moduleKey;
  String isTopMargin;
  String isLeftRightMargin;
  String isShow;
  String topMargin;
  String leftRightMargin;
  String topLeftRadius;
  String topRightRadius;
  String bottomLeftRadius;
  String bottomRightRadius;
  String isAuditAfterShow;
  ListStyle listStyle;

  HomeAuthModel(
      {this.name,
        this.desc,
        this.moduleType,
        this.moduleKey,
        this.isTopMargin,
        this.isLeftRightMargin,
        this.isShow,
        this.topMargin,
        this.leftRightMargin,
        this.topLeftRadius,
        this.topRightRadius,
        this.bottomLeftRadius,
        this.bottomRightRadius,
        this.isAuditAfterShow,
        this.listStyle});

  HomeAuthModel.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    desc = json['desc'];
    moduleType = json['module_type'];
    moduleKey = json['module_key'];
    isTopMargin = json['is_top_margin'];
    isLeftRightMargin = json['is_left_right_margin'];
    isShow = json['is_show'];
    topMargin = json['top_margin'];
    leftRightMargin = json['left_right_margin'];
    topLeftRadius = json['top_left_radius'];
    topRightRadius = json['top_right_radius'];
    bottomLeftRadius = json['bottom_left_radius'];
    bottomRightRadius = json['bottom_right_radius'];
    isAuditAfterShow = json['is_audit_after_show'];
    listStyle = json['list_style'] != null
        ? new ListStyle.fromJson(json['list_style'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['desc'] = this.desc;
    data['module_type'] = this.moduleType;
    data['module_key'] = this.moduleKey;
    data['is_top_margin'] = this.isTopMargin;
    data['is_left_right_margin'] = this.isLeftRightMargin;
    data['is_show'] = this.isShow;
    data['top_margin'] = this.topMargin;
    data['left_right_margin'] = this.leftRightMargin;
    data['top_left_radius'] = this.topLeftRadius;
    data['top_right_radius'] = this.topRightRadius;
    data['bottom_left_radius'] = this.bottomLeftRadius;
    data['bottom_right_radius'] = this.bottomRightRadius;
    data['is_audit_after_show'] = this.isAuditAfterShow;
    if (this.listStyle != null) {
      data['list_style'] = this.listStyle.toJson();
    }
    return data;
  }
}

class ListStyle {
  Before before;
  Before after;

  ListStyle({this.before, this.after});

  ListStyle.fromJson(Map<String, dynamic> json) {
    before =
    json['before'] != null ? new Before.fromJson(json['before']) : null;
    after = json['after'] != null ? new Before.fromJson(json['after']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.before != null) {
      data['before'] = this.before.toJson();
    }
    if (this.after != null) {
      data['after'] = this.after.toJson();
    }
    return data;
  }
}

class Before extends SkipModel{
  String auditImg;
  String contentText;
  String contentTextColor;
  String bgColor;
  String btnText;
  String btnTextColor;
  String btnBgColor;
  String requiredLogin;
  String requiredTaobaoAuth;
  String skipIdentifier;

  Before(
      {this.auditImg,
        this.contentText,
        this.contentTextColor,
        this.bgColor,
        this.btnText,
        this.btnTextColor,
        this.btnBgColor,
        this.requiredLogin,
        this.requiredTaobaoAuth,
        this.skipIdentifier});

  Before.fromJson(Map<String, dynamic> json) {
    super.fromJson(json);
    auditImg = json['audit_img'];
    contentText = json['content_text'];
    contentTextColor = json['content_text_color'];
    bgColor = json['bg_color'];
    btnText = json['btn_text'];
    btnTextColor = json['btn_text_color'];
    btnBgColor = json['btn_bg_color'];
    requiredLogin = json['required_login'];
    requiredTaobaoAuth = json['required_taobao_auth'];
    skipIdentifier = json['skip_identifier'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = super.toJson();
    data['audit_img'] = this.auditImg;
    data['content_text'] = this.contentText;
    data['content_text_color'] = this.contentTextColor;
    data['bg_color'] = this.bgColor;
    data['btn_text'] = this.btnText;
    data['btn_text_color'] = this.btnTextColor;
    data['btn_bg_color'] = this.btnBgColor;
    data['required_login'] = this.requiredLogin;
    data['required_taobao_auth'] = this.requiredTaobaoAuth;
    data['skip_identifier'] = this.skipIdentifier;
    return data;
  }
}
