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 addViewNum => '/app/user/information/addViewNum';
///
String get dynamicAddViewNum => '/app/user/community/dynamic/addViewNum';
///
String get deleteDynamic => '/app/user/community/dynamic/delete';
}
class _Task {

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

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

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

@ -20,4 +20,5 @@ ReplyListModel _$ReplyListModelFromJson(Map<String, dynamic> json) =>
dynamicImgList: (json['dynamicImgList'] as List<dynamic>)
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
.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/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<HomePage>
],
),
),
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));
},
),
)

@ -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,28 +44,49 @@ class AnnounceCard extends StatelessWidget {
...modelList.models
.map((e) => _card(e))
.toList()
.sepWidget(separate: 10.heightBox)
],
);
}
Widget _card(HomeAnnounceModel model) {
return Container(
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,
),
),
32.w.heightBox,
'${model.title}'.text.size(36.sp).black.bold.make(),
32.w.heightBox,
'${model.content}'.text.size(28.sp).color(ktextSubColor).make(),
'${model.content}'.text.maxLines(2).ellipsis.size(28.sp).color(ktextSubColor).make(),
40.w.heightBox,
Container(
height: 72.w,
@ -75,10 +97,6 @@ class AnnounceCard extends StatelessWidget {
),
),
),
child: InkWell(
onTap: () {
Get.to(() => NoticeDetailPage(id: model.id));
},
child: Row(
children: [
'查看详情'.text.size(24.w).color(ktextSubColor).make(),
@ -90,9 +108,9 @@ class AnnounceCard extends StatelessWidget {
],
),
),
),
],
),
),
);
}
}

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

@ -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(),
],
),
),

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

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

@ -104,6 +104,7 @@ class ActivityCard extends StatelessWidget {
(model?.avatarImgList?.map((e) => e.url).toList() ?? []),
pNum: model?.registrationNum ?? 0,
hasIcon: false,
),
),
// 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/model/common/img_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 {
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<ActivityDetailPage> {
BeeDivider.horizontal(),
16.hb,
AvatarsParticipate(
registrationList: _model!.registrationList,
avatars: _model!.registrationList
.map((e) => ImgModel.first(e.avatarImgList))
.toList(),

@ -38,6 +38,7 @@ class _ActivityPeopleListPageState extends State<ActivityPeopleListPage> {
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<ActivityPeopleListPage> {
itemBuilder: (context, index) {
return Row(
children: [
96.hb,
132.hb,
20.wb,
FadeInImage.assetNetwork(
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: 60.w,
width: 60.w,
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<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();
}
///
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 {
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<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 {
BaseModel model = await NetUtil().get(

@ -32,6 +32,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);
@ -173,7 +175,13 @@ class _CommunityPageState extends State<CommunityPage>
onDelete: () {
_easyRefreshController.callRefresh();
setState(() {});
}))
},
onBack: (){
_easyRefreshController.callRefresh();
setState(() {});
},
))
.toList()
],
),
@ -299,7 +307,9 @@ class _CommunityPageState extends State<CommunityPage>
onTap: () async {
var result =
await Get.to(() => PublicInformationDetailPage(id: item.id));
CommunityFunc.addViews(item.id);
if (result != null && result) {
_easyRefreshController.callRefresh();
}

@ -101,6 +101,18 @@ class _EventDetailPageState extends State<EventDetailPage> {
@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: [

@ -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) {
@ -290,14 +270,13 @@ class MyCommunityViewState extends State<MyCommunityView>
],
));
// 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,

@ -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,9 +143,7 @@ class _ChatCardState extends State<ChatCard> {
),
),
20.wb,
GestureDetector(
onTap: widget.model.isComment == 1 ? () async {} : () async {},
child: Material(
Material(
color: Colors.transparent,
child: Row(
children: [
@ -160,7 +159,6 @@ class _ChatCardState extends State<ChatCard> {
.make(),
],
),
),
)
],
),
@ -176,6 +174,7 @@ class _ChatCardState extends State<ChatCard> {
@override
Widget build(BuildContext context) {
return DecoratedBox(
decoration: BoxDecoration(
color: Colors.white,
@ -184,10 +183,19 @@ class _ChatCardState extends State<ChatCard> {
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<ChatCard> {
));
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!();
}
}

@ -121,19 +121,16 @@ class _MemberViewState extends State<MemberView> {
width: 108.w,
height: 40.w,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 10.w),
padding: EdgeInsets.symmetric(horizontal: 5.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(),
),
child: Text(
'${BeeMap.getIdentify(identify)}',
style: TextStyle(
fontSize: 22.sp,
color: Colors.black.withOpacity(0.85)),
)),
))
],
),

Loading…
Cancel
Save