|
@@ -191,6 +191,22 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -191,6 +191,22 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
191
|
}
|
191
|
}
|
|
192
|
}
|
192
|
}
|
|
193
|
|
193
|
|
|
|
|
194
|
+ _setCookbookOrderMarkeclass(String id, String upid) async {
|
|
|
|
195
|
+ Map<String, String> params = {
|
|
|
|
196
|
+ // "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
|
|
|
|
197
|
+ "id": id,
|
|
|
|
198
|
+ 'upid': upid
|
|
|
|
199
|
+ };
|
|
|
|
200
|
+ print(params);
|
|
|
|
201
|
+ bool sucess = await menuManageProvider
|
|
|
|
202
|
+ .setCookbookOrderMarkeclass(context, params, showLoading: true);
|
|
|
|
203
|
+ if (sucess) {
|
|
|
|
204
|
+ Utils.showToast('修改成功!');
|
|
|
|
205
|
+ //刷新列表数据
|
|
|
|
206
|
+ _getCookbookByClass(showLoading: true);
|
|
|
|
207
|
+ }
|
|
|
|
208
|
+ }
|
|
|
|
209
|
+
|
|
194
|
///处理数据
|
210
|
///处理数据
|
|
195
|
_handleData({isMove = false}) {
|
211
|
_handleData({isMove = false}) {
|
|
196
|
if (menuManageProvider.menuModel != null) {
|
212
|
if (menuManageProvider.menuModel != null) {
|
|
@@ -717,8 +733,8 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -717,8 +733,8 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
717
|
}
|
733
|
}
|
|
718
|
|
734
|
|
|
719
|
_onLongPress(MenuSunModel model, int indexOut) async {
|
735
|
_onLongPress(MenuSunModel model, int indexOut) async {
|
|
720
|
- List<MenuSunModel> cookbooklist =
|
|
|
|
721
|
- menuManageProvider.menuModel[indexOut].cookbooklist;
|
736
|
+ MenuModel menumodel = menuManageProvider.menuModel[indexOut];
|
|
|
|
737
|
+ List<MenuSunModel> cookbooklist = menumodel.cookbooklist;
|
|
722
|
Map object = await DialogUtil.menuMagageAlertDialog(
|
738
|
Map object = await DialogUtil.menuMagageAlertDialog(
|
|
723
|
context,
|
739
|
context,
|
|
724
|
model.nameTypeList,
|
740
|
model.nameTypeList,
|
|
@@ -747,7 +763,14 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -747,7 +763,14 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
747
|
// model.id
|
763
|
// model.id
|
|
748
|
//上一个id
|
764
|
//上一个id
|
|
749
|
// cookbooklist[model.indexNew-1].id
|
765
|
// cookbooklist[model.indexNew-1].id
|
|
750
|
- _setCookbookOrder(model.id, cookbooklist[model.indexNew - 1].id);
|
766
|
+
|
|
|
|
767
|
+ if (menumodel.classType == '1') {
|
|
|
|
768
|
+ //10道必点菜
|
|
|
|
769
|
+ _setCookbookOrderMarkeclass(
|
|
|
|
770
|
+ model.id, cookbooklist[model.indexNew - 1].id);
|
|
|
|
771
|
+ } else {
|
|
|
|
772
|
+ _setCookbookOrder(model.id, cookbooklist[model.indexNew - 1].id);
|
|
|
|
773
|
+ }
|
|
751
|
|
774
|
|
|
752
|
// var child = menuManageProvider.menuModel[indexOut].cookbooklist
|
775
|
// var child = menuManageProvider.menuModel[indexOut].cookbooklist
|
|
753
|
// .removeAt(model.indexNew);
|
776
|
// .removeAt(model.indexNew);
|
|
@@ -766,7 +789,13 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
@@ -766,7 +789,13 @@ class _MenuManagePageState extends State<MenuManagePage> { |
|
766
|
//下一个id
|
789
|
//下一个id
|
|
767
|
// cookbooklist[model.indexNew+1].id
|
790
|
// cookbooklist[model.indexNew+1].id
|
|
768
|
|
791
|
|
|
769
|
- _setCookbookOrder(model.id, cookbooklist[model.indexNew + 1].id);
|
792
|
+ if (menumodel.classType == '1') {
|
|
|
|
793
|
+ //10道必点菜
|
|
|
|
794
|
+ _setCookbookOrderMarkeclass(
|
|
|
|
795
|
+ model.id, cookbooklist[model.indexNew + 1].id);
|
|
|
|
796
|
+ } else {
|
|
|
|
797
|
+ _setCookbookOrder(model.id, cookbooklist[model.indexNew + 1].id);
|
|
|
|
798
|
+ }
|
|
770
|
// var child = menuManageProvider.menuModel[indexOut].cookbooklist
|
799
|
// var child = menuManageProvider.menuModel[indexOut].cookbooklist
|
|
771
|
// .removeAt(model.indexNew);
|
800
|
// .removeAt(model.indexNew);
|
|
772
|
|
801
|
|