Compare commits

...

2 Commits

Author SHA1 Message Date
章文轩 e526b1ff4f Merge branch 'newHost' of https://git.oa00.com/1281228557/aku_new_community into newHost
3 years ago
章文轩 0de57d3905 fix bugs
3 years ago

@ -152,6 +152,18 @@ class _Community {
/// ///
String get topNewList => '/app/user/community/topic/newList'; 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 { class _Task {

@ -26,6 +26,7 @@ class ActivityDetailModel {
final String contact; final String contact;
final String tel; final String tel;
final List<ImgModel> organizerImgList; final List<ImgModel> organizerImgList;
final int isRegistration;
factory ActivityDetailModel.fromJson(Map<String, dynamic> json) => factory ActivityDetailModel.fromJson(Map<String, dynamic> json) =>
_$ActivityDetailModelFromJson(json); _$ActivityDetailModelFromJson(json);
@ -55,6 +56,7 @@ class ActivityDetailModel {
required this.contact, required this.contact,
required this.tel, required this.tel,
required this.organizerImgList, required this.organizerImgList,
required this.isRegistration,
}); });
} }

@ -34,6 +34,7 @@ ActivityDetailModel _$ActivityDetailModelFromJson(Map<String, dynamic> json) =>
organizerImgList: (json['organizerImgList'] as List<dynamic>) organizerImgList: (json['organizerImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>)) .map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
isRegistration:json['isRegistration'] as int
); );
Registration _$RegistrationFromJson(Map<String, dynamic> json) => Registration( Registration _$RegistrationFromJson(Map<String, dynamic> json) => Registration(

@ -14,6 +14,7 @@ class ReplyListModel {
final String sendDate; final String sendDate;
final List<ImgModel> avatarImgList; final List<ImgModel> avatarImgList;
final List<ImgModel> dynamicImgList; final List<ImgModel> dynamicImgList;
final int jumpId;
factory ReplyListModel.fromJson(Map<String, dynamic> json) => factory ReplyListModel.fromJson(Map<String, dynamic> json) =>
_$ReplyListModelFromJson(json); _$ReplyListModelFromJson(json);
@ -32,5 +33,6 @@ class ReplyListModel {
required this.sendDate, required this.sendDate,
required this.avatarImgList, required this.avatarImgList,
required this.dynamicImgList, required this.dynamicImgList,
required this.jumpId
}); });
} }

@ -20,4 +20,5 @@ ReplyListModel _$ReplyListModelFromJson(Map<String, dynamic> json) =>
dynamicImgList: (json['dynamicImgList'] as List<dynamic>) dynamicImgList: (json['dynamicImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>)) .map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
jumpId:json['jumpId'] as int
); );

@ -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/manager/advice/advice_page.dart';
import 'package:aku_new_community/ui/market/search/good_detail_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/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/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/beeImageNetwork.dart';
import 'package:aku_new_community/widget/bee_divider.dart'; import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/others/rectIndicator.dart'; import 'package:aku_new_community/widget/others/rectIndicator.dart';
@ -353,9 +355,15 @@ class _HomePageState extends State<HomePage>
], ],
), ),
), ),
onTap: () { onTap: () async {
Get.to(AdvicePage( var agreement = await HiveStore.appBox?.get('AdvicePage') ?? false;
type: AdviceType.SUGGESTION)); if (!agreement) {
await TipsDialog.tipsDialog();
HiveStore.appBox!.put('AdvicePage', true);
}
// Get.to(AdvicePage(
// type: AdviceType.SUGGESTION));
}, },
), ),
) )

@ -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/models/home/home_announce_model.dart';
import 'package:aku_new_community/pages/message_center_page/announce/announce_view.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/ui/community/notice/notice_detail_page.dart';
import 'package:aku_new_community/widget/beeImageNetwork.dart';
import 'package:common_utils/common_utils.dart'; import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -43,42 +44,59 @@ class AnnounceCard extends StatelessWidget {
...modelList.models ...modelList.models
.map((e) => _card(e)) .map((e) => _card(e))
.toList() .toList()
.sepWidget(separate: 10.heightBox)
], ],
); );
} }
Widget _card(HomeAnnounceModel model) { Widget _card(HomeAnnounceModel model) {
return Container( return InkWell(
color: Colors.white, onTap: () {
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w), Get.to(() => NoticeDetailPage(id: model.id));
child: Column( },
mainAxisSize: MainAxisSize.min, child: Container(
crossAxisAlignment: CrossAxisAlignment.start, color: Colors.white,
children: [ padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 24.w),
'${DateUtil.formatDateStr(model.createDate, format: 'dd日 HH:mm')}' margin: EdgeInsets.only(bottom: 16 .w),
.text child: Column(
.size(28.sp)
.color(ktextSubColor)
.make(),
32.w.heightBox, mainAxisSize: MainAxisSize.min,
'${model.title}'.text.size(36.sp).black.bold.make(), crossAxisAlignment: CrossAxisAlignment.start,
32.w.heightBox, children: [
'${model.content}'.text.size(28.sp).color(ktextSubColor).make(),
40.w.heightBox,
Container( '${DateUtil.formatDateStr(model.createDate, format: 'dd日 HH:mm')}'
height: 72.w, .text
decoration: BoxDecoration( .size(28.sp)
border: Border( .color(ktextSubColor)
top: BorderSide( .make(),
color: Color(0xFF000000).withOpacity(0.06), 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( 32.w.heightBox,
onTap: () {
Get.to(() => NoticeDetailPage(id: model.id)); '${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( child: Row(
children: [ children: [
'查看详情'.text.size(24.w).color(ktextSubColor).make(), '查看详情'.text.size(24.w).color(ktextSubColor).make(),
@ -90,8 +108,8 @@ class AnnounceCard extends StatelessWidget {
], ],
), ),
), ),
), ],
], ),
), ),
); );
} }

@ -71,7 +71,7 @@ class _MessageCenterPageState extends State<MessageCenterPage>
), ),
body: TabBarView( body: TabBarView(
children: [ children: [
ReplayView( ReplayView(
controller: _controllers[0], controller: _controllers[0],
), ),
ThumbsUpView( ThumbsUpView(

@ -38,7 +38,7 @@ class _ReplayViewState extends State<ReplayView> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ReplyCard(model: items[index]); return ReplyCard(model: items[index]);
}, },
separatorBuilder: (_, __) => 20.w.heightBox, separatorBuilder: (_, __) =>1.w.heightBox,
itemCount: items.length); itemCount: items.length);
}); });
} }

@ -1,9 +1,11 @@
import 'package:aku_new_community/base/base_style.dart'; 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/models/message/reply_list_model.dart';
import 'package:aku_new_community/pages/message_center_page/message_func.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:aku_new_community/widget/beeImageNetwork.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:velocity_x/velocity_x.dart'; import 'package:velocity_x/velocity_x.dart';
class ReplyCard extends StatelessWidget { class ReplyCard extends StatelessWidget {
@ -16,9 +18,16 @@ class ReplyCard extends StatelessWidget {
return GestureDetector( return GestureDetector(
onTap: () async { onTap: () async {
await MessageFunc.readMessage(model.id); await MessageFunc.readMessage(model.id);
Get.to(() => EventDetailPage(
dynamicId: model.jumpId,
onDelete: (){
},
));
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 48.w), padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 48.w),
color: Colors.white,
child: Row( child: Row(
children: [ children: [
ClipOval( ClipOval(
@ -35,13 +44,15 @@ class ReplyCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
model.sendName.text.size(26.sp).black.bold.make(), model.sendName.text.size(26.sp).black.bold.make(),
5.heightBox,
model.content.text model.content.text
.size(24.sp) .size(26.sp)
.color(ktextSubColor) .color(ktextSubColor)
.maxLines(1) .maxLines(1)
.ellipsis .ellipsis
.make(), .make(),
model.sendDate.text.size(24.sp).color(ktextSubColor).make(), 5.heightBox,
model.sendDate.text.size(22.sp).color(ktextSubColor).make(),
], ],
), ),
), ),

@ -259,6 +259,7 @@ class _ClockInPageState extends State<ClockInPage> {
currentValue.signDate, currentValue.signDate,
currentValue.addNums)) currentValue.addNums))
.toList(), .toList(),
_records.length>6?
Container( Container(
width: double.infinity, width: double.infinity,
height: 82.w, height: 82.w,
@ -266,7 +267,7 @@ class _ClockInPageState extends State<ClockInPage> {
color: Color(0xFFE5E5E5), color: Color(0xFFE5E5E5),
child: child:
'没有更多记录了~'.text.size(28.sp).color(ktextSubColor).make(), '没有更多记录了~'.text.size(28.sp).color(ktextSubColor).make(),
), ):SizedBox(),
].sepWidget(separate: 32.hb), ].sepWidget(separate: 32.hb),
), ),
) )

@ -406,7 +406,9 @@ class _PersonalIndexState extends State<PersonalIndex>
_function( _function(
'我的房屋', '我的房屋',
R.ASSETS_ICONS_ICON_MY_HOUSE_PNG, R.ASSETS_ICONS_ICON_MY_HOUSE_PNG,
() => MyHousePage(), (){
Get.to(() => MyHousePage());
},
// () => HouseOwnersPage( // () => HouseOwnersPage(
// identify: 4, // identify: 4,
// ), // ),
@ -415,23 +417,33 @@ class _PersonalIndexState extends State<PersonalIndex>
'${UserTool.userProvider.defaultHouse?.unitName ?? ''}' '${UserTool.userProvider.defaultHouse?.unitName ?? ''}'
'${UserTool.userProvider.defaultHouse?.estateName ?? ''}', '${UserTool.userProvider.defaultHouse?.estateName ?? ''}',
), ),
36.hb,
_function( _function(
'我的家庭', '我的家庭',
R.ASSETS_ICONS_ICON_MY_HOUSE_PNG, R.ASSETS_ICONS_ICON_MY_HOUSE_PNG,
() => MyFamilyPage(), (){
Get.to(() => MyFamilyPage());
}
,
''), ''),
36.hb,
// _function('我的车位', R.ASSETS_ICONS_ICON_MY_CARSEAT_PNG, // _function('我的车位', R.ASSETS_ICONS_ICON_MY_CARSEAT_PNG,
// () => CarParkingPage(), ''), // () => CarParkingPage(), ''),
// 36.hb, // 36.hb,
// _function('我的车', R.ASSETS_ICONS_ICON_MY_CAR_PNG, // _function('我的车', R.ASSETS_ICONS_ICON_MY_CAR_PNG,
// () => CarManagePage(), ''), // () => CarManagePage(), ''),
// 36.hb, // 36.hb,
// _function( _function(
// '我的访客', '我的访客',
// R.ASSETS_ICONS_ICON_MY_VISITOR_PNG, R.ASSETS_ICONS_ICON_MY_VISITOR_PNG,
// () => CarManagePage(), (){
// ''), BotToast.showText(text: '当前小区尚未连接设备', align: Alignment(0, 0.5));
// 36.hb, }
,
''),
36.hb,
_function( _function(
'收货地址', '收货地址',
R.ASSETS_ICONS_ICON_MY_LOCATION_PNG, R.ASSETS_ICONS_ICON_MY_LOCATION_PNG,
@ -477,13 +489,12 @@ class _PersonalIndexState extends State<PersonalIndex>
_function( _function(
String title, String title,
String path, String path,
dynamic page, VoidCallback onTap,
//dynamic page,
String msg, String msg,
) { ) {
return GestureDetector( return GestureDetector(
onTap: () { onTap: onTap,
Get.to(page);
},
child: Container( child: Container(
color: Colors.transparent, color: Colors.transparent,
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.w), padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 20.w),

@ -104,6 +104,7 @@ class ActivityCard extends StatelessWidget {
(model?.avatarImgList?.map((e) => e.url).toList() ?? []), (model?.avatarImgList?.map((e) => e.url).toList() ?? []),
pNum: model?.registrationNum ?? 0, pNum: model?.registrationNum ?? 0,
hasIcon: false, hasIcon: false,
), ),
), ),
// Spacer(), // Spacer(),

@ -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/constants/saas_api.dart';
import 'package:aku_new_community/model/common/img_model.dart'; import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/models/home/activity_detail_model.dart'; import 'package:aku_new_community/models/home/activity_detail_model.dart';
@ -166,7 +167,7 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
} }
bool get canTap { bool get canTap {
if (_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) { if ((_model?.regisEndTime?.isBefore(DateTime.now()) ?? true) ||_model!.isRegistration==1) {
return false; return false;
} }
return true; return true;
@ -298,6 +299,7 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
BeeDivider.horizontal(), BeeDivider.horizontal(),
16.hb, 16.hb,
AvatarsParticipate( AvatarsParticipate(
registrationList: _model!.registrationList,
avatars: _model!.registrationList avatars: _model!.registrationList
.map((e) => ImgModel.first(e.avatarImgList)) .map((e) => ImgModel.first(e.avatarImgList))
.toList(), .toList(),

@ -38,6 +38,7 @@ class _ActivityPeopleListPageState extends State<ActivityPeopleListPage> {
color: Colors.black.withOpacity(0.06), color: Colors.black.withOpacity(0.06),
height: 75.w, height: 75.w,
width: double.infinity, width: double.infinity,
alignment: Alignment.center,
child: '已有'.richText.color(Colors.black.withOpacity(0.65)).size(28.sp).withTextSpanChildren([ child: '已有'.richText.color(Colors.black.withOpacity(0.65)).size(28.sp).withTextSpanChildren([
widget.registrationList==null?''.textSpan widget.registrationList==null?''.textSpan
.size(28.sp) .size(28.sp)
@ -59,16 +60,29 @@ class _ActivityPeopleListPageState extends State<ActivityPeopleListPage> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Row( return Row(
children: [ children: [
96.hb, 132.hb,
20.wb, 20.wb,
FadeInImage.assetNetwork( Material(
placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, color: Color(0xFFF5F5F5),
image: SAASAPI.image(ImgModel.first(widget.registrationList![index].avatarImgList)), borderRadius: BorderRadius.circular(40.w),
height: 60.w, clipBehavior: Clip.antiAlias,
width: 60.w, 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, 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<ActivityPeopleListPage> {
); );
} }
getName(String name){
for(int i=0;i<name.length;i++){
if(i>0){
name = name.replaceRange(i, i+1, '*') ;
}
}
return name;
}
} }

@ -47,18 +47,45 @@ class CommunityFunc {
return model.rows.map((e) => InformationListModel.fromJson(e)).toList(); return model.rows.map((e) => InformationListModel.fromJson(e)).toList();
} }
///
static Future<bool> 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<String> addViews(int newsId) async { static Future<String> addViews(int newsId) async {
BaseModel model = await NetUtil().get( BaseModel model = await NetUtil().get(
API.community.addViews, SAASAPI.community.addViewNum,
params: { params: {
'newsId': newsId, 'informationId': newsId,
}, },
); );
if (model.success) return ''; if (model.success) return '';
return model.msg; return model.msg;
} }
///
static Future<String> dynamicAddViews(int newsId) async {
BaseModel model = await NetUtil().get(
SAASAPI.community.dynamicAddViewNum,
params: {
'dynamicId': newsId,
},
);
if (model.success) return '';
return model.msg;
}
/// ///
static Future<MarketStatisticsModel?> getMarketStatistics() async { static Future<MarketStatisticsModel?> getMarketStatistics() async {
BaseModel model = await NetUtil().get( BaseModel model = await NetUtil().get(

@ -32,6 +32,8 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'event_detail_page.dart';
class CommunityPage extends StatefulWidget { class CommunityPage extends StatefulWidget {
CommunityPage({Key? key}) : super(key: key); CommunityPage({Key? key}) : super(key: key);
@ -173,7 +175,13 @@ class _CommunityPageState extends State<CommunityPage>
onDelete: () { onDelete: () {
_easyRefreshController.callRefresh(); _easyRefreshController.callRefresh();
setState(() {}); setState(() {});
})) },
onBack: (){
_easyRefreshController.callRefresh();
setState(() {});
},
))
.toList() .toList()
], ],
), ),
@ -299,7 +307,9 @@ class _CommunityPageState extends State<CommunityPage>
onTap: () async { onTap: () async {
var result = var result =
await Get.to(() => PublicInformationDetailPage(id: item.id)); await Get.to(() => PublicInformationDetailPage(id: item.id));
CommunityFunc.addViews(item.id); CommunityFunc.addViews(item.id);
if (result != null && result) { if (result != null && result) {
_easyRefreshController.callRefresh(); _easyRefreshController.callRefresh();
} }

@ -101,6 +101,18 @@ class _EventDetailPageState extends State<EventDetailPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BeeScaffold( return BeeScaffold(
leading: Navigator.canPop(context)
? IconButton(
onPressed: () => Get.back(result: true),
icon: Icon(
CupertinoIcons.chevron_back,
color: Colors.black,
),
)
: SizedBox(),
title: '详情', title: '详情',
bottomNavi: _bottomButton(), bottomNavi: _bottomButton(),
actions: [ actions: [

@ -181,26 +181,6 @@ class MyCommunityViewState extends State<MyCommunityView>
), ),
); );
BeeListView<MyEventItemModel>(
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) { Widget _getMoments(DynamicMyListBody item) {
@ -290,14 +270,13 @@ class MyCommunityViewState extends State<MyCommunityView>
], ],
)); ));
// if (result == true) { if (result == true) {
// await NetUtil().get( var result = await CommunityFunc.deleteDynamicAddViews(item.id);
// API.community.deleteMyEvent, if(result){
// params: {'themeId': widget.model!.id}, refresh();
// showMessage: true, }
// );
// }
// }
}, },
child: Container( child: Container(
width: 32.w, width: 32.w,

@ -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/model/common/img_model.dart';
import 'package:aku_new_community/models/community/all_dynamic_list_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/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/add_new_event_page.dart';
import 'package:aku_new_community/ui/community/community_views/event_detail_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'; 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 { class ChatCard extends StatefulWidget {
final AllDynamicListModel model; final AllDynamicListModel model;
final VoidCallback? onDelete; final VoidCallback? onDelete;
final VoidCallback? onBack;
final bool hideLine; final bool hideLine;
final bool canTap; final bool canTap;
@ -34,7 +35,7 @@ class ChatCard extends StatefulWidget {
required this.model, required this.model,
this.onDelete, this.onDelete,
this.hideLine = false, this.hideLine = false,
this.canTap = true, this.canTap = true, this.onBack,
}) : super(key: key); }) : super(key: key);
@override @override
@ -142,24 +143,21 @@ class _ChatCardState extends State<ChatCard> {
), ),
), ),
20.wb, 20.wb,
GestureDetector( Material(
onTap: widget.model.isComment == 1 ? () async {} : () async {}, color: Colors.transparent,
child: Material( child: Row(
color: Colors.transparent, children: [
child: Row( Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG,
children: [ width: 32.w,
Image.asset(R.ASSETS_ICONS_COMMUNITY_COMMENT_PNG, height: 32.w,
width: 32.w, color: Colors.black.withOpacity(0.45)),
height: 32.w, 5.wb,
color: Colors.black.withOpacity(0.45)), '${widget.model.commentNum}'
5.wb, .text
'${widget.model.commentNum}' .size(24.sp)
.text .color(Color(0xFF999999))
.size(24.sp) .make(),
.color(Color(0xFF999999)) ],
.make(),
],
),
), ),
) )
], ],
@ -176,6 +174,7 @@ class _ChatCardState extends State<ChatCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return DecoratedBox( return DecoratedBox(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -184,10 +183,19 @@ class _ChatCardState extends State<ChatCard> {
padding: EdgeInsets.zero, padding: EdgeInsets.zero,
onPressed: widget.canTap onPressed: widget.canTap
? () async { ? () async {
Get.to(() => EventDetailPage(
var result =
await Get.to(() => EventDetailPage(
dynamicId: widget.model.id, dynamicId: widget.model.id,
onDelete: widget.onDelete, onDelete: widget.onDelete,
)); ));
CommunityFunc.dynamicAddViews(widget.model.id);
if (result != null && result) {
widget.onBack!();
}
} }
: null, : null,
child: Column( child: Column(
@ -264,11 +272,8 @@ class _ChatCardState extends State<ChatCard> {
)); ));
if (result == true) { if (result == true) {
await NetUtil().get(
API.community.deleteMyEvent, await CommunityFunc.deleteDynamicAddViews(widget.model.id);
params: {'themeId': widget.model.id},
showMessage: true,
);
if (widget.onDelete != null) widget.onDelete!(); if (widget.onDelete != null) widget.onDelete!();
} }
} }

@ -118,22 +118,19 @@ class _MemberViewState extends State<MemberView> {
borderRadius: BorderRadius.circular(58.w), borderRadius: BorderRadius.circular(58.w),
clipBehavior: Clip.antiAlias, clipBehavior: Clip.antiAlias,
child: Container( child: Container(
width: 108.w, width: 108.w,
height: 40.w, height: 40.w,
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 10.w), padding: EdgeInsets.symmetric(horizontal: 5.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFFF1C87F).withOpacity(0.4), color: Color(0xFFF1C87F).withOpacity(0.4),
), ),
child: '${BeeMap.getIdentify(identify)}' child: Text(
.text '${BeeMap.getIdentify(identify)}',
.size(22.sp) style: TextStyle(
.maxFontSize(22.sp) fontSize: 22.sp,
.minFontSize(18.sp) color: Colors.black.withOpacity(0.85)),
.stepGranularity(1.sp) )),
.color(Colors.black.withOpacity(0.85))
.make(),
),
)) ))
], ],
), ),

Loading…
Cancel
Save