|
|
|
// import 'package:flutter/material.dart';
|
|
|
|
// import 'package:one_key/constant/constant.dart';
|
|
|
|
// import 'package:one_key/constant/state.dart';
|
|
|
|
// import 'package:one_key/models/tableOuter.dart';
|
|
|
|
// import 'package:one_key/net/base_resp.dart';
|
|
|
|
// import 'package:one_key/net/dio_util.dart';
|
|
|
|
// import 'package:one_key/net/http_url.dart';
|
|
|
|
// import 'package:one_key/models/table.dart' as t;
|
|
|
|
// import 'package:one_key/utils/navigator_util.dart';
|
|
|
|
// import 'package:one_key/utils/utils.dart';
|
|
|
|
|
|
|
|
// class SelectTableModel {
|
|
|
|
// PageState pageState = PageState.Loading;
|
|
|
|
|
|
|
|
// //获取桌位数据
|
|
|
|
// Future<List<TableOuter>> getTableList(
|
|
|
|
// BuildContext context, Map<String, String> params,
|
|
|
|
// {isShowLoading = true}) async {
|
|
|
|
// if (isShowLoading) {
|
|
|
|
// pageState = PageState.Loading;
|
|
|
|
// notifyListeners();
|
|
|
|
// }
|
|
|
|
// BaseResp<List> baseResp = await DioUtil()
|
|
|
|
// .request<List>(context, Method.get, HttpUrl.table_list,
|
|
|
|
// data: params, showLoading: true)
|
|
|
|
// .catchError((error) {
|
|
|
|
// print(error.toString());
|
|
|
|
// });
|
|
|
|
// if (baseResp.code == Constant.status_success) {
|
|
|
|
// return (baseResp.data[0] as List).map((value) {
|
|
|
|
// TableOuter tableOuter = TableOuter();
|
|
|
|
// tableOuter.name = value["name"];
|
|
|
|
// tableOuter.list = (value["list"] as List).map((table) {
|
|
|
|
// return t.Table.fromJson(table as Map<String, dynamic>);
|
|
|
|
// }).toList();
|
|
|
|
// return tableOuter;
|
|
|
|
// }).toList();
|
|
|
|
// }
|
|
|
|
// return [];
|
|
|
|
// }
|
|
|
|
// } |