添加 社区介绍

添加 服务浏览
添加 公共资讯详情
对接 公共资讯详情接口
hmxc
张萌 4 years ago
parent 920f2724a0
commit 3a15265753

@ -221,6 +221,9 @@ class _Manager {
///app
String get packageConfirm => '/user/packageCollection/confirmCollection';
///appid
String get getPublicInformationDetail => '/user/news/findNewsByNewsId';
}
class _Community {

@ -1,13 +1,11 @@
// import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:aku_community/pages/electronic_commerc/electronic_commerc_page.dart';
import 'package:aku_community/pages/renovation_manage/renovation_manage_page.dart';
import 'package:flutter/material.dart';
import 'package:equatable/equatable.dart';
import 'package:aku_community/const/resource.dart';
import 'package:aku_community/pages/community_introduce/community_introduce_page.dart';
import 'package:aku_community/pages/convenient_phone/convenient_phone_page.dart';
import 'package:aku_community/pages/electronic_commerc/electronic_commerc_page.dart';
import 'package:aku_community/pages/event_activity/event_voting_page.dart';
import 'package:aku_community/pages/express_packages/express_package_page.dart';
import 'package:aku_community/pages/goods_deto_page/goods_deto_page.dart';
@ -16,6 +14,8 @@ import 'package:aku_community/pages/industry_committee/industry_committee_page.d
import 'package:aku_community/pages/life_pay/life_pay_page.dart';
import 'package:aku_community/pages/one_alarm/widget/alarm_page.dart';
import 'package:aku_community/pages/opening_code_page/opening_code_page.dart';
import 'package:aku_community/pages/renovation_manage/renovation_manage_page.dart';
import 'package:aku_community/pages/service_browse/service_browse_page.dart';
import 'package:aku_community/pages/setting_page/settings_page.dart';
import 'package:aku_community/pages/things_page/fixed_submit_page.dart';
import 'package:aku_community/pages/visitor_access_page/visitor_access_page.dart';
@ -30,7 +30,7 @@ import 'package:aku_community/ui/profile/house/house_owners_page.dart';
///
///Application Object
class AO extends Equatable {
class AO {
String title = '';
String path = '';
dynamic page = () => Scaffold();
@ -52,7 +52,16 @@ class AO extends Equatable {
}
@override
List<Object?> get props => [title];
bool operator ==(Object other) {
if (identical(this, other)) return true;
return other is AO &&
other.title == title &&
other.path == path;
}
@override
int get hashCode => title.hashCode ^ path.hashCode;
}
///
@ -80,6 +89,8 @@ List<AO> appObjects = [
AO('设施预约', R.ASSETS_ICONS_TOOL_FACILITY_PNG, () => FacilityAppointmentPage()),
AO('快递包裹', R.ASSETS_APPLICATIONS_TRANSFER_PNG, () => ExpressPackagePage()),
AO('电子商务', R.ASSETS_IMAGES_PLACEHOLDER_WEBP, () => ElectronicCommercPage()),
AO('服务浏览', R.ASSETS_IMAGES_PLACEHOLDER_WEBP, () => ServiceBrowsePage()),
AO('社区介绍', R.ASSETS_IMAGES_PLACEHOLDER_WEBP, () => CommunityIntroducePage()),
// AO(
// '小区教育',
// R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
@ -156,6 +167,8 @@ List<String> _smartManagerApp = [
'设施预约',
'快递包裹',
'电子商务',
'服务浏览',
'社区介绍',
// '小区教育',
// '健康运动',
// '家政服务',

@ -0,0 +1,37 @@
import 'package:equatable/equatable.dart';
import 'package:json_annotation/json_annotation.dart';
part 'news_detail_model.g.dart';
@JsonSerializable()
class NewsDetailModel extends Equatable {
final int id;
final String code;
final String title;
final String content;
final String newsCategoryName;
final String createName;
final String createDate;
NewsDetailModel({
required this.id,
required this.code,
required this.title,
required this.content,
required this.newsCategoryName,
required this.createName,
required this.createDate,
});
factory NewsDetailModel.fromJson(Map<String, dynamic> json) =>
_$NewsDetailModelFromJson(json);
@override
List<Object> get props {
return [
id,
code,
title,
content,
newsCategoryName,
createName,
createDate,
];
}
}

@ -0,0 +1,19 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'news_detail_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
NewsDetailModel _$NewsDetailModelFromJson(Map<String, dynamic> json) {
return NewsDetailModel(
id: json['id'] as int,
code: json['code'] as String,
title: json['title'] as String,
content: json['content'] as String,
newsCategoryName: json['newsCategoryName'] as String,
createName: json['createName'] as String,
createDate: json['createDate'] as String,
);
}

@ -0,0 +1,45 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/const/resource.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class CommunityIntroducePage extends StatefulWidget {
CommunityIntroducePage({Key? key}) : super(key: key);
@override
_CommunityIntroducePageState createState() => _CommunityIntroducePageState();
}
class _CommunityIntroducePageState extends State<CommunityIntroducePage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
bodyColor: Colors.white,
title: '社区介绍',
body: ListView(
children: [
SizedBox(
child: Image.asset(
R.ASSETS_IMAGES_PLACEHOLDER_WEBP,
fit: BoxFit.cover,
),
width: double.infinity,
height: 424.w,
),
24.w.heightBox,
''' 小区内部环境典雅幽静绿化多通过小区道路的合理组织休闲设施的精心安排提供自然、舒适的居住环境。周边配套齐全设施完备物业管理完善保安24小时值班住户素质高。社区主流健康向上社区风气良好邻里关系和谐。
便
广
线西使
'''
.text
.size(28.sp)
.color(ktextPrimary)
.make(),
],
),
);
}
}

@ -0,0 +1,70 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_community/extensions/widget_list_ext.dart';
class ServiceBrowsePage extends StatefulWidget {
ServiceBrowsePage({Key? key}) : super(key: key);
@override
_ServiceBrowsePageState createState() => _ServiceBrowsePageState();
}
class _ServiceBrowsePageState extends State<ServiceBrowsePage> {
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '服务浏览',
body: ListView(
padding: EdgeInsets.symmetric(vertical: 12.w),
children: [
_buildCard(
'小区绿化服务范围及工作范畴',
'随着城市建设的发展,人们对生活环境的要求越来越高,越来越重视小区的园林绿化建设,绿化养护作为一项长期性工作,需要有科学的计划和正确的实施方法,同时要求园林人扎实做好......',
'南宁人才公寓',
' 04-13 09:46'),
].sepWidget(separate: 12.w.heightBox),
),
);
}
Widget _buildCard(String title, String content, String name, String date) {
return Container(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
width: double.infinity,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
title.text
.size(32.sp)
.color(ktextPrimary)
.maxLines(1)
.overflow(TextOverflow.ellipsis)
.bold
.make(),
32.w.heightBox,
content.text
.size(24.sp)
.color(ktextSubColor)
.maxLines(3)
.overflow(TextOverflow.ellipsis)
.make(),
32.w.heightBox,
Row(
children: [
name.text.size(20.sp).color(ktextSubColor).make(),
Spacer(),
'发布于 ${DateUtil.formatDateStr(date, format: 'MM-dd HH:mm')}'
.text
.size(20.sp)
.color(ktextSubColor)
.make(),
],
),
],
));
}
}

@ -1,11 +1,13 @@
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/model/common/img_model.dart';
import 'package:aku_community/models/news/news_item_model.dart';
import 'package:aku_community/ui/home/public_infomation/public_information_detail_page.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/utils/headers.dart';
import 'package:get/get.dart';
class PublicInfomationCard extends StatelessWidget {
final NewsItemModel model;
@ -17,7 +19,9 @@ class PublicInfomationCard extends StatelessWidget {
color: Colors.white,
elevation: 0,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
onPressed: () {},
onPressed: () {
Get.to(() => PublicInformationDetailPage(id:this.model.id));
},
padding: EdgeInsets.zero,
child: Container(
height: 248.w,
@ -26,6 +30,7 @@ class PublicInfomationCard extends StatelessWidget {
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(model.title),
Spacer(),

@ -0,0 +1,100 @@
import 'package:aku_community/base/base_style.dart';
import 'package:aku_community/constants/api.dart';
import 'package:aku_community/models/news/news_detail_model.dart';
import 'package:aku_community/utils/network/base_model.dart';
import 'package:aku_community/utils/network/net_util.dart';
import 'package:aku_community/widget/bee_scaffold.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class PublicInformationDetailPage extends StatefulWidget {
final int id;
PublicInformationDetailPage({Key? key, required this.id}) : super(key: key);
@override
_PublicInformationDetailPageState createState() =>
_PublicInformationDetailPageState();
}
class _PublicInformationDetailPageState
extends State<PublicInformationDetailPage> {
late EasyRefreshController _easyRefreshController;
bool _onload = true;
late NewsDetailModel _detailModel;
@override
void initState() {
super.initState();
_easyRefreshController = EasyRefreshController();
}
@override
void dispose() {
_easyRefreshController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '公共资讯',
bodyColor: Colors.white,
body: EasyRefresh(
firstRefresh: true,
header: MaterialHeader(),
onRefresh: () async {
BaseModel baseModel = await NetUtil()
.get(API.manager.getPublicInformationDetail, params: {
"newsId": widget.id,
});
if (baseModel.status! && baseModel.data != null) {
_detailModel = NewsDetailModel.fromJson(baseModel.data);
} else {
BotToast.showText(text: '无法获取信息');
}
_onload = false;
setState(() {});
},
child: _onload
? _emptyWidget()
: ListView(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
children: [
_detailModel.title.text
.size(36.sp)
.color(ktextPrimary)
.bold
.align(TextAlign.center)
.make(),
24.w.heightBox,
SizedBox(
width: double.infinity,
child: _detailModel.content.text
.size(28.sp)
.color(ktextPrimary)
.make(),
),
40.w.heightBox,
Row(
children: [
Spacer(),
'发布于 ${DateUtil.formatDateStr(_detailModel.createDate, format: 'MM-dd HH:mm')}'
.text
.size(24.sp)
.color(ktextSubColor)
.make(),
],
)
],
),
),
);
}
Widget _emptyWidget() {
return Container();
}
}
Loading…
Cancel
Save