Commit 2dac9af2b0b2d768ae5e5fd4419d87c81d68917c

Authored by wdn127929
1 parent 1ee103c3

预订安排---会员优惠---分享

@@ -47,7 +47,7 @@ class RechargeListSunModel { @@ -47,7 +47,7 @@ class RechargeListSunModel {
47 String explain; 47 String explain;
48 String isOpen; 48 String isOpen;
49 String status; 49 String status;
50 - // Null qrcode; 50 + String qrcode;
51 String isExamine; 51 String isExamine;
52 String cdate; 52 String cdate;
53 bool isCheck = false; 53 bool isCheck = false;
@@ -72,7 +72,7 @@ class RechargeListSunModel { @@ -72,7 +72,7 @@ class RechargeListSunModel {
72 this.explain, 72 this.explain,
73 this.isOpen, 73 this.isOpen,
74 this.status, 74 this.status,
75 - // this.qrcode, 75 + this.qrcode,
76 this.isExamine, 76 this.isExamine,
77 this.cdate}); 77 this.cdate});
78 78
@@ -98,7 +98,7 @@ class RechargeListSunModel { @@ -98,7 +98,7 @@ class RechargeListSunModel {
98 explain = json['explain']; 98 explain = json['explain'];
99 isOpen = json['is_open']; 99 isOpen = json['is_open'];
100 status = json['status']; 100 status = json['status'];
101 - // qrcode = json['qrcode']; 101 + qrcode = json['qrcode'];
102 isExamine = json['is_examine']; 102 isExamine = json['is_examine'];
103 cdate = json['cdate']; 103 cdate = json['cdate'];
104 } 104 }
@@ -115,7 +115,7 @@ class RechargeListSunModel { @@ -115,7 +115,7 @@ class RechargeListSunModel {
115 data['explain'] = this.explain; 115 data['explain'] = this.explain;
116 data['is_open'] = this.isOpen; 116 data['is_open'] = this.isOpen;
117 data['status'] = this.status; 117 data['status'] = this.status;
118 - // data['qrcode'] = this.qrcode; 118 + data['qrcode'] = this.qrcode;
119 data['is_examine'] = this.isExamine; 119 data['is_examine'] = this.isExamine;
120 data['cdate'] = this.cdate; 120 data['cdate'] = this.cdate;
121 return data; 121 return data;
@@ -164,10 +164,10 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin { @@ -164,10 +164,10 @@ class _CouponPageState extends State<CouponPage> with TickerProviderStateMixin {
164 164
165 Navigator.of(context).pop(); 165 Navigator.of(context).pop();
166 }, 166 },
167 - // rightImgName: 'scan.png',  
168 - // onTapRight: () {  
169 - // _scan();  
170 - // }, 167 + rightImgName: 'scan.png',
  168 + onTapRight: () {
  169 + _scan();
  170 + },
171 ), 171 ),
172 body: WillPopScope( 172 body: WillPopScope(
173 onWillPop: () { 173 onWillPop: () {
  1 +import 'package:cached_network_image/cached_network_image.dart';
1 import 'package:common_utils/common_utils.dart'; 2 import 'package:common_utils/common_utils.dart';
2 import 'package:flutter/material.dart'; 3 import 'package:flutter/material.dart';
3 import 'package:flutter_screenutil/flutter_screenutil.dart'; 4 import 'package:flutter_screenutil/flutter_screenutil.dart';
@@ -43,10 +44,40 @@ class _RechargeItemState extends State<RechargeItem> { @@ -43,10 +44,40 @@ class _RechargeItemState extends State<RechargeItem> {
43 Widget build(BuildContext context) { 44 Widget build(BuildContext context) {
44 // CouponSunModel sunModel = widget.couponSonModel; 45 // CouponSunModel sunModel = widget.couponSonModel;
45 bool notSelect = true; 46 bool notSelect = true;
  47 + BoxDecoration decoration;
46 if (widget.from == 'history') { 48 if (widget.from == 'history') {
47 notSelect = false; 49 notSelect = false;
48 } else { 50 } else {
49 // notSelect = sunModel.isOpenBool; 51 // notSelect = sunModel.isOpenBool;
  52 +
  53 + }
  54 + if (widget.from == 'menu' || widget.from == 'menu-show') {
  55 + decoration = BoxDecoration(
  56 + borderRadius: BorderRadius.only(
  57 + topLeft: Radius.circular(ScreenUtil().setWidth(16)),
  58 + topRight: Radius.circular(ScreenUtil().setWidth(16))),
  59 + gradient: LinearGradient(stops: [
  60 + -0.5747,
  61 + 0.5572,
  62 + 1.4872
  63 + ], colors: [
  64 + MyColours.color_4C8DAD,
  65 + MyColours.color_0143A3,
  66 + MyColours.color_42A5FF
  67 + ], begin: Alignment.topLeft, end: Alignment.bottomRight),
  68 + );
  69 + } else {
  70 + decoration = BoxDecoration(
  71 + color: widget.from == 'history'
  72 + ? MyColours.color_BFC4D4
  73 + : notSelect
  74 + ? widget.rechargeListSunModel.isOpen == '1'
  75 + ? MyColours.color_438E93
  76 + : MyColours.color_999999
  77 + : MyColours.color_999999,
  78 + borderRadius: BorderRadius.only(
  79 + topLeft: Radius.circular(ScreenUtil().setWidth(16)),
  80 + topRight: Radius.circular(ScreenUtil().setWidth(16))));
50 } 81 }
51 // double explainH = 0.0; 82 // double explainH = 0.0;
52 83
@@ -97,20 +128,7 @@ class _RechargeItemState extends State<RechargeItem> { @@ -97,20 +128,7 @@ class _RechargeItemState extends State<RechargeItem> {
97 height: ScreenUtil().setWidth(60), 128 height: ScreenUtil().setWidth(60),
98 padding: EdgeInsets.symmetric( 129 padding: EdgeInsets.symmetric(
99 horizontal: ScreenUtil().setWidth(40)), 130 horizontal: ScreenUtil().setWidth(40)),
100 - decoration: BoxDecoration(  
101 - color: widget.from == 'history'  
102 - ? MyColours.color_BFC4D4  
103 - : notSelect  
104 - ? widget.rechargeListSunModel.isOpen ==  
105 - '1'  
106 - ? MyColours.color_438E93  
107 - : MyColours.color_999999  
108 - : MyColours.color_999999,  
109 - borderRadius: BorderRadius.only(  
110 - topLeft: Radius.circular(  
111 - ScreenUtil().setWidth(16)),  
112 - topRight: Radius.circular(  
113 - ScreenUtil().setWidth(16)))), 131 + decoration: decoration,
114 child: Row( 132 child: Row(
115 mainAxisAlignment: MainAxisAlignment.spaceBetween, 133 mainAxisAlignment: MainAxisAlignment.spaceBetween,
116 children: [ 134 children: [
@@ -137,58 +155,142 @@ class _RechargeItemState extends State<RechargeItem> { @@ -137,58 +155,142 @@ class _RechargeItemState extends State<RechargeItem> {
137 ScreenUtil().setWidth(26), 155 ScreenUtil().setWidth(26),
138 ScreenUtil().setWidth(40), 156 ScreenUtil().setWidth(40),
139 ScreenUtil().setWidth(26)), 157 ScreenUtil().setWidth(26)),
140 - child: Column(  
141 - crossAxisAlignment: CrossAxisAlignment.start,  
142 - children: [  
143 - if (widget.rechargeListSunModel.rechargeList  
144 - .isPrice ==  
145 - '1')  
146 - Container(  
147 - // height: ScreenUtil().setWidth(14 * 2),  
148 - // width: ScreenUtil().setWidth(232 * 2),  
149 - margin: EdgeInsets.only(bottom: w(5)),  
150 - child: Text(  
151 - '会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠余额${widget.rechargeListSunModel.rechargeList.price}元;',  
152 - maxLines: 1,  
153 - overflow: TextOverflow.ellipsis,  
154 - style: TextStyle(  
155 - color: MyColours.color_999999,  
156 - fontSize: ScreenUtil().setSp(20),  
157 - )), 158 + child: widget.from == 'menu-show'
  159 + ? Row(
  160 + mainAxisAlignment:
  161 + MainAxisAlignment.spaceBetween,
  162 + children: [
  163 + Column(
  164 + crossAxisAlignment:
  165 + CrossAxisAlignment.start,
  166 + children: [
  167 + if (widget.rechargeListSunModel
  168 + .rechargeList.isPrice ==
  169 + '1')
  170 + Container(
  171 + // height: ScreenUtil().setWidth(14 * 2),
  172 + // width: ScreenUtil().setWidth(232 * 2),
  173 + margin:
  174 + EdgeInsets.only(bottom: w(5)),
  175 + child: Text(
  176 + '会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠余额${widget.rechargeListSunModel.rechargeList.price}元;',
  177 + maxLines: 1,
  178 + overflow: TextOverflow.ellipsis,
  179 + style: TextStyle(
  180 + color: MyColours.color_999999,
  181 + fontSize:
  182 + ScreenUtil().setSp(20),
  183 + )),
  184 + ),
  185 + if (widget.rechargeListSunModel
  186 + .rechargeList.isScore ==
  187 + '1')
  188 + Container(
  189 + // height: ScreenUtil().setWidth(14 * 2),
  190 + // width: ScreenUtil().setWidth(232 * 2),
  191 + margin:
  192 + EdgeInsets.only(bottom: w(5)),
  193 + child: Text(
  194 + '会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${widget.rechargeListSunModel.rechargeList.score}积分;',
  195 + maxLines: 1,
  196 + overflow: TextOverflow.ellipsis,
  197 + style: TextStyle(
  198 + color: MyColours.color_999999,
  199 + fontSize:
  200 + ScreenUtil().setSp(20),
  201 + )),
  202 + ),
  203 + if (widget.rechargeListSunModel
  204 + .rechargeList.isCoupons ==
  205 + '1')
  206 + Container(
  207 + // height: ScreenUtil().setWidth(14 * 2),
  208 + // width: ScreenUtil().setWidth(232 * 2),
  209 + child: Text(
  210 + '会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${Utils.listToStringEnglish3(widget.rechargeListSunModel.rechargeList.couponsNames)}。',
  211 + maxLines: 1,
  212 + overflow: TextOverflow.ellipsis,
  213 + style: TextStyle(
  214 + color: MyColours.color_999999,
  215 + fontSize:
  216 + ScreenUtil().setSp(20),
  217 + )),
  218 + ),
  219 + ],
  220 + ),
  221 + if (widget.rechargeListSunModel.qrcode !=
  222 + null)
  223 + Column(
  224 + children: [
  225 + CachedNetworkImage(
  226 + imageUrl: widget
  227 + .rechargeListSunModel.qrcode,
  228 + width: w(60),
  229 + fit: BoxFit.cover,
  230 + ),
  231 + VEmptyView(10),
  232 + Text(
  233 + '长按识别二维码前往充值',
  234 + style: TextStyle(
  235 + fontSize: font(10),
  236 + color: MyColours.color_999999),
  237 + )
  238 + ],
  239 + )
  240 + ],
  241 + )
  242 + : Column(
  243 + crossAxisAlignment: CrossAxisAlignment.start,
  244 + children: [
  245 + if (widget.rechargeListSunModel.rechargeList
  246 + .isPrice ==
  247 + '1')
  248 + Container(
  249 + // height: ScreenUtil().setWidth(14 * 2),
  250 + // width: ScreenUtil().setWidth(232 * 2),
  251 + margin: EdgeInsets.only(bottom: w(5)),
  252 + child: Text(
  253 + '会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠余额${widget.rechargeListSunModel.rechargeList.price}元;',
  254 + maxLines: 1,
  255 + overflow: TextOverflow.ellipsis,
  256 + style: TextStyle(
  257 + color: MyColours.color_999999,
  258 + fontSize: ScreenUtil().setSp(20),
  259 + )),
  260 + ),
  261 + if (widget.rechargeListSunModel.rechargeList
  262 + .isScore ==
  263 + '1')
  264 + Container(
  265 + // height: ScreenUtil().setWidth(14 * 2),
  266 + // width: ScreenUtil().setWidth(232 * 2),
  267 + margin: EdgeInsets.only(bottom: w(5)),
  268 + child: Text(
  269 + '会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${widget.rechargeListSunModel.rechargeList.score}积分;',
  270 + maxLines: 1,
  271 + overflow: TextOverflow.ellipsis,
  272 + style: TextStyle(
  273 + color: MyColours.color_999999,
  274 + fontSize: ScreenUtil().setSp(20),
  275 + )),
  276 + ),
  277 + if (widget.rechargeListSunModel.rechargeList
  278 + .isCoupons ==
  279 + '1')
  280 + Container(
  281 + // height: ScreenUtil().setWidth(14 * 2),
  282 + // width: ScreenUtil().setWidth(232 * 2),
  283 + child: Text(
  284 + '会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${Utils.listToStringEnglish3(widget.rechargeListSunModel.rechargeList.couponsNames)}。',
  285 + maxLines: 1,
  286 + overflow: TextOverflow.ellipsis,
  287 + style: TextStyle(
  288 + color: MyColours.color_999999,
  289 + fontSize: ScreenUtil().setSp(20),
  290 + )),
  291 + ),
  292 + ],
158 ), 293 ),
159 - if (widget.rechargeListSunModel.rechargeList  
160 - .isScore ==  
161 - '1')  
162 - Container(  
163 - // height: ScreenUtil().setWidth(14 * 2),  
164 - // width: ScreenUtil().setWidth(232 * 2),  
165 - margin: EdgeInsets.only(bottom: w(5)),  
166 - child: Text(  
167 - '会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${widget.rechargeListSunModel.rechargeList.score}积分;',  
168 - maxLines: 1,  
169 - overflow: TextOverflow.ellipsis,  
170 - style: TextStyle(  
171 - color: MyColours.color_999999,  
172 - fontSize: ScreenUtil().setSp(20),  
173 - )),  
174 - ),  
175 - if (widget.rechargeListSunModel.rechargeList  
176 - .isCoupons ==  
177 - '1')  
178 - Container(  
179 - // height: ScreenUtil().setWidth(14 * 2),  
180 - // width: ScreenUtil().setWidth(232 * 2),  
181 - child: Text(  
182 - '会员充值满${widget.rechargeListSunModel.rechargeMoney}元赠送${Utils.listToStringEnglish3(widget.rechargeListSunModel.rechargeList.couponsNames)}。',  
183 - maxLines: 1,  
184 - overflow: TextOverflow.ellipsis,  
185 - style: TextStyle(  
186 - color: MyColours.color_999999,  
187 - fontSize: ScreenUtil().setSp(20),  
188 - )),  
189 - ),  
190 - ],  
191 - ),  
192 294
193 // widget.from == 'select' 295 // widget.from == 'select'
194 // ? widget.showCheck 296 // ? widget.showCheck
1 import 'package:flutter/material.dart'; 1 import 'package:flutter/material.dart';
  2 +import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
2 import 'package:one_key/utils/repaint_boundary_utils.dart'; 3 import 'package:one_key/utils/repaint_boundary_utils.dart';
3 import 'package:one_key/widgets/system_app_bar.dart'; 4 import 'package:one_key/widgets/system_app_bar.dart';
4 import 'package:provider/provider.dart'; 5 import 'package:provider/provider.dart';
@@ -12,8 +13,12 @@ import '../../../widgets/round_button.dart'; @@ -12,8 +13,12 @@ import '../../../widgets/round_button.dart';
12 import '../../../widgets/v_empty_view.dart'; 13 import '../../../widgets/v_empty_view.dart';
13 import '../../models/cookbook_model.dart'; 14 import '../../models/cookbook_model.dart';
14 import '../../models/notebook_detail.dart'; 15 import '../../models/notebook_detail.dart';
  16 +import '../../models/recharge_list_model.dart';
  17 +import '../../provider/marketing_center_provider.dart';
15 import '../../provider/user_model.dart'; 18 import '../../provider/user_model.dart';
  19 +import '../../route/navigator_util.dart';
16 import '../../utils/share_helper.dart'; 20 import '../../utils/share_helper.dart';
  21 +import '../my/marketing_center/recharge/recharge_item.dart';
17 22
18 /** 23 /**
19 * 生成的预览页 24 * 生成的预览页
@@ -46,10 +51,45 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> { @@ -46,10 +51,45 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
46 //全局key-截图key 51 //全局key-截图key
47 final GlobalKey boundaryKey = GlobalKey(); 52 final GlobalKey boundaryKey = GlobalKey();
48 53
  54 + MarketingCenterProvider marketingCenterProvider;
  55 + int index;
  56 + TextEditingController recommendC = TextEditingController();
  57 + bool isRecharge = true;
  58 + bool isRecommend = true;
  59 +
49 @override 60 @override
50 void initState() { 61 void initState() {
51 super.initState(); 62 super.initState();
52 Utils.changeStatusColor(color: Colors.transparent); 63 Utils.changeStatusColor(color: Colors.transparent);
  64 + recommendC.text =
  65 + '${widget.detailEntity.rnameStr ?? ''}:\n 根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,预计可以享受大量优惠!';
  66 + WidgetsBinding.instance.addPostFrameCallback((_) {
  67 + _getNewRechargeList();
  68 + });
  69 + }
  70 +
  71 + _getNewRechargeList() async {
  72 + await marketingCenterProvider.getNewRechargeList(context);
  73 + if (marketingCenterProvider.rechargeList != null &&
  74 + marketingCenterProvider.rechargeList.length > 0) {
  75 + index = 0; //默认展示第一个
  76 + _getRecommendC();
  77 + }
  78 + }
  79 +
  80 + _getRecommendC() {
  81 + String show = marketingCenterProvider
  82 + .rechargeList[index].rechargeList.isPrice ==
  83 + '1'
  84 + ? '预计可以节约${marketingCenterProvider.rechargeList[index].rechargeList.price}元!'
  85 + : '预计可以享受大量优惠!';
  86 +
  87 + String name = widget.detailEntity.rnameStr == null
  88 + ? '${widget.detailEntity.rnameStr}:\n'
  89 + : '';
  90 +
  91 + recommendC.text = '${name} 根据您选择的菜品,我们推荐您参加以下活动,本次消费可用,${show}';
  92 + setState(() {});
53 } 93 }
54 94
55 Widget _laduWidget() { 95 Widget _laduWidget() {
@@ -76,6 +116,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> { @@ -76,6 +116,8 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
76 116
77 @override 117 @override
78 Widget build(BuildContext context) { 118 Widget build(BuildContext context) {
  119 + marketingCenterProvider =
  120 + Provider.of<MarketingCenterProvider>(context, listen: true);
79 String sellername = 121 String sellername =
80 Provider.of<UserModel>(context, listen: false).user.sellername; 122 Provider.of<UserModel>(context, listen: false).user.sellername;
81 String sellerAdr = 123 String sellerAdr =
@@ -90,404 +132,633 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> { @@ -90,404 +132,633 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
90 String servicePerson = '${widget.detailEntity.nick_name ?? ''}' + 132 String servicePerson = '${widget.detailEntity.nick_name ?? ''}' +
91 ' ' + 133 ' ' +
92 '${widget.detailEntity.seller_user_phone ?? ''}'; 134 '${widget.detailEntity.seller_user_phone ?? ''}';
93 - return Scaffold( 135 + return KeyboardDismissOnTap(
  136 + child: Scaffold(
94 backgroundColor: MyColours.color_ffffff, 137 backgroundColor: MyColours.color_ffffff,
  138 + appBar: SystemAppBar('排菜单'),
95 body: Column( 139 body: Column(
96 children: [ 140 children: [
97 Expanded( 141 Expanded(
98 child: SingleChildScrollView( 142 child: SingleChildScrollView(
99 controller: controller, 143 controller: controller,
100 - child: RepaintBoundary(  
101 - key: boundaryKey,  
102 - child: Container(  
103 - color: Colors.white,  
104 - child: Column(children: [  
105 - Container(  
106 - width: double.infinity,  
107 - margin: EdgeInsets.zero,  
108 - padding: EdgeInsets.only(  
109 - left: w(20),  
110 - right: w(20),  
111 - top: w(30),  
112 - bottom: w(15)),  
113 - // height: w(200),  
114 - // constraints: new BoxConstraints.expand(  
115 - // height: w(200),  
116 - // ),  
117 - decoration: BoxDecoration(  
118 - image: DecorationImage(  
119 - image: AssetImage(  
120 - Utils.getImgPath('preview_bg')),  
121 - fit: BoxFit.cover  
122 -  
123 - // centerSlice: new Rect.fromLTRB(270.0, 180.0, 1360.0, 730.0),  
124 - )),  
125 -  
126 - child: Column(  
127 - crossAxisAlignment: CrossAxisAlignment.start,  
128 - children: [  
129 - Text(  
130 - '${sellername} 贵宾排菜菜单',  
131 - style: TextStyle(  
132 - fontSize: font(20),  
133 - fontWeight: FontWeight.bold,  
134 - color: MyColours.color_CFB53B),  
135 - ),  
136 - VEmptyView(26),  
137 - Text(  
138 - '预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',  
139 - style: TextStyle(  
140 - fontSize: font(14),  
141 - color: MyColours.color_303030),  
142 - ),  
143 - VEmptyView(10),  
144 - Text(  
145 - '预订时间 | ${widget.detailEntity.ddateymd}',  
146 - style: TextStyle(  
147 - fontSize: font(14),  
148 - color: MyColours.color_303030),  
149 - ),  
150 - VEmptyView(10),  
151 - Text(  
152 - '区域桌台 | ${tables}',  
153 - style: TextStyle(  
154 - fontSize: font(14),  
155 - color: MyColours.color_303030),  
156 - ),  
157 - VEmptyView(10),  
158 - Text(  
159 - '餐厅地址 | ${sellerAdr}',  
160 - style: TextStyle(  
161 - fontSize: font(14),  
162 - color: MyColours.color_303030),  
163 - ),  
164 - VEmptyView(10),  
165 - Text(  
166 - '专属服务 | ${servicePerson}',  
167 - style: TextStyle(  
168 - fontSize: font(14),  
169 - color: MyColours.color_303030),  
170 - ),  
171 - ],  
172 - ),  
173 - ),  
174 - widget.name != null && widget.name != ''  
175 - ? Container(  
176 - width: double.infinity,  
177 - // width: w(32),  
178 - // constraints: BoxConstraints(  
179 - // minHeight: w(48),  
180 - // ),  
181 - // height: w(48),  
182 - padding: EdgeInsets.only(  
183 - left: w(10),  
184 - right: w(20),  
185 - top: w(10),  
186 - bottom: w(10)),  
187 - decoration: BoxDecoration(  
188 - border: Border(  
189 - // top: BorderSide(  
190 - // width: w(1), color: MyColours.color_DBDBDB),  
191 - bottom: BorderSide(  
192 - width: w(1),  
193 - color:  
194 - MyColours.color_DBDBDB))),  
195 - // constraints: BoxConstraints(minWidth: w(20)),  
196 - child: Row(  
197 - children: [  
198 - Expanded(  
199 - child: Text(  
200 - widget.name,  
201 - style: TextStyle(  
202 - color: MyColours.color_515151,  
203 - fontSize: font(16),  
204 - fontWeight: FontWeight.bold),  
205 - )  
206 - // TextField(  
207 - // maxLines: 1,  
208 - // // controller:  
209 - // // focusNode: _focusNode,  
210 - // // autofocus: true,  
211 -  
212 - // style: TextStyle(  
213 - // color: MyColours.color_515151,  
214 - // fontSize: font(16),  
215 - // fontWeight: FontWeight.bold),  
216 - // textAlign: TextAlign.left,  
217 - // // textAlignVertical: TextAlignVertical.center,  
218 - // decoration: InputDecoration(  
219 - // // hintText: "请输入排菜名称",  
220 - // hintText: '朋友小聚888套餐(若无名称不展示本行)',  
221 - // hintStyle: TextStyle(  
222 - // color: MyColours.color_999999,  
223 - // fontSize: font(16),  
224 - // fontWeight: FontWeight.bold),  
225 - // // isCollapsed:  
226 - // // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度  
227 - // border: OutlineInputBorder(  
228 - // borderSide: BorderSide.none),  
229 - // contentPadding: EdgeInsets.zero,  
230 - // ),  
231 - // keyboardType: TextInputType.text,  
232 - // textInputAction: TextInputAction.done, 144 + child: Column(
  145 + children: [
  146 + RepaintBoundary(
  147 + key: boundaryKey,
  148 + child: Container(
  149 + color: Colors.white,
  150 + child: Column(children: [
  151 + Stack(children: [
  152 + Stack(
  153 + // alignment: AlignmentDirectional.bottomCenter, // alignment:子组件对齐方式 系统默认
  154 + // alignment: const FractionalOffset(0.5, 0.9), //自己指定Stack子组件对齐 ,只对Stack中有两个子View生效。0.5表示x轴,0.9表示y轴(FractionalOffset 0.5,0.5表示中心)
  155 + //AlignmentDirectional x、y 偏移量取值范围为 [-1,1],如果 x 的偏移量大于 0,则表示向右偏移,小于 0 则向左偏移;如果 y 轴的偏移量大于 0 则向下偏移,小于 0 则向上偏移。
  156 + alignment: AlignmentDirectional(
  157 + 0, 0), //AlignmentDirectional 0,0表示在正中心。
  158 + fit: StackFit.loose,
233 159
234 - // onChanged: (value) {  
235 - // // setState(() {});  
236 - // // _searchSellerLocation();  
237 - // // customerProvider.searchData(value);  
238 - // },  
239 - // onEditingComplete: () {  
240 - // FocusScope.of(context)  
241 - // .requestFocus(FocusNode()); //点击空白处隐藏键盘  
242 - // // contantShowModel.searchData(  
243 - // // contantShowModel.controller.text);  
244 - // // _searchSellerLocation();  
245 - // // _focusNode.unfocus();  
246 - // },  
247 - // )  
248 - ),  
249 - HEmptyView(20),  
250 - Text(  
251 - '1份',  
252 - style: TextStyle(  
253 - fontSize: font(14),  
254 - color: MyColours.color_515151), 160 + children: [
  161 + Container(
  162 + width: double.infinity,
  163 + margin: EdgeInsets.zero,
  164 + padding: EdgeInsets.only(
  165 + left: w(20),
  166 + right: w(20),
  167 + top: w(30),
  168 + bottom: w(15)),
  169 + // height: w(200),
  170 + // constraints: new BoxConstraints.expand(
  171 + // height: w(200),
  172 + // ),
  173 + decoration: BoxDecoration(
  174 + gradient: LinearGradient(
  175 + stops: [
  176 + -0.5747,
  177 + 0.5572,
  178 + 1.4872
  179 + ],
  180 + colors: [
  181 + MyColours.color_4C8DAD,
  182 + MyColours.color_0143A3,
  183 + MyColours.color_42A5FF
  184 + ],
  185 + begin: Alignment.topLeft,
  186 + end: Alignment.bottomRight),
255 ), 187 ),
256 - ],  
257 - ))  
258 - : SizedBox(),  
259 - ListView.builder(  
260 - itemCount: widget.showList.length,  
261 - shrinkWrap: true,  
262 - controller: controller,  
263 - padding: EdgeInsets.zero,  
264 - itemBuilder: (context, index) {  
265 - MenuModel menuModel = widget.showList[index];  
266 - return ListView.builder(  
267 - itemCount:  
268 - menuModel.cookbooklist.length + 1,  
269 - shrinkWrap: true,  
270 - controller: controller,  
271 - padding: EdgeInsets.zero,  
272 - itemBuilder: (context, index) {  
273 - if (index == 0) {  
274 - return Column(  
275 - children: [  
276 - //头  
277 - Container(  
278 - width: double.infinity,  
279 - // width: w(32),  
280 - height: w(48),  
281 - padding: EdgeInsets.only(  
282 - left: w(10),  
283 - right: w(20)),  
284 - decoration: BoxDecoration(  
285 - border: Border(  
286 - bottom: BorderSide(  
287 - width: w(1),  
288 - color: MyColours  
289 - .color_DBDBDB))),  
290 - // constraints: BoxConstraints(minWidth: w(20)),  
291 - child: Row(  
292 - mainAxisAlignment:  
293 - MainAxisAlignment  
294 - .spaceBetween,  
295 - children: [  
296 - Text(  
297 - menuModel.className,  
298 - style: TextStyle(  
299 - fontSize: font(16),  
300 - color: MyColours  
301 - .color_515151,  
302 - fontWeight:  
303 - FontWeight  
304 - .bold),  
305 - ),  
306 - Text(  
307 - '${menuModel.allSum}道',  
308 - style: TextStyle(  
309 - fontSize: font(14),  
310 - color: MyColours  
311 - .color_515151,  
312 - ),  
313 - ),  
314 - ],  
315 - ))  
316 - ],  
317 - );  
318 - }  
319 - int indexReal = index - 1;  
320 - MenuSunModel menuSunModel =  
321 - menuModel.cookbooklist[indexReal];  
322 - return Container(  
323 - padding: EdgeInsets.symmetric(  
324 - horizontal: w(20),  
325 - vertical: w(13)),  
326 - decoration: BoxDecoration(  
327 - border: Border(  
328 - bottom: BorderSide(  
329 - width: w(1),  
330 - color: MyColours  
331 - .color_DBDBDB))),  
332 - child: Row( 188 + child: Container(
  189 + color: Colors.transparent,
  190 + child: Column(
  191 + crossAxisAlignment:
  192 + CrossAxisAlignment.start,
  193 + children: [
  194 + Text(
  195 + '${sellername} 贵宾排菜菜单',
  196 + style: TextStyle(
  197 + fontSize: font(20),
  198 + fontWeight:
  199 + FontWeight.bold,
  200 + color:
  201 + Colors.transparent),
  202 + ),
  203 + VEmptyView(26),
  204 + Text(
  205 + '预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',
  206 + style: TextStyle(
  207 + fontSize: font(14),
  208 + color:
  209 + Colors.transparent),
  210 + ),
  211 + VEmptyView(10),
  212 + Text(
  213 + '预订时间 | ${widget.detailEntity.ddateymd}',
  214 + style: TextStyle(
  215 + fontSize: font(14),
  216 + color:
  217 + Colors.transparent),
  218 + ),
  219 + VEmptyView(10),
  220 + Text(
  221 + '区域桌台 | ${tables}',
  222 + style: TextStyle(
  223 + fontSize: font(14),
  224 + color:
  225 + Colors.transparent),
  226 + ),
  227 + VEmptyView(10),
  228 + Text(
  229 + '餐厅地址 | ${sellerAdr}',
  230 + style: TextStyle(
  231 + fontSize: font(14),
  232 + color:
  233 + Colors.transparent),
  234 + ),
  235 + VEmptyView(10),
  236 + Text(
  237 + '专属服务 | ${servicePerson}',
  238 + style: TextStyle(
  239 + fontSize: font(14),
  240 + color:
  241 + Colors.transparent),
  242 + ),
  243 + ],
  244 + )),
  245 + ),
  246 + Positioned(
  247 + right: w(22),
  248 + bottom: w(30),
  249 + child: Image.asset(
  250 + Utils.getImgPath('menu_bg')),
  251 + width: w(170),
  252 + )
  253 + ],
  254 + ),
  255 + Positioned(
  256 + top: w(30),
  257 + left: w(20),
  258 + child: Container(
  259 + color: Colors.transparent,
  260 + child: Column(
  261 + crossAxisAlignment:
  262 + CrossAxisAlignment.start,
333 children: [ 263 children: [
334 - // Container(  
335 - // constraints: BoxConstraints(  
336 - // maxWidth: w(80)),  
337 - Expanded(  
338 - child: Text(  
339 - menuSunModel.name,  
340 - maxLines: 10,  
341 - overflow: TextOverflow.ellipsis, 264 + Text(
  265 + '${sellername} 贵宾排菜菜单',
  266 + style: TextStyle(
  267 + fontSize: font(20),
  268 + fontWeight: FontWeight.bold,
  269 + color:
  270 + MyColours.color_CFB53B),
  271 + ),
  272 + VEmptyView(26),
  273 + Text(
  274 + '预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',
  275 + style: TextStyle(
  276 + fontSize: font(14),
  277 + color:
  278 + MyColours.color_CFB53B),
  279 + ),
  280 + VEmptyView(10),
  281 + Text(
  282 + '预订时间 | ${widget.detailEntity.ddateymd}',
  283 + style: TextStyle(
  284 + fontSize: font(14),
  285 + color:
  286 + MyColours.color_CFB53B),
  287 + ),
  288 + VEmptyView(10),
  289 + Text(
  290 + '区域桌台 | ${tables}',
342 style: TextStyle( 291 style: TextStyle(
343 fontSize: font(14), 292 fontSize: font(14),
344 color: 293 color:
345 - MyColours.color_515151),  
346 - )),  
347 - // HEmptyView(8),  
348 - // _laduWidget(),  
349 - Spacer(), 294 + MyColours.color_CFB53B),
  295 + ),
  296 + VEmptyView(10),
350 Text( 297 Text(
351 - '${menuSunModel.price}元/${menuSunModel.unit}',  
352 - maxLines: 2,  
353 - overflow: TextOverflow.ellipsis, 298 + '餐厅地址 | ${sellerAdr}',
354 style: TextStyle( 299 style: TextStyle(
355 - fontSize: font(12), 300 + fontSize: font(14),
356 color: 301 color:
357 - MyColours.color_515151), 302 + MyColours.color_CFB53B),
358 ), 303 ),
359 - // HEmptyView(108),  
360 - // Text(  
361 - // '38元/份',  
362 - // maxLines: 2,  
363 - // overflow: TextOverflow.ellipsis,  
364 - // style: TextStyle(  
365 - // fontSize: font(10),  
366 - // color: MyColours.color_8EBBBE),  
367 - // ),  
368 - Container(  
369 - width: w(79),  
370 - alignment:  
371 - Alignment.centerRight,  
372 - child: Text(  
373 - '${menuSunModel.amount}份', 304 + VEmptyView(10),
  305 + Text(
  306 + '专属服务 | ${servicePerson}',
  307 + style: TextStyle(
  308 + fontSize: font(14),
  309 + color:
  310 + MyColours.color_CFB53B),
  311 + ),
  312 + ],
  313 + ))),
  314 + ]),
  315 + widget.name != null && widget.name != ''
  316 + ? Container(
  317 + width: double.infinity,
  318 + // width: w(32),
  319 + // constraints: BoxConstraints(
  320 + // minHeight: w(48),
  321 + // ),
  322 + // height: w(48),
  323 + padding: EdgeInsets.only(
  324 + left: w(10),
  325 + right: w(20),
  326 + top: w(10),
  327 + bottom: w(10)),
  328 + decoration: BoxDecoration(
  329 + border: Border(
  330 + // top: BorderSide(
  331 + // width: w(1), color: MyColours.color_DBDBDB),
  332 + bottom: BorderSide(
  333 + width: w(1),
  334 + color: MyColours
  335 + .color_DBDBDB))),
  336 + // constraints: BoxConstraints(minWidth: w(20)),
  337 + child: Row(
  338 + children: [
  339 + Expanded(
  340 + child: Text(
  341 + widget.name,
  342 + style: TextStyle(
  343 + color: MyColours.color_515151,
  344 + fontSize: font(16),
  345 + fontWeight: FontWeight.bold),
  346 + )
  347 + // TextField(
  348 + // maxLines: 1,
  349 + // // controller:
  350 + // // focusNode: _focusNode,
  351 + // // autofocus: true,
  352 +
  353 + // style: TextStyle(
  354 + // color: MyColours.color_515151,
  355 + // fontSize: font(16),
  356 + // fontWeight: FontWeight.bold),
  357 + // textAlign: TextAlign.left,
  358 + // // textAlignVertical: TextAlignVertical.center,
  359 + // decoration: InputDecoration(
  360 + // // hintText: "请输入排菜名称",
  361 + // hintText: '朋友小聚888套餐(若无名称不展示本行)',
  362 + // hintStyle: TextStyle(
  363 + // color: MyColours.color_999999,
  364 + // fontSize: font(16),
  365 + // fontWeight: FontWeight.bold),
  366 + // // isCollapsed:
  367 + // // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  368 + // border: OutlineInputBorder(
  369 + // borderSide: BorderSide.none),
  370 + // contentPadding: EdgeInsets.zero,
  371 + // ),
  372 + // keyboardType: TextInputType.text,
  373 + // textInputAction: TextInputAction.done,
  374 +
  375 + // onChanged: (value) {
  376 + // // setState(() {});
  377 + // // _searchSellerLocation();
  378 + // // customerProvider.searchData(value);
  379 + // },
  380 + // onEditingComplete: () {
  381 + // FocusScope.of(context)
  382 + // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  383 + // // contantShowModel.searchData(
  384 + // // contantShowModel.controller.text);
  385 + // // _searchSellerLocation();
  386 + // // _focusNode.unfocus();
  387 + // },
  388 + // )
  389 + ),
  390 + HEmptyView(20),
  391 + Text(
  392 + '1份',
  393 + style: TextStyle(
  394 + fontSize: font(14),
  395 + color:
  396 + MyColours.color_515151),
  397 + ),
  398 + ],
  399 + ))
  400 + : SizedBox(),
  401 + ListView.builder(
  402 + itemCount: widget.showList.length,
  403 + shrinkWrap: true,
  404 + controller: controller,
  405 + padding: EdgeInsets.zero,
  406 + itemBuilder: (context, index) {
  407 + MenuModel menuModel =
  408 + widget.showList[index];
  409 + return ListView.builder(
  410 + itemCount:
  411 + menuModel.cookbooklist.length + 1,
  412 + shrinkWrap: true,
  413 + controller: controller,
  414 + padding: EdgeInsets.zero,
  415 + itemBuilder: (context, index) {
  416 + if (index == 0) {
  417 + return Column(
  418 + children: [
  419 + //头
  420 + Container(
  421 + width: double.infinity,
  422 + // width: w(32),
  423 + height: w(48),
  424 + padding: EdgeInsets.only(
  425 + left: w(10),
  426 + right: w(20)),
  427 + decoration: BoxDecoration(
  428 + border: Border(
  429 + bottom: BorderSide(
  430 + width: w(1),
  431 + color: MyColours
  432 + .color_DBDBDB))),
  433 + // constraints: BoxConstraints(minWidth: w(20)),
  434 + child: Row(
  435 + mainAxisAlignment:
  436 + MainAxisAlignment
  437 + .spaceBetween,
  438 + children: [
  439 + Text(
  440 + menuModel.className,
  441 + style: TextStyle(
  442 + fontSize:
  443 + font(16),
  444 + color: MyColours
  445 + .color_515151,
  446 + fontWeight:
  447 + FontWeight
  448 + .bold),
  449 + ),
  450 + Text(
  451 + '${menuModel.allSum}道',
  452 + style: TextStyle(
  453 + fontSize:
  454 + font(14),
  455 + color: MyColours
  456 + .color_515151,
  457 + ),
  458 + ),
  459 + ],
  460 + ))
  461 + ],
  462 + );
  463 + }
  464 + int indexReal = index - 1;
  465 + MenuSunModel menuSunModel =
  466 + menuModel
  467 + .cookbooklist[indexReal];
  468 + return Container(
  469 + padding: EdgeInsets.symmetric(
  470 + horizontal: w(20),
  471 + vertical: w(13)),
  472 + decoration: BoxDecoration(
  473 + border: Border(
  474 + bottom: BorderSide(
  475 + width: w(1),
  476 + color: MyColours
  477 + .color_DBDBDB))),
  478 + child: Row(
  479 + children: [
  480 + // Container(
  481 + // constraints: BoxConstraints(
  482 + // maxWidth: w(80)),
  483 + Expanded(
  484 + child: Text(
  485 + menuSunModel.name,
  486 + maxLines: 10,
  487 + overflow:
  488 + TextOverflow.ellipsis,
374 style: TextStyle( 489 style: TextStyle(
375 - fontSize: font(12), 490 + fontSize: font(14),
376 color: MyColours 491 color: MyColours
377 .color_515151), 492 .color_515151),
378 )), 493 )),
379 - ],  
380 - ),  
381 - );  
382 - });  
383 - }),  
384 - widget.remark != null && widget.remark != ''  
385 - ? Container(  
386 - width: double.infinity,  
387 - padding: EdgeInsets.symmetric(  
388 - horizontal: w(15), vertical: w(7)),  
389 - margin: EdgeInsets.only(  
390 - top: w(7),  
391 - bottom: w(13),  
392 - left: w(20),  
393 - right: w(20)), 494 + // HEmptyView(8),
  495 + // _laduWidget(),
  496 + Spacer(),
  497 + Text(
  498 + '${menuSunModel.price}元/${menuSunModel.unit}',
  499 + maxLines: 2,
  500 + overflow:
  501 + TextOverflow.ellipsis,
  502 + style: TextStyle(
  503 + fontSize: font(12),
  504 + color: MyColours
  505 + .color_515151),
  506 + ),
  507 + // HEmptyView(108),
  508 + // Text(
  509 + // '38元/份',
  510 + // maxLines: 2,
  511 + // overflow: TextOverflow.ellipsis,
  512 + // style: TextStyle(
  513 + // fontSize: font(10),
  514 + // color: MyColours.color_8EBBBE),
  515 + // ),
  516 + Container(
  517 + width: w(79),
  518 + alignment:
  519 + Alignment.centerRight,
  520 + child: Text(
  521 + '${menuSunModel.amount}份',
  522 + style: TextStyle(
  523 + fontSize: font(12),
  524 + color: MyColours
  525 + .color_515151),
  526 + )),
  527 + ],
  528 + ),
  529 + );
  530 + });
  531 + }),
  532 + widget.remark != null && widget.remark != ''
  533 + ? Container(
  534 + width: double.infinity,
  535 + padding: EdgeInsets.symmetric(
  536 + horizontal: w(15), vertical: w(7)),
  537 + margin: EdgeInsets.only(
  538 + top: w(7),
  539 + bottom: w(13),
  540 + left: w(20),
  541 + right: w(20)),
  542 + decoration: BoxDecoration(
  543 + borderRadius:
  544 + BorderRadius.circular(r(5)),
  545 + border: Border.all(
  546 + width: w(1),
  547 + color: MyColours.color_DBDBDB)),
  548 + child: Text(
  549 + "${widget.remark}",
  550 + style: TextStyle(
  551 + color: MyColours.color_515151,
  552 + fontSize: font(12)),
  553 + )
  554 + // child: TextField(
  555 + // maxLines: 4,
  556 + // // controller:
  557 + // // focusNode: _focusNode,
  558 + // // autofocus: true,
  559 +
  560 + // style: TextStyle(
  561 + // color: MyColours.color_515151, fontSize: font(12)),
  562 + // textAlign: TextAlign.left,
  563 + // // textAlignVertical: TextAlignVertical.center,
  564 + // decoration: InputDecoration(
  565 + // hintText: "请输入整单备注",
  566 + // hintStyle: TextStyle(
  567 + // color: MyColours.color_999999,
  568 + // fontSize: font(12),
  569 + // ),
  570 + // // isCollapsed:
  571 + // // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  572 + // border:
  573 + // OutlineInputBorder(borderSide: BorderSide.none),
  574 + // contentPadding: EdgeInsets.zero,
  575 + // ),
  576 + // keyboardType: TextInputType.number,
  577 + // textInputAction: TextInputAction.done,
  578 +
  579 + // onChanged: (value) {
  580 + // // setState(() {});
  581 + // // _searchSellerLocation();
  582 + // // customerProvider.searchData(value);
  583 + // },
  584 + // onEditingComplete: () {
  585 + // FocusScope.of(context)
  586 + // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  587 + // // contantShowModel.searchData(
  588 + // // contantShowModel.controller.text);
  589 + // // _searchSellerLocation();
  590 + // // _focusNode.unfocus();
  591 + // },
  592 + // ),
  593 + )
  594 + : SizedBox(),
  595 + Container(
394 decoration: BoxDecoration( 596 decoration: BoxDecoration(
395 - borderRadius:  
396 - BorderRadius.circular(r(5)),  
397 - border: Border.all(  
398 - width: w(1),  
399 - color: MyColours.color_DBDBDB)),  
400 - child: Text(  
401 - "${widget.remark}", 597 + border: Border(
  598 + top: BorderSide(
  599 + width: w(1),
  600 + color: widget.remark != null &&
  601 + widget.remark != ''
  602 + ? MyColours.color_DBDBDB
  603 + : Colors.transparent))),
  604 + padding: EdgeInsets.symmetric(
  605 + horizontal: w(10), vertical: w(15)),
  606 + child: Row(
  607 + mainAxisAlignment:
  608 + MainAxisAlignment.spaceAround,
  609 + children: [
  610 + Text(
  611 + '总计',
  612 + style: TextStyle(
  613 + fontSize: font(12),
  614 + color: MyColours.color_515151),
  615 + ),
  616 + Text(
  617 + '菜单价:${widget.priceSum}元',
  618 + style: TextStyle(
  619 + fontSize: font(12),
  620 + color: MyColours.color_515151),
  621 + ),
  622 + Text(
  623 + '会员价:${widget.memberPriceSum}元',
  624 + style: TextStyle(
  625 + fontSize: font(12),
  626 + color: MyColours.color_515151),
  627 + ),
  628 + Text(
  629 + '排菜价:${widget.planDishText}元',
  630 + style: TextStyle(
  631 + fontSize: font(12),
  632 + color: MyColours.color_515151),
  633 + )
  634 + ])),
  635 + VEmptyView(10),
  636 + ]))),
  637 + VEmptyView(10),
  638 + if (index != null)
  639 + InkWell(
  640 + onTap: () {
  641 + setState(() {
  642 + isRecharge = !isRecharge;
  643 + });
  644 + },
  645 + child: Padding(
  646 + padding:
  647 + EdgeInsets.symmetric(horizontal: w(20)),
  648 + child: Row(
  649 + children: [
  650 + Image.asset(
  651 + Utils.getImgPath(isRecharge
  652 + ? 'f_select'
  653 + : 'f_select_not'),
  654 + width: w(20),
  655 + ),
  656 + HEmptyView(20),
  657 + Text(
  658 + '推荐优惠活动(点击优惠活动可以切换其他优惠)',
402 style: TextStyle( 659 style: TextStyle(
403 - color: MyColours.color_515151,  
404 - fontSize: font(12)), 660 + fontSize: font(12),
  661 + color: MyColours.color_515151),
405 ) 662 )
406 - // child: TextField(  
407 - // maxLines: 4,  
408 - // // controller:  
409 - // // focusNode: _focusNode,  
410 - // // autofocus: true, 663 + ],
  664 + ))),
  665 + if (index != null) VEmptyView(15),
  666 + if (index != null)
  667 + RechargeItem(
  668 + from: 'menu',
  669 + rechargeListSunModel:
  670 + marketingCenterProvider.rechargeList[index],
  671 + onPressed: () {
  672 + //切换活动
411 673
412 - // style: TextStyle(  
413 - // color: MyColours.color_515151, fontSize: font(12)),  
414 - // textAlign: TextAlign.left,  
415 - // // textAlignVertical: TextAlignVertical.center,  
416 - // decoration: InputDecoration(  
417 - // hintText: "请输入整单备注",  
418 - // hintStyle: TextStyle(  
419 - // color: MyColours.color_999999,  
420 - // fontSize: font(12),  
421 - // ),  
422 - // // isCollapsed:  
423 - // // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度  
424 - // border:  
425 - // OutlineInputBorder(borderSide: BorderSide.none),  
426 - // contentPadding: EdgeInsets.zero,  
427 - // ),  
428 - // keyboardType: TextInputType.number,  
429 - // textInputAction: TextInputAction.done, 674 + if (index ==
  675 + marketingCenterProvider.rechargeList.length -
  676 + 1) {
  677 + index = 0;
  678 + } else {
  679 + index++;
  680 + }
430 681
431 - // onChanged: (value) {  
432 - // // setState(() {});  
433 - // // _searchSellerLocation();  
434 - // // customerProvider.searchData(value);  
435 - // },  
436 - // onEditingComplete: () {  
437 - // FocusScope.of(context)  
438 - // .requestFocus(FocusNode()); //点击空白处隐藏键盘  
439 - // // contantShowModel.searchData(  
440 - // // contantShowModel.controller.text);  
441 - // // _searchSellerLocation();  
442 - // // _focusNode.unfocus();  
443 - // },  
444 - // ),  
445 - )  
446 - : SizedBox(),  
447 - Container(  
448 - decoration: BoxDecoration(  
449 - border: Border(  
450 - top: BorderSide(  
451 - width: w(1),  
452 - color: MyColours.color_DBDBDB))),  
453 - padding: EdgeInsets.symmetric(  
454 - horizontal: w(10), vertical: w(15)), 682 + _getRecommendC();
  683 + },
  684 + ),
  685 + VEmptyView(40),
  686 + if (index != null)
  687 + InkWell(
  688 + onTap: () {
  689 + setState(() {
  690 + isRecommend = !isRecommend;
  691 + });
  692 + },
  693 + child: Padding(
  694 + padding:
  695 + EdgeInsets.symmetric(horizontal: w(20)),
455 child: Row( 696 child: Row(
456 - mainAxisAlignment:  
457 - MainAxisAlignment.spaceAround,  
458 - children: [  
459 - Text(  
460 - '总计',  
461 - style: TextStyle(  
462 - fontSize: font(12),  
463 - color: MyColours.color_515151),  
464 - ),  
465 - Text(  
466 - '菜单价:${widget.priceSum}元',  
467 - style: TextStyle(  
468 - fontSize: font(12),  
469 - color: MyColours.color_515151),  
470 - ),  
471 - Text(  
472 - '会员价:${widget.memberPriceSum}元',  
473 - style: TextStyle(  
474 - fontSize: font(12),  
475 - color: MyColours.color_515151),  
476 - ),  
477 - Text(  
478 - '排菜价:${widget.planDishText}元',  
479 - style: TextStyle(  
480 - fontSize: font(12),  
481 - color: MyColours.color_515151),  
482 - )  
483 - ])),  
484 - Text(  
485 - '周到安排技术支持 400-000-9690',  
486 - style: TextStyle( 697 + children: [
  698 + Image.asset(
  699 + Utils.getImgPath(isRecommend
  700 + ? 'f_select'
  701 + : 'f_select_not'),
  702 + width: w(20),
  703 + ),
  704 + HEmptyView(20),
  705 + Text(
  706 + '使用自动生成的推荐语(可点击编辑)',
  707 + style: TextStyle(
  708 + fontSize: font(12),
  709 + color: MyColours.color_515151),
  710 + )
  711 + ],
  712 + ))),
  713 + if (index != null) VEmptyView(15),
  714 + if (index != null)
  715 + Container(
  716 + margin: EdgeInsets.symmetric(horizontal: w(20)),
  717 + padding: EdgeInsets.symmetric(horizontal: w(10)),
  718 + decoration: BoxDecoration(
  719 + borderRadius: BorderRadius.circular(r(5)),
  720 + border: Border.all(
  721 + width: w(0.5),
  722 + color: MyColours.color_DBDBDB)),
  723 + child: TextField(
  724 + controller: recommendC,
  725 + textAlign: TextAlign.left,
  726 + // textAlignVertical:
  727 + // TextAlignVertical.bottom,
  728 + maxLines: 3,
  729 + // //光标颜色
  730 + // cursorColor:
  731 + // widget.isSelect ? Colors.white : MyColours.color_199095,
  732 + //输入文本的样式
  733 + style: TextStyle(
  734 + color: MyColours.color_999999,
487 fontSize: font(12), 735 fontSize: font(12),
488 - color: MyColours.color_999999),  
489 - ),  
490 - ]))))), 736 + ),
  737 + // focusNode: focusNode,
  738 + decoration: InputDecoration(
  739 + border: OutlineInputBorder(
  740 + borderSide: BorderSide.none),
  741 + hintText: '请输入推荐语',
  742 + hintStyle: TextStyle(
  743 + color: MyColours.color_999999,
  744 + fontSize: font(12),
  745 + ),
  746 + enabledBorder: new UnderlineInputBorder(
  747 + borderSide: BorderSide.none,
  748 + ),
  749 + focusedBorder: new UnderlineInputBorder(
  750 + borderSide: BorderSide.none,
  751 + ),
  752 + ),
  753 + onChanged: (value) {},
  754 + onEditingComplete: () {
  755 + FocusScope.of(context)
  756 + .requestFocus(FocusNode()); //点击空白处隐藏键盘
  757 + },
  758 + keyboardType: TextInputType.text)),
  759 + VEmptyView(20),
  760 + ],
  761 + ))),
491 Container( 762 Container(
492 color: MyColours.color_ffffff, 763 color: MyColours.color_ffffff,
493 padding: EdgeInsets.only( 764 padding: EdgeInsets.only(
@@ -514,7 +785,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> { @@ -514,7 +785,7 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
514 HEmptyView(30), 785 HEmptyView(30),
515 Expanded( 786 Expanded(
516 child: RoundButton( 787 child: RoundButton(
517 - text: '分享排菜单', 788 + text: '下一步',
518 gradientStart: MyColours.color_438E93, 789 gradientStart: MyColours.color_438E93,
519 gradientEnd: MyColours.color_438E93, 790 gradientEnd: MyColours.color_438E93,
520 height: w(43), 791 height: w(43),
@@ -522,9 +793,32 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> { @@ -522,9 +793,32 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
522 fontSize: 36, 793 fontSize: 36,
523 isBold: false, 794 isBold: false,
524 onPressed: () { 795 onPressed: () {
525 - ShareHelper.onShareWx(context,  
526 - boundaryKey: boundaryKey);  
527 - // NavigatorUtil.goOrderPreviewPage(context); 796 + if (index != null) {
  797 + NavigatorUtil.goOrderSharePage(context,
  798 + object: {'object': widget.showList},
  799 + name: widget.name,
  800 + remark: widget.remark,
  801 + priceSum: widget.priceSum,
  802 + memberPriceSum: widget.memberPriceSum,
  803 + planDishText: widget.planDishText,
  804 + detailEntity: widget.detailEntity,
  805 + rechargeListSunModel:
  806 + marketingCenterProvider.rechargeList[index],
  807 + recommend: recommendC.text,
  808 + isRecharge: isRecharge,
  809 + isRecommend: isRecommend);
  810 + } else {
  811 + NavigatorUtil.goOrderSharePage(
  812 + context,
  813 + object: {'object': widget.showList},
  814 + name: widget.name,
  815 + remark: widget.remark,
  816 + priceSum: widget.priceSum,
  817 + memberPriceSum: widget.memberPriceSum,
  818 + planDishText: widget.planDishText,
  819 + detailEntity: widget.detailEntity,
  820 + );
  821 + }
528 }, 822 },
529 ), 823 ),
530 ) 824 )
@@ -532,6 +826,6 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> { @@ -532,6 +826,6 @@ class _OrderPreviewPageState extends State<OrderPreviewPage> {
532 )) 826 ))
533 ], 827 ],
534 ), 828 ),
535 - ); 829 + ));
536 } 830 }
537 } 831 }
  1 +import 'package:flutter/material.dart';
  2 +import 'package:flutter_keyboard_visibility/flutter_keyboard_visibility.dart';
  3 +import 'package:one_key/utils/repaint_boundary_utils.dart';
  4 +import 'package:one_key/widgets/system_app_bar.dart';
  5 +import 'package:provider/provider.dart';
  6 +
  7 +import '../../../res/colors.dart';
  8 +import '../../../utils/screen_util.dart';
  9 +import '../../../utils/utils.dart';
  10 +import '../../../widgets/MyDivider.dart';
  11 +import '../../../widgets/h_empty_view.dart';
  12 +import '../../../widgets/round_button.dart';
  13 +import '../../../widgets/v_empty_view.dart';
  14 +import '../../models/cookbook_model.dart';
  15 +import '../../models/notebook_detail.dart';
  16 +import '../../models/recharge_list_model.dart';
  17 +import '../../provider/marketing_center_provider.dart';
  18 +import '../../provider/user_model.dart';
  19 +import '../../utils/share_helper.dart';
  20 +import '../my/marketing_center/recharge/recharge_item.dart';
  21 +
  22 +/**
  23 + * 微信分享截图
  24 + */
  25 +class OrderSharePage extends StatefulWidget {
  26 + final List<MenuModel> showList;
  27 + final String priceSum;
  28 + final String memberPriceSum;
  29 + final String planDishText;
  30 + final String name;
  31 + final String remark;
  32 + final NotebookDetail detailEntity;
  33 +
  34 + final RechargeListSunModel rechargeListSunModel;
  35 +
  36 + final String recommend;
  37 +
  38 + final bool isRecommend;
  39 + final bool isRecharge;
  40 +
  41 + OrderSharePage(
  42 + {Key key,
  43 + this.showList,
  44 + this.priceSum,
  45 + this.memberPriceSum,
  46 + this.planDishText,
  47 + this.name,
  48 + this.remark,
  49 + this.detailEntity,
  50 + this.rechargeListSunModel,
  51 + this.recommend,
  52 + this.isRecommend,
  53 + this.isRecharge})
  54 + : super(key: key);
  55 +
  56 + @override
  57 + _OrderSharePageState createState() => _OrderSharePageState();
  58 +}
  59 +
  60 +class _OrderSharePageState extends State<OrderSharePage> {
  61 + ScrollController controller = ScrollController();
  62 + //全局key-截图key
  63 + final GlobalKey boundaryKey = GlobalKey();
  64 +
  65 + @override
  66 + void initState() {
  67 + super.initState();
  68 + Utils.changeStatusColor(color: Colors.transparent);
  69 +
  70 + WidgetsBinding.instance.addPostFrameCallback((_) {});
  71 + }
  72 +
  73 + Widget _laduWidget() {
  74 + // if (labelIcon[widget
  75 + // .cookBookList.labelList[index].icon] is int) {
  76 + // int ladu = labelIcon[
  77 + // widget.cookBookList.labelList[index].icon];
  78 + int ladu = 6;
  79 + List<Widget> widgetList = [];
  80 + for (var i = 0; i < ladu; i++) {
  81 + widgetList.add(Image.asset(
  82 + Utils.getImgPath('ladu'),
  83 + width: w(10),
  84 + ));
  85 + }
  86 + // widgetList.add(HEmptyView(10));
  87 + return Row(
  88 + children: widgetList,
  89 + );
  90 + // }else{
  91 + // return SizedBox();
  92 + // }
  93 + }
  94 +
  95 + @override
  96 + Widget build(BuildContext context) {
  97 + String sellername =
  98 + Provider.of<UserModel>(context, listen: false).user.sellername;
  99 + String sellerAdr =
  100 + Provider.of<UserModel>(context, listen: false).user.sellerAddr;
  101 + String tables = '';
  102 + widget.detailEntity.tables.forEach((element) {
  103 + tables += '${element.name}、';
  104 + });
  105 + if (tables.endsWith('、')) {
  106 + tables = tables.substring(0, tables.length - 1);
  107 + }
  108 + String servicePerson = '${widget.detailEntity.nick_name ?? ''}' +
  109 + ' ' +
  110 + '${widget.detailEntity.seller_user_phone ?? ''}';
  111 + return KeyboardDismissOnTap(
  112 + child: Scaffold(
  113 + backgroundColor: MyColours.color_ffffff,
  114 + appBar: SystemAppBar('排菜单'),
  115 + body: Column(
  116 + children: [
  117 + Expanded(
  118 + child: SingleChildScrollView(
  119 + controller: controller,
  120 + child: RepaintBoundary(
  121 + key: boundaryKey,
  122 + child: Container(
  123 + color: Colors.white,
  124 + child: Column(children: [
  125 + Stack(children: [
  126 + Stack(
  127 + // alignment: AlignmentDirectional.bottomCenter, // alignment:子组件对齐方式 系统默认
  128 + // alignment: const FractionalOffset(0.5, 0.9), //自己指定Stack子组件对齐 ,只对Stack中有两个子View生效。0.5表示x轴,0.9表示y轴(FractionalOffset 0.5,0.5表示中心)
  129 + //AlignmentDirectional x、y 偏移量取值范围为 [-1,1],如果 x 的偏移量大于 0,则表示向右偏移,小于 0 则向左偏移;如果 y 轴的偏移量大于 0 则向下偏移,小于 0 则向上偏移。
  130 + alignment: AlignmentDirectional(
  131 + 0, 0), //AlignmentDirectional 0,0表示在正中心。
  132 + fit: StackFit.loose,
  133 +
  134 + children: [
  135 + Container(
  136 + width: double.infinity,
  137 + margin: EdgeInsets.zero,
  138 + padding: EdgeInsets.only(
  139 + left: w(20),
  140 + right: w(20),
  141 + top: w(30),
  142 + bottom: w(15)),
  143 + // height: w(200),
  144 + // constraints: new BoxConstraints.expand(
  145 + // height: w(200),
  146 + // ),
  147 + decoration: BoxDecoration(
  148 + gradient: LinearGradient(
  149 + stops: [
  150 + -0.5747,
  151 + 0.5572,
  152 + 1.4872
  153 + ],
  154 + colors: [
  155 + MyColours.color_4C8DAD,
  156 + MyColours.color_0143A3,
  157 + MyColours.color_42A5FF
  158 + ],
  159 + begin: Alignment.topLeft,
  160 + end: Alignment.bottomRight),
  161 + ),
  162 + child: Container(
  163 + color: Colors.transparent,
  164 + child: Column(
  165 + crossAxisAlignment:
  166 + CrossAxisAlignment.start,
  167 + children: [
  168 + Text(
  169 + '${sellername} 贵宾排菜菜单',
  170 + style: TextStyle(
  171 + fontSize: font(20),
  172 + fontWeight: FontWeight.bold,
  173 + color: Colors.transparent),
  174 + ),
  175 + VEmptyView(26),
  176 + Text(
  177 + '预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',
  178 + style: TextStyle(
  179 + fontSize: font(14),
  180 + color: Colors.transparent),
  181 + ),
  182 + VEmptyView(10),
  183 + Text(
  184 + '预订时间 | ${widget.detailEntity.ddateymd}',
  185 + style: TextStyle(
  186 + fontSize: font(14),
  187 + color: Colors.transparent),
  188 + ),
  189 + VEmptyView(10),
  190 + Text(
  191 + '区域桌台 | ${tables}',
  192 + style: TextStyle(
  193 + fontSize: font(14),
  194 + color: Colors.transparent),
  195 + ),
  196 + VEmptyView(10),
  197 + Text(
  198 + '餐厅地址 | ${sellerAdr}',
  199 + style: TextStyle(
  200 + fontSize: font(14),
  201 + color: Colors.transparent),
  202 + ),
  203 + VEmptyView(10),
  204 + Text(
  205 + '专属服务 | ${servicePerson}',
  206 + style: TextStyle(
  207 + fontSize: font(14),
  208 + color: Colors.transparent),
  209 + ),
  210 + ],
  211 + )),
  212 + ),
  213 + Positioned(
  214 + right: w(22),
  215 + bottom: w(30),
  216 + child: Image.asset(Utils.getImgPath('menu_bg')),
  217 + width: w(170),
  218 + )
  219 + ],
  220 + ),
  221 + Positioned(
  222 + top: w(30),
  223 + left: w(20),
  224 + child: Container(
  225 + color: Colors.transparent,
  226 + child: Column(
  227 + crossAxisAlignment: CrossAxisAlignment.start,
  228 + children: [
  229 + Text(
  230 + '${sellername} 贵宾排菜菜单',
  231 + style: TextStyle(
  232 + fontSize: font(20),
  233 + fontWeight: FontWeight.bold,
  234 + color: MyColours.color_CFB53B),
  235 + ),
  236 + VEmptyView(26),
  237 + Text(
  238 + '预订贵宾 | ${widget.detailEntity.rnameStr ?? ''}',
  239 + style: TextStyle(
  240 + fontSize: font(14),
  241 + color: MyColours.color_CFB53B),
  242 + ),
  243 + VEmptyView(10),
  244 + Text(
  245 + '预订时间 | ${widget.detailEntity.ddateymd}',
  246 + style: TextStyle(
  247 + fontSize: font(14),
  248 + color: MyColours.color_CFB53B),
  249 + ),
  250 + VEmptyView(10),
  251 + Text(
  252 + '区域桌台 | ${tables}',
  253 + style: TextStyle(
  254 + fontSize: font(14),
  255 + color: MyColours.color_CFB53B),
  256 + ),
  257 + VEmptyView(10),
  258 + Text(
  259 + '餐厅地址 | ${sellerAdr}',
  260 + style: TextStyle(
  261 + fontSize: font(14),
  262 + color: MyColours.color_CFB53B),
  263 + ),
  264 + VEmptyView(10),
  265 + Text(
  266 + '专属服务 | ${servicePerson}',
  267 + style: TextStyle(
  268 + fontSize: font(14),
  269 + color: MyColours.color_CFB53B),
  270 + ),
  271 + ],
  272 + ))),
  273 + ]),
  274 + widget.name != null && widget.name != ''
  275 + ? Container(
  276 + width: double.infinity,
  277 + // width: w(32),
  278 + // constraints: BoxConstraints(
  279 + // minHeight: w(48),
  280 + // ),
  281 + // height: w(48),
  282 + padding: EdgeInsets.only(
  283 + left: w(10),
  284 + right: w(20),
  285 + top: w(10),
  286 + bottom: w(10)),
  287 + decoration: BoxDecoration(
  288 + border: Border(
  289 + // top: BorderSide(
  290 + // width: w(1), color: MyColours.color_DBDBDB),
  291 + bottom: BorderSide(
  292 + width: w(1),
  293 + color: MyColours.color_DBDBDB))),
  294 + // constraints: BoxConstraints(minWidth: w(20)),
  295 + child: Row(
  296 + children: [
  297 + Expanded(
  298 + child: Text(
  299 + widget.name,
  300 + style: TextStyle(
  301 + color: MyColours.color_515151,
  302 + fontSize: font(16),
  303 + fontWeight: FontWeight.bold),
  304 + )
  305 + // TextField(
  306 + // maxLines: 1,
  307 + // // controller:
  308 + // // focusNode: _focusNode,
  309 + // // autofocus: true,
  310 +
  311 + // style: TextStyle(
  312 + // color: MyColours.color_515151,
  313 + // fontSize: font(16),
  314 + // fontWeight: FontWeight.bold),
  315 + // textAlign: TextAlign.left,
  316 + // // textAlignVertical: TextAlignVertical.center,
  317 + // decoration: InputDecoration(
  318 + // // hintText: "请输入排菜名称",
  319 + // hintText: '朋友小聚888套餐(若无名称不展示本行)',
  320 + // hintStyle: TextStyle(
  321 + // color: MyColours.color_999999,
  322 + // fontSize: font(16),
  323 + // fontWeight: FontWeight.bold),
  324 + // // isCollapsed:
  325 + // // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  326 + // border: OutlineInputBorder(
  327 + // borderSide: BorderSide.none),
  328 + // contentPadding: EdgeInsets.zero,
  329 + // ),
  330 + // keyboardType: TextInputType.text,
  331 + // textInputAction: TextInputAction.done,
  332 +
  333 + // onChanged: (value) {
  334 + // // setState(() {});
  335 + // // _searchSellerLocation();
  336 + // // customerProvider.searchData(value);
  337 + // },
  338 + // onEditingComplete: () {
  339 + // FocusScope.of(context)
  340 + // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  341 + // // contantShowModel.searchData(
  342 + // // contantShowModel.controller.text);
  343 + // // _searchSellerLocation();
  344 + // // _focusNode.unfocus();
  345 + // },
  346 + // )
  347 + ),
  348 + HEmptyView(20),
  349 + Text(
  350 + '1份',
  351 + style: TextStyle(
  352 + fontSize: font(14),
  353 + color: MyColours.color_515151),
  354 + ),
  355 + ],
  356 + ))
  357 + : SizedBox(),
  358 + ListView.builder(
  359 + itemCount: widget.showList.length,
  360 + shrinkWrap: true,
  361 + controller: controller,
  362 + padding: EdgeInsets.zero,
  363 + itemBuilder: (context, index) {
  364 + MenuModel menuModel = widget.showList[index];
  365 + return ListView.builder(
  366 + itemCount: menuModel.cookbooklist.length + 1,
  367 + shrinkWrap: true,
  368 + controller: controller,
  369 + padding: EdgeInsets.zero,
  370 + itemBuilder: (context, index) {
  371 + if (index == 0) {
  372 + return Column(
  373 + children: [
  374 + //头
  375 + Container(
  376 + width: double.infinity,
  377 + // width: w(32),
  378 + height: w(48),
  379 + padding: EdgeInsets.only(
  380 + left: w(10), right: w(20)),
  381 + decoration: BoxDecoration(
  382 + border: Border(
  383 + bottom: BorderSide(
  384 + width: w(1),
  385 + color: MyColours
  386 + .color_DBDBDB))),
  387 + // constraints: BoxConstraints(minWidth: w(20)),
  388 + child: Row(
  389 + mainAxisAlignment:
  390 + MainAxisAlignment
  391 + .spaceBetween,
  392 + children: [
  393 + Text(
  394 + menuModel.className,
  395 + style: TextStyle(
  396 + fontSize: font(16),
  397 + color: MyColours
  398 + .color_515151,
  399 + fontWeight:
  400 + FontWeight.bold),
  401 + ),
  402 + Text(
  403 + '${menuModel.allSum}道',
  404 + style: TextStyle(
  405 + fontSize: font(14),
  406 + color:
  407 + MyColours.color_515151,
  408 + ),
  409 + ),
  410 + ],
  411 + ))
  412 + ],
  413 + );
  414 + }
  415 + int indexReal = index - 1;
  416 + MenuSunModel menuSunModel =
  417 + menuModel.cookbooklist[indexReal];
  418 + return Container(
  419 + padding: EdgeInsets.symmetric(
  420 + horizontal: w(20), vertical: w(13)),
  421 + decoration: BoxDecoration(
  422 + border: Border(
  423 + bottom: BorderSide(
  424 + width: w(1),
  425 + color:
  426 + MyColours.color_DBDBDB))),
  427 + child: Row(
  428 + children: [
  429 + // Container(
  430 + // constraints: BoxConstraints(
  431 + // maxWidth: w(80)),
  432 + Expanded(
  433 + child: Text(
  434 + menuSunModel.name,
  435 + maxLines: 10,
  436 + overflow: TextOverflow.ellipsis,
  437 + style: TextStyle(
  438 + fontSize: font(14),
  439 + color: MyColours.color_515151),
  440 + )),
  441 + // HEmptyView(8),
  442 + // _laduWidget(),
  443 + Spacer(),
  444 + Text(
  445 + '${menuSunModel.price}元/${menuSunModel.unit}',
  446 + maxLines: 2,
  447 + overflow: TextOverflow.ellipsis,
  448 + style: TextStyle(
  449 + fontSize: font(12),
  450 + color: MyColours.color_515151),
  451 + ),
  452 + // HEmptyView(108),
  453 + // Text(
  454 + // '38元/份',
  455 + // maxLines: 2,
  456 + // overflow: TextOverflow.ellipsis,
  457 + // style: TextStyle(
  458 + // fontSize: font(10),
  459 + // color: MyColours.color_8EBBBE),
  460 + // ),
  461 + Container(
  462 + width: w(79),
  463 + alignment: Alignment.centerRight,
  464 + child: Text(
  465 + '${menuSunModel.amount}份',
  466 + style: TextStyle(
  467 + fontSize: font(12),
  468 + color:
  469 + MyColours.color_515151),
  470 + )),
  471 + ],
  472 + ),
  473 + );
  474 + });
  475 + }),
  476 + widget.remark != null && widget.remark != ''
  477 + ? Container(
  478 + width: double.infinity,
  479 + padding: EdgeInsets.symmetric(
  480 + horizontal: w(15), vertical: w(7)),
  481 + margin: EdgeInsets.only(
  482 + top: w(7),
  483 + bottom: w(13),
  484 + left: w(20),
  485 + right: w(20)),
  486 + decoration: BoxDecoration(
  487 + borderRadius: BorderRadius.circular(r(5)),
  488 + border: Border.all(
  489 + width: w(1),
  490 + color: MyColours.color_DBDBDB)),
  491 + child: Text(
  492 + "${widget.remark}",
  493 + style: TextStyle(
  494 + color: MyColours.color_515151,
  495 + fontSize: font(12)),
  496 + )
  497 + // child: TextField(
  498 + // maxLines: 4,
  499 + // // controller:
  500 + // // focusNode: _focusNode,
  501 + // // autofocus: true,
  502 +
  503 + // style: TextStyle(
  504 + // color: MyColours.color_515151, fontSize: font(12)),
  505 + // textAlign: TextAlign.left,
  506 + // // textAlignVertical: TextAlignVertical.center,
  507 + // decoration: InputDecoration(
  508 + // hintText: "请输入整单备注",
  509 + // hintStyle: TextStyle(
  510 + // color: MyColours.color_999999,
  511 + // fontSize: font(12),
  512 + // ),
  513 + // // isCollapsed:
  514 + // // true, //重点,相当于高度包裹的意思,必须设置为true,不然有默认奇妙的最小高度
  515 + // border:
  516 + // OutlineInputBorder(borderSide: BorderSide.none),
  517 + // contentPadding: EdgeInsets.zero,
  518 + // ),
  519 + // keyboardType: TextInputType.number,
  520 + // textInputAction: TextInputAction.done,
  521 +
  522 + // onChanged: (value) {
  523 + // // setState(() {});
  524 + // // _searchSellerLocation();
  525 + // // customerProvider.searchData(value);
  526 + // },
  527 + // onEditingComplete: () {
  528 + // FocusScope.of(context)
  529 + // .requestFocus(FocusNode()); //点击空白处隐藏键盘
  530 + // // contantShowModel.searchData(
  531 + // // contantShowModel.controller.text);
  532 + // // _searchSellerLocation();
  533 + // // _focusNode.unfocus();
  534 + // },
  535 + // ),
  536 + )
  537 + : SizedBox(),
  538 + Container(
  539 + decoration: BoxDecoration(
  540 + border: Border(
  541 + top: BorderSide(
  542 + width: w(1),
  543 + color: widget.remark != null &&
  544 + widget.remark != ''
  545 + ? MyColours.color_DBDBDB
  546 + : Colors.transparent))),
  547 + padding: EdgeInsets.symmetric(
  548 + horizontal: w(10), vertical: w(15)),
  549 + child: Row(
  550 + mainAxisAlignment: MainAxisAlignment.spaceAround,
  551 + children: [
  552 + Text(
  553 + '总计',
  554 + style: TextStyle(
  555 + fontSize: font(12),
  556 + color: MyColours.color_515151),
  557 + ),
  558 + Text(
  559 + '菜单价:${widget.priceSum}元',
  560 + style: TextStyle(
  561 + fontSize: font(12),
  562 + color: MyColours.color_515151),
  563 + ),
  564 + Text(
  565 + '会员价:${widget.memberPriceSum}元',
  566 + style: TextStyle(
  567 + fontSize: font(12),
  568 + color: MyColours.color_515151),
  569 + ),
  570 + Text(
  571 + '排菜价:${widget.planDishText}元',
  572 + style: TextStyle(
  573 + fontSize: font(12),
  574 + color: MyColours.color_515151),
  575 + )
  576 + ])),
  577 + // VEmptyView(10),
  578 + Column(
  579 + children: [
  580 + if (widget.isRecommend && widget.recommend != null)
  581 + VEmptyView(15),
  582 + if (widget.isRecommend && widget.recommend != null)
  583 + Container(
  584 + margin: EdgeInsets.symmetric(horizontal: w(20)),
  585 + padding:
  586 + EdgeInsets.symmetric(horizontal: w(10)),
  587 + // decoration: BoxDecoration(
  588 + // borderRadius: BorderRadius.circular(r(5)),
  589 + // border: Border.all(
  590 + // width: w(0.5),
  591 + // color: MyColours.color_DBDBDB)),
  592 + child: Text(
  593 + widget.recommend,
  594 + style: TextStyle(
  595 + color: MyColours.color_999999,
  596 + fontSize: font(12),
  597 + ),
  598 + )
  599 + // focusNode: focusNode,
  600 + ),
  601 + if (widget.isRecharge &&
  602 + widget.rechargeListSunModel != null)
  603 + VEmptyView(15),
  604 + if (widget.isRecharge &&
  605 + widget.rechargeListSunModel != null)
  606 + RechargeItem(
  607 + from: 'menu-show',
  608 + rechargeListSunModel: widget.rechargeListSunModel,
  609 + ),
  610 + VEmptyView(52),
  611 + Text(
  612 + '周到安排技术支持 400-000-9690',
  613 + style: TextStyle(
  614 + fontSize: font(12),
  615 + color: MyColours.color_999999),
  616 + ),
  617 + VEmptyView(26),
  618 + ],
  619 + )
  620 + ]))),
  621 + )),
  622 + Container(
  623 + color: MyColours.color_ffffff,
  624 + padding: EdgeInsets.only(
  625 + top: w(12), bottom: w(25), left: w(23), right: w(23)),
  626 + child: Row(
  627 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  628 + children: [
  629 + RoundButton(
  630 + text: '返回',
  631 + gradientStart: MyColours.color_ffffff,
  632 + gradientEnd: MyColours.color_ffffff,
  633 + borderColor: MyColours.color_438E93,
  634 + textColor: MyColours.color_438E93,
  635 + width: w(100),
  636 + height: w(43),
  637 + radius: r(5),
  638 + fontSize: 32,
  639 + isBold: false,
  640 + onPressed: () {
  641 + Navigator.pop(context);
  642 + // NavigatorUtil.goOrderSharePage(context);
  643 + },
  644 + ),
  645 + HEmptyView(30),
  646 + Expanded(
  647 + child: RoundButton(
  648 + text: '分享排菜单',
  649 + gradientStart: MyColours.color_438E93,
  650 + gradientEnd: MyColours.color_438E93,
  651 + height: w(43),
  652 + radius: r(5),
  653 + fontSize: 36,
  654 + isBold: false,
  655 + onPressed: () {
  656 + ShareHelper.onShareWx(
  657 + context,
  658 + boundaryKey: boundaryKey,
  659 + );
  660 +
  661 + // NavigatorUtil.goOrderSharePage(context);
  662 + },
  663 + ),
  664 + )
  665 + ],
  666 + ))
  667 + ],
  668 + ),
  669 + ));
  670 + }
  671 +}
@@ -32,6 +32,7 @@ import '../models/otherset_model.dart'; @@ -32,6 +32,7 @@ import '../models/otherset_model.dart';
32 import '../models/out_wine_record_model.dart'; 32 import '../models/out_wine_record_model.dart';
33 import '../models/plan_cook_by_rid_model.dart'; 33 import '../models/plan_cook_by_rid_model.dart';
34 import '../models/plan_cook_list_model.dart'; 34 import '../models/plan_cook_list_model.dart';
  35 +import '../models/recharge_list_model.dart';
35 import '../models/set_xuan_tai_model.dart'; 36 import '../models/set_xuan_tai_model.dart';
36 import '../models/wine_manage_model.dart'; 37 import '../models/wine_manage_model.dart';
37 import '../models/wine_model.dart'; 38 import '../models/wine_model.dart';
@@ -277,7 +278,7 @@ class NavigatorUtil { @@ -277,7 +278,7 @@ class NavigatorUtil {
277 /// 优惠券详情页 278 /// 优惠券详情页
278 static Future<dynamic> goCouponDetailPage( 279 static Future<dynamic> goCouponDetailPage(
279 BuildContext context, CouponSunModel couponSunModel, 280 BuildContext context, CouponSunModel couponSunModel,
280 - {replace = false,String idStr}) { 281 + {replace = false, String idStr}) {
281 return _navigateTo(context, 282 return _navigateTo(context,
282 "${Routes.coupon_detail}?couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}&idStr=$idStr", 283 "${Routes.coupon_detail}?couponSunModel=${FluroConvertUtils.object2string(couponSunModel)}&idStr=$idStr",
283 replace: replace); 284 replace: replace);
@@ -1450,10 +1451,12 @@ class NavigatorUtil { @@ -1450,10 +1451,12 @@ class NavigatorUtil {
1450 1451
1451 ///预订安排通知定制------优惠券选择 1452 ///预订安排通知定制------优惠券选择
1452 static Future<dynamic> goMarkingCouponSelectPage( 1453 static Future<dynamic> goMarkingCouponSelectPage(
1453 - BuildContext context,String idstr, { 1454 + BuildContext context,
  1455 + String idstr, {
1454 replace = false, 1456 replace = false,
1455 }) { 1457 }) {
1456 - return _navigateTo(context, "${Routes.marking_coupon_select_page}?idstr=$idstr", 1458 + return _navigateTo(
  1459 + context, "${Routes.marking_coupon_select_page}?idstr=$idstr",
1457 replace: replace); 1460 replace: replace);
1458 } 1461 }
1459 1462
@@ -1602,4 +1605,40 @@ class NavigatorUtil { @@ -1602,4 +1605,40 @@ class NavigatorUtil {
1602 context, "${Routes.marking_recharge_select_page}?idstr=$idstr", 1605 context, "${Routes.marking_recharge_select_page}?idstr=$idstr",
1603 replace: replace); 1606 replace: replace);
1604 } 1607 }
  1608 +
  1609 + ///排菜单--分享微信截屏
  1610 +
  1611 + static Future<dynamic> goOrderSharePage(
  1612 + BuildContext context, {
  1613 + replace = false,
  1614 + Map object,
  1615 + String priceSum,
  1616 + String memberPriceSum,
  1617 + String planDishText,
  1618 + String name,
  1619 + String remark,
  1620 + NotebookDetail detailEntity,
  1621 + RechargeListSunModel rechargeListSunModel,
  1622 + String recommend,
  1623 + bool isRecharge = false,
  1624 + bool isRecommend = false,
  1625 + }) {
  1626 + // if (invoice != null) {
  1627 + // return _navigateTo(context,
  1628 + // "${Routes.order_advance_home_page}?invoice=${FluroConvertUtils.object2string(invoice)}",
  1629 + // replace: replace);
  1630 + // }
  1631 + // if (object != null) {
  1632 + // return _navigateTo(context,
  1633 + // "${Routes.order_advance_home_page}?tids=$tids&tableidNow=$tableidNow&fromPage=$fromPage&canChoose=$canChoose&object=${FluroConvertUtils.object2string(object)}");
  1634 + // }
  1635 + if (rechargeListSunModel != null) {
  1636 + return _navigateTo(context,
  1637 + "${Routes.order_share_page}?object=${FluroConvertUtils.object2string(object)}&priceSum=$priceSum&memberPriceSum=$memberPriceSum&planDishText=${Uri.encodeComponent(planDishText)}&name=${Uri.encodeComponent(name)}&remark=${Uri.encodeComponent(remark)}&detail=${FluroConvertUtils.object2string(detailEntity)}&recharge=${FluroConvertUtils.object2string(rechargeListSunModel)}&isRecharge=${isRecharge}&isRecommend=${isRecommend}&recommend=${Uri.encodeComponent(recommend)}",
  1638 + replace: replace);
  1639 + }
  1640 + return _navigateTo(context,
  1641 + "${Routes.order_share_page}?object=${FluroConvertUtils.object2string(object)}&priceSum=$priceSum&memberPriceSum=$memberPriceSum&planDishText=${Uri.encodeComponent(planDishText)}&name=${Uri.encodeComponent(name)}&remark=${Uri.encodeComponent(remark)}&detail=${FluroConvertUtils.object2string(detailEntity)}&isRecharge=${isRecharge}&isRecommend=${isRecommend}&recommend=${Uri.encodeComponent(recommend)}",
  1642 + replace: replace);
  1643 + }
1605 } 1644 }
1 -  
2 import 'dart:convert'; 1 import 'dart:convert';
3 2
4 import 'package:fluro/fluro.dart'; 3 import 'package:fluro/fluro.dart';
@@ -17,6 +16,7 @@ import 'package:one_key/models/marketing_by_uid_model.dart'; @@ -17,6 +16,7 @@ import 'package:one_key/models/marketing_by_uid_model.dart';
17 import 'package:one_key/models/notebook_detail.dart'; 16 import 'package:one_key/models/notebook_detail.dart';
18 import 'package:one_key/models/otherset_model.dart'; 17 import 'package:one_key/models/otherset_model.dart';
19 import 'package:one_key/models/personnel_manage_model.dart'; 18 import 'package:one_key/models/personnel_manage_model.dart';
  19 +import 'package:one_key/models/recharge_list_model.dart';
20 import 'package:one_key/models/sms_info.dart'; 20 import 'package:one_key/models/sms_info.dart';
21 import 'package:one_key/models/statics_model.dart'; 21 import 'package:one_key/models/statics_model.dart';
22 import 'package:one_key/models/table_list.dart'; 22 import 'package:one_key/models/table_list.dart';
@@ -214,6 +214,7 @@ import '../pages/order_advance/order_advance_home_page.dart'; @@ -214,6 +214,7 @@ import '../pages/order_advance/order_advance_home_page.dart';
214 import '../pages/order_advance/order_create_temporary_page.dart'; 214 import '../pages/order_advance/order_create_temporary_page.dart';
215 import '../pages/order_advance/order_edit_list_show_page.dart'; 215 import '../pages/order_advance/order_edit_list_show_page.dart';
216 import '../pages/order_advance/order_preview_page.dart'; 216 import '../pages/order_advance/order_preview_page.dart';
  217 +import '../pages/order_advance/order_share_page.dart';
217 import '../provider/feast_model.dart'; 218 import '../provider/feast_model.dart';
218 import '../provider/marketing_center_provider.dart'; 219 import '../provider/marketing_center_provider.dart';
219 import '../provider/plan_dish_provider.dart'; 220 import '../provider/plan_dish_provider.dart';
@@ -2077,14 +2078,16 @@ var orderPreviewPageHandle = new Handler( @@ -2077,14 +2078,16 @@ var orderPreviewPageHandle = new Handler(
2077 2078
2078 return ChangeNotifierProvider<PlanDishProvider>( 2079 return ChangeNotifierProvider<PlanDishProvider>(
2079 create: (_) => PlanDishProvider(), 2080 create: (_) => PlanDishProvider(),
2080 - child: OrderPreviewPage(  
2081 - showList: res,  
2082 - priceSum: priceSum,  
2083 - memberPriceSum: memberPriceSum,  
2084 - planDishText: planDishText,  
2085 - name: name,  
2086 - remark: remark,  
2087 - detailEntity: detailEntity)); 2081 + child: ChangeNotifierProvider<MarketingCenterProvider>(
  2082 + create: (_) => MarketingCenterProvider(),
  2083 + child: OrderPreviewPage(
  2084 + showList: res,
  2085 + priceSum: priceSum,
  2086 + memberPriceSum: memberPriceSum,
  2087 + planDishText: planDishText,
  2088 + name: name,
  2089 + remark: remark,
  2090 + detailEntity: detailEntity)));
2088 }); 2091 });
2089 2092
2090 ///经理排菜---排菜编辑列表展示 2093 ///经理排菜---排菜编辑列表展示
@@ -2596,3 +2599,75 @@ var markingRechargeSelectPageHandle = new Handler( @@ -2596,3 +2599,75 @@ var markingRechargeSelectPageHandle = new Handler(
2596 create: (_) => MarketingCenterProvider(), 2599 create: (_) => MarketingCenterProvider(),
2597 child: MarkingRechargeSelectPage(selectid: idstr)); 2600 child: MarkingRechargeSelectPage(selectid: idstr));
2598 }); 2601 });
  2602 +
  2603 +///排菜单微信分享截屏页
  2604 +var orderSharePageHandle = new Handler(
  2605 + handlerFunc: (BuildContext context, Map<dynamic, List<Object>> params) {
  2606 + // String fromPage = params["fromPage"].first;
  2607 + // String tids = params["tids"].first;
  2608 +
  2609 + // String tableidNow = params["tableidNow"].first;
  2610 + // bool canChoose = params["canChoose"].first == "true" ? true : false;
  2611 + // List<TableList> res = [];
  2612 + // if (params.keys.contains('object')) {
  2613 + // Map object = FluroConvertUtils.string2map(params["object"].first);
  2614 + // List temp = object['object'];
  2615 +
  2616 + // for (var item in temp) {
  2617 + // res.add(TableList.fromJson(item));
  2618 + // }
  2619 + // }
  2620 + NotebookDetail detailEntity = NotebookDetail.fromJson(json
  2621 + .decode(FluroConvertUtils.fluroCnParamsDecode(params["detail"].first)));
  2622 + List<MenuModel> res = [];
  2623 + // String planDishPrice = '';
  2624 + if (params.keys.contains('object')) {
  2625 + Map object = FluroConvertUtils.string2map(params["object"].first);
  2626 + List temp = object['object'];
  2627 +
  2628 + // planDishPrice = params["planDishPrice"].first;
  2629 +
  2630 + for (var item in temp) {
  2631 + // MenuModel menuModel = MenuModel.fromJson2(item);
  2632 + // res.add(menuModel);
  2633 + // print(res);
  2634 + res.add(MenuModel.fromJson2(item));
  2635 + }
  2636 + }
  2637 + String priceSum = params["priceSum"].first;
  2638 + String memberPriceSum = params["memberPriceSum"].first;
  2639 + String planDishText = params["planDishText"].first;
  2640 + String name = params["name"].first;
  2641 + String remark = params["remark"].first;
  2642 +
  2643 + RechargeListSunModel rechargeListSunModel;
  2644 +
  2645 + if (params.keys.contains('recharge')) {
  2646 +
  2647 + rechargeListSunModel = RechargeListSunModel.fromJson(json.decode(
  2648 + FluroConvertUtils.fluroCnParamsDecode(params["recharge"].first)));
  2649 + }
  2650 +
  2651 + String recommend = params["recommend"].first;
  2652 +
  2653 + bool isRecommend = FluroConvertUtils.string2bool(params["isRecommend"].first);
  2654 + bool isRecharge =
  2655 + FluroConvertUtils.string2bool(params["isRecharge"].first);
  2656 +
  2657 + return ChangeNotifierProvider<PlanDishProvider>(
  2658 + create: (_) => PlanDishProvider(),
  2659 + child: ChangeNotifierProvider<MarketingCenterProvider>(
  2660 + create: (_) => MarketingCenterProvider(),
  2661 + child: OrderSharePage(
  2662 + showList: res,
  2663 + priceSum: priceSum,
  2664 + memberPriceSum: memberPriceSum,
  2665 + planDishText: planDishText,
  2666 + name: name,
  2667 + remark: remark,
  2668 + detailEntity: detailEntity,
  2669 + rechargeListSunModel: rechargeListSunModel,
  2670 + recommend: recommend,
  2671 + isRecommend: isRecommend,
  2672 + isRecharge: isRecharge)));
  2673 +});
@@ -229,19 +229,13 @@ class Routes { @@ -229,19 +229,13 @@ class Routes {
229 static String recharge_edit_page = "/recharge_edit_page"; //充值优惠详情编辑页 229 static String recharge_edit_page = "/recharge_edit_page"; //充值优惠详情编辑页
230 static String recharge_select_store_coupon_page = 230 static String recharge_select_store_coupon_page =
231 "/recharge_select_store_coupon_page"; //充值优惠选择店铺可核销优惠券 231 "/recharge_select_store_coupon_page"; //充值优惠选择店铺可核销优惠券
232 -static String recharge_detail_page =  
233 - "/recharge_detail_page"; //充值优惠详情页 232 + static String recharge_detail_page = "/recharge_detail_page"; //充值优惠详情页
234 233
235 - static String verification_coupon_page =  
236 - "/verification_coupon_page"; //核销使用 234 + static String verification_coupon_page = "/verification_coupon_page"; //核销使用
237 235
238 - static String marking_recharge_select_page = 236 + static String marking_recharge_select_page =
239 "/marking_recharge_select_page"; //充值优惠单选择页面 237 "/marking_recharge_select_page"; //充值优惠单选择页面
240 -  
241 -  
242 -  
243 -  
244 - 238 + static String order_share_page = "/order_share_page"; //排菜单微信分享截屏
245 239
246 static void configureRoutes(FluroRouter router) { 240 static void configureRoutes(FluroRouter router) {
247 router.notFoundHandler = new Handler( 241 router.notFoundHandler = new Handler(
@@ -456,16 +450,14 @@ static String recharge_detail_page = @@ -456,16 +450,14 @@ static String recharge_detail_page =
456 450
457 router.define(recharge_select_store_coupon_page, 451 router.define(recharge_select_store_coupon_page,
458 handler: rechargeSelectStoreCouponPageHandle); 452 handler: rechargeSelectStoreCouponPageHandle);
459 -router.define(recharge_detail_page,  
460 - handler: rechargeDetailPageHandle);  
461 -router.define(verification_coupon_page, 453 + router.define(recharge_detail_page, handler: rechargeDetailPageHandle);
  454 + router.define(verification_coupon_page,
462 handler: verificationCouponPageHandle); 455 handler: verificationCouponPageHandle);
463 456
464 -router.define(marking_recharge_select_page, 457 + router.define(marking_recharge_select_page,
465 handler: markingRechargeSelectPageHandle); 458 handler: markingRechargeSelectPageHandle);
466 -  
467 -  
468 - 459 + router.define(order_share_page,
  460 + handler: orderSharePageHandle);
469 461
470 } 462 }
471 } 463 }
@@ -16,11 +16,9 @@ import 'package:one_key/utils/wx_sdk.dart'; @@ -16,11 +16,9 @@ import 'package:one_key/utils/wx_sdk.dart';
16 // import 'package:share_plus/share_plus.dart'; 16 // import 'package:share_plus/share_plus.dart';
17 17
18 class ShareHelper { 18 class ShareHelper {
19 -  
20 static bool wxIsInstalled = false; 19 static bool wxIsInstalled = false;
21 //微信分享截图 20 //微信分享截图
22 - static void onShareWx(BuildContext context,{boundaryKey}) async {  
23 - 21 + static Future<bool> onShareWx(BuildContext context, {boundaryKey}) async {
24 wxIsInstalled = await WxSdk.wxIsInstalled(); 22 wxIsInstalled = await WxSdk.wxIsInstalled();
25 //收回键盘,如果有输入的情况下,先收回键盘,再截图 23 //收回键盘,如果有输入的情况下,先收回键盘,再截图
26 FocusScope.of(context).requestFocus(FocusNode()); 24 FocusScope.of(context).requestFocus(FocusNode());
@@ -43,6 +41,4 @@ class ShareHelper { @@ -43,6 +41,4 @@ class ShareHelper {
43 // wxIsInstalled = await WxSdk.wxIsInstalled(); 41 // wxIsInstalled = await WxSdk.wxIsInstalled();
44 // } 42 // }
45 43
46 -  
47 } 44 }
48 -  
@@ -188,6 +188,7 @@ dependencies: @@ -188,6 +188,7 @@ dependencies:
188 pin_code_fields: ^7.4.0 188 pin_code_fields: ^7.4.0
189 # 二维码扫描 189 # 二维码扫描
190 barcode_scan2: ^4.2.4 190 barcode_scan2: ^4.2.4
  191 + # ai_barcode 3.2.4
191 # qr_code_scanner: ^1.0.1 192 # qr_code_scanner: ^1.0.1
192 193
193 194