From cbfba39946ad7617456efa25010ab1d67c8694bf Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Wed, 30 Mar 2022 15:22:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E9=BB=98=E8=AE=A4=E6=88=BF?= =?UTF-8?q?=E5=B1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/profile_api.dart | 3 +++ lib/ui/profile/new_house/my_house_page.dart | 15 ++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/lib/constants/profile_api.dart b/lib/constants/profile_api.dart index 40057b68..54fce71a 100644 --- a/lib/constants/profile_api.dart +++ b/lib/constants/profile_api.dart @@ -7,6 +7,9 @@ class _ProfileApi { } class _MyHouse { + ///切换默认房屋 + String get switchDefaultEstate => '/app/user/myEstate/checkEstate'; + ///查询所有我的房屋 String get userHouse => '/app/user/myEstate/findAllMyEstate'; diff --git a/lib/ui/profile/new_house/my_house_page.dart b/lib/ui/profile/new_house/my_house_page.dart index 7de4ba49..b2d69023 100644 --- a/lib/ui/profile/new_house/my_house_page.dart +++ b/lib/ui/profile/new_house/my_house_page.dart @@ -1,15 +1,18 @@ import 'package:aku_new_community/base/base_style.dart'; +import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/gen/assets.gen.dart'; import 'package:aku_new_community/models/user/my_house_model.dart'; import 'package:aku_new_community/ui/profile/new_house/add_house_page.dart'; import 'package:aku_new_community/ui/profile/new_house/apply_record_page.dart'; import 'package:aku_new_community/ui/profile/new_house/widgets/add_house_button.dart'; +import 'package:aku_new_community/utils/network/net_util.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; import 'package:aku_new_community/widget/dialog/certification_dialog.dart'; import 'package:aku_new_community/widget/others/user_tool.dart'; import 'package:aku_new_community/widget/tag/bee_tag.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'; @@ -89,7 +92,17 @@ class _MyHousePageState extends State { return Stack( children: [ GestureDetector( - onTap: () {}, + onTap: () async { + var base = await NetUtil().get( + SAASAPI.profile.house.switchDefaultEstate, + params: {'estateId': model.isDefault}); + if (base.success) { + await UserTool.userProvider.updateMyHouseInfo(); + _refreshController.callRefresh(); + } else { + BotToast.showText(text: '切换默认房屋失败'); + } + }, child: Material( child: Container( width: 686.w,