Commit 0e1804ed6d192252005960876d8561302f3c2594

Authored by wdn127929
1 parent 01a2f7af

酒水差删除

  1 +class ClassifyModel {
  2 + int ret;
  3 + List<ClassifySunModel> data;
  4 + String msg;
  5 +
  6 + ClassifyModel({this.ret, this.data, this.msg});
  7 +
  8 + ClassifyModel.fromJson(Map<String, dynamic> json) {
  9 + ret = json['ret'];
  10 + if (json['data'] != null) {
  11 + data = <ClassifySunModel>[];
  12 + json['data'].forEach((v) {
  13 + data.add(new ClassifySunModel.fromJson(v));
  14 + });
  15 + }
  16 + msg = json['msg'];
  17 + }
  18 +
  19 + Map<String, dynamic> toJson() {
  20 + final Map<String, dynamic> data = new Map<String, dynamic>();
  21 + data['ret'] = this.ret;
  22 + if (this.data != null) {
  23 + data['data'] = this.data.map((v) => v.toJson()).toList();
  24 + }
  25 + data['msg'] = this.msg;
  26 + return data;
  27 + }
  28 +}
  29 +
  30 +class ClassifySunModel {
  31 + String id;
  32 + String sid;
  33 + String className;
  34 + String status;
  35 + dynamic cdate;
  36 +
  37 + ClassifySunModel(
  38 + {this.id, this.sid, this.className, this.status, this.cdate});
  39 +
  40 + ClassifySunModel.fromJson(Map<String, dynamic> json) {
  41 + id = json['id'];
  42 + sid = json['sid'];
  43 + className = json['class_name'];
  44 + status = json['status'];
  45 + cdate = json['cdate'];
  46 + }
  47 +
  48 + Map<String, dynamic> toJson() {
  49 + final Map<String, dynamic> data = new Map<String, dynamic>();
  50 + data['id'] = this.id;
  51 + data['sid'] = this.sid;
  52 + data['class_name'] = this.className;
  53 + data['status'] = this.status;
  54 + data['cdate'] = this.cdate;
  55 + return data;
  56 + }
  57 +}
@@ -3,14 +3,26 @@ class FilterBtnModel { @@ -3,14 +3,26 @@ class FilterBtnModel {
3 String id; 3 String id;
4 String title; 4 String title;
5 bool select = false; 5 bool select = false;
  6 + String roleName;
  7 + String phone;
  8 + String account;
6 9
7 FilterBtnModel(); 10 FilterBtnModel();
8 11
9 factory FilterBtnModel.fromJson(Map<String, dynamic> json) => FilterBtnModel() 12 factory FilterBtnModel.fromJson(Map<String, dynamic> json) => FilterBtnModel()
10 ..id = json["id"] 13 ..id = json["id"]
11 ..title = json["title"] 14 ..title = json["title"]
12 - ..select = json["select"]; 15 + ..select = json["select"]
  16 + ..roleName = json["role_name"]
  17 + ..phone = json["phone"]
  18 + ..account = json["account"];
13 19
14 - Map<String, dynamic> toJson() =>  
15 - <String, dynamic>{"id": id, "title": title, "select": select}; 20 + Map<String, dynamic> toJson() => <String, dynamic>{
  21 + "id": id,
  22 + "title": title,
  23 + "select": select,
  24 + 'roleName': roleName,
  25 + 'phone': phone,
  26 + 'account': account
  27 + };
16 } 28 }
  1 +class GetStaffModel {
  2 + int ret;
  3 + List<GetStaffSunModel> data;
  4 + String msg;
  5 +
  6 + GetStaffModel({this.ret, this.data, this.msg});
  7 +
  8 + GetStaffModel.fromJson(Map<String, dynamic> json) {
  9 + ret = json['ret'];
  10 + if (json['data'] != null) {
  11 + data = <GetStaffSunModel>[];
  12 + json['data'].forEach((v) {
  13 + data.add(new GetStaffSunModel.fromJson(v));
  14 + });
  15 + }
  16 + msg = json['msg'];
  17 + }
  18 +
  19 + Map<String, dynamic> toJson() {
  20 + final Map<String, dynamic> data = new Map<String, dynamic>();
  21 + data['ret'] = this.ret;
  22 + if (this.data != null) {
  23 + data['data'] = this.data.map((v) => v.toJson()).toList();
  24 + }
  25 + data['msg'] = this.msg;
  26 + return data;
  27 + }
  28 +}
  29 +
  30 +class GetStaffSunModel {
  31 + String id;
  32 + String sid;
  33 + String userId;
  34 + Null status;
  35 + Null cdate;
  36 +
  37 + GetStaffSunModel({this.id, this.sid, this.userId, this.status, this.cdate});
  38 +
  39 + GetStaffSunModel.fromJson(Map<String, dynamic> json) {
  40 + id = json['id'];
  41 + sid = json['sid'];
  42 + userId = json['user_id'];
  43 + status = json['status'];
  44 + cdate = json['cdate'];
  45 + }
  46 +
  47 + Map<String, dynamic> toJson() {
  48 + final Map<String, dynamic> data = new Map<String, dynamic>();
  49 + data['id'] = this.id;
  50 + data['sid'] = this.sid;
  51 + data['user_id'] = this.userId;
  52 + data['status'] = this.status;
  53 + data['cdate'] = this.cdate;
  54 + return data;
  55 + }
  56 +}
  1 +class WineModel {
  2 + int ret;
  3 + List<WineSunModel> data;
  4 + String msg;
  5 +
  6 + WineModel({this.ret, this.data, this.msg});
  7 +
  8 + WineModel.fromJson(Map<String, dynamic> json) {
  9 + ret = json['ret'];
  10 + if (json['data'] != null) {
  11 + data = <WineSunModel>[];
  12 + json['data'].forEach((v) {
  13 + data.add(new WineSunModel.fromJson(v));
  14 + });
  15 + }
  16 + msg = json['msg'];
  17 + }
  18 +
  19 + Map<String, dynamic> toJson() {
  20 + final Map<String, dynamic> data = new Map<String, dynamic>();
  21 + data['ret'] = this.ret;
  22 + if (this.data != null) {
  23 + data['data'] = this.data.map((v) => v.toJson()).toList();
  24 + }
  25 + data['msg'] = this.msg;
  26 + return data;
  27 + }
  28 +}
  29 +
  30 +class WineSunModel {
  31 + String id;
  32 + String sid;
  33 + String wineName;
  34 + String price;
  35 + String spec;
  36 + String bargaining;
  37 +
  38 + WineSunModel(
  39 + {this.id,
  40 + this.sid,
  41 + this.wineName,
  42 + this.price,
  43 + this.spec,
  44 + this.bargaining});
  45 +
  46 + WineSunModel.fromJson(Map<String, dynamic> json) {
  47 + id = json['id'];
  48 + sid = json['sid'];
  49 + wineName = json['wine_name'];
  50 + price = json['price'];
  51 + spec = json['spec'];
  52 + bargaining = json['bargaining'];
  53 + }
  54 +
  55 + Map<String, dynamic> toJson() {
  56 + final Map<String, dynamic> data = new Map<String, dynamic>();
  57 + data['id'] = this.id;
  58 + data['sid'] = this.sid;
  59 + data['wine_name'] = this.wineName;
  60 + data['price'] = this.price;
  61 + data['spec'] = this.spec;
  62 + data['bargaining'] = this.bargaining;
  63 + return data;
  64 + }
  65 +}
@@ -133,8 +133,7 @@ class HttpUrl { @@ -133,8 +133,7 @@ class HttpUrl {
133 static const String get_table_fill_update = 133 static const String get_table_fill_update =
134 "?service=App.Customer.GetTableFillUpDate"; // 根据指定日期,返回当前商家包间类型置满情况的日期 134 "?service=App.Customer.GetTableFillUpDate"; // 根据指定日期,返回当前商家包间类型置满情况的日期
135 135
136 - static const String app_pay_sub =  
137 - "?service=App.Pay.AppPaySub"; // 微信支付 136 + static const String app_pay_sub = "?service=App.Pay.AppPaySub"; // 微信支付
138 137
139 static const String get_table_class_by_id = 138 static const String get_table_class_by_id =
140 "?service=App.Seller.GetTableClassById"; // 获取包间分类 139 "?service=App.Seller.GetTableClassById"; // 获取包间分类
@@ -243,5 +242,17 @@ class HttpUrl { @@ -243,5 +242,17 @@ class HttpUrl {
243 "?service=Android.Reserve.NewGetMessageList"; //根据不同得消息类型获取对应得消息列表 242 "?service=Android.Reserve.NewGetMessageList"; //根据不同得消息类型获取对应得消息列表
244 static const String get_seller_reserve_total = 243 static const String get_seller_reserve_total =
245 "?service=Android.Reserve.GetSellerReserveTotal"; // 获取商家时间区间内订单数量 244 "?service=Android.Reserve.GetSellerReserveTotal"; // 获取商家时间区间内订单数量
  245 + static const String add_staff = "?service=App.Banquet.AddStaff"; // 添加宴会员工
  246 + static const String get_staff = "?service=App.Banquet.GetStaff"; // 获取宴会员工
  247 + static const String get_classify =
  248 + "?service=App.Banquet.GetClassify"; // 获取宴会分类
  249 + static const String set_classify =
  250 + "?service=App.Banquet.SetClassify"; // 添加宴会分类
  251 + static const String del_classify =
  252 + "?service=App.Banquet.DelClassify"; // 删除宴会分类
  253 +
  254 + static const String get_wine = "?service=App.Banquet.GetWine"; // 获取酒水
  255 + static const String set_wine = "?service=App.Banquet.SetWine"; // 添加酒水
  256 + static const String del_wine = "?service=App.Banquet.DelWine"; // 删除酒水
246 257
247 } 258 }
@@ -85,7 +85,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> { @@ -85,7 +85,7 @@ class _FeastCreatePageState extends State<FeastCreatePage> {
85 85
86 ///商家编辑页面 ----- 获取经理数据 86 ///商家编辑页面 ----- 获取经理数据
87 _getSellerUserBySellerid() async { 87 _getSellerUserBySellerid() async {
88 - await feastModel.getSellerUserBySellerid(context); 88 + await feastModel.getAuthUserLists(context);
89 89
90 // for (int i = 0; i < feastModel.sellerManageList.length; i++) { 90 // for (int i = 0; i < feastModel.sellerManageList.length; i++) {
91 // if (manageShow == feastModel.sellerManageList[i].title) { 91 // if (manageShow == feastModel.sellerManageList[i].title) {
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/flutter_screenutil.dart'; 2 import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/models/filter_btn_model.dart';
3 import 'package:one_key/widgets/MyDivider.dart'; 4 import 'package:one_key/widgets/MyDivider.dart';
  5 +import 'package:provider/provider.dart';
4 6
  7 +import '../../../constant/state.dart';
  8 +import '../../../provider/feast_model.dart';
  9 +import '../../../provider/user_model.dart';
5 import '../../../res/colors.dart'; 10 import '../../../res/colors.dart';
6 import '../../../utils/dialog_util.dart'; 11 import '../../../utils/dialog_util.dart';
7 import '../../../utils/screen_util.dart'; 12 import '../../../utils/screen_util.dart';
8 import '../../../utils/utils.dart'; 13 import '../../../utils/utils.dart';
9 import '../../../widgets/h_empty_view.dart'; 14 import '../../../widgets/h_empty_view.dart';
  15 +import '../../../widgets/page_exception.dart';
10 import '../../../widgets/round_button.dart'; 16 import '../../../widgets/round_button.dart';
11 import '../../../widgets/system_app_bar.dart'; 17 import '../../../widgets/system_app_bar.dart';
12 18
@@ -22,73 +28,145 @@ class FeastPersonalPage extends StatefulWidget { @@ -22,73 +28,145 @@ class FeastPersonalPage extends StatefulWidget {
22 } 28 }
23 29
24 class _FeastPersonalPageState extends State<FeastPersonalPage> { 30 class _FeastPersonalPageState extends State<FeastPersonalPage> {
  31 + FeastModel feastModel;
25 @override 32 @override
26 void initState() { 33 void initState() {
27 super.initState(); 34 super.initState();
28 Utils.changeStatusColor(color: MyColours.color_438E93); 35 Utils.changeStatusColor(color: MyColours.color_438E93);
  36 + WidgetsBinding.instance.addPostFrameCallback((_) {
  37 + _getData();
  38 + // scrollController.jumpTo(scrollController.position.minScrollExtent);
  39 + });
29 } 40 }
30 41
31 - Widget buildFeastTypeHeader(bool select) { 42 + _getData() async {
  43 + await Future.wait<bool>([_getSellerUserBySellerid(), _getStaff()])
  44 + .then((results) {
  45 + print(results[0]);
  46 + if (results[0] && results[1]) {
  47 + //成功
  48 + feastModel.sellerManageList.forEach((element) {
  49 + if (feastModel.getPersonnalList.contains(element.id)) {
  50 + element.select = true;
  51 + feastModel.selectPersonnalData.add(element.id);
  52 + } else {
  53 + element.select = false;
  54 + }
  55 + });
  56 + feastModel.getCheckValueMy();
  57 + } else {
  58 + if (!results[0]) {
  59 + // Utils.showToast('');
  60 + } else {
  61 + // Utils.showToast('');
  62 + }
  63 + }
  64 + }).catchError((e) {
  65 + print(e);
  66 + });
  67 + }
  68 +
  69 + ///获取经理数据
  70 + Future<bool> _getSellerUserBySellerid() async {
  71 + bool success = await feastModel.getAuthUserLists(context);
  72 + if (success) {
  73 + return true;
  74 + } else {
  75 + return false;
  76 + }
  77 + }
  78 +
  79 + ///
  80 + Future<bool> _getStaff() async {
  81 + bool success = await feastModel.getStaff(context);
  82 + if (success) {
  83 + return true;
  84 + } else {
  85 + return false;
  86 + }
  87 + }
  88 +
  89 + Widget buildFeastTypeHeader() {
32 return RoundButton( 90 return RoundButton(
33 - onPressed: () async {}, 91 + onPressed: () {
  92 + if (feastModel.checkValue) {
  93 + feastModel.cancelAllMy();
  94 + } else {
  95 + feastModel.addAllMy();
  96 + }
  97 + },
34 text: '全选', 98 text: '全选',
35 fontSize: 32, 99 fontSize: 32,
36 isBold: false, 100 isBold: false,
37 height: h(32), 101 height: h(32),
38 width: w(48), 102 width: w(48),
39 margin: EdgeInsets.only(top: w(18), bottom: w(4)), 103 margin: EdgeInsets.only(top: w(18), bottom: w(4)),
40 - textColor: select ? MyColours.color_ffffff : MyColours.color_438E93,  
41 - gradientStart: select ? MyColours.color_438E93 : MyColours.color_ffffff,  
42 - gradientEnd: select ? MyColours.color_438E93 : MyColours.color_ffffff,  
43 - borderColor: select ? MyColours.color_438E93 : MyColours.color_ffffff, 104 + textColor: feastModel.checkValue
  105 + ? MyColours.color_ffffff
  106 + : MyColours.color_438E93,
  107 + gradientStart: feastModel.checkValue
  108 + ? MyColours.color_438E93
  109 + : MyColours.color_ffffff,
  110 + gradientEnd: feastModel.checkValue
  111 + ? MyColours.color_438E93
  112 + : MyColours.color_ffffff,
  113 + borderColor: MyColours.color_438E93,
44 radius: r(6), 114 radius: r(6),
45 ); 115 );
46 } 116 }
47 117
48 - Widget buildFeastTypeItem() {  
49 - return Column(  
50 - children: [  
51 - Container(  
52 - height: h(48),  
53 - margin: EdgeInsets.only(top: w(12)),  
54 - // decoration: BoxDecoration(  
55 - // border: Border(  
56 - // bottom:  
57 - // BorderSide(width: w(1), color: MyColours.color_E7E7E7))),  
58 - child: Row(  
59 - children: [  
60 - InkWell(  
61 - onTap: () {},  
62 - child: Image.asset(  
63 - Utils.getImgPath(true ? 'select' : 'unselect'), 118 + Widget buildFeastTypeItem(FilterBtnModel model, int index) {
  119 + return InkWell(
  120 + onTap: () {
  121 + model.select = !model.select;
  122 + if (model.select) {
  123 + feastModel.addDataMy(index);
  124 + } else {
  125 + feastModel.cancelDataMy(index);
  126 + }
  127 + feastModel.getCheckValueMy();
  128 + },
  129 + child: Column(
  130 + children: [
  131 + Container(
  132 + height: h(48),
  133 + margin: EdgeInsets.only(top: w(12)),
  134 + // decoration: BoxDecoration(
  135 + // border: Border(
  136 + // bottom:
  137 + // BorderSide(width: w(1), color: MyColours.color_E7E7E7))),
  138 + child: Row(
  139 + children: [
  140 + Image.asset(
  141 + Utils.getImgPath(model.select ? 'select' : 'unselect'),
64 width: w(24), 142 width: w(24),
65 height: w(24), 143 height: w(24),
66 - )),  
67 - HEmptyView(16),  
68 - Text(  
69 - '刘经理 15833517582',  
70 - style: TextStyle(  
71 - fontSize: font(16), color: MyColours.color_E6000000),  
72 - ),  
73 - Spacer(),  
74 - Text(  
75 - '管理员 0001',  
76 - style: TextStyle(  
77 - fontSize: font(14), color: MyColours.color_999999), 144 + ),
  145 + HEmptyView(16),
  146 + Text(
  147 + '${model.title} ${model.phone ?? ''}',
  148 + style: TextStyle(
  149 + fontSize: font(16), color: MyColours.color_E6000000),
  150 + ),
  151 + Spacer(),
  152 + Text(
  153 + '${model.roleName} ${model.account}',
  154 + style: TextStyle(
  155 + fontSize: font(14), color: MyColours.color_999999),
  156 + ),
  157 + HEmptyView(32),
  158 + ],
78 ), 159 ),
79 - HEmptyView(32),  
80 - ],  
81 - ),  
82 - ),  
83 - Padding(  
84 - padding: EdgeInsets.only(left: w(32)),  
85 - child: MyDivider(  
86 - double.infinity,  
87 - w(0.5),  
88 - color: MyColours.color_E7E7E7,  
89 - ))  
90 - ],  
91 - ); 160 + ),
  161 + Padding(
  162 + padding: EdgeInsets.only(left: w(32)),
  163 + child: MyDivider(
  164 + double.infinity,
  165 + w(0.5),
  166 + color: MyColours.color_E7E7E7,
  167 + ))
  168 + ],
  169 + ));
92 } 170 }
93 171
94 Widget _callButton( 172 Widget _callButton(
@@ -133,6 +211,7 @@ class _FeastPersonalPageState extends State<FeastPersonalPage> { @@ -133,6 +211,7 @@ class _FeastPersonalPageState extends State<FeastPersonalPage> {
133 211
134 @override 212 @override
135 Widget build(BuildContext context) { 213 Widget build(BuildContext context) {
  214 + feastModel = Provider.of<FeastModel>(context, listen: true);
136 return Scaffold( 215 return Scaffold(
137 backgroundColor: MyColours.color_ffffff, 216 backgroundColor: MyColours.color_ffffff,
138 appBar: SystemAppBar( 217 appBar: SystemAppBar(
@@ -144,55 +223,89 @@ class _FeastPersonalPageState extends State<FeastPersonalPage> { @@ -144,55 +223,89 @@ class _FeastPersonalPageState extends State<FeastPersonalPage> {
144 Navigator.pop(context); 223 Navigator.pop(context);
145 }, 224 },
146 ), 225 ),
147 - body: Column(  
148 - children: [  
149 - Expanded(  
150 - child: NestedScrollView(  
151 - // controller: _scrollViewController,  
152 - headerSliverBuilder:  
153 - (BuildContext context, bool innerBoxIsScrolled) {  
154 - return <Widget>[  
155 - SliverAppBar(  
156 - pinned: true,  
157 - floating: false,  
158 - leading: null,  
159 - backgroundColor: MyColours.color_ffffff,  
160 - expandedHeight: ScreenUtil().setWidth(56 * 2),  
161 - automaticallyImplyLeading: false,  
162 - title: buildFeastTypeHeader(true),  
163 - // flexibleSpace: FlexibleSpaceBar(  
164 - // collapseMode: CollapseMode.pin,  
165 - // title: buildFeastTypeHeader())  
166 - )  
167 - ]; 226 + body: Consumer<FeastModel>(builder: (context, model, _) {
  227 + if (model.pageStatePersonnalHome != PageState.Success) {
  228 + return ExceptionPage(
  229 + pageState: model.pageStatePersonnalHome,
  230 + callback: () {
  231 + _getSellerUserBySellerid();
168 }, 232 },
169 - body: ListView.builder(  
170 - itemCount: 100,  
171 - padding: EdgeInsets.only(left: w(16)),  
172 - itemBuilder: (BuildContext context, int index) {  
173 - return buildFeastTypeItem();  
174 - }),  
175 - )),  
176 - Row( 233 + emptyMsg: "暂时没有员工哦",
  234 + emptyImg: "empty_search",
  235 + showMsg: "加载中,请稍后...",
  236 + );
  237 + } else {
  238 + return Column(
177 children: [ 239 children: [
178 Expanded( 240 Expanded(
179 - child: _callButton(  
180 - onPress: () {  
181 - Navigator.pop(context);  
182 - },  
183 - content: '返回',  
184 - hasLeftBorder: true,  
185 - isSelect: false)),  
186 - Expanded(  
187 - child: _callButton(  
188 - onPress: () {},  
189 - content: '保存',  
190 - hasLeftBorder: true,  
191 - isSelect: true)) 241 + child: NestedScrollView(
  242 + // controller: _scrollViewController,
  243 + headerSliverBuilder:
  244 + (BuildContext context, bool innerBoxIsScrolled) {
  245 + return <Widget>[
  246 + SliverAppBar(
  247 + pinned: true,
  248 + floating: false,
  249 + leading: null,
  250 + backgroundColor: MyColours.color_ffffff,
  251 + expandedHeight: ScreenUtil().setWidth(56 * 2),
  252 + automaticallyImplyLeading: false,
  253 + title: buildFeastTypeHeader(),
  254 + // flexibleSpace: FlexibleSpaceBar(
  255 + // collapseMode: CollapseMode.pin,
  256 + // title: buildFeastTypeHeader())
  257 + )
  258 + ];
  259 + },
  260 + body: ListView.builder(
  261 + itemCount: feastModel.sellerManageList.length,
  262 + padding: EdgeInsets.only(left: w(16)),
  263 + itemBuilder: (BuildContext context, int index) {
  264 + FilterBtnModel model = feastModel.sellerManageList[index];
  265 + return buildFeastTypeItem(model, index);
  266 + }),
  267 + )),
  268 + Row(
  269 + children: [
  270 + Expanded(
  271 + child: _callButton(
  272 + onPress: () {
  273 + Navigator.pop(context);
  274 + },
  275 + content: '返回',
  276 + hasLeftBorder: true,
  277 + isSelect: false)),
  278 + Expanded(
  279 + child: _callButton(
  280 + onPress: () async {
  281 + if (feastModel.selectPersonnalData.length == 0) {
  282 + Utils.showToast('请至少选择一个员工!');
  283 + return;
  284 + }
  285 + Map<String, String> params = {
  286 + "sid":
  287 + Provider.of<UserModel>(context, listen: false)
  288 + .user
  289 + .sellerid,
  290 + 'user_id': Utils.listToStringEnglish(
  291 + feastModel.selectPersonnalData)
  292 + };
  293 + bool success =
  294 + await feastModel.addStaff(context, params);
  295 + if (success) {
  296 + Utils.showToast('保存成功');
  297 + Navigator.pop(context);
  298 + }
  299 + },
  300 + content: '保存',
  301 + hasLeftBorder: true,
  302 + isSelect: true))
  303 + ],
  304 + )
192 ], 305 ],
193 - )  
194 - ],  
195 - ), 306 + );
  307 + }
  308 + }),
196 ); 309 );
197 } 310 }
198 } 311 }
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/flutter_screenutil.dart'; 2 import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/models/classify_model.dart';
  4 +import 'package:provider/provider.dart';
3 5
  6 +import '../../../constant/state.dart';
  7 +import '../../../provider/feast_model.dart';
  8 +import '../../../provider/user_model.dart';
4 import '../../../res/colors.dart'; 9 import '../../../res/colors.dart';
5 import '../../../utils/dialog_util.dart'; 10 import '../../../utils/dialog_util.dart';
6 import '../../../utils/screen_util.dart'; 11 import '../../../utils/screen_util.dart';
7 import '../../../utils/utils.dart'; 12 import '../../../utils/utils.dart';
8 import '../../../widgets/h_empty_view.dart'; 13 import '../../../widgets/h_empty_view.dart';
  14 +import '../../../widgets/page_exception.dart';
9 import '../../../widgets/round_button.dart'; 15 import '../../../widgets/round_button.dart';
10 import '../../../widgets/system_app_bar.dart'; 16 import '../../../widgets/system_app_bar.dart';
11 17
@@ -21,10 +27,35 @@ class FeastTypePage extends StatefulWidget { @@ -21,10 +27,35 @@ class FeastTypePage extends StatefulWidget {
21 } 27 }
22 28
23 class _FeastTypePageState extends State<FeastTypePage> { 29 class _FeastTypePageState extends State<FeastTypePage> {
  30 + FeastModel feastModel;
24 @override 31 @override
25 void initState() { 32 void initState() {
26 super.initState(); 33 super.initState();
27 Utils.changeStatusColor(color: MyColours.color_438E93); 34 Utils.changeStatusColor(color: MyColours.color_438E93);
  35 + WidgetsBinding.instance.addPostFrameCallback((_) {
  36 + _getClassify();
  37 + // scrollController.jumpTo(scrollController.position.minScrollExtent);
  38 + });
  39 + }
  40 +
  41 + ///获取宴会分类
  42 + Future<bool> _getClassify({bool isShowLoading = true}) async {
  43 + await feastModel.getClassify(context, isShowLoading: isShowLoading);
  44 + }
  45 +
  46 + _setClassify(String name, {String idstr}) async {
  47 + Map<String, String> params = {
  48 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  49 + 'class_name': name
  50 + };
  51 + if (idstr != null) {
  52 + params['id'] = idstr;
  53 + }
  54 + bool success = await feastModel.setClassify(context, params);
  55 + if (success) {
  56 + Utils.showToast('添加成功');
  57 + _getClassify(isShowLoading: true);
  58 + }
28 } 59 }
29 60
30 Widget buildFeastTypeHeader() { 61 Widget buildFeastTypeHeader() {
@@ -36,6 +67,7 @@ class _FeastTypePageState extends State<FeastTypePage> { @@ -36,6 +67,7 @@ class _FeastTypePageState extends State<FeastTypePage> {
36 text: '', 67 text: '',
37 lenghtLimit: false, 68 lenghtLimit: false,
38 toast: '请输入类型名称', rCallback: (name) { 69 toast: '请输入类型名称', rCallback: (name) {
  70 + _setClassify(name);
39 // _addCookbookClass(name, showLoading: true); 71 // _addCookbookClass(name, showLoading: true);
40 }); 72 });
41 }, 73 },
@@ -53,17 +85,18 @@ class _FeastTypePageState extends State<FeastTypePage> { @@ -53,17 +85,18 @@ class _FeastTypePageState extends State<FeastTypePage> {
53 ); 85 );
54 } 86 }
55 87
56 - Widget buildFeastTypeItem(String title) { 88 + Widget buildFeastTypeItem(ClassifySunModel data, int index) {
57 return Container( 89 return Container(
58 height: h(48), 90 height: h(48),
59 margin: EdgeInsets.only(top: w(12)), 91 margin: EdgeInsets.only(top: w(12)),
60 decoration: BoxDecoration( 92 decoration: BoxDecoration(
61 border: Border( 93 border: Border(
62 - bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))), 94 + bottom:
  95 + BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
63 child: Row( 96 child: Row(
64 children: [ 97 children: [
65 Text( 98 Text(
66 - title, 99 + data.className,
67 style: 100 style:
68 TextStyle(fontSize: font(16), color: MyColours.color_E6000000), 101 TextStyle(fontSize: font(16), color: MyColours.color_E6000000),
69 ), 102 ),
@@ -73,10 +106,10 @@ class _FeastTypePageState extends State<FeastTypePage> { @@ -73,10 +106,10 @@ class _FeastTypePageState extends State<FeastTypePage> {
73 DialogUtil.textfeildAlertDialog(context, 106 DialogUtil.textfeildAlertDialog(context,
74 title: '输入类型名称', 107 title: '输入类型名称',
75 hintText: '请输入', 108 hintText: '请输入',
76 - text: '原来的内容', 109 + text: data.className,
77 lenghtLimit: true, 110 lenghtLimit: true,
78 toast: '请输入类型名称', rCallback: (name) { 111 toast: '请输入类型名称', rCallback: (name) {
79 - // _addCookbookClass(name, showLoading: true); 112 + _setClassify(name, idstr: data.id);
80 }); 113 });
81 }, 114 },
82 child: Text( 115 child: Text(
@@ -89,20 +122,28 @@ class _FeastTypePageState extends State<FeastTypePage> { @@ -89,20 +122,28 @@ class _FeastTypePageState extends State<FeastTypePage> {
89 HEmptyView(32), 122 HEmptyView(32),
90 InkWell( 123 InkWell(
91 onTap: () { 124 onTap: () {
92 - //已经传到服务器,弹提醒窗口,是否删除  
93 - //修改之前有内容,则弹框 125 + if (index == 0) {
  126 + return;
  127 + }
94 DialogUtil.cupertinoAlertDialogFeast(context, 128 DialogUtil.cupertinoAlertDialogFeast(context,
95 rTitle: '删除', 129 rTitle: '删除',
96 title: "是否确认删除", 130 title: "是否确认删除",
97 - content: "满月宴", lCallback: () { 131 + content: data.className, lCallback: () {
98 print("取消"); 132 print("取消");
99 - }, rCallback: () { 133 + }, rCallback: () async {
100 print("确定"); 134 print("确定");
101 - // widget.deleteCallback(index); 135 +
  136 + Map<String, String> pramas = {'id': data.id};
  137 + bool success = await feastModel.delClassify(context, pramas);
  138 + if (success) {
  139 + Utils.showToast('删除成功');
  140 + _getClassify(isShowLoading: true);
  141 + }
102 }); 142 });
103 }, 143 },
104 child: Image.asset( 144 child: Image.asset(
105 - Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'), 145 + Utils.getImgPath(
  146 + index == 0 ? 'f_delete_red_un' : 'f_delete_red'),
106 width: w(32), 147 width: w(32),
107 height: w(32), 148 height: w(32),
108 )), 149 )),
@@ -114,6 +155,7 @@ class _FeastTypePageState extends State<FeastTypePage> { @@ -114,6 +155,7 @@ class _FeastTypePageState extends State<FeastTypePage> {
114 155
115 @override 156 @override
116 Widget build(BuildContext context) { 157 Widget build(BuildContext context) {
  158 + feastModel = Provider.of<FeastModel>(context, listen: true);
117 return Scaffold( 159 return Scaffold(
118 backgroundColor: MyColours.color_ffffff, 160 backgroundColor: MyColours.color_ffffff,
119 appBar: SystemAppBar( 161 appBar: SystemAppBar(
@@ -126,30 +168,43 @@ class _FeastTypePageState extends State<FeastTypePage> { @@ -126,30 +168,43 @@ class _FeastTypePageState extends State<FeastTypePage> {
126 }, 168 },
127 ), 169 ),
128 body: NestedScrollView( 170 body: NestedScrollView(
129 - // controller: _scrollViewController,  
130 - headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {  
131 - return <Widget>[  
132 - SliverAppBar(  
133 - pinned: true,  
134 - floating: false,  
135 - leading: null,  
136 - backgroundColor: MyColours.color_ffffff,  
137 - expandedHeight: ScreenUtil().setWidth(56 * 2),  
138 - automaticallyImplyLeading: false,  
139 - title: buildFeastTypeHeader(),  
140 - // flexibleSpace: FlexibleSpaceBar(  
141 - // collapseMode: CollapseMode.pin,  
142 - // title: buildFeastTypeHeader())  
143 - )  
144 - ];  
145 - },  
146 - body: ListView.builder(  
147 - itemCount: 100,  
148 - padding: EdgeInsets.only(left: w(16)),  
149 - itemBuilder: (BuildContext context, int index) {  
150 - return buildFeastTypeItem('公司年会');  
151 - }),  
152 - ), 171 + // controller: _scrollViewController,
  172 + headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {
  173 + return <Widget>[
  174 + SliverAppBar(
  175 + pinned: true,
  176 + floating: false,
  177 + leading: null,
  178 + backgroundColor: MyColours.color_ffffff,
  179 + expandedHeight: ScreenUtil().setWidth(56 * 2),
  180 + automaticallyImplyLeading: false,
  181 + title: buildFeastTypeHeader(),
  182 + // flexibleSpace: FlexibleSpaceBar(
  183 + // collapseMode: CollapseMode.pin,
  184 + // title: buildFeastTypeHeader())
  185 + )
  186 + ];
  187 + }, body: Consumer<FeastModel>(builder: (context, model, _) {
  188 + if (model.pageStateType != PageState.Success) {
  189 + return ExceptionPage(
  190 + pageState: model.pageStateType,
  191 + callback: () {
  192 + // _getSellerUserBySellerid();
  193 + },
  194 + emptyMsg: "暂时没有宴会类型哦",
  195 + emptyImg: "empty_search",
  196 + showMsg: "加载中,请稍后...",
  197 + );
  198 + } else {
  199 + return ListView.builder(
  200 + itemCount: feastModel.classifyData.length,
  201 + padding: EdgeInsets.only(left: w(16)),
  202 + itemBuilder: (BuildContext context, int index) {
  203 + ClassifySunModel data = feastModel.classifyData[index];
  204 + return buildFeastTypeItem(data, index);
  205 + });
  206 + }
  207 + })),
153 ); 208 );
154 } 209 }
155 } 210 }
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/flutter_screenutil.dart'; 2 import 'package:flutter_screenutil/flutter_screenutil.dart';
3 import 'package:one_key/widgets/v_empty_view.dart'; 3 import 'package:one_key/widgets/v_empty_view.dart';
  4 +import 'package:provider/provider.dart';
4 5
  6 +import '../../../models/wine_model.dart';
  7 +import '../../../provider/feast_model.dart';
  8 +import '../../../provider/user_model.dart';
5 import '../../../res/colors.dart'; 9 import '../../../res/colors.dart';
6 import '../../../route/navigator_util.dart'; 10 import '../../../route/navigator_util.dart';
7 import '../../../utils/dialog_util.dart'; 11 import '../../../utils/dialog_util.dart';
  12 +import '../../../utils/event_bus.dart';
8 import '../../../utils/screen_util.dart'; 13 import '../../../utils/screen_util.dart';
9 import '../../../utils/utils.dart'; 14 import '../../../utils/utils.dart';
10 import '../../../widgets/h_empty_view.dart'; 15 import '../../../widgets/h_empty_view.dart';
@@ -15,10 +20,10 @@ import '../../../widgets/system_app_bar.dart'; @@ -15,10 +20,10 @@ import '../../../widgets/system_app_bar.dart';
15 * 酒水添加 20 * 酒水添加
16 */ 21 */
17 class FeastWineManageEditPage extends StatefulWidget { 22 class FeastWineManageEditPage extends StatefulWidget {
18 - final isCreate; 23 + final WineSunModel wineSunModel;
19 FeastWineManageEditPage({ 24 FeastWineManageEditPage({
20 Key key, 25 Key key,
21 - this.isCreate = true, 26 + this.wineSunModel,
22 }) : super(key: key); 27 }) : super(key: key);
23 28
24 @override 29 @override
@@ -35,11 +40,38 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> { @@ -35,11 +40,38 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> {
35 FocusNode winePerF = FocusNode(); 40 FocusNode winePerF = FocusNode();
36 bool canBargaining = true; //是否议价 41 bool canBargaining = true; //是否议价
37 ScrollController controller = ScrollController(); 42 ScrollController controller = ScrollController();
  43 + FeastModel feastModel;
38 44
39 @override 45 @override
40 void initState() { 46 void initState() {
41 super.initState(); 47 super.initState();
42 Utils.changeStatusColor(color: MyColours.color_438E93); 48 Utils.changeStatusColor(color: MyColours.color_438E93);
  49 + if (widget.wineSunModel != null) {
  50 + wineNameC.text = widget.wineSunModel.wineName;
  51 + winePriceC.text = widget.wineSunModel.price;
  52 + winePerC.text = widget.wineSunModel.spec;
  53 + canBargaining = widget.wineSunModel.bargaining == '1' ? true : false;
  54 + }
  55 + }
  56 +
  57 + _setWine() async {
  58 + Map<String, String> params = {
  59 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  60 + 'wine_name': wineNameC.text,
  61 + 'price': winePriceC.text,
  62 + 'spec': winePerC.text,
  63 + 'bargaining': canBargaining ? '1' : '0'
  64 + };
  65 + if (widget.wineSunModel != null) {
  66 + params['id'] = widget.wineSunModel.id;
  67 + }
  68 + bool success = await feastModel.setWine(context, params);
  69 + if (success) {
  70 + Utils.showToast('添加成功');
  71 + bus.emit('feast_wine_list');
  72 + Navigator.pop(context);
  73 + // _getWine(isShowLoading: true);
  74 + }
43 } 75 }
44 76
45 ///请输入 77 ///请输入
@@ -50,7 +82,7 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> { @@ -50,7 +82,7 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> {
50 TextEditingController editingController, 82 TextEditingController editingController,
51 FocusNode focusNode, 83 FocusNode focusNode,
52 String subTitle, 84 String subTitle,
53 - {TextInputType inputType = TextInputType.number}) { 85 + {TextInputType inputType = TextInputType.text}) {
54 return Container( 86 return Container(
55 height: w(48), 87 height: w(48),
56 margin: EdgeInsets.only(top: w(12)), 88 margin: EdgeInsets.only(top: w(12)),
@@ -168,10 +200,11 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> { @@ -168,10 +200,11 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> {
168 200
169 @override 201 @override
170 Widget build(BuildContext context) { 202 Widget build(BuildContext context) {
  203 + feastModel = Provider.of<FeastModel>(context, listen: true);
171 return Scaffold( 204 return Scaffold(
172 backgroundColor: MyColours.color_ffffff, 205 backgroundColor: MyColours.color_ffffff,
173 appBar: SystemAppBar( 206 appBar: SystemAppBar(
174 - widget.isCreate ? '添加酒水' : wineNameC.text, 207 + wineNameC.text,
175 needWhite: true, 208 needWhite: true,
176 bgColor: MyColours.color_438E93, 209 bgColor: MyColours.color_438E93,
177 titleColor: MyColours.color_F6F6F6, 210 titleColor: MyColours.color_F6F6F6,
@@ -191,11 +224,11 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> { @@ -191,11 +224,11 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> {
191 child: Column( 224 child: Column(
192 crossAxisAlignment: CrossAxisAlignment.start, 225 crossAxisAlignment: CrossAxisAlignment.start,
193 children: [ 226 children: [
  227 + _textfield('酒水名称', '请输入', wineNameC, wineF, ''),
194 _textfield( 228 _textfield(
195 - '酒水名称', '剑南春52度500ml', wineNameC, wineF, ''),  
196 - _textfield(  
197 - '酒水单价', '1299', winePriceC, winePriceF, '元'),  
198 - _textfield('酒水规格', '份', winePerC, winePerF, ''), 229 + '酒水单价', '请输入', winePriceC, winePriceF, '元',
  230 + inputType: TextInputType.numberWithOptions()),
  231 + _textfield('酒水规格', '请输入', winePerC, winePerF, ''),
199 Container( 232 Container(
200 height: w(48), 233 height: w(48),
201 margin: EdgeInsets.only(top: w(12)), 234 margin: EdgeInsets.only(top: w(12)),
@@ -252,7 +285,21 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> { @@ -252,7 +285,21 @@ class _FeastWineManageEditPageState extends State<FeastWineManageEditPage> {
252 isSelect: false)), 285 isSelect: false)),
253 Expanded( 286 Expanded(
254 child: _callButton( 287 child: _callButton(
255 - onPress: () {}, 288 + onPress: () {
  289 + if (wineNameC.text.trim().length == 0) {
  290 + Utils.showToast('请输入酒水名称');
  291 + return;
  292 + }
  293 + if (winePriceC.text.trim().length == 0) {
  294 + Utils.showToast('请输入酒水单价');
  295 + return;
  296 + }
  297 + if (winePerC.text.trim().length == 0) {
  298 + Utils.showToast('请输入酒水规格');
  299 + return;
  300 + }
  301 + _setWine();
  302 + },
256 content: '保存', 303 content: '保存',
257 hasLeftBorder: true, 304 hasLeftBorder: true,
258 isSelect: true)) 305 isSelect: true))
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
2 import 'package:flutter_screenutil/flutter_screenutil.dart'; 2 import 'package:flutter_screenutil/flutter_screenutil.dart';
  3 +import 'package:one_key/models/wine_model.dart';
3 import 'package:one_key/route/navigator_util.dart'; 4 import 'package:one_key/route/navigator_util.dart';
4 import 'package:one_key/widgets/v_empty_view.dart'; 5 import 'package:one_key/widgets/v_empty_view.dart';
  6 +import 'package:provider/provider.dart';
5 7
  8 +import '../../../constant/state.dart';
  9 +import '../../../provider/feast_model.dart';
  10 +import '../../../provider/user_model.dart';
6 import '../../../res/colors.dart'; 11 import '../../../res/colors.dart';
7 import '../../../utils/dialog_util.dart'; 12 import '../../../utils/dialog_util.dart';
  13 +import '../../../utils/event_bus.dart';
8 import '../../../utils/screen_util.dart'; 14 import '../../../utils/screen_util.dart';
9 import '../../../utils/utils.dart'; 15 import '../../../utils/utils.dart';
10 import '../../../widgets/h_empty_view.dart'; 16 import '../../../widgets/h_empty_view.dart';
  17 +import '../../../widgets/page_exception.dart';
11 import '../../../widgets/round_button.dart'; 18 import '../../../widgets/round_button.dart';
12 import '../../../widgets/system_app_bar.dart'; 19 import '../../../widgets/system_app_bar.dart';
13 20
@@ -23,16 +30,37 @@ class FeastWineManagePage extends StatefulWidget { @@ -23,16 +30,37 @@ class FeastWineManagePage extends StatefulWidget {
23 } 30 }
24 31
25 class _FeastWineManagePageState extends State<FeastWineManagePage> { 32 class _FeastWineManagePageState extends State<FeastWineManagePage> {
  33 + FeastModel feastModel;
26 @override 34 @override
27 void initState() { 35 void initState() {
28 super.initState(); 36 super.initState();
29 Utils.changeStatusColor(color: MyColours.color_438E93); 37 Utils.changeStatusColor(color: MyColours.color_438E93);
  38 + WidgetsBinding.instance.addPostFrameCallback((_) {
  39 + _getWine();
  40 + // scrollController.jumpTo(scrollController.position.minScrollExtent);
  41 + });
  42 + bus.on("feast_wine_list", (arg) {
  43 + _getWine();
  44 + });
  45 + }
  46 +
  47 + @override
  48 + void dispose() {
  49 + bus.off('feast_wine_list');
  50 + super.dispose();
  51 + }
  52 +
  53 + ///获取宴会分类
  54 + Future<bool> _getWine({bool isShowLoading = true}) async {
  55 + await feastModel.getWine(context, isShowLoading: isShowLoading);
30 } 56 }
31 57
32 Widget buildFeastTypeHeader() { 58 Widget buildFeastTypeHeader() {
33 return RoundButton( 59 return RoundButton(
34 onPressed: () async { 60 onPressed: () async {
35 - NavigatorUtil.goFeastWineManageEditPage(context); 61 + NavigatorUtil.goFeastWineManageEditPage(
  62 + context,
  63 + );
36 }, 64 },
37 text: '添加一项', 65 text: '添加一项',
38 fontSize: 32, 66 fontSize: 32,
@@ -48,26 +76,28 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> { @@ -48,26 +76,28 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> {
48 ); 76 );
49 } 77 }
50 78
51 - Widget buildFeastTypeItem(String title, String subTitle) { 79 + Widget buildFeastTypeItem(WineSunModel data, int index) {
52 return Container( 80 return Container(
53 height: h(48), 81 height: h(48),
54 margin: EdgeInsets.only(top: w(12)), 82 margin: EdgeInsets.only(top: w(12)),
55 decoration: BoxDecoration( 83 decoration: BoxDecoration(
56 border: Border( 84 border: Border(
57 - bottom: BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))), 85 + bottom:
  86 + BorderSide(width: w(0.5), color: MyColours.color_E7E7E7))),
58 child: Row( 87 child: Row(
59 children: [ 88 children: [
60 Column( 89 Column(
61 crossAxisAlignment: CrossAxisAlignment.start, 90 crossAxisAlignment: CrossAxisAlignment.start,
62 children: [ 91 children: [
63 Text( 92 Text(
64 - title, 93 + data.wineName,
65 style: TextStyle( 94 style: TextStyle(
66 fontSize: font(16), color: MyColours.color_E6000000), 95 fontSize: font(16), color: MyColours.color_E6000000),
67 ), 96 ),
68 VEmptyView(12), 97 VEmptyView(12),
69 Text( 98 Text(
70 - subTitle, 99 + // '剑南春52度500ml', '1150元/份 不可议价'
  100 + '${data.price}元/${data.spec} ${data.bargaining == '1' ? '可议价' : '不可议价'}',
71 style: TextStyle( 101 style: TextStyle(
72 fontSize: font(12), color: MyColours.color_999999), 102 fontSize: font(12), color: MyColours.color_999999),
73 ) 103 )
@@ -76,7 +106,8 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> { @@ -76,7 +106,8 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> {
76 Spacer(), 106 Spacer(),
77 InkWell( 107 InkWell(
78 onTap: () { 108 onTap: () {
79 - NavigatorUtil.goFeastWineManageEditPage(context); 109 + NavigatorUtil.goFeastWineManageEditPage(context,
  110 + isNew: false, wineSunModel: data);
80 }, 111 },
81 child: Text( 112 child: Text(
82 '修改', 113 '修改',
@@ -93,7 +124,7 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> { @@ -93,7 +124,7 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> {
93 DialogUtil.cupertinoAlertDialogFeast(context, 124 DialogUtil.cupertinoAlertDialogFeast(context,
94 rTitle: '删除', 125 rTitle: '删除',
95 title: "是否确认删除", 126 title: "是否确认删除",
96 - content: "剑南春52度500ml", lCallback: () { 127 + content: data.wineName, lCallback: () {
97 print("取消"); 128 print("取消");
98 }, rCallback: () { 129 }, rCallback: () {
99 print("确定"); 130 print("确定");
@@ -101,7 +132,7 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> { @@ -101,7 +132,7 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> {
101 }); 132 });
102 }, 133 },
103 child: Image.asset( 134 child: Image.asset(
104 - Utils.getImgPath(true ? 'f_delete_red_un' : 'f_delete_red'), 135 + Utils.getImgPath('f_delete_red'),
105 width: w(32), 136 width: w(32),
106 height: w(32), 137 height: w(32),
107 )), 138 )),
@@ -153,24 +184,25 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> { @@ -153,24 +184,25 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> {
153 184
154 @override 185 @override
155 Widget build(BuildContext context) { 186 Widget build(BuildContext context) {
  187 + feastModel = Provider.of<FeastModel>(context, listen: true);
156 return Scaffold( 188 return Scaffold(
157 - backgroundColor: MyColours.color_ffffff,  
158 - appBar: SystemAppBar(  
159 - '酒水管理',  
160 - needWhite: true,  
161 - bgColor: MyColours.color_438E93,  
162 - titleColor: MyColours.color_F6F6F6,  
163 - onTap: () {  
164 - Navigator.pop(context);  
165 - },  
166 - ),  
167 - body: Column(  
168 - children: [  
169 - Expanded(  
170 - child: NestedScrollView(  
171 - // controller: _scrollViewController,  
172 - headerSliverBuilder:  
173 - (BuildContext context, bool innerBoxIsScrolled) { 189 + backgroundColor: MyColours.color_ffffff,
  190 + appBar: SystemAppBar(
  191 + '酒水管理',
  192 + needWhite: true,
  193 + bgColor: MyColours.color_438E93,
  194 + titleColor: MyColours.color_F6F6F6,
  195 + onTap: () {
  196 + Navigator.pop(context);
  197 + },
  198 + ),
  199 + body: Column(
  200 + children: [
  201 + Expanded(
  202 + child: NestedScrollView(
  203 + // controller: _scrollViewController,
  204 + headerSliverBuilder:
  205 + (BuildContext context, bool innerBoxIsScrolled) {
174 return <Widget>[ 206 return <Widget>[
175 SliverAppBar( 207 SliverAppBar(
176 pinned: true, 208 pinned: true,
@@ -185,34 +217,47 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> { @@ -185,34 +217,47 @@ class _FeastWineManagePageState extends State<FeastWineManagePage> {
185 // title: buildFeastTypeHeader()) 217 // title: buildFeastTypeHeader())
186 ) 218 )
187 ]; 219 ];
188 - },  
189 - body: ListView.builder(  
190 - itemCount: 100,  
191 - padding: EdgeInsets.only(left: w(16)),  
192 - itemBuilder: (BuildContext context, int index) {  
193 - return buildFeastTypeItem('剑南春52度500ml', '1150元/份 不可议价');  
194 - }),  
195 - )),  
196 - Row(  
197 - children: [  
198 - Expanded(  
199 - child: _callButton(  
200 - onPress: () {  
201 - Navigator.pop(context);  
202 - },  
203 - content: '返回',  
204 - hasLeftBorder: true,  
205 - isSelect: false)),  
206 - Expanded(  
207 - child: _callButton(  
208 - onPress: () {},  
209 - content: '保存',  
210 - hasLeftBorder: true,  
211 - isSelect: true))  
212 - ],  
213 - )  
214 - ],  
215 - ),  
216 - ); 220 + }, body: Consumer<FeastModel>(builder: (context, model, _) {
  221 + if (model.pageStateWine != PageState.Success) {
  222 + return ExceptionPage(
  223 + pageState: model.pageStateWine,
  224 + callback: () {
  225 + _getWine();
  226 + },
  227 + emptyMsg: "暂时没有酒水哦",
  228 + emptyImg: "empty_search",
  229 + showMsg: "加载中,请稍后...",
  230 + );
  231 + } else {
  232 + return ListView.builder(
  233 + itemCount: feastModel.wineData.length,
  234 + padding: EdgeInsets.only(left: w(16)),
  235 + itemBuilder: (BuildContext context, int index) {
  236 + WineSunModel data = feastModel.wineData[index];
  237 + return buildFeastTypeItem(data, index);
  238 + // '剑南春52度500ml', '1150元/份 不可议价'
  239 + });
  240 + }
  241 + }))),
  242 + // Row(
  243 + // children: [
  244 + // Expanded(
  245 + // child: _callButton(
  246 + // onPress: () {
  247 + // Navigator.pop(context);
  248 + // },
  249 + // content: '返回',
  250 + // hasLeftBorder: true,
  251 + // isSelect: false)),
  252 + // Expanded(
  253 + // child: _callButton(
  254 + // onPress: () {},
  255 + // content: '保存',
  256 + // hasLeftBorder: true,
  257 + // isSelect: true))
  258 + // ],
  259 + // )
  260 + ],
  261 + ));
217 } 262 }
218 } 263 }
@@ -5,8 +5,12 @@ import 'package:provider/provider.dart'; @@ -5,8 +5,12 @@ import 'package:provider/provider.dart';
5 5
6 import '../constant/constant.dart'; 6 import '../constant/constant.dart';
7 import '../constant/error.dart'; 7 import '../constant/error.dart';
  8 +import '../models/classify_model.dart';
8 import '../models/filter_btn_model.dart'; 9 import '../models/filter_btn_model.dart';
9 import '../models/get_seller_user_by_sellerid_model.dart'; 10 import '../models/get_seller_user_by_sellerid_model.dart';
  11 +import '../models/get_staff_model.dart';
  12 +import '../models/personnel_manage_model.dart';
  13 +import '../models/wine_model.dart';
10 import '../net/base_resp.dart'; 14 import '../net/base_resp.dart';
11 import '../net/dio_util.dart'; 15 import '../net/dio_util.dart';
12 import '../net/http_url.dart'; 16 import '../net/http_url.dart';
@@ -17,39 +21,410 @@ class FeastModel extends ChangeNotifier { @@ -17,39 +21,410 @@ class FeastModel extends ChangeNotifier {
17 21
18 List<FilterBtnModel> sellerManageList = []; //经理数据 ---- 商家编辑页面 22 List<FilterBtnModel> sellerManageList = []; //经理数据 ---- 商家编辑页面
19 23
20 - ///商家详情编辑页面 ------ 获取经理数据  
21 - Future<List<FilterBtnModel>> getSellerUserBySellerid(BuildContext context, 24 + PageState pageStatePersonnalHome = PageState.Loading; //员工管理
  25 + List<String> selectPersonnalData = [];
  26 + bool checkValue = false;
  27 + List<String> getPersonnalList = []; //宴会员工
  28 +
  29 + PageState pageStateType = PageState.Loading; //宴会类型
  30 + List<ClassifySunModel> classifyData = [];
  31 +
  32 + PageState pageStateWine = PageState.Loading; //酒水
  33 + List<WineSunModel> wineData = [];
  34 +
  35 + /***
  36 + *
  37 + * 宴会员工
  38 + */
  39 +
  40 + //全选按钮执行“全选”
  41 + addAllMy() async {
  42 + //把数据状态全部改成true,即选中状态
  43 + selectPersonnalData = [];
  44 + for (var i = 0; i < sellerManageList.length; i++) {
  45 + sellerManageList[i].select = true;
  46 + selectPersonnalData.add(sellerManageList[i].id);
  47 + }
  48 + checkValue = true;
  49 + notifyListeners();
  50 + }
  51 +
  52 +//全选按钮执行“全不选”
  53 + cancelAllMy() async {
  54 + selectPersonnalData = [];
  55 + //把数据状态全部改成false,即不选中状态
  56 + for (var i = 0; i < sellerManageList.length; i++) {
  57 + sellerManageList[i].select = false;
  58 + }
  59 +
  60 + checkValue = false;
  61 + notifyListeners();
  62 + }
  63 +
  64 +//选中
  65 + addDataMy(int index) {
  66 + // userHistorys[index].select = true;
  67 + selectPersonnalData.add(sellerManageList[index].id);
  68 + notifyListeners();
  69 + }
  70 +
  71 +//未选中
  72 + cancelDataMy(int index) {
  73 + // userHistorys[index].select = false;
  74 + selectPersonnalData
  75 + .removeWhere((element) => element == sellerManageList[index].id);
  76 + notifyListeners();
  77 + }
  78 +
  79 + //获取全选按钮的状态 true or false
  80 + getCheckValueMy() {
  81 + bool temp = sellerManageList.any((value) {
  82 + return value.select == false;
  83 + });
  84 + if (temp == true) {
  85 + checkValue = false;
  86 + } else {
  87 + checkValue = true;
  88 + }
  89 + notifyListeners();
  90 + }
  91 +
  92 + FilterBtnModel returnModel(PersonnelManageSunModel item) {
  93 + FilterBtnModel model = FilterBtnModel();
  94 + model.id = item.id;
  95 + model.title = item.nickName ?? item.account;
  96 + model.account = item.account;
  97 + model.phone = item.phone;
  98 + return model;
  99 + }
  100 +
  101 + /// 获取店员列表
  102 + Future<bool> getAuthUserLists(BuildContext context,
  103 + {showLoading = false}) async {
  104 + Map<String, String> params = {
  105 + "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  106 + };
  107 + BaseResp<dynamic> baseResp = await DioUtil()
  108 + .request<dynamic>(context, Method.get, HttpUrl.get_auth_user_lists,
  109 + data: params, showLoading: showLoading)
  110 + .catchError((error) {
  111 + print(error.toString());
  112 + if (error is MyError) {
  113 + switch (error.type) {
  114 + case 1:
  115 + pageStatePersonnalHome = PageState.ConnectivityError;
  116 + break;
  117 + case 2:
  118 + pageStatePersonnalHome = PageState.ConnectivityTimeOut;
  119 + break;
  120 + default:
  121 + pageStatePersonnalHome = PageState.ConnectivityError;
  122 + break;
  123 + }
  124 + }
  125 + notifyListeners();
  126 + return false;
  127 + });
  128 + if (baseResp != null && baseResp.code == Constant.status_success) {
  129 + Map data = baseResp.data;
  130 + Map<String, dynamic> tempData = {};
  131 + data.forEach((key, value) {
  132 + String keyTemp = key.split('_')[0];
  133 + String role_id = key.split('_')[1];
  134 + tempData[keyTemp] = {'listdata': value, 'role_id': role_id};
  135 + });
  136 + baseResp.responseData['data'] = tempData;
  137 + PersonnelManageModelData dataMap =
  138 + PersonnelManageModel.fromJson(baseResp.responseData).data;
  139 + sellerManageList = [];
  140 + for (PersonnelManageSunModel item in dataMap.admin.listdata) {
  141 + FilterBtnModel model = returnModel(item);
  142 + model.roleName = '管理员';
  143 + sellerManageList.add(model);
  144 + }
  145 +
  146 + for (PersonnelManageSunModel item in dataMap.cashier.listdata) {
  147 + FilterBtnModel model = returnModel(item);
  148 + model.roleName = '收银员';
  149 + sellerManageList.add(model);
  150 + }
  151 +
  152 + for (PersonnelManageSunModel item in dataMap.manager.listdata) {
  153 + FilterBtnModel model = returnModel(item);
  154 + model.roleName = '客户经理';
  155 + sellerManageList.add(model);
  156 + }
  157 + for (PersonnelManageSunModel item in dataMap.shopowner.listdata) {
  158 + FilterBtnModel model = returnModel(item);
  159 + model.roleName = '店长';
  160 + sellerManageList.add(model);
  161 + }
  162 +
  163 + for (PersonnelManageSunModel item in dataMap.waiter.listdata) {
  164 + FilterBtnModel model = returnModel(item);
  165 + model.roleName = '服务员';
  166 + sellerManageList.add(model);
  167 + }
  168 + pageStatePersonnalHome = PageState.Success;
  169 + notifyListeners();
  170 + return true;
  171 + } else {
  172 + Utils.showToast(baseResp.msg ?? "");
  173 + pageStatePersonnalHome = PageState.ConnectivityError;
  174 + notifyListeners();
  175 + return false;
  176 + }
  177 + }
  178 +
  179 + ///添加宴会员工
  180 + Future<dynamic> addStaff(BuildContext context, Map<String, String> params,
22 {isShowLoading = true}) async { 181 {isShowLoading = true}) async {
  182 + BaseResp<dynamic> baseResp = await DioUtil()
  183 + .request<dynamic>(context, Method.get, HttpUrl.add_staff,
  184 + data: params, showLoading: isShowLoading)
  185 + .catchError((error) {
  186 + print(error.toString());
  187 + if (error is MyError) {}
  188 + return false;
  189 + });
  190 + if (baseResp.code == Constant.status_success) {
  191 + // if (baseResp.data == 1) {
  192 + return true;
  193 + // } else {
  194 + // return false;
  195 + // }
  196 + } else {
  197 + if (baseResp != null) {
  198 + Utils.showToast(baseResp.msg ?? "");
  199 + }
  200 + return false;
  201 + }
  202 + }
  203 +
  204 + ///获取宴会员工
  205 + Future<bool> getStaff(BuildContext context, {isShowLoading = true}) async {
23 Map<String, String> params = { 206 Map<String, String> params = {
24 - 'sellerid': Provider.of<UserModel>(context, listen: false).user.sellerid 207 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
25 }; 208 };
26 BaseResp<dynamic> baseResp = await DioUtil() 209 BaseResp<dynamic> baseResp = await DioUtil()
27 - .request<dynamic>(  
28 - context, Method.get, HttpUrl.get_seller_user_by_sellerid,  
29 - data: params, showLoading: false) 210 + .request<dynamic>(context, Method.get, HttpUrl.get_staff,
  211 + data: params, showLoading: isShowLoading)
30 .catchError((error) { 212 .catchError((error) {
31 print(error.toString()); 213 print(error.toString());
32 if (error is MyError) {} 214 if (error is MyError) {}
  215 + return false;
  216 + });
  217 + getPersonnalList = [];
  218 + GetStaffModel getStaffModel = GetStaffModel.fromJson(baseResp.responseData);
  219 + if (getStaffModel.ret == Constant.status_success) {
  220 + List<GetStaffSunModel> data = getStaffModel.data;
  221 + data.forEach((element) {
  222 + getPersonnalList.add(element.userId);
  223 + });
  224 + return true;
  225 + } else {
  226 + Utils.showToast(baseResp.msg ?? "");
  227 + return false;
  228 + }
  229 + }
  230 +
  231 + /**
  232 + * 宴会类型
  233 + */
  234 +
  235 + ///添加宴会类型
  236 + Future<dynamic> setClassify(BuildContext context, Map<String, String> params,
  237 + {isShowLoading = true}) async {
  238 + BaseResp<dynamic> baseResp = await DioUtil()
  239 + .request<dynamic>(context, Method.get, HttpUrl.set_classify,
  240 + data: params, showLoading: isShowLoading)
  241 + .catchError((error) {
  242 + print(error.toString());
  243 + if (error is MyError) {}
  244 + return false;
33 }); 245 });
34 if (baseResp.code == Constant.status_success) { 246 if (baseResp.code == Constant.status_success) {
35 - List<GetSellerUserBySelleridSunModel> sunmodel =  
36 - GetSellerUserBySelleridModel.fromJson(baseResp.responseData).data;  
37 - sellerManageList = [];  
38 - if (sunmodel != null && sunmodel.length > 0) {  
39 - for (GetSellerUserBySelleridSunModel item in sunmodel) {  
40 - if (item.nickName != null) {  
41 - FilterBtnModel model = FilterBtnModel();  
42 - model.id = item.id;  
43 - model.title = item.nickName;  
44 - sellerManageList.add(model);  
45 - } 247 + // if (baseResp.data == 1) {
  248 + return true;
  249 + // } else {
  250 + // return false;
  251 + // }
  252 + } else {
  253 + if (baseResp != null) {
  254 + Utils.showToast(baseResp.msg ?? "");
  255 + }
  256 + return false;
  257 + }
  258 + }
  259 +
  260 + ///获取宴会类型
  261 + Future<bool> getClassify(BuildContext context, {isShowLoading = true}) async {
  262 + Map<String, String> params = {
  263 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  264 + };
  265 + BaseResp<dynamic> baseResp = await DioUtil()
  266 + .request<dynamic>(context, Method.get, HttpUrl.get_classify,
  267 + data: params, showLoading: isShowLoading)
  268 + .catchError((error) {
  269 + print(error.toString());
  270 + if (error is MyError) {
  271 + switch (error.type) {
  272 + case 1:
  273 + pageStateType = PageState.ConnectivityError;
  274 + break;
  275 + case 2:
  276 + pageStateType = PageState.ConnectivityTimeOut;
  277 + break;
  278 + default:
  279 + pageStateType = PageState.ConnectivityError;
  280 + break;
46 } 281 }
47 } 282 }
  283 + notifyListeners();
  284 + return false;
  285 + });
  286 +
  287 + ClassifyModel classifyModel = ClassifyModel.fromJson(baseResp.responseData);
  288 + if (classifyModel.ret == Constant.status_success) {
  289 + classifyData = classifyModel.data;
  290 + if (classifyData.length == 0) {
  291 + pageStateType = PageState.Empty;
  292 + } else {
  293 + pageStateType = PageState.Success;
  294 + }
  295 +
  296 + notifyListeners();
  297 + return true;
  298 + } else {
  299 + Utils.showToast(baseResp.msg ?? "");
  300 + pageStateType = PageState.ConnectivityError;
  301 + notifyListeners();
  302 + return false;
  303 + }
  304 + }
  305 +
  306 + ///删除宴会类型
  307 + Future<dynamic> delClassify(BuildContext context, Map<String, String> params,
  308 + {isShowLoading = true}) async {
  309 + BaseResp<dynamic> baseResp = await DioUtil()
  310 + .request<dynamic>(context, Method.get, HttpUrl.del_classify,
  311 + data: params, showLoading: isShowLoading)
  312 + .catchError((error) {
  313 + print(error.toString());
  314 + if (error is MyError) {}
  315 + return false;
  316 + });
  317 + if (baseResp.code == Constant.status_success) {
  318 + // if (baseResp.data == 1) {
  319 + return true;
  320 + // } else {
  321 + // return false;
  322 + // }
  323 + } else {
  324 + if (baseResp != null) {
  325 + Utils.showToast(baseResp.msg ?? "");
  326 + }
  327 + return false;
  328 + }
  329 + }
  330 +
  331 + /**
  332 + * 酒水
  333 + */
  334 +
  335 + ///添加酒水
  336 + Future<dynamic> setWine(BuildContext context, Map<String, String> params,
  337 + {isShowLoading = true}) async {
  338 + BaseResp<dynamic> baseResp = await DioUtil()
  339 + .request<dynamic>(context, Method.get, HttpUrl.set_wine,
  340 + data: params, showLoading: isShowLoading)
  341 + .catchError((error) {
  342 + print(error.toString());
  343 + if (error is MyError) {}
  344 + return false;
  345 + });
  346 + if (baseResp.code == Constant.status_success) {
  347 + // if (baseResp.data == 1) {
  348 + return true;
  349 + // } else {
  350 + // return false;
  351 + // }
  352 + } else {
  353 + if (baseResp != null) {
  354 + Utils.showToast(baseResp.msg ?? "");
  355 + }
  356 + return false;
  357 + }
  358 + }
  359 +
  360 + ///获取酒水
  361 + Future<bool> getWine(BuildContext context, {isShowLoading = true}) async {
  362 + Map<String, String> params = {
  363 + "sid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  364 + };
  365 + BaseResp<dynamic> baseResp = await DioUtil()
  366 + .request<dynamic>(context, Method.get, HttpUrl.get_wine,
  367 + data: params, showLoading: isShowLoading)
  368 + .catchError((error) {
  369 + print(error.toString());
  370 + if (error is MyError) {
  371 + switch (error.type) {
  372 + case 1:
  373 + pageStateWine = PageState.ConnectivityError;
  374 + break;
  375 + case 2:
  376 + pageStateWine = PageState.ConnectivityTimeOut;
  377 + break;
  378 + default:
  379 + pageStateWine = PageState.ConnectivityError;
  380 + break;
  381 + }
  382 + }
  383 + notifyListeners();
  384 + return false;
  385 + });
  386 +
  387 + WineModel wineModel = WineModel.fromJson(baseResp.responseData);
  388 + if (wineModel.ret == Constant.status_success) {
  389 + wineData = wineModel.data;
  390 + if (wineData.length == 0) {
  391 + pageStateWine = PageState.Empty;
  392 + } else {
  393 + pageStateWine = PageState.Success;
  394 + }
  395 +
  396 + notifyListeners();
  397 + return true;
  398 + } else {
  399 + Utils.showToast(baseResp.msg ?? "");
  400 + pageStateWine = PageState.ConnectivityError;
  401 + notifyListeners();
  402 + return false;
  403 + }
  404 + }
  405 +
  406 + ///删除酒水
  407 + Future<dynamic> delWine(BuildContext context, Map<String, String> params,
  408 + {isShowLoading = true}) async {
  409 + BaseResp<dynamic> baseResp = await DioUtil()
  410 + .request<dynamic>(context, Method.get, HttpUrl.del_wine,
  411 + data: params, showLoading: isShowLoading)
  412 + .catchError((error) {
  413 + print(error.toString());
  414 + if (error is MyError) {}
  415 + return false;
  416 + });
  417 + if (baseResp.code == Constant.status_success) {
  418 + // if (baseResp.data == 1) {
  419 + return true;
  420 + // } else {
  421 + // return false;
  422 + // }
48 } else { 423 } else {
49 if (baseResp != null) { 424 if (baseResp != null) {
50 Utils.showToast(baseResp.msg ?? ""); 425 Utils.showToast(baseResp.msg ?? "");
51 } 426 }
  427 + return false;
52 } 428 }
53 - return sellerManageList;  
54 } 429 }
55 } 430 }
@@ -26,6 +26,7 @@ import 'package:one_key/utils/utils.dart'; @@ -26,6 +26,7 @@ import 'package:one_key/utils/utils.dart';
26 import 'package:sqflite/sqlite_api.dart'; 26 import 'package:sqflite/sqlite_api.dart';
27 27
28 import '../app.dart'; 28 import '../app.dart';
  29 +import '../models/wine_model.dart';
29 30
30 class NavigatorUtil { 31 class NavigatorUtil {
31 static Future _navigateTo(BuildContext context, String path, 32 static Future _navigateTo(BuildContext context, String path,
@@ -943,8 +944,9 @@ class NavigatorUtil { @@ -943,8 +944,9 @@ class NavigatorUtil {
943 944
944 ///宴会----宴会管理 --- 酒水添加 945 ///宴会----宴会管理 --- 酒水添加
945 static Future<dynamic> goFeastWineManageEditPage(BuildContext context, 946 static Future<dynamic> goFeastWineManageEditPage(BuildContext context,
946 - {replace = false, bool onlyShow = false}) {  
947 - return _navigateTo(context, "${Routes.feast_wine_manage_edit_page}", 947 + {replace = false, bool isNew = true, WineSunModel wineSunModel}) {
  948 + return _navigateTo(context,
  949 + "${Routes.feast_wine_manage_edit_page}?wineSunModel=${FluroConvertUtils.object2string(wineSunModel)}&isNew=$isNew",
948 replace: replace); 950 replace: replace);
949 } 951 }
950 952
@@ -18,6 +18,7 @@ import 'package:one_key/models/sms_info.dart'; @@ -18,6 +18,7 @@ import 'package:one_key/models/sms_info.dart';
18 import 'package:one_key/models/statics_model.dart'; 18 import 'package:one_key/models/statics_model.dart';
19 import 'package:one_key/models/table_list.dart'; 19 import 'package:one_key/models/table_list.dart';
20 import 'package:one_key/models/user_history_entity.dart'; 20 import 'package:one_key/models/user_history_entity.dart';
  21 +import 'package:one_key/models/wine_model.dart';
21 import 'package:one_key/pages/coupon/coupon_create_select_type_page.dart'; 22 import 'package:one_key/pages/coupon/coupon_create_select_type_page.dart';
22 import 'package:one_key/pages/coupon/coupon_detail_page.dart'; 23 import 'package:one_key/pages/coupon/coupon_detail_page.dart';
23 import 'package:one_key/pages/coupon/coupon_edit_page.dart'; 24 import 'package:one_key/pages/coupon/coupon_edit_page.dart';
@@ -1493,7 +1494,18 @@ var feastWineManagePageHandle = new Handler( @@ -1493,7 +1494,18 @@ var feastWineManagePageHandle = new Handler(
1493 var feastWineManageEditPageHandle = new Handler( 1494 var feastWineManageEditPageHandle = new Handler(
1494 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { 1495 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
1495 // String uids = params["uids"].first; 1496 // String uids = params["uids"].first;
  1497 + bool isNew = FluroConvertUtils.string2bool(params["isNew"].first);
  1498 + if (!isNew) {
  1499 + WineSunModel wineSunModel = WineSunModel.fromJson(json.decode(
  1500 + FluroConvertUtils.fluroCnParamsDecode(params["wineSunModel"].first)));
  1501 +//
  1502 + // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
  1503 + return ChangeNotifierProvider<FeastModel>(
  1504 + create: (_) => FeastModel(),
  1505 + child: FeastWineManageEditPage(wineSunModel: wineSunModel));
  1506 + }
1496 1507
  1508 +//
1497 // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first); 1509 // bool onlyShow = FluroConvertUtils.string2bool(params["onlyShow"].first);
1498 return ChangeNotifierProvider<FeastModel>( 1510 return ChangeNotifierProvider<FeastModel>(
1499 create: (_) => FeastModel(), child: FeastWineManageEditPage()); 1511 create: (_) => FeastModel(), child: FeastWineManageEditPage());
@@ -1519,7 +1531,6 @@ var feastOthersetManageEditPageHandle = new Handler( @@ -1519,7 +1531,6 @@ var feastOthersetManageEditPageHandle = new Handler(
1519 create: (_) => FeastModel(), child: FeastOthersetManageEditPage()); 1531 create: (_) => FeastModel(), child: FeastOthersetManageEditPage());
1520 }); 1532 });
1521 1533
1522 -  
1523 ///宴会---定金管理 1534 ///宴会---定金管理
1524 var feastDepositManagePageHandle = new Handler( 1535 var feastDepositManagePageHandle = new Handler(
1525 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { 1536 handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
@@ -1539,10 +1550,3 @@ var feastDepositTypePageHandle = new Handler( @@ -1539,10 +1550,3 @@ var feastDepositTypePageHandle = new Handler(
1539 return ChangeNotifierProvider<FeastModel>( 1550 return ChangeNotifierProvider<FeastModel>(
1540 create: (_) => FeastModel(), child: FeastDepositTypePage()); 1551 create: (_) => FeastModel(), child: FeastDepositTypePage());
1541 }); 1552 });
1542 -  
1543 -  
1544 -  
1545 -  
1546 -  
1547 -  
1548 -  
@@ -659,14 +659,14 @@ packages: @@ -659,14 +659,14 @@ packages:
659 name: json_annotation 659 name: json_annotation
660 url: "https://pub.flutter-io.cn" 660 url: "https://pub.flutter-io.cn"
661 source: hosted 661 source: hosted
662 - version: "4.5.0" 662 + version: "4.6.0"
663 json_serializable: 663 json_serializable:
664 dependency: "direct dev" 664 dependency: "direct dev"
665 description: 665 description:
666 name: json_serializable 666 name: json_serializable
667 url: "https://pub.flutter-io.cn" 667 url: "https://pub.flutter-io.cn"
668 source: hosted 668 source: hosted
669 - version: "6.2.0" 669 + version: "6.3.1"
670 logging: 670 logging:
671 dependency: transitive 671 dependency: transitive
672 description: 672 description:
@@ -28,7 +28,7 @@ dependencies: @@ -28,7 +28,7 @@ dependencies:
28 # cupertino_icons: ^0.1.2 28 # cupertino_icons: ^0.1.2
29 cupertino_icons: ^1.0.4 29 cupertino_icons: ^1.0.4
30 30
31 - json_annotation: ^4.5.0 31 + json_annotation: ^4.6.0
32 # 状态管理 32 # 状态管理
33 provider: ^6.0.3 33 provider: ^6.0.3
34 # provider: ^4.0.4 34 # provider: ^4.0.4