|
@@ -311,6 +311,19 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -311,6 +311,19 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
311
|
_user.role_name = '迎宾';
|
311
|
_user.role_name = '迎宾';
|
|
312
|
|
312
|
|
|
313
|
await UserModel().saveUserInfo(_user);
|
313
|
await UserModel().saveUserInfo(_user);
|
|
|
|
314
|
+ print( Provider.of<UserModel>(context, listen: false).user.role_name_addition);
|
|
|
|
315
|
+ }
|
|
|
|
316
|
+ }
|
|
|
|
317
|
+
|
|
|
|
318
|
+ _saveUserAddition(String rolename) async {
|
|
|
|
319
|
+ if (App.sp.containsKey('user')) {
|
|
|
|
320
|
+ String s = App.sp.getString('user');
|
|
|
|
321
|
+ User _user = User.fromJson(json.decode(s));
|
|
|
|
322
|
+ _user.role_name_addition = rolename;
|
|
|
|
323
|
+
|
|
|
|
324
|
+
|
|
|
|
325
|
+ await UserModel().saveUserInfo(_user);
|
|
|
|
326
|
+ print( Provider.of<UserModel>(context, listen: false).user.role_name_addition);
|
|
314
|
}
|
327
|
}
|
|
315
|
}
|
328
|
}
|
|
316
|
|
329
|
|
|
@@ -330,6 +343,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -330,6 +343,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
330
|
if (user.openid == element.id) {
|
343
|
if (user.openid == element.id) {
|
|
331
|
if (element.accountType == '3') {
|
344
|
if (element.accountType == '3') {
|
|
332
|
_saveUser('管理员');
|
345
|
_saveUser('管理员');
|
|
|
|
346
|
+ }else{
|
|
|
|
347
|
+ _saveUserAddition('管理员');
|
|
333
|
}
|
348
|
}
|
|
334
|
}
|
349
|
}
|
|
335
|
});
|
350
|
});
|
|
@@ -338,6 +353,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -338,6 +353,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
338
|
if (user.openid == element.id) {
|
353
|
if (user.openid == element.id) {
|
|
339
|
if (element.accountType == '3') {
|
354
|
if (element.accountType == '3') {
|
|
340
|
_saveUser('店长');
|
355
|
_saveUser('店长');
|
|
|
|
356
|
+ }else{
|
|
|
|
357
|
+ _saveUserAddition('店长');
|
|
341
|
}
|
358
|
}
|
|
342
|
}
|
359
|
}
|
|
343
|
});
|
360
|
});
|
|
@@ -346,6 +363,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -346,6 +363,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
346
|
if (user.openid == element.id) {
|
363
|
if (user.openid == element.id) {
|
|
347
|
if (element.accountType == '3') {
|
364
|
if (element.accountType == '3') {
|
|
348
|
_saveUser('客户经理');
|
365
|
_saveUser('客户经理');
|
|
|
|
366
|
+ }else{
|
|
|
|
367
|
+ _saveUserAddition('客户经理');
|
|
349
|
}
|
368
|
}
|
|
350
|
}
|
369
|
}
|
|
351
|
});
|
370
|
});
|
|
@@ -354,6 +373,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -354,6 +373,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
354
|
if (user.openid == element.id) {
|
373
|
if (user.openid == element.id) {
|
|
355
|
if (element.accountType == '3') {
|
374
|
if (element.accountType == '3') {
|
|
356
|
_saveUser('收银员');
|
375
|
_saveUser('收银员');
|
|
|
|
376
|
+ }else{
|
|
|
|
377
|
+ _saveUserAddition('收银员');
|
|
357
|
}
|
378
|
}
|
|
358
|
}
|
379
|
}
|
|
359
|
});
|
380
|
});
|
|
@@ -362,6 +383,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -362,6 +383,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
362
|
if (user.openid == element.id) {
|
383
|
if (user.openid == element.id) {
|
|
363
|
if (element.accountType == '3') {
|
384
|
if (element.accountType == '3') {
|
|
364
|
_saveUser('服务员');
|
385
|
_saveUser('服务员');
|
|
|
|
386
|
+ }else{
|
|
|
|
387
|
+ _saveUserAddition('服务员');
|
|
365
|
}
|
388
|
}
|
|
366
|
}
|
389
|
}
|
|
367
|
});
|
390
|
});
|
|
@@ -370,6 +393,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -370,6 +393,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
370
|
if (user.openid == element.id) {
|
393
|
if (user.openid == element.id) {
|
|
371
|
if (element.accountType == '3') {
|
394
|
if (element.accountType == '3') {
|
|
372
|
_saveUser('前台');
|
395
|
_saveUser('前台');
|
|
|
|
396
|
+ }else{
|
|
|
|
397
|
+ _saveUserAddition('前台');
|
|
373
|
}
|
398
|
}
|
|
374
|
}
|
399
|
}
|
|
375
|
});
|
400
|
});
|
|
@@ -378,6 +403,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -378,6 +403,8 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
378
|
if (user.openid == element.id) {
|
403
|
if (user.openid == element.id) {
|
|
379
|
if (element.accountType == '3') {
|
404
|
if (element.accountType == '3') {
|
|
380
|
_saveUser( '迎宾');
|
405
|
_saveUser( '迎宾');
|
|
|
|
406
|
+ }else{
|
|
|
|
407
|
+ _saveUserAddition('迎宾');
|
|
381
|
}
|
408
|
}
|
|
382
|
}
|
409
|
}
|
|
383
|
});
|
410
|
});
|
|
@@ -1858,10 +1885,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
@@ -1858,10 +1885,12 @@ class HomePageState extends State<HomePage> with WidgetsBindingObserver { |
|
1858
|
}
|
1885
|
}
|
|
1859
|
if (index == 0) {
|
1886
|
if (index == 0) {
|
|
1860
|
if (!Utils.getAuthority(context, '消息中心')) {
|
1887
|
if (!Utils.getAuthority(context, '消息中心')) {
|
|
|
|
1888
|
+ Utils.showToast('您没有相关权限');
|
|
1861
|
return;
|
1889
|
return;
|
|
1862
|
}
|
1890
|
}
|
|
1863
|
} else if (index == 2) {
|
1891
|
} else if (index == 2) {
|
|
1864
|
if (!Utils.getAuthority(context, '桌位')) {
|
1892
|
if (!Utils.getAuthority(context, '桌位')) {
|
|
|
|
1893
|
+ Utils.showToast('您没有相关权限');
|
|
1865
|
return;
|
1894
|
return;
|
|
1866
|
}
|
1895
|
}
|
|
1867
|
} else if (index == 3) {
|
1896
|
} else if (index == 3) {
|