From b08cd7cce2b5bd407ca0791a304cd4c0fddb3c78 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Fri, 2 Jul 2021 10:16:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=85=A5=E6=88=91=E7=9A=84=E6=88=BF?= =?UTF-8?q?=E5=B1=8B=E5=89=8D=E5=88=B7=E6=96=B0=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .fvm/fvm_config.json | 3 +- android/build.gradle | 20 +-- lib/generated_plugin_registrant.dart | 1 + .../house/house_information_check_page.dart | 2 +- lib/ui/profile/house/house_owners_page.dart | 158 ++++++++++-------- pubspec.lock | 8 +- 6 files changed, 106 insertions(+), 86 deletions(-) diff --git a/.fvm/fvm_config.json b/.fvm/fvm_config.json index 1c922f80..de7d3977 100644 --- a/.fvm/fvm_config.json +++ b/.fvm/fvm_config.json @@ -1,3 +1,4 @@ { - "flutterSdkVersion": "stable" + "flutterSdkVersion": "2.0.2", + "flavors": {} } \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index d3b97fbe..589f4f88 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,11 +1,11 @@ buildscript { ext.kotlin_version = '1.4.10' repositories { - // google() - // jcenter() - maven { url 'https://maven.aliyun.com/repository/google' } - maven { url 'https://maven.aliyun.com/repository/jcenter' } - maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } + google() + jcenter() + // maven { url 'https://maven.aliyun.com/repository/google' } + // maven { url 'https://maven.aliyun.com/repository/public' } + // maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } } dependencies { @@ -18,11 +18,11 @@ buildscript { allprojects { repositories { - // google() - // jcenter() - maven { url 'https://maven.aliyun.com/repository/google' } - maven { url 'https://maven.aliyun.com/repository/jcenter' } - maven { url 'http://maven.aliyun.com/nexus/content/groups/public' } + google() + jcenter() + // maven { url 'https://maven.aliyun.com/repository/google' } + // maven { url 'https://maven.aliyun.com/repository/public' } + // maven { url 'https://maven.aliyun.com/repository/gradle-plugin' } } } diff --git a/lib/generated_plugin_registrant.dart b/lib/generated_plugin_registrant.dart index 222a4e7a..21a62aa1 100644 --- a/lib/generated_plugin_registrant.dart +++ b/lib/generated_plugin_registrant.dart @@ -2,6 +2,7 @@ // Generated file. Do not edit. // +// ignore_for_file: directives_ordering // ignore_for_file: lines_longer_than_80_chars import 'package:device_info_plus_web/device_info_plus_web.dart'; diff --git a/lib/ui/profile/house/house_information_check_page.dart b/lib/ui/profile/house/house_information_check_page.dart index e44a55a5..4964997e 100644 --- a/lib/ui/profile/house/house_information_check_page.dart +++ b/lib/ui/profile/house/house_information_check_page.dart @@ -68,7 +68,7 @@ class _HouseInformationCheckPageState extends State { id: widget.detailModel.id, url: result, )); - } + } } catch (e) { LoggerData.addData(e); } diff --git a/lib/ui/profile/house/house_owners_page.dart b/lib/ui/profile/house/house_owners_page.dart index 9ae984a0..3ee5cf68 100644 --- a/lib/ui/profile/house/house_owners_page.dart +++ b/lib/ui/profile/house/house_owners_page.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/tenant_house_list_page.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_easyrefresh/easy_refresh.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:power_logger/power_logger.dart'; import 'package:provider/provider.dart'; import 'package:aku_community/const/resource.dart'; @@ -51,7 +54,8 @@ class _HouseOwnersPageState extends State { } bool get isOwner { - switch (widget.identify) { + + switch (UserTool.userProvider.userDetailModel!.type) { case 1: return true; case 3: @@ -63,7 +67,7 @@ class _HouseOwnersPageState extends State { } bool get isTourist { - switch (widget.identify) { + switch (UserTool.userProvider.userDetailModel!.type) { case 1: return false; case 2: @@ -77,77 +81,99 @@ class _HouseOwnersPageState extends State { } } + bool _onload = true; + @override void dispose() { _refreshController.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 Widget build(BuildContext context) { final appProvider = Provider.of(context); - return isTourist - ? _touristBody() + return _onload + ? BeeScaffold(title: '我的房屋') : BeeScaffold( title: '我的房屋', actions: [ - TextButton( - onPressed: () { - isOwner - ? Get.to(() => MyHouseList()) - : Get.to(TenantHouseListPage()); - }, - child: Text(isOwner ? '审核记录' : '我的选房'), - ), + isTourist + ? SizedBox() + : TextButton( + onPressed: () { + isOwner + ? Get.to(() => MyHouseList()) + : Get.to(() => TenantHouseListPage()); + }, + child: Text(isOwner ? '审核记录' : '我的选房'), + ), ], - body: EasyRefresh( - header: MaterialHeader(), - controller: _refreshController, - firstRefresh: true, - onRefresh: () async { - appProvider.updateHouses(await HouseFunc.passedHouses); - }, - child: ListView( - children: [ - _emptyHouse - ? 280.hb - : Padding( - padding: EdgeInsets.all(32.w), - child: HouseCard( - isOwner: isOwner, - type: appProvider.selectedHouse != null - ? CardAuthType.SUCCESS - : CardAuthType.FAIL, - model: appProvider.selectedHouse, - ), - ), - if (!_emptyHouse) 88.hb, - if (!_haveAuthedHouse) - Stack( + body: isTourist + ? _touristBody() + : EasyRefresh( + header: MaterialHeader(), + controller: _refreshController, + firstRefresh: true, + onRefresh: () async { + appProvider.updateHouses(await HouseFunc.passedHouses); + }, + child: ListView( children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 75.w), - child: Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP), - ), - Positioned( - bottom: 100.w, - left: 0, - right: 0, - child: _houseTitle.centered(), - ), + _emptyHouse + ? 280.hb + : Padding( + padding: EdgeInsets.all(32.w), + child: HouseCard( + isOwner: isOwner, + type: appProvider.selectedHouse != null + ? CardAuthType.SUCCESS + : CardAuthType.FAIL, + model: appProvider.selectedHouse, + ), + ), + if (!_emptyHouse) 88.hb, + if (!_haveAuthedHouse) + Stack( + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 75.w), + child: + Image.asset(R.ASSETS_STATIC_REVIEWING_WEBP), + ), + Positioned( + bottom: 100.w, + left: 0, + right: 0, + child: _houseTitle.centered(), + ), + ], + ), + if (_emptyHouse) + Center( + child: ElevatedButton( + onPressed: _addHouse, + child: Text('添加房屋'), + ), + ), + if (!isOwner && !_emptyHouse) _contractRelevant(), ], ), - if (_emptyHouse) - Center( - child: ElevatedButton( - onPressed: _addHouse, - child: Text('添加房屋'), - ), - ), - if (!isOwner && !_emptyHouse) _contractRelevant(), - ], - ), - ), + ), bottomNavi: BottomButton( onPressed: _addHouse, child: '新增房屋'.text.size(32.sp).color(ktextPrimary).bold.make()), @@ -168,15 +194,10 @@ class _HouseOwnersPageState extends State { mainAxisSpacing: 32.w, crossAxisSpacing: 32.w, children: [ - _cardBuild( - R.ASSETS_ICONS_PAY_PNG, '缴费查询', '查看租金及保证金情况', () {}), - _cardBuild( - R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}), - _cardBuild( - R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}), - _cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () { - - }) + _cardBuild(R.ASSETS_ICONS_PAY_PNG, '缴费查询', '查看租金及保证金情况', () {}), + _cardBuild(R.ASSETS_ICONS_CHANGE_PNG, '合同变更', '变更合同信息、重新签约', () {}), + _cardBuild(R.ASSETS_ICONS_CONTRACT_PNG, '合同续签', '到期前线上办理续签手续', () {}), + _cardBuild(R.ASSETS_ICONS_FINISH_PNG, '合同终止', '线上申请终止合同', () {}) ], ); } @@ -236,9 +257,6 @@ class _HouseOwnersPageState extends State { ], ), ); - return BeeScaffold( - title: '我的房屋', - body: center, - ); + return center; } } diff --git a/pubspec.lock b/pubspec.lock index e868ecf0..c1a52019 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -77,7 +77,7 @@ packages: name: async url: "https://pub.flutter-io.cn" source: hosted - version: "2.6.1" + version: "2.7.0" auto_size_text: dependency: transitive description: @@ -182,7 +182,7 @@ packages: name: charcode url: "https://pub.flutter-io.cn" source: hosted - version: "1.2.0" + version: "1.3.1" checked_yaml: dependency: transitive description: @@ -682,7 +682,7 @@ packages: name: meta url: "https://pub.flutter-io.cn" source: hosted - version: "1.3.0" + version: "1.4.0" mime: dependency: transitive description: @@ -1123,7 +1123,7 @@ packages: name: test_api url: "https://pub.flutter-io.cn" source: hosted - version: "0.3.0" + version: "0.4.1" timing: dependency: transitive description: