|
...
|
...
|
@@ -11,6 +11,7 @@ import 'package:one_key/models/sms_info.dart'; |
|
|
|
import 'package:one_key/models/store_info.dart';
|
|
|
|
import 'package:one_key/models/user.dart';
|
|
|
|
import 'package:one_key/models/version.dart';
|
|
|
|
import 'package:one_key/provider/base_info_provider.dart';
|
|
|
|
import 'package:one_key/provider/create_store_model.dart';
|
|
|
|
import 'package:one_key/provider/my_model.dart';
|
|
|
|
import 'package:one_key/provider/update_model.dart';
|
|
...
|
...
|
@@ -63,6 +64,10 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
|
|
late CollectStoreProvider collectStoreProvider;
|
|
|
|
bool isStoreWine = false;
|
|
|
|
|
|
|
|
late BaseIndoProvider _baseIndoProvider;
|
|
|
|
|
|
|
|
String? selfImage;
|
|
|
|
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
// TODO: implement initState
|
|
...
|
...
|
@@ -107,6 +112,7 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
|
|
'迎宾') {
|
|
|
|
_getAuthUserLists(showLoading: false);
|
|
|
|
}
|
|
|
|
_getCustomerActivityBaseinfo();
|
|
|
|
getMyPageCountData();
|
|
|
|
|
|
|
|
///apk版本检测
|
|
...
|
...
|
@@ -120,6 +126,12 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
|
|
_getSmsInfo(context);
|
|
|
|
// getMyPageCountData();
|
|
|
|
});
|
|
|
|
|
|
|
|
EventBus().on('refreshMyImage', (arg) {
|
|
|
|
// _getSmsInfo(context);
|
|
|
|
_getCustomerActivityBaseinfo();
|
|
|
|
// getMyPageCountData();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
...
|
...
|
@@ -129,6 +141,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
|
|
// AzhonAppUpdate.dispose();
|
|
|
|
EventBus().off('changeStatusColor');
|
|
|
|
EventBus().off('refreshMySms');
|
|
|
|
|
|
|
|
EventBus().off('refreshMyImage');
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
...
|
...
|
@@ -184,6 +198,19 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
_getCustomerActivityBaseinfo() async {
|
|
|
|
Map<String, String?> params = {
|
|
|
|
'sellerid': Provider.of<UserModel>(context, listen: false).user!.sellerid,
|
|
|
|
"uid": Provider.of<UserModel>(context, listen: false).user!.openid,
|
|
|
|
};
|
|
|
|
|
|
|
|
bool success =
|
|
|
|
await _baseIndoProvider.getCustomerActivityBaseinfo(context, params);
|
|
|
|
if (success) {
|
|
|
|
selfImage = _baseIndoProvider.baseInfoSunModel!.photo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//获取员工信息列表
|
|
|
|
_getAuthUserLists({bool showLoading = true}) async {
|
|
|
|
Map<String, String?> params = {
|
|
...
|
...
|
@@ -489,6 +516,8 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
|
|
createStoreModel = Provider.of<CreateStoreModel>(context, listen: false);
|
|
|
|
collectStoreProvider =
|
|
|
|
Provider.of<CollectStoreProvider>(context, listen: true);
|
|
|
|
|
|
|
|
_baseIndoProvider = Provider.of<BaseIndoProvider>(context, listen: true);
|
|
|
|
return Scaffold(
|
|
|
|
backgroundColor: MyColours.color_f3f3f3,
|
|
|
|
// appBar: AppBar(
|
|
...
|
...
|
@@ -534,86 +563,125 @@ class MyPageState extends State<MyPage> with WidgetsBindingObserver { |
|
|
|
child: Row(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(left: w(13)),
|
|
|
|
child: model.user!.sellerimage ==
|
|
|
|
null ||
|
|
|
|
model.user!.sellerimage == ''
|
|
|
|
? Image.asset(
|
|
|
|
Utils.getImgPath('base_tx_bg'),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(44 * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(44 * 2),
|
|
|
|
)
|
|
|
|
: Container(
|
|
|
|
width: w(44),
|
|
|
|
height: w(44),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
width: w(2),
|
|
|
|
color: Colors.white),
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.all(Radius
|
|
|
|
.circular(r(44))),
|
|
|
|
image: DecorationImage(
|
|
|
|
image: NetworkImage(model
|
|
|
|
.user!.sellerimage!),
|
|
|
|
)))),
|
|
|
|
VEmptyView(8),
|
|
|
|
Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
maxWidth: ScreenUtil().setWidth(400),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
'杨经理 店长 >',
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
letterSpacing: 0.2,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: ScreenUtil().setSp(24)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(8),
|
|
|
|
Text(
|
|
|
|
'员工编号:' +
|
|
|
|
model.user!.account! +
|
|
|
|
" " +
|
|
|
|
(model.user!.role_name_addition ??
|
|
|
|
''),
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: font(10)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
),
|
|
|
|
InkWell(
|
|
|
|
onTap: () {
|
|
|
|
if (outDay == '0') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (Utils.getAuthority(context, '个人信息')) {
|
|
|
|
NavigatorUtil.goBaseInfoPage(
|
|
|
|
context, FromPage.FromPageMyPage);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Column(
|
|
|
|
crossAxisAlignment:
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment:
|
|
|
|
MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Padding(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.only(left: w(13)),
|
|
|
|
child: selfImage == null ||
|
|
|
|
selfImage == ''
|
|
|
|
? Image.asset(
|
|
|
|
Utils.getImgPath(
|
|
|
|
'base_tx_bg'),
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
width: ScreenUtil()
|
|
|
|
.setWidth(44 * 2),
|
|
|
|
height: ScreenUtil()
|
|
|
|
.setWidth(44 * 2),
|
|
|
|
)
|
|
|
|
: Container(
|
|
|
|
width: w(44),
|
|
|
|
height: w(44),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
border: Border.all(
|
|
|
|
width: w(2),
|
|
|
|
color:
|
|
|
|
Colors.white),
|
|
|
|
borderRadius:
|
|
|
|
BorderRadius.all(
|
|
|
|
Radius.circular(
|
|
|
|
r(44))),
|
|
|
|
image: DecorationImage(
|
|
|
|
fit: BoxFit.cover,
|
|
|
|
image: NetworkImage(
|
|
|
|
selfImage!),
|
|
|
|
)))),
|
|
|
|
VEmptyView(8),
|
|
|
|
Container(
|
|
|
|
constraints: BoxConstraints(
|
|
|
|
maxWidth:
|
|
|
|
ScreenUtil().setWidth(400),
|
|
|
|
),
|
|
|
|
child: Text(
|
|
|
|
'${model.user!.nickName} ${model.user!.role_name_addition} >',
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
letterSpacing: 0.2,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(24)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(8),
|
|
|
|
Text(
|
|
|
|
'员工编号:' + model.user!.account!,
|
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: font(10)),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
)),
|
|
|
|
HEmptyView(22),
|
|
|
|
Spacer(),
|
|
|
|
Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.end,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
'${model.user!.sellername} >',
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
letterSpacing: 0.2,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize: ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
VEmptyView(12),
|
|
|
|
InkWell(
|
|
|
|
onTap: () async {
|
|
|
|
//
|
|
|
|
if (outDay == '0') {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (Utils.getAuthority(
|
|
|
|
context, '店铺信息')) {
|
|
|
|
await NavigatorUtil
|
|
|
|
.goStoreBaseInfoPage(context);
|
|
|
|
// print(image['image']);
|
|
|
|
// UserModel userModel =
|
|
|
|
// Provider.of<UserModel>(context,
|
|
|
|
// listen: false);
|
|
|
|
// User user = userModel.user;
|
|
|
|
// user.sellerimage = image['image'];
|
|
|
|
// await App.sp.setString('user',
|
|
|
|
// json.encode(user.toJson()));
|
|
|
|
// print(userModel.user);
|
|
|
|
setState(() {});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
child: Container(
|
|
|
|
padding:
|
|
|
|
EdgeInsets.only(bottom: w(6)),
|
|
|
|
child: Text(
|
|
|
|
'${model.user!.sellername} >',
|
|
|
|
maxLines: 1,
|
|
|
|
overflow: TextOverflow.ellipsis,
|
|
|
|
style: TextStyle(
|
|
|
|
letterSpacing: 0.2,
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
color: MyColours.color_ffffff,
|
|
|
|
fontSize:
|
|
|
|
ScreenUtil().setSp(32)),
|
|
|
|
),
|
|
|
|
)),
|
|
|
|
Text(
|
|
|
|
'店铺编号:' +
|
|
|
|
model.user!.sellerid!.padLeft(6, '0'),
|
...
|
...
|
|