Commit 6bb8b023ffb3471dca371d03672b7841ca466d9c

Authored by wdn127929
1 parent 9a1fc06f

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

1 -class GetBanquetByIdModel {  
2 - int ret;  
3 - GetBanquetByIdSunModel data;  
4 - String msg;  
5 -  
6 - GetBanquetByIdModel({this.ret, this.data, this.msg});  
7 -  
8 - GetBanquetByIdModel.fromJson(Map<String, dynamic> json) {  
9 - ret = json['ret'];  
10 - data = json['data'] != null  
11 - ? new GetBanquetByIdSunModel.fromJson(json['data'])  
12 - : null;  
13 - msg = json['msg'];  
14 - }  
15 -  
16 - Map<String, dynamic> toJson() {  
17 - final Map<String, dynamic> data = new Map<String, dynamic>();  
18 - data['ret'] = this.ret;  
19 - if (this.data != null) {  
20 - data['data'] = this.data.toJson();  
21 - }  
22 - data['msg'] = this.msg;  
23 - return data;  
24 - }  
25 -}  
26 -  
27 -class GetBanquetByIdSunModel {  
28 - BasicInfo basicInfo;  
29 - List<SessionsInfo> sessionsInfo;  
30 - ContractInfo contractInfo;  
31 - String invoice;  
32 -  
33 - GetBanquetByIdSunModel(  
34 - {this.basicInfo, this.sessionsInfo, this.contractInfo, this.invoice});  
35 -  
36 - GetBanquetByIdSunModel.fromJson(Map<String, dynamic> json) {  
37 - basicInfo = json['basic_info'] != null  
38 - ? new BasicInfo.fromJson(json['basic_info'])  
39 - : null;  
40 - if (json['sessions_info'] != null) {  
41 - sessionsInfo = <SessionsInfo>[];  
42 - json['sessions_info'].forEach((v) {  
43 - sessionsInfo.add(new SessionsInfo.fromJson(v));  
44 - });  
45 - }  
46 -  
47 - contractInfo = json['contract_info'] != null  
48 - ? new ContractInfo.fromJson(json['contract_info'])  
49 - : null;  
50 - invoice = json['invoice'];  
51 - }  
52 -  
53 - Map<String, dynamic> toJson() {  
54 - final Map<String, dynamic> data = new Map<String, dynamic>();  
55 - if (this.basicInfo != null) {  
56 - data['basic_info'] = this.basicInfo.toJson();  
57 - }  
58 - if (this.sessionsInfo != null) {  
59 - data['sessions_info'] = this.sessionsInfo.map((v) => v.toJson()).toList();  
60 - }  
61 -  
62 - if (this.contractInfo != null) {  
63 - data['contract_info'] = this.contractInfo.toJson();  
64 - }  
65 - data['invoice'] = this.invoice;  
66 - return data;  
67 - }  
68 -}  
69 -  
70 -class BasicInfo {  
71 - String ddate;  
72 - String rname;  
73 - String sex;  
74 - String phone;  
75 - String remark;  
76 - Jiedan jiedan;  
77 - Jiedan staff;  
78 - String classify;  
79 -  
80 - BasicInfo(  
81 - {this.ddate,  
82 - this.rname,  
83 - this.sex,  
84 - this.phone,  
85 - this.remark,  
86 - this.jiedan,  
87 - this.staff,  
88 - this.classify});  
89 -  
90 - BasicInfo.fromJson(Map<String, dynamic> json) {  
91 - ddate = json['ddate'];  
92 - rname = json['rname'];  
93 - sex = json['sex'];  
94 - phone = json['phone'];  
95 - remark = json['remark'];  
96 - jiedan =  
97 - json['jiedan'] != null ? new Jiedan.fromJson(json['jiedan']) : null;  
98 - staff = json['staff'] != null ? new Jiedan.fromJson(json['staff']) : null;  
99 - classify = json['classify'];  
100 - }  
101 -  
102 - Map<String, dynamic> toJson() {  
103 - final Map<String, dynamic> data = new Map<String, dynamic>();  
104 - data['ddate'] = this.ddate;  
105 - data['rname'] = this.rname;  
106 - data['sex'] = this.sex;  
107 - data['phone'] = this.phone;  
108 - data['remark'] = this.remark;  
109 - if (this.jiedan != null) {  
110 - data['jiedan'] = this.jiedan.toJson();  
111 - }  
112 - if (this.staff != null) {  
113 - data['staff'] = this.staff.toJson();  
114 - }  
115 - data['classify'] = this.classify;  
116 - return data;  
117 - }  
118 -}  
119 -  
120 -class Jiedan {  
121 - String nickName;  
122 - String account;  
123 -  
124 - Jiedan({this.nickName, this.account});  
125 -  
126 - Jiedan.fromJson(Map<String, dynamic> json) {  
127 - nickName = json['nick_name'];  
128 - account = json['account'];  
129 - }  
130 -  
131 - Map<String, dynamic> toJson() {  
132 - final Map<String, dynamic> data = new Map<String, dynamic>();  
133 - data['nick_name'] = this.nickName;  
134 - data['account'] = this.account;  
135 - return data;  
136 - }  
137 -}  
138 -  
139 -class SessionsInfo {  
140 - String id;  
141 - String rid;  
142 - String reserveOrder;  
143 - String ddateInterval;  
144 - String rdate;  
145 - String tids;  
146 - String setmeal;  
147 - String wine;  
148 - String other;  
149 - dynamic remark;  
150 - String images;  
151 - dynamic serviceType;  
152 - dynamic servicePer;  
153 - dynamic servicePrice;  
154 - dynamic discountType;  
155 - dynamic discountPer;  
156 - dynamic discountPrice;  
157 -  
158 - SessionsInfo(  
159 - {this.id,  
160 - this.rid,  
161 - this.reserveOrder,  
162 - this.ddateInterval,  
163 - this.rdate,  
164 - this.tids,  
165 - this.setmeal,  
166 - this.wine,  
167 - this.other,  
168 - this.remark,  
169 - this.images,  
170 - this.serviceType,  
171 - this.servicePer,  
172 - this.servicePrice,  
173 - this.discountType,  
174 - this.discountPer,  
175 - this.discountPrice});  
176 -  
177 - SessionsInfo.fromJson(Map<String, dynamic> json) {  
178 - id = json['id'];  
179 - rid = json['rid'];  
180 - reserveOrder = json['reserve_order'];  
181 - ddateInterval = json['ddate_interval'];  
182 - rdate = json['rdate'];  
183 - tids = json['tids'];  
184 - setmeal = json['setmeal'];  
185 - wine = json['wine'];  
186 - other = json['other'];  
187 - remark = json['remark'];  
188 - images = json['images'];  
189 - serviceType = json['service_type'];  
190 - servicePer = json['service_per'];  
191 - servicePrice = json['service_price'];  
192 - discountType = json['discount_type'];  
193 - discountPer = json['discount_per'];  
194 - discountPrice = json['discount_price'];  
195 - }  
196 -  
197 - Map<String, dynamic> toJson() {  
198 - final Map<String, dynamic> data = new Map<String, dynamic>();  
199 - data['id'] = this.id;  
200 - data['rid'] = this.rid;  
201 - data['reserve_order'] = this.reserveOrder;  
202 - data['ddate_interval'] = this.ddateInterval;  
203 - data['rdate'] = this.rdate;  
204 - data['tids'] = this.tids;  
205 - data['setmeal'] = this.setmeal;  
206 - data['wine'] = this.wine;  
207 - data['other'] = this.other;  
208 - data['remark'] = this.remark;  
209 - data['images'] = this.images;  
210 - data['service_type'] = this.serviceType;  
211 - data['service_per'] = this.servicePer;  
212 - data['service_price'] = this.servicePrice;  
213 - data['discount_type'] = this.discountType;  
214 - data['discount_per'] = this.discountPer;  
215 - data['discount_price'] = this.discountPrice;  
216 - return data;  
217 - }  
218 -}  
219 -  
220 -class CostInfoModel {  
221 - String title;  
222 - CostInfoSunModel costInfoSunModel;  
223 - //服务费  
224 -// 优惠金额  
225 -}  
226 -  
227 -class CostInfoSunModel {  
228 - String cname;  
229 - String unitPrice;  
230 - String numStr;  
231 - int price;  
232 -  
233 - CostInfoSunModel({this.cname, this.unitPrice, this.numStr, this.price});  
234 -  
235 - CostInfoSunModel.fromJson(Map<String, dynamic> json) {  
236 - cname = json['cname'];  
237 - unitPrice = json['unit_price'];  
238 - numStr = json['num'];  
239 - price = json['price'];  
240 - }  
241 -  
242 - Map<String, dynamic> toJson() {  
243 - final Map<String, dynamic> data = new Map<String, dynamic>();  
244 - data['cname'] = this.cname;  
245 - data['unit_price'] = this.unitPrice;  
246 - data['num'] = this.numStr;  
247 - data['price'] = this.price;  
248 - return data;  
249 - }  
250 -}  
251 -  
252 -class ContractInfo {  
253 - String contractTotalPrice;  
254 - String contractFinalPrice;  
255 - String contractRname;  
256 - String contractSellerName;  
257 - String contractNo;  
258 - String contractImages;  
259 -  
260 - ContractInfo(  
261 - {this.contractTotalPrice,  
262 - this.contractFinalPrice,  
263 - this.contractRname,  
264 - this.contractSellerName,  
265 - this.contractNo,  
266 - this.contractImages});  
267 -  
268 - ContractInfo.fromJson(Map<String, dynamic> json) {  
269 - contractTotalPrice = json['contract_total_price'];  
270 - contractFinalPrice = json['contract_final_price'];  
271 - contractRname = json['contract_rname'];  
272 - contractSellerName = json['contract_seller_name'];  
273 - contractNo = json['contract_no'];  
274 - contractImages = json['contract_images'];  
275 - }  
276 -  
277 - Map<String, dynamic> toJson() {  
278 - final Map<String, dynamic> data = new Map<String, dynamic>();  
279 - data['contract_total_price'] = this.contractTotalPrice;  
280 - data['contract_final_price'] = this.contractFinalPrice;  
281 - data['contract_rname'] = this.contractRname;  
282 - data['contract_seller_name'] = this.contractSellerName;  
283 - data['contract_no'] = this.contractNo;  
284 - data['contract_images'] = this.contractImages;  
285 - return data;  
286 - }  
287 -}  
  1 +import 'dart:convert' as convert;
  2 +
  3 +import 'package:flutter/material.dart';
  4 +
  5 +class GetBanquetByIdNewModel {
  6 + int ret;
  7 + GetBanquetByIdNewSunModel data;
  8 + String msg;
  9 +
  10 + GetBanquetByIdNewModel({this.ret, this.data, this.msg});
  11 +
  12 + GetBanquetByIdNewModel.fromJson(Map<String, dynamic> json) {
  13 + ret = json['ret'];
  14 + data = json['data'] != null
  15 + ? new GetBanquetByIdNewSunModel.fromJson(json['data'])
  16 + : null;
  17 + msg = json['msg'];
  18 + }
  19 +
  20 + Map<String, dynamic> toJson() {
  21 + final Map<String, dynamic> data = new Map<String, dynamic>();
  22 + data['ret'] = this.ret;
  23 + if (this.data != null) {
  24 + data['data'] = this.data.toJson();
  25 + }
  26 + data['msg'] = this.msg;
  27 + return data;
  28 + }
  29 +}
  30 +
  31 +class GetBanquetByIdNewSunModel {
  32 + BasicInfo basicInfo;
  33 + List<SessionsInfo> sessionsInfo;
  34 + List<CostInfoModel> costInfo; //费用信息
  35 + ContractInfo contractInfo;
  36 + Invoice invoice;
  37 +
  38 + GetBanquetByIdNewSunModel(
  39 + {this.basicInfo,
  40 + this.sessionsInfo,
  41 + this.costInfo,
  42 + this.contractInfo,
  43 + this.invoice});
  44 +
  45 + GetBanquetByIdNewSunModel.fromJson(Map<String, dynamic> json) {
  46 + basicInfo = json['basic_info'] != null
  47 + ? new BasicInfo.fromJson(json['basic_info'])
  48 + : null;
  49 + if (json['sessions_info'] != null) {
  50 + sessionsInfo = <SessionsInfo>[];
  51 + json['sessions_info'].forEach((v) {
  52 + sessionsInfo.add(new SessionsInfo.fromJson(v));
  53 + });
  54 + }
  55 +
  56 + contractInfo = ContractInfo();
  57 + // contractInfo = json['contract_info'] != null
  58 + // ? new ContractInfo.fromJson(json['contract_info'])
  59 + // : null;
  60 + invoice = json['invoice'] != null
  61 + ? new Invoice.fromJson(convert.jsonDecode(json['invoice']))
  62 + : null; //发票信息
  63 + if (json['cost_info'] != null) {
  64 + costInfo = <CostInfoModel>[];
  65 + double totalP = 0.0;
  66 + json['cost_info'].forEach((key, v) {
  67 + CostInfoModel model = CostInfoModel.fromJson(v);
  68 + model.title = '${key}费用';
  69 + costInfo.add(model);
  70 + totalP += double.parse(model.sumPrice);
  71 + });
  72 + contractInfo.contractTotalPrice = totalP.toString();
  73 + }
  74 + }
  75 +
  76 + Map<String, dynamic> toJson() {
  77 + final Map<String, dynamic> data = new Map<String, dynamic>();
  78 + if (this.basicInfo != null) {
  79 + data['basic_info'] = this.basicInfo.toJson();
  80 + }
  81 + if (this.sessionsInfo != null) {
  82 + data['sessions_info'] = this.sessionsInfo.map((v) => v.toJson()).toList();
  83 + }
  84 + if (this.costInfo != null) {
  85 + data['cost_info'] = this.costInfo.map((v) => v.toJson()).toList();
  86 + }
  87 + if (this.contractInfo != null) {
  88 + data['contract_info'] = this.contractInfo.toJson();
  89 + }
  90 + data['invoice'] = this.invoice;
  91 + return data;
  92 + }
  93 +}
  94 +
  95 +class BasicInfo {
  96 + String ddate;
  97 + String rname;
  98 + String sex;
  99 + String phone;
  100 + String remark;
  101 + Jiedan jiedan;
  102 + Jiedan staff;
  103 + String classify;
  104 +
  105 + BasicInfo(
  106 + {this.ddate,
  107 + this.rname,
  108 + this.sex,
  109 + this.phone,
  110 + this.remark,
  111 + this.jiedan,
  112 + this.staff,
  113 + this.classify});
  114 +
  115 + BasicInfo.fromJson(Map<String, dynamic> json) {
  116 + ddate = json['ddate'];
  117 + rname = json['rname'];
  118 + sex = json['sex'];
  119 + phone = json['phone'];
  120 + remark = json['remark'];
  121 + jiedan =
  122 + json['jiedan'] != null ? new Jiedan.fromJson(json['jiedan']) : null;
  123 + staff = json['staff'] != null ? new Jiedan.fromJson(json['staff']) : null;
  124 + classify = json['classify'];
  125 + }
  126 +
  127 + Map<String, dynamic> toJson() {
  128 + final Map<String, dynamic> data = new Map<String, dynamic>();
  129 + data['ddate'] = this.ddate;
  130 + data['rname'] = this.rname;
  131 + data['sex'] = this.sex;
  132 + data['phone'] = this.phone;
  133 + data['remark'] = this.remark;
  134 + if (this.jiedan != null) {
  135 + data['jiedan'] = this.jiedan.toJson();
  136 + }
  137 + if (this.staff != null) {
  138 + data['staff'] = this.staff.toJson();
  139 + }
  140 + data['classify'] = this.classify;
  141 + return data;
  142 + }
  143 +}
  144 +
  145 +class Jiedan {
  146 + String nickName;
  147 + String account;
  148 +
  149 + Jiedan({this.nickName, this.account});
  150 +
  151 + Jiedan.fromJson(Map<String, dynamic> json) {
  152 + nickName = json['nick_name'];
  153 + account = json['account'];
  154 + }
  155 +
  156 + Map<String, dynamic> toJson() {
  157 + final Map<String, dynamic> data = new Map<String, dynamic>();
  158 + data['nick_name'] = this.nickName;
  159 + data['account'] = this.account;
  160 + return data;
  161 + }
  162 +}
  163 +
  164 +class SessionsInfo {
  165 + String rdate;
  166 + String tableInfo;
  167 + List<SetmealDetail> setmeal;
  168 + List<WineDetail> wine;
  169 + List<OtherDetail> other;
  170 + String remark;
  171 + List<Images> images;
  172 +
  173 + SessionsInfo(
  174 + {this.rdate,
  175 + this.tableInfo,
  176 + this.setmeal,
  177 + this.wine,
  178 + this.other,
  179 + this.remark,
  180 + this.images});
  181 +
  182 + SessionsInfo.fromJson(Map<String, dynamic> json) {
  183 + rdate = json['rdate'];
  184 + tableInfo = json['table_info'];
  185 + if (json['setmeal'] != null) {
  186 + setmeal = <SetmealDetail>[];
  187 + json['setmeal'].forEach((v) {
  188 + setmeal.add(new SetmealDetail.fromJson(v));
  189 + });
  190 + }
  191 + if (json['wine'] != null) {
  192 + wine = <WineDetail>[];
  193 + json['wine'].forEach((v) {
  194 + wine.add(new WineDetail.fromJson(v));
  195 + });
  196 + }
  197 + if (json['other'] != null) {
  198 + other = <OtherDetail>[];
  199 + json['other'].forEach((v) {
  200 + other.add(new OtherDetail.fromJson(v));
  201 + });
  202 + }
  203 + remark = json['remark'];
  204 +
  205 + if (json['images'] != null) {
  206 + images = <Images>[];
  207 + convert.jsonDecode(json['images']).forEach((v) {
  208 + images.add(new Images.fromJson(v));
  209 + });
  210 + }
  211 + }
  212 +
  213 + Map<String, dynamic> toJson() {
  214 + final Map<String, dynamic> data = new Map<String, dynamic>();
  215 + data['rdate'] = this.rdate;
  216 + data['table_info'] = this.tableInfo;
  217 + if (this.setmeal != null) {
  218 + data['setmeal'] = this.setmeal.map((v) => v.toJson()).toList();
  219 + }
  220 + if (this.wine != null) {
  221 + data['wine'] = this.wine.map((v) => v.toJson()).toList();
  222 + }
  223 + if (this.other != null) {
  224 + data['other'] = this.other.map((v) => v.toJson()).toList();
  225 + }
  226 + data['remark'] = this.remark;
  227 + data['images'] = this.images;
  228 + return data;
  229 + }
  230 +}
  231 +
  232 +class SetmealDetail {
  233 + String setmealId;
  234 + String price;
  235 + String finalPrice;
  236 + String pnum;
  237 + String min;
  238 + String spare;
  239 + List<Cooklist> cooklist;
  240 + String mealName;
  241 +
  242 + SetmealDetail(
  243 + {this.setmealId,
  244 + this.price,
  245 + this.finalPrice,
  246 + this.pnum,
  247 + this.min,
  248 + this.spare,
  249 + this.cooklist,
  250 + this.mealName});
  251 +
  252 + SetmealDetail.fromJson(Map<String, dynamic> json) {
  253 + setmealId = json['setmeal_id'];
  254 + price = json['price'];
  255 + finalPrice = json['final_price'];
  256 + pnum = json['pnum'];
  257 + min = json['min'];
  258 + spare = json['spare'];
  259 + if (json['cooklist'] != null) {
  260 + cooklist = <Cooklist>[];
  261 + json['cooklist'].forEach((v) {
  262 + cooklist.add(new Cooklist.fromJson(v));
  263 + });
  264 + }
  265 + mealName = json['meal_name'];
  266 + }
  267 +
  268 + Map<String, dynamic> toJson() {
  269 + final Map<String, dynamic> data = new Map<String, dynamic>();
  270 + data['setmeal_id'] = this.setmealId;
  271 + data['price'] = this.price;
  272 + data['final_price'] = this.finalPrice;
  273 + data['pnum'] = this.pnum;
  274 + data['min'] = this.min;
  275 + data['spare'] = this.spare;
  276 + if (this.cooklist != null) {
  277 + data['cooklist'] = this.cooklist.map((v) => v.toJson()).toList();
  278 + }
  279 + data['meal_name'] = this.mealName;
  280 + return data;
  281 + }
  282 +}
  283 +
  284 +class Cooklist {
  285 + String cname;
  286 +
  287 + Cooklist({this.cname});
  288 +
  289 + Cooklist.fromJson(Map<String, dynamic> json) {
  290 + cname = json['cname'];
  291 + }
  292 +
  293 + Map<String, dynamic> toJson() {
  294 + final Map<String, dynamic> data = new Map<String, dynamic>();
  295 + data['cname'] = this.cname;
  296 + return data;
  297 + }
  298 +}
  299 +
  300 +class WineDetail {
  301 + String wineName;
  302 + String wineNum;
  303 + String spec;
  304 +
  305 + WineDetail({this.wineName, this.wineNum, this.spec});
  306 +
  307 + WineDetail.fromJson(Map<String, dynamic> json) {
  308 + wineName = json['wine_name'];
  309 + wineNum = json['wine_num'];
  310 + spec = json['spec'];
  311 + }
  312 +
  313 + Map<String, dynamic> toJson() {
  314 + final Map<String, dynamic> data = new Map<String, dynamic>();
  315 + data['wine_name'] = this.wineName;
  316 + data['wine_num'] = this.wineNum;
  317 + data['spec'] = this.spec;
  318 +
  319 + return data;
  320 + }
  321 +}
  322 +
  323 +class OtherDetail {
  324 + String otherName;
  325 + String otherNum;
  326 + String spec;
  327 +
  328 + OtherDetail({this.otherName, this.otherNum, this.spec});
  329 +
  330 + OtherDetail.fromJson(Map<String, dynamic> json) {
  331 + otherName = json['other_name'];
  332 + otherNum = json['other_num'];
  333 + spec = json['spec'];
  334 + }
  335 +
  336 + Map<String, dynamic> toJson() {
  337 + final Map<String, dynamic> data = new Map<String, dynamic>();
  338 + data['other_name'] = this.otherName;
  339 + data['other_num'] = this.otherNum;
  340 + data['spec'] = this.spec;
  341 + return data;
  342 + }
  343 +}
  344 +
  345 +class CostInfoModel {
  346 + String title;
  347 + List<CostInfoSunModel> data;
  348 + bool service = true; //服务费
  349 + bool discount = true; // 优惠金额
  350 + TextEditingController serviceC = TextEditingController();
  351 + TextEditingController discountC = TextEditingController();
  352 + String totalPrice; //合计
  353 + String sumPrice; //优惠和服务费之前的金额
  354 +
  355 + CostInfoModel({this.title, this.data});
  356 +
  357 + CostInfoModel.fromJson(List<dynamic> json) {
  358 + data = [];
  359 + double price = 0.0;
  360 + json.forEach((value) {
  361 + CostInfoSunModel sunModel = new CostInfoSunModel.fromJson(value);
  362 + price += sunModel.price;
  363 + data.add(sunModel);
  364 + });
  365 + sumPrice = price.toString();
  366 + totalPrice = sumPrice;
  367 + }
  368 +
  369 + Map<String, dynamic> toJson() {
  370 + final Map<String, dynamic> data = new Map<String, dynamic>();
  371 + data['title'] = this.title;
  372 + data['data'] = this.data;
  373 + return data;
  374 + }
  375 +}
  376 +
  377 +class CostInfoSunModel {
  378 + String cname;
  379 + String unitPrice;
  380 + String numStr;
  381 + int price;
  382 + String wineName;
  383 + String otherName;
  384 +
  385 + CostInfoSunModel(
  386 + {this.cname,
  387 + this.unitPrice,
  388 + this.numStr,
  389 + this.price,
  390 + this.wineName,
  391 + this.otherName});
  392 +
  393 + CostInfoSunModel.fromJson(Map<String, dynamic> json) {
  394 + cname = json['cname'];
  395 + unitPrice = json['unit_price'];
  396 + numStr = json['num'];
  397 + price = json['price'];
  398 + wineName = json['wine_name'];
  399 + otherName = json['other_name'];
  400 + }
  401 +
  402 + Map<String, dynamic> toJson() {
  403 + final Map<String, dynamic> data = new Map<String, dynamic>();
  404 + data['cname'] = this.cname;
  405 + data['unit_price'] = this.unitPrice;
  406 + data['num'] = this.numStr;
  407 + data['price'] = this.price;
  408 + data['wine_name'] = this.wineName;
  409 + data['other_name'] = this.otherName;
  410 + return data;
  411 + }
  412 +}
  413 +
  414 +class ContractInfo {
  415 + String contractTotalPrice;
  416 + String contractFinalPrice;
  417 + String contractRname;
  418 + String contractSellerName;
  419 + String contractNo;
  420 + List<Images> contractImages;
  421 + TextEditingController contractFinalPriceC = TextEditingController();
  422 +
  423 + ContractInfo(
  424 + {this.contractTotalPrice,
  425 + this.contractFinalPrice,
  426 + this.contractRname,
  427 + this.contractSellerName,
  428 + this.contractNo,
  429 + this.contractImages});
  430 +
  431 + ContractInfo.fromJson(Map<String, dynamic> json) {
  432 + contractTotalPrice = json['contract_total_price'];
  433 + contractFinalPrice = json['contract_final_price'];
  434 + contractRname = json['contract_rname'];
  435 + contractSellerName = json['contract_seller_name'];
  436 + contractNo = json['contract_no'];
  437 + if (json['contract_images'] != null) {
  438 + contractImages = <Images>[];
  439 + convert.jsonDecode(json['contract_images']).forEach((v) {
  440 + contractImages.add(new Images.fromJson(v));
  441 + });
  442 + }
  443 + }
  444 +
  445 + Map<String, dynamic> toJson() {
  446 + final Map<String, dynamic> data = new Map<String, dynamic>();
  447 + data['contract_total_price'] = this.contractTotalPrice;
  448 + data['contract_final_price'] = this.contractFinalPrice;
  449 + data['contract_rname'] = this.contractRname;
  450 + data['contract_seller_name'] = this.contractSellerName;
  451 + data['contract_no'] = this.contractNo;
  452 + data['contract_images'] = this.contractImages;
  453 + return data;
  454 + }
  455 +}
  456 +
  457 +class Images {
  458 + String url;
  459 +
  460 + Images({this.url});
  461 +
  462 + Images.fromJson(Map<String, dynamic> json) {
  463 + url = json['url'];
  464 + }
  465 +
  466 + Map<String, dynamic> toJson() {
  467 + final Map<String, dynamic> data = new Map<String, dynamic>();
  468 + data['url'] = this.url;
  469 + return data;
  470 + }
  471 +}
  472 +
  473 +class Invoice {
  474 + String invoiceType; // "1 普通 2 专用",
  475 + String price; //开票金额
  476 + String unitName; //单位全称
  477 + String numStr; //税号
  478 + String address; //地址
  479 + String phone; //电话
  480 + String bank; //开户行
  481 + String bankNum; //开户行账号
  482 + String mail; //邮箱
  483 + String addressee; //收件人
  484 + String addresseePhone; //收件人电话
  485 + String addresseeAddress; //收件人地址
  486 + String code; //邮编
  487 +
  488 + Invoice(
  489 + {this.invoiceType,
  490 + this.price,
  491 + this.unitName,
  492 + this.numStr,
  493 + this.address,
  494 + this.phone,
  495 + this.bank,
  496 + this.bankNum,
  497 + this.mail,
  498 + this.addressee,
  499 + this.addresseePhone,
  500 + this.addresseeAddress,
  501 + this.code});
  502 +
  503 + Invoice.fromJson(Map<String, dynamic> json) {
  504 + invoiceType = json['invoice_type'];
  505 + price = json['price'];
  506 + unitName = json['unit_name'];
  507 + numStr = json['num'];
  508 + address = json['address'];
  509 + phone = json['phone'];
  510 + bank = json['bank'];
  511 + bankNum = json['bank_num'];
  512 + mail = json['mail'];
  513 + addressee = json['addressee'];
  514 + addresseePhone = json['addressee_phone'];
  515 + addresseeAddress = json['addressee_address'];
  516 + code = json['code'];
  517 + }
  518 +
  519 + Map<String, dynamic> toJson() {
  520 + final Map<String, dynamic> data = new Map<String, dynamic>();
  521 + data['invoice_type'] = this.invoiceType;
  522 + data['price'] = this.price;
  523 + data['unit_name'] = this.unitName;
  524 + data['num'] = this.numStr;
  525 + data['address'] = this.address;
  526 + data['phone'] = this.phone;
  527 + data['bank'] = this.bank;
  528 + data['bank_num'] = this.bankNum;
  529 + data['mail'] = this.mail;
  530 + data['addressee'] = this.addressee;
  531 + data['addressee_phone'] = this.addresseePhone;
  532 + data['addressee_address'] = this.addresseeAddress;
  533 + data['code'] = this.code;
  534 + return data;
  535 + }
  536 +}
@@ -50,32 +50,32 @@ class SetXuanTaiModel { @@ -50,32 +50,32 @@ class SetXuanTaiModel {
50 reserveOrder = json['reserve_order']; 50 reserveOrder = json['reserve_order'];
51 ddateInterval = json['ddate_interval']; 51 ddateInterval = json['ddate_interval'];
52 rdate = json['rdate']; 52 rdate = json['rdate'];
53 - if (json['tids'] = null) { 53 + if (json['tids'] != null) {
54 tids = <Tids>[]; 54 tids = <Tids>[];
55 json['tids'].forEach((v) { 55 json['tids'].forEach((v) {
56 tids.add(new Tids.fromJson(v)); 56 tids.add(new Tids.fromJson(v));
57 }); 57 });
58 } 58 }
59 - if (json['setmeal'] = null) { 59 + if (json['setmeal'] != null) {
60 setmeal = <Setmeal>[]; 60 setmeal = <Setmeal>[];
61 json['setmeal'].forEach((v) { 61 json['setmeal'].forEach((v) {
62 setmeal.add(new Setmeal.fromJson(v)); 62 setmeal.add(new Setmeal.fromJson(v));
63 }); 63 });
64 } 64 }
65 - if (json['wine'] = null) { 65 + if (json['wine'] != null) {
66 wine = <Wine>[]; 66 wine = <Wine>[];
67 json['wine'].forEach((v) { 67 json['wine'].forEach((v) {
68 wine.add(new Wine.fromJson(v)); 68 wine.add(new Wine.fromJson(v));
69 }); 69 });
70 } 70 }
71 - if (json['other'] = null) { 71 + if (json['other'] != null) {
72 other = <Other>[]; 72 other = <Other>[];
73 json['other'].forEach((v) { 73 json['other'].forEach((v) {
74 other.add(new Other.fromJson(v)); 74 other.add(new Other.fromJson(v));
75 }); 75 });
76 } 76 }
77 remark = json['remark']; 77 remark = json['remark'];
78 - if (json['images'] = null) { 78 + if (json['images'] != null) {
79 images = <Images>[]; 79 images = <Images>[];
80 json['images'].forEach((v) { 80 json['images'].forEach((v) {
81 images.add(new Images.fromJson(v)); 81 images.add(new Images.fromJson(v));
@@ -89,20 +89,20 @@ class SetXuanTaiModel { @@ -89,20 +89,20 @@ class SetXuanTaiModel {
89 data['reserve_order'] = this.reserveOrder; 89 data['reserve_order'] = this.reserveOrder;
90 data['ddate_interval'] = this.ddateInterval; 90 data['ddate_interval'] = this.ddateInterval;
91 data['rdate'] = this.rdate; 91 data['rdate'] = this.rdate;
92 - if (this.tids = null) { 92 + if (this.tids != null) {
93 data['tids'] = this.tids.map((v) => v.toJson()).toList(); 93 data['tids'] = this.tids.map((v) => v.toJson()).toList();
94 } 94 }
95 - if (this.setmeal = null) { 95 + if (this.setmeal != null) {
96 data['setmeal'] = this.setmeal.map((v) => v.toJson()).toList(); 96 data['setmeal'] = this.setmeal.map((v) => v.toJson()).toList();
97 } 97 }
98 - if (this.wine = null) { 98 + if (this.wine != null) {
99 data['wine'] = this.wine.map((v) => v.toJson()).toList(); 99 data['wine'] = this.wine.map((v) => v.toJson()).toList();
100 } 100 }
101 - if (this.other = null) { 101 + if (this.other != null) {
102 data['other'] = this.other.map((v) => v.toJson()).toList(); 102 data['other'] = this.other.map((v) => v.toJson()).toList();
103 } 103 }
104 data['remark'] = this.remark; 104 data['remark'] = this.remark;
105 - if (this.images = null) { 105 + if (this.images != null) {
106 data['images'] = this.images.map((v) => v.toJson()).toList(); 106 data['images'] = this.images.map((v) => v.toJson()).toList();
107 } 107 }
108 return data; 108 return data;
@@ -110,8 +110,8 @@ class SetXuanTaiModel { @@ -110,8 +110,8 @@ class SetXuanTaiModel {
110 } 110 }
111 111
112 class Tids { 112 class Tids {
113 - String tid;  
114 - String numStr; 113 + dynamic tid;
  114 + dynamic numStr;
115 String name; 115 String name;
116 TextEditingController tableNumC = TextEditingController(); //桌位个数 116 TextEditingController tableNumC = TextEditingController(); //桌位个数
117 117
@@ -17,6 +17,7 @@ import 'package:provider/provider.dart'; @@ -17,6 +17,7 @@ import 'package:provider/provider.dart';
17 import '../../constant/state.dart'; 17 import '../../constant/state.dart';
18 import '../../models/dsolt_xt.dart'; 18 import '../../models/dsolt_xt.dart';
19 import '../../models/feast_menu_model.dart'; 19 import '../../models/feast_menu_model.dart';
  20 +import '../../models/get_banquet_by_id_new_model.dart';
20 import '../../models/set_xuan_tai_model.dart'; 21 import '../../models/set_xuan_tai_model.dart';
21 import '../../models/setmeal_by_id_model.dart'; 22 import '../../models/setmeal_by_id_model.dart';
22 import '../../models/upload_img_model.dart'; 23 import '../../models/upload_img_model.dart';
@@ -176,9 +177,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -176,9 +177,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
176 await feastModel.getStaff(context); 177 await feastModel.getStaff(context);
177 } 178 }
178 179
179 -///获取宴会详情 180 + ///获取宴会详情
180 _getBanquetById() async { 181 _getBanquetById() async {
181 - Map<String, String> pramas = {'rid': '64'};//feastModel.rid 182 + Map<String, String> pramas = {'rid': '64'}; //feastModel.rid
182 await feastModel.getBanquetById(context, pramas); 183 await feastModel.getBanquetById(context, pramas);
183 } 184 }
184 185
@@ -2496,13 +2497,26 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2496,13 +2497,26 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2496 left: w(12), right: w(12), top: w(8), bottom: w(11)), 2497 left: w(12), right: w(12), top: w(8), bottom: w(11)),
2497 child: Column( 2498 child: Column(
2498 children: [ 2499 children: [
2499 - baseInfoItem('宴会日期:', '2022-08-02 (周二 七月初五)'),  
2500 - baseInfoItem('宴会类型:', '婚宴'),  
2501 - baseInfoItem('预订人:', '方 先生'),  
2502 - baseInfoItem('场次数量:', '共 1 场'),  
2503 - baseInfoItem('电话:', '15833517582'),  
2504 - baseInfoItem('服务经理:', '刘经理'),  
2505 - baseInfoItem('备注:', '无'), 2500 + baseInfoItem(
  2501 + '宴会日期:',
  2502 + createDateText(
  2503 + context,
  2504 + DateTime.fromMillisecondsSinceEpoch(int.parse(
  2505 + feastModel.banquetDetail.basicInfo.ddate) *
  2506 + 1000))),
  2507 + baseInfoItem(
  2508 + '宴会类型:', feastModel.banquetDetail.basicInfo.classify),
  2509 + baseInfoItem('预订人:',
  2510 + '${feastModel.banquetDetail.basicInfo.rname} ${feastModel.banquetDetail.basicInfo.sex}'),
  2511 + baseInfoItem('场次数量:',
  2512 + '共 ${feastModel.banquetDetail.sessionsInfo.length} 场'),
  2513 + baseInfoItem('电话:', feastModel.banquetDetail.basicInfo.phone),
  2514 + baseInfoItem(
  2515 + '服务经理:',
  2516 + feastModel.banquetDetail.basicInfo.jiedan.nickName ??
  2517 + feastModel.banquetDetail.basicInfo.jiedan.account),
  2518 + baseInfoItem(
  2519 + '备注:', feastModel.banquetDetail.basicInfo.remark ?? '无'),
2506 ], 2520 ],
2507 )) 2521 ))
2508 ], 2522 ],
@@ -2511,9 +2525,15 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2511,9 +2525,15 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2511 } 2525 }
2512 2526
2513 ///第一场 。第二场。。。。 2527 ///第一场 。第二场。。。。
2514 - Widget sessionsWidget(  
2515 - String title,  
2516 - ) { 2528 + Widget sessionsWidget(String title, SessionsInfo sessionsInfo) {
  2529 + int tableNum = 0;
  2530 + List<String> temp = sessionsInfo.tableInfo.split('、');
  2531 + temp.forEach((element) {
  2532 + int start = element.indexOf('(');
  2533 + int end = element.length - 2;
  2534 + String numstr = element.substring(start + 1, end);
  2535 + tableNum += int.parse(numstr);
  2536 + });
2517 return Container( 2537 return Container(
2518 margin: EdgeInsets.only(bottom: h(26)), 2538 margin: EdgeInsets.only(bottom: h(26)),
2519 decoration: BoxDecoration( 2539 decoration: BoxDecoration(
@@ -2541,9 +2561,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2541,9 +2561,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2541 left: w(12), right: w(12), top: w(8), bottom: w(11)), 2561 left: w(12), right: w(12), top: w(8), bottom: w(11)),
2542 child: Column( 2562 child: Column(
2543 children: [ 2563 children: [
2544 - baseInfoItem('场次时间:', '2022-08-02 午餐 12:00至14:00'),  
2545 - baseInfoItem('桌位数量:', '共 32 桌'),  
2546 - baseInfoItem('桌位信息:', '凤凰厅 (30桌)、包间1 (1桌)、包间2 (1桌)'), 2564 + baseInfoItem('场次时间:', sessionsInfo.rdate),
  2565 + baseInfoItem('桌位数量:', '共 ${tableNum} 桌'),
  2566 + baseInfoItem('桌位信息:', sessionsInfo.tableInfo),
2547 Padding( 2567 Padding(
2548 padding: EdgeInsets.symmetric(vertical: h(6)), 2568 padding: EdgeInsets.symmetric(vertical: h(6)),
2549 child: Row( 2569 child: Row(
@@ -2558,11 +2578,13 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2558,11 +2578,13 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2558 ), 2578 ),
2559 Expanded( 2579 Expanded(
2560 child: ListView.builder( 2580 child: ListView.builder(
2561 - itemCount: 3, 2581 + itemCount: sessionsInfo.setmeal.length,
2562 shrinkWrap: true, 2582 shrinkWrap: true,
2563 controller: _scrollController, 2583 controller: _scrollController,
2564 itemBuilder: 2584 itemBuilder:
2565 (BuildContext context, int index) { 2585 (BuildContext context, int index) {
  2586 + SetmealDetail setmealDetail =
  2587 + sessionsInfo.setmeal[index];
2566 return Container( 2588 return Container(
2567 padding: EdgeInsets.only(bottom: w(8)), 2589 padding: EdgeInsets.only(bottom: w(8)),
2568 margin: EdgeInsets.only(bottom: w(12)), 2590 margin: EdgeInsets.only(bottom: w(12)),
@@ -2576,7 +2598,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2576,7 +2598,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2576 children: [ 2598 children: [
2577 Row( 2599 Row(
2578 children: [ 2600 children: [
2579 - Text('1299套餐', 2601 + Text(setmealDetail.mealName,
2580 style: TextStyle( 2602 style: TextStyle(
2581 color: MyColours 2603 color: MyColours
2582 .color_515151, 2604 .color_515151,
@@ -2604,19 +2626,22 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2604,19 +2626,22 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2604 VEmptyView(16), 2626 VEmptyView(16),
2605 Row( 2627 Row(
2606 children: [ 2628 children: [
2607 - Text('10 人/桌', 2629 + Text(
  2630 + '${setmealDetail.pnum} 人/桌',
2608 style: TextStyle( 2631 style: TextStyle(
2609 color: MyColours 2632 color: MyColours
2610 .color_999999, 2633 .color_999999,
2611 fontSize: font(12))), 2634 fontSize: font(12))),
2612 HEmptyView(24), 2635 HEmptyView(24),
2613 - Text('保证 30 桌', 2636 + Text(
  2637 + '保证 ${setmealDetail.min} 桌',
2614 style: TextStyle( 2638 style: TextStyle(
2615 color: MyColours 2639 color: MyColours
2616 .color_999999, 2640 .color_999999,
2617 fontSize: font(12))), 2641 fontSize: font(12))),
2618 HEmptyView(24), 2642 HEmptyView(24),
2619 - Text('备用 2 桌', 2643 + Text(
  2644 + '备用 ${setmealDetail.spare} 桌',
2620 style: TextStyle( 2645 style: TextStyle(
2621 color: MyColours 2646 color: MyColours
2622 .color_999999, 2647 .color_999999,
@@ -2628,9 +2653,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2628,9 +2653,9 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2628 })) 2653 }))
2629 ], 2654 ],
2630 )), 2655 )),
2631 - sessionsItem('酒水安排:'),  
2632 - sessionsItem('其他配置:'),  
2633 - remarkItem('备注:') 2656 + sessionsItem('酒水安排:', sessionsInfo),
  2657 + sessionsItem('其他配置:', sessionsInfo),
  2658 + remarkItem('备注:', sessionsInfo)
2634 ], 2659 ],
2635 )) 2660 ))
2636 ], 2661 ],
@@ -2639,7 +2664,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2639,7 +2664,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2639 } 2664 }
2640 2665
2641 ///备注----照片 2666 ///备注----照片
2642 - Widget remarkItem(String title) { 2667 + Widget remarkItem(String title, SessionsInfo sessionsInfo) {
2643 return Padding( 2668 return Padding(
2644 padding: EdgeInsets.symmetric(vertical: h(6)), 2669 padding: EdgeInsets.symmetric(vertical: h(6)),
2645 child: Row( 2670 child: Row(
@@ -2655,18 +2680,134 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2655,18 +2680,134 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2655 child: Column( 2680 child: Column(
2656 crossAxisAlignment: CrossAxisAlignment.start, 2681 crossAxisAlignment: CrossAxisAlignment.start,
2657 children: [ 2682 children: [
2658 - Text(  
2659 - '剑南春52度剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml剑南春52度500ml500ml',  
2660 - style: TextStyle(  
2661 - color: MyColours.color_515151, fontSize: font(12))),  
2662 - VEmptyView(16),  
2663 - _getGridImg(['fff', '', 'fff', '', 'fff', '', 'fff', '']) 2683 + sessionsInfo.remark == null || sessionsInfo.remark == ''
  2684 + ? SizedBox()
  2685 + : Text(sessionsInfo.remark,
  2686 + style: TextStyle(
  2687 + color: MyColours.color_515151, fontSize: font(12))),
  2688 + sessionsInfo.remark == null || sessionsInfo.remark == ''
  2689 + ? SizedBox()
  2690 + : VEmptyView(16),
  2691 + _getGridImg(sessionsInfo.images.map((e) {
  2692 + return e.url;
  2693 + }).toList())
2664 ], 2694 ],
2665 )), 2695 )),
2666 ], 2696 ],
2667 )); 2697 ));
2668 } 2698 }
2669 2699
  2700 + ///计算合计费用
  2701 + _calculatePrice(costInfoModel) {
  2702 + double sum = double.parse(costInfoModel.sumPrice); //原来总金额
  2703 + double total = 0.0;
  2704 + if (Utils.isNumeric(costInfoModel.serviceC.text)) {
  2705 + //输入的是数字,计算金额
  2706 +
  2707 + if (costInfoModel.service) {
  2708 + //选中固定金额
  2709 + // if(double.parse(value) > sum){
  2710 +
  2711 + // }
  2712 + total = sum + double.parse(costInfoModel.serviceC.text);
  2713 + } else {
  2714 + //选中百分比
  2715 + if (int.parse(costInfoModel.serviceC.text) > 100) {
  2716 + Utils.showToast('请输入小于100的数字');
  2717 +
  2718 + return;
  2719 + }
  2720 +
  2721 + // 使除数为0
  2722 + double input = double.parse(costInfoModel.serviceC.text);
  2723 + total = sum + sum * input / 100;
  2724 + }
  2725 + } else {
  2726 + // if (!Utils.isNumeric(costInfoModel.discountC.text)) {
  2727 + // costInfoModel.totalPrice = costInfoModel.sumPrice;
  2728 + // }
  2729 + }
  2730 + if (Utils.isNumeric(costInfoModel.discountC.text)) {
  2731 + //输入的是数字,计算金额
  2732 +
  2733 + if (costInfoModel.discount) {
  2734 + //选中固定金额
  2735 + // if(double.parse(value) > sum){
  2736 +
  2737 + // }
  2738 + total -= double.parse(costInfoModel.discountC.text);
  2739 + } else {
  2740 + //选中百分比
  2741 + if (int.parse(costInfoModel.discountC.text) > 100) {
  2742 + Utils.showToast('请输入小于100的数字');
  2743 +
  2744 + return;
  2745 + }
  2746 +
  2747 + // 使除数为0
  2748 + double input = double.parse(costInfoModel.discountC.text);
  2749 + total = total - sum * input / 100;
  2750 + }
  2751 + // String num2StrD = total.toStringAsFixed(2); //保留两位小数
  2752 + // costInfoModel.totalPrice = num2StrD;
  2753 + } else {
  2754 + // if (!Utils.isNumeric(costInfoModel.serviceC.text)) {
  2755 + // costInfoModel.totalPrice = costInfoModel.sumPrice;
  2756 + // }
  2757 + }
  2758 + if (total == 0.0) {
  2759 + costInfoModel.totalPrice = costInfoModel.sumPrice;
  2760 + } else {
  2761 + String num2StrD = total.toStringAsFixed(2); //保留两位小数
  2762 + costInfoModel.totalPrice = num2StrD;
  2763 + }
  2764 + double finalContract = 0.0; //最终议价
  2765 + feastModel.banquetDetail.costInfo.forEach((element) {
  2766 + finalContract += double.parse(element.totalPrice);
  2767 + });
  2768 + feastModel.banquetDetail.contractInfo.contractFinalPrice =
  2769 + finalContract.toString();
  2770 + feastModel.banquetDetail.contractInfo.contractFinalPriceC.text =
  2771 + finalContract.toString();
  2772 +
  2773 + setState(() {});
  2774 + }
  2775 +
  2776 + // ///计算优惠金额
  2777 + // _calculatDiscount(costInfoModel) {
  2778 + // if (Utils.isNumeric(costInfoModel.discountC.text)) {
  2779 + // //输入的是数字,计算金额
  2780 + // double sum = double.parse(costInfoModel.totalPrice); //原来总金额
  2781 + // double total = 0.0;
  2782 +
  2783 + // if (costInfoModel.service) {
  2784 + // //选中固定金额
  2785 + // // if(double.parse(value) > sum){
  2786 +
  2787 + // // }
  2788 + // total = sum - double.parse(costInfoModel.discountC.text);
  2789 + // } else {
  2790 + // //选中百分比
  2791 + // if (int.parse(costInfoModel.discountC.text) > 100) {
  2792 + // Utils.showToast('请输入小于100的数字');
  2793 +
  2794 + // return;
  2795 + // }
  2796 +
  2797 + // // 使除数为0
  2798 + // double input = double.parse(costInfoModel.discountC.text);
  2799 + // total = sum - sum * input / 100;
  2800 + // }
  2801 + // String num2StrD = total.toStringAsFixed(2); //保留两位小数
  2802 + // costInfoModel.totalPrice = num2StrD;
  2803 + // } else {
  2804 + // if (!Utils.isNumeric(costInfoModel.serviceC.text)) {
  2805 + // costInfoModel.totalPrice = costInfoModel.sumPrice;
  2806 + // }
  2807 + // }
  2808 + // setState(() {});
  2809 + // }
  2810 +
2670 ///费用详情 2811 ///费用详情
2671 Widget costWidget() { 2812 Widget costWidget() {
2672 return Container( 2813 return Container(
@@ -2692,10 +2833,12 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2692,10 +2833,12 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2692 ), 2833 ),
2693 VEmptyView(34), 2834 VEmptyView(34),
2694 ListView.builder( 2835 ListView.builder(
2695 - itemCount: 2, 2836 + itemCount: feastModel.banquetDetail.costInfo.length,
2696 shrinkWrap: true, 2837 shrinkWrap: true,
2697 controller: _scrollController, 2838 controller: _scrollController,
2698 itemBuilder: (BuildContext context, int index) { 2839 itemBuilder: (BuildContext context, int index) {
  2840 + CostInfoModel costInfoModel =
  2841 + feastModel.banquetDetail.costInfo[index];
2699 return Padding( 2842 return Padding(
2700 padding: EdgeInsets.only( 2843 padding: EdgeInsets.only(
2701 left: w(12), right: w(12), bottom: w(27)), 2844 left: w(12), right: w(12), bottom: w(27)),
@@ -2703,7 +2846,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2703,7 +2846,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2703 crossAxisAlignment: CrossAxisAlignment.start, 2846 crossAxisAlignment: CrossAxisAlignment.start,
2704 children: [ 2847 children: [
2705 Text( 2848 Text(
2706 - '第一场费用:', 2849 + '${costInfoModel.title}:',
2707 style: TextStyle( 2850 style: TextStyle(
2708 color: MyColours.color_999999, 2851 color: MyColours.color_999999,
2709 fontSize: font(12)), 2852 fontSize: font(12)),
@@ -2711,15 +2854,27 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2711,15 +2854,27 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2711 VEmptyView(8), 2854 VEmptyView(8),
2712 costItem('名称', '单价', '数量', '金额', isTitle: true), 2855 costItem('名称', '单价', '数量', '金额', isTitle: true),
2713 ListView.builder( 2856 ListView.builder(
2714 - itemCount: 4, 2857 + itemCount: costInfoModel.data.length,
2715 shrinkWrap: true, 2858 shrinkWrap: true,
2716 controller: _scrollController, 2859 controller: _scrollController,
2717 itemBuilder: (BuildContext context, int index) { 2860 itemBuilder: (BuildContext context, int index) {
  2861 + CostInfoSunModel costInfoSunModel =
  2862 + costInfoModel.data[index];
  2863 + String name = '';
  2864 + if (costInfoSunModel.cname != null) {
  2865 + name = costInfoSunModel.cname;
  2866 + }
  2867 + if (costInfoSunModel.otherName != null) {
  2868 + name = costInfoSunModel.otherName;
  2869 + }
  2870 + if (costInfoSunModel.wineName != null) {
  2871 + name = costInfoSunModel.wineName;
  2872 + }
2718 return costItem( 2873 return costItem(
2719 - '1299套餐',  
2720 - '1299',  
2721 - '30',  
2722 - '38970', 2874 + name,
  2875 + costInfoSunModel.unitPrice,
  2876 + costInfoSunModel.numStr,
  2877 + costInfoSunModel.price.toString(),
2723 ); 2878 );
2724 }), 2879 }),
2725 //服务费 2880 //服务费
@@ -2742,31 +2897,75 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2742,31 +2897,75 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2742 fontSize: font(12)), 2897 fontSize: font(12)),
2743 ), 2898 ),
2744 ), 2899 ),
2745 - Image.asset(  
2746 - Utils.getImgPath('f_radio_sel'),  
2747 - width: w(20),  
2748 - ),  
2749 - HEmptyView(8),  
2750 - Text(  
2751 - '固定金额',  
2752 - style: TextStyle(  
2753 - color: MyColours.color_515151,  
2754 - fontSize: font(12)), 2900 + InkWell(
  2901 + onTap: () {
  2902 + if (costInfoModel.service) {
  2903 + return;
  2904 + }
  2905 + setState(() {
  2906 + costInfoModel.service =
  2907 + !costInfoModel.service;
  2908 + });
  2909 + if (costInfoModel.serviceC.text != '') {
  2910 + _calculatePrice(
  2911 + costInfoModel,
  2912 + );
  2913 + }
  2914 + },
  2915 + child: Row(
  2916 + children: [
  2917 + Image.asset(
  2918 + Utils.getImgPath(costInfoModel.service
  2919 + ? 'f_radio_sel'
  2920 + : 'f_radio_un'),
  2921 + width: w(20),
  2922 + ),
  2923 + HEmptyView(8),
  2924 + Text(
  2925 + '固定金额',
  2926 + style: TextStyle(
  2927 + color: MyColours.color_515151,
  2928 + fontSize: font(12)),
  2929 + ),
  2930 + ],
  2931 + ),
2755 ), 2932 ),
2756 HEmptyView(16), 2933 HEmptyView(16),
2757 - Image.asset(  
2758 - Utils.getImgPath('f_radio_un'),  
2759 - width: w(20), 2934 + InkWell(
  2935 + onTap: () {
  2936 + if (!costInfoModel.service) {
  2937 + return;
  2938 + }
  2939 + setState(() {
  2940 + costInfoModel.service =
  2941 + !costInfoModel.service;
  2942 + });
  2943 + if (costInfoModel.serviceC.text != '') {
  2944 + _calculatePrice(
  2945 + costInfoModel,
  2946 + );
  2947 + }
  2948 + },
  2949 + child: Row(
  2950 + children: [
  2951 + Image.asset(
  2952 + Utils.getImgPath(!costInfoModel.service
  2953 + ? 'f_radio_sel'
  2954 + : 'f_radio_un'),
  2955 + width: w(20),
  2956 + ),
  2957 + HEmptyView(8),
  2958 + Container(
  2959 + width: w(40),
  2960 + child: Text(
  2961 + '百分比',
  2962 + style: TextStyle(
  2963 + color: MyColours.color_515151,
  2964 + fontSize: font(12)),
  2965 + )),
  2966 + ],
  2967 + ),
2760 ), 2968 ),
2761 - HEmptyView(8),  
2762 - Container(  
2763 - width: w(40),  
2764 - child: Text(  
2765 - '百分比',  
2766 - style: TextStyle(  
2767 - color: MyColours.color_515151,  
2768 - fontSize: font(12)),  
2769 - )),  
2770 HEmptyView(12), 2969 HEmptyView(12),
2771 Expanded( 2970 Expanded(
2772 child: Container( 2971 child: Container(
@@ -2784,7 +2983,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2784,7 +2983,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2784 style: TextStyle( 2983 style: TextStyle(
2785 fontSize: ScreenUtil().setSp(24), 2984 fontSize: ScreenUtil().setSp(24),
2786 color: MyColours.color_515151), 2985 color: MyColours.color_515151),
2787 - // controller: controller, 2986 + controller: costInfoModel.serviceC,
2788 // focusNode: node, 2987 // focusNode: node,
2789 // textAlignVertical: TextAlignVertical.top, 2988 // textAlignVertical: TextAlignVertical.top,
2790 decoration: InputDecoration( 2989 decoration: InputDecoration(
@@ -2805,6 +3004,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2805,6 +3004,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2805 onChanged: (value) { 3004 onChanged: (value) {
2806 print('ggg'); 3005 print('ggg');
2807 3006
  3007 + _calculatePrice(
  3008 + costInfoModel,
  3009 + );
  3010 +
2808 // nameStr = value; 3011 // nameStr = value;
2809 }, 3012 },
2810 onEditingComplete: () { 3013 onEditingComplete: () {
@@ -2819,7 +3022,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2819,7 +3022,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2819 ), 3022 ),
2820 HEmptyView(4), 3023 HEmptyView(4),
2821 Text( 3024 Text(
2822 - '%', 3025 + costInfoModel.service ? '元' : '%',
2823 style: TextStyle( 3026 style: TextStyle(
2824 color: MyColours.color_000000, 3027 color: MyColours.color_000000,
2825 fontSize: font(12)), 3028 fontSize: font(12)),
@@ -2846,31 +3049,69 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2846,31 +3049,69 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2846 fontSize: font(12)), 3049 fontSize: font(12)),
2847 ), 3050 ),
2848 ), 3051 ),
2849 - Image.asset(  
2850 - Utils.getImgPath('f_radio_sel'),  
2851 - width: w(20),  
2852 - ),  
2853 - HEmptyView(8),  
2854 - Text(  
2855 - '固定金额',  
2856 - style: TextStyle(  
2857 - color: MyColours.color_515151,  
2858 - fontSize: font(12)),  
2859 - ), 3052 + InkWell(
  3053 + onTap: () {
  3054 + if (costInfoModel.discount) {
  3055 + return;
  3056 + }
  3057 + setState(() {
  3058 + costInfoModel.discount =
  3059 + !costInfoModel.discount;
  3060 + });
  3061 + if (costInfoModel.discountC.text != '') {
  3062 + _calculatePrice(
  3063 + costInfoModel,
  3064 + );
  3065 + }
  3066 + },
  3067 + child: Row(children: [
  3068 + Image.asset(
  3069 + Utils.getImgPath(costInfoModel.discount
  3070 + ? 'f_radio_sel'
  3071 + : 'f_radio_un'),
  3072 + width: w(20),
  3073 + ),
  3074 + HEmptyView(8),
  3075 + Text(
  3076 + '固定金额',
  3077 + style: TextStyle(
  3078 + color: MyColours.color_515151,
  3079 + fontSize: font(12)),
  3080 + ),
  3081 + ])),
2860 HEmptyView(16), 3082 HEmptyView(16),
2861 - Image.asset(  
2862 - Utils.getImgPath('f_radio_un'),  
2863 - width: w(20),  
2864 - ),  
2865 - HEmptyView(8),  
2866 - Container(  
2867 - width: w(40),  
2868 - child: Text(  
2869 - '折扣',  
2870 - style: TextStyle(  
2871 - color: MyColours.color_515151,  
2872 - fontSize: font(12)),  
2873 - )), 3083 + InkWell(
  3084 + onTap: () {
  3085 + if (!costInfoModel.discount) {
  3086 + return;
  3087 + }
  3088 + setState(() {
  3089 + costInfoModel.discount =
  3090 + !costInfoModel.discount;
  3091 + });
  3092 + if (costInfoModel.discountC.text != '') {
  3093 + _calculatePrice(
  3094 + costInfoModel,
  3095 + );
  3096 + }
  3097 + },
  3098 + child: Row(children: [
  3099 + Image.asset(
  3100 + Utils.getImgPath(!costInfoModel.discount
  3101 + ? 'f_radio_sel'
  3102 + : 'f_radio_un'),
  3103 + width: w(20),
  3104 + ),
  3105 + HEmptyView(8),
  3106 + Container(
  3107 + width: w(40),
  3108 + child: Text(
  3109 + '折扣',
  3110 + style: TextStyle(
  3111 + color: MyColours.color_515151,
  3112 + fontSize: font(12)),
  3113 + ))
  3114 + ])),
2874 HEmptyView(12), 3115 HEmptyView(12),
2875 Expanded( 3116 Expanded(
2876 child: Container( 3117 child: Container(
@@ -2888,7 +3129,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2888,7 +3129,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2888 style: TextStyle( 3129 style: TextStyle(
2889 fontSize: ScreenUtil().setSp(24), 3130 fontSize: ScreenUtil().setSp(24),
2890 color: MyColours.color_515151), 3131 color: MyColours.color_515151),
2891 - // controller: controller, 3132 + controller: costInfoModel.discountC,
2892 // focusNode: node, 3133 // focusNode: node,
2893 // textAlignVertical: TextAlignVertical.top, 3134 // textAlignVertical: TextAlignVertical.top,
2894 decoration: InputDecoration( 3135 decoration: InputDecoration(
@@ -2909,6 +3150,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2909,6 +3150,10 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2909 onChanged: (value) { 3150 onChanged: (value) {
2910 print('ggg'); 3151 print('ggg');
2911 3152
  3153 + _calculatePrice(
  3154 + costInfoModel,
  3155 + );
  3156 +
2912 // nameStr = value; 3157 // nameStr = value;
2913 }, 3158 },
2914 onEditingComplete: () { 3159 onEditingComplete: () {
@@ -2923,7 +3168,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2923,7 +3168,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2923 ), 3168 ),
2924 HEmptyView(4), 3169 HEmptyView(4),
2925 Text( 3170 Text(
2926 - '元', 3171 + costInfoModel.discount ? '元' : '%',
2927 style: TextStyle( 3172 style: TextStyle(
2928 color: MyColours.color_000000, 3173 color: MyColours.color_000000,
2929 fontSize: font(12)), 3174 fontSize: font(12)),
@@ -2948,7 +3193,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -2948,7 +3193,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
2948 ), 3193 ),
2949 Spacer(), 3194 Spacer(),
2950 Text( 3195 Text(
2951 - '7000000 元', 3196 + '${costInfoModel.totalPrice} 元',
2952 style: TextStyle( 3197 style: TextStyle(
2953 color: MyColours.color_515151, 3198 color: MyColours.color_515151,
2954 fontWeight: FontWeight.bold, 3199 fontWeight: FontWeight.bold,
@@ -3053,7 +3298,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -3053,7 +3298,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
3053 ), 3298 ),
3054 HEmptyView(12), 3299 HEmptyView(12),
3055 Text( 3300 Text(
3056 - '159000 元', 3301 + '${feastModel.banquetDetail.contractInfo.contractTotalPrice} 元',
3057 style: TextStyle( 3302 style: TextStyle(
3058 fontWeight: FontWeight.bold, 3303 fontWeight: FontWeight.bold,
3059 color: MyColours.color_515151, 3304 color: MyColours.color_515151,
@@ -3101,7 +3346,12 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -3101,7 +3346,12 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
3101 ], 3346 ],
3102 )), 3347 )),
3103 HEmptyView(12), 3348 HEmptyView(12),
3104 - _textfield('1299', null, null, width: w(110)), 3349 + _textfield(
  3350 + '请输入',
  3351 + feastModel
  3352 + .banquetDetail.contractInfo.contractFinalPriceC,
  3353 + null,
  3354 + width: w(110)),
3105 HEmptyView(24), 3355 HEmptyView(24),
3106 Text( 3356 Text(
3107 '元', 3357 '元',
@@ -3227,6 +3477,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -3227,6 +3477,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
3227 // widget.isSelect ? Colors.white : MyColours.color_199095, 3477 // widget.isSelect ? Colors.white : MyColours.color_199095,
3228 //输入文本的样式 3478 //输入文本的样式
3229 style: TextStyle( 3479 style: TextStyle(
  3480 + color: MyColours.color_438E93,
3230 fontSize: ScreenUtil().setSp(28), 3481 fontSize: ScreenUtil().setSp(28),
3231 fontWeight: FontWeight.bold, 3482 fontWeight: FontWeight.bold,
3232 ), 3483 ),
@@ -3361,7 +3612,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -3361,7 +3612,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
3361 } 3612 }
3362 3613
3363 ///三组 左---中----右 3614 ///三组 左---中----右
3364 - Widget sessionsItem(String title) { 3615 + Widget sessionsItem(String title, SessionsInfo sessionsInfo) {
3365 return Padding( 3616 return Padding(
3366 padding: EdgeInsets.symmetric(vertical: h(6)), 3617 padding: EdgeInsets.symmetric(vertical: h(6)),
3367 child: Row( 3618 child: Row(
@@ -3375,10 +3626,21 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -3375,10 +3626,21 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
3375 ), 3626 ),
3376 Expanded( 3627 Expanded(
3377 child: ListView.builder( 3628 child: ListView.builder(
3378 - itemCount: 3, 3629 + itemCount: title == '酒水安排:'
  3630 + ? sessionsInfo.wine.length
  3631 + : sessionsInfo.other.length,
3379 shrinkWrap: true, 3632 shrinkWrap: true,
3380 controller: _scrollController, 3633 controller: _scrollController,
3381 itemBuilder: (BuildContext context, int index) { 3634 itemBuilder: (BuildContext context, int index) {
  3635 + String name = title == '酒水安排:'
  3636 + ? sessionsInfo.wine[index].wineName
  3637 + : sessionsInfo.other[index].otherName;
  3638 + String numStr = title == '酒水安排:'
  3639 + ? sessionsInfo.wine[index].wineNum
  3640 + : sessionsInfo.other[index].otherNum;
  3641 + String spec = title == '酒水安排:'
  3642 + ? sessionsInfo.wine[index].spec
  3643 + : sessionsInfo.other[index].spec;
3382 return Container( 3644 return Container(
3383 padding: EdgeInsets.only(bottom: w(8)), 3645 padding: EdgeInsets.only(bottom: w(8)),
3384 margin: EdgeInsets.only(bottom: w(12)), 3646 margin: EdgeInsets.only(bottom: w(12)),
@@ -3390,11 +3652,11 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -3390,11 +3652,11 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
3390 child: Row( 3652 child: Row(
3391 children: [ 3653 children: [
3392 Expanded( 3654 Expanded(
3393 - child: Text('剑南春52度500ml', 3655 + child: Text(name,
3394 style: TextStyle( 3656 style: TextStyle(
3395 color: MyColours.color_515151, 3657 color: MyColours.color_515151,
3396 fontSize: font(12)))), 3658 fontSize: font(12)))),
3397 - Text('60 份', 3659 + Text('${numStr} ${spec}',
3398 style: TextStyle( 3660 style: TextStyle(
3399 color: MyColours.color_515151, 3661 color: MyColours.color_515151,
3400 fontSize: font(12))) 3662 fontSize: font(12)))
@@ -3435,50 +3697,50 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -3435,50 +3697,50 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
3435 ClipRRect( 3697 ClipRRect(
3436 borderRadius: BorderRadius.circular(r(5)), 3698 borderRadius: BorderRadius.circular(r(5)),
3437 child: CachedNetworkImage( 3699 child: CachedNetworkImage(
3438 - // imageUrl: data[index].qiniuUrl,  
3439 - imageUrl:  
3440 - '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', 3700 + imageUrl: data[index],
  3701 + // imageUrl:
  3702 + // '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',
3441 fit: BoxFit.cover, 3703 fit: BoxFit.cover,
3442 width: ScreenUtil().setWidth(38 * 2), 3704 width: ScreenUtil().setWidth(38 * 2),
3443 height: ScreenUtil().setWidth(38 * 2), 3705 height: ScreenUtil().setWidth(38 * 2),
3444 ), 3706 ),
3445 ), 3707 ),
3446 - Positioned(  
3447 - top: 0,  
3448 - right: 0,  
3449 - child: GestureDetector(  
3450 - child: Image.asset(  
3451 - Utils.getImgPath("f_delete"),  
3452 - width: ScreenUtil().setWidth(24),  
3453 - height: ScreenUtil().setWidth(24),  
3454 - ),  
3455 - onTap: () {  
3456 - //已经传到服务器,弹提醒窗口,是否删除  
3457 - //修改之前有内容,则弹框  
3458 - DialogUtil.cupertinoAlertDialog(context,  
3459 - title: "确认删除",  
3460 - content: "是否确定删除该照片,删除操作不可逆转,请谨慎操作",  
3461 - lCallback: () {  
3462 - print("取消");  
3463 - }, rCallback: () {  
3464 - print("确定");  
3465 - // widget.deleteCallback(index);  
3466 - });  
3467 - }  
3468 - // else {  
3469 - // //点击删除按钮  
3470 - // setState(() {  
3471 - // temp.removeWhere((element) =>  
3472 - // element == temp[index]);  
3473 - // widget.model.imageQiniuUrlList  
3474 - // .removeWhere((element) =>  
3475 - // element ==  
3476 - // widget.model  
3477 - // .imageQiniuUrlList[index]);  
3478 - // });  
3479 - // }  
3480 - // },  
3481 - )), 3708 + // Positioned(
  3709 + // top: 0,
  3710 + // right: 0,
  3711 + // child: GestureDetector(
  3712 + // child: Image.asset(
  3713 + // Utils.getImgPath("f_delete"),
  3714 + // width: ScreenUtil().setWidth(24),
  3715 + // height: ScreenUtil().setWidth(24),
  3716 + // ),
  3717 + // onTap: () {
  3718 + // //已经传到服务器,弹提醒窗口,是否删除
  3719 + // //修改之前有内容,则弹框
  3720 + // DialogUtil.cupertinoAlertDialog(context,
  3721 + // title: "确认删除",
  3722 + // content: "是否确定删除该照片,删除操作不可逆转,请谨慎操作",
  3723 + // lCallback: () {
  3724 + // print("取消");
  3725 + // }, rCallback: () {
  3726 + // print("确定");
  3727 + // // widget.deleteCallback(index);
  3728 + // });
  3729 + // }
  3730 + // // else {
  3731 + // // //点击删除按钮
  3732 + // // setState(() {
  3733 + // // temp.removeWhere((element) =>
  3734 + // // element == temp[index]);
  3735 + // // widget.model.imageQiniuUrlList
  3736 + // // .removeWhere((element) =>
  3737 + // // element ==
  3738 + // // widget.model
  3739 + // // .imageQiniuUrlList[index]);
  3740 + // // });
  3741 + // // }
  3742 + // // },
  3743 + // )),
3482 ], 3744 ],
3483 ), 3745 ),
3484 ); 3746 );
@@ -3506,30 +3768,36 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -3506,30 +3768,36 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
3506 return Column( 3768 return Column(
3507 children: [ 3769 children: [
3508 Expanded( 3770 Expanded(
3509 - child:  
3510 - Padding(  
3511 - padding: EdgeInsets.symmetric(horizontal: w(12)),  
3512 - child: SingleChildScrollView(  
3513 - controller: _scrollController,  
3514 - child: Column(children: [  
3515 - baseInfoWidget(), //基本信息  
3516 - VEmptyView(52),  
3517 - //场次  
3518 - ListView.builder(  
3519 - itemCount: 3,  
3520 - shrinkWrap: true,  
3521 - controller: _scrollController,  
3522 - itemBuilder: (BuildContext context, int index) {  
3523 - return sessionsWidget('第${index + 1}场');  
3524 - }),  
3525 - //费用详情  
3526 - costWidget(),  
3527 - //合同  
3528 - contractWidget(),  
3529 -  
3530 - invoiceWidget()  
3531 - ]))),  
3532 - ), 3771 + child: Padding(
  3772 + padding: EdgeInsets.symmetric(horizontal: w(12)),
  3773 + child: SingleChildScrollView(
  3774 + controller: _scrollController,
  3775 + child: Column(children: [
  3776 + baseInfoWidget(), //基本信息
  3777 + VEmptyView(52),
  3778 + //场次
  3779 + ListView.builder(
  3780 + itemCount:
  3781 + feastModel.banquetDetail.sessionsInfo.length,
  3782 + shrinkWrap: true,
  3783 + controller: _scrollController,
  3784 + itemBuilder: (BuildContext context, int index) {
  3785 + SessionsInfo sessionsInfo = feastModel
  3786 + .banquetDetail.sessionsInfo[index];
  3787 + String numStr =
  3788 + ConvertNumberToChineseMoneyWords.toChinese(
  3789 + index);
  3790 + return sessionsWidget(
  3791 + '第${numStr}场', sessionsInfo);
  3792 + }),
  3793 + //费用详情
  3794 + costWidget(),
  3795 + //合同
  3796 + contractWidget(),
  3797 +
  3798 + invoiceWidget()
  3799 + ]))),
  3800 + ),
3533 Row( 3801 Row(
3534 children: [ 3802 children: [
3535 Expanded( 3803 Expanded(
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:one_key/constant/state.dart'; 2 import 'package:one_key/constant/state.dart';
3 -import 'package:one_key/models/get_banquet_by_id_model.dart';  
4 import 'package:one_key/models/get_setmeal_class_model.dart'; 3 import 'package:one_key/models/get_setmeal_class_model.dart';
  4 +import 'package:one_key/models/order_info_model.dart';
5 import 'package:one_key/provider/user_model.dart'; 5 import 'package:one_key/provider/user_model.dart';
6 import 'package:provider/provider.dart'; 6 import 'package:provider/provider.dart';
7 7
@@ -9,6 +9,7 @@ import '../constant/constant.dart'; @@ -9,6 +9,7 @@ import '../constant/constant.dart';
9 import '../constant/error.dart'; 9 import '../constant/error.dart';
10 import '../models/classify_model.dart'; 10 import '../models/classify_model.dart';
11 import '../models/filter_btn_model.dart'; 11 import '../models/filter_btn_model.dart';
  12 +import '../models/get_banquet_by_id_new_model.dart';
12 import '../models/get_banquet_deposit_model.dart'; 13 import '../models/get_banquet_deposit_model.dart';
13 import '../models/get_deposit_model.dart'; 14 import '../models/get_deposit_model.dart';
14 import '../models/get_seller_user_by_sellerid_model.dart'; 15 import '../models/get_seller_user_by_sellerid_model.dart';
@@ -25,6 +26,7 @@ import '../net/base_resp.dart'; @@ -25,6 +26,7 @@ import '../net/base_resp.dart';
25 import '../net/dio_util.dart'; 26 import '../net/dio_util.dart';
26 import '../net/http_url.dart'; 27 import '../net/http_url.dart';
27 import '../utils/utils.dart'; 28 import '../utils/utils.dart';
  29 +import 'dart:convert' as convert;
28 30
29 class FeastModel extends ChangeNotifier { 31 class FeastModel extends ChangeNotifier {
30 PageState pageState = PageState.Success; 32 PageState pageState = PageState.Success;
@@ -72,6 +74,7 @@ class FeastModel extends ChangeNotifier { @@ -72,6 +74,7 @@ class FeastModel extends ChangeNotifier {
72 List<GetBanquetDepositSunModel> banquetDepositData = []; //宴会定金列表数据 74 List<GetBanquetDepositSunModel> banquetDepositData = []; //宴会定金列表数据
73 75
74 PageState pageStateBanquet = PageState.Loading; //宴会详情 76 PageState pageStateBanquet = PageState.Loading; //宴会详情
  77 + GetBanquetByIdNewSunModel banquetDetail; //宴会详情信息
75 78
76 /*** 79 /***
77 * 80 *
@@ -317,33 +320,8 @@ class FeastModel extends ChangeNotifier { @@ -317,33 +320,8 @@ class FeastModel extends ChangeNotifier {
317 return false; 320 return false;
318 }); 321 });
319 if (baseResp.code == Constant.status_success) { 322 if (baseResp.code == Constant.status_success) {
320 - GetBanquetByIdSunModel model =  
321 - GetBanquetByIdModel.fromJson(baseResp.responseData).data;  
322 - BasicInfo basicInfo = baseResp.data['basic_info'] != null  
323 - ? new BasicInfo.fromJson(baseResp.data['basic_info'])  
324 - : null;  
325 - List<SessionsInfo> sessionsInfo = [];  
326 - List<String> keys = [];  
327 - if (baseResp.data['sessions_info'] != null) {  
328 - baseResp.data['sessions_info'].forEach((v) {  
329 - SessionsInfo temp = new SessionsInfo.fromJson(v);  
330 - sessionsInfo.add(temp);  
331 - keys.add(temp.reserveOrder);  
332 - });  
333 - }  
334 - List<CostInfoModel> costInfo = [];  
335 - if (baseResp.data['cost_info'] != null) {  
336 - Map map = baseResp.data['cost_info'];  
337 - for (String item in keys) {  
338 - map.forEach((key, value) {  
339 - CostInfoModel model = CostInfoModel();  
340 - model.title = '${key}费用';  
341 - model.costInfoSunModel = CostInfoSunModel.fromJson(value);  
342 - costInfo.add(model);  
343 - });  
344 - }  
345 - }  
346 - 323 + banquetDetail =
  324 + GetBanquetByIdNewModel.fromJson(baseResp.responseData).data;
347 325
348 // if (baseResp.data == 1) { 326 // if (baseResp.data == 1) {
349 // rid = baseResp.data['id']; 327 // rid = baseResp.data['id'];
@@ -32,6 +32,14 @@ import '../app.dart'; @@ -32,6 +32,14 @@ import '../app.dart';
32 typedef BookTimeSetCallback = void Function(bool needChange); 32 typedef BookTimeSetCallback = void Function(bool needChange);
33 33
34 class Utils { 34 class Utils {
  35 + //判定是否为数字
  36 + static bool isNumeric(String s) {
  37 + if (s == null) {
  38 + return false;
  39 + }
  40 + return double.tryParse(s) != null;
  41 + }
  42 +
35 //请求参数按key按ASCII排序key1=value1&key2=value2&...&keyN=valueN 43 //请求参数按key按ASCII排序key1=value1&key2=value2&...&keyN=valueN
36 static String keySort(Map<String, String> oldParamsMap) { 44 static String keySort(Map<String, String> oldParamsMap) {
37 List attrKeys = oldParamsMap.keys.toList(); 45 List attrKeys = oldParamsMap.keys.toList();