class CounponModel {
  String bg_img;
  String coupon_endtime;
  String coupon_price;
  String coupon_price_color;
  String coupon_time_color;
  String coupon_title;
  String coupon_title_color;
  String coupon_url;
  String price_type;
  String price_type_color;
  String buy_url;
  String provider;
  String goood_id;
  ConvertArgs convertArgs;

  CounponModel({
    this.goood_id,
    this.provider,
    this.bg_img,
    this.coupon_endtime,
    this.coupon_price,
    this.coupon_price_color,
    this.coupon_time_color,
    this.coupon_title,
    this.coupon_title_color,
    this.coupon_url,
    this.price_type,
    this.price_type_color,
    this.buy_url,
    this.convertArgs,
  });

  factory CounponModel.fromJson(Map<String, dynamic> json) {
    return CounponModel(
      goood_id: json['goood_id'],
      provider: json['provider'],
      bg_img: json['bg_img'],
      coupon_endtime: json['coupon_endtime'],
      coupon_price: json['coupon_price'],
      coupon_price_color: json['coupon_price_color'],
      coupon_time_color: json['coupon_time_color'],
      coupon_title: json['coupon_title'],
      coupon_title_color: json['coupon_title_color'],
      coupon_url: json['coupon_url'],
      price_type: json['price_type'],
      price_type_color: json['price_type_color'],
      buy_url: json['buy_url'],
      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['bg_img'] = this.bg_img;
    data['coupon_endtime'] = this.coupon_endtime;
    data['coupon_price'] = this.coupon_price;
    data['coupon_price_color'] = this.coupon_price_color;
    data['coupon_time_color'] = this.coupon_time_color;
    data['coupon_title'] = this.coupon_title;
    data['coupon_title_color'] = this.coupon_title_color;
    data['coupon_url'] = this.coupon_url;
    data['price_type'] = this.price_type;
    data['price_type_color'] = this.price_type_color;
    data['buy_url'] = this.buy_url;
    data['provider'] = this.provider;
    data['goood_id'] = this.goood_id;
    if (this.convertArgs != null) {
      data['convert_args'] = this.convertArgs.toJson();
    }

    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;
  }
}

