From cbc3ca23484db3f662aa185819cc2ebb69965aad Mon Sep 17 00:00:00 2001 From: datang Date: Thu, 2 Jun 2022 14:14:38 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=8A=A5=E4=BA=8B=E6=8A=A5=E4=BF=AEtab?= =?UTF-8?q?=E5=B0=8F=E5=B0=BA=E5=AF=B8=E6=89=8B=E6=9C=BA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=AE=8C=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pages/home/home_page.dart | 85 ++++++++++--------- .../work_order/work_order_page.dart | 1 + lib/widget/tab_bar/bee_tab_bar.dart | 1 + 3 files changed, 47 insertions(+), 40 deletions(-) diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 8930da44..20492ac9 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -110,44 +110,46 @@ class _HomePageState extends State right: 32.w, left: 32.w, bottom: 20.w), - child: Row(crossAxisAlignment: CrossAxisAlignment.center, children: [ - // if (appProvider.location != null) - Image.asset( - Assets.home.icLocation.path, - width: 48.w, - height: 48.w, - ), - 16.wb, - Text( - '${UserTool.userProvider.userInfoModel?.communityName ?? ""}', - // appProvider.location?['city'] == null - // ? '' - // : appProvider.location?['city'] as String? ?? '', - style: TextStyle( - fontWeight: FontWeight.w600, - fontSize: 28.sp, - color: Color(0xff333333), + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + // if (appProvider.location != null) + Image.asset( + Assets.home.icLocation.path, + width: 48.w, + height: 48.w, ), - textAlign: TextAlign.center, - ), - // Text( - // '(${appProvider.weatherType} ${appProvider.weatherTemp}℃)', - // style: TextStyle( - // fontSize: 28.sp, - // color: Color(0xff999999), - // ), - // textAlign: TextAlign.center, - // ), - Spacer(), - // GestureDetector( - // onTap: () { - // Get.to(() => BeeSearch()); - // }, - // child: - // Image.asset(Assets.home.icSearch.path, height: 48.w, width: 48.w), - // ), - 20.wb, - Badge( + 16.wb, + Text( + '${UserTool.userProvider.userInfoModel?.communityName ?? ""}', + // appProvider.location?['city'] == null + // ? '' + // : appProvider.location?['city'] as String? ?? '', + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 28.sp, + color: Color(0xff333333), + ), + textAlign: TextAlign.center, + ), + // Text( + // '(${appProvider.weatherType} ${appProvider.weatherTemp}℃)', + // style: TextStyle( + // fontSize: 28.sp, + // color: Color(0xff999999), + // ), + // textAlign: TextAlign.center, + // ), + Spacer(), + // GestureDetector( + // onTap: () { + // Get.to(() => BeeSearch()); + // }, + // child: + // Image.asset(Assets.home.icSearch.path, height: 48.w, width: 48.w), + // ), + 20.wb, + Badge( elevation: 0, badgeColor: Color(0xFFCF2525), padding: sum > 9 ? EdgeInsets.all(2.w) : EdgeInsets.all(5.w), @@ -168,8 +170,10 @@ class _HomePageState extends State }, child: Image.asset(Assets.home.icMessage.path, height: 48.w, width: 48.w), - )), - ]), + ), + ), + ], + ), ); return AnnotatedRegion( value: SystemUiOverlayStyle.dark, @@ -359,7 +363,8 @@ class _HomePageState extends State ), ), onTap: () async { - Get.to(AdvicePage(type: AdviceType.SUGGESTION)); + Get.to(AdvicePage( + type: AdviceType.SUGGESTION)); }, ), ) diff --git a/lib/ui/function_and_service/work_order/work_order_page.dart b/lib/ui/function_and_service/work_order/work_order_page.dart index 393deb63..811f99ef 100644 --- a/lib/ui/function_and_service/work_order/work_order_page.dart +++ b/lib/ui/function_and_service/work_order/work_order_page.dart @@ -62,6 +62,7 @@ class _WorkOrderPageState extends State appBarBottom: BeeTabBar( tabs: _tabs, controller: _tabController, + scrollable: true, ), body: TabBarView( controller: _tabController, diff --git a/lib/widget/tab_bar/bee_tab_bar.dart b/lib/widget/tab_bar/bee_tab_bar.dart index c1ffb38a..b87bce55 100644 --- a/lib/widget/tab_bar/bee_tab_bar.dart +++ b/lib/widget/tab_bar/bee_tab_bar.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; class BeeTabBar extends StatefulWidget with PreferredSizeWidget { final TabController? controller; From ed61867ab75eb2be6b2af221b5894013ac3e022f Mon Sep 17 00:00:00 2001 From: datang Date: Mon, 6 Jun 2022 13:57:59 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=8C=89=E9=92=AE=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E8=AF=84=E8=AE=BAicon=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community_views/event_detail_page.dart | 153 ++++++++---------- .../community_views/widgets/chat_card.dart | 1 + 2 files changed, 70 insertions(+), 84 deletions(-) diff --git a/lib/ui/community/community_views/event_detail_page.dart b/lib/ui/community/community_views/event_detail_page.dart index ee7a230c..4f8df288 100644 --- a/lib/ui/community/community_views/event_detail_page.dart +++ b/lib/ui/community/community_views/event_detail_page.dart @@ -106,18 +106,15 @@ class _EventDetailPageState extends State { @override Widget build(BuildContext context) { return BeeScaffold( - leading: Navigator.canPop(context) ? IconButton( - onPressed: () => Get.back(result: true), - icon: Icon( - CupertinoIcons.chevron_back, - color: Colors.black, - ), - ) + onPressed: () => Get.back(result: true), + icon: Icon( + CupertinoIcons.chevron_back, + color: Colors.black, + ), + ) : SizedBox(), - - title: '详情', bottomNavi: _bottomButton(), actions: [ @@ -303,8 +300,9 @@ class _EventDetailPageState extends State { ); } - Widget _commentWidget(CommentListModel model, int rootIndex) { - return GestureDetector( + Widget _commentWidget(CommentListModel model, int rootIndex){ + final userProvider = Provider.of(context); + return GestureDetector( onTap: () { _rootId = model.id; _parentId = model.id; @@ -363,9 +361,9 @@ class _EventDetailPageState extends State { ), Spacer(), CommunityPopButton( - isMyself: _isMyself, + isMyself: userProvider.userInfoModel?.id==model.createId, onSelect: (value) async { - if (_isMyself) { + if (userProvider.userInfoModel?.id==model.createId) { await CommunityFunc.deleteComment(model.id); _refreshController.callRefresh(); } @@ -374,80 +372,68 @@ class _EventDetailPageState extends State { 40.hb, model.content.text.size(28.sp).color(ktextSubColor).make(), 30.hb, - GestureDetector( - onTap: () async { - var res = - await NetUtil().get(SAASAPI.community.commentLike, params: { - 'commentId': model.id, - }); - if (res.success) { - _likes[rootIndex] = !_likes[rootIndex]; - setState(() {}); - } - }, - child: Row( - children: [ - Spacer(), - GestureDetector( - onTap: () async { - var base = await NetUtil().get( - SAASAPI.community.commentLike, - params: {'commentId': model.id}); - if (base.success) { - _likes[rootIndex] = !_likes[rootIndex]; - if (_likes[rootIndex]) { - _likeNums[rootIndex] += 1; - } else { - _likeNums[rootIndex] -= 1; - } - BotToast.showText( - text: _likes[rootIndex] ? '点赞成功' : '取消点赞成功'); + Row( + children: [ + Spacer(), + GestureDetector( + onTap: () async { + var base = await NetUtil().get( + SAASAPI.community.commentLike, + params: {'commentId': model.id}); + if (base.success) { + _likes[rootIndex] = !_likes[rootIndex]; + if (_likes[rootIndex]) { + _likeNums[rootIndex] += 1; } else { - BotToast.showText(text: base.msg); + _likeNums[rootIndex] -= 1; } + BotToast.showText( + text: _likes[rootIndex] ? '点赞成功' : '取消点赞成功'); + } else { + BotToast.showText(text: base.msg); + } - setState(() {}); - }, - child: Material( - color: Colors.transparent, - child: Row( - children: [ - Image.asset( - R.ASSETS_ICONS_COMMUNITY_LIKE_PNG, - width: 32.w, - height: 32.w, - color: !_likes[rootIndex] - ? Colors.black.withOpacity(0.45) - : kPrimaryColor, - ), - 5.wb, - '${_likeNums[rootIndex]}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - ], - ), + setState(() {}); + }, + child: Material( + color: Colors.transparent, + child: Row( + children: [ + Image.asset( + R.ASSETS_ICONS_COMMUNITY_LIKE_PNG, + width: 32.w, + height: 32.w, + color: !_likes[rootIndex] + ? Colors.black.withOpacity(0.45) + : kPrimaryColor, + ), + 5.wb, + '${_likeNums[rootIndex]}' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), + ], ), ), - 32.wb, - Row( - children: [ - Image.asset( - R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG, - width: 40.w, - height: 40.w, - ), - ], - ), - 5.wb, - '${model.commentNum}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - ], - ), + ), + 32.wb, + Row( + children: [ + Image.asset( + R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG, + width: 40.w, + height: 40.w, + ), + ], + ), + 5.wb, + '${model.commentNum}' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), + ], ), 40.hb, model.commentTwoList.isEmpty @@ -535,7 +521,7 @@ class _EventDetailPageState extends State { fontSize: 28.sp, ), children: [ - if (model.createId ==widget.createId) + if (model.createId == widget.createId) WidgetSpan( child: Container( width: 56.w, @@ -584,7 +570,6 @@ class _EventDetailPageState extends State { } _bottomButton() { - final userProvider = Provider.of(context); return Container( width: double.infinity, height: 100.w, diff --git a/lib/ui/community/community_views/widgets/chat_card.dart b/lib/ui/community/community_views/widgets/chat_card.dart index abc60097..e5226df4 100644 --- a/lib/ui/community/community_views/widgets/chat_card.dart +++ b/lib/ui/community/community_views/widgets/chat_card.dart @@ -247,6 +247,7 @@ class _ChatCardState extends State { ], ), Spacer(), + CommunityPopButton( isMyself: _isMyself, onSelect: (dynamic _) async { From 86edde4c09cc99ec41b3c79efa229c8f312930e5 Mon Sep 17 00:00:00 2001 From: datang Date: Mon, 6 Jun 2022 15:33:59 +0800 Subject: [PATCH 3/3] =?UTF-8?q?app=E7=94=A8=E6=88=B7=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E6=B3=A8=E9=94=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/constants/saas_api.dart | 5 ++++- lib/pages/setting_page/account_manager_page.dart | 13 ++++++++++--- lib/pages/setting_page/settings_page.dart | 8 ++++---- lib/provider/user_provider.dart | 2 +- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/lib/constants/saas_api.dart b/lib/constants/saas_api.dart index da3b5699..2c94f68f 100644 --- a/lib/constants/saas_api.dart +++ b/lib/constants/saas_api.dart @@ -104,7 +104,10 @@ class _User { class _Login { ///app用户退出 - String get logOut => '/app/user/quit'; + String get quit => '/app/user/quit'; + + ///app用户注销 + String get logOut =>'/app/user/logout'; ///查询所有小区信息 String get allCommunity => '/app/login/findAllCommunity'; diff --git a/lib/pages/setting_page/account_manager_page.dart b/lib/pages/setting_page/account_manager_page.dart index a0376265..8840ad16 100644 --- a/lib/pages/setting_page/account_manager_page.dart +++ b/lib/pages/setting_page/account_manager_page.dart @@ -1,3 +1,4 @@ +import 'package:aku_new_community/constants/saas_api.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -7,6 +8,9 @@ import 'package:velocity_x/velocity_x.dart'; import 'package:aku_new_community/pages/sign/login/other_login_page.dart'; import 'package:aku_new_community/widget/bee_scaffold.dart'; +import '../../utils/network/base_model.dart'; +import '../../utils/network/net_util.dart'; + class AccountManagerPage extends StatefulWidget { AccountManagerPage({Key? key}) : super(key: key); @@ -37,9 +41,12 @@ class _AccountManagerPageState extends State { color: Colors.red.withOpacity(0.7), ), ), - onPressed: () { - //暂时隐去一键登录页 - Get.offAll(() => OtherLoginPage()); + onPressed: () async { + BaseModel baseModel = + await NetUtil().post(SAASAPI.login.logOut); + if (baseModel.success) { + Get.offAll(() => OtherLoginPage()); + } }, ), ], diff --git a/lib/pages/setting_page/settings_page.dart b/lib/pages/setting_page/settings_page.dart index b3294cf7..28973073 100644 --- a/lib/pages/setting_page/settings_page.dart +++ b/lib/pages/setting_page/settings_page.dart @@ -143,10 +143,10 @@ class _SettingsPageState extends State { title: '意见反馈', onTap: () => Get.to(() => FeedBackPage()), ), - // _buildTile( - // title: '账号管理', - // onTap: () => Get.to(() => AccountManagerPage()), - // ), + _buildTile( + title: '账号管理', + onTap: () => Get.to(() => AccountManagerPage()), + ), _buildTile( title: '用户协议', onTap: () => Get.to(() => AgreementPage()), diff --git a/lib/provider/user_provider.dart b/lib/provider/user_provider.dart index 0ac877d5..402c8bd5 100644 --- a/lib/provider/user_provider.dart +++ b/lib/provider/user_provider.dart @@ -58,7 +58,7 @@ class UserProvider extends ChangeNotifier { final appProvider = Provider.of(Get.context!, listen: false); appProvider.setCurrentHouse(null); if (_isLogin) { - NetUtil().post(SAASAPI.login.logOut, showMessage: true); + NetUtil().post(SAASAPI.login.quit, showMessage: true); NetUtil().dio!.options.headers.remove('app-login-token'); _isLogin = false; }