|
...
|
...
|
@@ -14,15 +14,168 @@ import 'package:one_key/route/navigator_util.dart'; |
|
|
|
import 'package:one_key/utils/utils.dart';
|
|
|
|
import 'package:one_key/widgets/MyDivider.dart';
|
|
|
|
import 'package:one_key/widgets/common_button.dart';
|
|
|
|
import 'package:one_key/widgets/h_empty_view.dart';
|
|
|
|
import 'package:one_key/widgets/table_item.dart';
|
|
|
|
import 'package:one_key/widgets/v_empty_view.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
import 'package:table_calendar/table_calendar.dart';
|
|
|
|
import 'package:one_key/models/table.dart' as t;
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
typedef CustomCallBack = void Function(Object object);
|
|
|
|
|
|
|
|
class DialogUtil {
|
|
|
|
//跳转拨打电话页面
|
|
|
|
static goPhone(String phoneNum) async {
|
|
|
|
String url = "tel:$phoneNum";
|
|
|
|
if (await canLaunch(url)) {
|
|
|
|
await launch(url);
|
|
|
|
} else {
|
|
|
|
LogUtil.e("Could not launch $url");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
底部选择弹框
|
|
|
|
*/
|
|
|
|
static showPhoneSelectBottomSheet(context, String phone) async {
|
|
|
|
// list.insert(0, '立即在线预订');
|
|
|
|
Widget dialog = Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(114) * 2 +
|
|
|
|
ScreenUtil().setWidth(114) +
|
|
|
|
ScreenUtil().setWidth(70),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(ScreenUtil().setWidth(40)),
|
|
|
|
topRight: Radius.circular(ScreenUtil().setWidth(40)))),
|
|
|
|
child: Column(
|
|
|
|
children: <Widget>[
|
|
|
|
VEmptyView(60),
|
|
|
|
Container(
|
|
|
|
height: ScreenUtil().setWidth(44),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
child: Text(phone,
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
fontSize: ScreenUtil().setSp(36)))),
|
|
|
|
VEmptyView(60),
|
|
|
|
InkWell(
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(114),
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(670),
|
|
|
|
height: ScreenUtil().setWidth(84),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f5f5f5,
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(42))),
|
|
|
|
child: Text(
|
|
|
|
"呼叫",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(114),
|
|
|
|
alignment: Alignment.topCenter,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
child: Container(
|
|
|
|
width: ScreenUtil().setWidth(670),
|
|
|
|
height: ScreenUtil().setWidth(84),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
color: MyColours.color_f5f5f5,
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.circular(ScreenUtil().setWidth(42))),
|
|
|
|
child: Text(
|
|
|
|
"取消",
|
|
|
|
style: TextStyle(
|
|
|
|
color: MyColours.color_666666,
|
|
|
|
fontSize: ScreenUtil().setSp(28)),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
onTap: () {
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
},
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
);
|
|
|
|
final option = await showModalBottomSheet(
|
|
|
|
context: context,
|
|
|
|
backgroundColor: Colors.transparent,
|
|
|
|
builder: (context) {
|
|
|
|
return Stack(
|
|
|
|
children: <Widget>[dialog],
|
|
|
|
);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
//构建电话Item
|
|
|
|
static _buildPhoneItem(List<dynamic> list) {
|
|
|
|
List<Widget> items = [];
|
|
|
|
for (int i = 0; i < list.length; i++) {
|
|
|
|
if (i > 0 && i < list.length) {
|
|
|
|
items.add(Container(
|
|
|
|
margin: EdgeInsets.only(
|
|
|
|
left: ScreenUtil().setWidth(144),
|
|
|
|
right: ScreenUtil().setWidth(40)),
|
|
|
|
height: ScreenUtil().setWidth(1),
|
|
|
|
color: MyColours.color_e5e5e5,
|
|
|
|
));
|
|
|
|
}
|
|
|
|
items.add(
|
|
|
|
InkWell(
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: ScreenUtil().setWidth(156),
|
|
|
|
padding: EdgeInsets.symmetric(
|
|
|
|
horizontal: ScreenUtil().setWidth(40),
|
|
|
|
vertical: ScreenUtil().setWidth(30)),
|
|
|
|
alignment: Alignment.center,
|
|
|
|
decoration: i == 0
|
|
|
|
? BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
borderRadius: BorderRadius.only(
|
|
|
|
topLeft: Radius.circular(ScreenUtil().setWidth(40)),
|
|
|
|
topRight: Radius.circular(ScreenUtil().setWidth(40))),
|
|
|
|
)
|
|
|
|
: BoxDecoration(
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
),
|
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
children: [],
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
onTap: () {
|
|
|
|
Utils.goPhone(list[i].toString());
|
|
|
|
},
|
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
return items;
|
|
|
|
}
|
|
|
|
|
|
|
|
//备注弹框
|
|
|
|
static showRemarkDialog(
|
|
|
|
BuildContext context, List<Remark> remarks, CustomCallBack callback,
|
...
|
...
|
|