Commit 6bb8b023ffb3471dca371d03672b7841ca466d9c

Authored by wdn127929
1 parent 9a1fc06f

差合同提交、发票增删改、删除场次

class GetBanquetByIdModel {
int ret;
GetBanquetByIdSunModel data;
String msg;
GetBanquetByIdModel({this.ret, this.data, this.msg});
GetBanquetByIdModel.fromJson(Map<String, dynamic> json) {
ret = json['ret'];
data = json['data'] != null
? new GetBanquetByIdSunModel.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 GetBanquetByIdSunModel {
BasicInfo basicInfo;
List<SessionsInfo> sessionsInfo;
ContractInfo contractInfo;
String invoice;
GetBanquetByIdSunModel(
{this.basicInfo, this.sessionsInfo, this.contractInfo, this.invoice});
GetBanquetByIdSunModel.fromJson(Map<String, dynamic> json) {
basicInfo = json['basic_info'] != null
? new BasicInfo.fromJson(json['basic_info'])
: null;
if (json['sessions_info'] != null) {
sessionsInfo = <SessionsInfo>[];
json['sessions_info'].forEach((v) {
sessionsInfo.add(new SessionsInfo.fromJson(v));
});
}
contractInfo = json['contract_info'] != null
? new ContractInfo.fromJson(json['contract_info'])
: null;
invoice = json['invoice'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.basicInfo != null) {
data['basic_info'] = this.basicInfo.toJson();
}
if (this.sessionsInfo != null) {
data['sessions_info'] = this.sessionsInfo.map((v) => v.toJson()).toList();
}
if (this.contractInfo != null) {
data['contract_info'] = this.contractInfo.toJson();
}
data['invoice'] = this.invoice;
return data;
}
}
class BasicInfo {
String ddate;
String rname;
String sex;
String phone;
String remark;
Jiedan jiedan;
Jiedan staff;
String classify;
BasicInfo(
{this.ddate,
this.rname,
this.sex,
this.phone,
this.remark,
this.jiedan,
this.staff,
this.classify});
BasicInfo.fromJson(Map<String, dynamic> json) {
ddate = json['ddate'];
rname = json['rname'];
sex = json['sex'];
phone = json['phone'];
remark = json['remark'];
jiedan =
json['jiedan'] != null ? new Jiedan.fromJson(json['jiedan']) : null;
staff = json['staff'] != null ? new Jiedan.fromJson(json['staff']) : null;
classify = json['classify'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ddate'] = this.ddate;
data['rname'] = this.rname;
data['sex'] = this.sex;
data['phone'] = this.phone;
data['remark'] = this.remark;
if (this.jiedan != null) {
data['jiedan'] = this.jiedan.toJson();
}
if (this.staff != null) {
data['staff'] = this.staff.toJson();
}
data['classify'] = this.classify;
return data;
}
}
class Jiedan {
String nickName;
String account;
Jiedan({this.nickName, this.account});
Jiedan.fromJson(Map<String, dynamic> json) {
nickName = json['nick_name'];
account = json['account'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['nick_name'] = this.nickName;
data['account'] = this.account;
return data;
}
}
class SessionsInfo {
String id;
String rid;
String reserveOrder;
String ddateInterval;
String rdate;
String tids;
String setmeal;
String wine;
String other;
dynamic remark;
String images;
dynamic serviceType;
dynamic servicePer;
dynamic servicePrice;
dynamic discountType;
dynamic discountPer;
dynamic discountPrice;
SessionsInfo(
{this.id,
this.rid,
this.reserveOrder,
this.ddateInterval,
this.rdate,
this.tids,
this.setmeal,
this.wine,
this.other,
this.remark,
this.images,
this.serviceType,
this.servicePer,
this.servicePrice,
this.discountType,
this.discountPer,
this.discountPrice});
SessionsInfo.fromJson(Map<String, dynamic> json) {
id = json['id'];
rid = json['rid'];
reserveOrder = json['reserve_order'];
ddateInterval = json['ddate_interval'];
rdate = json['rdate'];
tids = json['tids'];
setmeal = json['setmeal'];
wine = json['wine'];
other = json['other'];
remark = json['remark'];
images = json['images'];
serviceType = json['service_type'];
servicePer = json['service_per'];
servicePrice = json['service_price'];
discountType = json['discount_type'];
discountPer = json['discount_per'];
discountPrice = json['discount_price'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['rid'] = this.rid;
data['reserve_order'] = this.reserveOrder;
data['ddate_interval'] = this.ddateInterval;
data['rdate'] = this.rdate;
data['tids'] = this.tids;
data['setmeal'] = this.setmeal;
data['wine'] = this.wine;
data['other'] = this.other;
data['remark'] = this.remark;
data['images'] = this.images;
data['service_type'] = this.serviceType;
data['service_per'] = this.servicePer;
data['service_price'] = this.servicePrice;
data['discount_type'] = this.discountType;
data['discount_per'] = this.discountPer;
data['discount_price'] = this.discountPrice;
return data;
}
}
class CostInfoModel {
String title;
CostInfoSunModel costInfoSunModel;
//服务费
// 优惠金额
}
class CostInfoSunModel {
String cname;
String unitPrice;
String numStr;
int price;
CostInfoSunModel({this.cname, this.unitPrice, this.numStr, this.price});
CostInfoSunModel.fromJson(Map<String, dynamic> json) {
cname = json['cname'];
unitPrice = json['unit_price'];
numStr = json['num'];
price = json['price'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['cname'] = this.cname;
data['unit_price'] = this.unitPrice;
data['num'] = this.numStr;
data['price'] = this.price;
return data;
}
}
class ContractInfo {
String contractTotalPrice;
String contractFinalPrice;
String contractRname;
String contractSellerName;
String contractNo;
String contractImages;
ContractInfo(
{this.contractTotalPrice,
this.contractFinalPrice,
this.contractRname,
this.contractSellerName,
this.contractNo,
this.contractImages});
ContractInfo.fromJson(Map<String, dynamic> json) {
contractTotalPrice = json['contract_total_price'];
contractFinalPrice = json['contract_final_price'];
contractRname = json['contract_rname'];
contractSellerName = json['contract_seller_name'];
contractNo = json['contract_no'];
contractImages = json['contract_images'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['contract_total_price'] = this.contractTotalPrice;
data['contract_final_price'] = this.contractFinalPrice;
data['contract_rname'] = this.contractRname;
data['contract_seller_name'] = this.contractSellerName;
data['contract_no'] = this.contractNo;
data['contract_images'] = this.contractImages;
return data;
}
}
import 'dart:convert' as convert;
import 'package:flutter/material.dart';
class GetBanquetByIdNewModel {
int ret;
GetBanquetByIdNewSunModel data;
String msg;
GetBanquetByIdNewModel({this.ret, this.data, this.msg});
GetBanquetByIdNewModel.fromJson(Map<String, dynamic> json) {
ret = json['ret'];
data = json['data'] != null
? new GetBanquetByIdNewSunModel.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 GetBanquetByIdNewSunModel {
BasicInfo basicInfo;
List<SessionsInfo> sessionsInfo;
List<CostInfoModel> costInfo; //费用信息
ContractInfo contractInfo;
Invoice invoice;
GetBanquetByIdNewSunModel(
{this.basicInfo,
this.sessionsInfo,
this.costInfo,
this.contractInfo,
this.invoice});
GetBanquetByIdNewSunModel.fromJson(Map<String, dynamic> json) {
basicInfo = json['basic_info'] != null
? new BasicInfo.fromJson(json['basic_info'])
: null;
if (json['sessions_info'] != null) {
sessionsInfo = <SessionsInfo>[];
json['sessions_info'].forEach((v) {
sessionsInfo.add(new SessionsInfo.fromJson(v));
});
}
contractInfo = ContractInfo();
// contractInfo = json['contract_info'] != null
// ? new ContractInfo.fromJson(json['contract_info'])
// : null;
invoice = json['invoice'] != null
? new Invoice.fromJson(convert.jsonDecode(json['invoice']))
: null; //发票信息
if (json['cost_info'] != null) {
costInfo = <CostInfoModel>[];
double totalP = 0.0;
json['cost_info'].forEach((key, v) {
CostInfoModel model = CostInfoModel.fromJson(v);
model.title = '${key}费用';
costInfo.add(model);
totalP += double.parse(model.sumPrice);
});
contractInfo.contractTotalPrice = totalP.toString();
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.basicInfo != null) {
data['basic_info'] = this.basicInfo.toJson();
}
if (this.sessionsInfo != null) {
data['sessions_info'] = this.sessionsInfo.map((v) => v.toJson()).toList();
}
if (this.costInfo != null) {
data['cost_info'] = this.costInfo.map((v) => v.toJson()).toList();
}
if (this.contractInfo != null) {
data['contract_info'] = this.contractInfo.toJson();
}
data['invoice'] = this.invoice;
return data;
}
}
class BasicInfo {
String ddate;
String rname;
String sex;
String phone;
String remark;
Jiedan jiedan;
Jiedan staff;
String classify;
BasicInfo(
{this.ddate,
this.rname,
this.sex,
this.phone,
this.remark,
this.jiedan,
this.staff,
this.classify});
BasicInfo.fromJson(Map<String, dynamic> json) {
ddate = json['ddate'];
rname = json['rname'];
sex = json['sex'];
phone = json['phone'];
remark = json['remark'];
jiedan =
json['jiedan'] != null ? new Jiedan.fromJson(json['jiedan']) : null;
staff = json['staff'] != null ? new Jiedan.fromJson(json['staff']) : null;
classify = json['classify'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ddate'] = this.ddate;
data['rname'] = this.rname;
data['sex'] = this.sex;
data['phone'] = this.phone;
data['remark'] = this.remark;
if (this.jiedan != null) {
data['jiedan'] = this.jiedan.toJson();
}
if (this.staff != null) {
data['staff'] = this.staff.toJson();
}
data['classify'] = this.classify;
return data;
}
}
class Jiedan {
String nickName;
String account;
Jiedan({this.nickName, this.account});
Jiedan.fromJson(Map<String, dynamic> json) {
nickName = json['nick_name'];
account = json['account'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['nick_name'] = this.nickName;
data['account'] = this.account;
return data;
}
}
class SessionsInfo {
String rdate;
String tableInfo;
List<SetmealDetail> setmeal;
List<WineDetail> wine;
List<OtherDetail> other;
String remark;
List<Images> images;
SessionsInfo(
{this.rdate,
this.tableInfo,
this.setmeal,
this.wine,
this.other,
this.remark,
this.images});
SessionsInfo.fromJson(Map<String, dynamic> json) {
rdate = json['rdate'];
tableInfo = json['table_info'];
if (json['setmeal'] != null) {
setmeal = <SetmealDetail>[];
json['setmeal'].forEach((v) {
setmeal.add(new SetmealDetail.fromJson(v));
});
}
if (json['wine'] != null) {
wine = <WineDetail>[];
json['wine'].forEach((v) {
wine.add(new WineDetail.fromJson(v));
});
}
if (json['other'] != null) {
other = <OtherDetail>[];
json['other'].forEach((v) {
other.add(new OtherDetail.fromJson(v));
});
}
remark = json['remark'];
if (json['images'] != null) {
images = <Images>[];
convert.jsonDecode(json['images']).forEach((v) {
images.add(new Images.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['rdate'] = this.rdate;
data['table_info'] = this.tableInfo;
if (this.setmeal != null) {
data['setmeal'] = this.setmeal.map((v) => v.toJson()).toList();
}
if (this.wine != null) {
data['wine'] = this.wine.map((v) => v.toJson()).toList();
}
if (this.other != null) {
data['other'] = this.other.map((v) => v.toJson()).toList();
}
data['remark'] = this.remark;
data['images'] = this.images;
return data;
}
}
class SetmealDetail {
String setmealId;
String price;
String finalPrice;
String pnum;
String min;
String spare;
List<Cooklist> cooklist;
String mealName;
SetmealDetail(
{this.setmealId,
this.price,
this.finalPrice,
this.pnum,
this.min,
this.spare,
this.cooklist,
this.mealName});
SetmealDetail.fromJson(Map<String, dynamic> json) {
setmealId = json['setmeal_id'];
price = json['price'];
finalPrice = json['final_price'];
pnum = json['pnum'];
min = json['min'];
spare = json['spare'];
if (json['cooklist'] != null) {
cooklist = <Cooklist>[];
json['cooklist'].forEach((v) {
cooklist.add(new Cooklist.fromJson(v));
});
}
mealName = json['meal_name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['setmeal_id'] = this.setmealId;
data['price'] = this.price;
data['final_price'] = this.finalPrice;
data['pnum'] = this.pnum;
data['min'] = this.min;
data['spare'] = this.spare;
if (this.cooklist != null) {
data['cooklist'] = this.cooklist.map((v) => v.toJson()).toList();
}
data['meal_name'] = this.mealName;
return data;
}
}
class Cooklist {
String cname;
Cooklist({this.cname});
Cooklist.fromJson(Map<String, dynamic> json) {
cname = json['cname'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['cname'] = this.cname;
return data;
}
}
class WineDetail {
String wineName;
String wineNum;
String spec;
WineDetail({this.wineName, this.wineNum, this.spec});
WineDetail.fromJson(Map<String, dynamic> json) {
wineName = json['wine_name'];
wineNum = json['wine_num'];
spec = json['spec'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['wine_name'] = this.wineName;
data['wine_num'] = this.wineNum;
data['spec'] = this.spec;
return data;
}
}
class OtherDetail {
String otherName;
String otherNum;
String spec;
OtherDetail({this.otherName, this.otherNum, this.spec});
OtherDetail.fromJson(Map<String, dynamic> json) {
otherName = json['other_name'];
otherNum = json['other_num'];
spec = json['spec'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['other_name'] = this.otherName;
data['other_num'] = this.otherNum;
data['spec'] = this.spec;
return data;
}
}
class CostInfoModel {
String title;
List<CostInfoSunModel> data;
bool service = true; //服务费
bool discount = true; // 优惠金额
TextEditingController serviceC = TextEditingController();
TextEditingController discountC = TextEditingController();
String totalPrice; //合计
String sumPrice; //优惠和服务费之前的金额
CostInfoModel({this.title, this.data});
CostInfoModel.fromJson(List<dynamic> json) {
data = [];
double price = 0.0;
json.forEach((value) {
CostInfoSunModel sunModel = new CostInfoSunModel.fromJson(value);
price += sunModel.price;
data.add(sunModel);
});
sumPrice = price.toString();
totalPrice = sumPrice;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['title'] = this.title;
data['data'] = this.data;
return data;
}
}
class CostInfoSunModel {
String cname;
String unitPrice;
String numStr;
int price;
String wineName;
String otherName;
CostInfoSunModel(
{this.cname,
this.unitPrice,
this.numStr,
this.price,
this.wineName,
this.otherName});
CostInfoSunModel.fromJson(Map<String, dynamic> json) {
cname = json['cname'];
unitPrice = json['unit_price'];
numStr = json['num'];
price = json['price'];
wineName = json['wine_name'];
otherName = json['other_name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['cname'] = this.cname;
data['unit_price'] = this.unitPrice;
data['num'] = this.numStr;
data['price'] = this.price;
data['wine_name'] = this.wineName;
data['other_name'] = this.otherName;
return data;
}
}
class ContractInfo {
String contractTotalPrice;
String contractFinalPrice;
String contractRname;
String contractSellerName;
String contractNo;
List<Images> contractImages;
TextEditingController contractFinalPriceC = TextEditingController();
ContractInfo(
{this.contractTotalPrice,
this.contractFinalPrice,
this.contractRname,
this.contractSellerName,
this.contractNo,
this.contractImages});
ContractInfo.fromJson(Map<String, dynamic> json) {
contractTotalPrice = json['contract_total_price'];
contractFinalPrice = json['contract_final_price'];
contractRname = json['contract_rname'];
contractSellerName = json['contract_seller_name'];
contractNo = json['contract_no'];
if (json['contract_images'] != null) {
contractImages = <Images>[];
convert.jsonDecode(json['contract_images']).forEach((v) {
contractImages.add(new Images.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['contract_total_price'] = this.contractTotalPrice;
data['contract_final_price'] = this.contractFinalPrice;
data['contract_rname'] = this.contractRname;
data['contract_seller_name'] = this.contractSellerName;
data['contract_no'] = this.contractNo;
data['contract_images'] = this.contractImages;
return data;
}
}
class Images {
String url;
Images({this.url});
Images.fromJson(Map<String, dynamic> json) {
url = json['url'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
return data;
}
}
class Invoice {
String invoiceType; // "1 普通 2 专用",
String price; //开票金额
String unitName; //单位全称
String numStr; //税号
String address; //地址
String phone; //电话
String bank; //开户行
String bankNum; //开户行账号
String mail; //邮箱
String addressee; //收件人
String addresseePhone; //收件人电话
String addresseeAddress; //收件人地址
String code; //邮编
Invoice(
{this.invoiceType,
this.price,
this.unitName,
this.numStr,
this.address,
this.phone,
this.bank,
this.bankNum,
this.mail,
this.addressee,
this.addresseePhone,
this.addresseeAddress,
this.code});
Invoice.fromJson(Map<String, dynamic> json) {
invoiceType = json['invoice_type'];
price = json['price'];
unitName = json['unit_name'];
numStr = json['num'];
address = json['address'];
phone = json['phone'];
bank = json['bank'];
bankNum = json['bank_num'];
mail = json['mail'];
addressee = json['addressee'];
addresseePhone = json['addressee_phone'];
addresseeAddress = json['addressee_address'];
code = json['code'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['invoice_type'] = this.invoiceType;
data['price'] = this.price;
data['unit_name'] = this.unitName;
data['num'] = this.numStr;
data['address'] = this.address;
data['phone'] = this.phone;
data['bank'] = this.bank;
data['bank_num'] = this.bankNum;
data['mail'] = this.mail;
data['addressee'] = this.addressee;
data['addressee_phone'] = this.addresseePhone;
data['addressee_address'] = this.addresseeAddress;
data['code'] = this.code;
return data;
}
}
... ...
... ... @@ -50,32 +50,32 @@ class SetXuanTaiModel {
reserveOrder = json['reserve_order'];
ddateInterval = json['ddate_interval'];
rdate = json['rdate'];
if (json['tids'] = null) {
if (json['tids'] != null) {
tids = <Tids>[];
json['tids'].forEach((v) {
tids.add(new Tids.fromJson(v));
});
}
if (json['setmeal'] = null) {
if (json['setmeal'] != null) {
setmeal = <Setmeal>[];
json['setmeal'].forEach((v) {
setmeal.add(new Setmeal.fromJson(v));
});
}
if (json['wine'] = null) {
if (json['wine'] != null) {
wine = <Wine>[];
json['wine'].forEach((v) {
wine.add(new Wine.fromJson(v));
});
}
if (json['other'] = null) {
if (json['other'] != null) {
other = <Other>[];
json['other'].forEach((v) {
other.add(new Other.fromJson(v));
});
}
remark = json['remark'];
if (json['images'] = null) {
if (json['images'] != null) {
images = <Images>[];
json['images'].forEach((v) {
images.add(new Images.fromJson(v));
... ... @@ -89,20 +89,20 @@ class SetXuanTaiModel {
data['reserve_order'] = this.reserveOrder;
data['ddate_interval'] = this.ddateInterval;
data['rdate'] = this.rdate;
if (this.tids = null) {
if (this.tids != null) {
data['tids'] = this.tids.map((v) => v.toJson()).toList();
}
if (this.setmeal = null) {
if (this.setmeal != null) {
data['setmeal'] = this.setmeal.map((v) => v.toJson()).toList();
}
if (this.wine = null) {
if (this.wine != null) {
data['wine'] = this.wine.map((v) => v.toJson()).toList();
}
if (this.other = null) {
if (this.other != null) {
data['other'] = this.other.map((v) => v.toJson()).toList();
}
data['remark'] = this.remark;
if (this.images = null) {
if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList();
}
return data;
... ... @@ -110,8 +110,8 @@ class SetXuanTaiModel {
}
class Tids {
String tid;
String numStr;
dynamic tid;
dynamic numStr;
String name;
TextEditingController tableNumC = TextEditingController(); //桌位个数
... ...
... ... @@ -17,6 +17,7 @@ import 'package:provider/provider.dart';
import '../../constant/state.dart';
import '../../models/dsolt_xt.dart';
import '../../models/feast_menu_model.dart';
import '../../models/get_banquet_by_id_new_model.dart';
import '../../models/set_xuan_tai_model.dart';
import '../../models/setmeal_by_id_model.dart';
import '../../models/upload_img_model.dart';
... ... @@ -176,9 +177,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
await feastModel.getStaff(context);
}
///获取宴会详情
///获取宴会详情
_getBanquetById() async {
Map<String, String> pramas = {'rid': '64'};//feastModel.rid
Map<String, String> pramas = {'rid': '64'}; //feastModel.rid
await feastModel.getBanquetById(context, pramas);
}
... ... @@ -2496,13 +2497,26 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
left: w(12), right: w(12), top: w(8), bottom: w(11)),
child: Column(
children: [
baseInfoItem('宴会日期:', '2022-08-02 (周二 七月初五)'),
baseInfoItem('宴会类型:', '婚宴'),
baseInfoItem('预订人:', '方 先生'),
baseInfoItem('场次数量:', '共 1 场'),
baseInfoItem('电话:', '15833517582'),
baseInfoItem('服务经理:', '刘经理'),
baseInfoItem('备注:', '无'),
baseInfoItem(
'宴会日期:',
createDateText(
context,
DateTime.fromMillisecondsSinceEpoch(int.parse(
feastModel.banquetDetail.basicInfo.ddate) *
1000))),
baseInfoItem(
'宴会类型:', feastModel.banquetDetail.basicInfo.classify),
baseInfoItem('预订人:',
'${feastModel.banquetDetail.basicInfo.rname} ${feastModel.banquetDetail.basicInfo.sex}'),
baseInfoItem('场次数量:',
'共 ${feastModel.banquetDetail.sessionsInfo.length} 场'),
baseInfoItem('电话:', feastModel.banquetDetail.basicInfo.phone),
baseInfoItem(
'服务经理:',
feastModel.banquetDetail.basicInfo.jiedan.nickName ??
feastModel.banquetDetail.basicInfo.jiedan.account),
baseInfoItem(
'备注:', feastModel.banquetDetail.basicInfo.remark ?? '无'),
],
))
],
... ... @@ -2511,9 +2525,15 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
}
///第一场 。第二场。。。。
Widget sessionsWidget(
String title,
) {
Widget sessionsWidget(String title, SessionsInfo sessionsInfo) {
int tableNum = 0;
List<String> temp = sessionsInfo.tableInfo.split('、');
temp.forEach((element) {
int start = element.indexOf('(');
int end = element.length - 2;
String numstr = element.substring(start + 1, end);
tableNum += int.parse(numstr);
});
return Container(
margin: EdgeInsets.only(bottom: h(26)),
decoration: BoxDecoration(
... ... @@ -2541,9 +2561,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
left: w(12), right: w(12), top: w(8), bottom: w(11)),
child: Column(
children: [
baseInfoItem('场次时间:', '2022-08-02 午餐 12:00至14:00'),
baseInfoItem('桌位数量:', '共 32 桌'),
baseInfoItem('桌位信息:', '凤凰厅 (30桌)、包间1 (1桌)、包间2 (1桌)'),
baseInfoItem('场次时间:', sessionsInfo.rdate),
baseInfoItem('桌位数量:', '共 ${tableNum} 桌'),
baseInfoItem('桌位信息:', sessionsInfo.tableInfo),
Padding(
padding: EdgeInsets.symmetric(vertical: h(6)),
child: Row(
... ... @@ -2558,11 +2578,13 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
),
Expanded(
child: ListView.builder(
itemCount: 3,
itemCount: sessionsInfo.setmeal.length,
shrinkWrap: true,
controller: _scrollController,
itemBuilder:
(BuildContext context, int index) {
SetmealDetail setmealDetail =
sessionsInfo.setmeal[index];
return Container(
padding: EdgeInsets.only(bottom: w(8)),
margin: EdgeInsets.only(bottom: w(12)),
... ... @@ -2576,7 +2598,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
children: [
Row(
children: [
Text('1299套餐',
Text(setmealDetail.mealName,
style: TextStyle(
color: MyColours
.color_515151,
... ... @@ -2604,19 +2626,22 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
VEmptyView(16),
Row(
children: [
Text('10 人/桌',
Text(
'${setmealDetail.pnum} 人/桌',
style: TextStyle(
color: MyColours
.color_999999,
fontSize: font(12))),
HEmptyView(24),
Text('保证 30 桌',
Text(
'保证 ${setmealDetail.min} 桌',
style: TextStyle(
color: MyColours
.color_999999,
fontSize: font(12))),
HEmptyView(24),
Text('备用 2 桌',
Text(
'备用 ${setmealDetail.spare} 桌',
style: TextStyle(
color: MyColours
.color_999999,
... ... @@ -2628,9 +2653,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
}))
],
)),
sessionsItem('酒水安排:'),
sessionsItem('其他配置:'),
remarkItem('备注:')
sessionsItem('酒水安排:', sessionsInfo),
sessionsItem('其他配置:', sessionsInfo),
remarkItem('备注:', sessionsInfo)
],
))
],
... ... @@ -2639,7 +2664,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
}
///备注----照片
Widget remarkItem(String title) {
Widget remarkItem(String title, SessionsInfo sessionsInfo) {
return Padding(
padding: EdgeInsets.symmetric(vertical: h(6)),
child: Row(
... ... @@ -2655,18 +2680,134 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'剑南春52度剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml500ml',
style: TextStyle(
color: MyColours.color_515151, fontSize: font(12))),
VEmptyView(16),
_getGridImg(['fff', '', 'fff', '', 'fff', '', 'fff', ''])
sessionsInfo.remark == null || sessionsInfo.remark == ''
? SizedBox()
: Text(sessionsInfo.remark,
style: TextStyle(
color: MyColours.color_515151, fontSize: font(12))),
sessionsInfo.remark == null || sessionsInfo.remark == ''
? SizedBox()
: VEmptyView(16),
_getGridImg(sessionsInfo.images.map((e) {
return e.url;
}).toList())
],
)),
],
));
}
///计算合计费用
_calculatePrice(costInfoModel) {
double sum = double.parse(costInfoModel.sumPrice); //原来总金额
double total = 0.0;
if (Utils.isNumeric(costInfoModel.serviceC.text)) {
//输入的是数字,计算金额
if (costInfoModel.service) {
//选中固定金额
// if(double.parse(value) > sum){
// }
total = sum + double.parse(costInfoModel.serviceC.text);
} else {
//选中百分比
if (int.parse(costInfoModel.serviceC.text) > 100) {
Utils.showToast('请输入小于100的数字');
return;
}
// 使除数为0
double input = double.parse(costInfoModel.serviceC.text);
total = sum + sum * input / 100;
}
} else {
// if (!Utils.isNumeric(costInfoModel.discountC.text)) {
// costInfoModel.totalPrice = costInfoModel.sumPrice;
// }
}
if (Utils.isNumeric(costInfoModel.discountC.text)) {
//输入的是数字,计算金额
if (costInfoModel.discount) {
//选中固定金额
// if(double.parse(value) > sum){
// }
total -= double.parse(costInfoModel.discountC.text);
} else {
//选中百分比
if (int.parse(costInfoModel.discountC.text) > 100) {
Utils.showToast('请输入小于100的数字');
return;
}
// 使除数为0
double input = double.parse(costInfoModel.discountC.text);
total = total - sum * input / 100;
}
// String num2StrD = total.toStringAsFixed(2); //保留两位小数
// costInfoModel.totalPrice = num2StrD;
} else {
// if (!Utils.isNumeric(costInfoModel.serviceC.text)) {
// costInfoModel.totalPrice = costInfoModel.sumPrice;
// }
}
if (total == 0.0) {
costInfoModel.totalPrice = costInfoModel.sumPrice;
} else {
String num2StrD = total.toStringAsFixed(2); //保留两位小数
costInfoModel.totalPrice = num2StrD;
}
double finalContract = 0.0; //最终议价
feastModel.banquetDetail.costInfo.forEach((element) {
finalContract += double.parse(element.totalPrice);
});
feastModel.banquetDetail.contractInfo.contractFinalPrice =
finalContract.toString();
feastModel.banquetDetail.contractInfo.contractFinalPriceC.text =
finalContract.toString();
setState(() {});
}
// ///计算优惠金额
// _calculatDiscount(costInfoModel) {
// if (Utils.isNumeric(costInfoModel.discountC.text)) {
// //输入的是数字,计算金额
// double sum = double.parse(costInfoModel.totalPrice); //原来总金额
// double total = 0.0;
// if (costInfoModel.service) {
// //选中固定金额
// // if(double.parse(value) > sum){
// // }
// total = sum - double.parse(costInfoModel.discountC.text);
// } else {
// //选中百分比
// if (int.parse(costInfoModel.discountC.text) > 100) {
// Utils.showToast('请输入小于100的数字');
// return;
// }
// // 使除数为0
// double input = double.parse(costInfoModel.discountC.text);
// total = sum - sum * input / 100;
// }
// String num2StrD = total.toStringAsFixed(2); //保留两位小数
// costInfoModel.totalPrice = num2StrD;
// } else {
// if (!Utils.isNumeric(costInfoModel.serviceC.text)) {
// costInfoModel.totalPrice = costInfoModel.sumPrice;
// }
// }
// setState(() {});
// }
///费用详情
Widget costWidget() {
return Container(
... ... @@ -2692,10 +2833,12 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
),
VEmptyView(34),
ListView.builder(
itemCount: 2,
itemCount: feastModel.banquetDetail.costInfo.length,
shrinkWrap: true,
controller: _scrollController,
itemBuilder: (BuildContext context, int index) {
CostInfoModel costInfoModel =
feastModel.banquetDetail.costInfo[index];
return Padding(
padding: EdgeInsets.only(
left: w(12), right: w(12), bottom: w(27)),
... ... @@ -2703,7 +2846,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'第一场费用:',
'${costInfoModel.title}:',
style: TextStyle(
color: MyColours.color_999999,
fontSize: font(12)),
... ... @@ -2711,15 +2854,27 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
VEmptyView(8),
costItem('名称', '单价', '数量', '金额', isTitle: true),
ListView.builder(
itemCount: 4,
itemCount: costInfoModel.data.length,
shrinkWrap: true,
controller: _scrollController,
itemBuilder: (BuildContext context, int index) {
CostInfoSunModel costInfoSunModel =
costInfoModel.data[index];
String name = '';
if (costInfoSunModel.cname != null) {
name = costInfoSunModel.cname;
}
if (costInfoSunModel.otherName != null) {
name = costInfoSunModel.otherName;
}
if (costInfoSunModel.wineName != null) {
name = costInfoSunModel.wineName;
}
return costItem(
'1299套餐',
'1299',
'30',
'38970',
name,
costInfoSunModel.unitPrice,
costInfoSunModel.numStr,
costInfoSunModel.price.toString(),
);
}),
//服务费
... ... @@ -2742,31 +2897,75 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
fontSize: font(12)),
),
),
Image.asset(
Utils.getImgPath('f_radio_sel'),
width: w(20),
),
HEmptyView(8),
Text(
'固定金额',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
InkWell(
onTap: () {
if (costInfoModel.service) {
return;
}
setState(() {
costInfoModel.service =
!costInfoModel.service;
});
if (costInfoModel.serviceC.text != '') {
_calculatePrice(
costInfoModel,
);
}
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(costInfoModel.service
? 'f_radio_sel'
: 'f_radio_un'),
width: w(20),
),
HEmptyView(8),
Text(
'固定金额',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
),
],
),
),
HEmptyView(16),
Image.asset(
Utils.getImgPath('f_radio_un'),
width: w(20),
InkWell(
onTap: () {
if (!costInfoModel.service) {
return;
}
setState(() {
costInfoModel.service =
!costInfoModel.service;
});
if (costInfoModel.serviceC.text != '') {
_calculatePrice(
costInfoModel,
);
}
},
child: Row(
children: [
Image.asset(
Utils.getImgPath(!costInfoModel.service
? 'f_radio_sel'
: 'f_radio_un'),
width: w(20),
),
HEmptyView(8),
Container(
width: w(40),
child: Text(
'百分比',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
)),
],
),
),
HEmptyView(8),
Container(
width: w(40),
child: Text(
'百分比',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
)),
HEmptyView(12),
Expanded(
child: Container(
... ... @@ -2784,7 +2983,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_515151),
// controller: controller,
controller: costInfoModel.serviceC,
// focusNode: node,
// textAlignVertical: TextAlignVertical.top,
decoration: InputDecoration(
... ... @@ -2805,6 +3004,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
onChanged: (value) {
print('ggg');
_calculatePrice(
costInfoModel,
);
// nameStr = value;
},
onEditingComplete: () {
... ... @@ -2819,7 +3022,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
),
HEmptyView(4),
Text(
'%',
costInfoModel.service ? '元' : '%',
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(12)),
... ... @@ -2846,31 +3049,69 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
fontSize: font(12)),
),
),
Image.asset(
Utils.getImgPath('f_radio_sel'),
width: w(20),
),
HEmptyView(8),
Text(
'固定金额',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
),
InkWell(
onTap: () {
if (costInfoModel.discount) {
return;
}
setState(() {
costInfoModel.discount =
!costInfoModel.discount;
});
if (costInfoModel.discountC.text != '') {
_calculatePrice(
costInfoModel,
);
}
},
child: Row(children: [
Image.asset(
Utils.getImgPath(costInfoModel.discount
? 'f_radio_sel'
: 'f_radio_un'),
width: w(20),
),
HEmptyView(8),
Text(
'固定金额',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
),
])),
HEmptyView(16),
Image.asset(
Utils.getImgPath('f_radio_un'),
width: w(20),
),
HEmptyView(8),
Container(
width: w(40),
child: Text(
'折扣',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
)),
InkWell(
onTap: () {
if (!costInfoModel.discount) {
return;
}
setState(() {
costInfoModel.discount =
!costInfoModel.discount;
});
if (costInfoModel.discountC.text != '') {
_calculatePrice(
costInfoModel,
);
}
},
child: Row(children: [
Image.asset(
Utils.getImgPath(!costInfoModel.discount
? 'f_radio_sel'
: 'f_radio_un'),
width: w(20),
),
HEmptyView(8),
Container(
width: w(40),
child: Text(
'折扣',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)),
))
])),
HEmptyView(12),
Expanded(
child: Container(
... ... @@ -2888,7 +3129,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
style: TextStyle(
fontSize: ScreenUtil().setSp(24),
color: MyColours.color_515151),
// controller: controller,
controller: costInfoModel.discountC,
// focusNode: node,
// textAlignVertical: TextAlignVertical.top,
decoration: InputDecoration(
... ... @@ -2909,6 +3150,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
onChanged: (value) {
print('ggg');
_calculatePrice(
costInfoModel,
);
// nameStr = value;
},
onEditingComplete: () {
... ... @@ -2923,7 +3168,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
),
HEmptyView(4),
Text(
'元',
costInfoModel.discount ? '元' : '%',
style: TextStyle(
color: MyColours.color_000000,
fontSize: font(12)),
... ... @@ -2948,7 +3193,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
),
Spacer(),
Text(
'7000000 元',
'${costInfoModel.totalPrice} 元',
style: TextStyle(
color: MyColours.color_515151,
fontWeight: FontWeight.bold,
... ... @@ -3053,7 +3298,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
),
HEmptyView(12),
Text(
'159000 元',
'${feastModel.banquetDetail.contractInfo.contractTotalPrice} 元',
style: TextStyle(
fontWeight: FontWeight.bold,
color: MyColours.color_515151,
... ... @@ -3101,7 +3346,12 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
],
)),
HEmptyView(12),
_textfield('1299', null, null, width: w(110)),
_textfield(
'请输入',
feastModel
.banquetDetail.contractInfo.contractFinalPriceC,
null,
width: w(110)),
HEmptyView(24),
Text(
'元',
... ... @@ -3227,6 +3477,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
// widget.isSelect ? Colors.white : MyColours.color_199095,
//输入文本的样式
style: TextStyle(
color: MyColours.color_438E93,
fontSize: ScreenUtil().setSp(28),
fontWeight: FontWeight.bold,
),
... ... @@ -3361,7 +3612,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
}
///三组 左---中----右
Widget sessionsItem(String title) {
Widget sessionsItem(String title, SessionsInfo sessionsInfo) {
return Padding(
padding: EdgeInsets.symmetric(vertical: h(6)),
child: Row(
... ... @@ -3375,10 +3626,21 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
),
Expanded(
child: ListView.builder(
itemCount: 3,
itemCount: title == '酒水安排:'
? sessionsInfo.wine.length
: sessionsInfo.other.length,
shrinkWrap: true,
controller: _scrollController,
itemBuilder: (BuildContext context, int index) {
String name = title == '酒水安排:'
? sessionsInfo.wine[index].wineName
: sessionsInfo.other[index].otherName;
String numStr = title == '酒水安排:'
? sessionsInfo.wine[index].wineNum
: sessionsInfo.other[index].otherNum;
String spec = title == '酒水安排:'
? sessionsInfo.wine[index].spec
: sessionsInfo.other[index].spec;
return Container(
padding: EdgeInsets.only(bottom: w(8)),
margin: EdgeInsets.only(bottom: w(12)),
... ... @@ -3390,11 +3652,11 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
child: Row(
children: [
Expanded(
child: Text('剑南春52度500ml',
child: Text(name,
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)))),
Text('60 份',
Text('${numStr} ${spec}',
style: TextStyle(
color: MyColours.color_515151,
fontSize: font(12)))
... ... @@ -3435,50 +3697,50 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
ClipRRect(
borderRadius: BorderRadius.circular(r(5)),
child: CachedNetworkImage(
// imageUrl: data[index].qiniuUrl,
imageUrl:
'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242332225H9-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1662806063&t=d576b5247e04ce721c266f098625f145',
imageUrl: data[index],
// imageUrl:
// 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimg.jj20.com%2Fup%2Fallimg%2F4k%2Fs%2F02%2F2109242332225H9-0-lp.jpg&refer=http%3A%2F%2Fimg.jj20.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1662806063&t=d576b5247e04ce721c266f098625f145',
fit: BoxFit.cover,
width: ScreenUtil().setWidth(38 * 2),
height: ScreenUtil().setWidth(38 * 2),
),
),
Positioned(
top: 0,
right: 0,
child: GestureDetector(
child: Image.asset(
Utils.getImgPath("f_delete"),
width: ScreenUtil().setWidth(24),
height: ScreenUtil().setWidth(24),
),
onTap: () {
//已经传到服务器,弹提醒窗口,是否删除
//修改之前有内容,则弹框
DialogUtil.cupertinoAlertDialog(context,
title: "确认删除",
content: "是否确定删除该照片,删除操作不可逆转,请谨慎操作",
lCallback: () {
print("取消");
}, rCallback: () {
print("确定");
// widget.deleteCallback(index);
});
}
// else {
// //点击删除按钮
// setState(() {
// temp.removeWhere((element) =>
// element == temp[index]);
// widget.model.imageQiniuUrlList
// .removeWhere((element) =>
// element ==
// widget.model
// .imageQiniuUrlList[index]);
// });
// }
// },
)),
// Positioned(
// top: 0,
// right: 0,
// child: GestureDetector(
// child: Image.asset(
// Utils.getImgPath("f_delete"),
// width: ScreenUtil().setWidth(24),
// height: ScreenUtil().setWidth(24),
// ),
// onTap: () {
// //已经传到服务器,弹提醒窗口,是否删除
// //修改之前有内容,则弹框
// DialogUtil.cupertinoAlertDialog(context,
// title: "确认删除",
// content: "是否确定删除该照片,删除操作不可逆转,请谨慎操作",
// lCallback: () {
// print("取消");
// }, rCallback: () {
// print("确定");
// // widget.deleteCallback(index);
// });
// }
// // else {
// // //点击删除按钮
// // setState(() {
// // temp.removeWhere((element) =>
// // element == temp[index]);
// // widget.model.imageQiniuUrlList
// // .removeWhere((element) =>
// // element ==
// // widget.model
// // .imageQiniuUrlList[index]);
// // });
// // }
// // },
// )),
],
),
);
... ... @@ -3506,30 +3768,36 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
return Column(
children: [
Expanded(
child:
Padding(
padding: EdgeInsets.symmetric(horizontal: w(12)),
child: SingleChildScrollView(
controller: _scrollController,
child: Column(children: [
baseInfoWidget(), //基本信息
VEmptyView(52),
//场次
ListView.builder(
itemCount: 3,
shrinkWrap: true,
controller: _scrollController,
itemBuilder: (BuildContext context, int index) {
return sessionsWidget('第${index + 1}场');
}),
//费用详情
costWidget(),
//合同
contractWidget(),
invoiceWidget()
]))),
),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: w(12)),
child: SingleChildScrollView(
controller: _scrollController,
child: Column(children: [
baseInfoWidget(), //基本信息
VEmptyView(52),
//场次
ListView.builder(
itemCount:
feastModel.banquetDetail.sessionsInfo.length,
shrinkWrap: true,
controller: _scrollController,
itemBuilder: (BuildContext context, int index) {
SessionsInfo sessionsInfo = feastModel
.banquetDetail.sessionsInfo[index];
String numStr =
ConvertNumberToChineseMoneyWords.toChinese(
index);
return sessionsWidget(
'第${numStr}场', sessionsInfo);
}),
//费用详情
costWidget(),
//合同
contractWidget(),
invoiceWidget()
]))),
),
Row(
children: [
Expanded(
... ...
import 'package:flutter/material.dart';
import 'package:one_key/constant/state.dart';
import 'package:one_key/models/get_banquet_by_id_model.dart';
import 'package:one_key/models/get_setmeal_class_model.dart';
import 'package:one_key/models/order_info_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:provider/provider.dart';
... ... @@ -9,6 +9,7 @@ import '../constant/constant.dart';
import '../constant/error.dart';
import '../models/classify_model.dart';
import '../models/filter_btn_model.dart';
import '../models/get_banquet_by_id_new_model.dart';
import '../models/get_banquet_deposit_model.dart';
import '../models/get_deposit_model.dart';
import '../models/get_seller_user_by_sellerid_model.dart';
... ... @@ -25,6 +26,7 @@ import '../net/base_resp.dart';
import '../net/dio_util.dart';
import '../net/http_url.dart';
import '../utils/utils.dart';
import 'dart:convert' as convert;
class FeastModel extends ChangeNotifier {
PageState pageState = PageState.Success;
... ... @@ -72,6 +74,7 @@ class FeastModel extends ChangeNotifier {
List<GetBanquetDepositSunModel> banquetDepositData = []; //宴会定金列表数据
PageState pageStateBanquet = PageState.Loading; //宴会详情
GetBanquetByIdNewSunModel banquetDetail; //宴会详情信息
/***
*
... ... @@ -317,33 +320,8 @@ class FeastModel extends ChangeNotifier {
return false;
});
if (baseResp.code == Constant.status_success) {
GetBanquetByIdSunModel model =
GetBanquetByIdModel.fromJson(baseResp.responseData).data;
BasicInfo basicInfo = baseResp.data['basic_info'] != null
? new BasicInfo.fromJson(baseResp.data['basic_info'])
: null;
List<SessionsInfo> sessionsInfo = [];
List<String> keys = [];
if (baseResp.data['sessions_info'] != null) {
baseResp.data['sessions_info'].forEach((v) {
SessionsInfo temp = new SessionsInfo.fromJson(v);
sessionsInfo.add(temp);
keys.add(temp.reserveOrder);
});
}
List<CostInfoModel> costInfo = [];
if (baseResp.data['cost_info'] != null) {
Map map = baseResp.data['cost_info'];
for (String item in keys) {
map.forEach((key, value) {
CostInfoModel model = CostInfoModel();
model.title = '${key}费用';
model.costInfoSunModel = CostInfoSunModel.fromJson(value);
costInfo.add(model);
});
}
}
banquetDetail =
GetBanquetByIdNewModel.fromJson(baseResp.responseData).data;
// if (baseResp.data == 1) {
// rid = baseResp.data['id'];
... ...
... ... @@ -32,6 +32,14 @@ import '../app.dart';
typedef BookTimeSetCallback = void Function(bool needChange);
class Utils {
//判定是否为数字
static bool isNumeric(String s) {
if (s == null) {
return false;
}
return double.tryParse(s) != null;
}
//请求参数按key按ASCII排序key1=value1&key2=value2&...&keyN=valueN
static String keySort(Map<String, String> oldParamsMap) {
List attrKeys = oldParamsMap.keys.toList();
... ...