社区活动相关接口对接

活动信息列表、活动详情、活动参与
BIGGGGG change.
hmxc
小赖 4 years ago
parent 26366ae719
commit c11b177352

@ -15,6 +15,7 @@ class API {
static _User user = _User();
static _Manager manager = _Manager();
static _Upload upload = _Upload();
static _Community community = _Community();
}
class _Login {
@ -114,10 +115,22 @@ class _Manager {
///
String get reportRepairComplete => '/user/reportRepair/completeOrder';
///
String get reportRepairEvaluate => '/user/reportRepair/evaluate';
}
class _Community {
///
String get activityList => '/user/activity/list';
///id
String get activityDetail => '/user/activity/findById';
///
String get activityPeopleList => '/user/activity/participantsList';
}
class _Upload {
///
String get uploadArticle => '/user/upload/uploadArticle';

@ -0,0 +1,27 @@
class ImgModel {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgModel({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgModel.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}

@ -0,0 +1,75 @@
import 'package:akuCommunity/model/common/img_model.dart';
import 'package:common_utils/common_utils.dart';
class ActivityDetailModel {
int id;
String title;
String content;
String location;
String activityStartTime;
String activityEndTime;
String registrationEndTime;
int countRegistration;
List<ImgModel> imgUrls;
List<ImgModel> headImgURls;
DateTime get startDate => DateUtil.getDateTime(activityStartTime);
DateTime get endDate => DateUtil.getDateTime(activityEndTime);
DateTime get registEndDate => DateUtil.getDateTime(registrationEndTime);
ActivityDetailModel(
{this.id,
this.title,
this.content,
this.location,
this.activityStartTime,
this.activityEndTime,
this.registrationEndTime,
this.countRegistration,
this.imgUrls,
this.headImgURls});
ActivityDetailModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
content = json['content'];
location = json['location'];
activityStartTime = json['activityStartTime'];
activityEndTime = json['activityEndTime'];
registrationEndTime = json['registrationEndTime'];
countRegistration = json['countRegistration'];
if (json['imgUrls'] != null) {
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgModel.fromJson(v));
});
} else
imgUrls = [];
if (json['headImgURls'] != null) {
headImgURls = new List<ImgModel>();
json['headImgURls'].forEach((v) {
headImgURls.add(new ImgModel.fromJson(v));
});
} else
headImgURls = [];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['content'] = this.content;
data['location'] = this.location;
data['activityStartTime'] = this.activityStartTime;
data['activityEndTime'] = this.activityEndTime;
data['registrationEndTime'] = this.registrationEndTime;
data['countRegistration'] = this.countRegistration;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
}
if (this.headImgURls != null) {
data['headImgURls'] = this.headImgURls.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -0,0 +1,68 @@
import 'package:akuCommunity/model/common/img_model.dart';
import 'package:common_utils/common_utils.dart';
class ActivityItemModel {
int id;
String title;
String location;
int status;
String registrationStartTime;
String registrationEndTime;
List<ImgModel> imgUrls;
List<ImgModel> headImgURls;
DateTime get begin => DateUtil.getDateTime(registrationStartTime);
DateTime get end => DateUtil.getDateTime(registrationEndTime);
ActivityItemModel(
{this.id,
this.title,
this.location,
this.status,
this.registrationStartTime,
this.registrationEndTime,
this.imgUrls,
this.headImgURls});
ActivityItemModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
location = json['location'];
status = json['status'];
registrationStartTime = json['registrationStartTime'];
registrationEndTime = json['registrationEndTime'];
if (json['imgUrls'] != null) {
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgModel.fromJson(v));
});
} else {
imgUrls = [];
}
if (json['headImgURls'] != null) {
headImgURls = new List<ImgModel>();
json['headImgURls'].forEach((v) {
headImgURls.add(new ImgModel.fromJson(v));
});
} else {
headImgURls = [];
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['location'] = this.location;
data['status'] = this.status;
data['registrationStartTime'] = this.registrationStartTime;
data['registrationEndTime'] = this.registrationEndTime;
if (this.imgUrls != null) {
data['imgUrls'] = this.imgUrls.map((v) => v.toJson()).toList();
}
if (this.headImgURls != null) {
data['headImgURls'] = this.headImgURls.map((v) => v.toJson()).toList();
}
return data;
}
}

@ -0,0 +1,59 @@
class ActivityPeopleModel {
int id;
String name;
String tel;
List<ImgUrl> imgUrl;
ActivityPeopleModel({this.id, this.name, this.tel, this.imgUrl});
ActivityPeopleModel.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
tel = json['tel'];
if (json['imgUrl'] != null) {
imgUrl = new List<ImgUrl>();
json['imgUrl'].forEach((v) {
imgUrl.add(new ImgUrl.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
data['tel'] = this.tel;
if (this.imgUrl != null) {
data['imgUrl'] = this.imgUrl.map((v) => v.toJson()).toList();
}
return data;
}
}
class ImgUrl {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrl({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrl.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}

@ -1,4 +1,5 @@
// Package imports:
import 'package:akuCommunity/model/common/img_model.dart';
import 'package:common_utils/common_utils.dart';
class AdviceDetailModel {
@ -58,7 +59,7 @@ class AppAdviceVo {
int status;
String content;
String createDate;
List<ImgUrls> imgUrls;
List<ImgModel> imgUrls;
DateTime get date => DateUtil.getDateTime(createDate);
@ -77,9 +78,9 @@ class AppAdviceVo {
content = json['content'];
createDate = json['createDate'];
if (json['imgUrls'] != null) {
imgUrls = new List<ImgUrls>();
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgUrls.fromJson(v));
imgUrls.add(new ImgModel.fromJson(v));
});
}
}
@ -98,34 +99,6 @@ class AppAdviceVo {
}
}
class ImgUrls {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrls.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}
class AppAdviceContentVos {
int id;
int createUserType;

@ -1,3 +1,5 @@
import 'package:akuCommunity/model/common/img_model.dart';
class FixedDetailModel {
AppReportRepairVo appReportRepairVo;
List<AppProcessRecordVo> appProcessRecordVo;
@ -48,7 +50,7 @@ class AppReportRepairVo {
int type;
int status;
String reportDetail;
List<ImgUrls> imgUrls;
List<ImgModel> imgUrls;
AppReportRepairVo(
{this.id, this.type, this.status, this.reportDetail, this.imgUrls});
@ -59,9 +61,9 @@ class AppReportRepairVo {
status = json['status'];
reportDetail = json['reportDetail'];
if (json['imgUrls'] != null) {
imgUrls = new List<ImgUrls>();
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgUrls.fromJson(v));
imgUrls.add(new ImgModel.fromJson(v));
});
}
}
@ -79,34 +81,6 @@ class AppReportRepairVo {
}
}
class ImgUrls {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrls.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}
class AppProcessRecordVo {
String operationDate;
int operationType;

@ -1,4 +1,5 @@
// Package imports:
import 'package:akuCommunity/model/common/img_model.dart';
import 'package:common_utils/common_utils.dart';
class SuggestionOrComplainModel {
@ -8,7 +9,7 @@ class SuggestionOrComplainModel {
String content;
int score;
DateTime createDate;
List<ImgUrls> imgUrls;
List<ImgModel> imgUrls;
SuggestionOrComplainModel(
{this.id,
@ -27,9 +28,9 @@ class SuggestionOrComplainModel {
score = json['score'];
createDate = DateUtil.getDateTime(json['createDate']);
if (json['imgUrls'] != null) {
imgUrls = new List<ImgUrls>();
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgUrls.fromJson(v));
imgUrls.add(new ImgModel.fromJson(v));
});
}
}

@ -1,9 +1,11 @@
import 'package:akuCommunity/model/common/img_model.dart';
class FixedSubmitModel {
int id;
int type;
int status;
String reportDetail;
List<ImgUrls> imgUrls;
List<ImgModel> imgUrls;
FixedSubmitModel(
{this.id, this.type, this.status, this.reportDetail, this.imgUrls});
@ -14,9 +16,9 @@ class FixedSubmitModel {
status = json['status'];
reportDetail = json['reportDetail'];
if (json['imgUrls'] != null) {
imgUrls = new List<ImgUrls>();
imgUrls = new List<ImgModel>();
json['imgUrls'].forEach((v) {
imgUrls.add(new ImgUrls.fromJson(v));
imgUrls.add(new ImgModel.fromJson(v));
});
}
}
@ -33,31 +35,3 @@ class FixedSubmitModel {
return data;
}
}
class ImgUrls {
String url;
String size;
int longs;
int paragraph;
int sort;
ImgUrls({this.url, this.size, this.longs, this.paragraph, this.sort});
ImgUrls.fromJson(Map<String, dynamic> json) {
url = json['url'];
size = json['size'];
longs = json['longs'];
paragraph = json['paragraph'];
sort = json['sort'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['url'] = this.url;
data['size'] = this.size;
data['longs'] = this.longs;
data['paragraph'] = this.paragraph;
data['sort'] = this.sort;
return data;
}
}

@ -3,13 +3,19 @@ import 'dart:async';
import 'dart:convert';
// Flutter imports:
import 'package:akuCommunity/model/community/activity_item_model.dart';
import 'package:akuCommunity/ui/community/activity_card.dart';
import 'package:akuCommunity/ui/community/activity_list_page.dart';
import 'package:akuCommunity/ui/community/community_func.dart';
import 'package:akuCommunity/ui/home/home_notification.dart';
import 'package:akuCommunity/ui/home/home_title.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
// Package imports:
import 'package:flutter_icons/flutter_icons.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';
import 'package:velocity_x/velocity_x.dart';
// Project imports:
@ -17,7 +23,6 @@ import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/extensions/num_ext.dart';
import 'package:akuCommunity/extensions/page_router.dart';
import 'package:akuCommunity/model/aku_shop_model.dart';
import 'package:akuCommunity/pages/activities_page/activities_page.dart';
import 'package:akuCommunity/pages/convenient_phone/convenient_phone_page.dart';
import 'package:akuCommunity/pages/home/widget/animate_app_bar.dart';
import 'package:akuCommunity/pages/industry_committee/industry_committee_page.dart';
@ -54,11 +59,12 @@ class _HomePageState extends State<HomePage>
List<AkuShopModel> _shopList = [];
List<dynamic> data;
RefreshController _refreshController =
RefreshController(initialRefresh: false);
EasyRefreshController _refreshController = EasyRefreshController();
int page = 1;
ActivityItemModel model;
List<GridButton> _gridList = [
GridButton('一键开门', R.ASSETS_ICONS_TOOL_YJKM_PNG, OpenDoorPage().to),
GridButton('访客通行', R.ASSETS_ICONS_TOOL_FKYQ_PNG, VisitorAccessPage().to),
@ -98,14 +104,6 @@ class _HomePageState extends State<HomePage>
});
}
void _onLoading() async {
await Future.delayed(Duration(milliseconds: 1500));
page++;
// akuShop(page);
if (mounted) setState(() {});
_refreshController.loadComplete();
}
_buildColButton({IconData icon, String title, VoidCallback onTap}) {
return MaterialButton(
onPressed: onTap,
@ -141,106 +139,101 @@ class _HomePageState extends State<HomePage>
16.wb,
],
),
body: RefreshConfiguration(
child: SmartRefresher(
controller: _refreshController,
header: WaterDropHeader(),
footer: ClassicFooter(),
onLoading: _onLoading,
enablePullUp: true,
enablePullDown: false,
child: CustomScrollView(
controller: _scrollController,
slivers: [
SliverToBoxAdapter(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
HomeSearch(),
HomeSwiper(),
SizedBox(height: 100.w),
ContainerComment(
radius: 8,
customWidget: GridButtons(
gridList: _gridList,
crossCount: 4,
),
body: EasyRefresh(
controller: _refreshController,
header: MaterialHeader(),
firstRefresh: true,
onRefresh: () async {
model = await CommunityFunc.activity();
setState(() {});
},
child: CustomScrollView(
controller: _scrollController,
slivers: [
SliverToBoxAdapter(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
HomeSearch(),
HomeSwiper(),
SizedBox(height: 100.w),
ContainerComment(
radius: 8,
customWidget: GridButtons(
gridList: _gridList,
crossCount: 4,
),
// SingleAdSpace(
// imagePath: R.ASSETS_EXAMPLE_GUANGGAO2_PNG,
// ),
HomeTagBar(
title: '物业收费标准请查收~',
tag: '公告',
isShowImage: true,
),
Column(
children: [
HomeTagBar(
title: '社区活动',
tag: '活动',
isShowImage: false,
fun: () {
ActivitiesPage().to;
},
),
HomeCard(
isActivity: true,
title: '22日上午10点,阳光小镇在二期乒乓球场地举行了小区乒乓比赛',
subtitleOne: '活动时二楼',
subtitleTwo: '06月17日 12:00至06月17日 18:30',
imagePath:
'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1601275745883&di=e7b2a1afdb8812f8a9acd9742ea7e1a7&imgtype=0&src=http%3A%2F%2Fy3.ifengimg.com%2Fcmpp%2F2013%2F12%2F27%2F03%2F459f46cb-c07f-4083-9a65-27b90cb4562f.jpg',
),
],
),
SizedBox(height: 24.w),
// Column(
// children: [
// HomeTagBar(
// title: '社区团购',
// tag: '团购',
// isShowImage: false,
// ),
// HomeCard(
// isActivity: false,
// title: '新疆库尔阿勒4.5斤,仙人蕉 香甜可口',
// subtitleOne: '中国新疆',
// subtitleTwo: '2020年07月03日',
// imagePath:
// 'http://news.eastday.com/d/file/tga/2013-02-17/c2e7bd7fca1ed2ecf5d50dc9fb30275d.jpg',
// ),
// HomeCard(
// isActivity: false,
// title: '刚果柠檬大果4盒 鲜果新鲜采摘15斤',
// subtitleOne: '非洲刚果',
// subtitleTwo: '2020年08月09日',
// imagePath:
// 'http://5b0988e595225.cdn.sohucs.com/images/20180203/328e145f84c54dd08d1b11b890109862.jpeg',
// ),
// ],
// ),
// SizedBox(height: 30.w),
// HomeTagBar(
// title: '社区商城',
// tag: '团购',
// isShowImage: false,
// isShowTitle: true,
// ),
],
),
),
// SingleAdSpace(
// imagePath: R.ASSETS_EXAMPLE_GUANGGAO2_PNG,
// ),
// Column(
// children: [
// HomeTagBar(
// title: '社区团购',
// tag: '团购',
// isShowImage: false,
// ),
// HomeCard(
// isActivity: false,
// title: '新疆库尔阿勒4.5斤,仙人蕉 香甜可口',
// subtitleOne: '中国新疆',
// subtitleTwo: '2020年07月03日',
// imagePath:
// 'http://news.eastday.com/d/file/tga/2013-02-17/c2e7bd7fca1ed2ecf5d50dc9fb30275d.jpg',
// ),
// HomeCard(
// isActivity: false,
// title: '刚果柠檬大果4盒 鲜果新鲜采摘15斤',
// subtitleOne: '非洲刚果',
// subtitleTwo: '2020年08月09日',
// imagePath:
// 'http://5b0988e595225.cdn.sohucs.com/images/20180203/328e145f84c54dd08d1b11b890109862.jpeg',
// ),
// ],
// ),
// SizedBox(height: 30.w),
// HomeTagBar(
// title: '社区商城',
// tag: '团购',
// isShowImage: false,
// isShowTitle: true,
// ),
],
),
// SliverPadding(
// padding: EdgeInsets.only(
// top: 30.w,
// left: 32.w,
// right: 32.w,
// ),
// sliver: _shopList.length == 0
// ? SliverToBoxAdapter(child: GoodsCardSkeleton())
// : SliverGoodsCard(shoplist: _shopList)),
],
),
),
SliverToBoxAdapter(
child: Column(
children: [
HomeNotification(),
HomeTitle(
title: '社区活动',
suffixTitle: '更多活动',
onTap: ActivityListPage().to,
),
model == null
? SizedBox()
: ActivityCard(model: model).pSymmetric(h: 24.w, v: 24.w),
],
)
.box
.white
.withRounded(value: 8.w)
.clip(Clip.antiAlias)
.margin(EdgeInsets.symmetric(horizontal: 32.w))
.make(),
),
// SliverPadding(
// padding: EdgeInsets.only(
// top: 30.w,
// left: 32.w,
// right: 32.w,
// ),
// sliver: _shopList.length == 0
// ? SliverToBoxAdapter(child: GoodsCardSkeleton())
// : SliverGoodsCard(shoplist: _shopList)),
],
),
),
);

@ -15,6 +15,9 @@ import 'package:akuCommunity/routers/page_routers.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t home_card need to be cleaned.")
class HomeCard extends StatefulWidget {
final String title;
final String subtitleOne;

@ -9,12 +9,20 @@ import 'package:flutter_icons/flutter_icons.dart';
import 'package:akuCommunity/base/assets_image.dart';
import 'package:akuCommunity/utils/headers.dart';
//TODO CLEAN BOTTOM CODES.
@Deprecated("sh*t home_tag_bar need to be cleaned.")
class HomeTagBar extends StatefulWidget {
final String title;
final String tag;
final bool isShowImage,isShowTitle;
final bool isShowImage, isShowTitle;
final Function fun;
HomeTagBar({Key key, this.title, this.tag, this.isShowImage,this.isShowTitle = false,this.fun})
HomeTagBar(
{Key key,
this.title,
this.tag,
this.isShowImage,
this.isShowTitle = false,
this.fun})
: super(key: key);
@override
@ -50,9 +58,7 @@ class _HomeTagBarState extends State<HomeTagBar> {
Text(
widget.title,
style: TextStyle(
fontSize: widget.isShowImage
? 28.sp
: 32.sp,
fontSize: widget.isShowImage ? 28.sp : 32.sp,
fontWeight: widget.isShowImage
? FontWeight.normal
: FontWeight.w600,
@ -60,25 +66,26 @@ class _HomeTagBarState extends State<HomeTagBar> {
),
],
),
widget.isShowTitle ? SizedBox() : InkWell(
onTap: () {
widget.fun();
},
child: Row(children: [
Text(
'更多${widget.tag}',
style: TextStyle(
color: Color(0xff999999),
fontSize: 20.sp),
),
SizedBox(width: 8.w),
Icon(
AntDesign.right,
color: Color(0xff999999),
size: 20.sp,
),
]),
),
widget.isShowTitle
? SizedBox()
: InkWell(
onTap: () {
widget.fun();
},
child: Row(children: [
Text(
'更多${widget.tag}',
style: TextStyle(
color: Color(0xff999999), fontSize: 20.sp),
),
SizedBox(width: 8.w),
Icon(
AntDesign.right,
color: Color(0xff999999),
size: 20.sp,
),
]),
),
],
),
widget.isShowImage

@ -0,0 +1,94 @@
import 'package:akuCommunity/model/common/img_model.dart';
import 'package:akuCommunity/model/community/activity_item_model.dart';
import 'package:akuCommunity/ui/community/activity_detail_page.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/widget/others/stack_avatar.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
class ActivityCard extends StatelessWidget {
final ActivityItemModel model;
const ActivityCard({
Key key,
@required this.model,
}) : super(key: key);
String get firstPath =>
(model.imgUrls?.isEmpty ?? true) ? null : model.imgUrls.first.url;
Widget build(BuildContext context) {
return MaterialButton(
clipBehavior: Clip.antiAlias,
color: Colors.white,
padding: EdgeInsets.zero,
onPressed: ActivityDetailPage(id: model.id).to,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8.w),
side: BorderSide(
color: Colors.grey,
),
),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
firstPath == null
? SizedBox()
: Hero(
tag: API.image(firstPath),
child: Material(
color: Colors.grey,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
image: API.image(firstPath),
height: 210.w,
width: double.infinity,
),
),
),
model.title.text
.size(28.sp)
.black
.make()
.pSymmetric(h: 24.w, v: 16.w),
[
'地 点:'.text.size(24.sp).color(Color(0xFF999999)).make(),
model.location.text.size(24.sp).make(),
].row().pSymmetric(h: 24.w),
6.hb,
[
'活动时间:'.text.size(24.sp).color(Color(0xFF999999)).make(),
'${DateUtil.formatDate(
model.begin,
format: 'MM月dd日 HH:mm',
)}${DateUtil.formatDate(
model.end,
format: 'MM月dd日 HH:mm',
)}'
.text
.size(24.sp)
.make(),
].row().pSymmetric(h: 24.w),
[
StackAvatar(avatars: model.headImgURls.map((e) => e.url).toList()),
Spacer(),
MaterialButton(
elevation: 0,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
color: Color(0xFFFFC40C),
shape: StadiumBorder(),
height: 44.w,
minWidth: 120.w,
onPressed: () {},
child: '去看看'.text.size(20.sp).bold.make(),
),
].row().p(24.w),
],
),
);
}
}

@ -0,0 +1,184 @@
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/community/activity_detail_model.dart';
import 'package:akuCommunity/ui/community/activity_people_list_page.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/utils/network/base_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/others/stack_avatar.dart';
import 'package:akuCommunity/widget/picker/bee_image_preview.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart';
import 'package:shimmer/shimmer.dart';
class ActivityDetailPage extends StatefulWidget {
final int id;
ActivityDetailPage({Key key, @required this.id}) : super(key: key);
@override
_ActivityDetailPageState createState() => _ActivityDetailPageState();
}
class _ActivityDetailPageState extends State<ActivityDetailPage> {
ActivityDetailModel model;
EasyRefreshController _refreshController = EasyRefreshController();
Widget get emptyWidget => Shimmer.fromColors(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
VxBox().white.height(45.w).width(544.w).make(),
48.hb,
VxBox()
.white
.height(228.w)
.width(double.infinity)
.withRounded(value: 8.w)
.make(),
44.hb,
...List.generate(
3,
(index) => VxBox()
.white
.height(45.w)
.width(544.w)
.margin(EdgeInsets.symmetric(vertical: 5.w))
.make(),
),
],
).pSymmetric(h: 32.w, v: 24.w),
baseColor: Colors.black12,
highlightColor: Colors.white,
);
@override
void dispose() {
_refreshController?.dispose();
super.dispose();
}
_buildTile(String title, String subTitle) {
return Row(
children: [
title.text.size(28.sp).make().box.width(136.w).make(),
subTitle.text.size(28.sp).make().expand(),
],
).pSymmetric(h: 32.w);
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '活动详情',
body: EasyRefresh(
header: MaterialHeader(),
onRefresh: () async {
BaseModel baseModel = await NetUtil().get(
API.community.activityDetail,
params: {'activityId': widget.id},
);
model = ActivityDetailModel.fromJson(baseModel.data);
setState(() {});
},
controller: _refreshController,
firstRefresh: true,
emptyWidget: model == null ? emptyWidget : null,
child: model == null
? SizedBox()
: ListView(
children: [
model.title.text
.size(32.sp)
.bold
.make()
.pSymmetric(h: 32.w, v: 24.w),
48.hb,
...model.imgUrls
.map((e) => GestureDetector(
onTap: () {
Get.to(
BeeImagePreview.path(path: API.image(e.url)),
opaque: false,
);
},
child: Hero(
tag: API.image(e.url),
child: Container(
height: 228.w,
decoration: BoxDecoration(
color: Colors.black12,
borderRadius: BorderRadius.circular(8.w),
),
clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
image: e.url,
),
),
),
).pSymmetric(h: 32.w))
.toList(),
44.hb,
model.content.text.size(28.sp).make().pSymmetric(h: 32.w),
44.hb,
_buildTile(
'开始时间',
DateUtil.formatDate(
model.startDate,
format: 'yyyy年MM月dd日 HH:mm',
),
),
_buildTile(
'结束时间',
DateUtil.formatDate(
model.endDate,
format: 'yyyy年MM月dd日 HH:mm',
),
),
_buildTile('地 点', model.location),
_buildTile('参与人数', '不限'),
_buildTile(
'报名截止',
DateUtil.formatDate(
model.registEndDate,
format: 'yyyy年MM月dd日 HH:mm',
),
),
115.hb,
Container(
height: 24.w,
color: Color(0xFFF9F9F9),
),
MaterialButton(
height: 92.w,
onPressed: () =>
Get.to(ActivityPeopleListPage(id: widget.id)),
child: Row(
children: [
StackAvatar(
avatars: model.headImgURls.map((e) => e.url).toList(),
),
Spacer(),
'已有${model.countRegistration}人参加'
.text
.size(28.sp)
.make(),
16.wb,
Icon(
CupertinoIcons.chevron_forward,
size: 30.w,
color: Color(0xFFD8D8D8),
),
],
),
),
Divider(height: 1.w, indent: 32.w, endIndent: 32.w),
],
),
).material(color: Colors.white),
);
}
}

@ -0,0 +1,48 @@
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/community/activity_item_model.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/ui/community/activity_card.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
class ActivityListPage extends StatefulWidget {
ActivityListPage({Key key}) : super(key: key);
@override
_ActivityListPageState createState() => _ActivityListPageState();
}
class _ActivityListPageState extends State<ActivityListPage> {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void dispose() {
_refreshController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '往期精彩',
body: BeeListView(
controller: _refreshController,
path: API.community.activityList,
convert: (model) =>
model.tableList.map((e) => ActivityItemModel.fromJson(e)).toList(),
builder: (items) {
return ListView.separated(
padding: EdgeInsets.symmetric(horizontal: 32.w, vertical: 20.w),
itemBuilder: (context, index) {
final ActivityItemModel model = items[index];
return ActivityCard(model: model);
},
separatorBuilder: (_, __) => 20.hb,
itemCount: items.length,
);
},
),
);
}
}

@ -0,0 +1,67 @@
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/community/activity_people_model.dart';
import 'package:akuCommunity/pages/things_page/widget/bee_list_view.dart';
import 'package:akuCommunity/widget/bee_scaffold.dart';
import 'package:akuCommunity/widget/others/stack_avatar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
class ActivityPeopleListPage extends StatefulWidget {
final int id;
ActivityPeopleListPage({Key key, @required this.id}) : super(key: key);
@override
_ActivityPeopleListPageState createState() => _ActivityPeopleListPageState();
}
class _ActivityPeopleListPageState extends State<ActivityPeopleListPage> {
EasyRefreshController _refreshController = EasyRefreshController();
@override
void dispose() {
_refreshController?.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return BeeScaffold(
title: '参与人员',
body: BeeListView(
controller: _refreshController,
path: API.community.activityPeopleList,
extraParams: {'activityId': widget.id},
convert: (model) => model.tableList
.map((e) => ActivityPeopleModel.fromJson(e))
.toList(),
builder: (items) {
return ListView.separated(
padding: EdgeInsets.all(32.w),
itemBuilder: (context, index) {
final ActivityPeopleModel model = items[index];
return Row(
children: [
96.hb,
20.wb,
FadeInImage.assetNetwork(
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
image: API.image(model.imgUrl.first.url),
height: 60.w,
width: 60.w,
),
18.wb,
model.name.text.size(28.sp).make(),
Spacer(),
model.tel.text.size(28.sp).make(),
],
);
},
separatorBuilder: (_, __) => Divider(height: 1.w),
itemCount: items.length,
);
},
).material(color: Colors.white),
);
}
}

@ -0,0 +1,15 @@
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/model/community/activity_item_model.dart';
import 'package:akuCommunity/utils/network/base_list_model.dart';
import 'package:akuCommunity/utils/network/net_util.dart';
class CommunityFunc {
static Future<ActivityItemModel> activity() async {
BaseListModel model = await NetUtil().getList(
API.community.activityList,
params: {'pageNum': 1, 'size': 1},
);
if (model.tableList.length == 0) return null;
return ActivityItemModel.fromJson(model.tableList.first);
}
}

@ -0,0 +1,50 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
class HomeNotification extends StatefulWidget {
HomeNotification({Key key}) : super(key: key);
@override
_HomeNotificationState createState() => _HomeNotificationState();
}
class _HomeNotificationState extends State<HomeNotification> {
@override
Widget build(BuildContext context) {
return Row(
children: [
85.hb,
24.wb,
Image.asset(
R.ASSETS_ICONS_ICON_NOTIFICATION_PNG,
height: 40.w,
width: 40.w,
),
24.wb,
'TTTTTTTTT'.text.size(28.sp).make(),
Spacer(),
MaterialButton(
shape: StadiumBorder(),
padding: EdgeInsets.symmetric(horizontal: 12.w),
onPressed: () {},
child: Row(
children: [
'更多公告'.text.size(20.sp).color(Color(0xFF999999)).make(),
8.wb,
Icon(
CupertinoIcons.chevron_forward,
size: 24.w,
color: Color(0xFF999999),
),
],
),
),
12.wb,
],
);
}
}

@ -0,0 +1,60 @@
import 'package:akuCommunity/base/base_style.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
class HomeTitle extends StatelessWidget {
final String title;
final String suffixTitle;
final VoidCallback onTap;
const HomeTitle({
Key key,
@required this.title,
@required this.suffixTitle,
@required this.onTap,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Row(
children: [
85.hb,
24.wb,
Stack(
children: [
Positioned(
left: 0,
right: 0,
bottom: 4.w,
child: Container(
color: kPrimaryColor,
height: 8.w,
),
),
title.text.size(32.sp).bold.make(),
],
),
Spacer(),
MaterialButton(
shape: StadiumBorder(),
padding: EdgeInsets.symmetric(horizontal: 12.w),
onPressed: onTap,
child: Row(
children: [
suffixTitle.text.size(20.sp).color(Color(0xFF999999)).make(),
8.wb,
Icon(
CupertinoIcons.chevron_forward,
size: 24.w,
color: Color(0xFF999999),
),
],
),
),
12.wb,
],
);
}
}

@ -113,13 +113,6 @@ class NetUtil {
}) async {
try {
Response res = await _dio.get(path, queryParameters: params);
_logger.v({
'path': res.request.path,
'header': res.request.headers,
'params': res.request.queryParameters,
'data': res.data,
});
LoggerData.addData(res);
BaseListModel baseListModel = BaseListModel.fromJson(res.data);
return baseListModel;
} on DioError catch (e) {

@ -0,0 +1,41 @@
import 'package:akuCommunity/const/resource.dart';
import 'package:akuCommunity/constants/api.dart';
import 'package:akuCommunity/utils/headers.dart';
import 'package:flutter/material.dart';
class StackAvatar extends StatelessWidget {
final List<String> avatars;
const StackAvatar({Key key, @required this.avatars}) : super(key: key);
double get offset => 35.w;
int get length => avatars?.length ?? 0;
@override
Widget build(BuildContext context) {
return Stack(
children: [
SizedBox(
width: 44.w * 2 + 26.w,
height: 44.w + 6.w,
),
...List.generate(length, (index) {
return Positioned(
left: index * offset,
child: Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(22.w + 2.w),
border: Border.all(color: Color(0xFF999999)),
),
clipBehavior: Clip.antiAlias,
child: FadeInImage.assetNetwork(
height: 44.w,
width: 44.w,
placeholder: R.ASSETS_IMAGES_LOGO_PNG,
image: API.image(avatars[index]),
),
),
);
}),
],
);
}
}
Loading…
Cancel
Save