import 'package:zhiying_comm/zhiying_comm.dart';
/// 反馈列表样式
class FeedbackRecordStyleModel extends SkipModel{
  String appBarName;
  String appBarNameColor;
  String appBarBgColor;
  String bgColor;
  ItemStyle itemStyle;
  List<FeedbackTypes> feedbackTypes;
  List<StateImages> stateImages;
  String requiredLogin;
  String requiredTaobaoAuth;
  String skipIdentifier;

  FeedbackRecordStyleModel(
      {this.appBarName,
      this.appBarNameColor,
      this.appBarBgColor,
      this.bgColor,
      this.itemStyle,
      this.feedbackTypes,
      this.stateImages,
      this.requiredLogin,
      this.requiredTaobaoAuth,
      this.skipIdentifier});

  FeedbackRecordStyleModel.fromJson(Map<String, dynamic> json) {
    super.fromJson(json);
    appBarName = json['app_bar_name'];
    appBarNameColor = json['app_bar_name_color'];
    appBarBgColor = json['app_bar_bg_color'];
    bgColor = json['bg_color'];
    itemStyle = json['item_style'] != null ? new ItemStyle.fromJson(json['item_style']) : null;
    if (json['feedback_types'] != null) {
      feedbackTypes = new List<FeedbackTypes>();
      json['feedback_types'].forEach((v) {
        feedbackTypes.add(new FeedbackTypes.fromJson(v));
      });
    }
    if (json['state_images'] != null) {
      stateImages = new List<StateImages>();
      json['state_images'].forEach((v) {
        stateImages.add(new StateImages.fromJson(v));
      });
    }
    requiredLogin = json['required_login'];
    requiredTaobaoAuth = json['required_taobao_auth'];
    skipIdentifier = json['skip_identifier'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = super.toJson();
    data['app_bar_name'] = this.appBarName;
    data['app_bar_name_color'] = this.appBarNameColor;
    data['app_bar_bg_color'] = this.appBarBgColor;
    data['bg_color'] = this.bgColor;
    if (this.itemStyle != null) {
      data['item_style'] = this.itemStyle.toJson();
    }
    if (this.feedbackTypes != null) {
      data['feedback_types'] = this.feedbackTypes.map((v) => v.toJson()).toList();
    }
    if (this.stateImages != null) {
      data['state_images'] = this.stateImages.map((v) => v.toJson()).toList();
    }
    data['required_login'] = this.requiredLogin;
    data['required_taobao_auth'] = this.requiredTaobaoAuth;
    data['skip_identifier'] = this.skipIdentifier;
    return data;
  }
}

class ItemStyle {
  String bgColor;
  String typeTextColor;
  String typeBgColor;
  String titleTextColor;
  String contentTextColor;
  String timeTextColor;

  ItemStyle({this.bgColor, this.typeTextColor, this.typeBgColor, this.titleTextColor, this.contentTextColor, this.timeTextColor});

  ItemStyle.fromJson(Map<String, dynamic> json) {
    bgColor = json['bg_color'];
    typeTextColor = json['type_text_color'];
    typeBgColor = json['type_bg_color'];
    titleTextColor = json['title_text_color'];
    contentTextColor = json['content_text_color'];
    timeTextColor = json['time_text_color'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['bg_color'] = this.bgColor;
    data['type_text_color'] = this.typeTextColor;
    data['type_bg_color'] = this.typeBgColor;
    data['title_text_color'] = this.titleTextColor;
    data['content_text_color'] = this.contentTextColor;
    data['time_text_color'] = this.timeTextColor;
    return data;
  }
}

class FeedbackTypes {
  String typeId;
  String name;

  FeedbackTypes({this.typeId, this.name});

  FeedbackTypes.fromJson(Map<String, dynamic> json) {
    typeId = json['type_id'];
    name = json['name'];
  }

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

class StateImages {
  String stateId;
  String img;

  StateImages({this.stateId, this.img});

  StateImages.fromJson(Map<String, dynamic> json) {
    stateId = json['state_id'];
    img = json['img'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['state_id'] = this.stateId;
    data['img'] = this.img;
    return data;
  }
}
