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

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

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

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

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

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

Loading…
Cancel
Save