Commit 54987decec0998b36aaabb4c3b76cce0e2f569ce

Authored by wdn127929
1 parent fe8ecc40

线上订单变更预订bug

@@ -12,14 +12,14 @@ if (flutterRoot == null) { @@ -12,14 +12,14 @@ if (flutterRoot == null) {
12 } 12 }
13 13
14 14
15 -def flutterVersionCode = "331" 15 +def flutterVersionCode = "338"
16 if (flutterVersionCode == null) { 16 if (flutterVersionCode == null) {
17 - flutterVersionCode = '331' 17 + flutterVersionCode = '338'
18 } 18 }
19 19
20 -def flutterVersionName = "3.3.1" 20 +def flutterVersionName = "3.3.8"
21 if (flutterVersionName == null) { 21 if (flutterVersionName == null) {
22 - flutterVersionName = '3.3.1' 22 + flutterVersionName = '3.3.8'
23 } 23 }
24 apply plugin: 'com.android.application' 24 apply plugin: 'com.android.application'
25 apply plugin: 'kotlin-android' 25 apply plugin: 'kotlin-android'
@@ -502,7 +502,7 @@ @@ -502,7 +502,7 @@
502 "$(inherited)", 502 "$(inherited)",
503 "$(PROJECT_DIR)/Flutter", 503 "$(PROJECT_DIR)/Flutter",
504 ); 504 );
505 - MARKETING_VERSION = 3.3.0; 505 + MARKETING_VERSION = 3.3.8;
506 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 506 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
507 PRODUCT_NAME = Runner; 507 PRODUCT_NAME = Runner;
508 PROVISIONING_PROFILE_SPECIFIER = ""; 508 PROVISIONING_PROFILE_SPECIFIER = "";
@@ -647,7 +647,7 @@ @@ -647,7 +647,7 @@
647 "$(inherited)", 647 "$(inherited)",
648 "$(PROJECT_DIR)/Flutter", 648 "$(PROJECT_DIR)/Flutter",
649 ); 649 );
650 - MARKETING_VERSION = 3.3.0; 650 + MARKETING_VERSION = 3.3.8;
651 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 651 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
652 PRODUCT_NAME = Runner; 652 PRODUCT_NAME = Runner;
653 PROVISIONING_PROFILE_SPECIFIER = ""; 653 PROVISIONING_PROFILE_SPECIFIER = "";
@@ -682,7 +682,7 @@ @@ -682,7 +682,7 @@
682 "$(inherited)", 682 "$(inherited)",
683 "$(PROJECT_DIR)/Flutter", 683 "$(PROJECT_DIR)/Flutter",
684 ); 684 );
685 - MARKETING_VERSION = 3.3.0; 685 + MARKETING_VERSION = 3.3.8;
686 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine; 686 PRODUCT_BUNDLE_IDENTIFIER = com.naji.reserveLine;
687 PRODUCT_NAME = Runner; 687 PRODUCT_NAME = Runner;
688 PROVISIONING_PROFILE_SPECIFIER = ""; 688 PROVISIONING_PROFILE_SPECIFIER = "";
@@ -74,7 +74,9 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -74,7 +74,9 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
74 void initState() { 74 void initState() {
75 super.initState(); 75 super.initState();
76 76
77 - dateTime = DateTime.now(); 77 + // dateTime = DateTime.now();
  78 + String ddate = widget.detailEntity.ddate.toString() + '000';
  79 + dateTime = DateTime.fromMillisecondsSinceEpoch(int.parse(ddate));
78 _nameNode.addListener(() { 80 _nameNode.addListener(() {
79 if (_nameNode.hasFocus) { 81 if (_nameNode.hasFocus) {
80 print('得到焦点'); 82 print('得到焦点');
@@ -92,7 +94,6 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -92,7 +94,6 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
92 // Provider.of<NotebookDetailChangeModel>(context, listen: false); 94 // Provider.of<NotebookDetailChangeModel>(context, listen: false);
93 sid = Provider.of<UserModel>(context, listen: false).user.sellerid; 95 sid = Provider.of<UserModel>(context, listen: false).user.sellerid;
94 _notebookDetailChangeModel.initDateHourMinuteList(context); 96 _notebookDetailChangeModel.initDateHourMinuteList(context);
95 - String ddate = widget.detailEntity.ddate.toString() + '000';  
96 _notebookDetailChangeModel.getNewTableList( 97 _notebookDetailChangeModel.getNewTableList(
97 context, 98 context,
98 ddate, 99 ddate,
@@ -694,7 +695,9 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -694,7 +695,9 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
694 Expanded( 695 Expanded(
695 child: TextField( 696 child: TextField(
696 maxLines: 1, 697 maxLines: 1,
697 - inputFormatters: [LengthLimitingTextInputFormatter(25)], 698 + inputFormatters: [
  699 + LengthLimitingTextInputFormatter(100)
  700 + ],
698 //输入文本的样式 701 //输入文本的样式
699 style: TextStyle( 702 style: TextStyle(
700 fontSize: ScreenUtil().setSp(34), 703 fontSize: ScreenUtil().setSp(34),
@@ -703,7 +706,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -703,7 +706,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
703 focusNode: _needNode, 706 focusNode: _needNode,
704 // textAlignVertical: TextAlignVertical.top, 707 // textAlignVertical: TextAlignVertical.top,
705 decoration: InputDecoration( 708 decoration: InputDecoration(
706 - hintText: "客户要求(25字以内,选填)", 709 + hintText: "客户要求(100字以内,选填)",
707 hintStyle: TextStyle( 710 hintStyle: TextStyle(
708 color: MyColours.color_999999, 711 color: MyColours.color_999999,
709 fontSize: ScreenUtil().setSp(34), 712 fontSize: ScreenUtil().setSp(34),
@@ -921,8 +924,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -921,8 +924,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
921 } 924 }
922 } 925 }
923 } 926 }
924 - if (currentRemark.length > 25) {  
925 - currentRemark = currentRemark.substring(0, 25); 927 + if (currentRemark.length > 100) {
  928 + currentRemark = currentRemark.substring(0, 100);
926 } 929 }
927 setState(() { 930 setState(() {
928 _notebookDetailChangeModel.customController.text = currentRemark; 931 _notebookDetailChangeModel.customController.text = currentRemark;
@@ -1455,8 +1458,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -1455,8 +1458,8 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
1455 item.selected = true; 1458 item.selected = true;
1456 } 1459 }
1457 // setState(() {}); 1460 // setState(() {});
1458 - int dateTimeMill =  
1459 - dateTime.millisecondsSinceEpoch; 1461 + int dateTimeMill = _notebookDetailChangeModel
  1462 + .dateTime.millisecondsSinceEpoch;
1460 1463
1461 await _notebookDetailChangeModel 1464 await _notebookDetailChangeModel
1462 .getNewTableList( 1465 .getNewTableList(
@@ -1735,7 +1738,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -1735,7 +1738,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
1735 textBaseline: TextBaseline.alphabetic), 1738 textBaseline: TextBaseline.alphabetic),
1736 textAlignVertical: TextAlignVertical.center, 1739 textAlignVertical: TextAlignVertical.center,
1737 maxLines: 5, 1740 maxLines: 5,
1738 - maxLength: 25, 1741 + maxLength: 100,
1739 decoration: InputDecoration( 1742 decoration: InputDecoration(
1740 hintText: "请输入备注或点击快捷选择标签", 1743 hintText: "请输入备注或点击快捷选择标签",
1741 hintStyle: TextStyle( 1744 hintStyle: TextStyle(
@@ -1966,7 +1969,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -1966,7 +1969,7 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
1966 "1" 1969 "1"
1967 ? //判断是否在线预订 1970 ? //判断是否在线预订
1968 await _notebookDetailChangeModel 1971 await _notebookDetailChangeModel
1969 - .updateOnlineReserveInfo(context) 1972 + .updateOnlineReserveInfo(context, nameStr)
1970 : await _notebookDetailChangeModel 1973 : await _notebookDetailChangeModel
1971 .setReserveInfo(context, nameStr); 1974 .setReserveInfo(context, nameStr);
1972 if (ObjectUtil.isNotEmpty(_model.row) || 1975 if (ObjectUtil.isNotEmpty(_model.row) ||
@@ -674,8 +674,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -674,8 +674,8 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
674 } 674 }
675 } 675 }
676 } 676 }
677 - if (currentRemark.length > 25) {  
678 - currentRemark = currentRemark.substring(0, 25); 677 + if (currentRemark.length > 100) {
  678 + currentRemark = currentRemark.substring(0, 100);
679 } 679 }
680 state(() { 680 state(() {
681 _cusdemController.text = currentRemark; 681 _cusdemController.text = currentRemark;
@@ -760,7 +760,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> { @@ -760,7 +760,7 @@ class NotebookDetailPageState extends State<NotebookDetailPage> {
760 textBaseline: TextBaseline.alphabetic), 760 textBaseline: TextBaseline.alphabetic),
761 textAlignVertical: TextAlignVertical.center, 761 textAlignVertical: TextAlignVertical.center,
762 maxLines: 5, 762 maxLines: 5,
763 - maxLength: 25, 763 + maxLength: 100,
764 decoration: InputDecoration( 764 decoration: InputDecoration(
765 hintText: "请输入备注或点击快捷选择标签", 765 hintText: "请输入备注或点击快捷选择标签",
766 hintStyle: TextStyle( 766 hintStyle: TextStyle(
@@ -318,9 +318,9 @@ class SelectTableFPageState extends State<SelectTableFPage> { @@ -318,9 +318,9 @@ class SelectTableFPageState extends State<SelectTableFPage> {
318 currentArea = '全部'; 318 currentArea = '全部';
319 _chooseTableModel.currentTables = _chooseTableModel.tablesAll; 319 _chooseTableModel.currentTables = _chooseTableModel.tablesAll;
320 } 320 }
321 - if (areas.length == 1) {  
322 - currentArea = areaTableMap.keys.first;  
323 - } 321 + // if (areas.length == 1) {
  322 + // currentArea = areaTableMap.keys.first;
  323 + // }
324 } 324 }
325 325
326 _chooseTableModel.pageState = PageState.Success; 326 _chooseTableModel.pageState = PageState.Success;
@@ -105,6 +105,7 @@ class InvicationPageState extends State<InvicationPage> @@ -105,6 +105,7 @@ class InvicationPageState extends State<InvicationPage>
105 bool needBack = false; 105 bool needBack = false;
106 bool needBlack = false; 106 bool needBlack = false;
107 bool needHistory = false; 107 bool needHistory = false;
  108 + bool needWechat = false;
108 String youhui = '选择优惠'; 109 String youhui = '选择优惠';
109 ScrollController scrollController = ScrollController(); 110 ScrollController scrollController = ScrollController();
110 final GlobalKey botGlobalKey = GlobalKey(); 111 final GlobalKey botGlobalKey = GlobalKey();
@@ -120,7 +121,11 @@ class InvicationPageState extends State<InvicationPage> @@ -120,7 +121,11 @@ class InvicationPageState extends State<InvicationPage>
120 if (_nameNode.hasFocus) { 121 if (_nameNode.hasFocus) {
121 showOverlay(context); 122 showOverlay(context);
122 } else { 123 } else {
123 - if (!needBack && !needBlack && !needHistory && !_phoneNode.hasFocus) { 124 + if (!needBack &&
  125 + !needBlack &&
  126 + !needHistory &&
  127 + !_phoneNode.hasFocus &&
  128 + !needWechat) {
124 _showConfirmWidget(); 129 _showConfirmWidget();
125 } 130 }
126 removeOverlay(); 131 removeOverlay();
@@ -132,7 +137,11 @@ class InvicationPageState extends State<InvicationPage> @@ -132,7 +137,11 @@ class InvicationPageState extends State<InvicationPage>
132 showOverlay(context); 137 showOverlay(context);
133 Scrollable.ensureVisible(botGlobalKey.currentContext); 138 Scrollable.ensureVisible(botGlobalKey.currentContext);
134 } else { 139 } else {
135 - if (!needBack && !needBlack && !needHistory && !_nameNode.hasFocus) { 140 + if (!needBack &&
  141 + !needBlack &&
  142 + !needHistory &&
  143 + !_nameNode.hasFocus &&
  144 + !needWechat) {
136 _showConfirmWidget(); 145 _showConfirmWidget();
137 } 146 }
138 147
@@ -181,7 +190,12 @@ class InvicationPageState extends State<InvicationPage> @@ -181,7 +190,12 @@ class InvicationPageState extends State<InvicationPage>
181 } 190 }
182 191
183 _showConfirmWidget( 192 _showConfirmWidget(
184 - {needBack = false, needSex = false, needHistory = false, int index}) { 193 + {needBack = false,
  194 + needSex = false,
  195 + needHistory = false,
  196 + needWechat = false,
  197 + int index,
  198 + VoidCallback callback}) {
185 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘 199 FocusScope.of(context).requestFocus(FocusNode()); //点击空白处隐藏键盘
186 String phone = ''; 200 String phone = '';
187 String name = ''; 201 String name = '';
@@ -223,59 +237,78 @@ class InvicationPageState extends State<InvicationPage> @@ -223,59 +237,78 @@ class InvicationPageState extends State<InvicationPage>
223 if (needBlack) { 237 if (needBlack) {
224 needBlack = false; 238 needBlack = false;
225 } 239 }
  240 + if (needWechat) {
  241 + needWechat = false;
  242 + callback();
  243 + }
  244 +
226 if (_baseIndoProvider.phoneController.text.trim().length > 0) { 245 if (_baseIndoProvider.phoneController.text.trim().length > 0) {
227 _baseIndoProvider.phoneController.text = oldPhone; 246 _baseIndoProvider.phoneController.text = oldPhone;
228 } 247 }
229 if (nameStr != null && nameStr.trim().length > 0) { 248 if (nameStr != null && nameStr.trim().length > 0) {
230 nameStr = oldName; 249 nameStr = oldName;
  250 +
231 for (var item in _baseIndoProvider.sexList) { 251 for (var item in _baseIndoProvider.sexList) {
232 if (item['select']) { 252 if (item['select']) {
233 if (nameStr != null && nameStr != '') { 253 if (nameStr != null && nameStr != '') {
234 _addNameSuffix(nameStr, item['title']); 254 _addNameSuffix(nameStr, item['title']);
  255 + } else {
  256 + _baseIndoProvider.nameController.text = '';
235 } 257 }
236 } 258 }
237 } 259 }
238 } 260 }
239 setState(() {}); 261 setState(() {});
240 } 262 }
241 - }, rCallback: () { 263 + }, rCallback: () async {
242 showPhoneHistory = false; 264 showPhoneHistory = false;
243 - if (needBack) {  
244 - needBack = false;  
245 - Navigator.of(context).pop();  
246 - }  
247 - if (needSex) {  
248 - needSex = false;  
249 - }  
250 - if (needHistory) {  
251 - setState(() {  
252 - showPhoneHistory = false;  
253 - _baseIndoProvider.phoneController.text =  
254 - _baseIndoProvider.userHistorys[index].phone != null  
255 - ? _baseIndoProvider.userHistorys[index].phone  
256 - : '';  
257 - // _homeEnterModel.nameController.text =  
258 - // _homeEnterModel  
259 - // .userHistorys[index].rname +  
260 - // _nameSuffix();  
261 - _addNameSuffix(  
262 - _baseIndoProvider.userHistorys[index].rname, _nameSuffix());  
263 - nameStr = _baseIndoProvider.userHistorys[index].rname;  
264 - _phoneNode.unfocus();  
265 - _baseIndoProvider.userHistorys.clear();  
266 - });  
267 - needHistory = false;  
268 - }  
269 - if (needBlack) {  
270 - needBlack = false; 265 + if (needWechat) {
  266 + needWechat = false;
  267 + await _updateReserve();
  268 + callback();
  269 + } else {
  270 + if (needBack) {
  271 + needBack = false;
  272 + Navigator.of(context).pop();
  273 + }
  274 + if (needSex) {
  275 + needSex = false;
  276 + }
  277 + if (needHistory) {
  278 + setState(() {
  279 + showPhoneHistory = false;
  280 + _baseIndoProvider.phoneController.text =
  281 + _baseIndoProvider.userHistorys[index].phone != null
  282 + ? _baseIndoProvider.userHistorys[index].phone
  283 + : '';
  284 + // _homeEnterModel.nameController.text =
  285 + // _homeEnterModel
  286 + // .userHistorys[index].rname +
  287 + // _nameSuffix();
  288 + _addNameSuffix(
  289 + _baseIndoProvider.userHistorys[index].rname, _nameSuffix());
  290 + nameStr = _baseIndoProvider.userHistorys[index].rname;
  291 + _phoneNode.unfocus();
  292 + _baseIndoProvider.userHistorys.clear();
  293 + });
  294 + needHistory = false;
  295 + }
  296 + if (needBlack) {
  297 + needBlack = false;
  298 + }
  299 +
  300 + _updateReserve();
271 } 301 }
272 - _updateReserve();  
273 }); 302 });
274 } else { 303 } else {
275 if (needBack) { 304 if (needBack) {
276 needBack = false; 305 needBack = false;
277 Navigator.of(context).pop(); 306 Navigator.of(context).pop();
278 } 307 }
  308 + if (needWechat) {
  309 + needWechat = false;
  310 + callback();
  311 + }
279 } 312 }
280 } 313 }
281 314
@@ -2114,92 +2147,111 @@ class InvicationPageState extends State<InvicationPage> @@ -2114,92 +2147,111 @@ class InvicationPageState extends State<InvicationPage>
2114 ScreenUtil().setWidth(40)), 2147 ScreenUtil().setWidth(40)),
2115 child: Column(children: [ 2148 child: Column(children: [
2116 RoundButton( 2149 RoundButton(
2117 - text: '微信通知',  
2118 - width: double.infinity,  
2119 - height: ScreenUtil().setWidth(84),  
2120 - gradientStart: MyColours.color_199095,  
2121 - gradientEnd: MyColours.color_199095,  
2122 - textColor: MyColours.color_ffffff,  
2123 - fontSize: 34,  
2124 - radius: ScreenUtil().setWidth(10),  
2125 - isBold: false,  
2126 - onPressed: () async {  
2127 - // Uint8List image = await _getImage();  
2128 - print(widget.rid);  
2129 - print(Provider.of<UserModel>(context, listen: false)  
2130 - .user  
2131 - .openid);  
2132 - // if (ObjectUtil.isEmpty(  
2133 - // _baseIndoProvider.baseInfoSunModel)) {  
2134 - // Utils.showToast('请输入个人资料');  
2135 - // return;  
2136 - // }  
2137 - // if (ObjectUtil.isEmpty(  
2138 - // _baseIndoProvider.baseInfoSunModel.name)) {  
2139 - // Utils.showToast('请填写您的姓名');  
2140 - // return;  
2141 - // }  
2142 - if (ObjectUtil.isEmpty(_baseIndoProvider.baseInfoSunModel) ||  
2143 - ObjectUtil.isEmpty(  
2144 - _baseIndoProvider.baseInfoSunModel.phone)) {  
2145 - Utils.showToast('请填写您的联系电话');  
2146 - return;  
2147 - }  
2148 - // if (ObjectUtil.isEmpty(  
2149 - // _baseIndoProvider.baseInfoSunModel.position)) {  
2150 - // Utils.showToast('请填写您在餐厅中的职位');  
2151 - // return;  
2152 - // }  
2153 - // if (ObjectUtil.isEmpty(  
2154 - // _baseIndoProvider.baseInfoSunModel.phone)) {  
2155 - // Utils.showToast('请上传您的头像');  
2156 - // return;  
2157 - // }  
2158 - // if (ObjectUtil.isEmpty(  
2159 - // _baseIndoProvider.baseInfoSunModel.qrcode)) {  
2160 - // Utils.showToast('请上传您的微信二维码');  
2161 - // return;  
2162 - // }  
2163 -  
2164 - // if (!couponProvider.hasModify && youhui != '选择优惠') {  
2165 - if (youhui != '选择优惠') {  
2166 - Map<String, String> params = {  
2167 - "rid": widget.rid,  
2168 - "aid":  
2169 - '${couponProvider.couponListSelect[couponSelectIndex].id}'  
2170 - };  
2171 - bool isSuc = await couponProvider.setActivityAsReserve(  
2172 - context, params);  
2173 - if (isSuc) {  
2174 - couponProvider.hasModify = true;  
2175 -  
2176 - bool isSuccess = await Utils.goShareInvicationToWeChat(  
2177 - widget.rid,  
2178 - Provider.of<UserModel>(context, listen: false)  
2179 - .user  
2180 - .openid);  
2181 - print(isSuccess);  
2182 - if (isSuccess) {  
2183 - _addForward(); 2150 + text: '微信通知',
  2151 + width: double.infinity,
  2152 + height: ScreenUtil().setWidth(84),
  2153 + gradientStart: MyColours.color_199095,
  2154 + gradientEnd: MyColours.color_199095,
  2155 + textColor: MyColours.color_ffffff,
  2156 + fontSize: 34,
  2157 + radius: ScreenUtil().setWidth(10),
  2158 + isBold: false,
  2159 + onPressed: () async {
  2160 + if (_nameNode.hasFocus || _phoneNode.hasFocus) {
  2161 + needWechat = true;
  2162 + _showConfirmWidget(
  2163 + needWechat: true,
  2164 + callback: () async {
  2165 + if (ObjectUtil.isEmpty(
  2166 + _baseIndoProvider.baseInfoSunModel) ||
  2167 + ObjectUtil.isEmpty(
  2168 + _baseIndoProvider.baseInfoSunModel.phone)) {
  2169 + Utils.showToast('请填写经理的联系电话');
  2170 + return;
  2171 + }
  2172 + if (youhui != '选择优惠') {
  2173 + Map<String, String> params = {
  2174 + "rid": widget.rid,
  2175 + "aid":
  2176 + '${couponProvider.couponListSelect[couponSelectIndex].id}'
  2177 + };
  2178 + bool isSuc = await couponProvider
  2179 + .setActivityAsReserve(context, params);
  2180 + if (isSuc) {
  2181 + couponProvider.hasModify = true;
  2182 +
  2183 + bool isSuccess =
  2184 + await Utils.goShareInvicationToWeChat(
  2185 + context,
  2186 + widget.rid,
  2187 + Provider.of<UserModel>(context,
  2188 + listen: false)
  2189 + .user
  2190 + .openid);
  2191 + print(isSuccess);
  2192 + if (isSuccess) {
  2193 + _addForward();
  2194 + }
  2195 + }
  2196 + } else {
  2197 + bool isSuccess =
  2198 + await Utils.goShareInvicationToWeChat(
  2199 + context,
  2200 + widget.rid,
  2201 + Provider.of<UserModel>(context,
  2202 + listen: false)
  2203 + .user
  2204 + .openid);
  2205 + if (isSuccess) {
  2206 + _addForward();
  2207 + }
  2208 + }
  2209 + });
  2210 + removeOverlay();
  2211 + } else {
  2212 + if (ObjectUtil.isEmpty(
  2213 + _baseIndoProvider.baseInfoSunModel) ||
  2214 + ObjectUtil.isEmpty(
  2215 + _baseIndoProvider.baseInfoSunModel.phone)) {
  2216 + Utils.showToast('请填写经理的联系电话');
  2217 + return;
  2218 + }
  2219 + if (youhui != '选择优惠') {
  2220 + Map<String, String> params = {
  2221 + "rid": widget.rid,
  2222 + "aid":
  2223 + '${couponProvider.couponListSelect[couponSelectIndex].id}'
  2224 + };
  2225 + bool isSuc = await couponProvider.setActivityAsReserve(
  2226 + context, params);
  2227 + if (isSuc) {
  2228 + couponProvider.hasModify = true;
  2229 +
  2230 + bool isSuccess =
  2231 + await Utils.goShareInvicationToWeChat(
  2232 + context,
  2233 + widget.rid,
  2234 + Provider.of<UserModel>(context, listen: false)
  2235 + .user
  2236 + .openid);
  2237 + print(isSuccess);
  2238 + if (isSuccess) {
  2239 + _addForward();
  2240 + }
  2241 + }
  2242 + } else {
  2243 + bool isSuccess = await Utils.goShareInvicationToWeChat(
  2244 + context,
  2245 + widget.rid,
  2246 + Provider.of<UserModel>(context, listen: false)
  2247 + .user
  2248 + .openid);
  2249 + if (isSuccess) {
  2250 + _addForward();
  2251 + }
2184 } 2252 }
2185 - // couponProvider.couponsShow = [];  
2186 - // couponProvider.couponsShow  
2187 - // .addAll(couponProvider.coupons);  
2188 - // couponProvider.coupons = [];  
2189 - // couponProvider.notifyListeners();  
2190 - }  
2191 - } else {  
2192 - bool isSuccess = await Utils.goShareInvicationToWeChat(  
2193 - widget.rid,  
2194 - Provider.of<UserModel>(context, listen: false)  
2195 - .user  
2196 - .openid);  
2197 - if (isSuccess) {  
2198 - _addForward();  
2199 } 2253 }
2200 - }  
2201 - },  
2202 - ), 2254 + }),
2203 VEmptyView(20), 2255 VEmptyView(20),
2204 Stack(children: [ 2256 Stack(children: [
2205 Container( 2257 Container(
@@ -2218,27 +2270,33 @@ class InvicationPageState extends State<InvicationPage> @@ -2218,27 +2270,33 @@ class InvicationPageState extends State<InvicationPage>
2218 radius: ScreenUtil().setWidth(10), 2270 radius: ScreenUtil().setWidth(10),
2219 isBold: false, 2271 isBold: false,
2220 onPressed: () async { 2272 onPressed: () async {
2221 - if (reserverPhone == null || reserverPhone.isEmpty) {  
2222 - //跳转到录入联系人页面  
2223 - // String temp = await NavigatorUtil.goEditReserverPage(  
2224 - // context, widget.rid, name, sex,  
2225 - // needBtn: true);  
2226 - // if (temp != null) {  
2227 - // reserverPhone = temp;  
2228 - // }  
2229 - Utils.showToast('请输入客户手机号');  
2230 - } else if (!Utils.phoneRegExp(reserverPhone)) {  
2231 - Utils.showToast('手机号格式错误,请修改正确');  
2232 - //跳转到录入联系人页面  
2233 - // String temp = await NavigatorUtil.goEditReserverPage(  
2234 - // context, widget.rid, name, sex,  
2235 - // needBtn: true);  
2236 - // if (temp != null) {  
2237 - // reserverPhone = temp;  
2238 - // }  
2239 - } else {  
2240 - if (!couponProvider.sendSMS) {  
2241 - /* 2273 + if (_nameNode.hasFocus || _phoneNode.hasFocus) {
  2274 + needWechat = true;
  2275 + _showConfirmWidget(
  2276 + needWechat: true,
  2277 + callback: () async {
  2278 + if (reserverPhone == null ||
  2279 + reserverPhone.isEmpty) {
  2280 + //跳转到录入联系人页面
  2281 + // String temp = await NavigatorUtil.goEditReserverPage(
  2282 + // context, widget.rid, name, sex,
  2283 + // needBtn: true);
  2284 + // if (temp != null) {
  2285 + // reserverPhone = temp;
  2286 + // }
  2287 + Utils.showToast('请输入客户手机号');
  2288 + } else if (!Utils.phoneRegExp(reserverPhone)) {
  2289 + Utils.showToast('手机号格式错误,请修改正确');
  2290 + //跳转到录入联系人页面
  2291 + // String temp = await NavigatorUtil.goEditReserverPage(
  2292 + // context, widget.rid, name, sex,
  2293 + // needBtn: true);
  2294 + // if (temp != null) {
  2295 + // reserverPhone = temp;
  2296 + // }
  2297 + } else {
  2298 + if (!couponProvider.sendSMS) {
  2299 + /*
2242 String dateSoltStr = ''; 2300 String dateSoltStr = '';
2243 if (widget.dateSolt == '1') { 2301 if (widget.dateSolt == '1') {
2244 dateSoltStr = '早餐'; 2302 dateSoltStr = '早餐';
@@ -2280,28 +2338,110 @@ class InvicationPageState extends State<InvicationPage> @@ -2280,28 +2338,110 @@ class InvicationPageState extends State<InvicationPage>
2280 params['Strtext'] = user.sellername; 2338 params['Strtext'] = user.sellername;
2281 } 2339 }
2282 */ 2340 */
2283 - UserModel userModel =  
2284 - Provider.of<UserModel>(context, listen: false);  
2285 - Map<String, String> params = {  
2286 - "rid": widget.rid,  
2287 - "sid": userModel.user.sellerid  
2288 - };  
2289 - bool success = await couponProvider  
2290 - .sendSMSWxSendSms(context, params);  
2291 - print(success);  
2292 - // if (success) {  
2293 - // Utils.showToast('短信已经发送成功!');  
2294 - // } else {  
2295 - // Utils.showToast('发送次数太频繁!'); 2341 + UserModel userModel =
  2342 + Provider.of<UserModel>(context,
  2343 + listen: false);
  2344 + Map<String, String> params = {
  2345 + "rid": widget.rid,
  2346 + "sid": userModel.user.sellerid
  2347 + };
  2348 + bool success = await couponProvider
  2349 + .sendSMSWxSendSms(context, params);
  2350 + print(success);
  2351 + // if (success) {
  2352 + // Utils.showToast('短信已经发送成功!');
  2353 + // } else {
  2354 + // Utils.showToast('发送次数太频繁!');
  2355 + // }
  2356 + } else {
  2357 + Utils.showToast('短信已经发送成功!');
  2358 + }
  2359 + }
  2360 + });
  2361 + removeOverlay();
  2362 + } else {
  2363 + if (reserverPhone == null || reserverPhone.isEmpty) {
  2364 + //跳转到录入联系人页面
  2365 + // String temp = await NavigatorUtil.goEditReserverPage(
  2366 + // context, widget.rid, name, sex,
  2367 + // needBtn: true);
  2368 + // if (temp != null) {
  2369 + // reserverPhone = temp;
  2370 + // }
  2371 + Utils.showToast('请输入客户手机号');
  2372 + } else if (!Utils.phoneRegExp(reserverPhone)) {
  2373 + Utils.showToast('手机号格式错误,请修改正确');
  2374 + //跳转到录入联系人页面
  2375 + // String temp = await NavigatorUtil.goEditReserverPage(
  2376 + // context, widget.rid, name, sex,
  2377 + // needBtn: true);
  2378 + // if (temp != null) {
  2379 + // reserverPhone = temp;
2296 // } 2380 // }
2297 } else { 2381 } else {
2298 - Utils.showToast('短信已经发送成功!'); 2382 + if (!couponProvider.sendSMS) {
  2383 + /*
  2384 + String dateSoltStr = '';
  2385 + if (widget.dateSolt == '1') {
  2386 + dateSoltStr = '早餐';
  2387 + } else if (widget.dateSolt == '2') {
  2388 + dateSoltStr = '午餐';
  2389 + } else if (widget.dateSolt == '3') {
  2390 + dateSoltStr = '晚餐';
  2391 + }
  2392 + DateTime dateTimeTemp =
  2393 + DateTime.fromMillisecondsSinceEpoch(
  2394 + int.parse(widget.ddate) * 1000);
  2395 + String dateTimeStrTemp =
  2396 + "${Utils.addZeroNumber(dateTimeTemp.month)}月${Utils.addZeroNumber(dateTimeTemp.day)}日";
  2397 + Map<String, String> params = {
  2398 + "id": widget.rid,
  2399 + "uid": Provider.of<UserModel>(context,
  2400 + listen: false)
  2401 + .user
  2402 + .openid,
  2403 + "phone": widget.phone,
  2404 +
  2405 + // "Strtext": user.sellername +
  2406 + // dateTimeStrTemp +
  2407 + // dateSoltStr +
  2408 + // ',' +
  2409 + // '餐厅经理' +
  2410 + // _baseIndoProvider.baseInfoSunModel.name +
  2411 + // '已为您安排在' +
  2412 + // widget.tableInfo.replaceAll("\n", "")
  2413 + };
  2414 + if (ObjectUtil.isNotEmpty(_baseIndoProvider
  2415 + .baseInfoSunModel) &&
  2416 + ObjectUtil.isNotEmpty(_baseIndoProvider
  2417 + .baseInfoSunModel.name)) {
  2418 + params['Strtext'] = user.sellername +
  2419 + _baseIndoProvider
  2420 + .baseInfoSunModel.name;
  2421 + } else {
  2422 + params['Strtext'] = user.sellername;
  2423 + }
  2424 + */
  2425 + UserModel userModel = Provider.of<UserModel>(
  2426 + context,
  2427 + listen: false);
  2428 + Map<String, String> params = {
  2429 + "rid": widget.rid,
  2430 + "sid": userModel.user.sellerid
  2431 + };
  2432 + bool success = await couponProvider
  2433 + .sendSMSWxSendSms(context, params);
  2434 + print(success);
  2435 + // if (success) {
  2436 + // Utils.showToast('短信已经发送成功!');
  2437 + // } else {
  2438 + // Utils.showToast('发送次数太频繁!');
  2439 + // }
  2440 + } else {
  2441 + Utils.showToast('短信已经发送成功!');
  2442 + }
2299 } 2443 }
2300 } 2444 }
2301 -  
2302 - // _sendSms();  
2303 -  
2304 - // NavigatorUtil.goSmsPage(context, widget.rid);  
2305 }, 2445 },
2306 )), 2446 )),
2307 Positioned( 2447 Positioned(
@@ -5,6 +5,7 @@ import 'package:one_key/models/customer_list_model.dart'; @@ -5,6 +5,7 @@ import 'package:one_key/models/customer_list_model.dart';
5 import 'package:one_key/models/guest_info_model.dart'; 5 import 'package:one_key/models/guest_info_model.dart';
6 import 'package:one_key/models/user_history_entity.dart'; 6 import 'package:one_key/models/user_history_entity.dart';
7 import 'package:one_key/provider/customer_provider.dart'; 7 import 'package:one_key/provider/customer_provider.dart';
  8 +import 'package:one_key/provider/user_model.dart';
8 import 'package:one_key/res/colors.dart'; 9 import 'package:one_key/res/colors.dart';
9 import 'package:one_key/route/navigator_util.dart'; 10 import 'package:one_key/route/navigator_util.dart';
10 import 'package:one_key/utils/dialog_util.dart'; 11 import 'package:one_key/utils/dialog_util.dart';
@@ -52,6 +53,7 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> { @@ -52,6 +53,7 @@ class _MyCustomerDetailPageState extends State<MyCustomerDetailPage> {
52 53
53 _getGuestInfo() async { 54 _getGuestInfo() async {
54 Map<String, String> params = { 55 Map<String, String> params = {
  56 + "uid": Provider.of<UserModel>(context, listen: false).user.openid,
55 "id": widget.userHistoryEntity.id, 57 "id": widget.userHistoryEntity.id,
56 'phone': widget.userHistoryEntity.phone 58 'phone': widget.userHistoryEntity.phone
57 }; 59 };
@@ -78,13 +78,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -78,13 +78,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
78 } 78 }
79 } 79 }
80 } else if (customerProvider.index == 0) { 80 } else if (customerProvider.index == 0) {
81 - customerProvider.hydSelAll = true;  
82 - for (FilterBtnModel item in customerProvider.filterHydList) {  
83 - // item.select = true;  
84 - item.select = false;  
85 - } 81 + // customerProvider.hydSelAll = true;
  82 + // for (FilterBtnModel item in customerProvider.filterHydList) {
  83 + // item.select = true;
  84 + // // item.select = false;
  85 + // }
86 } 86 }
87 - _getContantData(); 87 + _getContantData(first: true);
88 } 88 }
89 }); 89 });
90 WidgetsBinding.instance.addPostFrameCallback((_) async { 90 WidgetsBinding.instance.addPostFrameCallback((_) async {
@@ -96,13 +96,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -96,13 +96,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
96 first = false; 96 first = false;
97 } 97 }
98 customerProvider.initData(); 98 customerProvider.initData();
99 - if (tabController.index == 0) {  
100 - customerProvider.hydSelAll = true;  
101 - for (FilterBtnModel item in customerProvider.filterHydList) {  
102 - // item.select = true;  
103 - item.select = false;  
104 - }  
105 - } 99 + // if (tabController.index == 0) {
  100 + // customerProvider.hydSelAll = true;
  101 + // for (FilterBtnModel item in customerProvider.filterHydList) {
  102 + // item.select = true;
  103 + // // item.select = false;
  104 + // }
  105 + // }
106 _getContantData(first: first); 106 _getContantData(first: first);
107 _filterLabelList(); 107 _filterLabelList();
108 }); 108 });
@@ -176,17 +176,54 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -176,17 +176,54 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
176 } 176 }
177 params['labelid'] = labels; 177 params['labelid'] = labels;
178 } 178 }
179 - if (customerProvider.controllerstime.text.trim().length > 0) {  
180 - params['stime'] = customerProvider.controllerstime.text;  
181 - }  
182 - if (customerProvider.controlleretime.text.trim().length > 0) {  
183 - params['etime'] = customerProvider.controlleretime.text;  
184 - } 179 +
185 if (customerProvider.controllernum.text.trim().length > 0) { 180 if (customerProvider.controllernum.text.trim().length > 0) {
186 params['reserve_num'] = customerProvider.controlleretime.text; 181 params['reserve_num'] = customerProvider.controlleretime.text;
187 params['reserve_sort'] = '${dropValue + 1}'; 182 params['reserve_sort'] = '${dropValue + 1}';
188 } 183 }
189 184
  185 + bool temp = customerProvider.filterDayList.any((value) {
  186 + return value.select == true;
  187 + });
  188 + if (temp == true) {
  189 + if (customerProvider.controllernum.text.trim().length == 0) {
  190 + Utils.showToast('请输入多少次预订');
  191 + return;
  192 + }
  193 + String dayid = '';
  194 + for (FilterBtnModel item in customerProvider.filterDayList) {
  195 + if (item.select) {
  196 + dayid = item.id;
  197 + }
  198 + }
  199 +
  200 + params['reserve_date'] = dayid;
  201 + if (customerProvider.controllernum.text.trim().length > 0) {
  202 + params['reserve_num'] = customerProvider.controlleretime.text;
  203 + params['reserve_sort'] = '${dropValue + 1}';
  204 + }
  205 + } else {
  206 + if (customerProvider.controllernum.text.trim().length > 0) {
  207 + Utils.showToast('请选择7天、30天、60天或者120天');
  208 + return;
  209 + }
  210 + if (customerProvider.controllerstime.text.trim().length > 0 &&
  211 + customerProvider.controlleretime.text.trim().length == 0) {
  212 + Utils.showToast('请输入结束天数');
  213 + return;
  214 + }
  215 + if (customerProvider.controllerstime.text.trim().length == 0 &&
  216 + customerProvider.controlleretime.text.trim().length > 0) {
  217 + Utils.showToast('请输入开始天数');
  218 + return;
  219 + }
  220 + if (customerProvider.controllerstime.text.trim().length > 0 &&
  221 + customerProvider.controlleretime.text.trim().length > 0) {
  222 + params['stime'] = customerProvider.controllerstime.text;
  223 + params['etime'] = customerProvider.controlleretime.text;
  224 + }
  225 + }
  226 +
190 // params['reserve_date'] XX天内,例:30 227 // params['reserve_date'] XX天内,例:30
191 // params['reserve_num'] 时间内预定次数 228 // params['reserve_num'] 时间内预定次数
192 // params['reserve_sort'] 1 等于 2 小于 3 大于 229 // params['reserve_sort'] 1 等于 2 小于 3 大于
@@ -509,26 +546,83 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -509,26 +546,83 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
509 in customerProvider.filterLabelList) { 546 in customerProvider.filterLabelList) {
510 item.select = false; 547 item.select = false;
511 } 548 }
  549 + for (FilterBtnModel item
  550 + in customerProvider.filterDayList) {
  551 + item.select = false;
  552 + }
512 customerProvider.controllerstime.text = ''; 553 customerProvider.controllerstime.text = '';
513 customerProvider.controlleretime.text = ''; 554 customerProvider.controlleretime.text = '';
514 customerProvider.controllernum.text = ''; 555 customerProvider.controllernum.text = '';
515 dropValue = 0; 556 dropValue = 0;
516 }); 557 });
517 }, onPressedComplete: () { 558 }, onPressedComplete: () {
  559 + bool temp = customerProvider.filterDayList.any((value) {
  560 + return value.select == true;
  561 + });
  562 + if (temp == true) {
  563 + if (customerProvider.controllernum.text.trim().length ==
  564 + 0) {
  565 + Utils.showToast('请输入多少次预订');
  566 + return;
  567 + }
  568 + } else {
  569 + if (customerProvider.controllernum.text.trim().length >
  570 + 0) {
  571 + Utils.showToast('请选择7天、30天、60天或者120天');
  572 + return;
  573 + }
  574 + if (customerProvider.controllerstime.text.trim().length >
  575 + 0 &&
  576 + customerProvider.controlleretime.text.trim().length ==
  577 + 0) {
  578 + Utils.showToast('请输入结束天数');
  579 + return;
  580 + }
  581 + if (customerProvider.controllerstime.text.trim().length ==
  582 + 0 &&
  583 + customerProvider.controlleretime.text.trim().length >
  584 + 0) {
  585 + Utils.showToast('请输入开始天数');
  586 + return;
  587 + }
  588 + }
518 Navigator.of(context).pop(); 589 Navigator.of(context).pop();
519 - for (FilterBtnModel value  
520 - in customerProvider.filterHydList) {  
521 - if (value.select) {  
522 - if (value.title == '活跃') {  
523 - tabController.index = 1;  
524 - customerProvider.index = 1;  
525 - } else if (value.title == '沉睡') {  
526 - tabController.index = 2;  
527 - customerProvider.index = 2;  
528 - } else if (value.title == '流失') {  
529 - tabController.index = 3;  
530 - customerProvider.index = 3; 590 + if (customerProvider.hydSelAll) {
  591 + //全选,默认全部
  592 + tabController.index = 0;
  593 + customerProvider.index = 0;
  594 + } else {
  595 + int tag = 0; //有几个选中的项目
  596 + for (FilterBtnModel value
  597 + in customerProvider.filterHydList) {
  598 + if (value.select) {
  599 + tag++;
  600 + }
  601 + }
  602 + if (tag == 0) {
  603 + //全不选,默认全部
  604 + tabController.index = 0;
  605 + customerProvider.index = 0;
  606 + } else if (tag == 1) {
  607 + for (FilterBtnModel value
  608 + in customerProvider.filterHydList) {
  609 + if (value.select) {
  610 + if (value.title == '活跃') {
  611 + tabController.index = 1;
  612 + customerProvider.index = 1;
  613 + } else if (value.title == '沉睡') {
  614 + tabController.index = 2;
  615 + customerProvider.index = 2;
  616 + } else if (value.title == '流失') {
  617 + tabController.index = 3;
  618 + customerProvider.index = 3;
  619 + }
  620 + }
531 } 621 }
  622 + } else if (tag == 2) {
  623 + //选中2个的,默认全部
  624 + tabController.index = 0;
  625 + customerProvider.index = 0;
532 } 626 }
533 } 627 }
534 setState(() { 628 setState(() {
@@ -536,10 +630,29 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -536,10 +630,29 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
536 }); 630 });
537 _getContantData(); 631 _getContantData();
538 }, tapWhiteBack: () { 632 }, tapWhiteBack: () {
539 - // Navigator.of(context).pop();  
540 - // setState(() {  
541 - // showFilter = false;  
542 - // }); 633 + Navigator.of(context).pop();
  634 + setState(() {
  635 + showFilter = false;
  636 + });
  637 +
  638 + customerProvider.hydSelAll = false;
  639 + for (FilterBtnModel item
  640 + in customerProvider.filterHydList) {
  641 + item.select = false;
  642 + }
  643 + customerProvider.labelSelAll = false;
  644 + for (FilterBtnModel item
  645 + in customerProvider.filterLabelList) {
  646 + item.select = false;
  647 + }
  648 + for (FilterBtnModel item
  649 + in customerProvider.filterDayList) {
  650 + item.select = false;
  651 + }
  652 + customerProvider.controllerstime.text = '';
  653 + customerProvider.controlleretime.text = '';
  654 + customerProvider.controllernum.text = '';
  655 + dropValue = 0;
543 }); 656 });
544 } 657 }
545 }, 658 },
@@ -588,14 +701,29 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -588,14 +701,29 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
588 backgroundColor: Colors.transparent, 701 backgroundColor: Colors.transparent,
589 // resizeToAvoidBottomInset: false, 702 // resizeToAvoidBottomInset: false,
590 body: StatefulBuilder(builder: (context, state) { 703 body: StatefulBuilder(builder: (context, state) {
591 - return GestureDetector(  
592 - // behavior: HitTestBehavior.opaque,  
593 - onTap: tapWhiteBack,  
594 - child: _filterWidget( 704 + return Column(
  705 + children: [
  706 + GestureDetector(
  707 + behavior: HitTestBehavior.opaque,
  708 + onTap: tapWhiteBack,
  709 + // onTap: () {
  710 + // print('object');
  711 + // },
  712 + child: Container(
  713 + height: ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) +
  714 + ScreenUtil.statusBarHeight,
  715 + // width: s,
  716 + width: ScreenUtil.screenWidthDp,
  717 + // color: Colors.red,
  718 + )),
  719 + Expanded(
  720 + child: _filterWidget(
595 state, 721 state,
596 onPressedReset, 722 onPressedReset,
597 onPressedComplete, 723 onPressedComplete,
598 - )); 724 + ))
  725 + ],
  726 + );
599 })); 727 }));
600 }); 728 });
601 } 729 }
@@ -652,34 +780,34 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -652,34 +780,34 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
652 crossAxisAlignment: CrossAxisAlignment.start, 780 crossAxisAlignment: CrossAxisAlignment.start,
653 children: [ 781 children: [
654 Row( 782 Row(
655 - // mainAxisAlignment: MainAxisAlignment.spaceBetween, 783 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
656 children: [ 784 children: [
657 _textWidget('活跃度', MyColours.color_333333, FontWeight.bold, 28), 785 _textWidget('活跃度', MyColours.color_333333, FontWeight.bold, 28),
658 - // GestureDetector(  
659 - // onTap: () {  
660 - // state(() {  
661 - // customerProvider.hydSelAll = !customerProvider.hydSelAll;  
662 - // if (customerProvider.hydSelAll) {  
663 - // for (FilterBtnModel item  
664 - // in customerProvider.filterHydList) {  
665 - // item.select = true;  
666 - // }  
667 - // } else {  
668 - // for (FilterBtnModel item  
669 - // in customerProvider.filterHydList) {  
670 - // item.select = false;  
671 - // }  
672 - // }  
673 - // });  
674 - // },  
675 - // child: Container(  
676 - // color: Colors.white,  
677 - // height: ScreenUtil().setWidth(40),  
678 - // alignment: Alignment.center,  
679 - // padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),  
680 - // child: _textWidget(customerProvider.hydSelAll ? '全不选' : '全选',  
681 - // MyColours.color_199095, FontWeight.normal, 24)),  
682 - // ) 786 + GestureDetector(
  787 + onTap: () {
  788 + state(() {
  789 + customerProvider.hydSelAll = !customerProvider.hydSelAll;
  790 + if (customerProvider.hydSelAll) {
  791 + for (FilterBtnModel item
  792 + in customerProvider.filterHydList) {
  793 + item.select = true;
  794 + }
  795 + } else {
  796 + for (FilterBtnModel item
  797 + in customerProvider.filterHydList) {
  798 + item.select = false;
  799 + }
  800 + }
  801 + });
  802 + },
  803 + child: Container(
  804 + color: Colors.white,
  805 + height: ScreenUtil().setWidth(40),
  806 + alignment: Alignment.center,
  807 + padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),
  808 + child: _textWidget(customerProvider.hydSelAll ? '全不选' : '全选',
  809 + MyColours.color_199095, FontWeight.normal, 24)),
  810 + )
683 ], 811 ],
684 ), 812 ),
685 VEmptyView(30), 813 VEmptyView(30),
@@ -688,21 +816,22 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -688,21 +816,22 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
688 runSpacing: ScreenUtil().setWidth(20), 816 runSpacing: ScreenUtil().setWidth(20),
689 children: _buildFilterItem(customerProvider.filterHydList, false, 817 children: _buildFilterItem(customerProvider.filterHydList, false,
690 (FilterBtnModel item) { 818 (FilterBtnModel item) {
691 - // state(() {  
692 - // item.select = !item.select; 819 + state(() {
  820 + item.select = !item.select;
693 821
  822 + // }
  823 + });
  824 + customerProvider.getCheckhydSelAll();
  825 + // for (FilterBtnModel value in customerProvider.filterHydList) {
  826 + // value.select = false;
  827 + // }
  828 + // for (FilterBtnModel value in customerProvider.filterHydList) {
  829 + // if (item.id == value.id) {
  830 + // state(() {
  831 + // value.select = true;
  832 + // });
694 // } 833 // }
695 - // });  
696 - for (FilterBtnModel value in customerProvider.filterHydList) {  
697 - value.select = false;  
698 - }  
699 - for (FilterBtnModel value in customerProvider.filterHydList) {  
700 - if (item.id == value.id) {  
701 - state(() {  
702 - value.select = true;  
703 - });  
704 - }  
705 - } 834 + // }
706 })), 835 })),
707 ], 836 ],
708 ); 837 );
@@ -756,6 +885,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -756,6 +885,7 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
756 state(() { 885 state(() {
757 item.select = !item.select; 886 item.select = !item.select;
758 }); 887 });
  888 + customerProvider.getChecklabelSelAll();
759 })), 889 })),
760 ], 890 ],
761 ); 891 );
@@ -847,31 +977,46 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -847,31 +977,46 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
847 children: [ 977 children: [
848 Expanded( 978 Expanded(
849 child: _textFeildWidget(customerProvider.controllerstime, 979 child: _textFeildWidget(customerProvider.controllerstime,
850 - customerProvider.stimeFocus)), 980 + customerProvider.stimeFocus, state)),
851 HEmptyView(10), 981 HEmptyView(10),
852 _textWidget('至', MyColours.color_199095, FontWeight.normal, 24), 982 _textWidget('至', MyColours.color_199095, FontWeight.normal, 24),
853 HEmptyView(10), 983 HEmptyView(10),
854 Expanded( 984 Expanded(
855 child: _textFeildWidget(customerProvider.controlleretime, 985 child: _textFeildWidget(customerProvider.controlleretime,
856 - customerProvider.etimeFocus)), 986 + customerProvider.etimeFocus, state)),
857 ], 987 ],
858 ), 988 ),
859 VEmptyView(30), 989 VEmptyView(30),
860 Wrap( 990 Wrap(
861 spacing: ScreenUtil().setWidth(20), 991 spacing: ScreenUtil().setWidth(20),
862 runSpacing: ScreenUtil().setWidth(20), 992 runSpacing: ScreenUtil().setWidth(20),
863 - children: _buildFilterItem(customerProvider.filterDayList, true,  
864 - (FilterBtnModel item) {  
865 - if (customerProvider.stimeFocus.hasFocus) {  
866 - customerProvider.controllerstime.text = item.id;  
867 - }  
868 - if (customerProvider.etimeFocus.hasFocus) {  
869 - customerProvider.controlleretime.text = item.id;  
870 - }  
871 - // state(() {  
872 - // item.select = !item.select;  
873 - // });  
874 - }, grayBack: true)), 993 + children: _buildFilterItem(
  994 + customerProvider.filterDayList,
  995 + true,
  996 + (FilterBtnModel item) {
  997 + // if (customerProvider.stimeFocus.hasFocus) {
  998 + // customerProvider.controllerstime.text = item.id;
  999 + // }
  1000 + // if (customerProvider.etimeFocus.hasFocus) {
  1001 + // customerProvider.controlleretime.text = item.id;
  1002 + // }
  1003 + customerProvider.controllerstime.text = '';
  1004 + customerProvider.controlleretime.text = '';
  1005 + for (FilterBtnModel value in customerProvider.filterDayList) {
  1006 + value.select = false;
  1007 + }
  1008 + for (FilterBtnModel value in customerProvider.filterDayList) {
  1009 + if (item.id == value.id) {
  1010 + state(() {
  1011 + value.select = true;
  1012 + });
  1013 + }
  1014 + }
  1015 + // state(() {
  1016 + // item.select = !item.select;
  1017 + // });
  1018 + },
  1019 + )),
875 VEmptyView(30), 1020 VEmptyView(30),
876 _textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24), 1021 _textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24),
877 VEmptyView(30), 1022 VEmptyView(30),
@@ -987,6 +1132,9 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -987,6 +1132,9 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
987 textInputAction: TextInputAction.done, 1132 textInputAction: TextInputAction.done,
988 1133
989 onChanged: (value) { 1134 onChanged: (value) {
  1135 + customerProvider.controllerstime.text = '';
  1136 + customerProvider.controlleretime.text = '';
  1137 + state(() {});
990 // setState(() {}); 1138 // setState(() {});
991 // _searchSellerLocation(); 1139 // _searchSellerLocation();
992 // customerProvider.searchData(value); 1140 // customerProvider.searchData(value);
@@ -1045,8 +1193,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -1045,8 +1193,8 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
1045 } 1193 }
1046 1194
1047 /// 高级筛选输入框 1195 /// 高级筛选输入框
1048 - Widget _textFeildWidget(  
1049 - TextEditingController controller, FocusNode focusNode) { 1196 + Widget _textFeildWidget(TextEditingController controller, FocusNode focusNode,
  1197 + StateSetter state) {
1050 return Container( 1198 return Container(
1051 padding: EdgeInsets.symmetric( 1199 padding: EdgeInsets.symmetric(
1052 horizontal: ScreenUtil().setWidth(20), 1200 horizontal: ScreenUtil().setWidth(20),
@@ -1085,6 +1233,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -1085,6 +1233,13 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
1085 textInputAction: TextInputAction.done, 1233 textInputAction: TextInputAction.done,
1086 1234
1087 onChanged: (value) { 1235 onChanged: (value) {
  1236 + for (FilterBtnModel value
  1237 + in customerProvider.filterDayList) {
  1238 + value.select = false;
  1239 + }
  1240 + customerProvider.controllernum.text = '';
  1241 + state(() {});
  1242 +
1088 // setState(() {}); 1243 // setState(() {});
1089 // _searchSellerLocation(); 1244 // _searchSellerLocation();
1090 // customerProvider.searchData(value); 1245 // customerProvider.searchData(value);
@@ -1113,10 +1268,12 @@ class _MyCustomerListPageState extends State<MyCustomerListPage> @@ -1113,10 +1268,12 @@ class _MyCustomerListPageState extends State<MyCustomerListPage>
1113 padding: EdgeInsets.symmetric( 1268 padding: EdgeInsets.symmetric(
1114 // horizontal: ScreenUtil().setWidth(30), 1269 // horizontal: ScreenUtil().setWidth(30),
1115 ), 1270 ),
1116 - // height: ScreenUtil().setWidth(100),  
1117 - margin: EdgeInsets.only(  
1118 - top: ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) +  
1119 - ScreenUtil.statusBarHeight), 1271 + height: ScreenUtil.screenHeightDp -
  1272 + ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) -
  1273 + ScreenUtil.statusBarHeight,
  1274 + // margin: EdgeInsets.only(
  1275 + // top: ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) +
  1276 + // ScreenUtil.statusBarHeight),
1120 color: Color.fromRGBO(00, 00, 00, 0.49), 1277 color: Color.fromRGBO(00, 00, 00, 0.49),
1121 child: Align( 1278 child: Align(
1122 alignment: Alignment.topCenter, 1279 alignment: Alignment.topCenter,
@@ -101,66 +101,80 @@ class _MyCustomerPageState extends State<MyCustomerPage> { @@ -101,66 +101,80 @@ class _MyCustomerPageState extends State<MyCustomerPage> {
101 101
102 ///活跃客户、沉睡客户、流失客户 102 ///活跃客户、沉睡客户、流失客户
103 Widget _percentWidget(String pnum, String btnTitle, String percent) { 103 Widget _percentWidget(String pnum, String btnTitle, String percent) {
104 - return Container(  
105 - color: MyColours.color_ffffff,  
106 - // height: ScreenUtil().setWidth(230),  
107 - width: (ScreenUtil.screenWidthDp - ScreenUtil().setWidth(20)) / 3,  
108 - height: (ScreenUtil.screenWidthDp - ScreenUtil().setWidth(20)) / 3,  
109 - child: Column(  
110 - mainAxisAlignment: MainAxisAlignment.center,  
111 - children: [  
112 - Row( 104 + return InkWell(
  105 + onTap: () async {
  106 + String index = '0';
  107 + if (btnTitle == '活跃客户') {
  108 + index = '1';
  109 + } else if (btnTitle == '沉睡客户') {
  110 + index = '2';
  111 + } else if (btnTitle == '流失客户') {
  112 + index = '3';
  113 + }
  114 + NavigatorUtil.goMyCustomerListPage(
  115 + context, FromPage.FromPageMyCustomer,
  116 + index: index);
  117 + },
  118 + child: Container(
  119 + color: MyColours.color_ffffff,
  120 + // height: ScreenUtil().setWidth(230),
  121 + width: (ScreenUtil.screenWidthDp - ScreenUtil().setWidth(20)) / 3,
  122 + height: (ScreenUtil.screenWidthDp - ScreenUtil().setWidth(20)) / 3,
  123 + child: Column(
113 mainAxisAlignment: MainAxisAlignment.center, 124 mainAxisAlignment: MainAxisAlignment.center,
114 children: [ 125 children: [
115 - Text(pnum,  
116 - style: TextStyle(  
117 - color: MyColours.color_199095,  
118 - fontSize: ScreenUtil().setSp(40),  
119 - fontWeight: FontWeight.bold)),  
120 - Text('位',  
121 - style: TextStyle(  
122 - color: MyColours.color_199095,  
123 - fontSize: ScreenUtil().setSp(24),  
124 - )) 126 + Row(
  127 + mainAxisAlignment: MainAxisAlignment.center,
  128 + children: [
  129 + Text(pnum,
  130 + style: TextStyle(
  131 + color: MyColours.color_199095,
  132 + fontSize: ScreenUtil().setSp(40),
  133 + fontWeight: FontWeight.bold)),
  134 + Text('位',
  135 + style: TextStyle(
  136 + color: MyColours.color_199095,
  137 + fontSize: ScreenUtil().setSp(24),
  138 + ))
  139 + ],
  140 + ),
  141 + VEmptyView(20),
  142 + RoundButton(
  143 + onPressed: () async {
  144 + String index = '0';
  145 + if (btnTitle == '活跃客户') {
  146 + index = '1';
  147 + } else if (btnTitle == '沉睡客户') {
  148 + index = '2';
  149 + } else if (btnTitle == '流失客户') {
  150 + index = '3';
  151 + }
  152 + NavigatorUtil.goMyCustomerListPage(
  153 + context, FromPage.FromPageMyCustomer,
  154 + index: index);
  155 + },
  156 + text: btnTitle,
  157 + fontSize: 24,
  158 + isBold: false,
  159 + textColor: MyColours.color_333333,
  160 + gradientStart: MyColours.color_ffffff,
  161 + gradientEnd: MyColours.color_ffffff,
  162 + borderColor: Color.fromRGBO(118, 118, 118, 1),
  163 + height: ScreenUtil().setWidth(45),
  164 + width: ScreenUtil().setWidth(160),
  165 + radius: ScreenUtil().setWidth(30),
  166 + ),
  167 + VEmptyView(16),
  168 + percent == null
  169 + ? SizedBox()
  170 + : Text('${percent}%',
  171 + style: TextStyle(
  172 + color: MyColours.color_199095,
  173 + fontSize: ScreenUtil().setSp(24),
  174 + )),
125 ], 175 ],
126 ), 176 ),
127 - VEmptyView(20),  
128 - RoundButton(  
129 - onPressed: () async {  
130 - String index = '0';  
131 - if (btnTitle == '活跃客户') {  
132 - index = '1';  
133 - } else if (btnTitle == '沉睡客户') {  
134 - index = '2';  
135 - } else if (btnTitle == '流失客户') {  
136 - index = '3';  
137 - }  
138 - NavigatorUtil.goMyCustomerListPage(  
139 - context, FromPage.FromPageMyCustomer,  
140 - index: index);  
141 - },  
142 - text: btnTitle,  
143 - fontSize: 24,  
144 - isBold: false,  
145 - textColor: MyColours.color_333333,  
146 - gradientStart: MyColours.color_ffffff,  
147 - gradientEnd: MyColours.color_ffffff,  
148 - borderColor: Color.fromRGBO(118, 118, 118, 1),  
149 - height: ScreenUtil().setWidth(45),  
150 - width: ScreenUtil().setWidth(160),  
151 - radius: ScreenUtil().setWidth(30),  
152 - ),  
153 - VEmptyView(16),  
154 - percent == null  
155 - ? SizedBox()  
156 - : Text('${percent}%',  
157 - style: TextStyle(  
158 - color: MyColours.color_199095,  
159 - fontSize: ScreenUtil().setSp(24),  
160 - )),  
161 - ],  
162 - ),  
163 - ); 177 + ));
164 } 178 }
165 179
166 @override 180 @override
@@ -78,13 +78,13 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -78,13 +78,13 @@ class _CustomerListPageState extends State<CustomerListPage>
78 } 78 }
79 } 79 }
80 } else if (customerProvider.index == 0) { 80 } else if (customerProvider.index == 0) {
81 - customerProvider.hydSelAll = true;  
82 - for (FilterBtnModel item in customerProvider.filterHydList) {  
83 - // item.select = true;  
84 - item.select = false;  
85 - } 81 + // customerProvider.hydSelAll = true;
  82 + // for (FilterBtnModel item in customerProvider.filterHydList) {
  83 + // item.select = true;
  84 + // // item.select = false;
  85 + // }
86 } 86 }
87 - _getContantData(); 87 + _getContantData(first: true);
88 } 88 }
89 }); 89 });
90 WidgetsBinding.instance.addPostFrameCallback((_) async { 90 WidgetsBinding.instance.addPostFrameCallback((_) async {
@@ -99,13 +99,13 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -99,13 +99,13 @@ class _CustomerListPageState extends State<CustomerListPage>
99 } 99 }
100 100
101 customerProvider.initData(); 101 customerProvider.initData();
102 - if (tabController.index == 0) {  
103 - customerProvider.hydSelAll = true;  
104 - for (FilterBtnModel item in customerProvider.filterHydList) {  
105 - // item.select = true;  
106 - item.select = false;  
107 - }  
108 - } 102 + // if (tabController.index == 0) {
  103 + // customerProvider.hydSelAll = true;
  104 + // for (FilterBtnModel item in customerProvider.filterHydList) {
  105 + // item.select = true;
  106 + // // item.select = false;
  107 + // }
  108 + // }
109 _getContantData(first: first); 109 _getContantData(first: first);
110 _filterLabelList(); 110 _filterLabelList();
111 _getSellerGuestManage(); 111 _getSellerGuestManage();
@@ -233,15 +233,53 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -233,15 +233,53 @@ class _CustomerListPageState extends State<CustomerListPage>
233 } 233 }
234 } 234 }
235 235
236 - if (customerProvider.controllerstime.text.trim().length > 0) {  
237 - params['stime'] = customerProvider.controllerstime.text;  
238 - }  
239 - if (customerProvider.controlleretime.text.trim().length > 0) {  
240 - params['etime'] = customerProvider.controlleretime.text;  
241 - }  
242 - if (customerProvider.controllernum.text.trim().length > 0) {  
243 - params['reserve_num'] = customerProvider.controlleretime.text;  
244 - params['reserve_sort'] = '${dropValue + 1}'; 236 + // if (customerProvider.controllerstime.text.trim().length > 0) {
  237 + // params['stime'] = customerProvider.controllerstime.text;
  238 + // }
  239 + // if (customerProvider.controlleretime.text.trim().length > 0) {
  240 + // params['etime'] = customerProvider.controlleretime.text;
  241 + // }
  242 +
  243 + bool temp = customerProvider.filterDayList.any((value) {
  244 + return value.select == true;
  245 + });
  246 + if (temp == true) {
  247 + if (customerProvider.controllernum.text.trim().length == 0) {
  248 + Utils.showToast('请输入多少次预订');
  249 + return;
  250 + }
  251 + String dayid = '';
  252 + for (FilterBtnModel item in customerProvider.filterDayList) {
  253 + if (item.select) {
  254 + dayid = item.id;
  255 + }
  256 + }
  257 +
  258 + params['reserve_date'] = dayid;
  259 + if (customerProvider.controllernum.text.trim().length > 0) {
  260 + params['reserve_num'] = customerProvider.controlleretime.text;
  261 + params['reserve_sort'] = '${dropValue + 1}';
  262 + }
  263 + } else {
  264 + if (customerProvider.controllernum.text.trim().length > 0) {
  265 + Utils.showToast('请选择7天、30天、60天或者120天');
  266 + return;
  267 + }
  268 + if (customerProvider.controllerstime.text.trim().length > 0 &&
  269 + customerProvider.controlleretime.text.trim().length == 0) {
  270 + Utils.showToast('请输入结束天数');
  271 + return;
  272 + }
  273 + if (customerProvider.controllerstime.text.trim().length == 0 &&
  274 + customerProvider.controlleretime.text.trim().length > 0) {
  275 + Utils.showToast('请输入开始天数');
  276 + return;
  277 + }
  278 + if (customerProvider.controllerstime.text.trim().length > 0 &&
  279 + customerProvider.controlleretime.text.trim().length > 0) {
  280 + params['stime'] = customerProvider.controllerstime.text;
  281 + params['etime'] = customerProvider.controlleretime.text;
  282 + }
245 } 283 }
246 284
247 await customerProvider.getCustomerBySeller(context, params); 285 await customerProvider.getCustomerBySeller(context, params);
@@ -564,26 +602,84 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -564,26 +602,84 @@ class _CustomerListPageState extends State<CustomerListPage>
564 in customerProvider.filterManageList) { 602 in customerProvider.filterManageList) {
565 item.select = false; 603 item.select = false;
566 } 604 }
  605 + for (FilterBtnModel item
  606 + in customerProvider.filterDayList) {
  607 + item.select = false;
  608 + }
567 customerProvider.controllerstime.text = ''; 609 customerProvider.controllerstime.text = '';
568 customerProvider.controlleretime.text = ''; 610 customerProvider.controlleretime.text = '';
569 customerProvider.controllernum.text = ''; 611 customerProvider.controllernum.text = '';
570 dropValue = 0; 612 dropValue = 0;
571 }); 613 });
572 }, onPressedComplete: () { 614 }, onPressedComplete: () {
  615 + bool temp = customerProvider.filterDayList.any((value) {
  616 + return value.select == true;
  617 + });
  618 + if (temp == true) {
  619 + if (customerProvider.controllernum.text.trim().length ==
  620 + 0) {
  621 + Utils.showToast('请输入多少次预订');
  622 + return;
  623 + }
  624 + } else {
  625 + if (customerProvider.controllernum.text.trim().length >
  626 + 0) {
  627 + Utils.showToast('请选择7天、30天、60天或者120天');
  628 + return;
  629 + }
  630 + if (customerProvider.controllerstime.text.trim().length >
  631 + 0 &&
  632 + customerProvider.controlleretime.text.trim().length ==
  633 + 0) {
  634 + Utils.showToast('请输入结束天数');
  635 + return;
  636 + }
  637 + if (customerProvider.controllerstime.text.trim().length ==
  638 + 0 &&
  639 + customerProvider.controlleretime.text.trim().length >
  640 + 0) {
  641 + Utils.showToast('请输入开始天数');
  642 + return;
  643 + }
  644 + }
  645 +
573 Navigator.of(context).pop(); 646 Navigator.of(context).pop();
574 - for (FilterBtnModel value  
575 - in customerProvider.filterHydList) {  
576 - if (value.select) {  
577 - if (value.title == '活跃') {  
578 - tabController.index = 1;  
579 - customerProvider.index = 1;  
580 - } else if (value.title == '沉睡') {  
581 - tabController.index = 2;  
582 - customerProvider.index = 2;  
583 - } else if (value.title == '流失') {  
584 - tabController.index = 3;  
585 - customerProvider.index = 3; 647 + if (customerProvider.hydSelAll) {
  648 + //全选,默认全部
  649 + tabController.index = 0;
  650 + customerProvider.index = 0;
  651 + } else {
  652 + int tag = 0; //有几个选中的项目
  653 + for (FilterBtnModel value
  654 + in customerProvider.filterHydList) {
  655 + if (value.select) {
  656 + tag++;
  657 + }
  658 + }
  659 + if (tag == 0) {
  660 + //全不选,默认全部
  661 + tabController.index = 0;
  662 + customerProvider.index = 0;
  663 + } else if (tag == 1) {
  664 + for (FilterBtnModel value
  665 + in customerProvider.filterHydList) {
  666 + if (value.select) {
  667 + if (value.title == '活跃') {
  668 + tabController.index = 1;
  669 + customerProvider.index = 1;
  670 + } else if (value.title == '沉睡') {
  671 + tabController.index = 2;
  672 + customerProvider.index = 2;
  673 + } else if (value.title == '流失') {
  674 + tabController.index = 3;
  675 + customerProvider.index = 3;
  676 + }
  677 + }
586 } 678 }
  679 + } else if (tag == 2) {
  680 + //选中2个的,默认全部
  681 + tabController.index = 0;
  682 + customerProvider.index = 0;
587 } 683 }
588 } 684 }
589 setState(() { 685 setState(() {
@@ -591,10 +687,28 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -591,10 +687,28 @@ class _CustomerListPageState extends State<CustomerListPage>
591 }); 687 });
592 _getContantData(); 688 _getContantData();
593 }, tapWhiteBack: () { 689 }, tapWhiteBack: () {
594 - // Navigator.of(context).pop();  
595 - // setState(() {  
596 - // showFilter = false;  
597 - // }); 690 + Navigator.of(context).pop();
  691 + setState(() {
  692 + showFilter = false;
  693 + });
  694 + customerProvider.hydSelAll = false;
  695 + for (FilterBtnModel item
  696 + in customerProvider.filterHydList) {
  697 + item.select = false;
  698 + }
  699 + customerProvider.labelSelAll = false;
  700 + for (FilterBtnModel item
  701 + in customerProvider.filterLabelList) {
  702 + item.select = false;
  703 + }
  704 + for (FilterBtnModel item
  705 + in customerProvider.filterDayList) {
  706 + item.select = false;
  707 + }
  708 + customerProvider.controllerstime.text = '';
  709 + customerProvider.controlleretime.text = '';
  710 + customerProvider.controllernum.text = '';
  711 + dropValue = 0;
598 }); 712 });
599 } 713 }
600 }, 714 },
@@ -643,14 +757,27 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -643,14 +757,27 @@ class _CustomerListPageState extends State<CustomerListPage>
643 backgroundColor: Colors.transparent, 757 backgroundColor: Colors.transparent,
644 // resizeToAvoidBottomInset: false, 758 // resizeToAvoidBottomInset: false,
645 body: StatefulBuilder(builder: (context, state) { 759 body: StatefulBuilder(builder: (context, state) {
646 - return GestureDetector(  
647 - // behavior: HitTestBehavior.opaque,  
648 - onTap: tapWhiteBack,  
649 - child: _filterWidget(  
650 - state,  
651 - onPressedReset,  
652 - onPressedComplete,  
653 - )); 760 + return Column(children: [
  761 + GestureDetector(
  762 + behavior: HitTestBehavior.opaque,
  763 + onTap: tapWhiteBack,
  764 + // onTap: () {
  765 + // print('object');
  766 + // },
  767 + child: Container(
  768 + height: ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) +
  769 + ScreenUtil.statusBarHeight,
  770 + // width: s,
  771 + width: ScreenUtil.screenWidthDp,
  772 + // color: Colors.red,
  773 + )),
  774 + Expanded(
  775 + child: _filterWidget(
  776 + state,
  777 + onPressedReset,
  778 + onPressedComplete,
  779 + ))
  780 + ]);
654 })); 781 }));
655 }); 782 });
656 } 783 }
@@ -714,6 +841,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -714,6 +841,7 @@ class _CustomerListPageState extends State<CustomerListPage>
714 state(() { 841 state(() {
715 item.select = !item.select; 842 item.select = !item.select;
716 }); 843 });
  844 + customerProvider.getCheckmanageSelAll();
717 })), 845 })),
718 ], 846 ],
719 ); 847 );
@@ -728,31 +856,31 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -728,31 +856,31 @@ class _CustomerListPageState extends State<CustomerListPage>
728 mainAxisAlignment: MainAxisAlignment.spaceBetween, 856 mainAxisAlignment: MainAxisAlignment.spaceBetween,
729 children: [ 857 children: [
730 _textWidget('活跃度', MyColours.color_333333, FontWeight.bold, 28), 858 _textWidget('活跃度', MyColours.color_333333, FontWeight.bold, 28),
731 - // GestureDetector(  
732 - // onTap: () {  
733 - // state(() {  
734 - // customerProvider.hydSelAll = !customerProvider.hydSelAll;  
735 - // if (customerProvider.hydSelAll) {  
736 - // for (FilterBtnModel item  
737 - // in customerProvider.filterHydList) {  
738 - // item.select = true;  
739 - // }  
740 - // } else {  
741 - // for (FilterBtnModel item  
742 - // in customerProvider.filterHydList) {  
743 - // item.select = false;  
744 - // }  
745 - // }  
746 - // });  
747 - // },  
748 - // child: Container(  
749 - // color: Colors.white,  
750 - // height: ScreenUtil().setWidth(40),  
751 - // alignment: Alignment.center,  
752 - // padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),  
753 - // child: _textWidget(customerProvider.hydSelAll ? '全不选' : '全选',  
754 - // MyColours.color_199095, FontWeight.normal, 24)),  
755 - // ) 859 + GestureDetector(
  860 + onTap: () {
  861 + state(() {
  862 + customerProvider.hydSelAll = !customerProvider.hydSelAll;
  863 + if (customerProvider.hydSelAll) {
  864 + for (FilterBtnModel item
  865 + in customerProvider.filterHydList) {
  866 + item.select = true;
  867 + }
  868 + } else {
  869 + for (FilterBtnModel item
  870 + in customerProvider.filterHydList) {
  871 + item.select = false;
  872 + }
  873 + }
  874 + });
  875 + },
  876 + child: Container(
  877 + color: Colors.white,
  878 + height: ScreenUtil().setWidth(40),
  879 + alignment: Alignment.center,
  880 + padding: EdgeInsets.only(left: ScreenUtil().setWidth(130)),
  881 + child: _textWidget(customerProvider.hydSelAll ? '全不选' : '全选',
  882 + MyColours.color_199095, FontWeight.normal, 24)),
  883 + )
756 ], 884 ],
757 ), 885 ),
758 VEmptyView(30), 886 VEmptyView(30),
@@ -761,19 +889,25 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -761,19 +889,25 @@ class _CustomerListPageState extends State<CustomerListPage>
761 runSpacing: ScreenUtil().setWidth(20), 889 runSpacing: ScreenUtil().setWidth(20),
762 children: _buildFilterItem(customerProvider.filterHydList, false, 890 children: _buildFilterItem(customerProvider.filterHydList, false,
763 (FilterBtnModel item) { 891 (FilterBtnModel item) {
  892 + state(() {
  893 + item.select = !item.select;
  894 +
  895 + // }
  896 + });
  897 + customerProvider.getCheckhydSelAll();
764 // state(() { 898 // state(() {
765 // item.select = !item.select; 899 // item.select = !item.select;
766 // }); 900 // });
767 - for (FilterBtnModel value in customerProvider.filterHydList) {  
768 - value.select = false;  
769 - }  
770 - for (FilterBtnModel value in customerProvider.filterHydList) {  
771 - if (item.id == value.id) {  
772 - state(() {  
773 - value.select = true;  
774 - });  
775 - }  
776 - } 901 + // for (FilterBtnModel value in customerProvider.filterHydList) {
  902 + // value.select = false;
  903 + // }
  904 + // for (FilterBtnModel value in customerProvider.filterHydList) {
  905 + // if (item.id == value.id) {
  906 + // state(() {
  907 + // value.select = true;
  908 + // });
  909 + // }
  910 + // }
777 })), 911 })),
778 ], 912 ],
779 ); 913 );
@@ -827,6 +961,7 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -827,6 +961,7 @@ class _CustomerListPageState extends State<CustomerListPage>
827 state(() { 961 state(() {
828 item.select = !item.select; 962 item.select = !item.select;
829 }); 963 });
  964 + customerProvider.getChecklabelSelAll();
830 })), 965 })),
831 ], 966 ],
832 ); 967 );
@@ -918,13 +1053,13 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -918,13 +1053,13 @@ class _CustomerListPageState extends State<CustomerListPage>
918 children: [ 1053 children: [
919 Expanded( 1054 Expanded(
920 child: _textFeildWidget(customerProvider.controllerstime, 1055 child: _textFeildWidget(customerProvider.controllerstime,
921 - customerProvider.stimeFocus)), 1056 + customerProvider.stimeFocus, state)),
922 HEmptyView(10), 1057 HEmptyView(10),
923 _textWidget('至', MyColours.color_199095, FontWeight.normal, 24), 1058 _textWidget('至', MyColours.color_199095, FontWeight.normal, 24),
924 HEmptyView(10), 1059 HEmptyView(10),
925 Expanded( 1060 Expanded(
926 child: _textFeildWidget(customerProvider.controlleretime, 1061 child: _textFeildWidget(customerProvider.controlleretime,
927 - customerProvider.etimeFocus)), 1062 + customerProvider.etimeFocus, state)),
928 ], 1063 ],
929 ), 1064 ),
930 VEmptyView(30), 1065 VEmptyView(30),
@@ -933,16 +1068,28 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -933,16 +1068,28 @@ class _CustomerListPageState extends State<CustomerListPage>
933 runSpacing: ScreenUtil().setWidth(20), 1068 runSpacing: ScreenUtil().setWidth(20),
934 children: _buildFilterItem(customerProvider.filterDayList, true, 1069 children: _buildFilterItem(customerProvider.filterDayList, true,
935 (FilterBtnModel item) { 1070 (FilterBtnModel item) {
936 - if (customerProvider.stimeFocus.hasFocus) {  
937 - customerProvider.controllerstime.text = item.id; 1071 + customerProvider.controllerstime.text = '';
  1072 + customerProvider.controlleretime.text = '';
  1073 + for (FilterBtnModel value in customerProvider.filterDayList) {
  1074 + value.select = false;
938 } 1075 }
939 - if (customerProvider.etimeFocus.hasFocus) {  
940 - customerProvider.controlleretime.text = item.id; 1076 + for (FilterBtnModel value in customerProvider.filterDayList) {
  1077 + if (item.id == value.id) {
  1078 + state(() {
  1079 + value.select = true;
  1080 + });
  1081 + }
941 } 1082 }
  1083 + // if (customerProvider.stimeFocus.hasFocus) {
  1084 + // customerProvider.controllerstime.text = item.id;
  1085 + // }
  1086 + // if (customerProvider.etimeFocus.hasFocus) {
  1087 + // customerProvider.controlleretime.text = item.id;
  1088 + // }
942 // state(() { 1089 // state(() {
943 // item.select = !item.select; 1090 // item.select = !item.select;
944 // }); 1091 // });
945 - }, grayBack: true)), 1092 + })),
946 VEmptyView(30), 1093 VEmptyView(30),
947 _textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24), 1094 _textWidget('时间内预订次数', MyColours.color_333333, FontWeight.normal, 24),
948 VEmptyView(30), 1095 VEmptyView(30),
@@ -1058,6 +1205,9 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -1058,6 +1205,9 @@ class _CustomerListPageState extends State<CustomerListPage>
1058 textInputAction: TextInputAction.done, 1205 textInputAction: TextInputAction.done,
1059 1206
1060 onChanged: (value) { 1207 onChanged: (value) {
  1208 + customerProvider.controllerstime.text = '';
  1209 + customerProvider.controlleretime.text = '';
  1210 + state(() {});
1061 // setState(() {}); 1211 // setState(() {});
1062 // _searchSellerLocation(); 1212 // _searchSellerLocation();
1063 // customerProvider.searchData(value); 1213 // customerProvider.searchData(value);
@@ -1116,8 +1266,8 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -1116,8 +1266,8 @@ class _CustomerListPageState extends State<CustomerListPage>
1116 } 1266 }
1117 1267
1118 /// 高级筛选输入框 1268 /// 高级筛选输入框
1119 - Widget _textFeildWidget(  
1120 - TextEditingController controller, FocusNode focusNode) { 1269 + Widget _textFeildWidget(TextEditingController controller, FocusNode focusNode,
  1270 + StateSetter state) {
1121 return Container( 1271 return Container(
1122 padding: EdgeInsets.symmetric( 1272 padding: EdgeInsets.symmetric(
1123 horizontal: ScreenUtil().setWidth(20), 1273 horizontal: ScreenUtil().setWidth(20),
@@ -1156,6 +1306,12 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -1156,6 +1306,12 @@ class _CustomerListPageState extends State<CustomerListPage>
1156 textInputAction: TextInputAction.done, 1306 textInputAction: TextInputAction.done,
1157 1307
1158 onChanged: (value) { 1308 onChanged: (value) {
  1309 + for (FilterBtnModel value
  1310 + in customerProvider.filterDayList) {
  1311 + value.select = false;
  1312 + }
  1313 + customerProvider.controllernum.text = '';
  1314 + state(() {});
1159 // setState(() {}); 1315 // setState(() {});
1160 // _searchSellerLocation(); 1316 // _searchSellerLocation();
1161 // customerProvider.searchData(value); 1317 // customerProvider.searchData(value);
@@ -1184,10 +1340,12 @@ class _CustomerListPageState extends State<CustomerListPage> @@ -1184,10 +1340,12 @@ class _CustomerListPageState extends State<CustomerListPage>
1184 padding: EdgeInsets.symmetric( 1340 padding: EdgeInsets.symmetric(
1185 // horizontal: ScreenUtil().setWidth(30), 1341 // horizontal: ScreenUtil().setWidth(30),
1186 ), 1342 ),
1187 - // height: ScreenUtil().setWidth(100),  
1188 - margin: EdgeInsets.only(  
1189 - top: ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) +  
1190 - ScreenUtil.statusBarHeight), 1343 + height: ScreenUtil.screenHeightDp -
  1344 + ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) -
  1345 + ScreenUtil.statusBarHeight,
  1346 + // margin: EdgeInsets.only(
  1347 + // top: ScreenUtil().setWidth(92 + 52 + 30 * 3 + 90) +
  1348 + // ScreenUtil.statusBarHeight),
1191 color: Color.fromRGBO(00, 00, 00, 0.49), 1349 color: Color.fromRGBO(00, 00, 00, 0.49),
1192 child: Align( 1350 child: Align(
1193 alignment: Alignment.topCenter, 1351 alignment: Alignment.topCenter,
@@ -77,67 +77,81 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> { @@ -77,67 +77,81 @@ class _StoreCustomerPageState extends State<StoreCustomerPage> {
77 ///活跃客户、沉睡客户、流失客户 77 ///活跃客户、沉睡客户、流失客户
78 Widget _percentWidget(String pnum, String btnTitle, String percent, 78 Widget _percentWidget(String pnum, String btnTitle, String percent,
79 {String uid = ''}) { 79 {String uid = ''}) {
80 - return Container(  
81 - color: MyColours.color_ffffff,  
82 - // height: ScreenUtil().setWidth(230),  
83 - width: (ScreenUtil.screenWidthDp - ScreenUtil().setWidth(20)) / 3,  
84 - height: (ScreenUtil.screenWidthDp - ScreenUtil().setWidth(20)) / 3,  
85 - child: Column(  
86 - mainAxisAlignment: MainAxisAlignment.center,  
87 - children: [  
88 - Row( 80 + return InkWell(
  81 + onTap: () async {
  82 + String index = '0';
  83 +
  84 + if (btnTitle == '活跃客户') {
  85 + index = '1';
  86 + } else if (btnTitle == '沉睡客户') {
  87 + index = '2';
  88 + } else if (btnTitle == '流失客户') {
  89 + index = '3';
  90 + }
  91 + NavigatorUtil.goCustomerListPage(context, FromPage.FromPageHome, uid,
  92 + index: index);
  93 + },
  94 + child: Container(
  95 + color: MyColours.color_ffffff,
  96 + // height: ScreenUtil().setWidth(230),
  97 + width: (ScreenUtil.screenWidthDp - ScreenUtil().setWidth(20)) / 3,
  98 + height: (ScreenUtil.screenWidthDp - ScreenUtil().setWidth(20)) / 3,
  99 + child: Column(
89 mainAxisAlignment: MainAxisAlignment.center, 100 mainAxisAlignment: MainAxisAlignment.center,
90 children: [ 101 children: [
91 - Text(pnum,  
92 - style: TextStyle(  
93 - color: MyColours.color_199095,  
94 - fontSize: ScreenUtil().setSp(40),  
95 - fontWeight: FontWeight.bold)),  
96 - Text('位',  
97 - style: TextStyle(  
98 - color: MyColours.color_199095,  
99 - fontSize: ScreenUtil().setSp(24),  
100 - ))  
101 - ],  
102 - ),  
103 - VEmptyView(20),  
104 - RoundButton(  
105 - onPressed: () async {  
106 - String index = '0'; 102 + Row(
  103 + mainAxisAlignment: MainAxisAlignment.center,
  104 + children: [
  105 + Text(pnum,
  106 + style: TextStyle(
  107 + color: MyColours.color_199095,
  108 + fontSize: ScreenUtil().setSp(40),
  109 + fontWeight: FontWeight.bold)),
  110 + Text('位',
  111 + style: TextStyle(
  112 + color: MyColours.color_199095,
  113 + fontSize: ScreenUtil().setSp(24),
  114 + ))
  115 + ],
  116 + ),
  117 + VEmptyView(20),
  118 + RoundButton(
  119 + onPressed: () async {
  120 + String index = '0';
107 121
108 - if (btnTitle == '活跃客户') {  
109 - index = '1';  
110 - } else if (btnTitle == '沉睡客户') {  
111 - index = '2';  
112 - } else if (btnTitle == '流失客户') {  
113 - index = '3';  
114 - }  
115 - NavigatorUtil.goCustomerListPage(  
116 - context, FromPage.FromPageHome, uid,  
117 - index: index);  
118 - },  
119 - text: btnTitle,  
120 - fontSize: 24,  
121 - isBold: false,  
122 - textColor: MyColours.color_333333,  
123 - gradientStart: MyColours.color_ffffff,  
124 - gradientEnd: MyColours.color_ffffff,  
125 - borderColor: Color.fromRGBO(118, 118, 118, 1),  
126 - height: ScreenUtil().setWidth(45),  
127 - width: ScreenUtil().setWidth(160),  
128 - radius: ScreenUtil().setWidth(30), 122 + if (btnTitle == '活跃客户') {
  123 + index = '1';
  124 + } else if (btnTitle == '沉睡客户') {
  125 + index = '2';
  126 + } else if (btnTitle == '流失客户') {
  127 + index = '3';
  128 + }
  129 + NavigatorUtil.goCustomerListPage(
  130 + context, FromPage.FromPageHome, uid,
  131 + index: index);
  132 + },
  133 + text: btnTitle,
  134 + fontSize: 24,
  135 + isBold: false,
  136 + textColor: MyColours.color_333333,
  137 + gradientStart: MyColours.color_ffffff,
  138 + gradientEnd: MyColours.color_ffffff,
  139 + borderColor: Color.fromRGBO(118, 118, 118, 1),
  140 + height: ScreenUtil().setWidth(45),
  141 + width: ScreenUtil().setWidth(160),
  142 + radius: ScreenUtil().setWidth(30),
  143 + ),
  144 + VEmptyView(16),
  145 + percent == null
  146 + ? SizedBox()
  147 + : Text('${percent}%',
  148 + style: TextStyle(
  149 + color: MyColours.color_199095,
  150 + fontSize: ScreenUtil().setSp(24),
  151 + )),
  152 + ],
129 ), 153 ),
130 - VEmptyView(16),  
131 - percent == null  
132 - ? SizedBox()  
133 - : Text('${percent}%',  
134 - style: TextStyle(  
135 - color: MyColours.color_199095,  
136 - fontSize: ScreenUtil().setSp(24),  
137 - )),  
138 - ],  
139 - ),  
140 - ); 154 + ));
141 } 155 }
142 156
143 @override 157 @override
  1 +import 'dart:convert';
  2 +
1 import 'package:cached_network_image/cached_network_image.dart'; 3 import 'package:cached_network_image/cached_network_image.dart';
  4 +import 'package:common_utils/common_utils.dart';
  5 +import 'package:dio/dio.dart';
2 import 'package:flutter/material.dart'; 6 import 'package:flutter/material.dart';
3 import 'package:flutter_screenutil/screenutil.dart'; 7 import 'package:flutter_screenutil/screenutil.dart';
4 import 'package:one_key/models/get_seller_info_model.dart'; 8 import 'package:one_key/models/get_seller_info_model.dart';
5 import 'package:one_key/models/personnel_manage_model.dart'; 9 import 'package:one_key/models/personnel_manage_model.dart';
  10 +import 'package:one_key/net/dio_util.dart';
6 import 'package:one_key/provider/personnel_provider.dart'; 11 import 'package:one_key/provider/personnel_provider.dart';
7 import 'package:one_key/provider/user_model.dart'; 12 import 'package:one_key/provider/user_model.dart';
8 import 'package:one_key/res/colors.dart'; 13 import 'package:one_key/res/colors.dart';
@@ -48,7 +53,8 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { @@ -48,7 +53,8 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
48 : '添加手机号'; 53 : '添加手机号';
49 WidgetsBinding.instance.addPostFrameCallback((timeStamp) { 54 WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
50 if (widget.model.openid == null || widget.model.openid == 'null') { 55 if (widget.model.openid == null || widget.model.openid == 'null') {
51 - _getStoreBaseinfo(); 56 + // _getStoreBaseinfo();
  57 + _getWechatQrcode();
52 } 58 }
53 setState(() { 59 setState(() {
54 roleNameLogin = userModel.user.role_name; 60 roleNameLogin = userModel.user.role_name;
@@ -98,13 +104,13 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { @@ -98,13 +104,13 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
98 } 104 }
99 105
100 ///获取店铺信息 106 ///获取店铺信息
101 - _getStoreBaseinfo() async {  
102 - GetSellerInfoSunModel itemModel =  
103 - await personnelProvider.getSellerById(context);  
104 - if (itemModel != null) {  
105 - dcAdduserCode = itemModel.data.dcAdduserCode;  
106 - }  
107 - } 107 + // _getStoreBaseinfo() async {
  108 + // GetSellerInfoSunModel itemModel =
  109 + // await personnelProvider.getSellerById(context);
  110 + // if (itemModel != null) {
  111 + // dcAdduserCode = itemModel.data.dcAdduserCode;
  112 + // }
  113 + // }
108 114
109 ///设置接单人 115 ///设置接单人
110 _setUserIsCall({bool showLoading = true}) async { 116 _setUserIsCall({bool showLoading = true}) async {
@@ -191,8 +197,12 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { @@ -191,8 +197,12 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
191 _delSellerClerk(); 197 _delSellerClerk();
192 }); 198 });
193 } else if (element == '绑定微信') { 199 } else if (element == '绑定微信') {
194 - DialogUtil.openAlertDialogImage(  
195 - context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660); 200 + if (dcAdduserCode != '' && dcAdduserCode != null) {
  201 + DialogUtil.openAlertDialogImage(
  202 + context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
  203 + } else {
  204 + _getWechatQrcode(need: true);
  205 + }
196 } else if (element == '查看密码') { 206 } else if (element == '查看密码') {
197 NavigatorUtil.goPersonnelPasswordPage(context, 207 NavigatorUtil.goPersonnelPasswordPage(context,
198 account: widget.model.account, idstr: widget.model.id); 208 account: widget.model.account, idstr: widget.model.id);
@@ -204,6 +214,37 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> { @@ -204,6 +214,37 @@ class _PersonnelDetailPageState extends State<PersonnelDetailPage> {
204 return list; 214 return list;
205 } 215 }
206 216
  217 + ///获取二维码
  218 + _getWechatQrcode({bool need = false}) async {
  219 + String sid = Provider.of<UserModel>(context, listen: false).user.sellerid;
  220 + String id = Provider.of<UserModel>(context, listen: false).user.openid;
  221 + // https: //xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode/sellerid/商家ID/uid/当前账号ID
  222 + Response response = await DioUtil.getInstance().getDio().get(
  223 + "https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=${widget.model.id}");
  224 + // Response response = await DioUtil.getInstance().getDio().get(
  225 + // "https://xt.colorcun.com/WechatApi/WechatApi/CreateDcSubQrcode?sellerid=$sid&uid=$uid");
  226 + // Response response = await DioUtil.getInstance().getDio().get(
  227 + // "https://api.weixin.qq.com/sns/oauth2/access_token?appid=wx85aa3cdd0f791e65&secret=87c9a23c2e6032b2da75af6b0efc5424&code=$code&grant_type=authorization_code");
  228 + LogUtil.v("access_token:${response.toString()}");
  229 + Map<String, dynamic> responseData = json.decode(response.toString());
  230 + print(responseData);
  231 + dcAdduserCode = responseData["data"];
  232 + if (need) {
  233 + if (dcAdduserCode == null || dcAdduserCode == '') {
  234 + Utils.showToast('二维码获取失败');
  235 + } else {
  236 + DialogUtil.openAlertDialogImage(
  237 + context, '请员工使用微信扫一扫添加店员', dcAdduserCode, 660);
  238 + }
  239 + }
  240 +
  241 + print(dcAdduserCode);
  242 + // if (responseData["data"] != null) {
  243 + // // Utils.showToast(responseData["errmsg"] ?? "登录失败,请稍后重试");
  244 + // // Loading.hideLoading(context);
  245 + // } else {}
  246 + }
  247 +
207 @override 248 @override
208 Widget build(BuildContext context) { 249 Widget build(BuildContext context) {
209 userModel = Provider.of<UserModel>(context, listen: false); 250 userModel = Provider.of<UserModel>(context, listen: false);
@@ -87,6 +87,45 @@ class CustomerProvider extends ChangeNotifier { @@ -87,6 +87,45 @@ class CustomerProvider extends ChangeNotifier {
87 bool manageSelAll = false; 87 bool manageSelAll = false;
88 List<FilterBtnModel> filterManageList = []; //经理 88 List<FilterBtnModel> filterManageList = []; //经理
89 89
  90 + //获取全选按钮的状态 true or false
  91 + getCheckhydSelAll() {
  92 + bool temp = filterHydList.any((value) {
  93 + return value.select == false;
  94 + });
  95 + if (temp == true) {
  96 + hydSelAll = false;
  97 + } else {
  98 + hydSelAll = true;
  99 + }
  100 + notifyListeners();
  101 + }
  102 +
  103 + //获取全选按钮的状态 true or false
  104 + getChecklabelSelAll() {
  105 + bool temp = filterLabelList.any((value) {
  106 + return value.select == false;
  107 + });
  108 + if (temp == true) {
  109 + labelSelAll = false;
  110 + } else {
  111 + labelSelAll = true;
  112 + }
  113 + notifyListeners();
  114 + }
  115 +
  116 + //获取全选按钮的状态 true or false
  117 + getCheckmanageSelAll() {
  118 + bool temp = filterManageList.any((value) {
  119 + return value.select == false;
  120 + });
  121 + if (temp == true) {
  122 + manageSelAll = false;
  123 + } else {
  124 + manageSelAll = true;
  125 + }
  126 + notifyListeners();
  127 + }
  128 +
90 initData() { 129 initData() {
91 filterDayList = []; 130 filterDayList = [];
92 FilterBtnModel model = FilterBtnModel(); 131 FilterBtnModel model = FilterBtnModel();
@@ -671,34 +671,115 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -671,34 +671,115 @@ class NotebookDetailChangeModel with ChangeNotifier {
671 671
672 //更改在线预订 672 //更改在线预订
673 Future<SunReserveInfoModel> updateOnlineReserveInfo( 673 Future<SunReserveInfoModel> updateOnlineReserveInfo(
674 - BuildContext context) async { 674 + BuildContext context, String nameStr) async {
675 UserModel userModel = Provider.of<UserModel>(context, listen: false); 675 UserModel userModel = Provider.of<UserModel>(context, listen: false);
676 - String pnum = '';  
677 - for (var item in personNumList) {  
678 - if (item['isSelect']) {  
679 - pnum = item['dateText'];  
680 - }  
681 - } 676 + // String pnum = '';
  677 + // for (var item in personNumList) {
  678 + // if (item['isSelect']) {
  679 + // pnum = item['dateText'];
  680 + // }
  681 + // }
682 682
683 - String sex = '1';  
684 - for (var item in sexList) {  
685 - if (item['select']) {  
686 - sex = item['code'];  
687 - }  
688 - }  
689 - //当前选中 年-月-日string  
690 - String ymyStr = "";  
691 - //今天 明天 其他天  
692 - for (var item in dateList) {  
693 - if (item['select'] == true) {  
694 - ymyStr = item['title']; 683 + // String sex = '1';
  684 + // for (var item in sexList) {
  685 + // if (item['select']) {
  686 + // sex = item['code'];
  687 + // }
  688 + // }
  689 + // //当前选中 年-月-日string
  690 + // String ymyStr = "";
  691 + // //今天 明天 其他天
  692 + // for (var item in dateList) {
  693 + // if (item['select'] == true) {
  694 + // ymyStr = item['title'];
  695 + // }
  696 + // }
  697 + // String timeStr = ymyStr + ' ' + ddateStr + ':00';
  698 + // // int start = DateUtil.getDateMsByTimeStr(timeStr);
  699 +
  700 + // // String tempDdate = ymyStr + ' ' + ddateStr + ':00';
  701 + // int ddate = DateUtil.getDateMsByTimeStr(timeStr);
  702 + // String tableSelectInfo = '';
  703 + // for (TableList item in tableList) {
  704 + // // if (item.selected) {
  705 + // tableSelectInfo += ',${item.id}';
  706 + // // }
  707 + // }
  708 + // print(tableSelectInfo);
  709 + // if (tableSelectInfo.startsWith(',')) {
  710 + // tableSelectInfo = tableSelectInfo.substring(1);
  711 + // }
  712 + // print(tableSelectInfo);
  713 + // String rdate = '';
  714 + // String ddateSolt = '';
  715 + // print(sunDateList);
  716 + // for (var item in sunDateList) {
  717 + // if (item['isSelect'] == true) {
  718 + // String keys = '';
  719 + // ddateSolt = '${item['ddateSolt']}';
  720 + // if (item['ddateSolt'] == 1) {
  721 + // //早市
  722 + // keys = 'morning';
  723 + // } else if (item['ddateSolt'] == 2) {
  724 + // //午市
  725 + // keys = 'noon';
  726 + // } else if (item['ddateSolt'] == 3) {
  727 + // //晚市
  728 + // keys = 'night';
  729 + // }
  730 + // if (keys != '') {
  731 + // List temp = dailyMap[keys];
  732 + // String timeStrStart = ymyStr + ' ' + temp.first['title'] + ':00';
  733 + // String timeStrEnd = ymyStr + ' ' + temp.last['title'] + ':00';
  734 + // int startM = DateUtil.getDateMsByTimeStr(timeStrStart);
  735 + // int endM = DateUtil.getDateMsByTimeStr(timeStrEnd);
  736 + // String start = '${startM}'.substring(0, 10);
  737 + // String end = '${endM}'.substring(0, 10);
  738 + // rdate = start + '-' + end;
  739 + // }
  740 + // }
  741 + // }
  742 + // Map<String, String> params = {
  743 + //1 "rid": detailEntity.id,
  744 + // 'is_set_ddate': isSetDate,
  745 + //1 "sid": userModel.user.sellerid, //商家ID
  746 + //1 "tid": tableSelectInfo, //桌子ID: 格式 2,3,4
  747 + //1 "rname": nameController.text, //预订人姓名
  748 + //1 "sex": sex, //预订人姓名:1:男 2:女
  749 + //1 "phone": phoneController.text, //预订人电话
  750 + // "cusdem": customController.text, //预订人需求:25汉字
  751 + //1 "type": "0",
  752 + //1 "rdate": rdate, //预定用餐时间范围:时间戳 开始时间戳(time)-结束时间戳(time)
  753 + //1 "ddate": '${ddate}'.substring(0, 10), //到店时间
  754 + // "ddate_solt": ddateSolt
  755 + // };
  756 + // if (pnum != '' && pnum != null) {
  757 + // params['pnum'] = pnum;
  758 + // }
  759 + // print(params);
  760 + String ddateHm = detailEntity.ddateHm; //订座详情页面的到店时间
  761 + String ddateSolt = detailEntity.ddate_solt; //订座详情页面的餐段(1,2,3 早餐、午餐、晚餐)
  762 + String tempTime = ddateHm; //默认上个页面到店时间半小时值
  763 +
  764 + if (ddateSolt != currTimeIndex.toString() || tempTime == '') {
  765 + //餐段发生改变,则重新默认到店时间半小时值
  766 + if (currTimeIndex == 1) {
  767 + tempTime = '08:00';
  768 + } else if (currTimeIndex == 2) {
  769 + tempTime = '12:00';
  770 + } else if (currTimeIndex == 3) {
  771 + tempTime = '18:00';
695 } 772 }
696 } 773 }
697 - String timeStr = ymyStr + ' ' + ddateStr + ':00'; 774 +
  775 + String ymd = DateUtil.formatDate(dateTime, format: DateFormats.y_mo_d);
  776 + String timeStr = ymd + ' ' + tempTime + ':00';
698 // int start = DateUtil.getDateMsByTimeStr(timeStr); 777 // int start = DateUtil.getDateMsByTimeStr(timeStr);
699 778
  779 + LogUtil.v(timeStr);
700 // String tempDdate = ymyStr + ' ' + ddateStr + ':00'; 780 // String tempDdate = ymyStr + ' ' + ddateStr + ':00';
701 int ddate = DateUtil.getDateMsByTimeStr(timeStr); 781 int ddate = DateUtil.getDateMsByTimeStr(timeStr);
  782 +
702 String tableSelectInfo = ''; 783 String tableSelectInfo = '';
703 for (TableList item in tableList) { 784 for (TableList item in tableList) {
704 // if (item.selected) { 785 // if (item.selected) {
@@ -711,50 +792,73 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -711,50 +792,73 @@ class NotebookDetailChangeModel with ChangeNotifier {
711 } 792 }
712 print(tableSelectInfo); 793 print(tableSelectInfo);
713 String rdate = ''; 794 String rdate = '';
714 - String ddateSolt = '';  
715 - print(sunDateList);  
716 - for (var item in sunDateList) {  
717 - if (item['isSelect'] == true) {  
718 - String keys = '';  
719 - ddateSolt = '${item['ddateSolt']}';  
720 - if (item['ddateSolt'] == 1) {  
721 - //早市  
722 - keys = 'morning';  
723 - } else if (item['ddateSolt'] == 2) {  
724 - //午市  
725 - keys = 'noon';  
726 - } else if (item['ddateSolt'] == 3) {  
727 - //晚市  
728 - keys = 'night';  
729 - }  
730 - if (keys != '') {  
731 - List temp = dailyMap[keys];  
732 - String timeStrStart = ymyStr + ' ' + temp.first['title'] + ':00';  
733 - String timeStrEnd = ymyStr + ' ' + temp.last['title'] + ':00';  
734 - int startM = DateUtil.getDateMsByTimeStr(timeStrStart);  
735 - int endM = DateUtil.getDateMsByTimeStr(timeStrEnd);  
736 - String start = '${startM}'.substring(0, 10);  
737 - String end = '${endM}'.substring(0, 10);  
738 - rdate = start + '-' + end;  
739 - }  
740 - } 795 +
  796 + String keys = '';
  797 +
  798 + if (currTimeIndex == 1) {
  799 + //早市
  800 + keys = 'morning';
  801 + } else if (currTimeIndex == 2) {
  802 + //午市
  803 + keys = 'noon';
  804 + } else if (currTimeIndex == 3) {
  805 + //晚市
  806 + keys = 'night';
741 } 807 }
  808 + if (keys != '') {
  809 + List temp = dailyMap[keys];
  810 + String timeStrStart = ymd + ' ' + temp.first['title'] + ':00';
  811 + String timeStrEnd = ymd + ' ' + temp.last['title'] + ':00';
  812 + int startM = DateUtil.getDateMsByTimeStr(timeStrStart);
  813 + int endM = DateUtil.getDateMsByTimeStr(timeStrEnd);
  814 + String start = '${startM}'.substring(0, 10);
  815 + String end = '${endM}'.substring(0, 10);
  816 + rdate = start + '-' + end;
  817 + }
  818 + // Map<String, String> params = {
  819 + // "sid": userModel.user.sellerid, //商家ID
  820 + // "tid": tableSelectInfo, //桌子ID: 格式 2,3,4
  821 + // 'note_name': userModel.user.account,
  822 + // 'type': "0", //内部预订
  823 + // "rdate": rdate, //预定用餐时间范围:时间戳 开始时间戳(time)-结束时间戳(time)
  824 + // // 'is_set_ddate': "1",
  825 + // "ddate": '${ddate}'.substring(0, 10), //到店时间
  826 + // "channel": '5',
  827 + // // "uid": userModel.user.openid
  828 + // };
742 Map<String, String> params = { 829 Map<String, String> params = {
743 - "rid": detailEntity.id,  
744 - 'is_set_ddate': isSetDate, 830 +
  831 + // 'is_set_ddate': isSetDate,
745 "sid": userModel.user.sellerid, //商家ID 832 "sid": userModel.user.sellerid, //商家ID
746 "tid": tableSelectInfo, //桌子ID: 格式 2,3,4 833 "tid": tableSelectInfo, //桌子ID: 格式 2,3,4
747 - "rname": nameController.text, //预订人姓名  
748 - "sex": sex, //预订人姓名:1:男 2:女  
749 - "phone": phoneController.text, //预订人电话  
750 - "cusdem": customController.text, //预订人需求:25汉字 834 +
751 "type": "0", 835 "type": "0",
752 "rdate": rdate, //预定用餐时间范围:时间戳 开始时间戳(time)-结束时间戳(time) 836 "rdate": rdate, //预定用餐时间范围:时间戳 开始时间戳(time)-结束时间戳(time)
753 "ddate": '${ddate}'.substring(0, 10), //到店时间 837 "ddate": '${ddate}'.substring(0, 10), //到店时间
754 "ddate_solt": ddateSolt 838 "ddate_solt": ddateSolt
755 }; 839 };
756 - if (pnum != '' && pnum != null) {  
757 - params['pnum'] = pnum; 840 +
  841 + if (detailEntity.id.isNotEmpty && detailEntity.id != "-1") {
  842 + params['rid'] = detailEntity.id;
  843 + }
  844 + if (nameStr.trim().length > 0) {
  845 + String sex = '1';
  846 + for (var item in sexList) {
  847 + if (item['select']) {
  848 + sex = item['code'];
  849 + }
  850 + }
  851 +
  852 + params['rname'] = nameStr; //预订人姓名
  853 + params['sex'] = sex; //预订人性别:1:男 2:女
  854 + }
  855 + if (phoneController.text.trim().length > 0) {
  856 + params['phone'] = phoneController.text; //预订人电话
  857 +
  858 + }
  859 + if (customController.text.trim().length > 0) {
  860 + params['cusdem'] = customController.text; //预订人需求:25汉字
  861 +
758 } 862 }
759 print(params); 863 print(params);
760 BaseResp<Map<String, dynamic>> baseResp = await DioUtil() 864 BaseResp<Map<String, dynamic>> baseResp = await DioUtil()
@@ -1161,13 +1161,15 @@ class Utils { @@ -1161,13 +1161,15 @@ class Utils {
1161 } 1161 }
1162 1162
1163 //分享邀请函 1163 //分享邀请函
1164 - static goShareInvicationToWeChat(String rid, String uid) async { 1164 + static goShareInvicationToWeChat(
  1165 + BuildContext context, String rid, String uid) async {
1165 String _webPageUrl = "http://colorcun.com/"; 1166 String _webPageUrl = "http://colorcun.com/";
1166 // String _thumbnail = 1167 // String _thumbnail =
1167 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1"; 1168 // "https://xt04.colorcun.com/h5/index.html#/?id=163854&hasInvitation=1";
1168 String _thumbnail = 1169 String _thumbnail =
1169 "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg"; 1170 "https://qn.colorcun.com/reserve/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_201911151148572.jpg";
1170 - String _title = "用餐已为您安排"; 1171 + String _title =
  1172 + "您预订的${Provider.of<UserModel>(context, listen: false).user.sellername},已经安排,点击查看详情";
1171 String _userName = "gh_487873d353b3"; 1173 String _userName = "gh_487873d353b3";
1172 String _path = 1174 String _path =
1173 "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid"; 1175 "pages/customer/index?id=$rid&hasInvitation=1&hasSellerShare=1&uid=$uid";
@@ -1224,7 +1226,6 @@ class Utils { @@ -1224,7 +1226,6 @@ class Utils {
1224 return result.toString(); 1226 return result.toString();
1225 } 1227 }
1226 1228
1227 -  
1228 static String listToStringEnglish1(List<dynamic> list) { 1229 static String listToStringEnglish1(List<dynamic> list) {
1229 if (list == null) { 1230 if (list == null) {
1230 return null; 1231 return null;