class OrderModel {
  int uid;
  String nickname;
  bool hidOrder;
  String ordId;
  String providerOid;
  String itemId;
  int itemNum;
  String itemTitle;
  String itemPrice;
  String provider;
  String paidPrice;
  int orderType;
  String userCommission;
  String userCommissionRate;
  String reason;
  int state;
  String createAt;
  String updateAt;
  String confirmAt;
  String settleAt;
  String thumbnail;
  int priceType;
  String priceName;
  Map<String, dynamic> data; // 保存原始数据

  OrderModel({
    this.uid,
    this.nickname,
    this.hidOrder,
    this.ordId,
    this.providerOid,
    this.itemId,
    this.itemNum,
    this.itemTitle,
    this.itemPrice,
    this.provider,
    this.paidPrice,
    this.orderType,
    this.userCommission,
    this.userCommissionRate,
    this.reason,
    this.state,
    this.createAt,
    this.updateAt,
    this.confirmAt,
    this.settleAt,
    this.thumbnail,
    this.data,
  });

  OrderModel.fromJson(Map<String, dynamic> json) {
    uid = json['uid'];
    nickname = json['nickname'];
    hidOrder = json['hid_order'];
    ordId = json['ord_id'];
    providerOid = json['provider_oid'];
    itemId = json['item_id'];
    itemNum = json['item_num'];
    itemTitle = json['item_title'];
    itemPrice = json['item_price'];
    provider = json['provider'];
    paidPrice = json['paid_price'];
    orderType = json['order_type'];
    userCommission = json['user_commission'];
    userCommissionRate = json['user_commission_rate'];
    reason = json['reason'];
    state = json['state'];
    createAt = json['create_at'];
    updateAt = json['update_at'];
    confirmAt = json['confirm_at'];
    settleAt = json['settle_at'];
    thumbnail = json['thumbnail'];
    priceType=json['price_type'];
    priceName=json['price_name'];
    data = json;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['uid'] = this.uid;
    data['nickname'] = this.nickname;
    data['hid_order'] = this.hidOrder;
    data['ord_id'] = this.ordId;
    data['provider_oid'] = this.providerOid;
    data['item_id'] = this.itemId;
    data['item_num'] = this.itemNum;
    data['item_title'] = this.itemTitle;
    data['item_price'] = this.itemPrice;
    data['provider'] = this.provider;
    data['paid_price'] = this.paidPrice;
    data['order_type'] = this.orderType;
    data['user_commission'] = this.userCommission;
    data['user_commission_rate'] = this.userCommissionRate;
    data['reason'] = this.reason;
    data['state'] = this.state;
    data['create_at'] = this.createAt;
    data['update_at'] = this.updateAt;
    data['confirm_at'] = this.confirmAt;
    data['settle_at'] = this.settleAt;
    data['thumbnail'] = this.thumbnail;
    return data;
  }
}
