Showing
6 changed files
with
26 additions
and
19 deletions
| @@ -156,7 +156,7 @@ class MarkReserveModel { | @@ -156,7 +156,7 @@ class MarkReserveModel { | ||
| 156 | room = json['room']; | 156 | room = json['room']; |
| 157 | pnum = json['pnum']; | 157 | pnum = json['pnum']; |
| 158 | 158 | ||
| 159 | - address = json['address']; | 159 | + address = json['address'] == 'null' ? '' : json['address']; |
| 160 | sellerPhone = json['seller_phone']; | 160 | sellerPhone = json['seller_phone']; |
| 161 | 161 | ||
| 162 | managerImage = json['manager_image']; | 162 | managerImage = json['manager_image']; |
| @@ -187,20 +187,27 @@ class Setmeal { | @@ -187,20 +187,27 @@ class Setmeal { | ||
| 187 | // cooklist.add(new Cooklist.fromJson(v)); | 187 | // cooklist.add(new Cooklist.fromJson(v)); |
| 188 | // }); | 188 | // }); |
| 189 | // } | 189 | // } |
| 190 | - if (json['cooklist'] != null && json['cooklist'].length > 0) { | 190 | + if (json['cooklist'] is List) { |
| 191 | cooklist = <Cooklist>[]; | 191 | cooklist = <Cooklist>[]; |
| 192 | - dataMenu = {}; | ||
| 193 | - Map map = json['cooklist']; | ||
| 194 | - | ||
| 195 | - map.forEach((key, v) { | ||
| 196 | - List<Cook> cooktemp = []; | ||
| 197 | - v.forEach((v1) { | ||
| 198 | - cooklist.add(new Cooklist.fromJson(v1)); | ||
| 199 | - cooktemp.add(new Cook.fromJson(v1)); | ||
| 200 | - }); | ||
| 201 | - dataMenu[key] = cooktemp; | 192 | + json['cooklist'].forEach((v) { |
| 193 | + cooklist.add(new Cooklist.fromJson(v)); | ||
| 202 | }); | 194 | }); |
| 203 | - print(dataMenu); | 195 | + } else { |
| 196 | + if (json['cooklist'] != null && json['cooklist'].length > 0) { | ||
| 197 | + cooklist = <Cooklist>[]; | ||
| 198 | + dataMenu = {}; | ||
| 199 | + Map map = json['cooklist']; | ||
| 200 | + | ||
| 201 | + map.forEach((key, v) { | ||
| 202 | + List<Cook> cooktemp = []; | ||
| 203 | + v.forEach((v1) { | ||
| 204 | + cooklist.add(new Cooklist.fromJson(v1)); | ||
| 205 | + cooktemp.add(new Cook.fromJson(v1)); | ||
| 206 | + }); | ||
| 207 | + dataMenu[key] = cooktemp; | ||
| 208 | + }); | ||
| 209 | + print(dataMenu); | ||
| 210 | + } | ||
| 204 | } | 211 | } |
| 205 | 212 | ||
| 206 | // finalPriceC = json['finalPriceC']; | 213 | // finalPriceC = json['finalPriceC']; |
| @@ -63,6 +63,7 @@ class _FeastDishPageState extends State<FeastDishPage> { | @@ -63,6 +63,7 @@ class _FeastDishPageState extends State<FeastDishPage> { | ||
| 63 | bool success = await feastModel.setSetmealCook(context, params); | 63 | bool success = await feastModel.setSetmealCook(context, params); |
| 64 | if (success) { | 64 | if (success) { |
| 65 | Utils.showToast(cookid == null ? '添加成功' : '修改成功'); | 65 | Utils.showToast(cookid == null ? '添加成功' : '修改成功'); |
| 66 | + bus.emit('feast_setmeal_list'); | ||
| 66 | _getSetmealClassById(); | 67 | _getSetmealClassById(); |
| 67 | } | 68 | } |
| 68 | } | 69 | } |
| @@ -216,8 +217,7 @@ class _FeastDishPageState extends State<FeastDishPage> { | @@ -216,8 +217,7 @@ class _FeastDishPageState extends State<FeastDishPage> { | ||
| 216 | TextEditingController editingController, | 217 | TextEditingController editingController, |
| 217 | FocusNode focusNode, | 218 | FocusNode focusNode, |
| 218 | String subTitle, | 219 | String subTitle, |
| 219 | - {TextInputType inputType = | ||
| 220 | - TextInputType.text}) { | 220 | + {TextInputType inputType = TextInputType.text}) { |
| 221 | return Container( | 221 | return Container( |
| 222 | height: w(48), | 222 | height: w(48), |
| 223 | margin: EdgeInsets.only(top: w(12)), | 223 | margin: EdgeInsets.only(top: w(12)), |
| @@ -314,7 +314,7 @@ class _FeastDishSharePageState extends State<FeastDishSharePage> { | @@ -314,7 +314,7 @@ class _FeastDishSharePageState extends State<FeastDishSharePage> { | ||
| 314 | ), | 314 | ), |
| 315 | VEmptyView(10), | 315 | VEmptyView(10), |
| 316 | Text( | 316 | Text( |
| 317 | - '餐厅地址 | ${sellerAdr}', | 317 | + '餐厅地址 | ${sellerAdr ?? ''}', |
| 318 | style: TextStyle( | 318 | style: TextStyle( |
| 319 | fontSize: font(14), | 319 | fontSize: font(14), |
| 320 | color: Colors.transparent), | 320 | color: Colors.transparent), |
| @@ -368,7 +368,7 @@ class _FeastDishSharePageState extends State<FeastDishSharePage> { | @@ -368,7 +368,7 @@ class _FeastDishSharePageState extends State<FeastDishSharePage> { | ||
| 368 | ), | 368 | ), |
| 369 | VEmptyView(10), | 369 | VEmptyView(10), |
| 370 | Text( | 370 | Text( |
| 371 | - '餐厅地址 | ${sellerAdr}', | 371 | + '餐厅地址 | ${sellerAdr ?? ''}', |
| 372 | style: TextStyle( | 372 | style: TextStyle( |
| 373 | fontSize: font(14), | 373 | fontSize: font(14), |
| 374 | color: MyColours.color_CFB53B), | 374 | color: MyColours.color_CFB53B), |
| @@ -566,7 +566,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | @@ -566,7 +566,7 @@ class _BookInfoPageState extends State<BookInfoPage> { | ||
| 566 | fontWeight: FontWeight.bold, | 566 | fontWeight: FontWeight.bold, |
| 567 | fontSize: font(14))), | 567 | fontSize: font(14))), |
| 568 | VEmptyView(10), | 568 | VEmptyView(10), |
| 569 | - Text('${address}', | 569 | + Text('${address??''}', |
| 570 | style: TextStyle( | 570 | style: TextStyle( |
| 571 | height: 1.3, | 571 | height: 1.3, |
| 572 | color: MyColours.color_000000, | 572 | color: MyColours.color_000000, |
| @@ -472,7 +472,7 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | @@ -472,7 +472,7 @@ class _MarkingPreviewPageState extends State<MarkingPreviewPage> { | ||
| 472 | VEmptyView(10), | 472 | VEmptyView(10), |
| 473 | Padding( | 473 | Padding( |
| 474 | padding: EdgeInsets.only(left: w(8)), | 474 | padding: EdgeInsets.only(left: w(8)), |
| 475 | - child: Text('${reserveModel.address}', | 475 | + child: Text('${reserveModel.address??''}', |
| 476 | style: TextStyle( | 476 | style: TextStyle( |
| 477 | height: 1.3, | 477 | height: 1.3, |
| 478 | color: MyColours.color_000000, | 478 | color: MyColours.color_000000, |
-
Please register or login to post a comment