进入我的房屋前刷新个人信息

hmxc
张萌 4 years ago
parent bdd007266c
commit b08cd7cce2

@ -1,3 +1,4 @@
{ {
"flutterSdkVersion": "stable" "flutterSdkVersion": "2.0.2",
"flavors": {}
} }

@ -1,11 +1,11 @@
buildscript { buildscript {
ext.kotlin_version = '1.4.10' ext.kotlin_version = '1.4.10'
repositories { repositories {
// google() google()
// jcenter() jcenter()
maven { url 'https://maven.aliyun.com/repository/google' } // maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' } // maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } // maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
} }
dependencies { dependencies {
@ -18,11 +18,11 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
// google() google()
// jcenter() jcenter()
maven { url 'https://maven.aliyun.com/repository/google' } // maven { url 'https://maven.aliyun.com/repository/google' }
maven { url 'https://maven.aliyun.com/repository/jcenter' } // maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } // maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
} }
} }

@ -2,6 +2,7 @@
// Generated file. Do not edit. // Generated file. Do not edit.
// //
// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars // ignore_for_file: lines_longer_than_80_chars
import 'package:device_info_plus_web/device_info_plus_web.dart'; import 'package:device_info_plus_web/device_info_plus_web.dart';

@ -3,11 +3,14 @@ import 'package:aku_community/ui/profile/house/identify_selection_page.dart';
import 'package:aku_community/ui/profile/house/my_house_list.dart'; import 'package:aku_community/ui/profile/house/my_house_list.dart';
import 'package:aku_community/ui/profile/house/tenant_house_list_page.dart'; import 'package:aku_community/ui/profile/house/tenant_house_list_page.dart';
import 'package:aku_community/widget/buttons/bottom_button.dart'; import 'package:aku_community/widget/buttons/bottom_button.dart';
import 'package:aku_community/widget/others/user_tool.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:power_logger/power_logger.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:aku_community/const/resource.dart'; import 'package:aku_community/const/resource.dart';
@ -51,7 +54,8 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
} }
bool get isOwner { bool get isOwner {
switch (widget.identify) {
switch (UserTool.userProvider.userDetailModel!.type) {
case 1: case 1:
return true; return true;
case 3: case 3:
@ -63,7 +67,7 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
} }
bool get isTourist { bool get isTourist {
switch (widget.identify) { switch (UserTool.userProvider.userDetailModel!.type) {
case 1: case 1:
return false; return false;
case 2: case 2:
@ -77,30 +81,51 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
} }
} }
bool _onload = true;
@override @override
void dispose() { void dispose() {
_refreshController.dispose(); _refreshController.dispose();
super.dispose(); super.dispose();
} }
@override
void initState() {
Function cancel = BotToast.showLoading();
try {
Future.delayed(Duration(milliseconds: 300), () async {
await UserTool.userProvider.updateUserDetail();
});
} catch (e) {
LoggerData.addData(e);
}
_onload = false;
cancel();
super.initState();
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final appProvider = Provider.of<AppProvider>(context); final appProvider = Provider.of<AppProvider>(context);
return isTourist return _onload
? _touristBody() ? BeeScaffold(title: '我的房屋')
: BeeScaffold( : BeeScaffold(
title: '我的房屋', title: '我的房屋',
actions: [ actions: [
TextButton( isTourist
? SizedBox()
: TextButton(
onPressed: () { onPressed: () {
isOwner isOwner
? Get.to(() => MyHouseList()) ? Get.to(() => MyHouseList())
: Get.to(TenantHouseListPage()); : Get.to(() => TenantHouseListPage());
}, },
child: Text(isOwner ? '审核记录' : '我的选房'), child: Text(isOwner ? '审核记录' : '我的选房'),
), ),
], ],
body: EasyRefresh( body: isTourist
? _touristBody()
: EasyRefresh(
header: MaterialHeader(), header: MaterialHeader(),
controller: _refreshController, controller: _refreshController,
firstRefresh: true, firstRefresh: true,
@ -127,7 +152,8 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 75.w), padding: EdgeInsets.symmetric(horizontal: 75.w),
child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP), child:
Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP),
), ),
Positioned( Positioned(
bottom: 100.w, bottom: 100.w,
@ -168,15 +194,10 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
mainAxisSpacing: 32.w, mainAxisSpacing: 32.w,
crossAxisSpacing: 32.w, crossAxisSpacing: 32.w,
children: [ children: [
_cardBuild( _cardBuild(R.ASSETS_ICONS_PAY_PNG, '缴费查询', '查看租金及保证金情况', () {}),
R.ASSETS_ICONS_PAY_PNG, '缴费查询', '查看租金及保证金情况', () {}), _cardBuild(R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}),
_cardBuild( _cardBuild(R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}),
R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}), _cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () {})
_cardBuild(
R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}),
_cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () {
})
], ],
); );
} }
@ -236,9 +257,6 @@ class _HouseOwnersPageState extends State<HouseOwnersPage> {
], ],
), ),
); );
return BeeScaffold( return center;
title: '我的房屋',
body: center,
);
} }
} }

@ -77,7 +77,7 @@ packages:
name: async name: async
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "2.6.1" version: "2.7.0"
auto_size_text: auto_size_text:
dependency: transitive dependency: transitive
description: description:
@ -182,7 +182,7 @@ packages:
name: charcode name: charcode
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.2.0" version: "1.3.1"
checked_yaml: checked_yaml:
dependency: transitive dependency: transitive
description: description:
@ -682,7 +682,7 @@ packages:
name: meta name: meta
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "1.3.0" version: "1.4.0"
mime: mime:
dependency: transitive dependency: transitive
description: description:
@ -1123,7 +1123,7 @@ packages:
name: test_api name: test_api
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.3.0" version: "0.4.1"
timing: timing:
dependency: transitive dependency: transitive
description: description:

Loading…
Cancel
Save