class HomeGoodsListStyleModel {
  List<String> hotRankIconList;
  String topMargin;
  String leftRighMargin;
  List<HomeGoodsStyleModelProviders> providers;
  String titleColor;
  String currentPriceColor;
  String marketPriceColor;
  String shopNameColor;
  String saleCountColor;
  String saleCountText;
  String shopIcon;
  HomeGoodsStyleModelCouponCommission couponCommission;
  HomeGoodsStyleModelHotRank hotRank;

  HomeGoodsListStyleModel(
      {this.hotRankIconList,
      this.topMargin,
      this.leftRighMargin,
      this.providers,
      this.titleColor,
      this.currentPriceColor,
      this.marketPriceColor,
      this.shopNameColor,
      this.saleCountColor,
      this.saleCountText,
      this.shopIcon,
      this.couponCommission,
      this.hotRank});

  HomeGoodsListStyleModel.fromJson(Map<String, dynamic> json) {
    hotRankIconList = json['hot_rank_icon_list'].cast<String>();
    topMargin = json['top_margin'];
    leftRighMargin = json['left_righ_margin'];
    if (json['providers'] != null) {
      providers = new List<HomeGoodsStyleModelProviders>();
      json['providers'].forEach((v) {
        providers.add(new HomeGoodsStyleModelProviders.fromJson(v));
      });
    }
    titleColor = json['title_color'];
    currentPriceColor = json['current_price_color'];
    marketPriceColor = json['market_price_color'];
    shopNameColor = json['shop_name_color'];
    saleCountColor = json['sale_count_color'];
    saleCountText = json['sale_count_text'];
    shopIcon = json['shop_icon'];
    couponCommission = json['coupon_commission'] != null
        ? new HomeGoodsStyleModelCouponCommission.fromJson(
            json['coupon_commission'])
        : null;
    hotRank = json['hot_rank'] != null
        ? new HomeGoodsStyleModelHotRank.fromJson(json['hot_rank'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['hot_rank_icon_list'] = this.hotRankIconList;
    data['top_margin'] = this.topMargin;
    data['left_righ_margin'] = this.leftRighMargin;
    if (this.providers != null) {
      data['providers'] = this.providers.map((v) => v.toJson()).toList();
    }
    data['title_color'] = this.titleColor;
    data['current_price_color'] = this.currentPriceColor;
    data['market_price_color'] = this.marketPriceColor;
    data['shop_name_color'] = this.shopNameColor;
    data['sale_count_color'] = this.saleCountColor;
    data['sale_count_text'] = this.saleCountText;
    data['shop_icon'] = this.shopIcon;
    if (this.couponCommission != null) {
      data['coupon_commission'] = this.couponCommission.toJson();
    }
    if (this.hotRank != null) {
      data['hot_rank'] = this.hotRank.toJson();
    }
    return data;
  }
}

class HomeGoodsStyleModelProviders {
  String type;
  String providerNameColor;
  String providerBgColor;

  HomeGoodsStyleModelProviders(
      {this.type, this.providerNameColor, this.providerBgColor});

  HomeGoodsStyleModelProviders.fromJson(Map<String, dynamic> json) {
    type = json['type']?.toString();
    providerNameColor = json['provider_name_color']?.toString();
    providerBgColor = json['provider_bg_color']?.toString();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['type'] = this.type;
    data['provider_name_color'] = this.providerNameColor;
    data['provider_bg_color'] = this.providerBgColor;
    return data;
  }
}

class HomeGoodsStyleModelCouponCommission {
  HomeGoodsStyleModelCoupon coupon;
  HomeGoodsStyleModelCommission commission;

  HomeGoodsStyleModelCouponCommission({this.coupon, this.commission});

  HomeGoodsStyleModelCouponCommission.fromJson(Map<String, dynamic> json) {
    coupon = json['left'] != null
        ? new HomeGoodsStyleModelCoupon.fromJson(json['left'])
        : null;
    commission = json['right'] != null
        ? new HomeGoodsStyleModelCommission.fromJson(json['right'])
        : null;
  }

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

class HomeGoodsStyleModelCoupon {
  String couonText;
  String couponFontColor;
  String couponBgColor;
  String couponBgImg;
  String isImg;

  HomeGoodsStyleModelCoupon(
      {this.couonText,
      this.couponFontColor,
      this.couponBgColor,
      this.couponBgImg,
      this.isImg});

  HomeGoodsStyleModelCoupon.fromJson(Map<String, dynamic> json) {
    couonText = json['couon_text']?.toString();
    couponFontColor = json['coupon_font_color']?.toString();
    couponBgColor = json['coupon_bg_color']?.toString();
    couponBgImg = json['coupon_bg_img']?.toString();
    isImg = json['is_img']?.toString();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['couon_text'] = this.couonText;
    data['coupon_font_color'] = this.couponFontColor;
    data['coupon_bg_color'] = this.couponBgColor;
    data['coupon_bg_img'] = this.couponBgImg;
    data['is_img'] = this.isImg;
    return data;
  }
}

class HomeGoodsStyleModelCommission {
  String commissionText;
  String commissionFontColor;
  String commissionBgColor;
  String commissionBgImg;
  String isImg;

  HomeGoodsStyleModelCommission(
      {this.commissionText,
      this.commissionFontColor,
      this.commissionBgColor,
      this.commissionBgImg,
      this.isImg});

  HomeGoodsStyleModelCommission.fromJson(Map<String, dynamic> json) {
    commissionText = json['commission_text']?.toString();
    commissionFontColor = json['commission_font_color']?.toString();
    commissionBgColor = json['commission_bg_color']?.toString();
    commissionBgImg = json['commission_bg_img']?.toString();
    isImg = json['is_img']?.toString();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['commission_text'] = this.commissionText;
    data['commission_font_color'] = this.commissionFontColor;
    data['commission_bg_color'] = this.commissionBgColor;
    data['commission_bg_img'] = this.commissionBgImg;
    data['is_img'] = this.isImg;
    return data;
  }
}

class HomeGoodsStyleModelHotRank {
  String isOpen;
  String bgColor;
  String fontColor;
  String hotSaleImg;
  String buyNowImg;

  HomeGoodsStyleModelHotRank(
      {this.isOpen,
      this.bgColor,
      this.fontColor,
      this.hotSaleImg,
      this.buyNowImg});

  HomeGoodsStyleModelHotRank.fromJson(Map<String, dynamic> json) {
    isOpen = json['is_open']?.toString();
    bgColor = json['bg_color']?.toString();
    fontColor = json['font_color']?.toString();
    hotSaleImg = json['hot_sale_img']?.toString();
    buyNowImg = json['buy_now_img']?.toString();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['is_open'] = this.isOpen;
    data['bg_color'] = this.bgColor;
    data['font_color'] = this.fontColor;
    data['hot_sale_img'] = this.hotSaleImg;
    data['buy_now_img'] = this.buyNowImg;
    return data;
  }
}
