class GoodsDetailsFooterModel {
  String collect;
  String collect_color;
  String collect_icon;
  String collected_icon;
  String home;
  String home_color;
  String home_icon;
  String save_earn;
  String save_earn_bg1_color;
  String save_earn_bg2_color;
  String save_earn_color;
  String save_earn_val_color;
  String share_earn;
  String share_earn_bg1_color;
  String share_earn_bg2_color;
  String share_earn_color;
  String share_earn_val_color;
  String share_value;
  String self_buy_value;

  String isFav;
  String buyUrl;
  String shareUrl;
  FavArgs favArgs;
  ShareUrlArgs shareUrlArgs;

  String provider;
  String good_id;
  ConvertArgs convertArgs;

  GoodsDetailsFooterModel({
    this.buyUrl,
    this.favArgs,
    this.isFav,
    this.shareUrl,
    this.shareUrlArgs,
    this.collect,
    this.collect_color,
    this.collect_icon,
    this.home,
    this.home_color,
    this.home_icon,
    this.save_earn,
    this.save_earn_bg1_color,
    this.save_earn_bg2_color,
    this.save_earn_color,
    this.save_earn_val_color,
    this.share_earn,
    this.share_earn_bg1_color,
    this.share_earn_bg2_color,
    this.share_earn_color,
    this.share_earn_val_color,
    this.share_value,
    this.self_buy_value,
    this.collected_icon,
    this.good_id,
    this.provider,
    this.convertArgs,
  });

  factory GoodsDetailsFooterModel.fromJson(Map<String, dynamic> json) {
    return GoodsDetailsFooterModel(
      isFav: json['is_fav'],
      buyUrl: json['buy_url'],
      shareUrl: json['share_url'],
      favArgs: json['fav_args'] != null ? new FavArgs.fromJson(json['fav_args']) : null,
      shareUrlArgs: json['share_url_args'] != null ? new ShareUrlArgs.fromJson(json['share_url_args']) : null,
      collect: json['collect'],
      collect_color: json['collect_color'],
      collect_icon: json['collect_icon'],
      home: json['home'],
      home_color: json['home_color'],
      home_icon: json['home_icon'],
      save_earn: json['save_earn'],
      save_earn_bg1_color: json['save_earn_bg1_color'],
      save_earn_bg2_color: json['save_earn_bg2_color'],
      save_earn_color: json['save_earn_color'],
      save_earn_val_color: json['save_earn_val_color'],
      share_earn: json['share_earn'],
      share_earn_bg1_color: json['share_earn_bg1_color'],
      share_earn_bg2_color: json['share_earn_bg2_color'],
      share_earn_color: json['share_earn_color'],
      share_earn_val_color: json['share_earn_val_color'],
      share_value: json['share_value'],
      self_buy_value: json['self_buy_value'],
      collected_icon: json['collected_icon'],
      good_id: json['good_id'],
      provider: json['provider'],
      convertArgs: json['convert_args'] != null ? ConvertArgs.fromJson(json['convert_args']) : null,
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['collect'] = this.collect;
    data['collect_color'] = this.collect_color;
    data['collect_icon'] = this.collect_icon;
    data['home'] = this.home;
    data['home_color'] = this.home_color;
    data['home_icon'] = this.home_icon;
    data['save_earn'] = this.save_earn;
    data['save_earn_bg1_color'] = this.save_earn_bg1_color;
    data['save_earn_bg2_color'] = this.save_earn_bg2_color;
    data['save_earn_color'] = this.save_earn_color;
    data['save_earn_val_color'] = this.save_earn_val_color;
    data['share_earn'] = this.share_earn;
    data['share_earn_bg1_color'] = this.share_earn_bg1_color;
    data['share_earn_bg2_color'] = this.share_earn_bg2_color;
    data['share_earn_color'] = this.share_earn_color;
    data['share_earn_val_color'] = this.share_earn_val_color;
    data['share_value'] = this.share_value;
    data['self_buy_value'] = this.self_buy_value;
    data['collected_icon'] = this.collected_icon;

    data['is_fav'] = this.isFav;
    data['buy_url'] = this.buyUrl;
    data['share_url'] = this.shareUrl;
    if (this.favArgs != null) {
      data['fav_args'] = this.favArgs.toJson();
    }
    if (this.shareUrlArgs != null) {
      data['share_url_args'] = this.shareUrlArgs.toJson();
    }

    data['provider'] = this.provider;
    data['good_id'] = this.good_id;
    if (this.convertArgs != null) {
      data['convert_args'] = this.convertArgs.toJson();
    }

    return data;
  }
}

class FavArgs {
  String provider;
  String providerName;
  String goodId;
  String goodImage;
  String goodTitle;
  String shopName;
  String coupon;
  String couponUrl;
  String commission;
  String marketPrice;
  String currentPrice;
  String inorderCount;
  Null detailData;

  FavArgs(
      {this.provider,
      this.providerName,
      this.goodId,
      this.goodImage,
      this.goodTitle,
      this.shopName,
      this.coupon,
      this.couponUrl,
      this.commission,
      this.marketPrice,
      this.currentPrice,
      this.inorderCount,
      this.detailData});

  FavArgs.fromJson(Map<String, dynamic> json) {
    provider = json['provider'];
    providerName = json['provider_name'];
    goodId = json['good_id'];
    goodImage = json['good_image'];
    goodTitle = json['good_title'];
    shopName = json['shop_name'];
    coupon = json['coupon'];
    couponUrl = json['coupon_url'];
    commission = json['commission'];
    marketPrice = json['market_price'];
    currentPrice = json['current_price'];
    inorderCount = json['inorder_count'];
    detailData = json['detail_data'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['provider'] = this.provider;
    data['provider_name'] = this.providerName;
    data['good_id'] = this.goodId;
    data['good_image'] = this.goodImage;
    data['good_title'] = this.goodTitle;
    data['shop_name'] = this.shopName;
    data['coupon'] = this.coupon;
    data['coupon_url'] = this.couponUrl;
    data['commission'] = this.commission;
    data['market_price'] = this.marketPrice;
    data['current_price'] = this.currentPrice;
    data['inorder_count'] = this.inorderCount;
    data['detail_data'] = this.detailData;
    return data;
  }
}

class ShareUrlArgs {
  String buyUrl;
  String coupon;
  String couponPrice;
  String marketPrice;
  String posterImage;
  String selfbuyCommission;
  String title;
  String type;

  ShareUrlArgs({this.buyUrl, this.coupon, this.couponPrice, this.marketPrice, this.posterImage, this.selfbuyCommission, this.title, this.type});

  ShareUrlArgs.fromJson(Map<String, dynamic> json) {
    buyUrl = json['buy_url'];
    coupon = json['coupon'];
    couponPrice = json['coupon_price'];
    marketPrice = json['market_price'];
    posterImage = json['poster_image'];
    selfbuyCommission = json['selfbuy_commission'];
    title = json['title'];
    type = json['type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['buy_url'] = this.buyUrl;
    data['coupon'] = this.coupon;
    data['coupon_price'] = this.couponPrice;
    data['market_price'] = this.marketPrice;
    data['poster_image'] = this.posterImage;
    data['selfbuy_commission'] = this.selfbuyCommission;
    data['title'] = this.title;
    data['type'] = this.type;
    return data;
  }
}

class ConvertArgs {
  String gid;
  String goodUrl;
  String couponUrl;
  String couponPrice;
  String activityUrl;
  String isShare;

  ConvertArgs({this.gid, this.goodUrl, this.couponUrl, this.couponPrice, this.activityUrl, this.isShare});

  ConvertArgs.fromJson(Map<String, dynamic> json) {
    gid = json['gid'];
    goodUrl = json['good_url'];
    couponUrl = json['coupon_url'];
    couponPrice = json['coupon_price'];
    activityUrl = json['activity_url'];
    isShare = json['is_share'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['gid'] = this.gid;
    data['good_url'] = this.goodUrl;
    data['coupon_url'] = this.couponUrl;
    data['coupon_price'] = this.couponPrice;
    data['activity_url'] = this.activityUrl;
    data['is_share'] = this.isShare;
    return data;
  }
}
