|
@@ -11,6 +11,7 @@ import 'package:one_key/models/sms_info.dart'; |
|
@@ -11,6 +11,7 @@ import 'package:one_key/models/sms_info.dart'; |
|
11
|
import 'package:one_key/models/store_info.dart';
|
11
|
import 'package:one_key/models/store_info.dart';
|
|
12
|
import 'package:one_key/models/user.dart';
|
12
|
import 'package:one_key/models/user.dart';
|
|
13
|
import 'package:one_key/models/version.dart';
|
13
|
import 'package:one_key/models/version.dart';
|
|
|
|
14
|
+import 'package:one_key/provider/base_info_provider.dart';
|
|
14
|
import 'package:one_key/provider/create_store_model.dart';
|
15
|
import 'package:one_key/provider/create_store_model.dart';
|
|
15
|
import 'package:one_key/provider/my_model.dart';
|
16
|
import 'package:one_key/provider/my_model.dart';
|
|
16
|
import 'package:one_key/provider/update_model.dart';
|
17
|
import 'package:one_key/provider/update_model.dart';
|
|
@@ -63,6 +64,10 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
@@ -63,6 +64,10 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
63
|
late CollectStoreProvider collectStoreProvider;
|
64
|
late CollectStoreProvider collectStoreProvider;
|
|
64
|
bool isStoreWine = false;
|
65
|
bool isStoreWine = false;
|
|
65
|
|
66
|
|
|
|
|
67
|
+ late BaseIndoProvider _baseIndoProvider;
|
|
|
|
68
|
+
|
|
|
|
69
|
+ String? selfImage;
|
|
|
|
70
|
+
|
|
66
|
@override
|
71
|
@override
|
|
67
|
void initState() {
|
72
|
void initState() {
|
|
68
|
// TODO: implement initState
|
73
|
// TODO: implement initState
|
|
@@ -107,6 +112,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
@@ -107,6 +112,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
107
|
'迎宾') {
|
112
|
'迎宾') {
|
|
108
|
_getAuthUserLists(showLoading: false);
|
113
|
_getAuthUserLists(showLoading: false);
|
|
109
|
}
|
114
|
}
|
|
|
|
115
|
+ _getCustomerActivityBaseinfo();
|
|
110
|
getMyPageCountData();
|
116
|
getMyPageCountData();
|
|
111
|
|
117
|
|
|
112
|
///apk版本检测
|
118
|
///apk版本检测
|
|
@@ -120,6 +126,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
@@ -120,6 +126,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
120
|
_getSmsInfo(context);
|
126
|
_getSmsInfo(context);
|
|
121
|
// getMyPageCountData();
|
127
|
// getMyPageCountData();
|
|
122
|
});
|
128
|
});
|
|
|
|
129
|
+
|
|
|
|
130
|
+ EventBus().on('refreshMyImage', (arg) {
|
|
|
|
131
|
+ // _getSmsInfo(context);
|
|
|
|
132
|
+ _getCustomerActivityBaseinfo();
|
|
|
|
133
|
+ // getMyPageCountData();
|
|
|
|
134
|
+ });
|
|
123
|
}
|
135
|
}
|
|
124
|
|
136
|
|
|
125
|
@override
|
137
|
@override
|
|
@@ -129,6 +141,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
@@ -129,6 +141,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
129
|
// AzhonAppUpdate.dispose();
|
141
|
// AzhonAppUpdate.dispose();
|
|
130
|
EventBus().off('changeStatusColor');
|
142
|
EventBus().off('changeStatusColor');
|
|
131
|
EventBus().off('refreshMySms');
|
143
|
EventBus().off('refreshMySms');
|
|
|
|
144
|
+
|
|
|
|
145
|
+ EventBus().off('refreshMyImage');
|
|
132
|
}
|
146
|
}
|
|
133
|
|
147
|
|
|
134
|
@override
|
148
|
@override
|
|
@@ -184,6 +198,19 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
@@ -184,6 +198,19 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
184
|
// }
|
198
|
// }
|
|
185
|
// }
|
199
|
// }
|
|
186
|
|
200
|
|
|
|
|
201
|
+ _getCustomerActivityBaseinfo() async {
|
|
|
|
202
|
+ Map<String, String?> params = {
|
|
|
|
203
|
+ 'sellerid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
204
|
+ "uid": Provider.of<UserModel>(context, listen: false).user!.openid,
|
|
|
|
205
|
+ };
|
|
|
|
206
|
+
|
|
|
|
207
|
+ bool success =
|
|
|
|
208
|
+ await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
|
|
|
|
209
|
+ if (success) {
|
|
|
|
210
|
+ selfImage = _baseIndoProvider.baseInfoSunModel!.photo;
|
|
|
|
211
|
+ }
|
|
|
|
212
|
+ }
|
|
|
|
213
|
+
|
|
187
|
//获取员工信息列表
|
214
|
//获取员工信息列表
|
|
188
|
_getAuthUserLists({bool showLoading = true}) async {
|
215
|
_getAuthUserLists({bool showLoading = true}) async {
|
|
189
|
Map<String, String?> params = {
|
216
|
Map<String, String?> params = {
|
|
@@ -489,6 +516,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
@@ -489,6 +516,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
489
|
createStoreModel = Provider.of<CreateStoreModel>(context, listen: false);
|
516
|
createStoreModel = Provider.of<CreateStoreModel>(context, listen: false);
|
|
490
|
collectStoreProvider =
|
517
|
collectStoreProvider =
|
|
491
|
Provider.of<CollectStoreProvider>(context, listen: true);
|
518
|
Provider.of<CollectStoreProvider>(context, listen: true);
|
|
|
|
519
|
+
|
|
|
|
520
|
+ _baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
|
|
492
|
return Scaffold(
|
521
|
return Scaffold(
|
|
493
|
backgroundColor: MyColours.color_f3f3f3,
|
522
|
backgroundColor: MyColours.color_f3f3f3,
|
|
494
|
// appBar: AppBar(
|
523
|
// appBar: AppBar(
|
|
@@ -534,86 +563,125 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
@@ -534,86 +563,125 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
534
|
child: Row(
|
563
|
child: Row(
|
|
535
|
crossAxisAlignment: CrossAxisAlignment.center,
|
564
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
536
|
children: [
|
565
|
children: [
|
|
537
|
- Column(
|
|
|
|
538
|
- crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
539
|
- mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
540
|
- children: [
|
|
|
|
541
|
- Padding(
|
|
|
|
542
|
- padding: EdgeInsets.only(left: w(13)),
|
|
|
|
543
|
- child: model.user!.sellerimage ==
|
|
|
|
544
|
- null ||
|
|
|
|
545
|
- model.user!.sellerimage == ''
|
|
|
|
546
|
- ? Image.asset(
|
|
|
|
547
|
- Utils.getImgPath('base_tx_bg'),
|
|
|
|
548
|
- fit: BoxFit.cover,
|
|
|
|
549
|
- width: ScreenUtil()
|
|
|
|
550
|
- .setWidth(44 * 2),
|
|
|
|
551
|
- height: ScreenUtil()
|
|
|
|
552
|
- .setWidth(44 * 2),
|
|
|
|
553
|
- )
|
|
|
|
554
|
- : Container(
|
|
|
|
555
|
- width: w(44),
|
|
|
|
556
|
- height: w(44),
|
|
|
|
557
|
- decoration: BoxDecoration(
|
|
|
|
558
|
- border: Border.all(
|
|
|
|
559
|
- width: w(2),
|
|
|
|
560
|
- color: Colors.white),
|
|
|
|
561
|
- borderRadius:
|
|
|
|
562
|
- BorderRadius.all(Radius
|
|
|
|
563
|
- .circular(r(44))),
|
|
|
|
564
|
- image: DecorationImage(
|
|
|
|
565
|
- image: NetworkImage(model
|
|
|
|
566
|
- .user!.sellerimage!),
|
|
|
|
567
|
- )))),
|
|
|
|
568
|
- VEmptyView(8),
|
|
|
|
569
|
- Container(
|
|
|
|
570
|
- constraints: BoxConstraints(
|
|
|
|
571
|
- maxWidth: ScreenUtil().setWidth(400),
|
|
|
|
572
|
- ),
|
|
|
|
573
|
- child: Text(
|
|
|
|
574
|
- '杨经理 店长 >',
|
|
|
|
575
|
- maxLines: 1,
|
|
|
|
576
|
- overflow: TextOverflow.ellipsis,
|
|
|
|
577
|
- style: TextStyle(
|
|
|
|
578
|
- letterSpacing: 0.2,
|
|
|
|
579
|
- fontWeight: FontWeight.w600,
|
|
|
|
580
|
- color: MyColours.color_ffffff,
|
|
|
|
581
|
- fontSize: ScreenUtil().setSp(24)),
|
|
|
|
582
|
- ),
|
|
|
|
583
|
- ),
|
|
|
|
584
|
- VEmptyView(8),
|
|
|
|
585
|
- Text(
|
|
|
|
586
|
- '员工编号:' +
|
|
|
|
587
|
- model.user!.account! +
|
|
|
|
588
|
- " " +
|
|
|
|
589
|
- (model.user!.role_name_addition ??
|
|
|
|
590
|
- ''),
|
|
|
|
591
|
- style: TextStyle(
|
|
|
|
592
|
- fontWeight: FontWeight.bold,
|
|
|
|
593
|
- color: MyColours.color_ffffff,
|
|
|
|
594
|
- fontSize: font(10)),
|
|
|
|
595
|
- ),
|
|
|
|
596
|
- ],
|
|
|
|
597
|
- ),
|
566
|
+ InkWell(
|
|
|
|
567
|
+ onTap: () {
|
|
|
|
568
|
+ if (outDay == '0') {
|
|
|
|
569
|
+ return;
|
|
|
|
570
|
+ }
|
|
|
|
571
|
+
|
|
|
|
572
|
+ if (Utils.getAuthority(context, '个人信息')) {
|
|
|
|
573
|
+ NavigatorUtil.goBaseInfoPage(
|
|
|
|
574
|
+ context, FromPage.FromPageMyPage);
|
|
|
|
575
|
+ }
|
|
|
|
576
|
+ },
|
|
|
|
577
|
+ child: Column(
|
|
|
|
578
|
+ crossAxisAlignment:
|
|
|
|
579
|
+ CrossAxisAlignment.start,
|
|
|
|
580
|
+ mainAxisAlignment:
|
|
|
|
581
|
+ MainAxisAlignment.center,
|
|
|
|
582
|
+ children: [
|
|
|
|
583
|
+ Padding(
|
|
|
|
584
|
+ padding:
|
|
|
|
585
|
+ EdgeInsets.only(left: w(13)),
|
|
|
|
586
|
+ child: selfImage == null ||
|
|
|
|
587
|
+ selfImage == ''
|
|
|
|
588
|
+ ? Image.asset(
|
|
|
|
589
|
+ Utils.getImgPath(
|
|
|
|
590
|
+ 'base_tx_bg'),
|
|
|
|
591
|
+ fit: BoxFit.cover,
|
|
|
|
592
|
+ width: ScreenUtil()
|
|
|
|
593
|
+ .setWidth(44 * 2),
|
|
|
|
594
|
+ height: ScreenUtil()
|
|
|
|
595
|
+ .setWidth(44 * 2),
|
|
|
|
596
|
+ )
|
|
|
|
597
|
+ : Container(
|
|
|
|
598
|
+ width: w(44),
|
|
|
|
599
|
+ height: w(44),
|
|
|
|
600
|
+ decoration: BoxDecoration(
|
|
|
|
601
|
+ border: Border.all(
|
|
|
|
602
|
+ width: w(2),
|
|
|
|
603
|
+ color:
|
|
|
|
604
|
+ Colors.white),
|
|
|
|
605
|
+ borderRadius:
|
|
|
|
606
|
+ BorderRadius.all(
|
|
|
|
607
|
+ Radius.circular(
|
|
|
|
608
|
+ r(44))),
|
|
|
|
609
|
+ image: DecorationImage(
|
|
|
|
610
|
+ fit: BoxFit.cover,
|
|
|
|
611
|
+ image: NetworkImage(
|
|
|
|
612
|
+ selfImage!),
|
|
|
|
613
|
+ )))),
|
|
|
|
614
|
+ VEmptyView(8),
|
|
|
|
615
|
+ Container(
|
|
|
|
616
|
+ constraints: BoxConstraints(
|
|
|
|
617
|
+ maxWidth:
|
|
|
|
618
|
+ ScreenUtil().setWidth(400),
|
|
|
|
619
|
+ ),
|
|
|
|
620
|
+ child: Text(
|
|
|
|
621
|
+ '${model.user!.nickName} ${model.user!.role_name_addition} >',
|
|
|
|
622
|
+ maxLines: 1,
|
|
|
|
623
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
624
|
+ style: TextStyle(
|
|
|
|
625
|
+ letterSpacing: 0.2,
|
|
|
|
626
|
+ fontWeight: FontWeight.w600,
|
|
|
|
627
|
+ color: MyColours.color_ffffff,
|
|
|
|
628
|
+ fontSize:
|
|
|
|
629
|
+ ScreenUtil().setSp(24)),
|
|
|
|
630
|
+ ),
|
|
|
|
631
|
+ ),
|
|
|
|
632
|
+ VEmptyView(8),
|
|
|
|
633
|
+ Text(
|
|
|
|
634
|
+ '员工编号:' + model.user!.account!,
|
|
|
|
635
|
+ style: TextStyle(
|
|
|
|
636
|
+ fontWeight: FontWeight.bold,
|
|
|
|
637
|
+ color: MyColours.color_ffffff,
|
|
|
|
638
|
+ fontSize: font(10)),
|
|
|
|
639
|
+ ),
|
|
|
|
640
|
+ ],
|
|
|
|
641
|
+ )),
|
|
598
|
HEmptyView(22),
|
642
|
HEmptyView(22),
|
|
599
|
Spacer(),
|
643
|
Spacer(),
|
|
600
|
Column(
|
644
|
Column(
|
|
601
|
crossAxisAlignment: CrossAxisAlignment.end,
|
645
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
602
|
mainAxisAlignment: MainAxisAlignment.center,
|
646
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
603
|
children: [
|
647
|
children: [
|
|
604
|
- Container(
|
|
|
|
605
|
- child: Text(
|
|
|
|
606
|
- '${model.user!.sellername} >',
|
|
|
|
607
|
- maxLines: 1,
|
|
|
|
608
|
- overflow: TextOverflow.ellipsis,
|
|
|
|
609
|
- style: TextStyle(
|
|
|
|
610
|
- letterSpacing: 0.2,
|
|
|
|
611
|
- fontWeight: FontWeight.w600,
|
|
|
|
612
|
- color: MyColours.color_ffffff,
|
|
|
|
613
|
- fontSize: ScreenUtil().setSp(32)),
|
|
|
|
614
|
- ),
|
|
|
|
615
|
- ),
|
|
|
|
616
|
- VEmptyView(12),
|
648
|
+ InkWell(
|
|
|
|
649
|
+ onTap: () async {
|
|
|
|
650
|
+ //
|
|
|
|
651
|
+ if (outDay == '0') {
|
|
|
|
652
|
+ return;
|
|
|
|
653
|
+ }
|
|
|
|
654
|
+ if (Utils.getAuthority(
|
|
|
|
655
|
+ context, '店铺信息')) {
|
|
|
|
656
|
+ await NavigatorUtil
|
|
|
|
657
|
+ .goStoreBaseInfoPage(context);
|
|
|
|
658
|
+ // print(image['image']);
|
|
|
|
659
|
+ // UserModel userModel =
|
|
|
|
660
|
+ // Provider.of<UserModel>(context,
|
|
|
|
661
|
+ // listen: false);
|
|
|
|
662
|
+ // User user = userModel.user;
|
|
|
|
663
|
+ // user.sellerimage = image['image'];
|
|
|
|
664
|
+ // await App.sp.setString('user',
|
|
|
|
665
|
+ // json.encode(user.toJson()));
|
|
|
|
666
|
+ // print(userModel.user);
|
|
|
|
667
|
+ setState(() {});
|
|
|
|
668
|
+ }
|
|
|
|
669
|
+ },
|
|
|
|
670
|
+ child: Container(
|
|
|
|
671
|
+ padding:
|
|
|
|
672
|
+ EdgeInsets.only(bottom: w(6)),
|
|
|
|
673
|
+ child: Text(
|
|
|
|
674
|
+ '${model.user!.sellername} >',
|
|
|
|
675
|
+ maxLines: 1,
|
|
|
|
676
|
+ overflow: TextOverflow.ellipsis,
|
|
|
|
677
|
+ style: TextStyle(
|
|
|
|
678
|
+ letterSpacing: 0.2,
|
|
|
|
679
|
+ fontWeight: FontWeight.w600,
|
|
|
|
680
|
+ color: MyColours.color_ffffff,
|
|
|
|
681
|
+ fontSize:
|
|
|
|
682
|
+ ScreenUtil().setSp(32)),
|
|
|
|
683
|
+ ),
|
|
|
|
684
|
+ )),
|
|
617
|
Text(
|
685
|
Text(
|
|
618
|
'店铺编号:' +
|
686
|
'店铺编号:' +
|
|
619
|
model.user!.sellerid!.padLeft(6, '0'),
|
687
|
model.user!.sellerid!.padLeft(6, '0'),
|