order_recharge_by_id_model.dart 4.76 KB
import 'dart:convert';

import 'package:one_key/models/coupon_model.dart';

class OrderRechargeByidModel {
  int ret;
  OrderRechargeByidSunModel data;
  String msg;

  OrderRechargeByidModel({this.ret, this.data, this.msg});

  OrderRechargeByidModel.fromJson(Map<String, dynamic> json) {
    ret = json['ret'];
    data = json['data'] != null
        ? new OrderRechargeByidSunModel.fromJson(json['data'])
        : null;
    msg = json['msg'];
  }

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

class OrderRechargeByidSunModel {
  String id;
  String sellerid;
  String sellername;
  String orderid;
  String orderNo;
  String rechargeId;
  String rechargeName;
  String isExamine;
  String expDate;
  String qrcode;
  String type;
  String cdate;
  Activity activity;

  OrderRechargeByidSunModel(
      {this.id,
      this.sellerid,
      this.sellername,
      this.orderid,
      this.orderNo,
      this.rechargeId,
      this.rechargeName,
      this.isExamine,
      this.expDate,
      this.qrcode,
      this.type,
      this.cdate,
      this.activity});

  OrderRechargeByidSunModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    sellerid = json['sellerid'];
    sellername = json['sellername'];
    orderid = json['orderid'];
    orderNo = json['order_no'];
    rechargeId = json['recharge_id'];
    rechargeName = json['recharge_name'];
    isExamine = json['is_examine'];
    expDate = json['exp_date'];
    qrcode = json['qrcode'];
    type = json['type'];
    cdate = json['cdate'];
    activity = json['activity'] != null
        ? new Activity.fromJson(json['activity'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['sellerid'] = this.sellerid;
    data['sellername'] = this.sellername;
    data['orderid'] = this.orderid;
    data['order_no'] = this.orderNo;
    data['recharge_id'] = this.rechargeId;
    data['recharge_name'] = this.rechargeName;
    data['is_examine'] = this.isExamine;
    data['exp_date'] = this.expDate;
    data['qrcode'] = this.qrcode;
    data['type'] = this.type;
    data['cdate'] = this.cdate;
    if (this.activity != null) {
      data['activity'] = this.activity.toJson();
    }
    return data;
  }
}

class Activity {
  String id;
  String uid;
  String sellerid;
  String uidList;
  String isType;
  String isExamine;
  String aname;
  String desc;
  String stime;
  String etime;
  String explain;
  String isOpen;
  String price;
  CouponUse use;
  ExpDate expDate;
  String status;
  String cdate;

  Activity(
      {this.id,
      this.uid,
      this.sellerid,
      this.uidList,
      this.isType,
      this.isExamine,
      this.aname,
      this.desc,
      this.stime,
      this.etime,
      this.explain,
      this.isOpen,
      this.price,
      this.use,
      this.expDate,
      this.status,
      this.cdate});

  Activity.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    uid = json['uid'];
    sellerid = json['sellerid'];
    uidList = json['uid_list'];
    isType = json['is_type'];
    isExamine = json['is_examine'];
    aname = json['aname'];
    desc = json['desc'];
    stime = json['stime'];
    etime = json['etime'];
    explain = json['explain'];
    isOpen = json['is_open'];
    price = json['price'];
    // use = json['use'];
    // expDate = json['exp_date'];

    use = json['use'] == null
        ? null
        : (json['use'] is String)
            ? CouponUse.fromJson(jsonDecode(json['use']))
            : (json['use'] is Map)
                ? CouponUse.fromJson(json['use'])
                : null;
    expDate = json['exp_date'] == null
        ? null
        : (json['exp_date'] is String)
            ? ExpDate.fromJson(jsonDecode(json['exp_date']))
            : (json['exp_date'] is Map)
                ? ExpDate.fromJson(json['exp_date'])
                : null;
    status = json['status'];
    cdate = json['cdate'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['uid'] = this.uid;
    data['sellerid'] = this.sellerid;
    data['uid_list'] = this.uidList;
    data['is_type'] = this.isType;
    data['is_examine'] = this.isExamine;
    data['aname'] = this.aname;
    data['desc'] = this.desc;
    data['stime'] = this.stime;
    data['etime'] = this.etime;
    data['explain'] = this.explain;
    data['is_open'] = this.isOpen;
    data['price'] = this.price;
    data['use'] = this.use;
    data['exp_date'] = this.expDate;
    data['status'] = this.status;
    data['cdate'] = this.cdate;
    return data;
  }
}