Commit ab7ebb3bcdbc4b913272ec0e955cb8f9fe377199

Authored by wdn127929
1 parent 36976ac9

电话不能录入自己的开关设置&&录入预订和新建存酒电话限制

@@ -2104,81 +2104,83 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> { @@ -2104,81 +2104,83 @@ class _NoteBookChangeFPageState extends State<NoteBookChangeFPage> {
2104 : await _notebookDetailChangeModel 2104 : await _notebookDetailChangeModel
2105 .setReserveInfo(context, nameStr, 2105 .setReserveInfo(context, nameStr,
2106 widget.detailEntity.uid); 2106 widget.detailEntity.uid);
2107 - if (ObjectUtil.isNotEmpty(_model.row) ||  
2108 - ObjectUtil.isNotEmpty(_model.row.id)) {  
2109 - print('成功');  
2110 - // _notebookDetailChangeModel.clearData();  
2111 - bus.emit("refresh_detail");  
2112 - bus.emit("refresh_book_list"); //刷新已预订列表  
2113 - if (widget.back) {  
2114 - EventBus()  
2115 - .emit("refresh_invitaion_info"); //刷新预订安排页面  
2116 - Navigator.pop(context);  
2117 - } else {  
2118 - String ddate_solt = '';  
2119 - if (_model.row.isSetDdate == '1') {  
2120 - String createtime =  
2121 - _model.row.ddate.toString() + '000';  
2122 - DateTime createTime =  
2123 - DateTime.fromMillisecondsSinceEpoch(  
2124 - int.parse(createtime));  
2125 - ddate_solt = DateUtil.formatDate(createTime,  
2126 - format: DateFormats.h_m); 2107 + if (_model!= null) {
  2108 + if (ObjectUtil.isNotEmpty(_model.row) ||
  2109 + ObjectUtil.isNotEmpty(_model.row.id)) {
  2110 + print('成功');
  2111 + // _notebookDetailChangeModel.clearData();
  2112 + bus.emit("refresh_detail");
  2113 + bus.emit("refresh_book_list"); //刷新已预订列表
  2114 + if (widget.back) {
  2115 + EventBus()
  2116 + .emit("refresh_invitaion_info"); //刷新预订安排页面
  2117 + Navigator.pop(context);
2127 } else { 2118 } else {
2128 - if (_model.row.ddateSolt == '1') {  
2129 - ddate_solt = '早餐';  
2130 - } else if (_model.row.ddateSolt == '2') {  
2131 - ddate_solt = '午餐';  
2132 - } else if (_model.row.ddateSolt == '3') {  
2133 - ddate_solt = '晚餐'; 2119 + String ddate_solt = '';
  2120 + if (_model.row.isSetDdate == '1') {
  2121 + String createtime =
  2122 + _model.row.ddate.toString() + '000';
  2123 + DateTime createTime =
  2124 + DateTime.fromMillisecondsSinceEpoch(
  2125 + int.parse(createtime));
  2126 + ddate_solt = DateUtil.formatDate(createTime,
  2127 + format: DateFormats.h_m);
  2128 + } else {
  2129 + if (_model.row.ddateSolt == '1') {
  2130 + ddate_solt = '早餐';
  2131 + } else if (_model.row.ddateSolt == '2') {
  2132 + ddate_solt = '午餐';
  2133 + } else if (_model.row.ddateSolt == '3') {
  2134 + ddate_solt = '晚餐';
  2135 + }
2134 } 2136 }
  2137 + List<dynamic> tableinfo =
  2138 + convert.jsonDecode(_model.row.tableinfo);
  2139 + print(tableinfo);
  2140 +
  2141 + // if (tableinfo.length > 1) {
  2142 + // _nameStr =
  2143 + // t.TableList.fromJson(tableinfo[0]).name +
  2144 + // '等${tableinfo.length}桌';
  2145 + // }
  2146 + String _nameStr = '';
  2147 + String _tid = '';
  2148 + for (int i = 0; i < tableinfo.length; i++) {
  2149 + _nameStr +=
  2150 + '${t.TableList.fromJson(tableinfo[i]).name},';
  2151 +
  2152 + _tid +=
  2153 + '${t.TableList.fromJson(tableinfo[i]).id},';
  2154 + }
  2155 + if (_tid.endsWith(',')) {
  2156 + _tid = _tid.substring(0, _tid.length - 1);
  2157 + }
  2158 + if (_nameStr.endsWith(',')) {
  2159 + _nameStr = _nameStr.substring(
  2160 + 0, _nameStr.length - 1);
  2161 + }
  2162 + LogUtil.v(_nameStr);
  2163 + NavigatorUtil.goInvicationPage(
  2164 + context, _model.row.id,
  2165 + // _nameStr,
  2166 + // _model.row.ddate,
  2167 + // ddate_solt,
  2168 + // _model.row.phone,
  2169 + // _model.row.ddateSolt,
  2170 + // _model.row.rname == null
  2171 + // ? ''
  2172 + // : _model.row.rname,
  2173 + // _model.row.sex == null ? '' : _model.row.sex,
  2174 + // _model.row.cusdem,
  2175 + // tid: _tid,
  2176 + replace: true);
2135 } 2177 }
2136 - List<dynamic> tableinfo =  
2137 - convert.jsonDecode(_model.row.tableinfo);  
2138 - print(tableinfo);  
2139 -  
2140 - // if (tableinfo.length > 1) {  
2141 - // _nameStr =  
2142 - // t.TableList.fromJson(tableinfo[0]).name +  
2143 - // '等${tableinfo.length}桌';  
2144 - // }  
2145 - String _nameStr = '';  
2146 - String _tid = '';  
2147 - for (int i = 0; i < tableinfo.length; i++) {  
2148 - _nameStr +=  
2149 - '${t.TableList.fromJson(tableinfo[i]).name},';  
2150 -  
2151 - _tid +=  
2152 - '${t.TableList.fromJson(tableinfo[i]).id},';  
2153 - }  
2154 - if (_tid.endsWith(',')) {  
2155 - _tid = _tid.substring(0, _tid.length - 1);  
2156 - }  
2157 - if (_nameStr.endsWith(',')) {  
2158 - _nameStr =  
2159 - _nameStr.substring(0, _nameStr.length - 1);  
2160 - }  
2161 - LogUtil.v(_nameStr);  
2162 - NavigatorUtil.goInvicationPage(  
2163 - context, _model.row.id,  
2164 - // _nameStr,  
2165 - // _model.row.ddate,  
2166 - // ddate_solt,  
2167 - // _model.row.phone,  
2168 - // _model.row.ddateSolt,  
2169 - // _model.row.rname == null  
2170 - // ? ''  
2171 - // : _model.row.rname,  
2172 - // _model.row.sex == null ? '' : _model.row.sex,  
2173 - // _model.row.cusdem,  
2174 - // tid: _tid,  
2175 - replace: true); 2178 + EventBus().emit("refresh_tablemanager"); //刷新桌位
  2179 + } else {
  2180 + Utils.showToast(widget.detailEntity.id == "-1"
  2181 + ? "录入预订订单失败,请重试!"
  2182 + : "变更预订订单失败,请重试!");
2176 } 2183 }
2177 - EventBus().emit("refresh_tablemanager"); //刷新桌位  
2178 - } else {  
2179 - Utils.showToast(widget.detailEntity.id == "-1"  
2180 - ? "录入预订订单失败,请重试!"  
2181 - : "变更预订订单失败,请重试!");  
2182 } 2184 }
2183 }, 2185 },
2184 ), 2186 ),
@@ -48,6 +48,7 @@ import '../../models/get_seller_info_model.dart'; @@ -48,6 +48,7 @@ import '../../models/get_seller_info_model.dart';
48 import '../../models/seller_version_model.dart'; 48 import '../../models/seller_version_model.dart';
49 import '../../models/user.dart'; 49 import '../../models/user.dart';
50 import '../../provider/collect_store_provider.dart'; 50 import '../../provider/collect_store_provider.dart';
  51 +import '../../provider/customer_provider.dart';
51 import '../../provider/feast_model.dart'; 52 import '../../provider/feast_model.dart';
52 import '../../provider/marketing_center_provider.dart'; 53 import '../../provider/marketing_center_provider.dart';
53 import '../../provider/notebook_detail_model.dart'; 54 import '../../provider/notebook_detail_model.dart';
@@ -202,7 +203,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { @@ -202,7 +203,9 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver {
202 create: (_) => RemarkManagerModel(), 203 create: (_) => RemarkManagerModel(),
203 child: ChangeNotifierProvider<StoreBaseIndoProvider>( 204 child: ChangeNotifierProvider<StoreBaseIndoProvider>(
204 create: (_) => StoreBaseIndoProvider(), 205 create: (_) => StoreBaseIndoProvider(),
205 - child: TableManagerPage()))), 206 + child: ChangeNotifierProvider<CustomerProvider>(
  207 + create: (_) => CustomerProvider(),
  208 + child: TableManagerPage())))),
206 ))) 209 )))
207 ..add( 210 ..add(
208 ChangeNotifierProvider<FeastModel>( 211 ChangeNotifierProvider<FeastModel>(
@@ -221,6 +221,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> { @@ -221,6 +221,7 @@ class _BaseInfoPageState extends State<BaseInfoPage> {
221 String s = App.sp.getString('user'); 221 String s = App.sp.getString('user');
222 User _user = User.fromJson(json.decode(s)); 222 User _user = User.fromJson(json.decode(s));
223 _user.nickName = nameStr; 223 _user.nickName = nameStr;
  224 + _user.userphone = phoneTemp;
224 225
225 await UserModel().saveUserInfo(_user); 226 await UserModel().saveUserInfo(_user);
226 } 227 }
@@ -14,6 +14,7 @@ import 'package:provider/provider.dart'; @@ -14,6 +14,7 @@ import 'package:provider/provider.dart';
14 14
15 import '../../../../utils/screen_util.dart'; 15 import '../../../../utils/screen_util.dart';
16 import '../../../../widgets/h_empty_view.dart'; 16 import '../../../../widgets/h_empty_view.dart';
  17 +import '../../../../widgets/round_button.dart';
17 18
18 class CustomerSettingPage extends StatefulWidget { 19 class CustomerSettingPage extends StatefulWidget {
19 CustomerSettingPage({Key key}) : super(key: key); 20 CustomerSettingPage({Key key}) : super(key: key);
@@ -42,7 +43,8 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { @@ -42,7 +43,8 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
42 _sellerGuestSet() async { 43 _sellerGuestSet() async {
43 Map<String, String> params = { 44 Map<String, String> params = {
44 "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid, 45 "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
45 - 'is_additional': customerProvider.isrepair ? "1" : "0" 46 + 'is_additional': customerProvider.isrepair ? "1" : "0",
  47 + 'is_enter_self': customerProvider.isselfphone ? '1' : '0'
46 }; 48 };
47 bool success = await customerProvider.setSellerGuest(context, params, 49 bool success = await customerProvider.setSellerGuest(context, params,
48 showLoading: true); 50 showLoading: true);
@@ -51,10 +53,8 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { @@ -51,10 +53,8 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
51 53
52 ///获取客情配置 54 ///获取客情配置
53 _sellerGuestGet() async { 55 _sellerGuestGet() async {
54 - Map<String, String> params = {  
55 - "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,  
56 - };  
57 - bool success = await customerProvider.getSellerGuest(context, params); 56 +
  57 + bool success = await customerProvider.getSellerGuest(context);
58 58
59 // if (success) { 59 // if (success) {
60 // customerProvider.isrepair = true; 60 // customerProvider.isrepair = true;
@@ -227,215 +227,240 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> { @@ -227,215 +227,240 @@ class _CustomerSettingPageState extends State<CustomerSettingPage> {
227 body: Padding( 227 body: Padding(
228 padding: EdgeInsets.only( 228 padding: EdgeInsets.only(
229 left: ScreenUtil().setWidth(32), top: ScreenUtil().setWidth(40)), 229 left: ScreenUtil().setWidth(32), top: ScreenUtil().setWidth(40)),
230 - child: SingleChildScrollView(  
231 - child: Column(  
232 - crossAxisAlignment: CrossAxisAlignment.start,  
233 - children: [  
234 - Container(  
235 - padding: EdgeInsets.symmetric(vertical: w(8)),  
236 - child: Text('客人信息录入',  
237 - style: TextStyle(  
238 - color: MyColours.color_515151,  
239 - fontSize: ScreenUtil().setSp(32)))),  
240 - MyDivider(  
241 - double.infinity,  
242 - w(1),  
243 - color: MyColours.color_E7E7E7,  
244 - ),  
245 -  
246 - VEmptyView(24),  
247 -  
248 - InkWell(  
249 - onTap: () {  
250 - setState(() {  
251 - customerProvider.isselfphone =  
252 - !customerProvider.isselfphone;  
253 - });  
254 - _sellerGuestSet();  
255 - },  
256 - child: Container(  
257 - padding:  
258 - EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),  
259 - child: Row(  
260 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
261 - crossAxisAlignment: CrossAxisAlignment.center,  
262 - children: [  
263 - Text('录入客户电话时不能用自己手机号',  
264 - style: TextStyle(  
265 - color: MyColours.color_515151,  
266 - fontSize: ScreenUtil().setSp(28))),  
267 - Image.asset(  
268 - customerProvider.isselfphone  
269 - ? Utils.getImgPath('swich_on')  
270 - : Utils.getImgPath('swich_off'),  
271 - width: ScreenUtil().setWidth(88),  
272 - // height: ScreenUtil().setWidth(82),  
273 - ),  
274 - ],  
275 - )),  
276 - ),  
277 - Padding(  
278 - padding: EdgeInsets.only(left: w(14), right: w(10)),  
279 - child: MyDivider(  
280 - double.infinity,  
281 - w(1),  
282 - color: MyColours.color_E7E7E7,  
283 - )),  
284 - VEmptyView(24),  
285 - InkWell( 230 + child: Column(
  231 + crossAxisAlignment: CrossAxisAlignment.start,
  232 + children: [
  233 + Expanded(
  234 + child: SingleChildScrollView(
  235 + child: Column(
  236 + crossAxisAlignment: CrossAxisAlignment.start,
  237 + children: [
  238 + Container(
  239 + padding: EdgeInsets.symmetric(vertical: w(8)),
  240 + child: Text('客人信息录入',
  241 + style: TextStyle(
  242 + color: MyColours.color_515151,
  243 + fontSize: ScreenUtil().setSp(32)))),
  244 + MyDivider(
  245 + double.infinity,
  246 + w(1),
  247 + color: MyColours.color_E7E7E7,
  248 + ),
  249 + VEmptyView(24),
  250 + InkWell(
286 onTap: () { 251 onTap: () {
287 setState(() { 252 setState(() {
288 - customerProvider.isrepair = !customerProvider.isrepair; 253 + customerProvider.isselfphone =
  254 + !customerProvider.isselfphone;
289 }); 255 });
290 - _sellerGuestSet(); 256 + // _sellerGuestSet();
291 }, 257 },
292 child: Container( 258 child: Container(
293 - padding:  
294 - EdgeInsets.symmetric(vertical: w(8), horizontal: w(14)),  
295 - child: Row(  
296 - mainAxisAlignment: MainAxisAlignment.spaceBetween,  
297 - crossAxisAlignment: CrossAxisAlignment.center,  
298 - children: [  
299 - Text('预订要求补录客人信息',  
300 - style: TextStyle(  
301 - color: MyColours.color_515151,  
302 - fontSize: ScreenUtil().setSp(28))),  
303 - Image.asset(  
304 - customerProvider.isrepair  
305 - ? Utils.getImgPath('swich_on')  
306 - : Utils.getImgPath('swich_off'),  
307 - width: ScreenUtil().setWidth(88),  
308 - // height: ScreenUtil().setWidth(82),  
309 - ),  
310 - ],  
311 - ),  
312 - )), 259 + padding: EdgeInsets.symmetric(
  260 + vertical: w(8), horizontal: w(14)),
  261 + child: Row(
  262 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  263 + crossAxisAlignment: CrossAxisAlignment.center,
  264 + children: [
  265 + Text('录入客户电话时不能用自己手机号',
  266 + style: TextStyle(
  267 + color: MyColours.color_515151,
  268 + fontSize: ScreenUtil().setSp(28))),
  269 + Image.asset(
  270 + customerProvider.isselfphone
  271 + ? Utils.getImgPath('swich_on')
  272 + : Utils.getImgPath('swich_off'),
  273 + width: ScreenUtil().setWidth(88),
  274 + // height: ScreenUtil().setWidth(82),
  275 + ),
  276 + ],
  277 + )),
  278 + ),
  279 + Padding(
  280 + padding: EdgeInsets.only(left: w(14), right: w(10)),
  281 + child: MyDivider(
  282 + double.infinity,
  283 + w(1),
  284 + color: MyColours.color_E7E7E7,
  285 + )),
  286 + VEmptyView(24),
  287 + InkWell(
  288 + onTap: () {
  289 + setState(() {
  290 + customerProvider.isrepair = !customerProvider.isrepair;
  291 + });
  292 + },
  293 + child: Container(
  294 + padding: EdgeInsets.symmetric(
  295 + vertical: w(8), horizontal: w(14)),
  296 + child: Row(
  297 + mainAxisAlignment: MainAxisAlignment.spaceBetween,
  298 + crossAxisAlignment: CrossAxisAlignment.center,
  299 + children: [
  300 + Text('预订要求补录客人信息',
  301 + style: TextStyle(
  302 + color: MyColours.color_515151,
  303 + fontSize: ScreenUtil().setSp(28))),
  304 + Image.asset(
  305 + customerProvider.isrepair
  306 + ? Utils.getImgPath('swich_on')
  307 + : Utils.getImgPath('swich_off'),
  308 + width: ScreenUtil().setWidth(88),
  309 + // height: ScreenUtil().setWidth(82),
  310 + ),
  311 + ],
  312 + ),
  313 + )),
  314 + Padding(
  315 + padding: EdgeInsets.only(left: w(14), right: w(10)),
  316 + child: MyDivider(
  317 + double.infinity,
  318 + w(1),
  319 + color: MyColours.color_E7E7E7,
  320 + )),
  321 + VEmptyView(48),
  322 + Text('店内自定义标签',
  323 + style: TextStyle(
  324 + color: MyColours.color_515151,
  325 + fontSize: ScreenUtil().setSp(32))),
  326 + VEmptyView(48),
  327 + Container(
  328 + padding: EdgeInsets.symmetric(
  329 + vertical: w(18), horizontal: w(14)),
  330 + child: Wrap(
  331 + spacing: ScreenUtil().setWidth(20),
  332 + runSpacing: ScreenUtil().setWidth(10),
  333 + children: _buildLabelItem(customerProvider.labelList))),
  334 + Padding(
  335 + padding: EdgeInsets.only(left: w(14), right: w(10)),
  336 + child: MyDivider(
  337 + double.infinity,
  338 + w(1),
  339 + color: MyColours.color_E7E7E7,
  340 + )),
  341 + ],
  342 + ))),
313 343
314 - Padding(  
315 - padding: EdgeInsets.only(left: w(14), right: w(10)),  
316 - child: MyDivider(  
317 - double.infinity,  
318 - w(1),  
319 - color: MyColours.color_E7E7E7,  
320 - )),  
321 - VEmptyView(48),  
322 - Text('店内自定义标签',  
323 - style: TextStyle(  
324 - color: MyColours.color_515151,  
325 - fontSize: ScreenUtil().setSp(32))),  
326 - VEmptyView(48),  
327 - Container(  
328 - padding:  
329 - EdgeInsets.symmetric(vertical: w(18), horizontal: w(14)),  
330 - child: Wrap(  
331 - spacing: ScreenUtil().setWidth(20),  
332 - runSpacing: ScreenUtil().setWidth(10),  
333 - children: _buildLabelItem(customerProvider.labelList))),  
334 - Padding(  
335 - padding: EdgeInsets.only(left: w(14), right: w(10)),  
336 - child: MyDivider(  
337 - double.infinity,  
338 - w(1),  
339 - color: MyColours.color_E7E7E7,  
340 - )),  
341 - // VEmptyView(34),  
342 - // MyDivider(  
343 - // double.infinity,  
344 - // w(1),  
345 - // color: MyColours.color_E7E7E7,  
346 - // ),  
347 - // VEmptyView(52),  
348 - // InkWell(  
349 - // onTap: () {  
350 - // setState(() {  
351 - // swichSync = !swichSync;  
352 - // });  
353 - // // _sellerGuestSet();  
354 - // },  
355 - // child: Row(  
356 - // mainAxisAlignment: MainAxisAlignment.spaceBetween,  
357 - // crossAxisAlignment: CrossAxisAlignment.center,  
358 - // children: [  
359 - // Text('是否与会员系统同步',  
360 - // style: TextStyle(  
361 - // color: MyColours.color_515151,  
362 - // fontSize: ScreenUtil().setSp(32))),  
363 - // Image.asset(  
364 - // swichSync  
365 - // ? Utils.getImgPath('f_swich_on')  
366 - // : Utils.getImgPath('f_swich_off'),  
367 - // width: ScreenUtil().setWidth(70),  
368 - // // height: ScreenUtil().setWidth(82),  
369 - // ),  
370 - // ],  
371 - // ),  
372 - // ),  
373 - // VEmptyView(48),  
374 - // InkWell(  
375 - // onTap: () {  
376 - // FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘  
377 - // // DialogUtil.showSelectCusmanDialog(context, memberList,  
378 - // // (value) {  
379 - // // if (value != null) {  
380 - // // setState(() {  
381 - // // memberIndex = value.first;  
382 - // // memberShow = memberList[memberIndex];  
383 - // // });  
384 - // // }  
385 - // // }, selecteds: memberIndex == null ? [] : [memberIndex])  
386 - // // .then((value) {});  
387 - // },  
388 - // child: Container(  
389 - // // height: ScreenUtil().setWidth(60),  
390 - // padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(50)),  
391 - // child: Row(  
392 - // mainAxisAlignment: MainAxisAlignment.spaceBetween,  
393 - // crossAxisAlignment: CrossAxisAlignment.center,  
394 - // children: [  
395 - // Container(  
396 - // // color: Colors.red,  
397 - // width: ScreenUtil().setWidth(150),  
398 - // height: ScreenUtil().setWidth(35),  
399 - // child: Text(  
400 - // '会员系统选择',  
401 - // style: TextStyle(  
402 - // fontSize: ScreenUtil().setSp(32),  
403 - // color: MyColours.color_515151),  
404 - // ),  
405 - // ),  
406 - // Expanded(  
407 - // child: Text(  
408 - // memberShow,  
409 - // overflow: TextOverflow.ellipsis,  
410 - // style: TextStyle(  
411 - // color: MyColours.color_353535,  
412 - // fontSize: ScreenUtil().setSp(28),  
413 - // ),  
414 - // )),  
415 - // HEmptyView(10),  
416 - // Image.asset(  
417 - // Utils.getImgPath(  
418 - // showLabel ? 'c_arrow_up' : 'c_arrow_down'),  
419 - // width: ScreenUtil().setWidth(24),  
420 - // // height: ScreenUtil().setWidth(10),  
421 - // )  
422 - // ],  
423 - // ),  
424 - // )),  
425 - // _itemWidget('企业代码或账号', "点击这里输入企业代码或账号", null, null),  
426 - // VEmptyView(50),  
427 - // _itemWidget('管理员账号', "点击这里输入管理员账号", null, null),  
428 - // VEmptyView(50),  
429 - // _itemWidget('密码', "点击这里输入管理员密码", null, null),  
430 - // VEmptyView(40),  
431 - // Center(  
432 - // child: Text(  
433 - // '请与纳极客服400-000-9690 联系对接事宜',  
434 - // style: TextStyle(  
435 - // color: MyColours.color_999999, fontSize: font(12)),  
436 - // ))  
437 - ],  
438 - ), 344 + Container(
  345 + color: MyColours.color_ffffff,
  346 + padding: EdgeInsets.symmetric(horizontal: w(48)),
  347 + margin: EdgeInsets.only(bottom: w(35), top: w(25)),
  348 + child: RoundButton(
  349 + // content: widget.fromPage == 'tablePhoto'
  350 + // ? '确定'
  351 + // : "已选${selectNum}个 确定",
  352 + text: '保存',
  353 + // width: w(128),
  354 + height: w(40),
  355 + radius: r(4),
  356 + isBold: false,
  357 + gradientStart: MyColours.color_438E93,
  358 + gradientEnd: MyColours.color_438E93,
  359 + fontSize: 28,
  360 + textColor: MyColours.color_ffffff,
  361 + onPressed: () {
  362 + _sellerGuestSet();
  363 + },
  364 + ),
  365 + )
  366 +
  367 + // VEmptyView(34),
  368 + // MyDivider(
  369 + // double.infinity,
  370 + // w(1),
  371 + // color: MyColours.color_E7E7E7,
  372 + // ),
  373 + // VEmptyView(52),
  374 + // InkWell(
  375 + // onTap: () {
  376 + // setState(() {
  377 + // swichSync = !swichSync;
  378 + // });
  379 + // // _sellerGuestSet();
  380 + // },
  381 + // child: Row(
  382 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  383 + // crossAxisAlignment: CrossAxisAlignment.center,
  384 + // children: [
  385 + // Text('是否与会员系统同步',
  386 + // style: TextStyle(
  387 + // color: MyColours.color_515151,
  388 + // fontSize: ScreenUtil().setSp(32))),
  389 + // Image.asset(
  390 + // swichSync
  391 + // ? Utils.getImgPath('f_swich_on')
  392 + // : Utils.getImgPath('f_swich_off'),
  393 + // width: ScreenUtil().setWidth(70),
  394 + // // height: ScreenUtil().setWidth(82),
  395 + // ),
  396 + // ],
  397 + // ),
  398 + // ),
  399 + // VEmptyView(48),
  400 + // InkWell(
  401 + // onTap: () {
  402 + // FocusScope.of(context).requestFocus(FocusNode()); //隐藏键盘
  403 + // // DialogUtil.showSelectCusmanDialog(context, memberList,
  404 + // // (value) {
  405 + // // if (value != null) {
  406 + // // setState(() {
  407 + // // memberIndex = value.first;
  408 + // // memberShow = memberList[memberIndex];
  409 + // // });
  410 + // // }
  411 + // // }, selecteds: memberIndex == null ? [] : [memberIndex])
  412 + // // .then((value) {});
  413 + // },
  414 + // child: Container(
  415 + // // height: ScreenUtil().setWidth(60),
  416 + // padding: EdgeInsets.only(bottom: ScreenUtil().setWidth(50)),
  417 + // child: Row(
  418 + // mainAxisAlignment: MainAxisAlignment.spaceBetween,
  419 + // crossAxisAlignment: CrossAxisAlignment.center,
  420 + // children: [
  421 + // Container(
  422 + // // color: Colors.red,
  423 + // width: ScreenUtil().setWidth(150),
  424 + // height: ScreenUtil().setWidth(35),
  425 + // child: Text(
  426 + // '会员系统选择',
  427 + // style: TextStyle(
  428 + // fontSize: ScreenUtil().setSp(32),
  429 + // color: MyColours.color_515151),
  430 + // ),
  431 + // ),
  432 + // Expanded(
  433 + // child: Text(
  434 + // memberShow,
  435 + // overflow: TextOverflow.ellipsis,
  436 + // style: TextStyle(
  437 + // color: MyColours.color_353535,
  438 + // fontSize: ScreenUtil().setSp(28),
  439 + // ),
  440 + // )),
  441 + // HEmptyView(10),
  442 + // Image.asset(
  443 + // Utils.getImgPath(
  444 + // showLabel ? 'c_arrow_up' : 'c_arrow_down'),
  445 + // width: ScreenUtil().setWidth(24),
  446 + // // height: ScreenUtil().setWidth(10),
  447 + // )
  448 + // ],
  449 + // ),
  450 + // )),
  451 + // _itemWidget('企业代码或账号', "点击这里输入企业代码或账号", null, null),
  452 + // VEmptyView(50),
  453 + // _itemWidget('管理员账号', "点击这里输入管理员账号", null, null),
  454 + // VEmptyView(50),
  455 + // _itemWidget('密码', "点击这里输入管理员密码", null, null),
  456 + // VEmptyView(40),
  457 + // Center(
  458 + // child: Text(
  459 + // '请与纳极客服400-000-9690 联系对接事宜',
  460 + // style: TextStyle(
  461 + // color: MyColours.color_999999, fontSize: font(12)),
  462 + // ))
  463 + ],
439 ), 464 ),
440 ), 465 ),
441 )); 466 ));
@@ -548,6 +548,24 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> { @@ -548,6 +548,24 @@ class _CreateStoreWinePageState extends State<CreateStoreWinePage> {
548 Utils.showToast('请输入联系电话!'); 548 Utils.showToast('请输入联系电话!');
549 return false; 549 return false;
550 } 550 }
  551 +
  552 + UserModel userModel =
  553 + Provider.of<UserModel>(context, listen: false);
  554 +
  555 + //判断是否可以输入自己的手机号
  556 + CustomerProvider customerProvider =
  557 + Provider.of<CustomerProvider>(context, listen: false);
  558 + await customerProvider.getSellerGuest(context);
  559 + if (customerProvider.isselfphone) {
  560 + //录入客户电话时不能用自己手机号(管店)
  561 + if (phoneC.text.trim().length > 0) {
  562 + if (userModel.user.userphone == phoneC.text.trim()) {
  563 + Utils.showToast('录入客户电话时不能用自己手机号!');
  564 + return null;
  565 + }
  566 + }
  567 + }
  568 +
551 if (nameC.text.trim().length == 0) { 569 if (nameC.text.trim().length == 0) {
552 Utils.showToast('请输入客人姓名!'); 570 Utils.showToast('请输入客人姓名!');
553 return false; 571 return false;
@@ -1894,8 +1894,11 @@ class CustomerProvider extends ChangeNotifier { @@ -1894,8 +1894,11 @@ class CustomerProvider extends ChangeNotifier {
1894 } 1894 }
1895 1895
1896 //获取商家客情设置 1896 //获取商家客情设置
1897 - Future<bool> getSellerGuest(BuildContext context, Map<String, String> params, 1897 + Future<bool> getSellerGuest(BuildContext context,
1898 {bool showLoading = false}) async { 1898 {bool showLoading = false}) async {
  1899 + Map<String, String> params = {
  1900 + "sellerid": Provider.of<UserModel>(context, listen: false).user.sellerid,
  1901 + };
1899 BaseResp<dynamic> baseResp = await DioUtil() 1902 BaseResp<dynamic> baseResp = await DioUtil()
1900 .request<dynamic>(context, Method.get, HttpUrl.seller_guest_get, 1903 .request<dynamic>(context, Method.get, HttpUrl.seller_guest_get,
1901 data: params, showLoading: showLoading) 1904 data: params, showLoading: showLoading)
@@ -1912,8 +1915,9 @@ class CustomerProvider extends ChangeNotifier { @@ -1912,8 +1915,9 @@ class CustomerProvider extends ChangeNotifier {
1912 isrepair = baseResp.responseData['data']['is_additional'] == '1' 1915 isrepair = baseResp.responseData['data']['is_additional'] == '1'
1913 ? true 1916 ? true
1914 : false; 1917 : false;
1915 - isselfphone =  
1916 - baseResp.responseData['data']['isselfphone'] == '1' ? true : false; 1918 + isselfphone = baseResp.responseData['data']['is_enter_self'] == '1'
  1919 + ? true
  1920 + : false;
1917 return true; 1921 return true;
1918 } 1922 }
1919 1923
@@ -10,6 +10,7 @@ import 'package:one_key/models/user_history_entity.dart'; @@ -10,6 +10,7 @@ import 'package:one_key/models/user_history_entity.dart';
10 import 'package:one_key/net/base_resp.dart'; 10 import 'package:one_key/net/base_resp.dart';
11 import 'package:one_key/net/dio_util.dart'; 11 import 'package:one_key/net/dio_util.dart';
12 import 'package:one_key/net/http_url.dart'; 12 import 'package:one_key/net/http_url.dart';
  13 +import 'package:one_key/provider/customer_provider.dart';
13 import 'package:one_key/provider/notebook_detail_model.dart'; 14 import 'package:one_key/provider/notebook_detail_model.dart';
14 import 'package:one_key/provider/user_model.dart'; 15 import 'package:one_key/provider/user_model.dart';
15 import 'package:one_key/utils/utils.dart'; 16 import 'package:one_key/utils/utils.dart';
@@ -576,6 +577,20 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -576,6 +577,20 @@ class NotebookDetailChangeModel with ChangeNotifier {
576 BuildContext context, String nameStr, String uid) async { 577 BuildContext context, String nameStr, String uid) async {
577 UserModel userModel = Provider.of<UserModel>(context, listen: false); 578 UserModel userModel = Provider.of<UserModel>(context, listen: false);
578 579
  580 + //判断是否可以输入自己的手机号
  581 + CustomerProvider customerProvider =
  582 + Provider.of<CustomerProvider>(context, listen: false);
  583 + await customerProvider.getSellerGuest(context);
  584 + if (customerProvider.isselfphone) {
  585 + //录入客户电话时不能用自己手机号(管店)
  586 + if (phoneController.text.trim().length > 0) {
  587 + if (userModel.user.userphone == phoneController.text.trim()) {
  588 + Utils.showToast('录入客户电话时不能用自己手机号!');
  589 + return null;
  590 + }
  591 + }
  592 + }
  593 +
579 // String tempTime; 594 // String tempTime;
580 // if (currTimeIndex == 1) { 595 // if (currTimeIndex == 1) {
581 // tempTime = '08:00'; 596 // tempTime = '08:00';
@@ -711,7 +726,7 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -711,7 +726,7 @@ class NotebookDetailChangeModel with ChangeNotifier {
711 .catchError((error) { 726 .catchError((error) {
712 print(error.toString()); 727 print(error.toString());
713 }); 728 });
714 - SunReserveInfoModel itemModel; 729 + SunReserveInfoModel itemModel = SunReserveInfoModel(null, null, null);
715 if (baseResp == null) return itemModel; 730 if (baseResp == null) return itemModel;
716 if (baseResp.code == Constant.status_success) { 731 if (baseResp.code == Constant.status_success) {
717 if (int.parse(baseResp.status) != Constant.status_success) { 732 if (int.parse(baseResp.status) != Constant.status_success) {
@@ -734,6 +749,20 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -734,6 +749,20 @@ class NotebookDetailChangeModel with ChangeNotifier {
734 Future<SunReserveInfoModel> updateOnlineReserveInfo( 749 Future<SunReserveInfoModel> updateOnlineReserveInfo(
735 BuildContext context, String nameStr, String uid) async { 750 BuildContext context, String nameStr, String uid) async {
736 UserModel userModel = Provider.of<UserModel>(context, listen: false); 751 UserModel userModel = Provider.of<UserModel>(context, listen: false);
  752 +
  753 + //判断是否可以输入自己的手机号
  754 + CustomerProvider customerProvider =
  755 + Provider.of<CustomerProvider>(context, listen: false);
  756 + await customerProvider.getSellerGuest(context);
  757 + if (customerProvider.isselfphone) {
  758 + //录入客户电话时不能用自己手机号(管店)
  759 + if (phoneController.text.trim().length > 0) {
  760 + if (userModel.user.userphone == phoneController.text.trim()) {
  761 + Utils.showToast('录入客户电话时不能用自己手机号!');
  762 + return null;
  763 + }
  764 + }
  765 + }
737 // String pnum = ''; 766 // String pnum = '';
738 // for (var item in personNumList) { 767 // for (var item in personNumList) {
739 // if (item['isSelect']) { 768 // if (item['isSelect']) {
@@ -944,8 +973,7 @@ class NotebookDetailChangeModel with ChangeNotifier { @@ -944,8 +973,7 @@ class NotebookDetailChangeModel with ChangeNotifier {
944 } 973 }
945 // if (customController.text.trim().length > 0) { 974 // if (customController.text.trim().length > 0) {
946 975
947 - params['cusdem'] = customController.text; //预订人需求:25汉字  
948 - 976 + params['cusdem'] = customController.text; //预订人需求:25汉字
949 977
950 // } 978 // }
951 print(params); 979 print(params);
@@ -17,6 +17,7 @@ import 'package:one_key/net/base_resp.dart'; @@ -17,6 +17,7 @@ import 'package:one_key/net/base_resp.dart';
17 import 'package:one_key/net/dio_util.dart'; 17 import 'package:one_key/net/dio_util.dart';
18 import 'package:one_key/net/http_url.dart'; 18 import 'package:one_key/net/http_url.dart';
19 import 'package:one_key/models/table.dart' as t; 19 import 'package:one_key/models/table.dart' as t;
  20 +import 'package:one_key/provider/customer_provider.dart';
20 import 'package:one_key/provider/store_base_info_provider.dart'; 21 import 'package:one_key/provider/store_base_info_provider.dart';
21 import 'package:one_key/provider/user_model.dart'; 22 import 'package:one_key/provider/user_model.dart';
22 import 'package:one_key/route/navigator_util.dart'; 23 import 'package:one_key/route/navigator_util.dart';
@@ -427,6 +428,22 @@ class TableManagerModel with ChangeNotifier { @@ -427,6 +428,22 @@ class TableManagerModel with ChangeNotifier {
427 Utils.showToast('请选择桌位'); 428 Utils.showToast('请选择桌位');
428 return null; 429 return null;
429 } 430 }
  431 +
  432 + //判断是否可以输入自己的手机号
  433 + CustomerProvider customerProvider =
  434 + Provider.of<CustomerProvider>(context, listen: false);
  435 + await customerProvider.getSellerGuest(context);
  436 + if (customerProvider.isselfphone) {
  437 + //录入客户电话时不能用自己手机号(管店)
  438 + if (guest != null && guest.phone != null) {
  439 + print(Provider.of<UserModel>(context, listen: false).user.userphone);
  440 + if (Provider.of<UserModel>(context, listen: false).user.userphone ==
  441 + guest.phone) {
  442 + Utils.showToast('录入客户电话时不能用自己手机号!');
  443 + return null;
  444 + }
  445 + }
  446 + }
430 bool sucess = await getReserveList( 447 bool sucess = await getReserveList(
431 context, 448 context,
432 showMsg: true, 449 showMsg: true,
@@ -525,11 +525,13 @@ var noteBookChangeFPageHandle = new Handler( @@ -525,11 +525,13 @@ var noteBookChangeFPageHandle = new Handler(
525 create: (_) => NotebookDetailChangeModel(detailEntity), 525 create: (_) => NotebookDetailChangeModel(detailEntity),
526 child: ChangeNotifierProvider<RemarkManagerModel>( 526 child: ChangeNotifierProvider<RemarkManagerModel>(
527 create: (_) => RemarkManagerModel(), 527 create: (_) => RemarkManagerModel(),
528 - child: NoteBookChangeFPage(  
529 - detailEntity: detailEntity,  
530 - rid: rid,  
531 - back: back,  
532 - ))); 528 + child: ChangeNotifierProvider<CustomerProvider>(
  529 + create: (_) => CustomerProvider(),
  530 + child: NoteBookChangeFPage(
  531 + detailEntity: detailEntity,
  532 + rid: rid,
  533 + back: back,
  534 + ))));
533 }); 535 });
534 536
535 // 跳转可订时段管理页面 537 // 跳转可订时段管理页面
@@ -3177,7 +3179,8 @@ var verifyFoodPageHandle = new Handler( @@ -3177,7 +3179,8 @@ var verifyFoodPageHandle = new Handler(
3177 var areasSelectPageHandle = new Handler( 3179 var areasSelectPageHandle = new Handler(
3178 handlerFunc: (BuildContext context, Map<String, List<Object>> params) { 3180 handlerFunc: (BuildContext context, Map<String, List<Object>> params) {
3179 String rid = params["rid"].first; 3181 String rid = params["rid"].first;
3180 - String name = params["name"].first; 3182 + String name = params["name"].first;
3181 return ChangeNotifierProvider<MyTableManageHomeModel>( 3183 return ChangeNotifierProvider<MyTableManageHomeModel>(
3182 - create: (_) => MyTableManageHomeModel(), child: AreasSelectPage(rid:rid,name:name)); 3184 + create: (_) => MyTableManageHomeModel(),
  3185 + child: AreasSelectPage(rid: rid, name: name));
3183 }); 3186 });