Showing
11 changed files
with
927 additions
and
12 deletions
assets/table_manage_arrow_down.png
0 → 100755
1.48 KB
assets/table_manage_empty.png
0 → 100755
178 KB
assets/table_manage_swich_off.png
0 → 100755
949 Bytes
assets/table_manage_swich_on.png
0 → 100755
1.03 KB
lib/models/table_type_model.dart
0 → 100644
| 1 | +import 'package:json_annotation/json_annotation.dart'; | ||
| 2 | + | ||
| 3 | +part 'table_type_model.g.dart'; | ||
| 4 | + | ||
| 5 | + | ||
| 6 | +@JsonSerializable() | ||
| 7 | + class TableTypeModel extends Object { | ||
| 8 | + | ||
| 9 | + @JsonKey(name: 'ret') | ||
| 10 | + int ret; | ||
| 11 | + | ||
| 12 | + @JsonKey(name: 'data') | ||
| 13 | + List<TableTypeSunModel> data; | ||
| 14 | + | ||
| 15 | + @JsonKey(name: 'msg') | ||
| 16 | + String msg; | ||
| 17 | + | ||
| 18 | + TableTypeModel(this.ret,this.data,this.msg,); | ||
| 19 | + | ||
| 20 | + factory TableTypeModel.fromJson(Map<String, dynamic> srcJson) => _$TableTypeModelFromJson(srcJson); | ||
| 21 | + | ||
| 22 | + Map<String, dynamic> toJson() => _$TableTypeModelToJson(this); | ||
| 23 | + | ||
| 24 | +} | ||
| 25 | + | ||
| 26 | + | ||
| 27 | +@JsonSerializable() | ||
| 28 | + class TableTypeSunModel extends Object { | ||
| 29 | + | ||
| 30 | + @JsonKey(name: 'id') | ||
| 31 | + String id; | ||
| 32 | + | ||
| 33 | + @JsonKey(name: 'name') | ||
| 34 | + String name; | ||
| 35 | + | ||
| 36 | + @JsonKey(name: 'cdate') | ||
| 37 | + String cdate; | ||
| 38 | + | ||
| 39 | + TableTypeSunModel(this.id,this.name,this.cdate,); | ||
| 40 | + | ||
| 41 | + factory TableTypeSunModel.fromJson(Map<String, dynamic> srcJson) => _$TableTypeSunModelFromJson(srcJson); | ||
| 42 | + | ||
| 43 | + Map<String, dynamic> toJson() => _$TableTypeSunModelToJson(this); | ||
| 44 | + | ||
| 45 | +} | ||
| 46 | + | ||
| 47 | + |
lib/models/table_type_model.g.dart
0 → 100644
| 1 | +// GENERATED CODE - DO NOT MODIFY BY HAND | ||
| 2 | + | ||
| 3 | +part of 'table_type_model.dart'; | ||
| 4 | + | ||
| 5 | +// ************************************************************************** | ||
| 6 | +// JsonSerializableGenerator | ||
| 7 | +// ************************************************************************** | ||
| 8 | + | ||
| 9 | +TableTypeModel _$TableTypeModelFromJson(Map<String, dynamic> json) { | ||
| 10 | + return TableTypeModel( | ||
| 11 | + json['ret'] as int, | ||
| 12 | + (json['data'][0] as List) | ||
| 13 | + ?.map((e) => e == null | ||
| 14 | + ? null | ||
| 15 | + : TableTypeSunModel.fromJson(e as Map<String, dynamic>)) | ||
| 16 | + ?.toList(), | ||
| 17 | + json['msg'] as String, | ||
| 18 | + ); | ||
| 19 | +} | ||
| 20 | + | ||
| 21 | +Map<String, dynamic> _$TableTypeModelToJson(TableTypeModel instance) => | ||
| 22 | + <String, dynamic>{ | ||
| 23 | + 'ret': instance.ret, | ||
| 24 | + 'data': instance.data, | ||
| 25 | + 'msg': instance.msg, | ||
| 26 | + }; | ||
| 27 | + | ||
| 28 | +TableTypeSunModel _$TableTypeSunModelFromJson(Map<String, dynamic> json) { | ||
| 29 | + return TableTypeSunModel( | ||
| 30 | + json['id'] as String, | ||
| 31 | + json['name'] as String, | ||
| 32 | + json['cdate'] as String, | ||
| 33 | + ); | ||
| 34 | +} | ||
| 35 | + | ||
| 36 | +Map<String, dynamic> _$TableTypeSunModelToJson(TableTypeSunModel instance) => | ||
| 37 | + <String, dynamic>{ | ||
| 38 | + 'id': instance.id, | ||
| 39 | + 'name': instance.name, | ||
| 40 | + 'cdate': instance.cdate, | ||
| 41 | + }; |
| @@ -222,5 +222,7 @@ class HttpUrl { | @@ -222,5 +222,7 @@ class HttpUrl { | ||
| 222 | "?service=App.GuestManage.GetSellerUserBySellerid"; // 获取客户经理列表 | 222 | "?service=App.GuestManage.GetSellerUserBySellerid"; // 获取客户经理列表 |
| 223 | static const String send_marketing_msg_by_mid = | 223 | static const String send_marketing_msg_by_mid = |
| 224 | "?service=App.GuestManage.SendMarketingMsgByMid"; // 催促未完成任务经理发消息 | 224 | "?service=App.GuestManage.SendMarketingMsgByMid"; // 催促未完成任务经理发消息 |
| 225 | + static const String get_table_type = | ||
| 226 | + "?service=App.Tables.GetTabletype"; // 获取桌子类型列表 | ||
| 225 | 227 | ||
| 226 | } | 228 | } |
| @@ -77,6 +77,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | @@ -77,6 +77,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | ||
| 77 | 77 | ||
| 78 | WidgetsBinding.instance.addPostFrameCallback((_) { | 78 | WidgetsBinding.instance.addPostFrameCallback((_) { |
| 79 | tableManagerModel.initTime(context); | 79 | tableManagerModel.initTime(context); |
| 80 | + tableManagerModel.getTabletype(context); | ||
| 80 | // EventBus().on("refresh_tablemanager", (arg) { | 81 | // EventBus().on("refresh_tablemanager", (arg) { |
| 81 | // //订座-完成预订 刷新管理桌位 | 82 | // //订座-完成预订 刷新管理桌位 |
| 82 | // tableManagerModel.getReserveList(context, | 83 | // tableManagerModel.getReserveList(context, |
| @@ -160,14 +161,14 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | @@ -160,14 +161,14 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | ||
| 160 | .tableOuterList[tableManagerModel.selectNumber].isSelect, | 161 | .tableOuterList[tableManagerModel.selectNumber].isSelect, |
| 161 | child: InkWell( | 162 | child: InkWell( |
| 162 | onTap: () async { | 163 | onTap: () async { |
| 163 | - List<String> areas = []; | ||
| 164 | - for (int i = 0; i < tableManagerModel.areas.length; i++) { | ||
| 165 | - areas.add(tableManagerModel.areas[i].name); | 164 | + List<String> tableTypeS = []; |
| 165 | + for (int i = 0; i < tableManagerModel.tableTypeList.length; i++) { | ||
| 166 | + tableTypeS.add(tableManagerModel.tableTypeList[i].name); | ||
| 166 | } | 167 | } |
| 167 | 168 | ||
| 168 | //添加桌位弹框 | 169 | //添加桌位弹框 |
| 169 | - await DialogUtil.openCreateTableDialog( | ||
| 170 | - context, areas, i, personNumList, | 170 | + await DialogUtil.openMyTableManageCreateTableDialog( |
| 171 | + context, tableTypeS, personNumList, | ||
| 171 | onTap: (Map<String, String> value) async { | 172 | onTap: (Map<String, String> value) async { |
| 172 | print(value); | 173 | print(value); |
| 173 | // 'areaname': | 174 | // 'areaname': |
| @@ -291,6 +292,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | @@ -291,6 +292,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | ||
| 291 | return true; | 292 | return true; |
| 292 | }, | 293 | }, |
| 293 | child: Scaffold( | 294 | child: Scaffold( |
| 295 | + resizeToAvoidBottomInset: false, //输入框抵住键盘 | ||
| 294 | appBar: SystemAppBar( | 296 | appBar: SystemAppBar( |
| 295 | "桌位管理", | 297 | "桌位管理", |
| 296 | showLeading: true, | 298 | showLeading: true, |
| @@ -316,7 +318,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | @@ -316,7 +318,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | ||
| 316 | // } | 318 | // } |
| 317 | }, | 319 | }, |
| 318 | emptyMsg: "暂时没有桌位哦", | 320 | emptyMsg: "暂时没有桌位哦", |
| 319 | - emptyImg: "empty_search", | 321 | + emptyImg: "table_manage_empty", |
| 320 | showMsg: "加载中,请稍后...", | 322 | showMsg: "加载中,请稍后...", |
| 321 | )) | 323 | )) |
| 322 | : Expanded( | 324 | : Expanded( |
| @@ -359,7 +361,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | @@ -359,7 +361,7 @@ class MyTableManagerHomePageState extends State<MyTableManagerHomePage> { | ||
| 359 | onTap: () async { | 361 | onTap: () async { |
| 360 | //添加区域弹框 | 362 | //添加区域弹框 |
| 361 | await DialogUtil | 363 | await DialogUtil |
| 362 | - .openCreateAreaDialog( | 364 | + .openTableManageCreateAreaDialog( |
| 363 | context, onTap: | 365 | context, onTap: |
| 364 | (value) async { | 366 | (value) async { |
| 365 | print(value); | 367 | print(value); |
| @@ -10,6 +10,7 @@ import 'package:one_key/models/notebook.dart'; | @@ -10,6 +10,7 @@ import 'package:one_key/models/notebook.dart'; | ||
| 10 | import 'package:one_key/models/reserve_info_model.dart'; | 10 | import 'package:one_key/models/reserve_info_model.dart'; |
| 11 | import 'package:one_key/models/tableOuter.dart'; | 11 | import 'package:one_key/models/tableOuter.dart'; |
| 12 | import 'package:one_key/models/table_list.dart'; | 12 | import 'package:one_key/models/table_list.dart'; |
| 13 | +import 'package:one_key/models/table_type_model.dart'; | ||
| 13 | import 'package:one_key/net/base_resp.dart'; | 14 | import 'package:one_key/net/base_resp.dart'; |
| 14 | import 'package:one_key/net/dio_util.dart'; | 15 | import 'package:one_key/net/dio_util.dart'; |
| 15 | import 'package:one_key/net/http_url.dart'; | 16 | import 'package:one_key/net/http_url.dart'; |
| @@ -38,6 +39,8 @@ class MyTableManageHomeModel with ChangeNotifier { | @@ -38,6 +39,8 @@ class MyTableManageHomeModel with ChangeNotifier { | ||
| 38 | 39 | ||
| 39 | PageState pageState = PageState.Loading; | 40 | PageState pageState = PageState.Loading; |
| 40 | 41 | ||
| 42 | + List<TableTypeSunModel> tableTypeList; | ||
| 43 | + | ||
| 41 | int selectNumber; | 44 | int selectNumber; |
| 42 | 45 | ||
| 43 | //初始化时间 | 46 | //初始化时间 |
| @@ -266,6 +269,22 @@ class MyTableManageHomeModel with ChangeNotifier { | @@ -266,6 +269,22 @@ class MyTableManageHomeModel with ChangeNotifier { | ||
| 266 | return areaSunModelList; | 269 | return areaSunModelList; |
| 267 | } | 270 | } |
| 268 | 271 | ||
| 272 | + //获取桌子类型列表 | ||
| 273 | + Future<List<TableTypeSunModel>> getTabletype(BuildContext context) async { | ||
| 274 | + // Map<String, String> params = {"sellerid": userModel.user.sellerid}; | ||
| 275 | + BaseResp<List> baseResp = await DioUtil() | ||
| 276 | + .request<List>(context, Method.get, HttpUrl.get_table_type, | ||
| 277 | + showLoading: false) | ||
| 278 | + .catchError((error) { | ||
| 279 | + print(error.toString()); | ||
| 280 | + }); | ||
| 281 | + tableTypeList = []; | ||
| 282 | + if (baseResp.code == Constant.status_success) { | ||
| 283 | + tableTypeList = TableTypeModel.fromJson(baseResp.responseData).data; | ||
| 284 | + } | ||
| 285 | + return tableTypeList; | ||
| 286 | + } | ||
| 287 | + | ||
| 269 | //添加商家桌位 | 288 | //添加商家桌位 |
| 270 | Future<bool> addTable( | 289 | Future<bool> addTable( |
| 271 | BuildContext context, Map<String, String> params) async { | 290 | BuildContext context, Map<String, String> params) async { |
| @@ -312,8 +331,9 @@ class MyTableManageHomeModel with ChangeNotifier { | @@ -312,8 +331,9 @@ class MyTableManageHomeModel with ChangeNotifier { | ||
| 312 | // getReserveList(context, needLoading: false, needKeep: true); | 331 | // getReserveList(context, needLoading: false, needKeep: true); |
| 313 | // } else { | 332 | // } else { |
| 314 | // // pageState = PageState.Empty; | 333 | // // pageState = PageState.Empty; |
| 315 | - // pageState = PageState.Success; | ||
| 316 | - // notifyListeners(); | 334 | + initData(); |
| 335 | + pageState = PageState.Success; | ||
| 336 | + notifyListeners(); | ||
| 317 | // } | 337 | // } |
| 318 | } | 338 | } |
| 319 | } | 339 | } |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | 2 | ||
| 3 | class MyColours { | 3 | class MyColours { |
| 4 | - | ||
| 5 | - | 4 | + static const Color color_E7E7E7 = Color(0xffE7E7E7); |
| 6 | static const Color color_E34D59 = Color(0xffE34D59); | 5 | static const Color color_E34D59 = Color(0xffE34D59); |
| 7 | static const Color color_515151 = Color(0xff515151); | 6 | static const Color color_515151 = Color(0xff515151); |
| 8 | static const Color color_438E93 = Color(0xff438E93); | 7 | static const Color color_438E93 = Color(0xff438E93); |
| @@ -281,9 +281,183 @@ class DialogUtil { | @@ -281,9 +281,183 @@ class DialogUtil { | ||
| 281 | // }); | 281 | // }); |
| 282 | // } | 282 | // } |
| 283 | 283 | ||
| 284 | + static Future openTableManageCreateAreaDialog(BuildContext context, | ||
| 285 | + {CustomCallBack onTap}) async { | ||
| 286 | + TextEditingController controller = TextEditingController(); | ||
| 287 | + bool isRed = true; | ||
| 288 | + final action = await showDialog( | ||
| 289 | + context: context, | ||
| 290 | + barrierDismissible: false, | ||
| 291 | + builder: (BuildContext context) { | ||
| 292 | + return StatefulBuilder(builder: (context, state) { | ||
| 293 | + return Scaffold( | ||
| 294 | + backgroundColor: Colors.transparent, | ||
| 295 | + body: Center( | ||
| 296 | + child: Container( | ||
| 297 | + padding: EdgeInsets.symmetric( | ||
| 298 | + horizontal: ScreenUtil().setWidth(50)), | ||
| 299 | + height: ScreenUtil().setWidth(218 * 2 + 10), | ||
| 300 | + decoration: BoxDecoration( | ||
| 301 | + borderRadius: | ||
| 302 | + BorderRadius.circular(ScreenUtil().setWidth(16))), | ||
| 303 | + child: Card( | ||
| 304 | + shape: RoundedRectangleBorder( | ||
| 305 | + borderRadius: BorderRadius.all( | ||
| 306 | + Radius.circular(ScreenUtil().setWidth(10)))), //设置圆角 | ||
| 307 | + child: Container( | ||
| 308 | + child: Column( | ||
| 309 | + children: [ | ||
| 310 | + VEmptyView(64), | ||
| 311 | + Container( | ||
| 312 | + // height: ScreenUtil().setWidth(48), | ||
| 313 | + alignment: Alignment.center, | ||
| 314 | + child: Text('添加区域', | ||
| 315 | + style: TextStyle( | ||
| 316 | + fontWeight: FontWeight.bold, | ||
| 317 | + fontSize: ScreenUtil().setSp(34), | ||
| 318 | + color: MyColours.color_333333)), | ||
| 319 | + ), | ||
| 320 | + VEmptyView(40), | ||
| 321 | + Container( | ||
| 322 | + height: ScreenUtil().setWidth(48 * 2), | ||
| 323 | + margin: EdgeInsets.symmetric( | ||
| 324 | + horizontal: ScreenUtil().setWidth(40)), | ||
| 325 | + decoration: BoxDecoration( | ||
| 326 | + color: MyColours.color_f3f3f3, | ||
| 327 | + borderRadius: BorderRadius.circular( | ||
| 328 | + ScreenUtil().setWidth(10))), | ||
| 329 | + child: Row( | ||
| 330 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 331 | + children: [ | ||
| 332 | + HEmptyView(20), | ||
| 333 | + isRed | ||
| 334 | + ? Text( | ||
| 335 | + '*', | ||
| 336 | + style: TextStyle( | ||
| 337 | + fontSize: ScreenUtil().setSp(32), | ||
| 338 | + color: MyColours.color_E34D59), | ||
| 339 | + ) | ||
| 340 | + : SizedBox(), | ||
| 341 | + Expanded( | ||
| 342 | + child: TextField( | ||
| 343 | + controller: controller, | ||
| 344 | + maxLines: 1, | ||
| 345 | + // //光标颜色 | ||
| 346 | + // cursorColor: | ||
| 347 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 348 | + //输入文本的样式 | ||
| 349 | + style: TextStyle( | ||
| 350 | + fontSize: ScreenUtil().setSp(32), | ||
| 351 | + color: MyColours.color_515151), | ||
| 352 | + | ||
| 353 | + decoration: InputDecoration( | ||
| 354 | + contentPadding: EdgeInsets.only( | ||
| 355 | + bottom: ScreenUtil() | ||
| 356 | + .setWidth(40)), //设置文字内容与边框距离 | ||
| 357 | + // enabledBorder: UnderlineInputBorder( | ||
| 358 | + // borderSide: BorderSide( | ||
| 359 | + // color: MyColours.color_efefef), | ||
| 360 | + // ), | ||
| 361 | + // focusedBorder: UnderlineInputBorder( | ||
| 362 | + // borderSide: BorderSide( | ||
| 363 | + // color: MyColours.color_efefef, | ||
| 364 | + // width: ScreenUtil().setWidth(2)), | ||
| 365 | + // ), | ||
| 366 | + // prefixText: '*', | ||
| 367 | + // prefixStyle: TextStyle( | ||
| 368 | + // fontSize: ScreenUtil().setSp(32), | ||
| 369 | + // color: MyColours.color_E95750), | ||
| 370 | + border: OutlineInputBorder( | ||
| 371 | + borderSide: BorderSide.none), | ||
| 372 | + hintText: '输入区域名称', | ||
| 373 | + hintStyle: TextStyle( | ||
| 374 | + color: MyColours.color_BFC4D4, | ||
| 375 | + fontSize: ScreenUtil().setSp(32), | ||
| 376 | + ), | ||
| 377 | + ), | ||
| 378 | + onChanged: (value) { | ||
| 379 | + state(() { | ||
| 380 | + if (controller.text == '') { | ||
| 381 | + isRed = true; | ||
| 382 | + } else { | ||
| 383 | + isRed = false; | ||
| 384 | + } | ||
| 385 | + }); | ||
| 386 | + }, | ||
| 387 | + onEditingComplete: () { | ||
| 388 | + FocusScope.of(context).requestFocus( | ||
| 389 | + FocusNode()); //点击空白处隐藏键盘 | ||
| 390 | + }, | ||
| 391 | + keyboardType: TextInputType.text, | ||
| 392 | + ), | ||
| 393 | + ) | ||
| 394 | + ], | ||
| 395 | + ), | ||
| 396 | + ), | ||
| 397 | + VEmptyView(80), | ||
| 398 | + MyDivider(double.infinity, ScreenUtil().setWidth(2), | ||
| 399 | + color: MyColours.color_f3f3f3), | ||
| 400 | + Row( | ||
| 401 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 402 | + children: [ | ||
| 403 | + RoundButton( | ||
| 404 | + text: '取消', | ||
| 405 | + width: (ScreenUtil.screenWidthDp - | ||
| 406 | + ScreenUtil().setWidth(60) * 2) / | ||
| 407 | + 2, | ||
| 408 | + height: ScreenUtil().setWidth(112), | ||
| 409 | + // radius: ScreenUtil().setWidth(10), | ||
| 410 | + gradientStart: MyColours.color_ffffff, | ||
| 411 | + gradientEnd: MyColours.color_ffffff, | ||
| 412 | + textColor: MyColours.color_000000, | ||
| 413 | + isBold: false, | ||
| 414 | + fontSize: 34, | ||
| 415 | + onPressed: () { | ||
| 416 | + Navigator.pop(context); | ||
| 417 | + }), | ||
| 418 | + MyDivider(ScreenUtil().setWidth(2), | ||
| 419 | + ScreenUtil().setWidth(112), | ||
| 420 | + color: MyColours.color_f3f3f3), | ||
| 421 | + RoundButton( | ||
| 422 | + text: '确定', | ||
| 423 | + width: (ScreenUtil.screenWidthDp - | ||
| 424 | + ScreenUtil().setWidth(60) * 2) / | ||
| 425 | + 2, | ||
| 426 | + height: ScreenUtil().setWidth(112), | ||
| 427 | + // radius: ScreenUtil().setWidth(10), | ||
| 428 | + gradientStart: MyColours.color_ffffff, | ||
| 429 | + gradientEnd: MyColours.color_ffffff, | ||
| 430 | + textColor: isRed | ||
| 431 | + ? MyColours.color_999999 | ||
| 432 | + : MyColours.color_438E93, | ||
| 433 | + fontSize: 34, | ||
| 434 | + onPressed: () { | ||
| 435 | + if (!isRed) { | ||
| 436 | + if (controller.text.trim() == '') { | ||
| 437 | + Utils.showToast('请输入区域名称!'); | ||
| 438 | + return; | ||
| 439 | + } | ||
| 440 | + onTap(controller.text); | ||
| 441 | + Navigator.pop(context, controller.text); | ||
| 442 | + } | ||
| 443 | + }), | ||
| 444 | + ], | ||
| 445 | + ) | ||
| 446 | + ], | ||
| 447 | + ), | ||
| 448 | + ), | ||
| 449 | + ), | ||
| 450 | + ), | ||
| 451 | + )); | ||
| 452 | + }); | ||
| 453 | + }, | ||
| 454 | + ); | ||
| 455 | + } | ||
| 456 | + | ||
| 284 | static Future openCreateAreaDialog(BuildContext context, | 457 | static Future openCreateAreaDialog(BuildContext context, |
| 285 | {CustomCallBack onTap}) async { | 458 | {CustomCallBack onTap}) async { |
| 286 | TextEditingController controller = TextEditingController(); | 459 | TextEditingController controller = TextEditingController(); |
| 460 | + | ||
| 287 | final action = await showDialog( | 461 | final action = await showDialog( |
| 288 | context: context, | 462 | context: context, |
| 289 | barrierDismissible: false, | 463 | barrierDismissible: false, |
| @@ -423,6 +597,51 @@ class DialogUtil { | @@ -423,6 +597,51 @@ class DialogUtil { | ||
| 423 | ); | 597 | ); |
| 424 | } | 598 | } |
| 425 | 599 | ||
| 600 | + static btnChooseTableManagePnum( | ||
| 601 | + String title, String maxOrMin, double width, ClickCallback callback) { | ||
| 602 | + return InkWell( | ||
| 603 | + onTap: () { | ||
| 604 | + callback(title); | ||
| 605 | + }, | ||
| 606 | + child: Row( | ||
| 607 | + children: [ | ||
| 608 | + // Container( | ||
| 609 | + // padding: EdgeInsets.symmetric( | ||
| 610 | + // horizontal: ScreenUtil().setWidth(20), | ||
| 611 | + // vertical: ScreenUtil().setWidth(10)), | ||
| 612 | + // height: ScreenUtil().setWidth(60), | ||
| 613 | + // width: width, | ||
| 614 | + // decoration: BoxDecoration( | ||
| 615 | + // border: Border( | ||
| 616 | + // bottom: BorderSide( | ||
| 617 | + // width: ScreenUtil().setWidth(2), | ||
| 618 | + // color: MyColours.color_E7E7E7)), | ||
| 619 | + // ), | ||
| 620 | + // child: | ||
| 621 | + Text( | ||
| 622 | + title == '' | ||
| 623 | + ? maxOrMin == 'max' | ||
| 624 | + ? '最多' | ||
| 625 | + : '最少' | ||
| 626 | + : title, | ||
| 627 | + style: TextStyle( | ||
| 628 | + decoration: TextDecoration.underline, | ||
| 629 | + color: title == '' | ||
| 630 | + ? MyColours.color_BFC4D4 | ||
| 631 | + : MyColours.color_199095, | ||
| 632 | + fontSize: ScreenUtil().setWidth(28)), | ||
| 633 | + ), | ||
| 634 | + // ), | ||
| 635 | + HEmptyView(14), | ||
| 636 | + Image.asset( | ||
| 637 | + Utils.getImgPath('table_manage_arrow_down'), | ||
| 638 | + width: ScreenUtil().setWidth(40), | ||
| 639 | + // height: ScreenUtil().setWidth(10), | ||
| 640 | + ) | ||
| 641 | + ], | ||
| 642 | + )); | ||
| 643 | + } | ||
| 644 | + | ||
| 426 | static btnChoose(String title, double width, ClickCallback callback) { | 645 | static btnChoose(String title, double width, ClickCallback callback) { |
| 427 | return InkWell( | 646 | return InkWell( |
| 428 | onTap: () { | 647 | onTap: () { |
| @@ -458,6 +677,42 @@ class DialogUtil { | @@ -458,6 +677,42 @@ class DialogUtil { | ||
| 458 | ))); | 677 | ))); |
| 459 | } | 678 | } |
| 460 | 679 | ||
| 680 | + static tableManageSelectWidget( | ||
| 681 | + List<String> data, double height, CustomCallBack onTap) { | ||
| 682 | + return Container( | ||
| 683 | + decoration: BoxDecoration( | ||
| 684 | + color: MyColours.color_ffffff, | ||
| 685 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(10)), | ||
| 686 | + border: Border.all( | ||
| 687 | + color: MyColours.color_cccccc, | ||
| 688 | + width: ScreenUtil().setWidth(2))), | ||
| 689 | + width: ScreenUtil().setWidth(120 * 2), | ||
| 690 | + height: ScreenUtil().setWidth(height), | ||
| 691 | + child: ListView.builder( | ||
| 692 | + padding: | ||
| 693 | + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(20)), | ||
| 694 | + itemCount: data.length, | ||
| 695 | + itemBuilder: (context, index) { | ||
| 696 | + return InkWell( | ||
| 697 | + onTap: () { | ||
| 698 | + onTap(index); | ||
| 699 | + }, | ||
| 700 | + child: Container( | ||
| 701 | + padding: EdgeInsets.all(ScreenUtil().setWidth(20)), | ||
| 702 | + decoration: BoxDecoration( | ||
| 703 | + border: Border( | ||
| 704 | + bottom: BorderSide( | ||
| 705 | + color: MyColours.color_efefef, | ||
| 706 | + width: ScreenUtil().setWidth(2)))), | ||
| 707 | + child: Text(data[index], | ||
| 708 | + style: TextStyle( | ||
| 709 | + color: MyColours.color_199095, | ||
| 710 | + fontSize: ScreenUtil().setSp(28))), | ||
| 711 | + ), | ||
| 712 | + ); | ||
| 713 | + })); | ||
| 714 | + } | ||
| 715 | + | ||
| 461 | static selectWidget(List<String> data, CustomCallBack onTap) { | 716 | static selectWidget(List<String> data, CustomCallBack onTap) { |
| 462 | return Container( | 717 | return Container( |
| 463 | decoration: BoxDecoration( | 718 | decoration: BoxDecoration( |
| @@ -495,6 +750,555 @@ class DialogUtil { | @@ -495,6 +750,555 @@ class DialogUtil { | ||
| 495 | })); | 750 | })); |
| 496 | } | 751 | } |
| 497 | 752 | ||
| 753 | + static Future openMyTableManageCreateTableDialog( | ||
| 754 | + BuildContext context, List<String> baojianList, List<String> pnum, | ||
| 755 | + {CustomCallBackMap onTap}) async { | ||
| 756 | + TextEditingController controller = TextEditingController(); | ||
| 757 | + | ||
| 758 | + TextEditingController _norNumController = TextEditingController(); | ||
| 759 | + FocusNode _norNumFocusNode = FocusNode(); | ||
| 760 | + bool showBaojian = true; | ||
| 761 | + bool showPnumMin = true; | ||
| 762 | + bool showPnumMax = true; | ||
| 763 | + String pnumMin = ''; | ||
| 764 | + String pnumMax = ''; | ||
| 765 | + int currentBaojianIndex = 0; | ||
| 766 | + String baojian = baojianList[currentBaojianIndex]; | ||
| 767 | + bool mulCreate = false; | ||
| 768 | + // StateSetter globalState; | ||
| 769 | +// //输入框焦点 | ||
| 770 | +// focusNode.addListener(() { | ||
| 771 | +// if (!focusNode.hasFocus) { | ||
| 772 | +// // print('失去焦点'); | ||
| 773 | + | ||
| 774 | +// } else { | ||
| 775 | +// // print('得到焦点'); | ||
| 776 | +// globalState(() { | ||
| 777 | +// showPnumMin = true; | ||
| 778 | +// showPnumMax = true; | ||
| 779 | +// showArea = true; | ||
| 780 | +// }); | ||
| 781 | +// } | ||
| 782 | +// }); | ||
| 783 | + | ||
| 784 | + final action = await showDialog( | ||
| 785 | + context: context, | ||
| 786 | + barrierDismissible: false, | ||
| 787 | + builder: (BuildContext context) { | ||
| 788 | + return Center(child: StatefulBuilder(builder: (context, state) { | ||
| 789 | + // globalState = state; | ||
| 790 | + | ||
| 791 | + return Container( | ||
| 792 | + margin: EdgeInsets.only(top: ScreenUtil().setWidth(300)), | ||
| 793 | + padding: | ||
| 794 | + EdgeInsets.symmetric(horizontal: ScreenUtil().setWidth(50)), | ||
| 795 | + // height: ScreenUtil().setWidth(326 * 2) + | ||
| 796 | + // ScreenUtil().setWidth(250 * 2), | ||
| 797 | + decoration: BoxDecoration( | ||
| 798 | + borderRadius: | ||
| 799 | + BorderRadius.circular(ScreenUtil().setWidth(10))), | ||
| 800 | + child: Stack(children: [ | ||
| 801 | + Column( | ||
| 802 | + children: [ | ||
| 803 | + Card( | ||
| 804 | + shape: RoundedRectangleBorder( | ||
| 805 | + borderRadius: BorderRadius.all(Radius.circular( | ||
| 806 | + ScreenUtil().setWidth(10)))), //设置圆角 | ||
| 807 | + child: Stack( | ||
| 808 | + overflow: Overflow.visible, | ||
| 809 | + children: [ | ||
| 810 | + Container( | ||
| 811 | + child: Column( | ||
| 812 | + children: [ | ||
| 813 | + VEmptyView(64), | ||
| 814 | + Container( | ||
| 815 | + padding: EdgeInsets.symmetric( | ||
| 816 | + horizontal: | ||
| 817 | + ScreenUtil().setWidth(44)), | ||
| 818 | + // height: ScreenUtil().setWidth(48), | ||
| 819 | + alignment: Alignment.center, | ||
| 820 | + child: Text('新建桌位', | ||
| 821 | + style: TextStyle( | ||
| 822 | + fontWeight: FontWeight.bold, | ||
| 823 | + fontSize: ScreenUtil().setSp(34), | ||
| 824 | + color: MyColours.color_333333)), | ||
| 825 | + ), | ||
| 826 | + VEmptyView(60), | ||
| 827 | + InkWell( | ||
| 828 | + onTap: () { | ||
| 829 | + state(() { | ||
| 830 | + mulCreate = !mulCreate; | ||
| 831 | + }); | ||
| 832 | + }, | ||
| 833 | + child: Container( | ||
| 834 | + padding: EdgeInsets.symmetric( | ||
| 835 | + horizontal: | ||
| 836 | + ScreenUtil().setWidth(44)), | ||
| 837 | + height: ScreenUtil().setWidth(30 * 2), | ||
| 838 | + child: Row( | ||
| 839 | + mainAxisAlignment: | ||
| 840 | + MainAxisAlignment.spaceBetween, | ||
| 841 | + crossAxisAlignment: | ||
| 842 | + CrossAxisAlignment.center, | ||
| 843 | + children: [ | ||
| 844 | + HEmptyView(32), | ||
| 845 | + Text('批量创建', | ||
| 846 | + style: TextStyle( | ||
| 847 | + fontSize: ScreenUtil() | ||
| 848 | + .setSp(32), | ||
| 849 | + color: MyColours | ||
| 850 | + .color_000000)), | ||
| 851 | + Spacer(), | ||
| 852 | + Image.asset( | ||
| 853 | + mulCreate | ||
| 854 | + ? Utils.getImgPath( | ||
| 855 | + 'table_manage_swich_on') | ||
| 856 | + : Utils.getImgPath( | ||
| 857 | + 'table_manage_swich_off'), | ||
| 858 | + width: | ||
| 859 | + ScreenUtil().setWidth(60), | ||
| 860 | + // height: ScreenUtil().setWidth(82), | ||
| 861 | + ), | ||
| 862 | + HEmptyView(32), | ||
| 863 | + ], | ||
| 864 | + ), | ||
| 865 | + )), | ||
| 866 | + VEmptyView(30), | ||
| 867 | + // MyDivider(double.infinity, | ||
| 868 | + // ScreenUtil().setWidth(2), | ||
| 869 | + // color: MyColours.color_E7E7E7), | ||
| 870 | + // VEmptyView(30), | ||
| 871 | + mulCreate | ||
| 872 | + ? Padding( | ||
| 873 | + padding: EdgeInsets.symmetric( | ||
| 874 | + horizontal: | ||
| 875 | + ScreenUtil().setWidth(72), | ||
| 876 | + ), | ||
| 877 | + child: textfield( | ||
| 878 | + context, | ||
| 879 | + '数量', | ||
| 880 | + '填写个数', | ||
| 881 | + _norNumController, | ||
| 882 | + _norNumFocusNode, | ||
| 883 | + '人')) | ||
| 884 | + : Container( | ||
| 885 | + margin: EdgeInsets.symmetric( | ||
| 886 | + horizontal: | ||
| 887 | + ScreenUtil().setWidth(44)), | ||
| 888 | + height: | ||
| 889 | + ScreenUtil().setWidth(48 * 2), | ||
| 890 | + // margin: EdgeInsets.symmetric( | ||
| 891 | + // horizontal: | ||
| 892 | + // ScreenUtil().setWidth(40)), | ||
| 893 | + decoration: BoxDecoration( | ||
| 894 | + color: MyColours.color_f3f3f3, | ||
| 895 | + borderRadius: | ||
| 896 | + BorderRadius.circular( | ||
| 897 | + ScreenUtil() | ||
| 898 | + .setWidth(10))), | ||
| 899 | + child: Row( | ||
| 900 | + crossAxisAlignment: | ||
| 901 | + CrossAxisAlignment.center, | ||
| 902 | + children: [ | ||
| 903 | + HEmptyView(20), | ||
| 904 | + Expanded( | ||
| 905 | + child: TextField( | ||
| 906 | + controller: controller, | ||
| 907 | + maxLines: 1, | ||
| 908 | + // //光标颜色 | ||
| 909 | + // cursorColor: | ||
| 910 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 911 | + //输入文本的样式 | ||
| 912 | + style: TextStyle( | ||
| 913 | + fontSize: ScreenUtil() | ||
| 914 | + .setSp(32), | ||
| 915 | + color: MyColours | ||
| 916 | + .color_515151), | ||
| 917 | + | ||
| 918 | + decoration: InputDecoration( | ||
| 919 | + contentPadding: EdgeInsets.only( | ||
| 920 | + bottom: ScreenUtil() | ||
| 921 | + .setWidth( | ||
| 922 | + 40)), //设置文字内容与边框距离 | ||
| 923 | + // enabledBorder: UnderlineInputBorder( | ||
| 924 | + // borderSide: BorderSide( | ||
| 925 | + // color: MyColours.color_efefef), | ||
| 926 | + // ), | ||
| 927 | + // focusedBorder: UnderlineInputBorder( | ||
| 928 | + // borderSide: BorderSide( | ||
| 929 | + // color: MyColours.color_efefef, | ||
| 930 | + // width: ScreenUtil().setWidth(2)), | ||
| 931 | + // ), | ||
| 932 | + // prefixText: '*', | ||
| 933 | + // prefixStyle: TextStyle( | ||
| 934 | + // fontSize: ScreenUtil().setSp(32), | ||
| 935 | + // color: MyColours.color_E95750), | ||
| 936 | + border: | ||
| 937 | + OutlineInputBorder( | ||
| 938 | + borderSide: | ||
| 939 | + BorderSide | ||
| 940 | + .none), | ||
| 941 | + hintText: '桌位名称', | ||
| 942 | + hintStyle: TextStyle( | ||
| 943 | + color: MyColours | ||
| 944 | + .color_BFC4D4, | ||
| 945 | + fontSize: ScreenUtil() | ||
| 946 | + .setSp(32), | ||
| 947 | + ), | ||
| 948 | + ), | ||
| 949 | + onChanged: (value) { | ||
| 950 | + state(() {}); | ||
| 951 | + }, | ||
| 952 | + onEditingComplete: () { | ||
| 953 | + FocusScope.of(context) | ||
| 954 | + .requestFocus( | ||
| 955 | + FocusNode()); //点击空白处隐藏键盘 | ||
| 956 | + }, | ||
| 957 | + keyboardType: | ||
| 958 | + TextInputType.text, | ||
| 959 | + ), | ||
| 960 | + ) | ||
| 961 | + ], | ||
| 962 | + ), | ||
| 963 | + ), | ||
| 964 | + VEmptyView(32), | ||
| 965 | + InkWell( | ||
| 966 | + onTap: () { | ||
| 967 | + state(() { | ||
| 968 | + showPnumMax = true; | ||
| 969 | + showPnumMin = true; | ||
| 970 | + showBaojian = !showBaojian; | ||
| 971 | + }); | ||
| 972 | + }, | ||
| 973 | + child: Container( | ||
| 974 | + padding: EdgeInsets.symmetric( | ||
| 975 | + horizontal: | ||
| 976 | + ScreenUtil().setWidth(44)), | ||
| 977 | + height: ScreenUtil().setWidth(30 * 2), | ||
| 978 | + child: Row( | ||
| 979 | + crossAxisAlignment: | ||
| 980 | + CrossAxisAlignment.center, | ||
| 981 | + children: [ | ||
| 982 | + HEmptyView(32), | ||
| 983 | + Text( | ||
| 984 | + '桌位类型', | ||
| 985 | + style: TextStyle( | ||
| 986 | + fontSize: | ||
| 987 | + ScreenUtil().setSp(32), | ||
| 988 | + color: | ||
| 989 | + MyColours.color_000000), | ||
| 990 | + ), | ||
| 991 | + Spacer(), | ||
| 992 | + // Stack( | ||
| 993 | + // overflow: Overflow.visible, | ||
| 994 | + // children: [ | ||
| 995 | + Text( | ||
| 996 | + baojian, | ||
| 997 | + style: TextStyle( | ||
| 998 | + color: | ||
| 999 | + MyColours.color_515151, | ||
| 1000 | + fontSize: | ||
| 1001 | + ScreenUtil().setSp(32)), | ||
| 1002 | + ), | ||
| 1003 | + HEmptyView(12), | ||
| 1004 | + Image.asset( | ||
| 1005 | + Utils.getImgPath( | ||
| 1006 | + 'table_manage_arrow_down'), | ||
| 1007 | + width: ScreenUtil() | ||
| 1008 | + .setWidth(40)), | ||
| 1009 | + HEmptyView(32), | ||
| 1010 | + ], | ||
| 1011 | + ), | ||
| 1012 | + )), | ||
| 1013 | + | ||
| 1014 | + mulCreate | ||
| 1015 | + ? SizedBox() | ||
| 1016 | + : Container( | ||
| 1017 | + margin: EdgeInsets.only( | ||
| 1018 | + top: ScreenUtil().setWidth(60)), | ||
| 1019 | + padding: EdgeInsets.only( | ||
| 1020 | + left: ScreenUtil().setWidth(44), | ||
| 1021 | + right: | ||
| 1022 | + ScreenUtil().setWidth(44)), | ||
| 1023 | + height: | ||
| 1024 | + ScreenUtil().setWidth(30 * 2), | ||
| 1025 | + child: Row( | ||
| 1026 | + crossAxisAlignment: | ||
| 1027 | + CrossAxisAlignment.center, | ||
| 1028 | + children: [ | ||
| 1029 | + HEmptyView(32), | ||
| 1030 | + Text( | ||
| 1031 | + '人数', | ||
| 1032 | + style: TextStyle( | ||
| 1033 | + fontSize: ScreenUtil() | ||
| 1034 | + .setSp(32), | ||
| 1035 | + color: MyColours | ||
| 1036 | + .color_000000), | ||
| 1037 | + ), | ||
| 1038 | + Spacer(), | ||
| 1039 | + // Stack( | ||
| 1040 | + // overflow: Overflow.visible, | ||
| 1041 | + // children: [ | ||
| 1042 | + btnChooseTableManagePnum( | ||
| 1043 | + pnumMin, | ||
| 1044 | + 'min', | ||
| 1045 | + ScreenUtil() | ||
| 1046 | + .setWidth(54 * 2), | ||
| 1047 | + (value) { | ||
| 1048 | + state(() { | ||
| 1049 | + showBaojian = true; | ||
| 1050 | + showPnumMax = true; | ||
| 1051 | + showPnumMin = !showPnumMin; | ||
| 1052 | + }); | ||
| 1053 | + }), | ||
| 1054 | + HEmptyView(40), | ||
| 1055 | + Text( | ||
| 1056 | + '至', | ||
| 1057 | + style: TextStyle( | ||
| 1058 | + fontSize: ScreenUtil() | ||
| 1059 | + .setSp(32), | ||
| 1060 | + color: MyColours | ||
| 1061 | + .color_000000), | ||
| 1062 | + ), | ||
| 1063 | + HEmptyView(40), | ||
| 1064 | + btnChooseTableManagePnum( | ||
| 1065 | + pnumMax, | ||
| 1066 | + 'max', | ||
| 1067 | + ScreenUtil() | ||
| 1068 | + .setWidth(54 * 2), | ||
| 1069 | + (value) { | ||
| 1070 | + state(() { | ||
| 1071 | + showBaojian = true; | ||
| 1072 | + showPnumMin = true; | ||
| 1073 | + showPnumMax = !showPnumMax; | ||
| 1074 | + }); | ||
| 1075 | + }), | ||
| 1076 | + HEmptyView(32), | ||
| 1077 | + ], | ||
| 1078 | + ), | ||
| 1079 | + ), | ||
| 1080 | + VEmptyView(80), | ||
| 1081 | + MyDivider(double.infinity, | ||
| 1082 | + ScreenUtil().setWidth(2), | ||
| 1083 | + color: MyColours.color_f3f3f3), | ||
| 1084 | + Row( | ||
| 1085 | + mainAxisAlignment: | ||
| 1086 | + MainAxisAlignment.spaceBetween, | ||
| 1087 | + children: [ | ||
| 1088 | + RoundButton( | ||
| 1089 | + text: '取消', | ||
| 1090 | + width: (ScreenUtil.screenWidthDp - | ||
| 1091 | + ScreenUtil() | ||
| 1092 | + .setWidth(110) * | ||
| 1093 | + 2) / | ||
| 1094 | + 2, | ||
| 1095 | + height: | ||
| 1096 | + ScreenUtil().setWidth(112), | ||
| 1097 | + // radius: ScreenUtil().setWidth(10), | ||
| 1098 | + gradientStart: | ||
| 1099 | + MyColours.color_ffffff, | ||
| 1100 | + gradientEnd: | ||
| 1101 | + MyColours.color_ffffff, | ||
| 1102 | + textColor: MyColours.color_000000, | ||
| 1103 | + isBold: false, | ||
| 1104 | + fontSize: 34, | ||
| 1105 | + onPressed: () { | ||
| 1106 | + Navigator.pop(context); | ||
| 1107 | + }), | ||
| 1108 | + MyDivider(ScreenUtil().setWidth(2), | ||
| 1109 | + ScreenUtil().setWidth(112), | ||
| 1110 | + color: MyColours.color_f3f3f3), | ||
| 1111 | + RoundButton( | ||
| 1112 | + text: '确定', | ||
| 1113 | + width: (ScreenUtil.screenWidthDp - | ||
| 1114 | + ScreenUtil() | ||
| 1115 | + .setWidth(110) * | ||
| 1116 | + 2) / | ||
| 1117 | + 2, | ||
| 1118 | + height: | ||
| 1119 | + ScreenUtil().setWidth(112), | ||
| 1120 | + // radius: ScreenUtil().setWidth(10), | ||
| 1121 | + gradientStart: | ||
| 1122 | + MyColours.color_ffffff, | ||
| 1123 | + gradientEnd: | ||
| 1124 | + MyColours.color_ffffff, | ||
| 1125 | + textColor: controller.text == '' | ||
| 1126 | + ? MyColours.color_999999 | ||
| 1127 | + : MyColours.color_438E93, | ||
| 1128 | + fontSize: 34, | ||
| 1129 | + onPressed: () { | ||
| 1130 | + if (controller.text.trim() == | ||
| 1131 | + '') { | ||
| 1132 | + Utils.showToast('请输入桌位名称!'); | ||
| 1133 | + return; | ||
| 1134 | + } | ||
| 1135 | + // 当前选中区域 | ||
| 1136 | + // areas[currentAreaIndex] | ||
| 1137 | + //最低人数 | ||
| 1138 | + // pnumMin | ||
| 1139 | + //最高人数 | ||
| 1140 | + // pnumMax | ||
| 1141 | + | ||
| 1142 | + onTap({ | ||
| 1143 | + 'areaname': baojianList[ | ||
| 1144 | + currentBaojianIndex], | ||
| 1145 | + 'name': controller.text, | ||
| 1146 | + 'pnumMin': pnumMin, | ||
| 1147 | + 'pnumMax': pnumMax | ||
| 1148 | + }); | ||
| 1149 | + Navigator.pop(context); | ||
| 1150 | + }), | ||
| 1151 | + ]) | ||
| 1152 | + ], | ||
| 1153 | + ), | ||
| 1154 | + ), | ||
| 1155 | + Positioned( | ||
| 1156 | + left: ScreenUtil().setWidth(100 * 2), | ||
| 1157 | + top: ScreenUtil().setWidth(105 * 2), | ||
| 1158 | + child: Offstage( | ||
| 1159 | + offstage: showBaojian, | ||
| 1160 | + child: tableManageSelectWidget( | ||
| 1161 | + baojianList, 210, (index) { | ||
| 1162 | + state(() { | ||
| 1163 | + showBaojian = !showBaojian; | ||
| 1164 | + currentBaojianIndex = index; | ||
| 1165 | + baojian = | ||
| 1166 | + baojianList[currentBaojianIndex]; | ||
| 1167 | + }); | ||
| 1168 | + }), | ||
| 1169 | + )), | ||
| 1170 | + ], | ||
| 1171 | + )), | ||
| 1172 | + ], | ||
| 1173 | + ), | ||
| 1174 | + Positioned( | ||
| 1175 | + left: ScreenUtil().setWidth(30 * 2), | ||
| 1176 | + top: ScreenUtil().setWidth(112 * 2), | ||
| 1177 | + child: Offstage( | ||
| 1178 | + offstage: showPnumMin, | ||
| 1179 | + child: Material( | ||
| 1180 | + color: Colors.transparent, | ||
| 1181 | + child: selectWidget(pnum, (index) { | ||
| 1182 | + state(() { | ||
| 1183 | + showPnumMin = !showPnumMin; | ||
| 1184 | + pnumMin = pnum[index]; | ||
| 1185 | + }); | ||
| 1186 | + }), | ||
| 1187 | + ))), | ||
| 1188 | + Positioned( | ||
| 1189 | + left: ScreenUtil().setWidth(106 * 2), | ||
| 1190 | + top: ScreenUtil().setWidth(132 * 2), | ||
| 1191 | + child: Material( | ||
| 1192 | + color: Colors.transparent, | ||
| 1193 | + child: Offstage( | ||
| 1194 | + offstage: showPnumMax, | ||
| 1195 | + child: selectWidget(pnum, (index) { | ||
| 1196 | + state(() { | ||
| 1197 | + showPnumMax = !showPnumMax; | ||
| 1198 | + pnumMax = pnum[index]; | ||
| 1199 | + }); | ||
| 1200 | + }), | ||
| 1201 | + ))), | ||
| 1202 | + ])); | ||
| 1203 | + })); | ||
| 1204 | + }); | ||
| 1205 | + } | ||
| 1206 | + | ||
| 1207 | + ///输入框 | ||
| 1208 | + static Widget textfield( | ||
| 1209 | + BuildContext context, | ||
| 1210 | + String title, | ||
| 1211 | + String hintText, | ||
| 1212 | + TextEditingController editingController, | ||
| 1213 | + FocusNode focusNode, | ||
| 1214 | + String subTitle, | ||
| 1215 | + {bool needStar = false, | ||
| 1216 | + TextInputType inputType = TextInputType.number}) { | ||
| 1217 | + return Container( | ||
| 1218 | + child: Row( | ||
| 1219 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 1220 | + children: [ | ||
| 1221 | + Container( | ||
| 1222 | + child: Text( | ||
| 1223 | + title, | ||
| 1224 | + style: TextStyle( | ||
| 1225 | + color: MyColours.color_000000, | ||
| 1226 | + // fontWeight: FontWeight.bold, | ||
| 1227 | + fontSize: ScreenUtil().setSp(32)), | ||
| 1228 | + ), | ||
| 1229 | + ), | ||
| 1230 | + HEmptyView(20), | ||
| 1231 | + needStar | ||
| 1232 | + ? Container( | ||
| 1233 | + child: Text( | ||
| 1234 | + '*', | ||
| 1235 | + style: TextStyle( | ||
| 1236 | + color: MyColours.color_199095, | ||
| 1237 | + fontWeight: FontWeight.bold, | ||
| 1238 | + ), | ||
| 1239 | + ), | ||
| 1240 | + ) | ||
| 1241 | + : SizedBox(), | ||
| 1242 | + // Spacer(), | ||
| 1243 | + Expanded( | ||
| 1244 | + child: Container( | ||
| 1245 | + // height: ScreenUtil().setHeight(120), | ||
| 1246 | + padding: EdgeInsets.only( | ||
| 1247 | + left: ScreenUtil().setWidth(20), | ||
| 1248 | + right: ScreenUtil().setWidth(10), | ||
| 1249 | + top: ScreenUtil().setWidth(8)), | ||
| 1250 | + child: TextField( | ||
| 1251 | + controller: editingController, | ||
| 1252 | + textAlign: TextAlign.right, | ||
| 1253 | + // textAlignVertical: TextAlignVertical.bottom, | ||
| 1254 | + maxLines: 1, | ||
| 1255 | + inputFormatters: [], | ||
| 1256 | + | ||
| 1257 | + // //光标颜色 | ||
| 1258 | + // cursorColor: | ||
| 1259 | + // widget.isSelect ? Colors.white : MyColours.color_199095, | ||
| 1260 | + //输入文本的样式 | ||
| 1261 | + style: TextStyle( | ||
| 1262 | + fontSize: ScreenUtil().setSp(32), | ||
| 1263 | + color: MyColours.color_515151), | ||
| 1264 | + focusNode: focusNode, | ||
| 1265 | + decoration: InputDecoration( | ||
| 1266 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 1267 | + hintText: hintText, | ||
| 1268 | + hintStyle: TextStyle( | ||
| 1269 | + color: MyColours.color_BFC4D4, | ||
| 1270 | + fontSize: ScreenUtil().setSp(32), | ||
| 1271 | + ), | ||
| 1272 | + enabledBorder: new UnderlineInputBorder( | ||
| 1273 | + borderSide: BorderSide.none, | ||
| 1274 | + ), | ||
| 1275 | + focusedBorder: new UnderlineInputBorder( | ||
| 1276 | + borderSide: BorderSide.none, | ||
| 1277 | + ), | ||
| 1278 | + contentPadding: EdgeInsets.zero, | ||
| 1279 | + ), | ||
| 1280 | + onChanged: (value) {}, | ||
| 1281 | + onEditingComplete: () { | ||
| 1282 | + FocusScope.of(context) | ||
| 1283 | + .requestFocus(FocusNode()); //点击空白处隐藏键盘 | ||
| 1284 | + }, | ||
| 1285 | + keyboardType: inputType, | ||
| 1286 | + )), | ||
| 1287 | + ), | ||
| 1288 | + Container( | ||
| 1289 | + child: Text( | ||
| 1290 | + subTitle, | ||
| 1291 | + style: TextStyle( | ||
| 1292 | + color: MyColours.color_333333, | ||
| 1293 | + fontWeight: FontWeight.bold, | ||
| 1294 | + fontSize: ScreenUtil().setSp(32)), | ||
| 1295 | + ), | ||
| 1296 | + ), | ||
| 1297 | + ], | ||
| 1298 | + ), | ||
| 1299 | + ); | ||
| 1300 | + } | ||
| 1301 | + | ||
| 498 | static Future openCreateTableDialog(BuildContext context, List<String> areas, | 1302 | static Future openCreateTableDialog(BuildContext context, List<String> areas, |
| 499 | int currentAreaIndex, List<String> pnum, | 1303 | int currentAreaIndex, List<String> pnum, |
| 500 | {CustomCallBackMap onTap}) async { | 1304 | {CustomCallBackMap onTap}) async { |
| @@ -919,7 +1723,7 @@ class DialogUtil { | @@ -919,7 +1723,7 @@ class DialogUtil { | ||
| 919 | child: Text( | 1723 | child: Text( |
| 920 | "取消", | 1724 | "取消", |
| 921 | style: TextStyle( | 1725 | style: TextStyle( |
| 922 | - fontWeight: FontWeight.bold, | 1726 | + fontWeight: FontWeight.bold, |
| 923 | color: MyColours.color_5688F3, | 1727 | color: MyColours.color_5688F3, |
| 924 | fontSize: ScreenUtil().setSp(32)), | 1728 | fontSize: ScreenUtil().setSp(32)), |
| 925 | ), | 1729 | ), |
-
Please register or login to post a comment