class GoodsDetailsTitleModel {
  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 bgColor;
  String newPriceColor;
  String originalPriceColor;
  String couponText;
  String couponTextColor;
  String saleTextColor;
  String titleTextColor;
  String rewardBgColor;
  String rewardTextColor;
  String rewardStr;
  List<PlatformCss> platformCss;
  List<String> sourceList;
  String goBuyText;
  String goBuyColor;


  String currentPrice;
  String isCoupon;
  String marketPrice;
  String point;
  String soldCount;
  String title;

  String provider;
  String good_id;

  GoodsDetailsTitleModel(
      {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.bgColor,
        this.newPriceColor,
        this.originalPriceColor,
        this.couponText,
        this.couponTextColor,
        this.saleTextColor,
        this.titleTextColor,
        this.rewardBgColor,
        this.rewardTextColor,
        this.rewardStr,
        this.platformCss,
        this.sourceList,
        this.goBuyText,
        this.goBuyColor,

        this.currentPrice,
        this.isCoupon,
        this.marketPrice,
        this.point,
        this.soldCount,
        this.title,

        this.good_id,
        this.provider,
      });

  GoodsDetailsTitleModel.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'];
    bgColor = json['bg_color'];
    newPriceColor = json['new_price_color'];
    originalPriceColor = json['original_price_color'];
    couponText = json['coupon_text'];
    couponTextColor = json['coupon_text_color'];
    saleTextColor = json['sale_text_color'];
    titleTextColor = json['title_text_color'];
    rewardBgColor = json['reward_bg_color'];
    rewardTextColor = json['reward_text_color'];
    rewardStr = json['reward_str'];
    if (json['platform_css'] != null) {
      platformCss = new List<PlatformCss>();
      json['platform_css'].forEach((v) {
        platformCss.add(new PlatformCss.fromJson(v));
      });
    }
    sourceList = json['source_list'].cast<String>();
    goBuyText = json['go_buy_text'];
    goBuyColor = json['go_buy_text_color'];

    currentPrice = json['current_price'];
    isCoupon = json['is_coupon'];
    marketPrice = json['market_price'];
    point = json['point'];
    soldCount = json['sold_count'];
    title = json['title'];

    good_id = json['good_id'];
    provider = json['provider'];
  }

  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['bg_color'] = this.bgColor;
    data['new_price_color'] = this.newPriceColor;
    data['original_price_color'] = this.originalPriceColor;
    data['coupon_text'] = this.couponText;
    data['coupon_text_color'] = this.couponTextColor;
    data['sale_text_color'] = this.saleTextColor;
    data['title_text_color'] = this.titleTextColor;
    data['reward_bg_color'] = this.rewardBgColor;
    data['reward_text_color'] = this.rewardTextColor;
    data['reward_str'] = this.rewardStr;
    if (this.platformCss != null) {
      data['platform_css'] = this.platformCss.map((v) => v.toJson()).toList();
    }
    data['source_list'] = this.sourceList;
    data['go_buy_text'] = this.goBuyText;
    data['go_buy_text_color'] = this.goBuyColor;

    data['current_price'] = this.currentPrice;
    data['is_coupon'] = this.isCoupon;
    data['market_price'] = this.marketPrice;
    data['point'] = this.point;
    data['sold_count'] = this.soldCount;
    data['title'] = this.title;

    data['provider'] = this.provider;
    data['good_id'] = this.good_id;

    return data;
  }
}

class PlatformCss {
  String name;
  String type;
  String textColor;
  String bgColor;

  PlatformCss({this.name, this.type, this.textColor, this.bgColor});

  PlatformCss.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    type = json['type'];
    textColor = json['text_color'];
    bgColor = json['bg_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['type'] = this.type;
    data['text_color'] = this.textColor;
    data['bg_color'] = this.bgColor;
    return data;
  }
}
