GetDzSellerConfModel.dart 8.59 KB

import 'dart:convert' as convert;

class GetDzSellerConfModel {
  int? ret;
  GetDzSellerConfSunModel? data;
  String? msg;

  GetDzSellerConfModel({this.ret, this.data, this.msg});

  GetDzSellerConfModel.fromJson(Map<String, dynamic> json) {
    ret = json['ret'];
    data = json['data'] != null
        ? new GetDzSellerConfSunModel.fromJson(json['data'])
        : null;
    msg = json['msg'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['ret'] = this.ret;
    if (this.data != null) {
      data['data'] = this.data!.toJson();
    }
    data['msg'] = this.msg;
    return data;
  }
}

class GetDzSellerConfSunModel {
  String? id;
  String? sid;
  String? isSms;
  String? templateId;
  String? isOpenOrder;
  String? isOpenWine;
  String? dzVersion;
  String? isCheckedCall;
  String? isCheckedApp;
  String? isCheckedLite;
  String? reserveMode;
  String? isDisplayDish;
  String? isNewTemplate;
  AllCookStyle? cookStyle;
  String? cdate;
  String? isStoreSms;
  String? storeDate;

  String? isShowPrice;
  String? isOpenCancel;

  String? isNotice;
  String? isMarketing;

  String? saiyouyun;
  Bookinginfo? bookinginfo;
  String? isAllowUpdate;
  List<String>? isShowRnamePhone;

  String? isShowNoticeDeposit;
  String? depositPrice;
  String? liteStyle;

  String? liteStyleTitle;

  String? storePushMeg;
  String? storePushSms;

  String? pcNotPhone;
  String? pcNotName;
  String? isCustomerCancel;

  String? isAddOver; //是否允许新建过去订单
  String? isSetOver; //是否允许修改过去订单
  String? isReserveOver; //是否允许变更订单到过去餐段
   String? isReserveCancel; //允许取消过去餐段的订单

  String? cancelDay;
  String? cancelShopowner;
  String? cancelManager;
  String? cancelOther;

  GetDzSellerConfSunModel(
      {this.id,
      this.sid,
      this.isSms,
      this.templateId,
      this.isOpenOrder,
      this.isOpenWine,
      this.dzVersion,
      this.isCheckedCall,
      this.isCheckedApp,
      this.isCheckedLite,
      this.reserveMode,
      this.isDisplayDish,
      this.isNewTemplate,
      this.cookStyle,
      this.cdate,
      this.isStoreSms,
      this.storeDate,
      this.isShowPrice,
      this.isOpenCancel,
      this.isNotice,
      this.isMarketing,
      this.saiyouyun,
      this.bookinginfo,
      this.isAllowUpdate,
      this.isShowRnamePhone,
      this.isShowNoticeDeposit,
      this.depositPrice,
      this.liteStyle,
      this.liteStyleTitle,
      this.storePushMeg,
      this.storePushSms,
      this.pcNotPhone,
      this.pcNotName,
      this.isCustomerCancel,
      this.isAddOver,
      this.isSetOver,
      this.isReserveOver,
      this.isReserveCancel,
      this.cancelDay,
      this.cancelShopowner,
      this.cancelManager,
      this.cancelOther});

  GetDzSellerConfSunModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    sid = json['sid'];
    isSms = json['is_sms'];
    templateId = json['template_id'];
    isOpenOrder = json['is_open_order'];
    isOpenWine = json['is_open_wine'];
    dzVersion = json['dz_version'];
    isCheckedCall = json['is_checked_call'];
    isCheckedApp = json['is_checked_app'];
    isCheckedLite = json['is_checked_lite'];
    reserveMode = json['reserve_mode'];
    isDisplayDish = json['is_display_dish'];
    isNewTemplate = json['is_new_template'];
    cookStyle = json['cook_style'] == null
        ? null
        : AllCookStyle.fromJson(convert.json.decode(json['cook_style']));
    cdate = json['cdate'];
    isStoreSms = json['is_store_sms'];
    storeDate = json['store_date'];
    isShowPrice = json['is_show_price'];
    isOpenCancel = json['is_open_cancel_temp'];
    isNotice = json['is_seller_notice'];
    isMarketing = json['is_seller_marketing'];
    saiyouyun = json['saiyouyun'];
    bookinginfo = json['bookinginfo'] != null && json['bookinginfo'] != false
        ? new Bookinginfo.fromJson(json['bookinginfo'])
        : null;
    isAllowUpdate = json['is_allow_update'] ?? '1';

    isShowRnamePhone = [];

    if (json['is_show_ranme_phone'] != null &&
        json['is_show_ranme_phone'] != '') {
      convert.json.decode(json['is_show_ranme_phone']).forEach((v) {
        isShowRnamePhone!.add(v);
      });
    }
    isShowNoticeDeposit = json['is_show_notice_deposit'];
    depositPrice = json['deposit_price'];
    liteStyle = json['lite_style'];
    liteStyleTitle = json['lite_style_title'];

    storePushMeg = json['store_push_meg'];
    storePushSms = json['store_push_sms'];

    pcNotPhone = json['pc_not_phone'];
    pcNotName = json['pc_not_rname'] ?? '1';
    isCustomerCancel = json['is_customer_cancel'];
    isAddOver = json['is_add_over'];
    isSetOver = json['is_set_over'];
    isReserveOver = json['is_reserve_over'];
    isReserveCancel = json['is_reserve_cancel'];
    cancelDay = json['temp_cancel_day'] ?? '5';
    cancelShopowner = json['temp_for_shopowner'] ?? '1';
    cancelManager = json['temp_for_manager'] ?? '1';
    cancelOther = json['temp_for_other'] ?? '1';
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['sid'] = this.sid;
    data['is_sms'] = this.isSms;
    data['template_id'] = this.templateId;
    data['is_open_order'] = this.isOpenOrder;
    data['is_open_wine'] = this.isOpenWine;
    data['dz_version'] = this.dzVersion;
    data['is_checked_call'] = this.isCheckedCall;
    data['is_checked_app'] = this.isCheckedApp;
    data['is_checked_lite'] = this.isCheckedLite;
    data['reserve_mode'] = this.reserveMode;
    data['is_display_dish'] = this.isDisplayDish;
    data['is_new_template'] = this.isNewTemplate;
    data['cook_style'] = this.cookStyle;
    data['cdate'] = this.cdate;
    data['is_store_sms'] = this.isStoreSms;
    data['store_date'] = this.storeDate;
    data['is_show_price'] = this.isShowPrice;
    data['is_open_cancel_temp'] = this.isOpenCancel;
    data['is_seller_notice'] = this.isNotice;
    data['is_seller_marketing'] = this.isMarketing;
    data['saiyouyun'] = this.saiyouyun;
    if (this.bookinginfo != null) {
      data['bookinginfo'] = this.bookinginfo!.toJson();
    }
    data['is_allow_update'] = this.isAllowUpdate;
    data['is_show_ranme_phone'] = this.isShowRnamePhone;
    data['is_show_notice_deposit'] = this.isShowNoticeDeposit;
    data['deposit_price'] = this.depositPrice;
    data['lite_style'] = this.liteStyle;
    data['lite_style_title'] = this.liteStyleTitle;

    data['store_push_meg'] = this.storePushMeg;
    data['store_push_sms'] = this.storePushSms;
    data['pc_not_phone'] = this.pcNotPhone;
    data['pc_not_rname'] = this.pcNotName;
    data['is_customer_cancel'] = this.isCustomerCancel;
    data['is_add_over'] = this.isAddOver;
    data['is_set_over'] = this.isSetOver;
    data['is_reserve_over'] = this.isReserveOver;
        data['is_reserve_cancel'] = this.isReserveCancel;

    data['temp_cancel_day'] = this.cancelDay;
    data['temp_for_shopowner'] = this.cancelShopowner;
    data['temp_for_manager'] = this.cancelManager;
    data['temp_for_other'] = this.cancelOther;

    return data;
  }
}

class InputSetting {
  String? uid;
  String? isShowName;
  String? isShowPhone;

  InputSetting({this.uid, this.isShowName, this.isShowPhone});

  InputSetting.fromJson(Map<String, dynamic> json) {
    uid = json['uid'];
    isShowName = json['is_show_name'];
    isShowPhone = json['is_show_phone'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['uid'] = this.uid;
    data['is_show_name'] = this.isShowName;
    data['is_show_phone'] = this.isShowPhone;
    return data;
  }
}

class Bookinginfo {
  String? id;
  String? sid;
  String? smsCode;
  String? content;

  Bookinginfo({this.id, this.sid, this.smsCode, this.content});

  Bookinginfo.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    sid = json['sid'];
    smsCode = json['sms_code'];
    content = json['content'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['sid'] = this.sid;
    data['sms_code'] = this.smsCode;
    data['content'] = this.content;
    return data;
  }
}

class AllCookStyle {
  String? menuThemeColor;
  String? index;

  AllCookStyle({
    this.menuThemeColor,
    this.index,
  });

  AllCookStyle.fromJson(Map<String, dynamic> json) {
    menuThemeColor = json['menu_theme_color'];
    index = json['index'] ?? "0";
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['menu_theme_color'] = this.menuThemeColor;
    data['index'] = this.index ?? '0';
    return data;
  }
}