Commit f90aa0ef08b45a7de287b2f137f6f783b049a6c8

Authored by wdn127929
1 parent 72165a5e

预订安排和录入预订ok

... ... @@ -11,14 +11,14 @@ if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = "230"
def flutterVersionCode = "231"
if (flutterVersionCode == null) {
flutterVersionCode = '230'
flutterVersionCode = '231'
}
def flutterVersionName = "2.3.0"
def flutterVersionName = "2.3.1"
if (flutterVersionName == null) {
flutterVersionName = '2.3.0'
flutterVersionName = '2.3.1'
}
apply plugin: 'com.android.application'
... ...

459 Bytes | W: | H:

623 Bytes | W: | H:

  • 2-up
  • Swipe
  • Onion skin

1.16 KB | W: | H:

1.23 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

67.2 KB | W: | H:

56.5 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
... ... @@ -472,7 +472,7 @@
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 220;
CURRENT_PROJECT_VERSION = 230;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -487,7 +487,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.2.6;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -616,7 +616,7 @@
CODE_SIGN_ENTITLEMENTS = "Runner/一键订Debug.entitlements";
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 220;
CURRENT_PROJECT_VERSION = 230;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -631,7 +631,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.2.6;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = "";
... ... @@ -651,7 +651,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 220;
CURRENT_PROJECT_VERSION = 230;
DEVELOPMENT_TEAM = 8J59HM8B82;
ENABLE_BITCODE = NO;
FLUTTER_BUILD_MODE = release;
... ... @@ -666,7 +666,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 2.2.6;
MARKETING_VERSION = 2.3.1;
PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
PRODUCT_NAME = Runner;
PROVISIONING_PROFILE_SPECIFIER = "";
... ...
... ... @@ -586,8 +586,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
setState(() {
_currIndex = index;
});
if (_currIndex == 3) {
Utils.changeStatusColor(color: Colors.transparent);
if (_currIndex == 5) {
Utils.changeStatusColor(color: MyColours.color_199095);
} else {
Utils.changeStatusColor(color: Colors.white);
}
... ...
... ... @@ -80,10 +80,10 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
_initTime();
setState(() {});
sid = Provider.of<UserModel>(context, listen: false).user.sellerid;
_homeEnterModel.initDateHourMinuteList(context, currTimeIndex);
String ddate = DateTime.now().millisecondsSinceEpoch.toString() + '000';
_homeEnterModel
.getNewTableList(context, ddate, currTimeIndex.toString(), pnum, []);
_homeEnterModel.initDateHourMinuteList(context, currTimeIndex, dateText);
String ddate = DateTime.now().millisecondsSinceEpoch.toString();
_homeEnterModel.getNewTableList(
context, ddate, currTimeIndex.toString(), pnum);
Map<String, String> params = {
"uid": Provider.of<UserModel>(context, listen: false).user.openid
... ... @@ -471,11 +471,7 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
int ddate = DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳
// String pnum = Utils.getPnum(_homeEnterModel.personNumList);
_homeEnterModel.getNewTableList(
context,
'${ddate}',
currTimeIndex.toString(),
pnum,
_homeEnterModel.tableList);
context, '${ddate}', currTimeIndex.toString(), pnum);
_homeEnterModel.notifyListeners();
}
}, selecteds: selectPnum == null ? [] : [selectPnum])
... ... @@ -681,12 +677,13 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
// } else {
// _homeEnterModel.dateList[2]['title'] = '其他';
// }
_homeEnterModel.initHourAndMinuteSelect();
_homeEnterModel.getNewTableList(
context, '${dateTimeMill}', currTimeIndex.toString(), pnum);
_homeEnterModel.initHourAndMinuteSelect(dateText);
// 选完日历刷新页面
// String pnum = Utils.getPnum(_homeEnterModel.personNumList);
_homeEnterModel.getNewTableList(context, '${dateTimeMill}',
currTimeIndex.toString(), pnum, _homeEnterModel.tableList);
}
_homeEnterModel.notifyListeners();
});
... ... @@ -807,6 +804,7 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
}
_refreshRemark(List<Remark> remark, int index) {
print(currentRemark);
if (remark[index].selected) {
if (currentRemark.length == 0) {
currentRemark += '${remark[index].custom}';
... ... @@ -878,7 +876,7 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
// }
// });
if (currTimeIndex == 1) {
_homeEnterModel.ddateStr = '8:00';
_homeEnterModel.ddateStr = '08:00';
} else if (currTimeIndex == 2) {
_homeEnterModel.ddateStr = '12:00';
} else if (currTimeIndex == 3) {
... ... @@ -890,8 +888,8 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
String timeStr = ymyStr + ' ' + "00:00:00";
int ddate = DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳
// String pnum = Utils.getPnum(_homeEnterModel.personNumList);
_homeEnterModel.getNewTableList(context, '${ddate}',
currTimeIndex.toString(), pnum, _homeEnterModel.tableList);
_homeEnterModel.getNewTableList(
context, '${ddate}', currTimeIndex.toString(), pnum);
_homeEnterModel.notifyListeners();
Navigator.pop(context);
},
... ... @@ -902,7 +900,7 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
isSelect: _getCurruntIndex(list[i]) == currTimeIndex,
));
if (i < list.length - 1) {
temp.add(HEmptyView(80));
temp.add(HEmptyView(70));
}
}
return temp;
... ... @@ -1043,6 +1041,13 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
key = item['key'];
tempMndList = _homeEnterModel.dailyMap[key];
}
print(_homeEnterModel.ddateStr);
for (var itemSun in tempMndList) {
itemSun['select'] = false;
if (itemSun['title'] == _homeEnterModel.ddateStr) {
itemSun['select'] = true;
}
}
// if (item['isSelect'] == true) {
// }
... ... @@ -1109,7 +1114,7 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
itemBuilder: (BuildContext context, int index) {
// locationState = state;
return CustomButton(
onTap: () {
onTap: () async {
// state(() {
for (var item in tempMndList) {
item['select'] = false;
... ... @@ -1121,21 +1126,17 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
_homeEnterModel.ddateStr = item['title'];
}
}
// });
String ymyStr = dateText; //年月日
String timeStr = ymyStr + ' ' + "00:00:00";
int ddate = DateUtil.getDateMsByTimeStr(
timeStr); //筛选日期时间戳
// String pnum = Utils.getPnum(_homeEnterModel.personNumList);
_homeEnterModel.getNewTableList(
context,
'${ddate}',
currTimeIndex.toString(),
pnum,
_homeEnterModel.tableList);
_homeEnterModel.notifyListeners();
await _homeEnterModel.getNewTableList(context,
'${ddate}', currTimeIndex.toString(), pnum);
Navigator.pop(context);
_homeEnterModel.notifyListeners();
},
width: 80,
height: 36,
... ... @@ -1223,6 +1224,34 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
}
}
_clearData() async {
_initTime();
for (Remark item in remarkManagerModel.ofenRemarks) {
item.selected = false;
}
currentRemark = '';
_homeEnterModel.initSexList();
_homeEnterModel.nameController.text = '';
_homeEnterModel.phoneController.text = '';
_homeEnterModel.customController.text = '';
dateText = ""; //当前显示日期时间
// currTimeIndex = null;
_homeEnterModel.ddateStr = '';
pnum = '6';
selectPnum = 5;
dateTimeNow = DateTime.now();
dateText = "${dateTimeNow.year}" +
"-" +
Utils.addZeroNumber(dateTimeNow.month) +
"-" +
Utils.addZeroNumber(dateTimeNow.day);
String ddate = DateTime.now().millisecondsSinceEpoch.toString() + '000';
await _homeEnterModel.getNewTableList(
context, ddate, currTimeIndex.toString(), pnum);
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
_homeEnterModel.notifyListeners();
}
_getContactData() async {
Contact contact = await _contactPicker.selectContactWithNative();
setState(() {
... ... @@ -1257,29 +1286,8 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
'录入预订',
showLeading: false,
rightImgName: '清空',
onTapRight: () async {
_initTime();
_homeEnterModel.initSexList();
_homeEnterModel.nameController.text = '';
_homeEnterModel.phoneController.text = '';
_homeEnterModel.customController.text = '';
dateText = ""; //当前显示日期时间
// currTimeIndex = null;
_homeEnterModel.ddateStr = '';
pnum = '6';
selectPnum = 5;
dateTimeNow = DateTime.now();
dateText = "${dateTimeNow.year}" +
"-" +
Utils.addZeroNumber(dateTimeNow.month) +
"-" +
Utils.addZeroNumber(dateTimeNow.day);
String ddate =
DateTime.now().millisecondsSinceEpoch.toString() + '000';
await _homeEnterModel.getNewTableList(
context, ddate, currTimeIndex.toString(), pnum, []);
FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
_homeEnterModel.notifyListeners();
onTapRight: () {
_clearData();
},
),
Expanded(
... ... @@ -1314,7 +1322,10 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
return;
}
SunReserveInfoModel _model =
await _homeEnterModel.setReserveInfo(context);
await _homeEnterModel.setReserveInfo(context,
pnum: pnum,
dateText: dateText,
currTimeIndex: currTimeIndex);
if (ObjectUtil.isNotEmpty(_model.row) ||
ObjectUtil.isNotEmpty(_model.row.id)) {
print('成功');
... ... @@ -1354,8 +1365,29 @@ class _HomeEnterPageState extends State<HomeEnterPage> {
_model.row.ddate,
ddate_solt,
_model.row.phone,
replace: true);
EventBus().emit("refresh_tablemanager"); //刷新桌位
replace: false);
//今天 明天 其他天
String tempTime = _homeEnterModel.ddateStr;
if (_homeEnterModel.ddateStr == '') {
if (currTimeIndex == 1) {
tempTime = '08:00';
} else if (currTimeIndex == 2) {
tempTime = '12:00';
} else if (currTimeIndex == 3) {
tempTime = '18:30';
}
}
print(_model.row.tableinfo);
_clearData();
String timeStr = dateText + ' ' + tempTime + ':00';
LogUtil.v(timeStr);
int ddate = DateUtil.getDateMsByTimeStr(timeStr);
_homeEnterModel.getNewTableList(
context, '${ddate}', currTimeIndex.toString(), pnum);
// EventBus().emit("refresh_tablemanager"); //刷新桌位
} else {
Utils.showToast("录入预订订单失败,请重试!");
}
... ... @@ -1489,13 +1521,16 @@ class _ButtonState extends State<CustomButton> {
},
onEditingComplete: () {
_cancelNode.unfocus();
int ddate = Utils.getDdate(widget.model.dateList);
String ymyStr = widget.dateText; //年月日
String timeStr = ymyStr + ' ' + "00:00:00";
int ddate =
DateUtil.getDateMsByTimeStr(timeStr); //筛选日期时间戳
String ddateSolt =
Utils.getDdateSolt(widget.model.sunDateList);
// String pnum = Utils.getPnum(widget.model.personNumList);
widget.model.getNewTableList(context, '${ddate}',
ddateSolt, widget.pnum, widget.model.tableList);
widget.model.getNewTableList(
context, '${ddate}', ddateSolt, widget.pnum);
},
keyboardType: TextInputType.number,
),
... ...
... ... @@ -19,6 +19,7 @@ import 'package:one_key/route/navigator_util.dart';
import 'package:one_key/utils/utils.dart';
import 'package:one_key/widgets/h_empty_view.dart';
import 'package:one_key/widgets/round_button.dart';
import 'package:one_key/widgets/system_app_bar.dart';
import 'package:one_key/widgets/v_empty_view.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
... ... @@ -46,7 +47,7 @@ class InvicationPageState extends State<InvicationPage> {
DateTime dateTime;
String dateTimeStr = "";
ScrollController controller = ScrollController();
double couponHeight = 180.0;
double couponHeight = 140.0;
CouponProvider couponProvider;
BaseIndoProvider _baseIndoProvider;
String name = '填写姓名';
... ... @@ -135,7 +136,7 @@ class InvicationPageState extends State<InvicationPage> {
});
} else {
setState(() {
couponHeight = 180.0;
couponHeight = 140.0;
});
}
} else {
... ... @@ -278,640 +279,572 @@ class InvicationPageState extends State<InvicationPage> {
// TODO: implement build
_baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
couponProvider = Provider.of<CouponProvider>(context, listen: true);
return Container(
width: double.infinity,
// height: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/yd_bg_new.png"), fit: BoxFit.fill),
),
return SafeArea(
child: Scaffold(
backgroundColor: Colors.transparent,
backgroundColor: Colors.white,
appBar: SystemAppBar('', onTap: () {
Navigator.pop(context);
}),
body: Stack(
children: [
Container(
margin: EdgeInsets.only(top: ScreenUtil().setWidth(13 * 2)),
padding:
EdgeInsets.only(top: ScreenUtil().setWidth(35 * 2)),
child: Column(children: [
Expanded(
child: ListView(
controller: controller,
physics: BouncingScrollPhysics(),
children: <Widget>[
Center(
child: Column(
children: <Widget>[
Image.asset(
"assets/yd_logo.png",
width: ScreenUtil().setWidth(233 * 2),
height: ScreenUtil().setHeight(51 * 2),
),
VEmptyView(26),
Container(
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
// padding: EdgeInsets.all(
// ScreenUtil().setWidth(60)),
// decoration: BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// colors: [
// MyColours.color_F7F1E8,
// MyColours.color_E3D6C7,
// ],
// ),
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10))),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.center,
children: [
Container(
// color: Colors.red,
width:
ScreenUtil().setWidth(335 * 2),
height:
ScreenUtil().setWidth(200 * 2),
// decoration: BoxDecoration(
// image: DecorationImage(
// alignment:
// Alignment.topCenter,
// image: AssetImage(
// "assets/yd_baiinfo_bg.png"),
// fit: BoxFit.cover),
// ),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: ScreenUtil()
.setWidth(70)),
child: qiniuUrl == ''
? Image.asset(
Utils.getImgPath(
'yd_person'),
width: ScreenUtil().setWidth(
143 * 2),
height: ScreenUtil()
.setWidth(
190 * 2))
: Image.network(qiniuUrl,
Column(children: [
Expanded(
child: ListView(
controller: controller,
physics: BouncingScrollPhysics(),
children: <Widget>[
Center(
child: Column(
children: <Widget>[
VEmptyView(20),
Image.asset(
"assets/yd_logo.png",
width: ScreenUtil().setWidth(233 * 2),
height: ScreenUtil().setHeight(51 * 2),
),
VEmptyView(26),
Container(
margin: EdgeInsets.symmetric(
horizontal: ScreenUtil().setWidth(40)),
// padding: EdgeInsets.all(
// ScreenUtil().setWidth(60)),
// decoration: BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.topCenter,
// end: Alignment.bottomCenter,
// colors: [
// MyColours.color_F7F1E8,
// MyColours.color_E3D6C7,
// ],
// ),
// borderRadius: BorderRadius.circular(
// ScreenUtil().setWidth(10))),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
// color: Colors.red,
width: ScreenUtil().setWidth(335 * 2),
height: ScreenUtil().setWidth(200 * 2),
// decoration: BoxDecoration(
// image: DecorationImage(
// alignment:
// Alignment.topCenter,
// image: AssetImage(
// "assets/yd_baiinfo_bg.png"),
// fit: BoxFit.cover),
// ),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(
left: ScreenUtil()
.setWidth(70)),
child: qiniuUrl == ''
? Image.asset(
Utils.getImgPath(
'yd_person'),
width: ScreenUtil()
.setWidth(143 * 2),
height: ScreenUtil()
.setWidth(190 * 2))
: Image.network(qiniuUrl,
width: ScreenUtil()
.setWidth(143 * 2),
height: ScreenUtil()
.setWidth(190 * 2)),
),
HEmptyView(10),
Spacer(),
Container(
padding: EdgeInsets.only(
top: ScreenUtil()
.setWidth(37 * 2)),
// height: ScreenUtil()
// .setWidth(200 * 2),
child: Column(
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.end,
children: [
// VEmptyView(60),
GestureDetector(
behavior: HitTestBehavior
.opaque,
onTap: () {
_goBaseInfoPage();
},
child: Container(
width: ScreenUtil()
.setWidth(120 * 2),
height: ScreenUtil()
.setWidth(42 * 2),
child: Text(
name,
overflow: TextOverflow
.ellipsis,
textAlign:
TextAlign.right,
style: TextStyle(
color: name ==
'填写姓名'
? MyColours
.color_999999
: MyColours
.color_333333,
fontSize:
ScreenUtil()
.setSp(
60)),
),
),
),
// VEmptyView(6),
InkWell(
onTap: () {
_goBaseInfoPage();
},
child: Container(
width: ScreenUtil()
.setWidth(
143 * 2),
120 * 2),
height: ScreenUtil()
.setWidth(190 * 2)),
),
HEmptyView(10),
Spacer(),
Container(
padding: EdgeInsets.only(
top: ScreenUtil()
.setWidth(37 * 2)),
// height: ScreenUtil()
// .setWidth(200 * 2),
child: Column(
mainAxisAlignment:
MainAxisAlignment
.start,
crossAxisAlignment:
CrossAxisAlignment
.end,
children: [
// VEmptyView(60),
GestureDetector(
behavior:
HitTestBehavior
.opaque,
onTap: () {
_goBaseInfoPage();
},
child: Container(
width: ScreenUtil()
.setWidth(
120 * 2),
height: ScreenUtil()
.setWidth(
42 * 2),
child: Text(
name,
overflow:
TextOverflow
.ellipsis,
textAlign:
TextAlign
.right,
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize:
ScreenUtil()
.setSp(
60)),
),
),
),
// VEmptyView(6),
InkWell(
onTap: () {
_goBaseInfoPage();
},
child: Container(
width: ScreenUtil()
.setWidth(
120 * 2),
height:
ScreenUtil()
.setWidth(
22 *
2),
child: Text(
phone,
overflow:
TextOverflow
.ellipsis,
textAlign:
TextAlign
.right,
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize: ScreenUtil()
.setWidth(22 * 2),
child: Text(
phone,
overflow:
TextOverflow
.ellipsis,
textAlign:
TextAlign.right,
style: TextStyle(
color: phone ==
'填写电话'
? MyColours
.color_999999
: MyColours
.color_333333,
fontSize:
ScreenUtil()
.setSp(
32)),
),
)),
// VEmptyView(6),
InkWell(
onTap: () {
_goBaseInfoPage();
},
child: Container(
width: ScreenUtil()
.setWidth(
120 * 2),
height:
ScreenUtil()
.setWidth(
24 *
2),
child: Text(
position,
overflow:
TextOverflow
.ellipsis,
textAlign:
TextAlign
.right,
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize: ScreenUtil()
),
)),
// VEmptyView(6),
InkWell(
onTap: () {
_goBaseInfoPage();
},
child: Container(
width: ScreenUtil()
.setWidth(
120 * 2),
height: ScreenUtil()
.setWidth(24 * 2),
child: Text(
position,
overflow:
TextOverflow
.ellipsis,
textAlign:
TextAlign.right,
style: TextStyle(
color: position == '填写职位'
? MyColours
.color_999999
: MyColours
.color_333333,
fontSize:
ScreenUtil()
.setSp(
34)),
),
)),
),
)),
RoundButton(
// width: ScreenUtil().setWidth(95),
height: ScreenUtil()
.setWidth(60 * 2),
image:
Utils.getImgPath(
'yd_edit_new'),
imgWidth: 24,
radius: 0,
space: ScreenUtil()
.setWidth(20),
text: '编辑',
textColor: MyColours
.color_BA9953,
isBold: false,
fontSize: 28,
gradientStart: Colors
.transparent,
gradientEnd: Colors
.transparent,
onPressed: () {
_goBaseInfoPage();
},
)
],
)),
HEmptyView(60),
],
)),
// Positioned(
// bottom: 0,
// child: Container(
// color: MyColours.color_EEDBC4,
// width: double.infinity,
// height:
// ScreenUtil().setWidth(40),
// ))
// ],
// ),
// Container(
// color: MyColours.color_EEDBC4,
// width: double.infinity,
// height: ScreenUtil().setWidth(40),
// ),
VEmptyView(76),
// Image.asset(
// "assets/yd_up.png",
// width: ScreenUtil().setWidth(195 * 2),
// height:
// ScreenUtil().setHeight(33 * 2),
// ),
// VEmptyView(50),
RoundButton(
// width: ScreenUtil().setWidth(95),
height: ScreenUtil()
.setWidth(60 * 2),
image: Utils.getImgPath(
'yd_bianji'),
imgWidth: 24,
radius: 0,
space: ScreenUtil()
.setWidth(20),
text: '编辑',
textColor: MyColours
.color_199095,
isBold: false,
fontSize: 28,
gradientStart:
Colors.transparent,
gradientEnd:
Colors.transparent,
onPressed: () {
_goBaseInfoPage();
},
)
],
)),
HEmptyView(60),
],
)),
// Positioned(
// bottom: 0,
// child: Container(
// color: MyColours.color_EEDBC4,
// width: double.infinity,
// height:
// ScreenUtil().setWidth(40),
// ))
// ],
// ),
// Container(
// color: MyColours.color_EEDBC4,
// width: double.infinity,
// height: ScreenUtil().setWidth(40),
// ),
VEmptyView(76),
// Image.asset(
// "assets/yd_up.png",
// width: ScreenUtil().setWidth(195 * 2),
// height:
// ScreenUtil().setHeight(33 * 2),
// ),
// VEmptyView(50),
RepaintBoundary(
key: globalKey,
child: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(40)),
// color: Colors.red,
child: Column(
children: [
Container(
height:
ScreenUtil().setWidth(58),
child: Text(
user.sellername,
style: TextStyle(
// letterSpacing: ScreenUtil()
// .setWidth(2.13 * 2),
color: MyColours
.color_BA9953,
// fontWeight: FontWeight.bold,
fontSize: ScreenUtil()
.setSp(42)),
),
),
VEmptyView(14),
Container(
height:
ScreenUtil().setWidth(58),
child: Text(
'${dateTimeStr}',
style: TextStyle(
letterSpacing:
ScreenUtil()
.setWidth(
1.8 * 2),
color: MyColours
.color_BA9953,
fontSize: ScreenUtil()
.setSp(42)),
),
),
VEmptyView(26),
Container(
height:
ScreenUtil().setWidth(44),
child: Text(
'已为您安排在包间',
style: TextStyle(
color: MyColours
.color_ffffff,
fontSize: ScreenUtil()
.setSp(32)),
),
),
VEmptyView(28),
GestureDetector(
onTapDown: (TapDownDetails
details) =>
onTapDown(
context, details),
child: Container(
child: Stack(
alignment: Alignment
.bottomCenter,
overflow:
Overflow.visible,
children: [
Container(
margin: EdgeInsets.only(
bottom:
ScreenUtil()
.setWidth(
24)),
constraints: BoxConstraints(
maxWidth:
ScreenUtil()
.setWidth(
195 *
2)),
padding: EdgeInsets
.fromLTRB(
ScreenUtil()
.setWidth(
60),
ScreenUtil()
.setWidth(
30),
ScreenUtil()
.setWidth(
60),
RepaintBoundary(
key: globalKey,
child: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(10),
ScreenUtil().setWidth(40)),
// color: Colors.red,
child: Column(
children: [
Container(
height: ScreenUtil().setWidth(58),
child: Text(
user.sellername,
style: TextStyle(
// letterSpacing: ScreenUtil()
// .setWidth(2.13 * 2),
color:
MyColours.color_333333,
// fontWeight: FontWeight.bold,
fontSize:
ScreenUtil().setSp(42)),
),
),
VEmptyView(14),
Container(
height: ScreenUtil().setWidth(58),
child: Text(
'${dateTimeStr}',
style: TextStyle(
letterSpacing: ScreenUtil()
.setWidth(1.8 * 2),
color:
MyColours.color_333333,
fontSize:
ScreenUtil().setSp(42)),
),
),
VEmptyView(26),
Container(
height: ScreenUtil().setWidth(44),
child: Text(
'已为您安排在包间',
style: TextStyle(
color:
MyColours.color_666666,
fontSize:
ScreenUtil().setSp(32)),
),
),
VEmptyView(28),
GestureDetector(
onTapDown: (TapDownDetails
details) =>
onTapDown(context, details),
child: Container(
child: Stack(
alignment:
Alignment.bottomCenter,
overflow: Overflow.visible,
children: [
Container(
margin: EdgeInsets.only(
bottom: ScreenUtil()
.setWidth(24)),
constraints: BoxConstraints(
maxWidth: ScreenUtil()
.setWidth(
195 * 2)),
padding:
EdgeInsets.fromLTRB(
ScreenUtil()
.setWidth(60),
ScreenUtil()
.setWidth(30),
ScreenUtil()
.setWidth(60),
ScreenUtil()
.setWidth(
24 * 2)),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(
ScreenUtil()
.setWidth(
24 *
2)),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(
ScreenUtil()
.setWidth(13 *
13 *
2))),
border: Border.all(
color: MyColours
.color_BA9953,
width: ScreenUtil()
border: Border.all(
color: MyColours
.color_199095,
width:
ScreenUtil()
.setWidth(
4))),
child: Text(
widget.tableInfo
.replaceAll(
"\n", ""),
style: TextStyle(
// letterSpacing: ScreenUtil()
// .setWidth(2.13 * 2),
color: MyColours
.color_BA9953,
fontWeight:
FontWeight
.bold,
fontSize:
ScreenUtil()
.setSp(
52)),
),
),
Positioned(
key: key,
bottom: 0,
child: _baseIndoProvider
.photoList
.length >
0
? RoundButton(
onPressed:
() {
_seePhoto();
},
text: '浏览照片',
width: ScreenUtil()
.setWidth(
68 *
2),
height: ScreenUtil()
child: Text(
widget.tableInfo
.replaceAll(
"\n", ""),
style: TextStyle(
// letterSpacing: ScreenUtil()
// .setWidth(2.13 * 2),
color: MyColours
.color_333333,
fontWeight:
FontWeight.bold,
fontSize:
ScreenUtil()
.setSp(52)),
),
),
Positioned(
key: key,
bottom: 0,
child: _baseIndoProvider
.photoList
.length >
0
? RoundButton(
onPressed: () {
_seePhoto();
},
text: '浏览照片',
width: ScreenUtil()
.setWidth(
68 * 2),
height:
ScreenUtil()
.setWidth(
24 *
2),
fontSize: 26,
textColor:
MyColours
.color_333333,
isBold: false,
gradientStart:
MyColours
.color_BA9953,
gradientEnd:
MyColours
.color_BA9953,
)
: Container(),
)
],
))),
],
),
),
fontSize: 26,
textColor: MyColours
.color_ffffff,
isBold: false,
gradientStart:
MyColours
.color_199095,
gradientEnd: MyColours
.color_199095,
)
: Container(),
)
],
))),
],
),
VEmptyView(30),
Container(
// height: ScreenUtil().setWidth(40),
child: Text(
'${user.sellerAddr}',
maxLines: 3,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: TextStyle(
color: MyColours.color_BA9953,
fontSize:
ScreenUtil().setSp(28)),
),
),
// VEmptyView(20),
// RoundButton(
// text: '一键导航',
// width: ScreenUtil().setWidth(68 * 2),
// height: ScreenUtil().setWidth(24 * 2),
// fontSize: 24,
// textColor: MyColours.color_794F28,
// isBold: false,
// gradientStart:
// Color.fromRGBO(121, 79, 40, 0.1),
// gradientEnd:
// Color.fromRGBO(121, 79, 40, 0.1),
// ),
// VEmptyView(50),
// Image.asset(
// "assets/yd_down.png",
// width: ScreenUtil().setWidth(195 * 2),
// height:
// ScreenUtil().setHeight(33 * 2),
// ),
// VEmptyView(60),
],
),
),
)
],
),
),
VEmptyView(couponHeight),
])),
Container(
width: double.infinity,
height: ScreenUtil().setHeight(99),
child: Row(
children: <Widget>[
GestureDetector(
onTap: () async {
if (widget.phone.isEmpty) {
Utils.showToast("没有预订人电话信息");
return;
}
if (!couponProvider.sendSMS) {
Map<String, String> params = {
"id": widget.rid,
"uid": Provider.of<UserModel>(context,
listen: false)
.user
.openid,
"phone": widget.phone,
"Strtext": user.sellername +
_baseIndoProvider.baseInfoSunModel.name
};
bool success = await couponProvider
.sendSMSWxSendSms(context, params);
print(success);
if (success) {
Utils.showToast('短信已经发送成功!');
} else {
Utils.showToast('发送次数太频繁!');
}
} else {
Utils.showToast('短信已经发送成功!');
}
// NavigatorUtil.goSmsPage(context, widget.rid);
},
child: Container(
width: ScreenUtil().setWidth(135 * 2),
height: double.infinity,
alignment: Alignment.center,
decoration: BoxDecoration(
color: MyColours.color_262628,
border: Border(
top: BorderSide(
width: ScreenUtil().setWidth(1),
color: MyColours.color_ECD9B7))),
child: Text(
"发短信",
style: TextStyle(
color: MyColours.color_ECD9B7,
fontSize: ScreenUtil().setSp(28)),
VEmptyView(30),
Container(
// height: ScreenUtil().setWidth(40),
child: Text(
'${user.sellerAddr}',
maxLines: 3,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center,
style: TextStyle(
color: MyColours.color_333333,
fontSize: ScreenUtil().setSp(28)),
),
),
// VEmptyView(20),
// RoundButton(
// text: '一键导航',
// width: ScreenUtil().setWidth(68 * 2),
// height: ScreenUtil().setWidth(24 * 2),
// fontSize: 24,
// textColor: MyColours.color_794F28,
// isBold: false,
// gradientStart:
// Color.fromRGBO(121, 79, 40, 0.1),
// gradientEnd:
// Color.fromRGBO(121, 79, 40, 0.1),
// ),
// VEmptyView(50),
// Image.asset(
// "assets/yd_down.png",
// width: ScreenUtil().setWidth(195 * 2),
// height:
// ScreenUtil().setHeight(33 * 2),
// ),
// VEmptyView(60),
],
),
),
),
Expanded(
child: GestureDetector(
onTap: () async {
// Uint8List image = await _getImage();
)
],
),
),
VEmptyView(couponHeight),
])),
Padding(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(70),
ScreenUtil().setWidth(20),
ScreenUtil().setWidth(70),
ScreenUtil().setWidth(40)),
child: Column(children: [
RoundButton(
text: '通知客户',
width: double.infinity,
height: ScreenUtil().setWidth(84),
gradientStart: MyColours.color_199095,
gradientEnd: MyColours.color_199095,
textColor: MyColours.color_ffffff,
fontSize: 34,
radius: ScreenUtil().setWidth(10),
isBold: false,
onPressed: () async {
// Uint8List image = await _getImage();
if (ObjectUtil.isEmpty(
_baseIndoProvider.baseInfoSunModel)) {
Utils.showToast('请输入个人资料');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.name)) {
Utils.showToast('请填写您的姓名');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.phone)) {
Utils.showToast('请填写您的联系电话');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.position)) {
Utils.showToast('请填写您在餐厅中的职位');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.phone)) {
Utils.showToast('请上传您的头像');
return;
}
if (ObjectUtil.isEmpty(_baseIndoProvider
.baseInfoSunModel.qrcode)) {
Utils.showToast('请上传您的微信二维码');
return;
}
if (!couponProvider.hasModify &&
couponProvider.coupons.length > 0) {
Map<String, String> params = {
"rid": widget.rid,
"aid": Utils.listToStringEnglish(
couponProvider.coupons)
};
bool isSuc = await couponProvider
.setActivityAsReserve(context, params);
if (isSuc) {
couponProvider.hasModify = true;
if (ObjectUtil.isEmpty(
_baseIndoProvider.baseInfoSunModel)) {
Utils.showToast('请输入个人资料');
return;
}
if (ObjectUtil.isEmpty(
_baseIndoProvider.baseInfoSunModel.name)) {
Utils.showToast('请填写您的姓名');
return;
}
if (ObjectUtil.isEmpty(
_baseIndoProvider.baseInfoSunModel.phone)) {
Utils.showToast('请填写您的联系电话');
return;
}
if (ObjectUtil.isEmpty(
_baseIndoProvider.baseInfoSunModel.position)) {
Utils.showToast('请填写您在餐厅中的职位');
return;
}
if (ObjectUtil.isEmpty(
_baseIndoProvider.baseInfoSunModel.phone)) {
Utils.showToast('请上传您的头像');
return;
}
if (ObjectUtil.isEmpty(
_baseIndoProvider.baseInfoSunModel.qrcode)) {
Utils.showToast('请上传您的微信二维码');
return;
}
if (!couponProvider.hasModify &&
couponProvider.coupons.length > 0) {
Map<String, String> params = {
"rid": widget.rid,
"aid": Utils.listToStringEnglish(
couponProvider.coupons)
};
bool isSuc = await couponProvider
.setActivityAsReserve(context, params);
if (isSuc) {
couponProvider.hasModify = true;
bool isSuccess =
await Utils.goShareInvicationToWeChat(
widget.rid,
Provider.of<UserModel>(context,
listen: false)
.user
.openid);
print(isSuccess);
// couponProvider.couponsShow = [];
// couponProvider.couponsShow
// .addAll(couponProvider.coupons);
// couponProvider.coupons = [];
// couponProvider.notifyListeners();
}
} else {
bool isSuccess =
await Utils.goShareInvicationToWeChat(
widget.rid,
Provider.of<UserModel>(context,
listen: false)
.user
.openid);
print(isSuccess);
}
},
child: Container(
width: double.infinity,
height: double.infinity,
color: MyColours.color_ECD9B7,
alignment: Alignment.center,
child: Text(
"通知客户",
style: TextStyle(
color: MyColours.color_7B512A,
fontSize: ScreenUtil().setSp(30)),
),
),
),
)
],
bool isSuccess =
await Utils.goShareInvicationToWeChat(
widget.rid,
Provider.of<UserModel>(context,
listen: false)
.user
.openid);
print(isSuccess);
// couponProvider.couponsShow = [];
// couponProvider.couponsShow
// .addAll(couponProvider.coupons);
// couponProvider.coupons = [];
// couponProvider.notifyListeners();
}
} else {
bool isSuccess =
await Utils.goShareInvicationToWeChat(
widget.rid,
Provider.of<UserModel>(context,
listen: false)
.user
.openid);
print(isSuccess);
}
},
),
)
])),
Positioned(
left: ScreenUtil().setWidth(0),
top: ScreenUtil().setWidth(0),
child: SafeArea(
child: GestureDetector(
onTap: () {
Navigator.of(context).pop();
},
behavior: HitTestBehavior.opaque,
child: Container(
padding: EdgeInsets.fromLTRB(
ScreenUtil().setWidth(40),
ScreenUtil().setWidth(28),
ScreenUtil().setWidth(200),
ScreenUtil().setWidth(100),
VEmptyView(20),
RoundButton(
text: '发短信',
width: double.infinity,
height: ScreenUtil().setWidth(84),
gradientStart: MyColours.color_ffffff,
gradientEnd: MyColours.color_ffffff,
textColor: MyColours.color_199095,
borderColor: MyColours.color_199095,
fontSize: 34,
radius: ScreenUtil().setWidth(10),
isBold: false,
onPressed: () async {
if (widget.phone.isEmpty) {
Utils.showToast("没有预订人电话信息");
return;
}
if (!couponProvider.sendSMS) {
Map<String, String> params = {
"id": widget.rid,
"uid": Provider.of<UserModel>(context,
listen: false)
.user
.openid,
"phone": widget.phone,
"Strtext": user.sellername +
_baseIndoProvider.baseInfoSunModel.name
};
bool success = await couponProvider
.sendSMSWxSendSms(context, params);
print(success);
if (success) {
Utils.showToast('短信已经发送成功!');
} else {
Utils.showToast('发送次数太频繁!');
}
} else {
Utils.showToast('短信已经发送成功!');
}
// NavigatorUtil.goSmsPage(context, widget.rid);
},
),
alignment: Alignment.centerLeft,
child: Image.asset(
"assets/back_white.png",
width: ScreenUtil().setWidth(20),
height: ScreenUtil().setHeight(31),
)),
)),
),
])),
]),
Positioned(
// left: ScreenUtil().setWidth(180),
bottom: ScreenUtil().setWidth(110),
right: ScreenUtil().setWidth(40),
bottom: ScreenUtil().setWidth(124 * 2),
right: ScreenUtil().setWidth(52 * 2),
child: couponProvider.hasModify ||
couponProvider.coupons.length > 0 ||
couponProvider.couponListSelect.length > 0
... ... @@ -931,7 +864,7 @@ class InvicationPageState extends State<InvicationPage> {
vertical: ScreenUtil().setWidth(16)),
height: ScreenUtil().setWidth(35 * 2),
decoration: BoxDecoration(
color: MyColours.color_000000,
color: Color.fromRGBO(0, 0, 0, 0.5),
borderRadius: BorderRadius.circular(
ScreenUtil().setWidth(20))),
child: Row(
... ...
... ... @@ -40,6 +40,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
controller = ScrollController(initialScrollOffset: 0.0);
WidgetsBinding.instance.addObserver(this);
Utils.changeStatusColor(color: MyColours.color_199095);
Utils.getCurrVersion().then((version) {
setState(() {
cur_version = "v" + version;
... ... @@ -53,7 +54,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver {
///获取积分
});
EventBus().on('changeStatusColor', (arg) {
Utils.changeStatusColor(color: Colors.transparent);
Utils.changeStatusColor(color: MyColours.color_199095);
});
}
... ...
... ... @@ -36,7 +36,7 @@ class NoteBookPageState extends State<NoteBookPage> {
String noon; //午市时间段
String night; //晚市时间段
DateTime dateTime; //当前日期
DateTime dateTimeNow; //当前日期
UserModel userModel;
... ... @@ -70,11 +70,11 @@ class NoteBookPageState extends State<NoteBookPage> {
//初始化时间
_initTime() {
dateTime = DateTime.now();
dateText = "${dateTime.year}年 " +
Utils.addZeroNumber(dateTime.month) +
dateTimeNow = DateTime.now();
dateText = "${dateTimeNow.year}年 " +
Utils.addZeroNumber(dateTimeNow.month) +
"月" +
Utils.addZeroNumber(dateTime.day) +
Utils.addZeroNumber(dateTimeNow.day) +
"日" +
" 今天";
morning =
... ... @@ -82,49 +82,49 @@ class NoteBookPageState extends State<NoteBookPage> {
noon = userModel.user.noon.isEmpty ? "00:00-00:00" : userModel.user.noon;
night = userModel.user.night.isEmpty ? "00:00-00:00" : userModel.user.night;
if (morning != '' &&
dateTime.isBefore(DateTime.parse(dateTime.year.toString() +
dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
Utils.addZeroNumber(dateTimeNow.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
Utils.addZeroNumber(dateTimeNow.day) +
" " +
morning.split("-")[1] +
":00"))) {
//未过早市
currTimeIndex = 1;
} else if (noon != '' &&
dateTime.isAfter(DateTime.parse(dateTime.year.toString() +
dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
Utils.addZeroNumber(dateTimeNow.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
Utils.addZeroNumber(dateTimeNow.day) +
" " +
morning.split("-")[1] +
":00")) &&
dateTime.isBefore(DateTime.parse(dateTime.year.toString() +
dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
Utils.addZeroNumber(dateTimeNow.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
Utils.addZeroNumber(dateTimeNow.day) +
" " +
noon.split("-")[1] +
":00"))) {
//过了早市,未过午市
currTimeIndex = 2;
} else if (night != '' &&
dateTime.isAfter(DateTime.parse(dateTime.year.toString() +
dateTimeNow.isAfter(DateTime.parse(dateTimeNow.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
Utils.addZeroNumber(dateTimeNow.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
Utils.addZeroNumber(dateTimeNow.day) +
" " +
noon.split("-")[1] +
":00")) &&
dateTime.isBefore(DateTime.parse(dateTime.year.toString() +
dateTimeNow.isBefore(DateTime.parse(dateTimeNow.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
Utils.addZeroNumber(dateTimeNow.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
Utils.addZeroNumber(dateTimeNow.day) +
" " +
night.split("-")[1] +
":00"))) {
... ... @@ -157,20 +157,20 @@ class NoteBookPageState extends State<NoteBookPage> {
//获取一天开始-结束时间字符串
String _getRdate() {
//一天开始时间
double startDay = (DateTime.parse((dateTime.year.toString() +
double startDay = (DateTime.parse((dateTimeNow.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
Utils.addZeroNumber(dateTimeNow.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
Utils.addZeroNumber(dateTimeNow.day) +
" 00:00:00"))
.millisecondsSinceEpoch) /
1000;
//一天结束时间
double endDay = (DateTime.parse((dateTime.year.toString() +
double endDay = (DateTime.parse((dateTimeNow.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
Utils.addZeroNumber(dateTimeNow.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
Utils.addZeroNumber(dateTimeNow.day) +
" 23:59:59"))
.millisecondsSinceEpoch) /
1000;
... ... @@ -182,13 +182,13 @@ class NoteBookPageState extends State<NoteBookPage> {
NoteBookModel model = Provider.of<NoteBookModel>(context, listen: false);
Map<String, String> params = {
"sid": userModel.user.sellerid,
"day": dateTime.year.toString() +
(dateTime.month < 10
? "0" + dateTime.month.toString()
: dateTime.month.toString()) +
(dateTime.day < 10
? "0" + dateTime.day.toString()
: dateTime.day.toString())
"day": dateTimeNow.year.toString() +
(dateTimeNow.month < 10
? "0" + dateTimeNow.month.toString()
: dateTimeNow.month.toString()) +
(dateTimeNow.day < 10
? "0" + dateTimeNow.day.toString()
: dateTimeNow.day.toString())
};
if (tabIndex == 1) {
params["account"] = userModel.user.account;
... ... @@ -266,7 +266,7 @@ class NoteBookPageState extends State<NoteBookPage> {
//生成日期文本
_createDateText(DateTime day) {
if (Utils.isOneDay(day, dateTime)) return; //日期没变
if (Utils.isOneDay(day, dateTimeNow)) return; //日期没变
setState(() {
DateTime dateNow = DateTime.now();
dateText = "${day.year}年 " +
... ... @@ -283,7 +283,7 @@ class NoteBookPageState extends State<NoteBookPage> {
} else {
dateText += " 周${Utils.formatWeekDayNum(day.weekday)}";
}
dateTime = day;
dateTimeNow = day;
});
_getReserveList();
_reserveCountDay();
... ... @@ -422,7 +422,7 @@ class NoteBookPageState extends State<NoteBookPage> {
child: Center(
child: GestureDetector(
onTap: () {
DialogUtil.showCalendarDialog(context, dateTime)
DialogUtil.showCalendarDialog(context, dateTimeNow)
.then((day) {
if (day != null) {
_createDateText(day);
... ...
... ... @@ -85,6 +85,10 @@ class SelectTablePageState extends State<SelectTablePage> {
}
}
}
if (tableOuterList.length == 0) {
_chooseTableModel.pageState = PageState.Empty;
_chooseTableModel.notifyListeners();
}
if (_chooseTableModel.pageState == PageState.Success) {
_getReserveList(userModel.user.sellerid);
}
... ... @@ -195,7 +199,7 @@ class SelectTablePageState extends State<SelectTablePage> {
callback: () {
getTableList();
},
emptyMsg: "暂时没有预订哦",
emptyMsg: "暂时没有桌位哦",
emptyImg: "empty_search",
showMsg: "加载中,请稍后...",
);
... ...
... ... @@ -2,6 +2,8 @@ import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:one_key/app.dart';
import 'package:one_key/constant/constant.dart';
import 'package:one_key/constant/error.dart';
import 'package:one_key/models/notebook.dart';
import 'package:one_key/models/notebook_detail.dart';
import 'package:one_key/models/reserve_info_model.dart';
import 'package:one_key/models/seller_info.dart';
... ... @@ -11,12 +13,13 @@ 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/provider/notebook_detail_model.dart';
import 'package:one_key/provider/notebook_model.dart';
import 'package:one_key/provider/user_model.dart';
import 'package:one_key/utils/utils.dart';
import 'package:provider/provider.dart';
class HomeEnterModel with ChangeNotifier {
List dateList = []; //日期选择 月-日 某天
// List dateList = []; //日期选择 月-日 某天
List sunDateList = []; // 早市、午市、晚市
List personNumList = []; // 人数
TextEditingController numController = TextEditingController(); //人数
... ... @@ -34,12 +37,11 @@ class HomeEnterModel with ChangeNotifier {
String isSetDate = '0';
List<TableList> recommendList = []; //推荐列表
bool isRecommend = false; //是否展示推荐
List oldTableList = [];
List<UserHistoryEntity> userHistorys = []; //历史录入
clearData() {
dateList = []; //日期选择 月-日 某天
// dateList = []; //日期选择 月-日 某天
sunDateList = []; // 早市、午市、晚市
personNumList = []; // 人数
numController = TextEditingController(); //人数
... ... @@ -55,47 +57,47 @@ class HomeEnterModel with ChangeNotifier {
//构造函数,初始化
HomeEnterModel() {
_initDateList();
// _initDateList();
_initPersonNumList();
initSexList();
}
///初始化 日期选择 月-日 某天
_initDateList() {
//今天
DateTime dateTime = DateTime.now();
int dateTimeMill = dateTime.millisecondsSinceEpoch;
String dateText = DateUtil.formatDateMs(dateTimeMill, format: 'yyyy-MM-dd');
dateList.add({
'title': dateText,
'select': false,
'fontSize': 34.0,
'dayText': ' 今天',
'isImage': false
});
//明天
int tomorrowMill = dateTimeMill + 24 * 60 * 60 * 1000;
String dateTextTomorrow =
DateUtil.formatDateMs(tomorrowMill, format: 'yyyy-MM-dd');
dateList.add({
'title': dateTextTomorrow,
'select': false,
'fontSize': 34.0,
'dayText': ' 明天',
'isImage': false
});
//第三个
dateList.add({
'title': '其他',
'select': false,
'fontSize': 30.0,
'dayText': '',
'isImage': true
});
}
// ///初始化 日期选择 月-日 某天
// _initDateList() {
// //今天
// DateTime dateTime = DateTime.now();
// int dateTimeMill = dateTime.millisecondsSinceEpoch;
// String dateText = DateUtil.formatDateMs(dateTimeMill, format: 'yyyy-MM-dd');
// dateList.add({
// 'title': dateText,
// 'select': false,
// 'fontSize': 34.0,
// 'dayText': ' 今天',
// 'isImage': false
// });
// //明天
// int tomorrowMill = dateTimeMill + 24 * 60 * 60 * 1000;
// String dateTextTomorrow =
// DateUtil.formatDateMs(tomorrowMill, format: 'yyyy-MM-dd');
// dateList.add({
// 'title': dateTextTomorrow,
// 'select': false,
// 'fontSize': 34.0,
// 'dayText': ' 明天',
// 'isImage': false
// });
// //第三个
// dateList.add({
// 'title': '其他',
// 'select': false,
// 'fontSize': 30.0,
// 'dayText': '',
// 'isImage': true
// });
// }
/// 初始化 早市、午市、晚市
_initSunDateList(morning, noon, night, ddateSolt) {
_initSunDateList(morning, noon, night, ddateSolt, dateText) {
if (morning != '') {
sunDateList.add({
'dateText': '早餐',
... ... @@ -123,7 +125,7 @@ class HomeEnterModel with ChangeNotifier {
'isSelect': ddateSolt == 3 ? true : false
});
}
initHourAndMinuteSelect();
initHourAndMinuteSelect(dateText);
notifyListeners();
}
... ... @@ -162,7 +164,8 @@ class HomeEnterModel with ChangeNotifier {
}
/// 早市、午市、晚市对应的半个小时间隔时间段
initDateHourMinuteList(BuildContext context, int index) async {
initDateHourMinuteList(
BuildContext context, int index, String dateText) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
userModel.user.morning == ''
? dailyMap.putIfAbsent('morning', () => '')
... ... @@ -177,7 +180,7 @@ class HomeEnterModel with ChangeNotifier {
: dailyMap.putIfAbsent(
'night', () => _getHourAndMinute(userModel.user.night, 3));
_initSunDateList(userModel.user.morning, userModel.user.noon,
userModel.user.night, index);
userModel.user.night, index, dateText);
}
//根据获取时间 11:00-12:30 获取30分钟间隔组装的数组
... ... @@ -244,16 +247,16 @@ class HomeEnterModel with ChangeNotifier {
}
//初始化早市午市晚市选中时间
initHourAndMinuteSelect() {
initHourAndMinuteSelect(String ymyStr) {
int timeMillsNow = DateTime.now().millisecondsSinceEpoch;
//当前选中 年-月-日
String ymyStr = "";
//今天 明天 其他天
for (var item in dateList) {
if (item['select'] == true) {
ymyStr = item['title'];
}
}
// //今天 明天 其他天
// for (var item in dateList) {
// if (item['select'] == true) {
// ymyStr = item['title'];
// }
// }
String timeStr = ymyStr + ' 00:00:00';
LogUtil.v(timeStr);
DateTime dateTime = DateUtil.getDateTime(timeStr); //当前年月日
... ... @@ -373,13 +376,106 @@ class HomeEnterModel with ChangeNotifier {
}
}
//获取已预订订单
Future<List<Notebook>> newGetReserveList(
BuildContext context, Map<String, String> params) async {
List<Notebook> notebooks = [];
BaseResp<List> baseResp = await DioUtil()
.request<List>(context, Method.get, HttpUrl.get_reserve_list,
data: params, showLoading: false)
.catchError((error) {
print(error.toString());
if (error is MyError) {
// switch (error.type) {
// case 1:
// pageState = PageState.ConnectivityError;
// break;
// case 2:
// pageState = PageState.ConnectivityTimeOut;
// break;
// default:
// pageState = PageState.ConnectivityError;
// break;
// }
}
});
if (baseResp == null) return [];
if (baseResp.code == Constant.status_success) {
notebooks = baseResp.data.map<Notebook>((value) {
return Notebook.fromJson(value);
}).toList();
} else {
Utils.showToast(baseResp.msg ?? "");
}
return notebooks;
}
//获取一天开始-结束时间字符串
String _getRdate(DateTime dateTime) {
//一天开始时间
double startDay = (DateTime.parse((dateTime.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
" 00:00:00"))
.millisecondsSinceEpoch) /
1000;
//一天结束时间
double endDay = (DateTime.parse((dateTime.year.toString() +
"-" +
Utils.addZeroNumber(dateTime.month) +
"-" +
Utils.addZeroNumber(dateTime.day) +
" 23:59:59"))
.millisecondsSinceEpoch) /
1000;
return startDay.floor().toString() + "-" + endDay.floor().toString();
}
//获取已预订列表
getReserveList(BuildContext context,
{DateTime dateTime, String currTimeIndex}) async {
Map<String, Notebook> tableMap = {};
NoteBookModel model = new NoteBookModel();
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
"sid": userModel.user.sellerid,
"rdate": _getRdate(dateTime),
"ddate_solt": currTimeIndex,
"y": "200",
"x": "1",
"keywords": "",
"sort": "1"
};
List<Notebook> noteBooks = await newGetReserveList(context, params);
for (Notebook notebook in noteBooks) {
if (notebook.tid.isEmpty) continue;
if (notebook.status == "1" ||
notebook.status == "2" ||
notebook.status == "5") {
//已预订,用餐中,已安排
List<String> tids = notebook.tid.split(",");
for (String tid in tids) {
tableMap['$tid'] = notebook;
// tableMap.add('$tid');
}
}
}
return tableMap;
}
///根据商家ID 获取桌位信息列表: 1:散座 2:包间 默认:获取所有数据
Future<List<TableList>> getNewTableList(BuildContext context, String ddate,
String ddate_solt, String pnum, List oldTableList) async {
String ddate_solt, String pnum) async {
DateTime createTime = DateTime.fromMillisecondsSinceEpoch(int.parse(ddate));
Map<String, Notebook> tableMap = await getReserveList(context,
dateTime: createTime, currTimeIndex: ddate_solt);
if (pnum == '') {
pnum = '6';
}
DateTime createTime = DateTime.fromMillisecondsSinceEpoch(int.parse(ddate));
String rdate = DateUtil.formatDate(createTime, format: "yyyyMMdd");
UserModel userModel = Provider.of<UserModel>(context, listen: false);
Map<String, String> params = {
... ... @@ -408,7 +504,7 @@ class HomeEnterModel with ChangeNotifier {
Utils.showToast(baseResp.msg ?? "");
}
tableList = [];
recommendList = [];
for (int i = 0; i < itemModelList.length; i++) {
if (itemModelList[i].name == "推荐") {
recommendList = itemModelList[i].list;
... ... @@ -420,8 +516,8 @@ class HomeEnterModel with ChangeNotifier {
itemModelList.remove(item);
}
for (var item in item.list) {
for (var table in oldTableList) {
if (item.id == table.id) {
for (var table in tableMap.values) {
if (item.id == table.tid) {
item.selected = true;
if (!tableList.contains(item)) {
tableList.add(item);
... ... @@ -430,48 +526,25 @@ class HomeEnterModel with ChangeNotifier {
}
}
}
// List usedTableList = []; //被占用的包间
// for (var itemOld in oldTableList) {
// if (tableList.length == 0) {
// usedTableList = oldTableList;
// } else {
// for (var item in tableList) {
// if (item.id != itemOld.id) {
// usedTableList.add(item);
// }
// }
// }
// }
List idold = [];
for (var itemOld in oldTableList) {
idold.add(itemOld.id);
}
List idnew = [];
for (var item in tableList) {
idnew.add(item.id);
}
for (var item in idnew) {
idold.remove(item);
}
print(idold); //被占用的桌子的id
if (idold.length > 0) {
String msg = '';
for (var item in oldTableList) {
if (idold.contains(item.id)) {
msg += '${item.name},';
}
}
if (msg.endsWith(',')) {
msg = msg.substring(0, msg.length - 1);
}
Utils.showToast('${msg}已被占用啦');
}
// if (usedTableList.length > 0) {
// print(usedTableList);
// List idold = [];
// for (var itemOld in tableMap.values) {
// idold.add(itemOld.tid);
// }
// List idnew = [];
// for (var item in tableList) {
// idnew.add(item.id);
// }
// for (var item in idnew) {
// idold.remove(item);
// }
// print(idold); //被占用的桌子的id
// if (idold.length > 0) {
// String msg = '';
// for (var item in usedTableList) {
// msg += '${item.name},';
// for (var item in tableMap.values) {
// if (idold.contains(item.tid)) {
// msg += '${item.name},';
// }
// }
// if (msg.endsWith(',')) {
// msg = msg.substring(0, msg.length - 1);
... ... @@ -479,51 +552,47 @@ class HomeEnterModel with ChangeNotifier {
// Utils.showToast('${msg}已被占用啦');
// }
// if(usedTableList.length > 0){
// for (TableList item in usedTableList) {
// item
// }
// }
if (tableList.length == 0) {
// Utils.showToast('包间已经被预订');
isRecommend = true;
for (var item in recommendList) {
for (var table in tableMap.values) {
recommendList.removeWhere((element) => item.id == table.tid);
}
}
} else {
isRecommend = false;
}
print(tableList);
print(recommendList);
notifyListeners();
return tableList;
}
}
///录入更改内部预订
Future<SunReserveInfoModel> setReserveInfo(BuildContext context) async {
Future<SunReserveInfoModel> setReserveInfo(BuildContext context,
{String pnum, String dateText, int currTimeIndex}) async {
UserModel userModel = Provider.of<UserModel>(context, listen: false);
String pnum = '6';
for (var item in personNumList) {
if (item['isSelect']) {
pnum = item['dateText'];
}
}
if (pnum == '') {
pnum = '6';
}
String sex = '1';
for (var item in sexList) {
if (item['select']) {
sex = item['code'];
}
}
//当前选中 年-月-日string
String ymyStr = "";
//今天 明天 其他天
for (var item in dateList) {
if (item['select'] == true) {
ymyStr = item['title'];
String tempTime = ddateStr;
if (ddateStr == '') {
if (currTimeIndex == 1) {
tempTime = '08:00';
} else if (currTimeIndex == 2) {
tempTime = '12:00';
} else if (currTimeIndex == 3) {
tempTime = '18:30';
}
}
String timeStr = ymyStr + ' ' + ddateStr + ':00';
String timeStr = dateText + ' ' + tempTime + ':00';
// int start = DateUtil.getDateMsByTimeStr(timeStr);
LogUtil.v(timeStr);
... ... @@ -543,32 +612,30 @@ class HomeEnterModel with ChangeNotifier {
String rdate = '';
String ddateSolt = '';
print(sunDateList);
for (var item in sunDateList) {
if (item['isSelect'] == true) {
String keys = '';
ddateSolt = '${item['ddateSolt']}';
if (item['ddateSolt'] == 1) {
//早市
keys = 'morning';
} else if (item['ddateSolt'] == 2) {
//午市
keys = 'noon';
} else if (item['ddateSolt'] == 3) {
//晚市
keys = 'night';
}
if (keys != '') {
List temp = dailyMap[keys];
String timeStrStart = ymyStr + ' ' + temp.first['title'] + ':00';
String timeStrEnd = ymyStr + ' ' + temp.last['title'] + ':00';
int startM = DateUtil.getDateMsByTimeStr(timeStrStart);
int endM = DateUtil.getDateMsByTimeStr(timeStrEnd);
String start = '${startM}'.substring(0, 10);
String end = '${endM}'.substring(0, 10);
rdate = start + '-' + end;
}
}
String keys = '';
ddateSolt = currTimeIndex.toString();
if (currTimeIndex == 1) {
//早市
keys = 'morning';
} else if (currTimeIndex == 2) {
//午市
keys = 'noon';
} else if (currTimeIndex == 3) {
//晚市
keys = 'night';
}
if (keys != '') {
List temp = dailyMap[keys];
String timeStrStart = dateText + ' ' + temp.first['title'] + ':00';
String timeStrEnd = dateText + ' ' + temp.last['title'] + ':00';
int startM = DateUtil.getDateMsByTimeStr(timeStrStart);
int endM = DateUtil.getDateMsByTimeStr(timeStrEnd);
String start = '${startM}'.substring(0, 10);
String end = '${endM}'.substring(0, 10);
rdate = start + '-' + end;
}
Map<String, String> params = {
"sid": userModel.user.sellerid, //商家ID
"tid": tableSelectInfo, //桌子ID: 格式 2,3,4
... ... @@ -581,7 +648,7 @@ class HomeEnterModel with ChangeNotifier {
'type': "0", //内部预订
"rdate": rdate, //预定用餐时间范围:时间戳 开始时间戳(time)-结束时间戳(time)
"ddate": '${ddate}'.substring(0, 10), //到店时间
'is_set_ddate': "1"
'is_set_ddate': '1'
};
print(params);
... ...
... ... @@ -212,7 +212,6 @@ flutter:
- assets/bg_invication.png
- assets/invication_line_left.png
- assets/invication_line_right.png
- assets/img_ydap.png
- assets/invication_map.png
- assets/invication_arrow_right.png
- assets/invication_back.png
... ...