pull/1/head
张萌 3 years ago
parent 01fcb33944
commit 065ae15f05

@ -444,7 +444,7 @@ class _DetoCreatePageState extends State<DetoCreatePage> {
.uploadFiles(_files, API.upload.uploadRepair);
BaseModel baseModel = await ManagerFunc.articleOutSubmit(
id: BeeParse.getEstateNameId(
userProvider.myHouseInfo!.communityName),
userProvider.myHouses.first.communityName),
name: _itemName,
weight: _selectWeight! + 1,
approach: _selectApproach + 1,

@ -517,7 +517,8 @@ class _PersonalIndexState extends State<PersonalIndex>
() => HouseOwnersPage(
identify: 4,
),
userProvider.myHouseInfo?.communityName ?? ''),
// userProvider.myHouses.first.communityName ??
''),
36.hb,
_function('我的车位', R.ASSETS_ICONS_ICON_MY_CARSEAT_PNG,
() => CarParkingPage(), ''),

@ -168,7 +168,7 @@ class _PropertyPageState extends State<PropertyPage>
),
Spacer(),
Text(
userProvider.myHouseInfo!.communityName,
userProvider.myHouses.first.communityName,
style: TextStyle(
fontSize: 28.sp,
color: Colors.white.withOpacity(0.85),

@ -154,12 +154,14 @@ class SignFunc {
return true;
}
static Future<MyHouseModel?> getMyHouseInfo() async {
static Future<List<MyHouseModel>> getMyHouseInfo() async {
BaseModel baseModel = await NetUtil().get(
SARSAPI.profile.house.userHouse,
);
if ((baseModel.data as List).isEmpty) return null;
return MyHouseModel.fromJson(baseModel.data);
if ((baseModel.data as List).isEmpty) return [];
return (baseModel.data as List)
.map((e) => MyHouseModel.fromJson(e))
.toList();
}
static Future checkNameAndAccount() async {

@ -59,13 +59,12 @@ class UserProvider extends ChangeNotifier {
_isLogin = false;
_token = null;
_userInfoModel = null;
_myHouseInfo = null;
_myHouses = [];
NetUtil().get(API.user.logout, showMessage: true);
NetUtil().dio!.options.headers.remove('app-login-token');
HiveStore.appBox!.delete('token');
HiveStore.appBox!.delete('login');
WebSocketUtil().closeWebSocket();
notifyListeners();
}
@ -84,8 +83,7 @@ class UserProvider extends ChangeNotifier {
}
Future updateMyHouseInfo() async {
_myHouseInfo = await SignFunc.getMyHouseInfo();
if (_userInfoModel != null && !kIsWeb && !Platform.isMacOS) {}
_myHouses = await SignFunc.getMyHouseInfo();
notifyListeners();
}
@ -97,9 +95,9 @@ class UserProvider extends ChangeNotifier {
UserInfoModel? get userInfoModel => _userInfoModel;
MyHouseModel? _myHouseInfo;
List<MyHouseModel> _myHouses = [];
MyHouseModel? get myHouseInfo => _myHouseInfo;
List<MyHouseModel> get myHouses => _myHouses;
///
Future setSex(int sex) async {

Loading…
Cancel
Save