From 0de57d39050b16e09c23cd073c07ccd8dc967e2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AB=A0=E6=96=87=E8=BD=A9?= <12812285557@qq.com> Date: Wed, 6 Apr 2022 20:32:32 +0800 Subject: [PATCH] fix bugs --- lib/constants/saas_api.dart | 12 +++ lib/models/home/activity_detail_model.dart | 2 + lib/models/home/activity_detail_model.g.dart | 1 + lib/models/message/reply_list_model.dart | 2 + lib/models/message/reply_list_model.g.dart | 1 + lib/pages/home/home_page.dart | 14 +++- .../announce/announce_card.dart | 80 ++++++++++++------- .../message_center_page.dart | 2 +- .../reply/replay_view.dart | 2 +- .../message_center_page/reply/reply_card.dart | 15 +++- .../personal/clock_in/clock_in_page.dart | 6 +- lib/pages/personal/personal_page.dart | 31 ++++--- lib/ui/community/activity/activity_card.dart | 1 + .../activity/activity_detail_page.dart | 4 +- .../activity/activity_people_list_page.dart | 41 ++++++++-- lib/ui/community/community_func.dart | 31 ++++++- .../community_views/community_page.dart | 12 ++- .../community_views/event_detail_page.dart | 12 +++ .../community_views/my_community_view.dart | 45 +++-------- .../community_views/widgets/chat_card.dart | 57 +++++++------ lib/ui/profile/new_house/member_view.dart | 29 +++---- 21 files changed, 265 insertions(+), 135 deletions(-) diff --git a/lib/constants/saas_api.dart b/lib/constants/saas_api.dart index 9b599f46..78869145 100644 --- a/lib/constants/saas_api.dart +++ b/lib/constants/saas_api.dart @@ -152,6 +152,18 @@ class _Community { ///新鲜话题 String get topNewList => '/app/user/community/topic/newList'; + + ///增加咨询浏览量 + String get addViewNum => '/app/user/information/addViewNum'; + + ///增加咨询浏览量 + String get dynamicAddViewNum => '/app/user/community/dynamic/addViewNum'; + + ///删除动态 + String get deleteDynamic => '/app/user/community/dynamic/delete'; + + + } class _Task { diff --git a/lib/models/home/activity_detail_model.dart b/lib/models/home/activity_detail_model.dart index fc0cc241..719814cc 100644 --- a/lib/models/home/activity_detail_model.dart +++ b/lib/models/home/activity_detail_model.dart @@ -26,6 +26,7 @@ class ActivityDetailModel { final String contact; final String tel; final List organizerImgList; + final int isRegistration; factory ActivityDetailModel.fromJson(Map json) => _$ActivityDetailModelFromJson(json); @@ -55,6 +56,7 @@ class ActivityDetailModel { required this.contact, required this.tel, required this.organizerImgList, + required this.isRegistration, }); } diff --git a/lib/models/home/activity_detail_model.g.dart b/lib/models/home/activity_detail_model.g.dart index 7c4652b9..bc2cfa26 100644 --- a/lib/models/home/activity_detail_model.g.dart +++ b/lib/models/home/activity_detail_model.g.dart @@ -34,6 +34,7 @@ ActivityDetailModel _$ActivityDetailModelFromJson(Map json) => organizerImgList: (json['organizerImgList'] as List) .map((e) => ImgModel.fromJson(e as Map)) .toList(), + isRegistration:json['isRegistration'] as int ); Registration _$RegistrationFromJson(Map json) => Registration( diff --git a/lib/models/message/reply_list_model.dart b/lib/models/message/reply_list_model.dart index c46fd140..5dbbb296 100644 --- a/lib/models/message/reply_list_model.dart +++ b/lib/models/message/reply_list_model.dart @@ -14,6 +14,7 @@ class ReplyListModel { final String sendDate; final List avatarImgList; final List dynamicImgList; + final int jumpId; factory ReplyListModel.fromJson(Map json) => _$ReplyListModelFromJson(json); @@ -32,5 +33,6 @@ class ReplyListModel { required this.sendDate, required this.avatarImgList, required this.dynamicImgList, + required this.jumpId }); } diff --git a/lib/models/message/reply_list_model.g.dart b/lib/models/message/reply_list_model.g.dart index b1c57659..821f888c 100644 --- a/lib/models/message/reply_list_model.g.dart +++ b/lib/models/message/reply_list_model.g.dart @@ -20,4 +20,5 @@ ReplyListModel _$ReplyListModelFromJson(Map json) => dynamicImgList: (json['dynamicImgList'] as List) .map((e) => ImgModel.fromJson(e as Map)) .toList(), + jumpId:json['jumpId'] as int ); diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index 3230a981..b28ca2c5 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -21,7 +21,9 @@ import 'package:aku_new_community/ui/home/public_infomation/public_information_d import 'package:aku_new_community/ui/manager/advice/advice_page.dart'; import 'package:aku_new_community/ui/market/search/good_detail_page.dart'; import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/utils/hive_store.dart'; import 'package:aku_new_community/utils/login_util.dart'; +import 'package:aku_new_community/utils/websocket/tips_dialog.dart'; import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/others/rectIndicator.dart'; @@ -353,9 +355,15 @@ class _HomePageState extends State ], ), ), - onTap: () { - Get.to(AdvicePage( - type: AdviceType.SUGGESTION)); + onTap: () async { + var agreement = await HiveStore.appBox?.get('AdvicePage') ?? false; + if (!agreement) { + await TipsDialog.tipsDialog(); + HiveStore.appBox!.put('AdvicePage', true); + } + + // Get.to(AdvicePage( + // type: AdviceType.SUGGESTION)); }, ), ) diff --git a/lib/pages/message_center_page/announce/announce_card.dart b/lib/pages/message_center_page/announce/announce_card.dart index 109b419e..21303cd2 100644 --- a/lib/pages/message_center_page/announce/announce_card.dart +++ b/lib/pages/message_center_page/announce/announce_card.dart @@ -3,6 +3,7 @@ import 'package:aku_new_community/extensions/widget_list_ext.dart'; import 'package:aku_new_community/models/home/home_announce_model.dart'; import 'package:aku_new_community/pages/message_center_page/announce/announce_view.dart'; import 'package:aku_new_community/ui/community/notice/notice_detail_page.dart'; +import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -43,42 +44,59 @@ class AnnounceCard extends StatelessWidget { ...modelList.models .map((e) => _card(e)) .toList() - .sepWidget(separate: 10.heightBox) + ], ); } Widget _card(HomeAnnounceModel model) { - return Container( - color: Colors.white, - padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - '${DateUtil.formatDateStr(model.createDate, format: 'dd日 HH:mm')}' - .text - .size(28.sp) - .color(ktextSubColor) - .make(), - 32.w.heightBox, - '${model.title}'.text.size(36.sp).black.bold.make(), - 32.w.heightBox, - '${model.content}'.text.size(28.sp).color(ktextSubColor).make(), - 40.w.heightBox, - Container( - height: 72.w, - decoration: BoxDecoration( - border: Border( - top: BorderSide( - color: Color(0xFF000000).withOpacity(0.06), - ), + return InkWell( + onTap: () { + Get.to(() => NoticeDetailPage(id: model.id)); + }, + child: Container( + color: Colors.white, + padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), + margin: EdgeInsets.only(bottom: 16 .w), + child: Column( + + + + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + + '${DateUtil.formatDateStr(model.createDate, format: 'dd日 HH:mm')}' + .text + .size(28.sp) + .color(ktextSubColor) + .make(), + 32.w.heightBox, + Container( + width: double.infinity, + height: 258.w, + clipBehavior: Clip.antiAliasWithSaveLayer, + decoration: BoxDecoration(borderRadius: BorderRadius.circular(16.w)), + child: BeeImageNetwork( + imgs: model.imgList, ), ), - child: InkWell( - onTap: () { - Get.to(() => NoticeDetailPage(id: model.id)); - }, + 32.w.heightBox, + + '${model.title}'.text.size(36.sp).black.bold.make(), + 32.w.heightBox, + '${model.content}'.text.maxLines(2).ellipsis.size(28.sp).color(ktextSubColor).make(), + 40.w.heightBox, + Container( + height: 72.w, + decoration: BoxDecoration( + border: Border( + top: BorderSide( + color: Color(0xFF000000).withOpacity(0.06), + ), + ), + ), child: Row( children: [ '查看详情'.text.size(24.w).color(ktextSubColor).make(), @@ -90,8 +108,8 @@ class AnnounceCard extends StatelessWidget { ], ), ), - ), - ], + ], + ), ), ); } diff --git a/lib/pages/message_center_page/message_center_page.dart b/lib/pages/message_center_page/message_center_page.dart index 0eea6cd6..9340abbb 100644 --- a/lib/pages/message_center_page/message_center_page.dart +++ b/lib/pages/message_center_page/message_center_page.dart @@ -71,7 +71,7 @@ class _MessageCenterPageState extends State ), body: TabBarView( children: [ - ReplayView( + ReplayView( controller: _controllers[0], ), ThumbsUpView( diff --git a/lib/pages/message_center_page/reply/replay_view.dart b/lib/pages/message_center_page/reply/replay_view.dart index 03fde28e..8229be86 100644 --- a/lib/pages/message_center_page/reply/replay_view.dart +++ b/lib/pages/message_center_page/reply/replay_view.dart @@ -38,7 +38,7 @@ class _ReplayViewState extends State { itemBuilder: (context, index) { return ReplyCard(model: items[index]); }, - separatorBuilder: (_, __) => 20.w.heightBox, + separatorBuilder: (_, __) =>1.w.heightBox, itemCount: items.length); }); } diff --git a/lib/pages/message_center_page/reply/reply_card.dart b/lib/pages/message_center_page/reply/reply_card.dart index 6b0161be..0f50792a 100644 --- a/lib/pages/message_center_page/reply/reply_card.dart +++ b/lib/pages/message_center_page/reply/reply_card.dart @@ -1,9 +1,11 @@ import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/models/message/reply_list_model.dart'; import 'package:aku_new_community/pages/message_center_page/message_func.dart'; +import 'package:aku_new_community/ui/community/community_views/event_detail_page.dart'; import 'package:aku_new_community/widget/beeImageNetwork.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; class ReplyCard extends StatelessWidget { @@ -16,9 +18,16 @@ class ReplyCard extends StatelessWidget { return GestureDetector( onTap: () async { await MessageFunc.readMessage(model.id); + Get.to(() => EventDetailPage( + dynamicId: model.jumpId, + onDelete: (){ + + }, + )); }, child: Container( padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 48.w), + color: Colors.white, child: Row( children: [ ClipOval( @@ -35,13 +44,15 @@ class ReplyCard extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ model.sendName.text.size(26.sp).black.bold.make(), + 5.heightBox, model.content.text - .size(24.sp) + .size(26.sp) .color(ktextSubColor) .maxLines(1) .ellipsis .make(), - model.sendDate.text.size(24.sp).color(ktextSubColor).make(), + 5.heightBox, + model.sendDate.text.size(22.sp).color(ktextSubColor).make(), ], ), ), diff --git a/lib/pages/personal/clock_in/clock_in_page.dart b/lib/pages/personal/clock_in/clock_in_page.dart index 2f31e8aa..f17edbeb 100644 --- a/lib/pages/personal/clock_in/clock_in_page.dart +++ b/lib/pages/personal/clock_in/clock_in_page.dart @@ -79,6 +79,9 @@ class _ClockInPageState extends State { child: BeeImageNetwork( height: 106.w, width: 106.w, + imgs: UserTool.userProvider.userInfoModel + ?.imgList ?? + [], ), ), ), @@ -260,6 +263,7 @@ class _ClockInPageState extends State { currentValue.signDate, currentValue.addNums)) .toList(), + _records.length>6? Container( width: double.infinity, height: 82.w, @@ -267,7 +271,7 @@ class _ClockInPageState extends State { color: Color(0xFFE5E5E5), child: '没有更多记录了~'.text.size(28.sp).color(ktextSubColor).make(), - ), + ):SizedBox(), ].sepWidget(separate: 32.hb), ), ) diff --git a/lib/pages/personal/personal_page.dart b/lib/pages/personal/personal_page.dart index 92eb980a..48eebbfb 100644 --- a/lib/pages/personal/personal_page.dart +++ b/lib/pages/personal/personal_page.dart @@ -369,7 +369,9 @@ class _PersonalIndexState extends State _function( '我的房屋', R.ASSETS_ICONS_ICON_MY_HOUSE_PNG, - () => MyHousePage(), + (){ + Get.to(() => MyHousePage()); + }, // () => HouseOwnersPage( // identify: 4, // ), @@ -382,7 +384,11 @@ class _PersonalIndexState extends State _function( '我的家庭', R.ASSETS_ICONS_ICON_MY_HOUSE_PNG, - () => MyFamilyPage(), + (){ + Get.to(() => MyFamilyPage()); + } + + , ''), 36.hb, // _function('我的车位', R.ASSETS_ICONS_ICON_MY_CARSEAT_PNG, @@ -394,15 +400,21 @@ class _PersonalIndexState extends State _function( '我的访客', R.ASSETS_ICONS_ICON_MY_VISITOR_PNG, - () => CarManagePage(), + (){ + BotToast.showText(text: '当前小区尚未连接设备', align: Alignment(0, 0.5)); + } + + , ''), 36.hb, _function( '收货地址设置', R.ASSETS_ICONS_ICON_MY_LOCATION_PNG, - () => AddressListPage( - canBack: false, - ), + (){ + Get.to(() => AddressListPage( + canBack: false, + ),); + }, ''), ], ), @@ -442,13 +454,12 @@ class _PersonalIndexState extends State _function( String title, String path, - dynamic page, + VoidCallback onTap, + //dynamic page, String msg, ) { return GestureDetector( - onTap: () { - Get.to(page); - }, + onTap: onTap, child: Container( color: Colors.transparent, child: Row( diff --git a/lib/ui/community/activity/activity_card.dart b/lib/ui/community/activity/activity_card.dart index f781226f..1b599477 100644 --- a/lib/ui/community/activity/activity_card.dart +++ b/lib/ui/community/activity/activity_card.dart @@ -104,6 +104,7 @@ class ActivityCard extends StatelessWidget { (model?.avatarImgList?.map((e) => e.url).toList() ?? []), pNum: model?.registrationNum ?? 0, hasIcon: false, + ), ), // Spacer(), diff --git a/lib/ui/community/activity/activity_detail_page.dart b/lib/ui/community/activity/activity_detail_page.dart index 4d9dcd47..b077444c 100644 --- a/lib/ui/community/activity/activity_detail_page.dart +++ b/lib/ui/community/activity/activity_detail_page.dart @@ -1,3 +1,4 @@ +import 'package:aku_new_community/base/base_style.dart'; import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/home/activity_detail_model.dart'; @@ -166,7 +167,7 @@ class _ActivityDetailPageState extends State { } bool get canTap { - if (_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) { + if ((_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) ||_model!.isRegistration==1) { return false; } return true; @@ -298,6 +299,7 @@ class _ActivityDetailPageState extends State { BeeDivider.horizontal(), 16.hb, AvatarsParticipate( + registrationList: _model!.registrationList, avatars: _model!.registrationList .map((e) => ImgModel.first(e.avatarImgList)) .toList(), diff --git a/lib/ui/community/activity/activity_people_list_page.dart b/lib/ui/community/activity/activity_people_list_page.dart index fabb1290..a470357e 100644 --- a/lib/ui/community/activity/activity_people_list_page.dart +++ b/lib/ui/community/activity/activity_people_list_page.dart @@ -38,6 +38,7 @@ class _ActivityPeopleListPageState extends State { color: Colors.black.withOpacity(0.06), height: 75.w, width: double.infinity, + alignment: Alignment.center, child: '已有'.richText.color(Colors.black.withOpacity(0.65)).size(28.sp).withTextSpanChildren([ widget.registrationList==null?''.textSpan .size(28.sp) @@ -59,16 +60,29 @@ class _ActivityPeopleListPageState extends State { itemBuilder: (context, index) { return Row( children: [ - 96.hb, + 132.hb, 20.wb, - FadeInImage.assetNetwork( - placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, - image: SAASAPI.image(ImgModel.first(widget.registrationList![index].avatarImgList)), - height: 60.w, - width: 60.w, + Material( + color: Color(0xFFF5F5F5), + borderRadius: BorderRadius.circular(40.w), + clipBehavior: Clip.antiAlias, + child: FadeInImage.assetNetwork( + placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + image: SAASAPI.image(ImgModel.first(widget.registrationList![index].avatarImgList)), + height: 80.w, + width: 80.w, + fit: BoxFit.fill, + imageErrorBuilder: (context, error, stackTrace) { + return Image.asset( + R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + width: 80.w, + height: 80.w, + ); + }, + ), ), 18.wb, - widget.registrationList![index].name.text.size(28.sp).make(), + '${getName(widget.registrationList![index].name) }'.text.size(28.sp).make(), ], ); }, @@ -80,4 +94,17 @@ class _ActivityPeopleListPageState extends State { ); } + + + getName(String name){ + for(int i=0;i0){ + name = name.replaceRange(i, i+1, '*') ; + } + + } + + + return name; + } } diff --git a/lib/ui/community/community_func.dart b/lib/ui/community/community_func.dart index f92aa653..07c4fd6c 100644 --- a/lib/ui/community/community_func.dart +++ b/lib/ui/community/community_func.dart @@ -47,18 +47,45 @@ class CommunityFunc { return model.rows.map((e) => InformationListModel.fromJson(e)).toList(); } + + ///删除动态 + static Future deleteDynamicAddViews(int dynamicId) async { + BaseModel model = await NetUtil().get(SAASAPI.community.deleteDynamic, + params: {'dynamicId': dynamicId}, showMessage: false); + if (model.success) { + BotToast.showText(text: '删除成功'); + return true; + } else { + BotToast.showText(text: '删除失败'); + return false; + } + } + ///给单个资讯增加浏览量 static Future addViews(int newsId) async { BaseModel model = await NetUtil().get( - API.community.addViews, + SAASAPI.community.addViewNum, params: { - 'newsId': newsId, + 'informationId': newsId, }, ); if (model.success) return ''; return model.msg; } + ///给单个动态增加浏览量 + static Future dynamicAddViews(int newsId) async { + BaseModel model = await NetUtil().get( + SAASAPI.community.dynamicAddViewNum, + params: { + 'dynamicId': newsId, + }, + ); + if (model.success) return ''; + return model.msg; + } + + ///查询顶部统计信息 static Future getMarketStatistics() async { BaseModel model = await NetUtil().get( diff --git a/lib/ui/community/community_views/community_page.dart b/lib/ui/community/community_views/community_page.dart index e71a6e0e..8409e3cf 100644 --- a/lib/ui/community/community_views/community_page.dart +++ b/lib/ui/community/community_views/community_page.dart @@ -33,6 +33,8 @@ import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:get/get.dart'; import 'package:provider/provider.dart'; +import 'event_detail_page.dart'; + class CommunityPage extends StatefulWidget { CommunityPage({Key? key}) : super(key: key); @@ -167,7 +169,13 @@ class _CommunityPageState extends State onDelete: () { _easyRefreshController.callRefresh(); setState(() {}); - })) + }, + onBack: (){ + _easyRefreshController.callRefresh(); + setState(() {}); + }, + + )) .toList() ], ), @@ -293,7 +301,9 @@ class _CommunityPageState extends State onTap: () async { var result = await Get.to(() => PublicInformationDetailPage(id: item.id)); + CommunityFunc.addViews(item.id); + if (result != null && result) { _easyRefreshController.callRefresh(); } diff --git a/lib/ui/community/community_views/event_detail_page.dart b/lib/ui/community/community_views/event_detail_page.dart index e96c9032..aced8511 100644 --- a/lib/ui/community/community_views/event_detail_page.dart +++ b/lib/ui/community/community_views/event_detail_page.dart @@ -101,6 +101,18 @@ 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, + ), + ) + : SizedBox(), + + title: '详情', bottomNavi: _bottomButton(), actions: [ diff --git a/lib/ui/community/community_views/my_community_view.dart b/lib/ui/community/community_views/my_community_view.dart index fc85cc52..cde37c19 100644 --- a/lib/ui/community/community_views/my_community_view.dart +++ b/lib/ui/community/community_views/my_community_view.dart @@ -160,26 +160,6 @@ class MyCommunityViewState extends State ), ); - BeeListView( - path: API.community.myEvent, - controller: _refreshController, - convert: (model) { - return model.rows.map((e) => MyEventItemModel.fromJson(e)).toList(); - }, - builder: (items) { - return ListView.separated( - padding: EdgeInsets.symmetric(vertical: 10.w), - itemBuilder: (context, index) { - final MyEventItemModel model = items[index]; - MyEventItemModel? preModel; - if (index >= 1) preModel = items[index - 1]; - return MyEventCard(model: model, preModel: preModel); - }, - separatorBuilder: (_, __) => 8.hb, - itemCount: items.length, - ); - }, - ); } Widget _getMoments(DynamicMyListBody item) { @@ -206,14 +186,14 @@ class MyCommunityViewState extends State mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - '11.15' + item.createDate.substring(5,10) .text - .size(32.sp) + .size(28.sp) .color(Color(0xA6000000)) .bold .isIntrinsic .make(), - '2021' + item.createDate.substring(0,4) .text .size(24.sp) .color(Color(0x73000000)) @@ -231,9 +211,9 @@ class MyCommunityViewState extends State mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - '25.61' + item.createDate.substring(10,16) .text - .size(28.sp) + .size(32.sp) .color(Color(0xA6000000)) .isIntrinsic .make(), @@ -268,14 +248,13 @@ class MyCommunityViewState extends State ], )); - // if (result == true) { - // await NetUtil().get( - // API.community.deleteMyEvent, - // params: {'themeId': widget.model!.id}, - // showMessage: true, - // ); - // - // } + if (result == true) { + var result = await CommunityFunc.deleteDynamicAddViews(item.id); + if(result){ + refresh(); + } + + } }, child: Container( width: 32.w, diff --git a/lib/ui/community/community_views/widgets/chat_card.dart b/lib/ui/community/community_views/widgets/chat_card.dart index e9900fe7..c08b478a 100644 --- a/lib/ui/community/community_views/widgets/chat_card.dart +++ b/lib/ui/community/community_views/widgets/chat_card.dart @@ -6,6 +6,7 @@ import 'package:aku_new_community/constants/saas_api.dart'; import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/models/community/all_dynamic_list_model.dart'; import 'package:aku_new_community/provider/user_provider.dart'; +import 'package:aku_new_community/ui/community/community_func.dart'; import 'package:aku_new_community/ui/community/community_views/add_new_event_page.dart'; import 'package:aku_new_community/ui/community/community_views/event_detail_page.dart'; import 'package:aku_new_community/utils/bee_date_util.dart'; @@ -25,7 +26,7 @@ import 'package:velocity_x/velocity_x.dart'; class ChatCard extends StatefulWidget { final AllDynamicListModel model; final VoidCallback? onDelete; - + final VoidCallback? onBack; final bool hideLine; final bool canTap; @@ -34,7 +35,7 @@ class ChatCard extends StatefulWidget { required this.model, this.onDelete, this.hideLine = false, - this.canTap = true, + this.canTap = true, this.onBack, }) : super(key: key); @override @@ -142,24 +143,21 @@ class _ChatCardState extends State { ), ), 20.wb, - GestureDetector( - onTap: widget.model.isComment == 1 ? () async {} : () async {}, - child: Material( - color: Colors.transparent, - child: Row( - children: [ - Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG, - width: 32.w, - height: 32.w, - color: Colors.black.withOpacity(0.45)), - 5.wb, - '${widget.model.commentNum}' - .text - .size(24.sp) - .color(Color(0xFF999999)) - .make(), - ], - ), + Material( + color: Colors.transparent, + child: Row( + children: [ + Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG, + width: 32.w, + height: 32.w, + color: Colors.black.withOpacity(0.45)), + 5.wb, + '${widget.model.commentNum}' + .text + .size(24.sp) + .color(Color(0xFF999999)) + .make(), + ], ), ) ], @@ -176,6 +174,7 @@ class _ChatCardState extends State { @override Widget build(BuildContext context) { + return DecoratedBox( decoration: BoxDecoration( color: Colors.white, @@ -184,10 +183,19 @@ class _ChatCardState extends State { padding: EdgeInsets.zero, onPressed: widget.canTap ? () async { - Get.to(() => EventDetailPage( + + var result = + await Get.to(() => EventDetailPage( dynamicId: widget.model.id, onDelete: widget.onDelete, )); + + CommunityFunc.dynamicAddViews(widget.model.id); + + if (result != null && result) { + widget.onBack!(); + } + } : null, child: Column( @@ -264,11 +272,8 @@ class _ChatCardState extends State { )); if (result == true) { - await NetUtil().get( - API.community.deleteMyEvent, - params: {'themeId': widget.model.id}, - showMessage: true, - ); + + await CommunityFunc.deleteDynamicAddViews(widget.model.id); if (widget.onDelete != null) widget.onDelete!(); } } diff --git a/lib/ui/profile/new_house/member_view.dart b/lib/ui/profile/new_house/member_view.dart index 897a9108..2053bddf 100644 --- a/lib/ui/profile/new_house/member_view.dart +++ b/lib/ui/profile/new_house/member_view.dart @@ -118,22 +118,19 @@ class _MemberViewState extends State { borderRadius: BorderRadius.circular(58.w), clipBehavior: Clip.antiAlias, child: Container( - width: 108.w, - height: 40.w, - alignment: Alignment.center, - padding: EdgeInsets.symmetric(horizontal: 10.w), - decoration: BoxDecoration( - color: Color(0xFFF1C87F).withOpacity(0.4), - ), - child: '${BeeMap.getIdentify(identify)}' - .text - .size(22.sp) - .maxFontSize(22.sp) - .minFontSize(18.sp) - .stepGranularity(1.sp) - .color(Colors.black.withOpacity(0.85)) - .make(), - ), + width: 108.w, + height: 40.w, + alignment: Alignment.center, + padding: EdgeInsets.symmetric(horizontal: 5.w), + decoration: BoxDecoration( + color: Color(0xFFF1C87F).withOpacity(0.4), + ), + child: Text( + '${BeeMap.getIdentify(identify)}', + style: TextStyle( + fontSize: 22.sp, + color: Colors.black.withOpacity(0.85)), + )), )) ], ),