CouponDataExpirationDate.dart 9.22 KB
/*
 Flutter3.x完全开发手册 https://www.flutterschool.cn/
*/
import 'dart:convert';

class ADataExpirationDate {
/*
{
  "valid_forever": "0",
  "stime": "1741536000",
  "etime": "1742486399"
} 
*/

  String? validForever;
  String? stime;
  String? etime;

  ADataExpirationDate({
    this.validForever,
    this.stime,
    this.etime,
  });
  ADataExpirationDate.fromJson(Map<String, dynamic> json) {
    validForever = json['valid_forever']?.toString();
    stime = json['stime']?.toString();
    etime = json['etime']?.toString();
  }
  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['valid_forever'] = validForever;
    data['stime'] = stime;
    data['etime'] = etime;
    return data;
  }
}

class ADataAexpiration {
/*
{
  "valid_forever": "0",
  "stime": "1741536000",
  "etime": "1742659199",
  "today": null,
  "tomorrow": null,
  "sday": null,
  "eday": null
} 
*/

  String? validForever;
  String? stime;
  String? etime;
  String? today;
  String? tomorrow;
  String? sday;
  String? eday;

  ADataAexpiration({
    this.validForever,
    this.stime,
    this.etime,
    this.today,
    this.tomorrow,
    this.sday,
    this.eday,
  });
  ADataAexpiration.fromJson(Map<String, dynamic> json) {
    validForever = json['valid_forever']?.toString();
    stime = json['stime']?.toString();
    etime = json['etime']?.toString();
    today = json['today']?.toString();
    tomorrow = json['tomorrow']?.toString();
    sday = json['sday']?.toString();
    eday = json['eday']?.toString();
  }
  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['valid_forever'] = validForever;
    data['stime'] = stime;
    data['etime'] = etime;
    data['today'] = today;
    data['tomorrow'] = tomorrow;
    data['sday'] = sday;
    data['eday'] = eday;
    return data;
  }
}

class ADataArule {
/*
{
  "is_same_day": "1",
  "is_accumulation": "1",
  "is_compartment": "1",
  "is_eatin": "1",
  "is_takeout": "1",
  "is_appointment": "1",
  "is_share_lose": "1",
  "is_share_have": "1"
} 
*/

  String? isSameDay;
  String? isAccumulation;
  String? isCompartment;
  String? isEatin;
  String? isTakeout;
  String? isAppointment;
  String? isShareLose;
  String? isShareHave;

  ADataArule({
    this.isSameDay,
    this.isAccumulation,
    this.isCompartment,
    this.isEatin,
    this.isTakeout,
    this.isAppointment,
    this.isShareLose,
    this.isShareHave,
  });
  ADataArule.fromJson(Map<String, dynamic> json) {
    isSameDay = json['is_same_day']?.toString();
    isAccumulation = json['is_accumulation']?.toString();
    isCompartment = json['is_compartment']?.toString();
    isEatin = json['is_eatin']?.toString();
    isTakeout = json['is_takeout']?.toString();
    isAppointment = json['is_appointment']?.toString();
    isShareLose = json['is_share_lose']?.toString();
    isShareHave = json['is_share_have']?.toString();
  }
  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['is_same_day'] = isSameDay;
    data['is_accumulation'] = isAccumulation;
    data['is_compartment'] = isCompartment;
    data['is_eatin'] = isEatin;
    data['is_takeout'] = isTakeout;
    data['is_appointment'] = isAppointment;
    data['is_share_lose'] = isShareLose;
    data['is_share_have'] = isShareHave;
    return data;
  }
}

class AData {
/*
{
  "id": "1088",
  "uid": "7035",
  "sellerid": "4352",
  "uid_list": null,
  "is_type": "3",
  "is_examine": "1",
  "aname": "名称测试",
  "desc": "200",
  "stime": null,
  "etime": null,
  "explain": "",
  "is_open": "1",
  "price": "200",
  "use": null,
  "status": "1",
  "grant_num": "100",
  "grant_last": "100",
  "urllink": "https://wxaurl.cn/7Dg2wrL8K2p",
  "lite_qrcode": "https://xt04.colorcun.com/activity/LiteQRcode/activity_1088.jpeg",
  "arule": {
    "is_same_day": "1",
    "is_accumulation": "1",
    "is_compartment": "1",
    "is_eatin": "1",
    "is_takeout": "1",
    "is_appointment": "1",
    "is_share_lose": "1",
    "is_share_have": "1"
  },
  "aexpiration": {
    "valid_forever": "0",
    "stime": "1741536000",
    "etime": "1742659199",
    "today": null,
    "tomorrow": null,
    "sday": null,
    "eday": null
  },
  "expiration_date": {
    "valid_forever": "0",
    "stime": "1741536000",
    "etime": "1742486399"
  },
  "cdate": "1741594601"
} 
*/

  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;
  String? use;
  String? status;
  String? grantNum;
  String? grantLast;
  String? urllink;
  String? liteQrcode;
  ADataArule? arule;
  ADataAexpiration? aexpiration;
  ADataExpirationDate? expirationDate;
  String? cdate;

  AData({
    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.status,
    this.grantNum,
    this.grantLast,
    this.urllink,
    this.liteQrcode,
    this.arule,
    this.aexpiration,
    this.expirationDate,
    this.cdate,
  });
  AData.fromJson(Map<String, dynamic> json) {
    id = json['id']?.toString();
    uid = json['uid']?.toString();
    sellerid = json['sellerid']?.toString();
    uidList = json['uid_list']?.toString();
    isType = json['is_type']?.toString();
    isExamine = json['is_examine']?.toString();
    aname = json['aname']?.toString();
    desc = json['desc']?.toString();
    stime = json['stime']?.toString();
    etime = json['etime']?.toString();
    explain = json['explain']?.toString();
    isOpen = json['is_open']?.toString();
    price = json['price']?.toString();
    use = json['use']?.toString();
    status = json['status']?.toString();
    grantNum = json['grant_num']?.toString();
    grantLast = json['grant_last']?.toString();
    urllink = json['urllink']?.toString();
    liteQrcode = json['lite_qrcode']?.toString();
    arule = (json['arule'] != null) ? ADataArule.fromJson(json['arule']) : null;
    aexpiration = (json['aexpiration'] != null) ? (json['aexpiration'] is Map)? ADataAexpiration.fromJson(json['aexpiration']):ADataAexpiration.fromJson(jsonDecode(json['aexpiration'])) : null;
    expirationDate = (json['expiration_date'] != null) ?(json['expiration_date'] is Map)? ADataExpirationDate.fromJson(json['expiration_date']): ADataExpirationDate.fromJson(jsonDecode(json['expiration_date'])) : null;
    cdate = json['cdate']?.toString();
  }
  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['id'] = id;
    data['uid'] = uid;
    data['sellerid'] = sellerid;
    data['uid_list'] = uidList;
    data['is_type'] = isType;
    data['is_examine'] = isExamine;
    data['aname'] = aname;
    data['desc'] = desc;
    data['stime'] = stime;
    data['etime'] = etime;
    data['explain'] = explain;
    data['is_open'] = isOpen;
    data['price'] = price;
    data['use'] = use;
    data['status'] = status;
    data['grant_num'] = grantNum;
    data['grant_last'] = grantLast;
    data['urllink'] = urllink;
    data['lite_qrcode'] = liteQrcode;
    if (arule != null) {
      data['arule'] = arule!.toJson();
    }
    if (aexpiration != null) {
      data['aexpiration'] = aexpiration!.toJson();
    }
    if (expirationDate != null) {
      data['expiration_date'] = expirationDate!.toJson();
    }
    data['cdate'] = cdate;
    return data;
  }
}

class A {
/*
{
  "ret": 200,
  "data": [
    {
      "id": "1088",
      "uid": "7035",
      "sellerid": "4352",
      "uid_list": null,
      "is_type": "3",
      "is_examine": "1",
      "aname": "名称测试",
      "desc": "200",
      "stime": null,
      "etime": null,
      "explain": "",
      "is_open": "1",
      "price": "200",
      "use": null,
      "status": "1",
      "grant_num": "100",
      "grant_last": "100",
      "urllink": "https://wxaurl.cn/7Dg2wrL8K2p",
      "lite_qrcode": "https://xt04.colorcun.com/activity/LiteQRcode/activity_1088.jpeg",
      "arule": {
        "is_same_day": "1",
        "is_accumulation": "1",
        "is_compartment": "1",
        "is_eatin": "1",
        "is_takeout": "1",
        "is_appointment": "1",
        "is_share_lose": "1",
        "is_share_have": "1"
      },
      "aexpiration": {
        "valid_forever": "0",
        "stime": "1741536000",
        "etime": "1742659199",
        "today": null,
        "tomorrow": null,
        "sday": null,
        "eday": null
      },
      "expiration_date": {
        "valid_forever": "0",
        "stime": "1741536000",
        "etime": "1742486399"
      },
      "cdate": "1741594601"
    }
  ],
  "msg": ""
} 
*/

  int? ret;
  List<AData?>? data;
  String? msg;

  A({
    this.ret,
    this.data,
    this.msg,
  });
  A.fromJson(Map<String, dynamic> json) {
    ret = json['ret']?.toInt();
  if (json['data'] != null) {
  final v = json['data'];
  final arr0 = <AData>[];
  v.forEach((v) {
  arr0.add(AData.fromJson(v));
  });
    this.data = arr0;
    }
    msg = json['msg']?.toString();
  }
  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['ret'] = ret;
    if (this.data != null) {
      final v = this.data;
      final arr0 = [];
  v!.forEach((v) {
  arr0.add(v!.toJson());
  });
      data['data'] = arr0;
    }
    data['msg'] = msg;
    return data;
  }
}