|
@@ -87,6 +87,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -87,6 +87,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
87
|
SmsInfoData smsInfoData;
|
87
|
SmsInfoData smsInfoData;
|
|
88
|
MyModel myModel;
|
88
|
MyModel myModel;
|
|
89
|
|
89
|
|
|
|
|
90
|
+ String smsErro = '';
|
|
90
|
String showErro = '';
|
91
|
String showErro = '';
|
|
91
|
|
92
|
|
|
92
|
// ScrollController _scrollCrl = ScrollController();
|
93
|
// ScrollController _scrollCrl = ScrollController();
|
|
@@ -121,6 +122,10 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -121,6 +122,10 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
121
|
///刷新图片显示
|
122
|
///刷新图片显示
|
|
122
|
_refreshTablePhoto();
|
123
|
_refreshTablePhoto();
|
|
123
|
});
|
124
|
});
|
|
|
|
125
|
+ EventBus().on("refresh_table_m_coupon", (arg) {
|
|
|
|
126
|
+ ///刷新优惠券
|
|
|
|
127
|
+ _couponNetworkData();
|
|
|
|
128
|
+ });
|
|
124
|
});
|
129
|
});
|
|
125
|
}
|
130
|
}
|
|
126
|
|
131
|
|
|
@@ -130,17 +135,22 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -130,17 +135,22 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
130
|
super.dispose();
|
135
|
super.dispose();
|
|
131
|
EventBus().off("refresh_tablemanager");
|
136
|
EventBus().off("refresh_tablemanager");
|
|
132
|
EventBus().off("refresh_tablePhoto");
|
137
|
EventBus().off("refresh_tablePhoto");
|
|
|
|
138
|
+ EventBus().off("refresh_table_m_coupon");
|
|
133
|
}
|
139
|
}
|
|
134
|
|
140
|
|
|
135
|
///获取短信余量
|
141
|
///获取短信余量
|
|
136
|
_getSmsInfo(context) async {
|
142
|
_getSmsInfo(context) async {
|
|
137
|
smsInfoData = await myModel.getSmsInfo(context);
|
143
|
smsInfoData = await myModel.getSmsInfo(context);
|
|
138
|
- if (myModel.smsInfo.isEmpty) {
|
144
|
+ if (myModel.smsInfo == '0') {
|
|
139
|
setState(() {
|
145
|
setState(() {
|
|
140
|
- showErro = '短信余额不足,请充值短信条数';
|
146
|
+ smsErro = '短信余额不足,请充值短信条数';
|
|
|
|
147
|
+ showErro = smsErro;
|
|
141
|
});
|
148
|
});
|
|
142
|
} else {
|
149
|
} else {
|
|
143
|
- showErro = '';
|
150
|
+ setState(() {
|
|
|
|
151
|
+ smsErro = '';
|
|
|
|
152
|
+ showErro = '';
|
|
|
|
153
|
+ });
|
|
144
|
}
|
154
|
}
|
|
145
|
|
155
|
|
|
146
|
// setState(() {
|
156
|
// setState(() {
|
|
@@ -827,6 +837,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -827,6 +837,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
827
|
if (value != null) {
|
837
|
if (value != null) {
|
|
828
|
sexSelectIndex = value.first;
|
838
|
sexSelectIndex = value.first;
|
|
829
|
sexStr = list[sexSelectIndex];
|
839
|
sexStr = list[sexSelectIndex];
|
|
|
|
840
|
+ if (nameStr != null && nameStr != '') {
|
|
|
|
841
|
+ _addNameSuffix(nameStr, sexStr);
|
|
|
|
842
|
+ }
|
|
830
|
setState(() {});
|
843
|
setState(() {});
|
|
831
|
}
|
844
|
}
|
|
832
|
}, selecteds: [sexSelectIndex])
|
845
|
}, selecteds: [sexSelectIndex])
|
|
@@ -917,6 +930,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -917,6 +930,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
917
|
setState(() {});
|
930
|
setState(() {});
|
|
918
|
}
|
931
|
}
|
|
919
|
},
|
932
|
},
|
|
|
|
933
|
+ title: '人数',
|
|
920
|
selecteds:
|
934
|
selecteds:
|
|
921
|
actualPnumIndex ==
|
935
|
actualPnumIndex ==
|
|
922
|
null
|
936
|
null
|
|
@@ -983,6 +997,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -983,6 +997,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
983
|
setState(() {});
|
997
|
setState(() {});
|
|
984
|
}
|
998
|
}
|
|
985
|
},
|
999
|
},
|
|
|
|
1000
|
+ title: '到店时间',
|
|
986
|
selecteds:
|
1001
|
selecteds:
|
|
987
|
ddateIndex == null
|
1002
|
ddateIndex == null
|
|
988
|
? []
|
1003
|
? []
|
|
@@ -1236,19 +1251,53 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1236,19 +1251,53 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1236
|
color: Colors.transparent),
|
1251
|
color: Colors.transparent),
|
|
1237
|
child: _buttonChoose(youhui, (value) {
|
1252
|
child: _buttonChoose(youhui, (value) {
|
|
1238
|
if (couponsCan == null || couponsCan.length == 0) {
|
1253
|
if (couponsCan == null || couponsCan.length == 0) {
|
|
1239
|
- Utils.showToast('暂无优惠券!');
|
1254
|
+ Utils.showToast('暂无优惠券,请创建新优惠');
|
|
1240
|
return;
|
1255
|
return;
|
|
1241
|
}
|
1256
|
}
|
|
1242
|
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
|
1257
|
FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
|
|
1243
|
- DialogUtil.showSelectCusmanDialog(context, couponsCan,
|
1258
|
+ DialogUtil.showSelectCusmanDialog(
|
|
|
|
1259
|
+ context,
|
|
|
|
1260
|
+ couponsCan,
|
|
1244
|
(value) {
|
1261
|
(value) {
|
|
1245
|
- if (value != null) {
|
|
|
|
1246
|
- setState(() {
|
|
|
|
1247
|
- couponSelectIndex = value.first;
|
|
|
|
1248
|
- youhui = couponsCan[couponSelectIndex];
|
|
|
|
1249
|
- });
|
|
|
|
1250
|
- }
|
|
|
|
1251
|
- },
|
1262
|
+ if (value != null) {
|
|
|
|
1263
|
+ setState(() {
|
|
|
|
1264
|
+ couponSelectIndex = value.first;
|
|
|
|
1265
|
+ youhui = couponsCan[couponSelectIndex];
|
|
|
|
1266
|
+ });
|
|
|
|
1267
|
+ }
|
|
|
|
1268
|
+ },
|
|
|
|
1269
|
+ title: '选择优惠',
|
|
|
|
1270
|
+ cancelText: '新增优惠',
|
|
|
|
1271
|
+ cancelTextColor: MyColours.color_438E93,
|
|
|
|
1272
|
+ onCancel: () async {
|
|
|
|
1273
|
+ UserModel userModel = Provider.of<UserModel>(
|
|
|
|
1274
|
+ context,
|
|
|
|
1275
|
+ listen: false);
|
|
|
|
1276
|
+ if (userModel.user.role_name == '管理员' ||
|
|
|
|
1277
|
+ userModel.user.role_name == '店长') {
|
|
|
|
1278
|
+ NavigatorUtil.goCouponCreateSelectTypePage(
|
|
|
|
1279
|
+ context);
|
|
|
|
1280
|
+ } else {
|
|
|
|
1281
|
+ bool needRefresh =
|
|
|
|
1282
|
+ await NavigatorUtil.goCouponEditPage(
|
|
|
|
1283
|
+ context);
|
|
|
|
1284
|
+ print(needRefresh);
|
|
|
|
1285
|
+ if (needRefresh != null && needRefresh) {
|
|
|
|
1286
|
+ _couponNetworkData();
|
|
|
|
1287
|
+ //刷新页面数据
|
|
|
|
1288
|
+ // _controller.callRefresh();
|
|
|
|
1289
|
+ // _couponNetworkData(tabController.index);
|
|
|
|
1290
|
+ }
|
|
|
|
1291
|
+ }
|
|
|
|
1292
|
+ // NavigatorUtil.goMarketingRecordsDetailPage(context);
|
|
|
|
1293
|
+ // bool needRefresh = await NavigatorUtil.goCouponEditPage(context);
|
|
|
|
1294
|
+ // print(needRefresh);
|
|
|
|
1295
|
+ // if (needRefresh != null && needRefresh) {
|
|
|
|
1296
|
+ // //刷新页面数据
|
|
|
|
1297
|
+ // // _controller.callRefresh();
|
|
|
|
1298
|
+ // _couponNetworkData();
|
|
|
|
1299
|
+ // }
|
|
|
|
1300
|
+ },
|
|
1252
|
selecteds: couponSelectIndex == null
|
1301
|
selecteds: couponSelectIndex == null
|
|
1253
|
? []
|
1302
|
? []
|
|
1254
|
: [couponSelectIndex])
|
1303
|
: [couponSelectIndex])
|
|
@@ -1430,6 +1479,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1430,6 +1479,7 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1430
|
in tableManagerModel.tablesShow) {
|
1479
|
in tableManagerModel.tablesShow) {
|
|
1431
|
if (item.id == table.id) {
|
1480
|
if (item.id == table.id) {
|
|
1432
|
item.selected = false;
|
1481
|
item.selected = false;
|
|
|
|
1482
|
+ setState(() {});
|
|
1433
|
}
|
1483
|
}
|
|
1434
|
}
|
1484
|
}
|
|
1435
|
for (t.Table item
|
1485
|
for (t.Table item
|
|
@@ -1439,9 +1489,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1439,9 +1489,9 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1439
|
.name]) {
|
1489
|
.name]) {
|
|
1440
|
if (item.id == table.id) {
|
1490
|
if (item.id == table.id) {
|
|
1441
|
item.selected = false;
|
1491
|
item.selected = false;
|
|
|
|
1492
|
+ setState(() {});
|
|
1442
|
}
|
1493
|
}
|
|
1443
|
}
|
1494
|
}
|
|
1444
|
- setState(() {});
|
|
|
|
1445
|
},
|
1495
|
},
|
|
1446
|
child: Container(
|
1496
|
child: Container(
|
|
1447
|
// color: Colors.red,
|
1497
|
// color: Colors.red,
|
|
@@ -1674,9 +1724,12 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1674,9 +1724,12 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1674
|
radius: ScreenUtil().setWidth(8),
|
1724
|
radius: ScreenUtil().setWidth(8),
|
|
1675
|
isBold: false,
|
1725
|
isBold: false,
|
|
1676
|
onPressed: () async {
|
1726
|
onPressed: () async {
|
|
1677
|
- if (myModel.smsInfo.isEmpty) {
|
|
|
|
1678
|
- return;
|
|
|
|
1679
|
- }
|
1727
|
+ // if (myModel.smsInfo == '0') {
|
|
|
|
1728
|
+ // setState(() {
|
|
|
|
1729
|
+ // showErro = smsErro;
|
|
|
|
1730
|
+ // });
|
|
|
|
1731
|
+ // return;
|
|
|
|
1732
|
+ // }
|
|
1680
|
if ((_baseIndoProvider.phoneController.text
|
1733
|
if ((_baseIndoProvider.phoneController.text
|
|
1681
|
.trim()
|
1734
|
.trim()
|
|
1682
|
.isEmpty ||
|
1735
|
.isEmpty ||
|
|
@@ -1735,9 +1788,52 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1735,9 +1788,52 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1735
|
params['Strtext'] = user.sellername;
|
1788
|
params['Strtext'] = user.sellername;
|
|
1736
|
}
|
1789
|
}
|
|
1737
|
*/
|
1790
|
*/
|
|
|
|
1791
|
+ Guest guest = Guest(
|
|
|
|
1792
|
+ null,
|
|
|
|
1793
|
+ null,
|
|
|
|
1794
|
+ null,
|
|
|
|
1795
|
+ null,
|
|
|
|
1796
|
+ null,
|
|
|
|
1797
|
+ null,
|
|
|
|
1798
|
+ null,
|
|
|
|
1799
|
+ null,
|
|
|
|
1800
|
+ null,
|
|
|
|
1801
|
+ null,
|
|
|
|
1802
|
+ null,
|
|
|
|
1803
|
+ null,
|
|
|
|
1804
|
+ null,
|
|
|
|
1805
|
+ null,
|
|
|
|
1806
|
+ null,
|
|
|
|
1807
|
+ null,
|
|
|
|
1808
|
+ null);
|
|
|
|
1809
|
+ if (widget.guest == null) {
|
|
|
|
1810
|
+ guest.phone =
|
|
|
|
1811
|
+ _baseIndoProvider.phoneController.text; //预订人电话
|
|
|
|
1812
|
+
|
|
|
|
1813
|
+ if (nameStr != null && nameStr.trim().length > 0) {
|
|
|
|
1814
|
+ String sex = '1';
|
|
|
|
1815
|
+ if (sexStr == '女士') {
|
|
|
|
1816
|
+ sex = '2';
|
|
|
|
1817
|
+ } else if (sexStr == '公司') {
|
|
|
|
1818
|
+ sex = '3';
|
|
|
|
1819
|
+ }
|
|
|
|
1820
|
+ guest.rname = nameStr; //预订人姓名
|
|
|
|
1821
|
+ guest.sex = sex; //预订人性别:1:男 2:女
|
|
|
|
1822
|
+
|
|
|
|
1823
|
+ }
|
|
|
|
1824
|
+ }
|
|
|
|
1825
|
+ String pnum;
|
|
|
|
1826
|
+ if (actualPnum != '选填') {
|
|
|
|
1827
|
+ pnum = actualPnum;
|
|
|
|
1828
|
+ }
|
|
1738
|
SunReserveInfoModel _model =
|
1829
|
SunReserveInfoModel _model =
|
|
1739
|
await tableManagerModel.setReserveInfo(context,
|
1830
|
await tableManagerModel.setReserveInfo(context,
|
|
1740
|
- needKeep: true, guest: widget.guest);
|
1831
|
+ needKeep: true,
|
|
|
|
1832
|
+ pnum: pnum,
|
|
|
|
1833
|
+ tempTime: ddateHm == '选填' ? null : ddateHm,
|
|
|
|
1834
|
+ guest: widget.guest == null
|
|
|
|
1835
|
+ ? guest
|
|
|
|
1836
|
+ : widget.guest);
|
|
1741
|
if (_model != null &&
|
1837
|
if (_model != null &&
|
|
1742
|
ObjectUtil.isNotEmpty(_model.row) &&
|
1838
|
ObjectUtil.isNotEmpty(_model.row) &&
|
|
1743
|
ObjectUtil.isNotEmpty(_model.row.id)) {
|
1839
|
ObjectUtil.isNotEmpty(_model.row.id)) {
|
|
@@ -1746,15 +1842,40 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
@@ -1746,15 +1842,40 @@ class TableManagerPageState extends State<TableManagerPage> { |
|
1746
|
// _homeEnterModel.clearData();
|
1842
|
// _homeEnterModel.clearData();
|
|
1747
|
bus.emit("refresh_tablemanager"); //刷新当前页面
|
1843
|
bus.emit("refresh_tablemanager"); //刷新当前页面
|
|
1748
|
bus.emit("refresh_book_list"); //刷新已预订列表
|
1844
|
bus.emit("refresh_book_list"); //刷新已预订列表
|
|
1749
|
- UserModel userModel =
|
|
|
|
1750
|
- Provider.of<UserModel>(context, listen: false);
|
|
|
|
1751
|
- Map<String, String> params = {
|
|
|
|
1752
|
- "rid": _model.row.id,
|
|
|
|
1753
|
- "sid": userModel.user.sellerid
|
|
|
|
1754
|
- };
|
|
|
|
1755
|
- bool success = await couponProvider
|
|
|
|
1756
|
- .sendSMSWxSendSms(context, params);
|
|
|
|
1757
|
- print(success);
|
1845
|
+ if (youhui != '选择优惠') {
|
|
|
|
1846
|
+ Map<String, String> params = {
|
|
|
|
1847
|
+ "rid": _model.row.id,
|
|
|
|
1848
|
+ "aid":
|
|
|
|
1849
|
+ '${couponProvider.couponListSelect[couponSelectIndex].id}'
|
|
|
|
1850
|
+ };
|
|
|
|
1851
|
+ bool isSuc = await couponProvider
|
|
|
|
1852
|
+ .setActivityAsReserve(context, params);
|
|
|
|
1853
|
+ if (isSuc) {
|
|
|
|
1854
|
+ couponProvider.hasModify = true;
|
|
|
|
1855
|
+ UserModel userModel = Provider.of<UserModel>(
|
|
|
|
1856
|
+ context,
|
|
|
|
1857
|
+ listen: false);
|
|
|
|
1858
|
+ Map<String, String> params = {
|
|
|
|
1859
|
+ "rid": _model.row.id,
|
|
|
|
1860
|
+ "sid": userModel.user.sellerid
|
|
|
|
1861
|
+ };
|
|
|
|
1862
|
+ bool success = await couponProvider
|
|
|
|
1863
|
+ .sendSMSWxSendSms(context, params);
|
|
|
|
1864
|
+ print(success);
|
|
|
|
1865
|
+ }
|
|
|
|
1866
|
+ } else {
|
|
|
|
1867
|
+ UserModel userModel = Provider.of<UserModel>(
|
|
|
|
1868
|
+ context,
|
|
|
|
1869
|
+ listen: false);
|
|
|
|
1870
|
+ Map<String, String> params = {
|
|
|
|
1871
|
+ "rid": _model.row.id,
|
|
|
|
1872
|
+ "sid": userModel.user.sellerid
|
|
|
|
1873
|
+ };
|
|
|
|
1874
|
+ bool success = await couponProvider
|
|
|
|
1875
|
+ .sendSMSWxSendSms(context, params);
|
|
|
|
1876
|
+ print(success);
|
|
|
|
1877
|
+ }
|
|
|
|
1878
|
+
|
|
1758
|
// if (success) {
|
1879
|
// if (success) {
|
|
1759
|
// Utils.showToast('短信已经发送成功!');
|
1880
|
// Utils.showToast('短信已经发送成功!');
|
|
1760
|
// } else {
|
1881
|
// } else {
|