class OrderPageItemStyleModel {
  String textCopy;
  String textOrderNo;
  String textOrderTime;
  String textFinishTime;
  String colorProviderFont;
  String colorProviderBg;
  String colorOrderTypeFont;
  String colorOrderStateFont;
  String colorTitle;
  String colorFont;
  String colorCopyBg;
  String colorTipsBg;
  String colorAmountFont;
  String colorIncomeFont;
  String skipIdentifier;
  List<OrderStateModel> orderState;
  List<OrderTypeModel> orderType;

  OrderPageItemStyleModel(
      {this.textCopy,
      this.textOrderNo,
      this.textOrderTime,
      this.textFinishTime,
      this.colorProviderFont,
      this.colorProviderBg,
      this.colorOrderTypeFont,
      this.colorOrderStateFont,
      this.colorTitle,
      this.colorFont,
      this.colorCopyBg,
      this.colorTipsBg,
      this.colorAmountFont,
      this.colorIncomeFont,
      this.skipIdentifier,
      this.orderState,
      this.orderType});

  OrderPageItemStyleModel.fromJson(Map<String, dynamic> json) {
    textCopy = json['text_copy'];
    textOrderNo = json['text_order_no'];
    textOrderTime = json['text_order_time'];
    textFinishTime = json['text_finish_time'];
    colorProviderFont = json['color_provider_font'];
    colorProviderBg = json['color_provider_bg'];
    colorOrderTypeFont = json['color_order_type_font'];
    colorOrderStateFont = json['color_order_state_font'];
    colorTitle = json['color_title'];
    colorFont = json['color_font'];
    colorCopyBg = json['color_copy_bg'];
    colorTipsBg = json['color_tips_bg'];
    colorAmountFont = json['color_amount_font'];
    colorIncomeFont = json['color_income_font'];
    skipIdentifier = json['skip_identifier'];
    if (json['order_state'] != null) {
      orderState = new List<OrderStateModel>();
      json['order_state'].forEach((v) {
        orderState.add(new OrderStateModel.fromJson(v));
      });
    }
    if (json['order_type'] != null) {
      orderType = new List<OrderTypeModel>();
      json['order_type'].forEach((v) {
        orderType.add(new OrderTypeModel.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['text_copy'] = this.textCopy;
    data['text_order_no'] = this.textOrderNo;
    data['text_order_time'] = this.textOrderTime;
    data['text_finish_time'] = this.textFinishTime;
    data['color_provider_font'] = this.colorProviderFont;
    data['color_provider_bg'] = this.colorProviderBg;
    data['color_order_type_font'] = this.colorOrderTypeFont;
    data['color_order_state_font'] = this.colorOrderStateFont;
    data['color_title'] = this.colorTitle;
    data['color_font'] = this.colorFont;
    data['color_copy_bg'] = this.colorCopyBg;
    data['color_tips_bg'] = this.colorTipsBg;
    data['color_amount_font'] = this.colorAmountFont;
    data['color_income_font'] = this.colorIncomeFont;
    data['skip_identifier'] = this.skipIdentifier;
    if (this.orderState != null) {
      data['order_state'] = this.orderState.map((v) => v.toJson()).toList();
    }
    if (this.orderType != null) {
      data['order_type'] = this.orderType.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class OrderStateModel {
  String name;
  String type;
  String tips;
  String tipsReplaceKey;
  String tipsReplaceColor;
  String amountText;
  String incomeText;

  OrderStateModel(
      {this.name,
      this.type,
      this.tips,
      this.tipsReplaceKey,
      this.tipsReplaceColor,
      this.amountText,
      this.incomeText});

  OrderStateModel.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    type = json['type'];
    tips = json['tips'];
    tipsReplaceKey = json['tips_replace_key'];
    tipsReplaceColor = json['tips_replace_color'];
    amountText = json['amount_text'];
    incomeText = json['income_text'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['type'] = this.type;
    data['tips'] = this.tips;
    data['tips_replace_key'] = this.tipsReplaceKey;
    data['tips_replace_color'] = this.tipsReplaceColor;
    data['amount_text'] = this.amountText;
    data['income_text'] = this.incomeText;
    return data;
  }
}

class OrderTypeModel {
  String name;
  String type;
  String replaceKey;

  OrderTypeModel({this.name, this.type, this.replaceKey});

  OrderTypeModel.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    type = json['type'];
    replaceKey = json['replace_key'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['name'] = this.name;
    data['type'] = this.type;
    data['replace_key'] = this.replaceKey;
    return data;
  }
}
