|
@@ -14,15 +14,168 @@ import 'package:one_key/route/navigator_util.dart'; |
|
@@ -14,15 +14,168 @@ import 'package:one_key/route/navigator_util.dart'; |
|
14
|
import 'package:one_key/utils/utils.dart';
|
14
|
import 'package:one_key/utils/utils.dart';
|
|
15
|
import 'package:one_key/widgets/MyDivider.dart';
|
15
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
16
|
import 'package:one_key/widgets/common_button.dart';
|
16
|
import 'package:one_key/widgets/common_button.dart';
|
|
|
|
17
|
+import 'package:one_key/widgets/h_empty_view.dart';
|
|
17
|
import 'package:one_key/widgets/table_item.dart';
|
18
|
import 'package:one_key/widgets/table_item.dart';
|
|
18
|
import 'package:one_key/widgets/v_empty_view.dart';
|
19
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
19
|
import 'package:provider/provider.dart';
|
20
|
import 'package:provider/provider.dart';
|
|
20
|
import 'package:table_calendar/table_calendar.dart';
|
21
|
import 'package:table_calendar/table_calendar.dart';
|
|
21
|
import 'package:one_key/models/table.dart' as t;
|
22
|
import 'package:one_key/models/table.dart' as t;
|
|
|
|
23
|
+import 'package:url_launcher/url_launcher.dart';
|
|
22
|
|
24
|
|
|
23
|
typedef CustomCallBack = void Function(Object object);
|
25
|
typedef CustomCallBack = void Function(Object object);
|
|
24
|
|
26
|
|
|
25
|
class DialogUtil {
|
27
|
class DialogUtil {
|
|
|
|
28
|
+ //跳转拨打电话页面
|
|
|
|
29
|
+ static goPhone(String phoneNum) async {
|
|
|
|
30
|
+ String url = "tel:$phoneNum";
|
|
|
|
31
|
+ if (await canLaunch(url)) {
|
|
|
|
32
|
+ await launch(url);
|
|
|
|
33
|
+ } else {
|
|
|
|
34
|
+ LogUtil.e("Could not launch $url");
|
|
|
|
35
|
+ }
|
|
|
|
36
|
+ }
|
|
|
|
37
|
+
|
|
|
|
38
|
+ /*
|
|
|
|
39
|
+ 底部选择弹框
|
|
|
|
40
|
+ */
|
|
|
|
41
|
+ static showPhoneSelectBottomSheet(context, String phone) async {
|
|
|
|
42
|
+ // list.insert(0, '立即在线预订');
|
|
|
|
43
|
+ Widget dialog = Container(
|
|
|
|
44
|
+ width: double.infinity,
|
|
|
|
45
|
+ height: ScreenUtil().setWidth(114) * 2 +
|
|
|
|
46
|
+ ScreenUtil().setWidth(114) +
|
|
|
|
47
|
+ ScreenUtil().setWidth(70),
|
|
|
|
48
|
+ decoration: BoxDecoration(
|
|
|
|
49
|
+ color: MyColours.color_ffffff,
|
|
|
|
50
|
+ borderRadius: BorderRadius.only(
|
|
|
|
51
|
+ topLeft: Radius.circular(ScreenUtil().setWidth(40)),
|
|
|
|
52
|
+ topRight: Radius.circular(ScreenUtil().setWidth(40)))),
|
|
|
|
53
|
+ child: Column(
|
|
|
|
54
|
+ children: <Widget>[
|
|
|
|
55
|
+ VEmptyView(60),
|
|
|
|
56
|
+ Container(
|
|
|
|
57
|
+ height: ScreenUtil().setWidth(44),
|
|
|
|
58
|
+ alignment: Alignment.center,
|
|
|
|
59
|
+ child: Text(phone,
|
|
|
|
60
|
+ style: TextStyle(
|
|
|
|
61
|
+ color: MyColours.color_666666,
|
|
|
|
62
|
+ fontSize: ScreenUtil().setSp(36)))),
|
|
|
|
63
|
+ VEmptyView(60),
|
|
|
|
64
|
+ InkWell(
|
|
|
|
65
|
+ child: Container(
|
|
|
|
66
|
+ width: double.infinity,
|
|
|
|
67
|
+ height: ScreenUtil().setWidth(114),
|
|
|
|
68
|
+ alignment: Alignment.topCenter,
|
|
|
|
69
|
+ color: MyColours.color_ffffff,
|
|
|
|
70
|
+ child: Container(
|
|
|
|
71
|
+ width: ScreenUtil().setWidth(670),
|
|
|
|
72
|
+ height: ScreenUtil().setWidth(84),
|
|
|
|
73
|
+ alignment: Alignment.center,
|
|
|
|
74
|
+ decoration: BoxDecoration(
|
|
|
|
75
|
+ color: MyColours.color_f5f5f5,
|
|
|
|
76
|
+ borderRadius:
|
|
|
|
77
|
+ BorderRadius.circular(ScreenUtil().setWidth(42))),
|
|
|
|
78
|
+ child: Text(
|
|
|
|
79
|
+ "呼叫",
|
|
|
|
80
|
+ style: TextStyle(
|
|
|
|
81
|
+ color: MyColours.color_666666,
|
|
|
|
82
|
+ fontSize: ScreenUtil().setSp(28)),
|
|
|
|
83
|
+ ),
|
|
|
|
84
|
+ )),
|
|
|
|
85
|
+ onTap: () {
|
|
|
|
86
|
+ Navigator.of(context).pop();
|
|
|
|
87
|
+ },
|
|
|
|
88
|
+ ),
|
|
|
|
89
|
+ InkWell(
|
|
|
|
90
|
+ child: Container(
|
|
|
|
91
|
+ width: double.infinity,
|
|
|
|
92
|
+ height: ScreenUtil().setWidth(114),
|
|
|
|
93
|
+ alignment: Alignment.topCenter,
|
|
|
|
94
|
+ color: MyColours.color_ffffff,
|
|
|
|
95
|
+ child: Container(
|
|
|
|
96
|
+ width: ScreenUtil().setWidth(670),
|
|
|
|
97
|
+ height: ScreenUtil().setWidth(84),
|
|
|
|
98
|
+ alignment: Alignment.center,
|
|
|
|
99
|
+ decoration: BoxDecoration(
|
|
|
|
100
|
+ color: MyColours.color_f5f5f5,
|
|
|
|
101
|
+ borderRadius:
|
|
|
|
102
|
+ BorderRadius.circular(ScreenUtil().setWidth(42))),
|
|
|
|
103
|
+ child: Text(
|
|
|
|
104
|
+ "取消",
|
|
|
|
105
|
+ style: TextStyle(
|
|
|
|
106
|
+ color: MyColours.color_666666,
|
|
|
|
107
|
+ fontSize: ScreenUtil().setSp(28)),
|
|
|
|
108
|
+ ),
|
|
|
|
109
|
+ )),
|
|
|
|
110
|
+ onTap: () {
|
|
|
|
111
|
+ Navigator.of(context).pop();
|
|
|
|
112
|
+ },
|
|
|
|
113
|
+ )
|
|
|
|
114
|
+ ],
|
|
|
|
115
|
+ ),
|
|
|
|
116
|
+ );
|
|
|
|
117
|
+ final option = await showModalBottomSheet(
|
|
|
|
118
|
+ context: context,
|
|
|
|
119
|
+ backgroundColor: Colors.transparent,
|
|
|
|
120
|
+ builder: (context) {
|
|
|
|
121
|
+ return Stack(
|
|
|
|
122
|
+ children: <Widget>[dialog],
|
|
|
|
123
|
+ );
|
|
|
|
124
|
+ });
|
|
|
|
125
|
+ }
|
|
|
|
126
|
+
|
|
|
|
127
|
+ //构建电话Item
|
|
|
|
128
|
+ static _buildPhoneItem(List<dynamic> list) {
|
|
|
|
129
|
+ List<Widget> items = [];
|
|
|
|
130
|
+ for (int i = 0; i < list.length; i++) {
|
|
|
|
131
|
+ if (i > 0 && i < list.length) {
|
|
|
|
132
|
+ items.add(Container(
|
|
|
|
133
|
+ margin: EdgeInsets.only(
|
|
|
|
134
|
+ left: ScreenUtil().setWidth(144),
|
|
|
|
135
|
+ right: ScreenUtil().setWidth(40)),
|
|
|
|
136
|
+ height: ScreenUtil().setWidth(1),
|
|
|
|
137
|
+ color: MyColours.color_e5e5e5,
|
|
|
|
138
|
+ ));
|
|
|
|
139
|
+ }
|
|
|
|
140
|
+ items.add(
|
|
|
|
141
|
+ InkWell(
|
|
|
|
142
|
+ child: Container(
|
|
|
|
143
|
+ width: double.infinity,
|
|
|
|
144
|
+ height: ScreenUtil().setWidth(156),
|
|
|
|
145
|
+ padding: EdgeInsets.symmetric(
|
|
|
|
146
|
+ horizontal: ScreenUtil().setWidth(40),
|
|
|
|
147
|
+ vertical: ScreenUtil().setWidth(30)),
|
|
|
|
148
|
+ alignment: Alignment.center,
|
|
|
|
149
|
+ decoration: i == 0
|
|
|
|
150
|
+ ? BoxDecoration(
|
|
|
|
151
|
+ color: MyColours.color_ffffff,
|
|
|
|
152
|
+ borderRadius: BorderRadius.only(
|
|
|
|
153
|
+ topLeft: Radius.circular(ScreenUtil().setWidth(40)),
|
|
|
|
154
|
+ topRight: Radius.circular(ScreenUtil().setWidth(40))),
|
|
|
|
155
|
+ )
|
|
|
|
156
|
+ : BoxDecoration(
|
|
|
|
157
|
+ color: MyColours.color_ffffff,
|
|
|
|
158
|
+ ),
|
|
|
|
159
|
+ child: Row(
|
|
|
|
160
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
161
|
+ children: [
|
|
|
|
162
|
+ Column(
|
|
|
|
163
|
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
164
|
+ crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
165
|
+ children: [],
|
|
|
|
166
|
+ )
|
|
|
|
167
|
+ ],
|
|
|
|
168
|
+ ),
|
|
|
|
169
|
+ ),
|
|
|
|
170
|
+ onTap: () {
|
|
|
|
171
|
+ Utils.goPhone(list[i].toString());
|
|
|
|
172
|
+ },
|
|
|
|
173
|
+ ),
|
|
|
|
174
|
+ );
|
|
|
|
175
|
+ }
|
|
|
|
176
|
+ return items;
|
|
|
|
177
|
+ }
|
|
|
|
178
|
+
|
|
26
|
//备注弹框
|
179
|
//备注弹框
|
|
27
|
static showRemarkDialog(
|
180
|
static showRemarkDialog(
|
|
28
|
BuildContext context, List<Remark> remarks, CustomCallBack callback,
|
181
|
BuildContext context, List<Remark> remarks, CustomCallBack callback,
|