import 'package:zhiying_base_widget/pages/goods_share_page/models/goods_share_temp_editor_model.dart';

class GoodsShareStyleModel {
  String unChooseColor;
  String chooseColor;
  String headerImage;
  String chooseImage;
  String unChooseImage;
  String rewardImage;
  String rewardText;
  Map<String, dynamic> shareImage;
  Map<String, dynamic> shareLink;
  Map<String, dynamic> shareMini;
  GoodsShareTempEditorModel editTemplate;

  GoodsShareStyleModel(
      {this.unChooseColor,
      this.chooseColor,
      this.headerImage,
      this.chooseImage,
      this.unChooseImage,
      this.rewardImage,
      this.rewardText,
      this.shareImage,
      this.editTemplate});

  GoodsShareStyleModel.fromJson(Map<String, dynamic> json) {
    unChooseColor = json['un_choose_color'];
    chooseColor = json['choose_color'];
    headerImage = json['header_image'];
    chooseImage = json['choose_image'];
    unChooseImage = json['un_choose_image'];
    rewardImage = json['reward_image'];
    rewardText = json['reward_text'];
    shareImage = json['share_image'];
    shareLink = json['share_link'];
    shareMini = json['share_mini'];
    editTemplate = GoodsShareTempEditorModel.fromJson(
        Map<String, dynamic>.from(json['edit_template']));
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['un_choose_color'] = this.unChooseColor;
    data['choose_color'] = this.chooseColor;
    data['header_image'] = this.headerImage;
    data['choose_image'] = this.chooseImage;
    data['un_choose_image'] = this.unChooseImage;
    data['reward_image'] = this.rewardImage;
    data['reward_text'] = this.rewardText;
    data['share_image'] = this.shareImage;
    data['share_link'] = this.shareLink;
    data['share_mini'] = this.shareMini;
    if (this.editTemplate != null) {
      data['edit_template'] = this.editTemplate.toJson();
    }
    return data;
  }
}
