Showing
15 changed files
with
890 additions
and
53 deletions
| @@ -352,4 +352,8 @@ class HttpUrl { | @@ -352,4 +352,8 @@ class HttpUrl { | ||
| 352 | static const String get_plan_cook_by_rid = | 352 | static const String get_plan_cook_by_rid = |
| 353 | "?service=App.PlanCook.GetPlanCookByRid"; // 根据预定ID获取排菜 | 353 | "?service=App.PlanCook.GetPlanCookByRid"; // 根据预定ID获取排菜 |
| 354 | 354 | ||
| 355 | + static const String create_order = | ||
| 356 | + "?service=App.Advance.CreateOrder"; // 跳转小程序提前点餐调用该接口生成oid | ||
| 357 | + | ||
| 358 | + | ||
| 355 | } | 359 | } |
| @@ -105,12 +105,17 @@ class _CouponSunPageState extends State<CouponSunPage> { | @@ -105,12 +105,17 @@ class _CouponSunPageState extends State<CouponSunPage> { | ||
| 105 | callback: () { | 105 | callback: () { |
| 106 | // offset = 0; | 106 | // offset = 0; |
| 107 | // getMessage(showLoading: true); | 107 | // getMessage(showLoading: true); |
| 108 | - _couponNetworkData(widget.index); | 108 | + |
| 109 | + if (pageState == PageState.Empty) { | ||
| 110 | + NavigatorUtil.goCouponHistoryPage(context); | ||
| 111 | + } else { | ||
| 112 | + _couponNetworkData(widget.index); | ||
| 113 | + } | ||
| 109 | }, | 114 | }, |
| 110 | emptyMsg: "暂时没有列表信息哦,", | 115 | emptyMsg: "暂时没有列表信息哦,", |
| 111 | emptyImg: "empty_search", | 116 | emptyImg: "empty_search", |
| 112 | showMsg: "加载中,请稍后...", | 117 | showMsg: "加载中,请稍后...", |
| 113 | - needEmpty: true, | 118 | + showText: '查看过期优惠券', |
| 114 | ); | 119 | ); |
| 115 | } else { | 120 | } else { |
| 116 | return EasyRefresh.custom( | 121 | return EasyRefresh.custom( |
| @@ -2609,10 +2609,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2609,10 +2609,11 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2609 | ? SizedBox() | 2609 | ? SizedBox() |
| 2610 | : Row( | 2610 | : Row( |
| 2611 | children: [ | 2611 | children: [ |
| 2612 | - detailEntity.order.cookbooklist | ||
| 2613 | - .length == | ||
| 2614 | - 0 | ||
| 2615 | - ? Expanded( | 2612 | + // detailEntity.order.cookbooklist |
| 2613 | + // .length == | ||
| 2614 | + // 0 | ||
| 2615 | + // ? | ||
| 2616 | + Expanded( | ||
| 2616 | flex: 1, | 2617 | flex: 1, |
| 2617 | child: InkWell( | 2618 | child: InkWell( |
| 2618 | onTap: () { | 2619 | onTap: () { |
| @@ -2652,8 +2653,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | @@ -2652,8 +2653,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { | ||
| 2652 | 34))), | 2653 | 34))), |
| 2653 | ), | 2654 | ), |
| 2654 | ), | 2655 | ), |
| 2655 | - )) | ||
| 2656 | - : SizedBox(), | 2656 | + )), |
| 2657 | + // : SizedBox(), | ||
| 2657 | Expanded( | 2658 | Expanded( |
| 2658 | flex: 2, | 2659 | flex: 2, |
| 2659 | child: InkWell( | 2660 | child: InkWell( |
| @@ -570,11 +570,14 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | @@ -570,11 +570,14 @@ class _MyCustomerDetailEditPageState extends State<MyCustomerDetailEditPage> { | ||
| 570 | )), | 570 | )), |
| 571 | 571 | ||
| 572 | VEmptyView(60), | 572 | VEmptyView(60), |
| 573 | - _textMulLine('忌口', '输入忌口的东西', jkController), | 573 | + _textMulLine( |
| 574 | + '忌口', '点这里输入客户忌口的东西,请用逗号隔开。', jkController), | ||
| 574 | VEmptyView(30), | 575 | VEmptyView(30), |
| 575 | - _textMulLine('喜好', '输入喜好', xhController), | 576 | + _textMulLine( |
| 577 | + '喜好', '点这里输入客户喜好的东西,请用逗号隔开。', xhController), | ||
| 576 | VEmptyView(30), | 578 | VEmptyView(30), |
| 577 | - _textMulLine('服务', '输入服务', fwController), | 579 | + _textMulLine('服务', '点这里输入客户需要的服务,如安静的包间、远离厕所等,请用逗号隔开。', |
| 580 | + fwController), | ||
| 578 | ], | 581 | ], |
| 579 | ))), | 582 | ))), |
| 580 | RoundButton( | 583 | RoundButton( |
| @@ -663,11 +663,14 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | @@ -663,11 +663,14 @@ class _CustomerDetailEditPageState extends State<CustomerDetailEditPage> { | ||
| 663 | ), | 663 | ), |
| 664 | )), | 664 | )), |
| 665 | VEmptyView(60), | 665 | VEmptyView(60), |
| 666 | - _textMulLine('忌口', '输入忌口的东西', jkController), | 666 | + _textMulLine( |
| 667 | + '忌口', '点这里输入客户忌口的东西,请用逗号隔开。', jkController), | ||
| 667 | VEmptyView(30), | 668 | VEmptyView(30), |
| 668 | - _textMulLine('喜好', '输入喜好', xhController), | 669 | + _textMulLine( |
| 670 | + '喜好', '点这里输入客户喜好的东西,请用逗号隔开。', xhController), | ||
| 669 | VEmptyView(30), | 671 | VEmptyView(30), |
| 670 | - _textMulLine('服务', '输入服务', fwController), | 672 | + _textMulLine('服务', '点这里输入客户需要的服务,如安静的包间、远离厕所等,请用逗号隔开。', |
| 673 | + fwController), | ||
| 671 | ], | 674 | ], |
| 672 | ))), | 675 | ))), |
| 673 | RoundButton( | 676 | RoundButton( |
| 1 | +import 'package:flutter/material.dart'; | ||
| 2 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 3 | +import 'package:one_key/constant/state.dart'; | ||
| 4 | +import 'package:one_key/models/customer_label_model.dart'; | ||
| 5 | +import 'package:one_key/models/guest_info_model.dart'; | ||
| 6 | +import 'package:one_key/provider/customer_provider.dart'; | ||
| 7 | +import 'package:one_key/provider/user_model.dart'; | ||
| 8 | +import 'package:one_key/res/colors.dart'; | ||
| 9 | +import 'package:one_key/route/navigator_util.dart'; | ||
| 10 | +import 'package:one_key/utils/dialog_util.dart'; | ||
| 11 | +import 'package:one_key/utils/event_bus.dart'; | ||
| 12 | +import 'package:one_key/utils/utils.dart'; | ||
| 13 | +import 'package:one_key/widgets/h_empty_view.dart'; | ||
| 14 | +import 'package:one_key/widgets/round_button.dart'; | ||
| 15 | +import 'package:one_key/widgets/system_app_bar.dart'; | ||
| 16 | +import 'package:one_key/widgets/v_empty_view.dart'; | ||
| 17 | +import 'package:provider/provider.dart'; | ||
| 18 | + | ||
| 19 | +import '../../models/notebook_detail.dart'; | ||
| 20 | +import '../../widgets/page_exception.dart'; | ||
| 21 | + | ||
| 22 | +class OrderCustomerDetailPage extends StatefulWidget { | ||
| 23 | + final NotebookDetail detailEntity; | ||
| 24 | + OrderCustomerDetailPage({Key key, this.detailEntity}) : super(key: key); | ||
| 25 | + | ||
| 26 | + @override | ||
| 27 | + _OrderCustomerDetailPageState createState() => | ||
| 28 | + _OrderCustomerDetailPageState(); | ||
| 29 | +} | ||
| 30 | + | ||
| 31 | +class _OrderCustomerDetailPageState extends State<OrderCustomerDetailPage> { | ||
| 32 | + List sexList = []; // 先生、女士、公司 | ||
| 33 | + TextEditingController nameController = TextEditingController(); | ||
| 34 | + FocusNode nameFocus = FocusNode(); | ||
| 35 | + String nameStr; | ||
| 36 | + TextEditingController phoneController = TextEditingController(); | ||
| 37 | + FocusNode phoneFocus = FocusNode(); | ||
| 38 | + TextEditingController adressController = TextEditingController(); | ||
| 39 | + FocusNode adressFocus = FocusNode(); | ||
| 40 | + TextEditingController departmentController = TextEditingController(); | ||
| 41 | + FocusNode departmentFocus = FocusNode(); | ||
| 42 | + TextEditingController positionController = TextEditingController(); | ||
| 43 | + FocusNode positionFocus = FocusNode(); | ||
| 44 | + TextEditingController jkController = TextEditingController(); | ||
| 45 | + TextEditingController xhController = TextEditingController(); | ||
| 46 | + TextEditingController fwController = TextEditingController(); | ||
| 47 | + bool showLabel = false; | ||
| 48 | + | ||
| 49 | + CustomerProvider customerProvider; | ||
| 50 | + String labelShow = ''; | ||
| 51 | + ScrollController scrollController = ScrollController(); | ||
| 52 | + @override | ||
| 53 | + void initState() { | ||
| 54 | + super.initState(); | ||
| 55 | + if ((widget.detailEntity.rnameStr == '' || | ||
| 56 | + widget.detailEntity.rnameStr == null) && | ||
| 57 | + (widget.detailEntity.phone == '' || | ||
| 58 | + widget.detailEntity.phone == null) && | ||
| 59 | + widget.detailEntity.status != "4") { | ||
| 60 | + //没有联系人 | ||
| 61 | + WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 62 | + customerProvider.pageStateGuestInfo = PageState.Empty; | ||
| 63 | + customerProvider.notifyListeners(); | ||
| 64 | + }); | ||
| 65 | + } else { | ||
| 66 | + _initSexList(); | ||
| 67 | + nameFocus.addListener(() { | ||
| 68 | + if (nameFocus.hasFocus) { | ||
| 69 | + print('得到焦点'); | ||
| 70 | + } else { | ||
| 71 | + print('失去焦点'); | ||
| 72 | + // _homeEnterModel.nameController.text = nameStr + _nameSuffix(); | ||
| 73 | + _addNameSuffix(nameStr, _nameSuffix()); | ||
| 74 | + } | ||
| 75 | + setState(() {}); | ||
| 76 | + }); | ||
| 77 | + WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 78 | + _getGuestInfo(); | ||
| 79 | + | ||
| 80 | + _getLabelBySellerid(); | ||
| 81 | + // scrollController.jumpTo(scrollController.position.minScrollExtent); | ||
| 82 | + }); | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + | ||
| 86 | + _getGuestInfo() async { | ||
| 87 | + Map<String, String> params = { | ||
| 88 | + "uid": Provider.of<UserModel>(context, listen: false).user.openid, | ||
| 89 | + "id": '195', | ||
| 90 | + 'phone': '18049359922' | ||
| 91 | + }; | ||
| 92 | + bool success = await customerProvider.getGuestInfo(context, params); | ||
| 93 | + if (success) { | ||
| 94 | + Guest guest = customerProvider.guestInfoSunModel.guest; | ||
| 95 | + if (guest.rname != '' && | ||
| 96 | + guest.rname != null && | ||
| 97 | + guest.sex != '' && | ||
| 98 | + guest.sex != null) { | ||
| 99 | + nameStr = guest.rname; | ||
| 100 | + for (var item in sexList) { | ||
| 101 | + item['select'] = false; | ||
| 102 | + if (item['code'] == guest.sex) { | ||
| 103 | + item['select'] = true; | ||
| 104 | + } | ||
| 105 | + } | ||
| 106 | + _addNameSuffix(nameStr, _nameSuffix()); | ||
| 107 | + } | ||
| 108 | + phoneController.text = guest.phone ?? ''; | ||
| 109 | + adressController.text = guest.company ?? ''; | ||
| 110 | + departmentController.text = guest.section ?? ''; | ||
| 111 | + positionController.text = guest.position ?? ''; | ||
| 112 | + jkController.text = guest.taboos ?? ''; | ||
| 113 | + xhController.text = guest.like ?? ''; | ||
| 114 | + fwController.text = guest.serve ?? ''; | ||
| 115 | + labelShow = guest.label ?? ''; | ||
| 116 | + setState(() {}); | ||
| 117 | + } | ||
| 118 | + | ||
| 119 | + // await customerProvider.searchData(customerProvider.controller.text); | ||
| 120 | + } | ||
| 121 | + | ||
| 122 | + ///获取商家标签 | ||
| 123 | + _getLabelBySellerid() async { | ||
| 124 | + List<CustomerLabelSunModel> modelLabel = | ||
| 125 | + await customerProvider.getLabelBySellerid(context); | ||
| 126 | + | ||
| 127 | + if (modelLabel.length > 0) { | ||
| 128 | + for (int i = 0; i < customerProvider.labelList.length; i++) { | ||
| 129 | + if (labelShow == customerProvider.labelList[i].label) { | ||
| 130 | + customerProvider.labelSelIndex = i; | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + } | ||
| 134 | + } | ||
| 135 | + | ||
| 136 | + _setGuestInfo() async { | ||
| 137 | + if (nameStr.trim().length == 0) { | ||
| 138 | + Utils.showToast('请填写客户姓名'); | ||
| 139 | + return; | ||
| 140 | + } | ||
| 141 | + if (phoneController.text.trim().length == 0) { | ||
| 142 | + Utils.showToast('请填写客户电话'); | ||
| 143 | + return; | ||
| 144 | + } | ||
| 145 | + String sex = '1'; | ||
| 146 | + for (var item in sexList) { | ||
| 147 | + if (item['select']) { | ||
| 148 | + sex = item['code']; | ||
| 149 | + } | ||
| 150 | + } | ||
| 151 | + Map<String, String> params = { | ||
| 152 | + "id": '195', | ||
| 153 | + 'sex': sex, | ||
| 154 | + 'rname': nameStr, | ||
| 155 | + 'phone': phoneController.text | ||
| 156 | + }; | ||
| 157 | + | ||
| 158 | + if (adressController.text.trim().length > 0) { | ||
| 159 | + params['company'] = adressController.text; | ||
| 160 | + } | ||
| 161 | + if (departmentController.text.trim().length > 0) { | ||
| 162 | + params['section'] = departmentController.text; | ||
| 163 | + } | ||
| 164 | + if (positionController.text.trim().length > 0) { | ||
| 165 | + params['position'] = positionController.text; | ||
| 166 | + } | ||
| 167 | + if (labelShow != '') { | ||
| 168 | + params['label'] = labelShow; | ||
| 169 | + } | ||
| 170 | + if (jkController.text.trim().length > 0) { | ||
| 171 | + params['taboos'] = jkController.text; | ||
| 172 | + } | ||
| 173 | + if (xhController.text.trim().length > 0) { | ||
| 174 | + params['like'] = xhController.text; | ||
| 175 | + } | ||
| 176 | + if (fwController.text.trim().length > 0) { | ||
| 177 | + params['serve'] = fwController.text; | ||
| 178 | + } | ||
| 179 | + bool sucess = | ||
| 180 | + await customerProvider.setGuestInfo(context, params, showLoading: true); | ||
| 181 | + if (sucess) { | ||
| 182 | + Utils.showToast('保存成功'); | ||
| 183 | + // bus.emit('refresh_guest_info'); | ||
| 184 | + // bus.emit('refresh_guest_list_my'); | ||
| 185 | + Map data = {}; | ||
| 186 | + if (jkController.text.trim().length > 0) { | ||
| 187 | + data['taboos'] = jkController.text; | ||
| 188 | + } | ||
| 189 | + if (xhController.text.trim().length > 0) { | ||
| 190 | + data['like'] = xhController.text; | ||
| 191 | + } | ||
| 192 | + if (fwController.text.trim().length > 0) { | ||
| 193 | + data['serve'] = fwController.text; | ||
| 194 | + } | ||
| 195 | + Navigator.pop(context, data); | ||
| 196 | + // 刷新前一页 | ||
| 197 | + } | ||
| 198 | + } | ||
| 199 | + | ||
| 200 | + ///称谓 | ||
| 201 | + _initSexList() { | ||
| 202 | + // String sexStr = detailEntity.sex; | ||
| 203 | + String sexStr = '1'; | ||
| 204 | + sexList = [ | ||
| 205 | + { | ||
| 206 | + 'title': '先生', | ||
| 207 | + 'select': sexStr == '1' ? true : false, | ||
| 208 | + 'code': '1', | ||
| 209 | + 'hasLeftBorder': true | ||
| 210 | + }, | ||
| 211 | + { | ||
| 212 | + 'title': '女士', | ||
| 213 | + 'select': sexStr == '2' ? true : false, | ||
| 214 | + 'code': '2', | ||
| 215 | + 'hasLeftBorder': false | ||
| 216 | + }, | ||
| 217 | + { | ||
| 218 | + 'title': '公司', | ||
| 219 | + 'select': sexStr == '3' ? true : false, | ||
| 220 | + 'code': '3', | ||
| 221 | + 'hasLeftBorder': false | ||
| 222 | + } | ||
| 223 | + ]; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + _addNameSuffix(String name, String suffix) { | ||
| 227 | + if (name == nameController.text && nameController.text.endsWith(suffix)) { | ||
| 228 | + return; | ||
| 229 | + } | ||
| 230 | + nameController.text = name + suffix; | ||
| 231 | + } | ||
| 232 | + | ||
| 233 | + //姓名后缀 | ||
| 234 | + _nameSuffix() { | ||
| 235 | + for (var item in sexList) { | ||
| 236 | + if (item['select'] == true) { | ||
| 237 | + return item['title']; | ||
| 238 | + } | ||
| 239 | + } | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + Widget _callButton( | ||
| 243 | + {GestureTapCallback onPress, | ||
| 244 | + content, | ||
| 245 | + hasLeftBorder = true, | ||
| 246 | + isSelect = false}) { | ||
| 247 | + return InkWell( | ||
| 248 | + onTap: onPress, | ||
| 249 | + child: Container( | ||
| 250 | + width: ScreenUtil().setWidth(84), | ||
| 251 | + height: ScreenUtil().setHeight(48), | ||
| 252 | + decoration: BoxDecoration( | ||
| 253 | + color: isSelect ? MyColours.color_199095 : MyColours.color_fefefe, | ||
| 254 | + border: Border( | ||
| 255 | + bottom: BorderSide( | ||
| 256 | + color: MyColours.color_6AB6B9, | ||
| 257 | + width: ScreenUtil().setWidth(2)), | ||
| 258 | + top: BorderSide( | ||
| 259 | + color: MyColours.color_6AB6B9, | ||
| 260 | + width: ScreenUtil().setWidth(2)), | ||
| 261 | + left: hasLeftBorder | ||
| 262 | + ? BorderSide( | ||
| 263 | + color: MyColours.color_6AB6B9, | ||
| 264 | + width: ScreenUtil().setWidth(2)) | ||
| 265 | + : BorderSide.none, | ||
| 266 | + right: BorderSide( | ||
| 267 | + color: MyColours.color_6AB6B9, | ||
| 268 | + width: ScreenUtil().setWidth(2)))), | ||
| 269 | + child: Align( | ||
| 270 | + alignment: Alignment.center, | ||
| 271 | + child: Text( | ||
| 272 | + content, | ||
| 273 | + style: TextStyle( | ||
| 274 | + color: isSelect ? Colors.white : MyColours.color_353535, | ||
| 275 | + fontSize: ScreenUtil().setSp(28)), | ||
| 276 | + ), | ||
| 277 | + ), | ||
| 278 | + ), | ||
| 279 | + ); | ||
| 280 | + } | ||
| 281 | + | ||
| 282 | + Widget _textfieldWidget(String title, String hint, | ||
| 283 | + TextEditingController controller, FocusNode focusNode) { | ||
| 284 | + return Container( | ||
| 285 | + // height: ScreenUtil().setWidth(60), | ||
| 286 | + padding: EdgeInsets.symmetric(vertical: ScreenUtil().setWidth(10)), | ||
| 287 | + decoration: BoxDecoration( | ||
| 288 | + border: Border( | ||
| 289 | + bottom: BorderSide( | ||
| 290 | + width: ScreenUtil().setWidth(2), | ||
| 291 | + color: Color.fromRGBO(220, 220, 220, 1)))), | ||
| 292 | + child: Row( | ||
| 293 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 294 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 295 | + children: [ | ||
| 296 | + Container( | ||
| 297 | + width: ScreenUtil().setWidth(150), | ||
| 298 | + height: ScreenUtil().setWidth(35), | ||
| 299 | + child: Text( | ||
| 300 | + title, | ||
| 301 | + style: TextStyle( | ||
| 302 | + fontSize: ScreenUtil().setSp(28), | ||
| 303 | + color: MyColours.color_333333), | ||
| 304 | + ), | ||
| 305 | + ), | ||
| 306 | + Expanded( | ||
| 307 | + child: TextField( | ||
| 308 | + maxLines: 1, | ||
| 309 | + | ||
| 310 | + //输入文本的样式 | ||
| 311 | + style: TextStyle( | ||
| 312 | + fontSize: ScreenUtil().setSp(30), | ||
| 313 | + color: MyColours.color_353535), | ||
| 314 | + controller: controller, | ||
| 315 | + focusNode: focusNode, | ||
| 316 | + // textAlignVertical: TextAlignVertical.top, | ||
| 317 | + decoration: InputDecoration( | ||
| 318 | + hintText: hint, | ||
| 319 | + hintStyle: TextStyle( | ||
| 320 | + color: MyColours.color_999999, | ||
| 321 | + fontSize: ScreenUtil().setSp(30), | ||
| 322 | + ), | ||
| 323 | + // contentPadding: | ||
| 324 | + // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)), | ||
| 325 | + contentPadding: EdgeInsets.zero, | ||
| 326 | + border: OutlineInputBorder(borderSide: BorderSide.none), | ||
| 327 | + ), | ||
| 328 | + onChanged: (value) {}, | ||
| 329 | + onEditingComplete: () { | ||
| 330 | + // if (controller == nameController) { | ||
| 331 | + // nameFocus.unfocus(); | ||
| 332 | + // // _homeEnterModel.nameController.text = | ||
| 333 | + // // nameStr + _nameSuffix(); | ||
| 334 | + // _addNameSuffix(nameStr, _nameSuffix()); | ||
| 335 | + // } | ||
| 336 | + print('fff'); | ||
| 337 | + }, | ||
| 338 | + keyboardType: TextInputType.text, | ||
| 339 | + ), | ||
| 340 | + ), | ||
| 341 | + ], | ||
| 342 | + ), | ||
| 343 | + ); | ||
| 344 | + } | ||
| 345 | + | ||
| 346 | + ///忌口和喜好 | ||
| 347 | + Widget _textMulLine( | ||
| 348 | + String title, String hintText, TextEditingController controller) { | ||
| 349 | + return Container( | ||
| 350 | + // height: ScreenUtil().setWidth(380), | ||
| 351 | + child: Column( | ||
| 352 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 353 | + children: [ | ||
| 354 | + Align( | ||
| 355 | + alignment: Alignment.centerLeft, | ||
| 356 | + child: Text( | ||
| 357 | + title, | ||
| 358 | + textAlign: TextAlign.left, | ||
| 359 | + style: TextStyle( | ||
| 360 | + color: MyColours.color_333333, | ||
| 361 | + fontSize: ScreenUtil().setSp(28)), | ||
| 362 | + )), | ||
| 363 | + VEmptyView(20), | ||
| 364 | + TextField( | ||
| 365 | + controller: controller, | ||
| 366 | + // keyboardType: TextInputType.number, //键盘类型,数字键盘 | ||
| 367 | + maxLines: 4, | ||
| 368 | + // maxLength: 50, | ||
| 369 | + | ||
| 370 | + // maxLengthEnforced: true, | ||
| 371 | + style: TextStyle( | ||
| 372 | + fontSize: ScreenUtil().setSp(30), | ||
| 373 | + color: MyColours.color_333333), //输入文本的样式 | ||
| 374 | + decoration: InputDecoration( | ||
| 375 | + contentPadding: EdgeInsets.all(ScreenUtil().setWidth(30)), | ||
| 376 | + hintText: hintText, | ||
| 377 | + hintStyle: TextStyle( | ||
| 378 | + color: MyColours.color_999999, | ||
| 379 | + fontSize: ScreenUtil().setSp(30), | ||
| 380 | + ), | ||
| 381 | + // fillColor: MyColours.color_F9F9F9, | ||
| 382 | + // fillColor: Colors.red, | ||
| 383 | + // filled: true, | ||
| 384 | + enabledBorder: OutlineInputBorder( | ||
| 385 | + //未选中时候的颜色 | ||
| 386 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)), | ||
| 387 | + borderSide: BorderSide( | ||
| 388 | + color: MyColours.color_cccccc, | ||
| 389 | + width: ScreenUtil().setWidth(2)), | ||
| 390 | + ), | ||
| 391 | + focusedBorder: OutlineInputBorder( | ||
| 392 | + //选中时外边框颜色 | ||
| 393 | + borderRadius: BorderRadius.circular(ScreenUtil().setWidth(20)), | ||
| 394 | + borderSide: BorderSide( | ||
| 395 | + color: MyColours.app_main, | ||
| 396 | + ), | ||
| 397 | + ), | ||
| 398 | + // border: OutlineInputBorder( | ||
| 399 | + // borderRadius: | ||
| 400 | + // BorderRadius.circular(ScreenUtil().setWidth(20)), | ||
| 401 | + // borderSide: BorderSide( | ||
| 402 | + // color: Colors.red, width: ScreenUtil().setWidth(2))), | ||
| 403 | + ), | ||
| 404 | + onChanged: (value) {}, | ||
| 405 | + ), | ||
| 406 | + ], | ||
| 407 | + ), | ||
| 408 | + ); | ||
| 409 | + } | ||
| 410 | + | ||
| 411 | + @override | ||
| 412 | + Widget build(BuildContext context) { | ||
| 413 | + customerProvider = Provider.of<CustomerProvider>(context, listen: true); | ||
| 414 | + return Scaffold( | ||
| 415 | + backgroundColor: MyColours.color_ffffff, | ||
| 416 | + appBar: SystemAppBar( | ||
| 417 | + '编辑客户详情', | ||
| 418 | + onTap: () { | ||
| 419 | + Navigator.of(context).pop(); | ||
| 420 | + }, | ||
| 421 | + ), | ||
| 422 | + body: Consumer<CustomerProvider>(builder: (context, model, _) { | ||
| 423 | + if (model.pageStateGuestInfo != PageState.Success) { | ||
| 424 | + return ExceptionPage( | ||
| 425 | + pageState: model.pageStateGuestInfo, | ||
| 426 | + callback: () { | ||
| 427 | + if (model.pageStateGuestInfo == PageState.Empty) { | ||
| 428 | + Navigator.pop(context); | ||
| 429 | + Navigator.pop(context); | ||
| 430 | + } else { | ||
| 431 | + model.pageStateGuestInfo = PageState.Loading; | ||
| 432 | + model.notifyListeners(); | ||
| 433 | + _getGuestInfo(); | ||
| 434 | + } | ||
| 435 | + }, | ||
| 436 | + emptyMsg: "暂时没有客户哦,", | ||
| 437 | + emptyImg: "empty_search", | ||
| 438 | + showMsg: "加载中,请稍后...", | ||
| 439 | + showText: '去添加', | ||
| 440 | + ); | ||
| 441 | + } else { | ||
| 442 | + return Column( | ||
| 443 | + children: [ | ||
| 444 | + Expanded( | ||
| 445 | + child: Padding( | ||
| 446 | + padding: EdgeInsets.symmetric( | ||
| 447 | + horizontal: ScreenUtil().setWidth(50)), | ||
| 448 | + child: ListView( | ||
| 449 | + controller: scrollController, | ||
| 450 | + children: [ | ||
| 451 | + // VEmptyView(30), | ||
| 452 | + Container( | ||
| 453 | + // height: ScreenUtil().setWidth(60), | ||
| 454 | + padding: EdgeInsets.symmetric( | ||
| 455 | + vertical: ScreenUtil().setWidth(10)), | ||
| 456 | + decoration: BoxDecoration( | ||
| 457 | + border: Border( | ||
| 458 | + bottom: BorderSide( | ||
| 459 | + width: ScreenUtil().setWidth(2), | ||
| 460 | + color: Color.fromRGBO( | ||
| 461 | + 220, 220, 220, 1)))), | ||
| 462 | + child: Row( | ||
| 463 | + mainAxisAlignment: | ||
| 464 | + MainAxisAlignment.spaceBetween, | ||
| 465 | + crossAxisAlignment: CrossAxisAlignment.center, | ||
| 466 | + children: [ | ||
| 467 | + Container( | ||
| 468 | + // color: Colors.red, | ||
| 469 | + width: ScreenUtil().setWidth(150), | ||
| 470 | + height: ScreenUtil().setWidth(35), | ||
| 471 | + child: Text( | ||
| 472 | + '姓名', | ||
| 473 | + style: TextStyle( | ||
| 474 | + fontSize: ScreenUtil().setSp(28), | ||
| 475 | + color: MyColours.color_333333), | ||
| 476 | + ), | ||
| 477 | + ), | ||
| 478 | + Expanded( | ||
| 479 | + child: TextField( | ||
| 480 | + maxLines: 1, | ||
| 481 | + | ||
| 482 | + //输入文本的样式 | ||
| 483 | + style: TextStyle( | ||
| 484 | + fontSize: ScreenUtil().setSp(30), | ||
| 485 | + color: MyColours.color_353535), | ||
| 486 | + controller: nameController, | ||
| 487 | + focusNode: nameFocus, | ||
| 488 | + // textAlignVertical: TextAlignVertical.top, | ||
| 489 | + decoration: InputDecoration( | ||
| 490 | + hintText: "填写姓名", | ||
| 491 | + hintStyle: TextStyle( | ||
| 492 | + color: MyColours.color_999999, | ||
| 493 | + fontSize: ScreenUtil().setSp(30), | ||
| 494 | + ), | ||
| 495 | + // contentPadding: | ||
| 496 | + // EdgeInsets.only(bottom: ScreenUtil().setWidth(17)), | ||
| 497 | + contentPadding: EdgeInsets.zero, | ||
| 498 | + border: OutlineInputBorder( | ||
| 499 | + borderSide: BorderSide.none), | ||
| 500 | + ), | ||
| 501 | + onChanged: (value) { | ||
| 502 | + print('ggg'); | ||
| 503 | + | ||
| 504 | + if (value.endsWith('先生') || | ||
| 505 | + value.endsWith('女士') || | ||
| 506 | + value.endsWith('公司')) { | ||
| 507 | + nameStr = value.substring( | ||
| 508 | + 0, value.length - 2); | ||
| 509 | + } else { | ||
| 510 | + nameStr = value; | ||
| 511 | + } | ||
| 512 | + }, | ||
| 513 | + onEditingComplete: () { | ||
| 514 | + print('fff'); | ||
| 515 | + nameFocus.unfocus(); | ||
| 516 | + // _homeEnterModel.nameController.text = | ||
| 517 | + // nameStr + _nameSuffix(); | ||
| 518 | + _addNameSuffix(nameStr, _nameSuffix()); | ||
| 519 | + }, | ||
| 520 | + keyboardType: TextInputType.text, | ||
| 521 | + ), | ||
| 522 | + ), | ||
| 523 | + // HEmptyView(40), | ||
| 524 | + Row( | ||
| 525 | + children: sexList.map((value) { | ||
| 526 | + return _callButton( | ||
| 527 | + onPress: () { | ||
| 528 | + for (var item in sexList) { | ||
| 529 | + item['select'] = false; | ||
| 530 | + if (item['title'] == | ||
| 531 | + value['title']) { | ||
| 532 | + item['select'] = true; | ||
| 533 | + // _homeEnterModel.nameController.text = | ||
| 534 | + // nameStr + item['title']; | ||
| 535 | + if (nameStr != null && | ||
| 536 | + nameStr != '') { | ||
| 537 | + _addNameSuffix( | ||
| 538 | + nameStr, item['title']); | ||
| 539 | + } | ||
| 540 | + } | ||
| 541 | + } | ||
| 542 | + setState(() {}); | ||
| 543 | + }, | ||
| 544 | + content: value['title'], | ||
| 545 | + hasLeftBorder: value['hasLeftBorder'], | ||
| 546 | + isSelect: value['select']); | ||
| 547 | + }).toList()), | ||
| 548 | + ], | ||
| 549 | + ), | ||
| 550 | + ), | ||
| 551 | + _textfieldWidget( | ||
| 552 | + '电话', '填写电话', phoneController, phoneFocus), | ||
| 553 | + _textfieldWidget('工作单位', '填写工作单位', adressController, | ||
| 554 | + adressFocus), | ||
| 555 | + _textfieldWidget('部门', '填写部门', departmentController, | ||
| 556 | + departmentFocus), | ||
| 557 | + _textfieldWidget('职位', '填写职位', positionController, | ||
| 558 | + positionFocus), | ||
| 559 | + InkWell( | ||
| 560 | + onTap: () { | ||
| 561 | + FocusScope.of(context) | ||
| 562 | + .requestFocus(FocusNode()); //隐藏键盘 | ||
| 563 | + DialogUtil.showSelectCusmanDialog( | ||
| 564 | + context, | ||
| 565 | + customerProvider.labelList | ||
| 566 | + .map((item) { | ||
| 567 | + return item.label; | ||
| 568 | + }).toList(), (value) { | ||
| 569 | + if (value != null) { | ||
| 570 | + setState(() { | ||
| 571 | + customerProvider.labelSelIndex = | ||
| 572 | + value.first; | ||
| 573 | + labelShow = customerProvider | ||
| 574 | + .labelList[ | ||
| 575 | + customerProvider.labelSelIndex] | ||
| 576 | + .label; | ||
| 577 | + }); | ||
| 578 | + } | ||
| 579 | + }, | ||
| 580 | + selecteds: customerProvider | ||
| 581 | + .labelSelIndex == | ||
| 582 | + null | ||
| 583 | + ? [] | ||
| 584 | + : [ | ||
| 585 | + customerProvider.labelSelIndex | ||
| 586 | + ]) | ||
| 587 | + .then((value) {}); | ||
| 588 | + }, | ||
| 589 | + child: Container( | ||
| 590 | + // height: ScreenUtil().setWidth(60), | ||
| 591 | + padding: EdgeInsets.symmetric( | ||
| 592 | + vertical: ScreenUtil().setWidth(50)), | ||
| 593 | + decoration: BoxDecoration( | ||
| 594 | + border: Border( | ||
| 595 | + bottom: BorderSide( | ||
| 596 | + width: ScreenUtil().setWidth(2), | ||
| 597 | + color: Color.fromRGBO( | ||
| 598 | + 220, 220, 220, 1)))), | ||
| 599 | + child: Row( | ||
| 600 | + mainAxisAlignment: | ||
| 601 | + MainAxisAlignment.spaceBetween, | ||
| 602 | + crossAxisAlignment: | ||
| 603 | + CrossAxisAlignment.center, | ||
| 604 | + children: [ | ||
| 605 | + Container( | ||
| 606 | + // color: Colors.red, | ||
| 607 | + width: ScreenUtil().setWidth(150), | ||
| 608 | + height: ScreenUtil().setWidth(35), | ||
| 609 | + child: Text( | ||
| 610 | + '自定义标签', | ||
| 611 | + style: TextStyle( | ||
| 612 | + fontSize: ScreenUtil().setSp(28), | ||
| 613 | + color: MyColours.color_333333), | ||
| 614 | + ), | ||
| 615 | + ), | ||
| 616 | + Expanded( | ||
| 617 | + child: Text( | ||
| 618 | + labelShow, | ||
| 619 | + overflow: TextOverflow.ellipsis, | ||
| 620 | + style: TextStyle( | ||
| 621 | + color: | ||
| 622 | + Color.fromRGBO(193, 194, 63, 1), | ||
| 623 | + fontSize: ScreenUtil().setSp(28), | ||
| 624 | + ), | ||
| 625 | + )), | ||
| 626 | + HEmptyView(10), | ||
| 627 | + Image.asset( | ||
| 628 | + Utils.getImgPath(showLabel | ||
| 629 | + ? 'c_arrow_up' | ||
| 630 | + : 'c_arrow_down'), | ||
| 631 | + width: ScreenUtil().setWidth(24), | ||
| 632 | + // height: ScreenUtil().setWidth(10), | ||
| 633 | + ) | ||
| 634 | + ], | ||
| 635 | + ), | ||
| 636 | + )), | ||
| 637 | + | ||
| 638 | + VEmptyView(60), | ||
| 639 | + _textMulLine( | ||
| 640 | + '忌口', '点这里输入客户忌口的东西,请用逗号隔开。', jkController), | ||
| 641 | + VEmptyView(30), | ||
| 642 | + _textMulLine( | ||
| 643 | + '喜好', '点这里输入客户喜好的东西,请用逗号隔开。', xhController), | ||
| 644 | + VEmptyView(30), | ||
| 645 | + _textMulLine( | ||
| 646 | + '服务', | ||
| 647 | + '点这里输入客户需要的服务,如安静的包间、远离厕所等,请用逗号隔开。', | ||
| 648 | + fwController), | ||
| 649 | + ], | ||
| 650 | + ))), | ||
| 651 | + RoundButton( | ||
| 652 | + text: '保存', | ||
| 653 | + radius: ScreenUtil().setWidth(10), | ||
| 654 | + margin: EdgeInsets.symmetric( | ||
| 655 | + horizontal: ScreenUtil().setWidth(90)), | ||
| 656 | + height: ScreenUtil().setWidth(80), | ||
| 657 | + fontSize: 26, | ||
| 658 | + isBold: false, | ||
| 659 | + onPressed: () { | ||
| 660 | + _setGuestInfo(); | ||
| 661 | + }, | ||
| 662 | + ), | ||
| 663 | + VEmptyView(30) | ||
| 664 | + ], | ||
| 665 | + ); | ||
| 666 | + } | ||
| 667 | + })); | ||
| 668 | + } | ||
| 669 | +} |
| @@ -18,6 +18,7 @@ import '../../constant/state.dart'; | @@ -18,6 +18,7 @@ import '../../constant/state.dart'; | ||
| 18 | import '../../models/cookbook_model.dart'; | 18 | import '../../models/cookbook_model.dart'; |
| 19 | import '../../models/notebook_detail.dart'; | 19 | import '../../models/notebook_detail.dart'; |
| 20 | import '../../models/plan_cook_list_model.dart'; | 20 | import '../../models/plan_cook_list_model.dart'; |
| 21 | +import '../../provider/customer_provider.dart'; | ||
| 21 | import '../../provider/plan_dish_provider.dart'; | 22 | import '../../provider/plan_dish_provider.dart'; |
| 22 | import '../../utils/event_bus.dart'; | 23 | import '../../utils/event_bus.dart'; |
| 23 | 24 | ||
| @@ -67,6 +68,26 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | @@ -67,6 +68,26 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | ||
| 67 | bus.off("refresh_order_advance_home"); | 68 | bus.off("refresh_order_advance_home"); |
| 68 | } | 69 | } |
| 69 | 70 | ||
| 71 | + _setGuestInfo() async { | ||
| 72 | + Map<String, String> params = { | ||
| 73 | + "id": '195', | ||
| 74 | + }; | ||
| 75 | + | ||
| 76 | + if (noFoodController.text.trim().length > 0) { | ||
| 77 | + params['taboos'] = noFoodController.text; | ||
| 78 | + } | ||
| 79 | + if (likeController.text.trim().length > 0) { | ||
| 80 | + params['like'] = likeController.text; | ||
| 81 | + } | ||
| 82 | + if (serviceController.text.trim().length > 0) { | ||
| 83 | + params['serve'] = serviceController.text; | ||
| 84 | + } | ||
| 85 | + CustomerProvider customerProvider = | ||
| 86 | + Provider.of<CustomerProvider>(context, listen: false); | ||
| 87 | + bool sucess = | ||
| 88 | + await customerProvider.setGuestInfo(context, params, showLoading: true); | ||
| 89 | + } | ||
| 90 | + | ||
| 70 | _getPlanCookByRid() async { | 91 | _getPlanCookByRid() async { |
| 71 | await _planDishProvider.getPlanCookByRid(context, {'rid': widget.rid}); | 92 | await _planDishProvider.getPlanCookByRid(context, {'rid': widget.rid}); |
| 72 | if (_planDishProvider.planCookByRidSunModel != null) { | 93 | if (_planDishProvider.planCookByRidSunModel != null) { |
| @@ -229,7 +250,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | @@ -229,7 +250,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | ||
| 229 | _planDishProvider.menuModelForManager | 250 | _planDishProvider.menuModelForManager |
| 230 | .insert(1, menuModelPlanDish); //添加排菜 | 251 | .insert(1, menuModelPlanDish); //添加排菜 |
| 231 | 252 | ||
| 232 | - MenuModel menuModelShort = MenuModel(); | 253 | + MenuModel menuModelShort = MenuModel(); |
| 233 | menuModelShort.className = '临时加菜'; | 254 | menuModelShort.className = '临时加菜'; |
| 234 | menuModelShort.classType = '5'; | 255 | menuModelShort.classType = '5'; |
| 235 | menuModelShort.cookbooklist = []; | 256 | menuModelShort.cookbooklist = []; |
| @@ -240,7 +261,8 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | @@ -240,7 +261,8 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | ||
| 240 | _planDishProvider.planCookByRidSunModel.temporaryList.length > 0) { | 261 | _planDishProvider.planCookByRidSunModel.temporaryList.length > 0) { |
| 241 | menuModelShort.cookbooklist | 262 | menuModelShort.cookbooklist |
| 242 | .addAll(_planDishProvider.planCookByRidSunModel.temporaryList); | 263 | .addAll(_planDishProvider.planCookByRidSunModel.temporaryList); |
| 243 | - _planDishProvider.planCookByRidSunModel.temporaryList.forEach((temporary) { | 264 | + _planDishProvider.planCookByRidSunModel.temporaryList |
| 265 | + .forEach((temporary) { | ||
| 244 | // if (temporary.amount > 0) { | 266 | // if (temporary.amount > 0) { |
| 245 | // carSum += temporary.amount; | 267 | // carSum += temporary.amount; |
| 246 | // } | 268 | // } |
| @@ -690,25 +712,44 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | @@ -690,25 +712,44 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | ||
| 690 | w(1), | 712 | w(1), |
| 691 | color: MyColours.color_DBDBDB, | 713 | color: MyColours.color_DBDBDB, |
| 692 | )), | 714 | )), |
| 693 | - Container( | ||
| 694 | - padding: EdgeInsets.only( | ||
| 695 | - top: w(10), bottom: w(10), right: w(20)), | ||
| 696 | - child: Row( | ||
| 697 | - mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 698 | - children: [ | ||
| 699 | - Text( | ||
| 700 | - '客户偏好参考', | ||
| 701 | - style: TextStyle( | ||
| 702 | - fontSize: font(16), | ||
| 703 | - color: MyColours.color_515151), | 715 | + InkWell( |
| 716 | + onTap: () async { | ||
| 717 | + Map object = | ||
| 718 | + await NavigatorUtil.goOrderCustomerDetailEditPage( | ||
| 719 | + context, widget.detailEntity); | ||
| 720 | + if (object != null) { | ||
| 721 | + if (object.containsKey('taboos')) { | ||
| 722 | + noFoodController.text = object['taboos']; | ||
| 723 | + } | ||
| 724 | + if (object.containsKey('like')) { | ||
| 725 | + likeController.text = object['like']; | ||
| 726 | + } | ||
| 727 | + if (object.containsKey('serve')) { | ||
| 728 | + serviceController.text = object['serve']; | ||
| 729 | + } | ||
| 730 | + | ||
| 731 | + setState(() {}); | ||
| 732 | + } | ||
| 733 | + }, | ||
| 734 | + child: Container( | ||
| 735 | + padding: EdgeInsets.only( | ||
| 736 | + top: w(10), bottom: w(10), right: w(20)), | ||
| 737 | + child: Row( | ||
| 738 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 739 | + children: [ | ||
| 740 | + Text( | ||
| 741 | + '客户偏好参考', | ||
| 742 | + style: TextStyle( | ||
| 743 | + fontSize: font(16), | ||
| 744 | + color: MyColours.color_515151), | ||
| 745 | + ), | ||
| 746 | + Image.asset( | ||
| 747 | + Utils.getImgPath('merge_arrow'), | ||
| 748 | + width: w(20), | ||
| 749 | + ) | ||
| 750 | + ], | ||
| 704 | ), | 751 | ), |
| 705 | - Image.asset( | ||
| 706 | - Utils.getImgPath('merge_arrow'), | ||
| 707 | - width: w(20), | ||
| 708 | - ) | ||
| 709 | - ], | ||
| 710 | - ), | ||
| 711 | - ), | 752 | + )), |
| 712 | VEmptyView(32), | 753 | VEmptyView(32), |
| 713 | Padding( | 754 | Padding( |
| 714 | padding: EdgeInsets.only(right: w(20)), | 755 | padding: EdgeInsets.only(right: w(20)), |
| @@ -747,11 +788,30 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | @@ -747,11 +788,30 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | ||
| 747 | Expanded( | 788 | Expanded( |
| 748 | flex: 1, | 789 | flex: 1, |
| 749 | child: InkWell( | 790 | child: InkWell( |
| 750 | - onTap: () { | 791 | + onTap: () async { |
| 751 | // NavigatorUtil | 792 | // NavigatorUtil |
| 752 | // .goOrderAdvanceHomePage( | 793 | // .goOrderAdvanceHomePage( |
| 753 | // context, | 794 | // context, |
| 754 | // ); | 795 | // ); |
| 796 | + await _setGuestInfo(); | ||
| 797 | + Map<String, String> params = { | ||
| 798 | + "rid": widget.rid | ||
| 799 | + // 'is_time': '0' | ||
| 800 | + // "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid, | ||
| 801 | + }; | ||
| 802 | + String oid = await _planDishProvider.getCreateOrder( | ||
| 803 | + context, params, | ||
| 804 | + showLoading: true); | ||
| 805 | + if (oid != null) { | ||
| 806 | + //获取成功 | ||
| 807 | + Utils.goMiniProgramOrderPage( | ||
| 808 | + context, | ||
| 809 | + widget.rid, | ||
| 810 | + oid, | ||
| 811 | + Provider.of<UserModel>(context, listen: false) | ||
| 812 | + .user | ||
| 813 | + .sellerid); | ||
| 814 | + } | ||
| 755 | }, | 815 | }, |
| 756 | child: Container( | 816 | child: Container( |
| 757 | margin: | 817 | margin: |
| @@ -1030,7 +1090,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | @@ -1030,7 +1090,7 @@ class _OrderAdvanceHomePageState extends State<OrderAdvanceHomePage> { | ||
| 1030 | // } | 1090 | // } |
| 1031 | } | 1091 | } |
| 1032 | // else if (element.className == '临时加菜') { | 1092 | // else if (element.className == '临时加菜') { |
| 1033 | - // } | 1093 | + // } |
| 1034 | else { | 1094 | else { |
| 1035 | //单菜 | 1095 | //单菜 |
| 1036 | bool hasmMenu = element.cookbooklist | 1096 | bool hasmMenu = element.cookbooklist |
| @@ -496,11 +496,13 @@ class CustomerProvider extends ChangeNotifier { | @@ -496,11 +496,13 @@ class CustomerProvider extends ChangeNotifier { | ||
| 496 | } | 496 | } |
| 497 | } | 497 | } |
| 498 | notifyListeners(); | 498 | notifyListeners(); |
| 499 | + return false; | ||
| 499 | }); | 500 | }); |
| 500 | if (baseResp != null && baseResp.code == Constant.status_success) { | 501 | if (baseResp != null && baseResp.code == Constant.status_success) { |
| 501 | pageStateGuestInfo = PageState.Success; | 502 | pageStateGuestInfo = PageState.Success; |
| 502 | guestInfoSunModel = GuestInfoModel.fromJson(baseResp.responseData).data; | 503 | guestInfoSunModel = GuestInfoModel.fromJson(baseResp.responseData).data; |
| 503 | notifyListeners(); | 504 | notifyListeners(); |
| 505 | + return true; | ||
| 504 | } else { | 506 | } else { |
| 505 | if (baseResp != null) { | 507 | if (baseResp != null) { |
| 506 | Utils.showToast(baseResp.msg ?? ""); | 508 | Utils.showToast(baseResp.msg ?? ""); |
| @@ -508,6 +510,7 @@ class CustomerProvider extends ChangeNotifier { | @@ -508,6 +510,7 @@ class CustomerProvider extends ChangeNotifier { | ||
| 508 | pageStateGuestInfo = PageState.ConnectivityTimeOut; | 510 | pageStateGuestInfo = PageState.ConnectivityTimeOut; |
| 509 | } | 511 | } |
| 510 | notifyListeners(); | 512 | notifyListeners(); |
| 513 | + return false; | ||
| 511 | } | 514 | } |
| 512 | 515 | ||
| 513 | // 获取客户纪念日列表 | 516 | // 获取客户纪念日列表 |
| @@ -1274,10 +1277,10 @@ class CustomerProvider extends ChangeNotifier { | @@ -1274,10 +1277,10 @@ class CustomerProvider extends ChangeNotifier { | ||
| 1274 | if (sunmodel != null && sunmodel.length > 0) { | 1277 | if (sunmodel != null && sunmodel.length > 0) { |
| 1275 | for (GetSellerUserBySelleridSunModel item in sunmodel) { | 1278 | for (GetSellerUserBySelleridSunModel item in sunmodel) { |
| 1276 | // if (item.nickName != null) { | 1279 | // if (item.nickName != null) { |
| 1277 | - FilterBtnModel model = FilterBtnModel(); | ||
| 1278 | - model.id = item.id; | ||
| 1279 | - model.title = item.nickName ?? item.account; | ||
| 1280 | - sellerManageList.add(model); | 1280 | + FilterBtnModel model = FilterBtnModel(); |
| 1281 | + model.id = item.id; | ||
| 1282 | + model.title = item.nickName ?? item.account; | ||
| 1283 | + sellerManageList.add(model); | ||
| 1281 | // } | 1284 | // } |
| 1282 | } | 1285 | } |
| 1283 | } | 1286 | } |
| @@ -89,6 +89,46 @@ class PlanDishProvider extends ChangeNotifier { | @@ -89,6 +89,46 @@ class PlanDishProvider extends ChangeNotifier { | ||
| 89 | } | 89 | } |
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | + getCreateOrder(BuildContext context, Map<String, String> params, | ||
| 93 | + {showLoading = false}) async { | ||
| 94 | + BaseResp<dynamic> baseResp = await DioUtil() | ||
| 95 | + .request<dynamic>(context, Method.get, HttpUrl.create_order, | ||
| 96 | + data: params, showLoading: showLoading) | ||
| 97 | + .catchError((error) { | ||
| 98 | + // print(error.toString()); | ||
| 99 | + // if (error is MyError) { | ||
| 100 | + // switch (error.type) { | ||
| 101 | + // case 1: | ||
| 102 | + // pageState = PageState.ConnectivityError; | ||
| 103 | + // break; | ||
| 104 | + // case 2: | ||
| 105 | + // pageState = PageState.ConnectivityTimeOut; | ||
| 106 | + // break; | ||
| 107 | + // default: | ||
| 108 | + // pageState = PageState.ConnectivityError; | ||
| 109 | + // break; | ||
| 110 | + // } | ||
| 111 | + // } | ||
| 112 | + // notifyListeners(); | ||
| 113 | + return null; | ||
| 114 | + }); | ||
| 115 | + // menuModel = []; | ||
| 116 | + | ||
| 117 | + if (baseResp != null && baseResp.code == Constant.status_success) { | ||
| 118 | + if (baseResp.data is Map) { | ||
| 119 | + return baseResp.data['id']; | ||
| 120 | + } | ||
| 121 | + // notifyListeners(); | ||
| 122 | + | ||
| 123 | + } else { | ||
| 124 | + Utils.showToast(baseResp.msg ?? ""); | ||
| 125 | + // pageState = PageState.ConnectivityError; | ||
| 126 | + // notifyListeners(); | ||
| 127 | + | ||
| 128 | + } | ||
| 129 | + return null; | ||
| 130 | + } | ||
| 131 | + | ||
| 92 | /// 根据预定ID获取排菜 | 132 | /// 根据预定ID获取排菜 |
| 93 | getPlanCookByRid(BuildContext context, Map<String, String> params, | 133 | getPlanCookByRid(BuildContext context, Map<String, String> params, |
| 94 | {showLoading = false}) async { | 134 | {showLoading = false}) async { |
| @@ -1372,4 +1372,16 @@ class NavigatorUtil { | @@ -1372,4 +1372,16 @@ class NavigatorUtil { | ||
| 1372 | "${Routes.order_create_temporary_page}?object=${FluroConvertUtils.object2string(object)}", | 1372 | "${Routes.order_create_temporary_page}?object=${FluroConvertUtils.object2string(object)}", |
| 1373 | replace: replace); | 1373 | replace: replace); |
| 1374 | } | 1374 | } |
| 1375 | + | ||
| 1376 | + ///排菜----编辑客户详情 | ||
| 1377 | + static Future<dynamic> goOrderCustomerDetailEditPage( | ||
| 1378 | + BuildContext context, | ||
| 1379 | + NotebookDetail detailEntity, | ||
| 1380 | + { | ||
| 1381 | + replace = false, | ||
| 1382 | + }) { | ||
| 1383 | + return _navigateTo(context, | ||
| 1384 | + "${Routes.order_customer_detail_page}?detail=${FluroConvertUtils.object2string(detailEntity)}", | ||
| 1385 | + replace: replace); | ||
| 1386 | + } | ||
| 1375 | } | 1387 | } |
| @@ -184,6 +184,7 @@ import '../pages/my/plan_dish/plan_dish_eidt_page.dart'; | @@ -184,6 +184,7 @@ import '../pages/my/plan_dish/plan_dish_eidt_page.dart'; | ||
| 184 | import '../pages/my/plan_dish/plan_new_dish_first_page.dart'; | 184 | import '../pages/my/plan_dish/plan_new_dish_first_page.dart'; |
| 185 | import '../pages/my/plan_dish/plan_new_dish_page.dart'; | 185 | import '../pages/my/plan_dish/plan_new_dish_page.dart'; |
| 186 | import '../pages/my/table_manage/merge_table_select_page.dart'; | 186 | import '../pages/my/table_manage/merge_table_select_page.dart'; |
| 187 | +import '../pages/order_advance/customer_detail_page.dart'; | ||
| 187 | import '../pages/order_advance/order_advance_home_page.dart'; | 188 | import '../pages/order_advance/order_advance_home_page.dart'; |
| 188 | import '../pages/order_advance/order_create_temporary_page.dart'; | 189 | import '../pages/order_advance/order_create_temporary_page.dart'; |
| 189 | import '../pages/order_advance/order_edit_list_show_page.dart'; | 190 | import '../pages/order_advance/order_edit_list_show_page.dart'; |
| @@ -1951,7 +1952,9 @@ var orderAdvanceHomePageHandle = new Handler( | @@ -1951,7 +1952,9 @@ var orderAdvanceHomePageHandle = new Handler( | ||
| 1951 | .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); | 1952 | .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); |
| 1952 | return ChangeNotifierProvider<PlanDishProvider>( | 1953 | return ChangeNotifierProvider<PlanDishProvider>( |
| 1953 | create: (_) => PlanDishProvider(), | 1954 | create: (_) => PlanDishProvider(), |
| 1954 | - child: OrderAdvanceHomePage(detailEntity: detailEntity, rid: rid)); | 1955 | + child: ChangeNotifierProvider<CustomerProvider>( |
| 1956 | + create: (_) => CustomerProvider(), | ||
| 1957 | + child:OrderAdvanceHomePage(detailEntity: detailEntity, rid: rid))); | ||
| 1955 | }); | 1958 | }); |
| 1956 | 1959 | ||
| 1957 | ///经理排菜---编辑 | 1960 | ///经理排菜---编辑 |
| @@ -2244,5 +2247,18 @@ var orderCreateTemporaryPageHandle = new Handler( | @@ -2244,5 +2247,18 @@ var orderCreateTemporaryPageHandle = new Handler( | ||
| 2244 | } | 2247 | } |
| 2245 | 2248 | ||
| 2246 | return ChangeNotifierProvider<PlanDishProvider>( | 2249 | return ChangeNotifierProvider<PlanDishProvider>( |
| 2247 | - create: (_) => PlanDishProvider(), child: OrderCreateTemporaryPage(data:res)); | 2250 | + create: (_) => PlanDishProvider(), |
| 2251 | + child: OrderCreateTemporaryPage(data: res)); | ||
| 2252 | +}); | ||
| 2253 | + | ||
| 2254 | +///经理排菜----我的客情 | ||
| 2255 | +var orderCustomerDetailPageHandle = new Handler( | ||
| 2256 | + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | ||
| 2257 | + // String idstr = params["idstr"].first; | ||
| 2258 | + NotebookDetail detailEntity = NotebookDetail.fromJson(json | ||
| 2259 | + .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); | ||
| 2260 | + return ChangeNotifierProvider<CustomerProvider>( | ||
| 2261 | + create: (_) => CustomerProvider(), | ||
| 2262 | + child: OrderCustomerDetailPage(detailEntity: detailEntity)); | ||
| 2263 | + | ||
| 2248 | }); | 2264 | }); |
| @@ -181,7 +181,11 @@ class Routes { | @@ -181,7 +181,11 @@ class Routes { | ||
| 181 | static String plan_dish_create_select_type_page = | 181 | static String plan_dish_create_select_type_page = |
| 182 | "/plan_dish_create_select_type_page"; //经理排菜---类型选择页 | 182 | "/plan_dish_create_select_type_page"; //经理排菜---类型选择页 |
| 183 | static String plan_dish_edit_page = "/plan_dish_eidt_page"; //经理排菜---编辑页 | 183 | static String plan_dish_edit_page = "/plan_dish_eidt_page"; //经理排菜---编辑页 |
| 184 | - static String order_create_temporary_page = "/order_create_temporary_page"; //经理排菜---临时菜新建页 | 184 | + static String order_create_temporary_page = |
| 185 | + "/order_create_temporary_page"; //经理排菜---临时菜新建页 | ||
| 186 | + static String order_customer_detail_page = | ||
| 187 | + "/order_customer_detail_page"; //经理排菜---客情 | ||
| 188 | + | ||
| 185 | 189 | ||
| 186 | 190 | ||
| 187 | static void configureRoutes(FluroRouter router) { | 191 | static void configureRoutes(FluroRouter router) { |
| @@ -359,8 +363,10 @@ class Routes { | @@ -359,8 +363,10 @@ class Routes { | ||
| 359 | 363 | ||
| 360 | router.define(plan_dish_edit_page, handler: planDishEidtPageHandle); | 364 | router.define(plan_dish_edit_page, handler: planDishEidtPageHandle); |
| 361 | 365 | ||
| 362 | - router.define(order_create_temporary_page, handler: orderCreateTemporaryPageHandle); | 366 | + router.define(order_create_temporary_page, |
| 367 | + handler: orderCreateTemporaryPageHandle); | ||
| 363 | 368 | ||
| 364 | - | 369 | + router.define(order_customer_detail_page, |
| 370 | + handler: orderCustomerDetailPageHandle); | ||
| 365 | } | 371 | } |
| 366 | } | 372 | } |
| @@ -1147,6 +1147,17 @@ class Utils { | @@ -1147,6 +1147,17 @@ class Utils { | ||
| 1147 | miniProgramType: WXMiniProgramType.RELEASE); | 1147 | miniProgramType: WXMiniProgramType.RELEASE); |
| 1148 | } | 1148 | } |
| 1149 | 1149 | ||
| 1150 | + //跳转小程序提前点餐 | ||
| 1151 | + static goMiniProgramOrderPage( | ||
| 1152 | + BuildContext context, String rid, String oid, String sid) { | ||
| 1153 | + // UserModel model = Provider.of<UserModel>(context, listen: false); | ||
| 1154 | + launchWeChatMiniProgram( | ||
| 1155 | + username: "gh_487873d353b3", | ||
| 1156 | + path: | ||
| 1157 | + "pack-cookbook/pages/index?rid=$rid&oid=$oid&identity=1&sid=$sid", | ||
| 1158 | + miniProgramType: WXMiniProgramType.RELEASE); | ||
| 1159 | + } | ||
| 1160 | + | ||
| 1150 | //分享已点菜品 | 1161 | //分享已点菜品 |
| 1151 | static goShareOrderFoodToWeChat(BuildContext context, | 1162 | static goShareOrderFoodToWeChat(BuildContext context, |
| 1152 | {String title, String rid, String img}) async { | 1163 | {String title, String rid, String img}) async { |
| @@ -9,14 +9,17 @@ class EmptyPage extends StatefulWidget { | @@ -9,14 +9,17 @@ class EmptyPage extends StatefulWidget { | ||
| 9 | final String content; | 9 | final String content; |
| 10 | final String imgname; | 10 | final String imgname; |
| 11 | final Color bgcolor; | 11 | final Color bgcolor; |
| 12 | - final bool needEmpty; | 12 | + |
| 13 | + final String showText; | ||
| 14 | + final VoidCallback callback; | ||
| 13 | 15 | ||
| 14 | const EmptyPage( | 16 | const EmptyPage( |
| 15 | {Key key, | 17 | {Key key, |
| 16 | this.content, | 18 | this.content, |
| 17 | this.imgname = "bg_error", | 19 | this.imgname = "bg_error", |
| 18 | this.bgcolor = MyColours.color_ffffff, | 20 | this.bgcolor = MyColours.color_ffffff, |
| 19 | - this.needEmpty = false}) | 21 | + this.showText, |
| 22 | + this.callback}) | ||
| 20 | : super(key: key); | 23 | : super(key: key); |
| 21 | 24 | ||
| 22 | @override | 25 | @override |
| @@ -58,13 +61,13 @@ class EmptyPageState extends State<EmptyPage> { | @@ -58,13 +61,13 @@ class EmptyPageState extends State<EmptyPage> { | ||
| 58 | fontSize: ScreenUtil().setSp(28), | 61 | fontSize: ScreenUtil().setSp(28), |
| 59 | color: MyColours.color_353535), | 62 | color: MyColours.color_353535), |
| 60 | ), | 63 | ), |
| 61 | - widget.needEmpty | 64 | + widget.showText != null |
| 62 | ? InkWell( | 65 | ? InkWell( |
| 63 | onTap: () { | 66 | onTap: () { |
| 64 | - NavigatorUtil.goCouponHistoryPage(context); | 67 | + widget.callback(); |
| 65 | }, | 68 | }, |
| 66 | child: Text( | 69 | child: Text( |
| 67 | - '查看过期优惠券', | 70 | + widget.showText, |
| 68 | style: TextStyle( | 71 | style: TextStyle( |
| 69 | fontSize: ScreenUtil().setSp(28), | 72 | fontSize: ScreenUtil().setSp(28), |
| 70 | color: MyColours.color_438E93), | 73 | color: MyColours.color_438E93), |
| @@ -13,7 +13,7 @@ class ExceptionPage extends StatefulWidget { | @@ -13,7 +13,7 @@ class ExceptionPage extends StatefulWidget { | ||
| 13 | final String emptyImg; | 13 | final String emptyImg; |
| 14 | final String showMsg; | 14 | final String showMsg; |
| 15 | final Color defalutColor; | 15 | final Color defalutColor; |
| 16 | - final bool needEmpty; | 16 | + final String showText; |
| 17 | 17 | ||
| 18 | const ExceptionPage( | 18 | const ExceptionPage( |
| 19 | {Key key, | 19 | {Key key, |
| @@ -23,7 +23,7 @@ class ExceptionPage extends StatefulWidget { | @@ -23,7 +23,7 @@ class ExceptionPage extends StatefulWidget { | ||
| 23 | this.emptyImg = 'bg_error', | 23 | this.emptyImg = 'bg_error', |
| 24 | this.showMsg = '', | 24 | this.showMsg = '', |
| 25 | this.defalutColor = MyColours.color_ffffff, | 25 | this.defalutColor = MyColours.color_ffffff, |
| 26 | - this.needEmpty = false}) | 26 | + this.showText}) |
| 27 | : super(key: key); | 27 | : super(key: key); |
| 28 | 28 | ||
| 29 | @override | 29 | @override |
| @@ -62,7 +62,8 @@ class ExceptionPageState extends State<ExceptionPage> { | @@ -62,7 +62,8 @@ class ExceptionPageState extends State<ExceptionPage> { | ||
| 62 | page = EmptyPage( | 62 | page = EmptyPage( |
| 63 | content: widget.emptyMsg, | 63 | content: widget.emptyMsg, |
| 64 | imgname: widget.emptyImg, | 64 | imgname: widget.emptyImg, |
| 65 | - needEmpty: widget.needEmpty, | 65 | + showText: widget.showText, |
| 66 | + callback: widget.callback, | ||
| 66 | ); | 67 | ); |
| 67 | break; | 68 | break; |
| 68 | case PageState.First: | 69 | case PageState.First: |
-
Please register or login to post a comment