Showing
12 changed files
with
447 additions
and
67 deletions
| @@ -270,7 +270,7 @@ class MenuSunModel { | @@ -270,7 +270,7 @@ class MenuSunModel { | ||
| 270 | 270 | ||
| 271 | taste = json['taste']; | 271 | taste = json['taste']; |
| 272 | cooks = json['cooks']; | 272 | cooks = json['cooks']; |
| 273 | - json['cook_style'] != null && json['cook_style'] != '' | 273 | + json['cook_style'] != null && json['cook_style'] != '' |
| 274 | ? cookStyle = DishCookStyle.fromJson(json['cook_style'] is Map | 274 | ? cookStyle = DishCookStyle.fromJson(json['cook_style'] is Map |
| 275 | ? json['cook_style'] | 275 | ? json['cook_style'] |
| 276 | : convert.json.decode(json['cook_style'])) | 276 | : convert.json.decode(json['cook_style'])) |
| @@ -403,9 +403,11 @@ class MenuSunModel { | @@ -403,9 +403,11 @@ class MenuSunModel { | ||
| 403 | taste = json['taste']; | 403 | taste = json['taste']; |
| 404 | cooks = json['cooks']; | 404 | cooks = json['cooks']; |
| 405 | json['cook_style'] != null && json['cook_style'] != '' | 405 | json['cook_style'] != null && json['cook_style'] != '' |
| 406 | - ? cookStyle = DishCookStyle.fromJson(json['cook_style'] is Map | 406 | + ? json['cook_style'] is DishCookStyle |
| 407 | ? json['cook_style'] | 407 | ? json['cook_style'] |
| 408 | - : convert.json.decode(json['cook_style'])) | 408 | + : cookStyle = DishCookStyle.fromJson(json['cook_style'] is Map |
| 409 | + ? json['cook_style'] | ||
| 410 | + : convert.json.decode(json['cook_style'])) | ||
| 409 | : cookStyle = DishCookStyle.fromJson({ | 411 | : cookStyle = DishCookStyle.fromJson({ |
| 410 | // 'image_type': image != null && image != '' ? '1' : '2', | 412 | // 'image_type': image != null && image != '' ? '1' : '2', |
| 411 | 'image_type': '1', | 413 | 'image_type': '1', |
| @@ -82,7 +82,7 @@ class SetMealSunModel { | @@ -82,7 +82,7 @@ class SetMealSunModel { | ||
| 82 | data['bargaining'] = this.bargaining; | 82 | data['bargaining'] = this.bargaining; |
| 83 | data['status'] = this.status; | 83 | data['status'] = this.status; |
| 84 | data['cdate'] = this.cdate; | 84 | data['cdate'] = this.cdate; |
| 85 | - if (this.classify = null) { | 85 | + if (this.classify != null) { |
| 86 | data['class'] = this.classify.map((v) => v.toJson()).toList(); | 86 | data['class'] = this.classify.map((v) => v.toJson()).toList(); |
| 87 | } | 87 | } |
| 88 | if (this.cook != null) { | 88 | if (this.cook != null) { |
| @@ -204,9 +204,9 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { | @@ -204,9 +204,9 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { | ||
| 204 | Tab( | 204 | Tab( |
| 205 | text: "我的优惠券", | 205 | text: "我的优惠券", |
| 206 | ), | 206 | ), |
| 207 | - Tab( | ||
| 208 | - text: "核销记录", | ||
| 209 | - ) | 207 | + // Tab( |
| 208 | + // text: "核销记录", | ||
| 209 | + // ) | ||
| 210 | ], | 210 | ], |
| 211 | indicatorColor: MyColours.color_438E93, | 211 | indicatorColor: MyColours.color_438E93, |
| 212 | indicatorSize: TabBarIndicatorSize.label, | 212 | indicatorSize: TabBarIndicatorSize.label, |
| @@ -236,9 +236,9 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { | @@ -236,9 +236,9 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { | ||
| 236 | ChangeNotifierProvider<PersonnelProvider>( | 236 | ChangeNotifierProvider<PersonnelProvider>( |
| 237 | create: (_) => PersonnelProvider(), | 237 | create: (_) => PersonnelProvider(), |
| 238 | child: CouponSunPage(index: 2)), | 238 | child: CouponSunPage(index: 2)), |
| 239 | - ChangeNotifierProvider<PersonnelProvider>( | ||
| 240 | - create: (_) => PersonnelProvider(), | ||
| 241 | - child: CouponHasVerificationPage()), | 239 | + // ChangeNotifierProvider<PersonnelProvider>( |
| 240 | + // create: (_) => PersonnelProvider(), | ||
| 241 | + // child: CouponHasVerificationPage()), | ||
| 242 | ], | 242 | ], |
| 243 | ), | 243 | ), |
| 244 | ), | 244 | ), |
| @@ -79,11 +79,12 @@ class MessageTreatedPageState extends State<MessageTreatedPage> { | @@ -79,11 +79,12 @@ class MessageTreatedPageState extends State<MessageTreatedPage> { | ||
| 79 | MessageMenuModel model5 = MessageMenuModel(); | 79 | MessageMenuModel model5 = MessageMenuModel(); |
| 80 | model5.title = '在线买单'; | 80 | model5.title = '在线买单'; |
| 81 | model5.select = false; | 81 | model5.select = false; |
| 82 | - MessageMenuModel model6 = MessageMenuModel(); | ||
| 83 | - model6.title = '会员充值'; | ||
| 84 | - model6.select = false; | 82 | + // MessageMenuModel model6 = MessageMenuModel(); |
| 83 | + // model6.title = '会员充值'; | ||
| 84 | + // model6.select = false; | ||
| 85 | 85 | ||
| 86 | - menuTitle = [model1, model2, model3, model4, model5, model6]; | 86 | + // menuTitle = [model1, model2, model3, model4, model5, model6]; |
| 87 | + menuTitle = [model1, model2, model3, model4, model5]; | ||
| 87 | } | 88 | } |
| 88 | 89 | ||
| 89 | @override | 90 | @override |
| @@ -166,10 +167,11 @@ class MessageTreatedPageState extends State<MessageTreatedPage> { | @@ -166,10 +167,11 @@ class MessageTreatedPageState extends State<MessageTreatedPage> { | ||
| 166 | } else if (index == 4) { | 167 | } else if (index == 4) { |
| 167 | //在线买单 | 168 | //在线买单 |
| 168 | typeid = '12'; | 169 | typeid = '12'; |
| 169 | - } else if (index == 5) { | ||
| 170 | - //会员充值 | ||
| 171 | - typeid = '12'; | ||
| 172 | } | 170 | } |
| 171 | + // else if (index == 5) { | ||
| 172 | + // //会员充值 | ||
| 173 | + // typeid = '12'; | ||
| 174 | + // } | ||
| 173 | getMessage(typeid, showLoading: true); | 175 | getMessage(typeid, showLoading: true); |
| 174 | }, | 176 | }, |
| 175 | child: Container( | 177 | child: Container( |
| 1 | import 'package:flutter/material.dart'; | 1 | import 'package:flutter/material.dart'; |
| 2 | +import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart'; | ||
| 3 | +import 'package:flutter_screenutil/flutter_screenutil.dart'; | ||
| 4 | +import 'package:one_key/utils/repaint_boundary_utils.dart'; | ||
| 2 | import 'package:one_key/widgets/system_app_bar.dart'; | 5 | import 'package:one_key/widgets/system_app_bar.dart'; |
| 3 | import 'package:provider/provider.dart'; | 6 | import 'package:provider/provider.dart'; |
| 4 | 7 | ||
| 5 | -import '../../../provider/feast_model.dart'; | 8 | +import '../../../models/cookbook_model.dart'; |
| 9 | +import '../../../models/notebook_detail.dart'; | ||
| 10 | +import '../../../models/recharge_list_model.dart'; | ||
| 11 | +import '../../../models/setmeal_by_id_model.dart'; | ||
| 12 | +import '../../../models/setmeal_model.dart'; | ||
| 13 | +import '../../../models/user.dart'; | ||
| 14 | +import '../../../provider/marketing_center_provider.dart'; | ||
| 15 | +import '../../../provider/user_model.dart'; | ||
| 16 | +import '../../../res/colors.dart'; | ||
| 17 | +import '../../../utils/screen_util.dart'; | ||
| 18 | +import '../../../utils/share_helper.dart'; | ||
| 19 | +import '../../../utils/utils.dart'; | ||
| 20 | +import '../../../widgets/MyDivider.dart'; | ||
| 21 | +import '../../../widgets/h_empty_view.dart'; | ||
| 22 | +import '../../../widgets/round_button.dart'; | ||
| 23 | +import '../../../widgets/v_empty_view.dart'; | ||
| 6 | 24 | ||
| 7 | /** | 25 | /** |
| 8 | * 宴会套餐菜单分享 | 26 | * 宴会套餐菜单分享 |
| 9 | */ | 27 | */ |
| 28 | + | ||
| 10 | class FeastDishSharePage extends StatefulWidget { | 29 | class FeastDishSharePage extends StatefulWidget { |
| 11 | - final String setmealId; | ||
| 12 | - FeastDishSharePage({Key key, this.setmealId}) : super(key: key); | 30 | + final SetMealSunModel setmealDetail; //套餐详情 |
| 31 | + | ||
| 32 | + FeastDishSharePage({ | ||
| 33 | + Key key, | ||
| 34 | + this.setmealDetail, | ||
| 35 | + }) : super(key: key); | ||
| 13 | 36 | ||
| 14 | @override | 37 | @override |
| 15 | _FeastDishSharePageState createState() => _FeastDishSharePageState(); | 38 | _FeastDishSharePageState createState() => _FeastDishSharePageState(); |
| 16 | } | 39 | } |
| 17 | 40 | ||
| 18 | class _FeastDishSharePageState extends State<FeastDishSharePage> { | 41 | class _FeastDishSharePageState extends State<FeastDishSharePage> { |
| 19 | - FeastModel feastModel; | 42 | + ScrollController controller = ScrollController(); |
| 43 | + //全局key-截图key | ||
| 44 | + final GlobalKey boundaryKey = GlobalKey(); | ||
| 45 | + | ||
| 46 | + Map<String, List<Cook>> data = {}; | ||
| 47 | + | ||
| 48 | + // Map<String, List<Cook>> dataNew = {}; | ||
| 49 | + List<String> classNames = []; | ||
| 50 | + | ||
| 20 | @override | 51 | @override |
| 21 | void initState() { | 52 | void initState() { |
| 22 | super.initState(); | 53 | super.initState(); |
| 23 | - WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| 24 | - _getSetmealById(); | ||
| 25 | - _getSetmealClass(); | ||
| 26 | - }); | 54 | + Utils.changeStatusColor(color: Colors.transparent); |
| 55 | + _getSetmealById(); | ||
| 27 | } | 56 | } |
| 28 | 57 | ||
| 29 | /// 根据ID获取宴会套餐 | 58 | /// 根据ID获取宴会套餐 |
| 30 | - _getSetmealById({bool isShowLoading = true}) async { | ||
| 31 | - Map<String, String> params = {"id": widget.setmealId}; | ||
| 32 | - bool success = await feastModel.getSetmealById(context, params, | ||
| 33 | - isShowLoading: isShowLoading); | ||
| 34 | - if (success) { | ||
| 35 | - // mealNameC.text = feastModel.setmealDetail.mealName; | ||
| 36 | - // mealPriceC.text = feastModel.setmealDetail.price; | ||
| 37 | - // canBargaining = feastModel.setmealDetail.bargaining == '1' ? true : false; | ||
| 38 | - setState(() {}); | 59 | + _getSetmealById() async { |
| 60 | + // Map<String, String> params = {"id": widget.setmealId}; | ||
| 61 | + // bool success = await feastModel.getSetmealById(context, params, | ||
| 62 | + // isShowLoading: isShowLoading); | ||
| 63 | + // if (success) { | ||
| 64 | + // if (widget.justSelData.length > 0) { | ||
| 65 | + // data = widget.justSelData; | ||
| 66 | + // data.forEach((key, value) { | ||
| 67 | + // classNames.add(key); | ||
| 68 | + // }); | ||
| 69 | + // } else { | ||
| 70 | + for (Classify item in widget.setmealDetail.classify) { | ||
| 71 | + // Map<String, List<Cook>> map = {}; | ||
| 72 | + String cid = item.id; | ||
| 73 | + String className = item.className; | ||
| 74 | + | ||
| 75 | + List<Cook> temp = []; | ||
| 76 | + int numStr = 0; | ||
| 77 | + for (Cook itemCook in widget.setmealDetail.cook) { | ||
| 78 | + if (cid == itemCook.cid) { | ||
| 79 | + temp.add(itemCook); | ||
| 80 | + if (itemCook.numStr != null) { | ||
| 81 | + numStr += int.parse(itemCook.numStr); | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + String key = className + '(${numStr}道)'; | ||
| 86 | + classNames.add(key); | ||
| 87 | + data[key] = temp; | ||
| 39 | } | 88 | } |
| 89 | + // } | ||
| 90 | + | ||
| 91 | + setState(() {}); | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + Widget _laduWidget() { | ||
| 95 | + // if (labelIcon[widget | ||
| 96 | + // .cookBookList.labelList[index].icon] is int) { | ||
| 97 | + // int ladu = labelIcon[ | ||
| 98 | + // widget.cookBookList.labelList[index].icon]; | ||
| 99 | + int ladu = 6; | ||
| 100 | + List<Widget> widgetList = []; | ||
| 101 | + for (var i = 0; i < ladu; i++) { | ||
| 102 | + widgetList.add(Image.asset( | ||
| 103 | + Utils.getImgPath('ladu'), | ||
| 104 | + width: w(10), | ||
| 105 | + )); | ||
| 106 | + } | ||
| 107 | + // widgetList.add(HEmptyView(10)); | ||
| 108 | + return Row( | ||
| 109 | + children: widgetList, | ||
| 110 | + ); | ||
| 111 | + // }else{ | ||
| 112 | + // return SizedBox(); | ||
| 113 | + // } | ||
| 40 | } | 114 | } |
| 41 | 115 | ||
| 42 | - /// 获取宴会套餐菜品分类列表 | ||
| 43 | - _getSetmealClass({bool isShowLoading = true}) async { | ||
| 44 | - Map<String, String> params = {"mid": widget.setmealId}; | ||
| 45 | - await feastModel.getSetmealClass(context, params, | ||
| 46 | - isShowLoading: isShowLoading); | ||
| 47 | - | 116 | + Widget _itemBuildWidget(BuildContext context, int index1) { |
| 117 | + List<Cook> cookList = data[classNames[index1]]; | ||
| 118 | + return ListView.builder( | ||
| 119 | + shrinkWrap: true, | ||
| 120 | + controller: controller, | ||
| 121 | + padding: EdgeInsets.only(bottom: w(20)), | ||
| 122 | + itemCount: cookList.length + 1, | ||
| 123 | + itemBuilder: (BuildContext context, int index) { | ||
| 124 | + if (index < 1) { | ||
| 125 | + return _buildHeaderWidget(context, classNames[index1]); | ||
| 126 | + } else { | ||
| 127 | + int itemIndex = index - 1; | ||
| 128 | + Cook setmeal = cookList[itemIndex]; | ||
| 129 | + | ||
| 130 | + return Container( | ||
| 131 | + margin: new EdgeInsets.only(top: h(14), left: w(25), right: w(25)), | ||
| 132 | + color: MyColours.color_ffffff, | ||
| 133 | + child: new GestureDetector( | ||
| 134 | + onTap: () { | ||
| 135 | + // _gotoProjectDetail(projectModelList[index]); | ||
| 136 | + }, | ||
| 137 | + child: new Container( | ||
| 138 | + color: MyColours.color_ffffff, | ||
| 139 | + child: Row( | ||
| 140 | + mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 141 | + children: [ | ||
| 142 | + Expanded( | ||
| 143 | + child: Container( | ||
| 144 | + child: Text( | ||
| 145 | + setmeal.cname, | ||
| 146 | + overflow: TextOverflow.ellipsis, | ||
| 147 | + maxLines: 10, | ||
| 148 | + style: TextStyle( | ||
| 149 | + color: MyColours.color_515151, | ||
| 150 | + fontSize: ScreenUtil().setSp(32)), | ||
| 151 | + ))), | ||
| 152 | + HEmptyView(30), | ||
| 153 | + Container( | ||
| 154 | + // width: h(16), | ||
| 155 | + child: Text( | ||
| 156 | + '${setmeal.numStr ?? ''}${setmeal.spec}', | ||
| 157 | + overflow: TextOverflow.ellipsis, | ||
| 158 | + maxLines: 1, | ||
| 159 | + style: TextStyle( | ||
| 160 | + color: MyColours.color_515151, | ||
| 161 | + fontSize: ScreenUtil().setSp(32)), | ||
| 162 | + )), | ||
| 163 | + ], | ||
| 164 | + )), | ||
| 165 | + ), | ||
| 166 | + ); | ||
| 167 | + } | ||
| 168 | + }, | ||
| 169 | + ); | ||
| 170 | + } | ||
| 171 | + | ||
| 172 | + // // 总count数 | ||
| 173 | + // int _getItemListCount() { | ||
| 174 | + // return data.length + 1; | ||
| 175 | + // } | ||
| 176 | + // 根据index展示不同的widget | ||
| 177 | + Widget buildItemWidget(BuildContext context, int index) { | ||
| 178 | + return _itemBuildWidget(context, index); | ||
| 179 | + } | ||
| 180 | + | ||
| 181 | + // header内容 | ||
| 182 | + Widget _buildHeaderWidget(BuildContext context, String title) { | ||
| 183 | + return Column( | ||
| 184 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 185 | + children: [ | ||
| 186 | + Container( | ||
| 187 | + padding: EdgeInsets.symmetric(horizontal: w(16), vertical: w(14)), | ||
| 188 | + child: Text( | ||
| 189 | + title, | ||
| 190 | + style: TextStyle( | ||
| 191 | + color: MyColours.color_E6000000, | ||
| 192 | + fontSize: font(16), | ||
| 193 | + ), | ||
| 194 | + )), | ||
| 195 | + Padding( | ||
| 196 | + padding: EdgeInsets.only(left: w(16)), | ||
| 197 | + child: MyDivider( | ||
| 198 | + double.infinity, | ||
| 199 | + w(0.5), | ||
| 200 | + color: MyColours.color_E7E7E7, | ||
| 201 | + )) | ||
| 202 | + ], | ||
| 203 | + ); | ||
| 48 | } | 204 | } |
| 49 | 205 | ||
| 50 | @override | 206 | @override |
| 51 | Widget build(BuildContext context) { | 207 | Widget build(BuildContext context) { |
| 52 | - feastModel = Provider.of<FeastModel>(context, listen: true); | ||
| 53 | - return Scaffold( | ||
| 54 | - body: Container(), | ||
| 55 | - ); | 208 | + String sellername = |
| 209 | + Provider.of<UserModel>(context, listen: false).user.sellername; | ||
| 210 | + String sellerAdr = | ||
| 211 | + Provider.of<UserModel>(context, listen: false).user.sellerAddr; | ||
| 212 | + User user = Provider.of<UserModel>(context, listen: false).user; | ||
| 213 | + String servicePerson = '${user.nickName ?? ''} ${user.userphone ?? ''}'; | ||
| 214 | + | ||
| 215 | + return KeyboardDismissOnTap( | ||
| 216 | + child: Scaffold( | ||
| 217 | + backgroundColor: MyColours.color_ffffff, | ||
| 218 | + appBar: SystemAppBar('排菜单'), | ||
| 219 | + body: Column( | ||
| 220 | + children: [ | ||
| 221 | + Expanded( | ||
| 222 | + child: SingleChildScrollView( | ||
| 223 | + controller: controller, | ||
| 224 | + child: RepaintBoundary( | ||
| 225 | + key: boundaryKey, | ||
| 226 | + child: Container( | ||
| 227 | + color: Colors.white, | ||
| 228 | + child: Column(children: [ | ||
| 229 | + Stack(children: [ | ||
| 230 | + Stack( | ||
| 231 | + // alignment: AlignmentDirectional.bottomCenter, // alignment:子组件对齐方式 系统默认 | ||
| 232 | + // alignment: const FractionalOffset(0.5, 0.9), //自己指定Stack子组件对齐 ,只对Stack中有两个子View生效。0.5表示x轴,0.9表示y轴(FractionalOffset 0.5,0.5表示中心) | ||
| 233 | + //AlignmentDirectional x、y 偏移量取值范围为 [-1,1],如果 x 的偏移量大于 0,则表示向右偏移,小于 0 则向左偏移;如果 y 轴的偏移量大于 0 则向下偏移,小于 0 则向上偏移。 | ||
| 234 | + alignment: AlignmentDirectional( | ||
| 235 | + 0, 0), //AlignmentDirectional 0,0表示在正中心。 | ||
| 236 | + fit: StackFit.loose, | ||
| 237 | + | ||
| 238 | + children: [ | ||
| 239 | + Container( | ||
| 240 | + width: double.infinity, | ||
| 241 | + margin: EdgeInsets.zero, | ||
| 242 | + padding: EdgeInsets.only( | ||
| 243 | + left: w(20), | ||
| 244 | + right: w(20), | ||
| 245 | + top: w(30), | ||
| 246 | + bottom: w(15)), | ||
| 247 | + // height: w(200), | ||
| 248 | + // constraints: new BoxConstraints.expand( | ||
| 249 | + // height: w(200), | ||
| 250 | + // ), | ||
| 251 | + decoration: BoxDecoration( | ||
| 252 | + gradient: LinearGradient( | ||
| 253 | + stops: [ | ||
| 254 | + -0.5747, | ||
| 255 | + 0.5572, | ||
| 256 | + 1.4872 | ||
| 257 | + ], | ||
| 258 | + colors: [ | ||
| 259 | + MyColours.color_4C8DAD, | ||
| 260 | + MyColours.color_0143A3, | ||
| 261 | + MyColours.color_42A5FF | ||
| 262 | + ], | ||
| 263 | + begin: Alignment.topLeft, | ||
| 264 | + end: Alignment.bottomRight), | ||
| 265 | + ), | ||
| 266 | + child: Container( | ||
| 267 | + color: Colors.transparent, | ||
| 268 | + child: Column( | ||
| 269 | + crossAxisAlignment: | ||
| 270 | + CrossAxisAlignment.start, | ||
| 271 | + children: [ | ||
| 272 | + Text( | ||
| 273 | + '${sellername} 贵宾排菜菜单', | ||
| 274 | + style: TextStyle( | ||
| 275 | + fontSize: font(20), | ||
| 276 | + fontWeight: FontWeight.bold, | ||
| 277 | + color: Colors.transparent), | ||
| 278 | + ), | ||
| 279 | + VEmptyView(26), | ||
| 280 | + Text( | ||
| 281 | + '套餐名称 | ${widget.setmealDetail.mealName ?? ''}', | ||
| 282 | + style: TextStyle( | ||
| 283 | + fontSize: font(14), | ||
| 284 | + color: Colors.transparent), | ||
| 285 | + ), | ||
| 286 | + VEmptyView(10), | ||
| 287 | + Text( | ||
| 288 | + '套餐价格 | ${widget.setmealDetail.price}元', | ||
| 289 | + style: TextStyle( | ||
| 290 | + fontSize: font(14), | ||
| 291 | + color: Colors.transparent), | ||
| 292 | + ), | ||
| 293 | + VEmptyView(10), | ||
| 294 | + Text( | ||
| 295 | + '餐厅地址 | ${sellerAdr}', | ||
| 296 | + style: TextStyle( | ||
| 297 | + fontSize: font(14), | ||
| 298 | + color: Colors.transparent), | ||
| 299 | + ), | ||
| 300 | + VEmptyView(10), | ||
| 301 | + Text( | ||
| 302 | + '专属服务 | ${servicePerson}', | ||
| 303 | + style: TextStyle( | ||
| 304 | + fontSize: font(14), | ||
| 305 | + color: Colors.transparent), | ||
| 306 | + ), | ||
| 307 | + ], | ||
| 308 | + )), | ||
| 309 | + ), | ||
| 310 | + Positioned( | ||
| 311 | + right: w(22), | ||
| 312 | + bottom: w(30), | ||
| 313 | + child: Image.asset(Utils.getImgPath('menu_bg')), | ||
| 314 | + width: w(170), | ||
| 315 | + ) | ||
| 316 | + ], | ||
| 317 | + ), | ||
| 318 | + Positioned( | ||
| 319 | + top: w(30), | ||
| 320 | + left: w(20), | ||
| 321 | + child: Container( | ||
| 322 | + color: Colors.transparent, | ||
| 323 | + child: Column( | ||
| 324 | + crossAxisAlignment: CrossAxisAlignment.start, | ||
| 325 | + children: [ | ||
| 326 | + Text( | ||
| 327 | + '${sellername} 贵宾排菜菜单', | ||
| 328 | + style: TextStyle( | ||
| 329 | + fontSize: font(20), | ||
| 330 | + fontWeight: FontWeight.bold, | ||
| 331 | + color: MyColours.color_CFB53B), | ||
| 332 | + ), | ||
| 333 | + VEmptyView(26), | ||
| 334 | + Text( | ||
| 335 | + '套餐名称 | ${widget.setmealDetail.mealName ?? ''}', | ||
| 336 | + style: TextStyle( | ||
| 337 | + fontSize: font(14), | ||
| 338 | + color: MyColours.color_CFB53B), | ||
| 339 | + ), | ||
| 340 | + VEmptyView(10), | ||
| 341 | + Text( | ||
| 342 | + '套餐价格 | ${widget.setmealDetail.price}元', | ||
| 343 | + style: TextStyle( | ||
| 344 | + fontSize: font(14), | ||
| 345 | + color: MyColours.color_CFB53B), | ||
| 346 | + ), | ||
| 347 | + VEmptyView(10), | ||
| 348 | + Text( | ||
| 349 | + '餐厅地址 | ${sellerAdr}', | ||
| 350 | + style: TextStyle( | ||
| 351 | + fontSize: font(14), | ||
| 352 | + color: MyColours.color_CFB53B), | ||
| 353 | + ), | ||
| 354 | + VEmptyView(10), | ||
| 355 | + Text( | ||
| 356 | + '专属服务 | ${servicePerson}', | ||
| 357 | + style: TextStyle( | ||
| 358 | + fontSize: font(14), | ||
| 359 | + color: MyColours.color_CFB53B), | ||
| 360 | + ), | ||
| 361 | + ], | ||
| 362 | + ))), | ||
| 363 | + ]), | ||
| 364 | + ListView.builder( | ||
| 365 | + shrinkWrap: true, | ||
| 366 | + controller: controller, | ||
| 367 | + // padding: EdgeInsets.only(right: w(12)), | ||
| 368 | + itemCount: data.length, | ||
| 369 | + itemBuilder: (BuildContext context, int index) { | ||
| 370 | + return buildItemWidget(context, index); | ||
| 371 | + }, | ||
| 372 | + ) | ||
| 373 | + ]))), | ||
| 374 | + )), | ||
| 375 | + Container( | ||
| 376 | + color: MyColours.color_ffffff, | ||
| 377 | + padding: EdgeInsets.only( | ||
| 378 | + top: w(12), bottom: w(25), left: w(23), right: w(23)), | ||
| 379 | + child: Row( | ||
| 380 | + // mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||
| 381 | + children: [ | ||
| 382 | + RoundButton( | ||
| 383 | + text: '返回', | ||
| 384 | + gradientStart: MyColours.color_ffffff, | ||
| 385 | + gradientEnd: MyColours.color_ffffff, | ||
| 386 | + borderColor: MyColours.color_438E93, | ||
| 387 | + textColor: MyColours.color_438E93, | ||
| 388 | + width: w(100), | ||
| 389 | + height: w(43), | ||
| 390 | + radius: r(5), | ||
| 391 | + fontSize: 32, | ||
| 392 | + isBold: false, | ||
| 393 | + onPressed: () { | ||
| 394 | + Navigator.pop(context); | ||
| 395 | + // NavigatorUtil.goFeastDishSharePage(context); | ||
| 396 | + }, | ||
| 397 | + ), | ||
| 398 | + HEmptyView(30), | ||
| 399 | + Expanded( | ||
| 400 | + child: RoundButton( | ||
| 401 | + text: '分享排菜单', | ||
| 402 | + gradientStart: MyColours.color_438E93, | ||
| 403 | + gradientEnd: MyColours.color_438E93, | ||
| 404 | + height: w(43), | ||
| 405 | + radius: r(5), | ||
| 406 | + fontSize: 36, | ||
| 407 | + isBold: false, | ||
| 408 | + onPressed: () { | ||
| 409 | + ShareHelper.onShareWx( | ||
| 410 | + context, | ||
| 411 | + boundaryKey: boundaryKey, | ||
| 412 | + ); | ||
| 413 | + | ||
| 414 | + // NavigatorUtil.goFeastDishSharePage(context); | ||
| 415 | + }, | ||
| 416 | + ), | ||
| 417 | + ) | ||
| 418 | + ], | ||
| 419 | + )) | ||
| 420 | + ], | ||
| 421 | + ), | ||
| 422 | + )); | ||
| 56 | } | 423 | } |
| 57 | } | 424 | } |
| @@ -133,7 +133,7 @@ class _FeastSetmealManagePageState extends State<FeastSetmealManagePage> { | @@ -133,7 +133,7 @@ class _FeastSetmealManagePageState extends State<FeastSetmealManagePage> { | ||
| 133 | Spacer(), | 133 | Spacer(), |
| 134 | InkWell( | 134 | InkWell( |
| 135 | onTap: () { | 135 | onTap: () { |
| 136 | - NavigatorUtil.goFeastDishSharePage(context,data.id); | 136 | + NavigatorUtil.goFeastDishSharePage(context,data); |
| 137 | }, | 137 | }, |
| 138 | child: Text( | 138 | child: Text( |
| 139 | '预览&分享', | 139 | '预览&分享', |
| @@ -110,7 +110,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -110,7 +110,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | _getDzSellerConf() async { | 112 | _getDzSellerConf() async { |
| 113 | - bool success = await menuManageProvider.getDzSellerConf(context); | 113 | + bool success = await menuManageProvider.getDzSellerConf(context,showLoading: false); |
| 114 | if (success) { | 114 | if (success) { |
| 115 | themeColerModel1 = themeColorData[menuManageProvider | 115 | themeColerModel1 = themeColorData[menuManageProvider |
| 116 | .dzSellerConfModel.cookStyle == | 116 | .dzSellerConfModel.cookStyle == |
| @@ -291,7 +291,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -291,7 +291,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 291 | spreadRadius: w(20)) | 291 | spreadRadius: w(20)) |
| 292 | ])), | 292 | ])), |
| 293 | VEmptyView(20), | 293 | VEmptyView(20), |
| 294 | - model.price == null | 294 | + model.spec != null |
| 295 | ? Column( | 295 | ? Column( |
| 296 | crossAxisAlignment: CrossAxisAlignment.start, | 296 | crossAxisAlignment: CrossAxisAlignment.start, |
| 297 | children: _priceWidget(model)) | 297 | children: _priceWidget(model)) |
| @@ -317,7 +317,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -317,7 +317,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 317 | 317 | ||
| 318 | List<Widget> _priceWidget(MenuSunModel model) { | 318 | List<Widget> _priceWidget(MenuSunModel model) { |
| 319 | List<SpecModel> tempPrice = []; | 319 | List<SpecModel> tempPrice = []; |
| 320 | - if (model.price == null) { | 320 | + if (model.spec != null) { |
| 321 | //新添加菜品 | 321 | //新添加菜品 |
| 322 | model.spec.forEach((element) { | 322 | model.spec.forEach((element) { |
| 323 | if (element.status == '1') { | 323 | if (element.status == '1') { |
| @@ -405,7 +405,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -405,7 +405,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 405 | spreadRadius: w(20)) | 405 | spreadRadius: w(20)) |
| 406 | ])), | 406 | ])), |
| 407 | VEmptyView(20), | 407 | VEmptyView(20), |
| 408 | - model.price == null | 408 | + model.spec != null |
| 409 | ? Column( | 409 | ? Column( |
| 410 | crossAxisAlignment: CrossAxisAlignment.start, | 410 | crossAxisAlignment: CrossAxisAlignment.start, |
| 411 | children: _priceWidget(model)) | 411 | children: _priceWidget(model)) |
| @@ -494,7 +494,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -494,7 +494,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 494 | ), | 494 | ), |
| 495 | )), | 495 | )), |
| 496 | HEmptyView(10), | 496 | HEmptyView(10), |
| 497 | - model.price == null | 497 | + model.spec != null |
| 498 | ? Column( | 498 | ? Column( |
| 499 | crossAxisAlignment: CrossAxisAlignment.start, | 499 | crossAxisAlignment: CrossAxisAlignment.start, |
| 500 | children: _priceWidget(model)) | 500 | children: _priceWidget(model)) |
| @@ -582,7 +582,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | @@ -582,7 +582,7 @@ class _MenuManagePageState extends State<MenuManagePage> { | ||
| 582 | VEmptyView(20), | 582 | VEmptyView(20), |
| 583 | Padding( | 583 | Padding( |
| 584 | padding: EdgeInsets.symmetric(horizontal: w(10)), | 584 | padding: EdgeInsets.symmetric(horizontal: w(10)), |
| 585 | - child: model.price == null | 585 | + child: model.spec != null |
| 586 | ? Column( | 586 | ? Column( |
| 587 | crossAxisAlignment: CrossAxisAlignment.start, | 587 | crossAxisAlignment: CrossAxisAlignment.start, |
| 588 | children: _priceWidget(model)) | 588 | children: _priceWidget(model)) |
| @@ -350,7 +350,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -350,7 +350,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 350 | spreadRadius: w(20)) | 350 | spreadRadius: w(20)) |
| 351 | ])), | 351 | ])), |
| 352 | VEmptyView(20), | 352 | VEmptyView(20), |
| 353 | - model.price == null | 353 | + model.spec != null |
| 354 | ? Column( | 354 | ? Column( |
| 355 | crossAxisAlignment: CrossAxisAlignment.start, | 355 | crossAxisAlignment: CrossAxisAlignment.start, |
| 356 | children: _priceWidget(model)) | 356 | children: _priceWidget(model)) |
| @@ -376,7 +376,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -376,7 +376,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 376 | 376 | ||
| 377 | List<Widget> _priceWidget(MenuSunModel model) { | 377 | List<Widget> _priceWidget(MenuSunModel model) { |
| 378 | List<SpecModel> tempPrice = []; | 378 | List<SpecModel> tempPrice = []; |
| 379 | - if (model.price == null) { | 379 | + if (model.spec != null) { |
| 380 | //新添加菜品 | 380 | //新添加菜品 |
| 381 | model.spec.forEach((element) { | 381 | model.spec.forEach((element) { |
| 382 | if (element.status == '1') { | 382 | if (element.status == '1') { |
| @@ -464,7 +464,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -464,7 +464,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 464 | spreadRadius: w(20)) | 464 | spreadRadius: w(20)) |
| 465 | ])), | 465 | ])), |
| 466 | VEmptyView(20), | 466 | VEmptyView(20), |
| 467 | - model.price == null | 467 | + model.spec != null |
| 468 | ? Column( | 468 | ? Column( |
| 469 | crossAxisAlignment: CrossAxisAlignment.start, | 469 | crossAxisAlignment: CrossAxisAlignment.start, |
| 470 | children: _priceWidget(model)) | 470 | children: _priceWidget(model)) |
| @@ -553,7 +553,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -553,7 +553,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 553 | ), | 553 | ), |
| 554 | )), | 554 | )), |
| 555 | HEmptyView(10), | 555 | HEmptyView(10), |
| 556 | - model.price == null | 556 | + model.spec != null |
| 557 | ? Column( | 557 | ? Column( |
| 558 | crossAxisAlignment: CrossAxisAlignment.start, | 558 | crossAxisAlignment: CrossAxisAlignment.start, |
| 559 | children: _priceWidget(model)) | 559 | children: _priceWidget(model)) |
| @@ -641,7 +641,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | @@ -641,7 +641,7 @@ class _MenuThemeColorSetPageState extends State<MenuThemeColorSetPage> { | ||
| 641 | VEmptyView(20), | 641 | VEmptyView(20), |
| 642 | Padding( | 642 | Padding( |
| 643 | padding: EdgeInsets.symmetric(horizontal: w(10)), | 643 | padding: EdgeInsets.symmetric(horizontal: w(10)), |
| 644 | - child: model.price == null | 644 | + child: model.spec != null |
| 645 | ? Column( | 645 | ? Column( |
| 646 | crossAxisAlignment: CrossAxisAlignment.start, | 646 | crossAxisAlignment: CrossAxisAlignment.start, |
| 647 | children: _priceWidget(model)) | 647 | children: _priceWidget(model)) |
| @@ -35,6 +35,8 @@ import '../models/plan_cook_by_rid_model.dart'; | @@ -35,6 +35,8 @@ import '../models/plan_cook_by_rid_model.dart'; | ||
| 35 | import '../models/plan_cook_list_model.dart'; | 35 | import '../models/plan_cook_list_model.dart'; |
| 36 | import '../models/recharge_list_model.dart'; | 36 | import '../models/recharge_list_model.dart'; |
| 37 | import '../models/set_xuan_tai_model.dart'; | 37 | import '../models/set_xuan_tai_model.dart'; |
| 38 | +import '../models/setmeal_by_id_model.dart'; | ||
| 39 | +import '../models/setmeal_model.dart'; | ||
| 38 | import '../models/wine_manage_model.dart'; | 40 | import '../models/wine_manage_model.dart'; |
| 39 | import '../models/wine_model.dart'; | 41 | import '../models/wine_model.dart'; |
| 40 | 42 | ||
| @@ -1705,9 +1707,11 @@ class NavigatorUtil { | @@ -1705,9 +1707,11 @@ class NavigatorUtil { | ||
| 1705 | ///宴会套餐分享预览 | 1707 | ///宴会套餐分享预览 |
| 1706 | /// | 1708 | /// |
| 1707 | 1709 | ||
| 1708 | - static void goFeastDishSharePage(BuildContext context, String setmealId, | 1710 | + static void goFeastDishSharePage( |
| 1711 | + BuildContext context, SetMealSunModel setmealDetail, | ||
| 1709 | {replace = false}) { | 1712 | {replace = false}) { |
| 1710 | - _navigateTo(context, "${Routes.feast_dish_share_page}?setmealId=$setmealId", | 1713 | + _navigateTo(context, |
| 1714 | + "${Routes.feast_dish_share_page}?detail=${FluroConvertUtils.object2string(setmealDetail.toJson())}", | ||
| 1711 | replace: replace); | 1715 | replace: replace); |
| 1712 | } | 1716 | } |
| 1713 | 1717 |
| @@ -160,6 +160,7 @@ import '../models/plan_cook_by_rid_model.dart'; | @@ -160,6 +160,7 @@ import '../models/plan_cook_by_rid_model.dart'; | ||
| 160 | import '../models/plan_cook_list_model.dart'; | 160 | import '../models/plan_cook_list_model.dart'; |
| 161 | import '../models/set_xuan_tai_model.dart'; | 161 | import '../models/set_xuan_tai_model.dart'; |
| 162 | import '../models/setmeal_by_id_model.dart'; | 162 | import '../models/setmeal_by_id_model.dart'; |
| 163 | +import '../models/setmeal_model.dart'; | ||
| 163 | import '../models/wine_manage_model.dart'; | 164 | import '../models/wine_manage_model.dart'; |
| 164 | import '../pages/coupon/coupon_verification_detail_page.dart'; | 165 | import '../pages/coupon/coupon_verification_detail_page.dart'; |
| 165 | import '../pages/coupon/verification_coupon_page.dart'; | 166 | import '../pages/coupon/verification_coupon_page.dart'; |
| @@ -2772,12 +2773,12 @@ var messageRechargeInfoPageHandle = new Handler( | @@ -2772,12 +2773,12 @@ var messageRechargeInfoPageHandle = new Handler( | ||
| 2772 | 2773 | ||
| 2773 | var feastDishSharePageHandle = new Handler( | 2774 | var feastDishSharePageHandle = new Handler( |
| 2774 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { | 2775 | handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) { |
| 2775 | - String setmealId = params["setmealId"].first; | ||
| 2776 | - // NotebookDetail detailEntity = NotebookDetail.fromJson(json | ||
| 2777 | - // .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); | 2776 | + |
| 2777 | + SetMealSunModel setmealDetail = SetMealSunModel.fromJson(json | ||
| 2778 | + .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first))); | ||
| 2778 | return ChangeNotifierProvider<FeastModel>( | 2779 | return ChangeNotifierProvider<FeastModel>( |
| 2779 | create: (_) => FeastModel(), | 2780 | create: (_) => FeastModel(), |
| 2780 | - child: FeastDishSharePage(setmealId: setmealId)); | 2781 | + child: FeastDishSharePage(setmealDetail: setmealDetail)); |
| 2781 | }); | 2782 | }); |
| 2782 | 2783 | ||
| 2783 | ///优惠券核销详情页 | 2784 | ///优惠券核销详情页 |
| @@ -44,6 +44,8 @@ class FluroConvertUtils { | @@ -44,6 +44,8 @@ class FluroConvertUtils { | ||
| 44 | return fluroCnParamsEncode(jsonEncode(t)); | 44 | return fluroCnParamsEncode(jsonEncode(t)); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | + | ||
| 48 | + | ||
| 47 | /// string json 转为 map | 49 | /// string json 转为 map |
| 48 | static Map<String, dynamic> string2map(String str) { | 50 | static Map<String, dynamic> string2map(String str) { |
| 49 | return json.decode(fluroCnParamsDecode(str)); | 51 | return json.decode(fluroCnParamsDecode(str)); |
| @@ -1218,9 +1218,10 @@ class Utils { | @@ -1218,9 +1218,10 @@ class Utils { | ||
| 1218 | // String _thumbnail = img; | 1218 | // String _thumbnail = img; |
| 1219 | String sellerImage = | 1219 | String sellerImage = |
| 1220 | Provider.of<UserModel>(context, listen: false).user.sellerimage; | 1220 | Provider.of<UserModel>(context, listen: false).user.sellerimage; |
| 1221 | - String _thumbnail = sellerImage == null || sellerImage == '' | ||
| 1222 | - ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png' | ||
| 1223 | - : sellerImage; | 1221 | + // String _thumbnail = sellerImage == null || sellerImage == '' |
| 1222 | + // ? 'http://nosqn.colorcun.com/reserve/images/3x/%E6%9A%82%E6%97%A0.png' | ||
| 1223 | + // : sellerImage; | ||
| 1224 | + String _thumbnail = 'https://nosqn.colorcun.com/share_advanced_order.png'; | ||
| 1224 | String _title = title; | 1225 | String _title = title; |
| 1225 | String _userName = "gh_487873d353b3"; | 1226 | String _userName = "gh_487873d353b3"; |
| 1226 | String _path = "pack-cookbook/pages/index?rid=$rid&identity=2&sid=$sid"; | 1227 | String _path = "pack-cookbook/pages/index?rid=$rid&identity=2&sid=$sid"; |
| @@ -1706,7 +1707,7 @@ class Utils { | @@ -1706,7 +1707,7 @@ class Utils { | ||
| 1706 | String _thumbnail = 'https://nosqn.colorcun.com/share_recharge.png'; | 1707 | String _thumbnail = 'https://nosqn.colorcun.com/share_recharge.png'; |
| 1707 | 1708 | ||
| 1708 | String _title = | 1709 | String _title = |
| 1709 | - "${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加储值优惠活动,点击进入。"; | 1710 | + "${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加“'${rechargeListSunModel.rname}'”,点击进入。"; |
| 1710 | String _userName = "gh_487873d353b3"; | 1711 | String _userName = "gh_487873d353b3"; |
| 1711 | String _path = | 1712 | String _path = |
| 1712 | "pack-activity/pack/vipRecharge?id=$rechargeid&name=${Provider.of<UserModel>(context, listen: false).user.sellername}&sid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&types=3"; | 1713 | "pack-activity/pack/vipRecharge?id=$rechargeid&name=${Provider.of<UserModel>(context, listen: false).user.sellername}&sid=${Provider.of<UserModel>(context, listen: false).user.sellerid}&types=3"; |
| @@ -1715,7 +1716,8 @@ class Utils { | @@ -1715,7 +1716,8 @@ class Utils { | ||
| 1715 | // _path = | 1716 | // _path = |
| 1716 | // "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid"; | 1717 | // "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid"; |
| 1717 | // } | 1718 | // } |
| 1718 | - String _description = "充值优惠购买分享"; | 1719 | + String _description = |
| 1720 | + "${Provider.of<UserModel>(context, listen: false).user.sellername}诚邀您参加“${rechargeListSunModel.rname}”,点击进入。"; | ||
| 1719 | // Uint8List source = await testComporessList(context, _thumbnail); | 1721 | // Uint8List source = await testComporessList(context, _thumbnail); |
| 1720 | 1722 | ||
| 1721 | //跳转小程序 | 1723 | //跳转小程序 |
-
Please register or login to post a comment