Merge branch 'master' of http://192.168.2.201:8099/laiiihz/akuCommunity
# Conflicts: # lib/pages/personal/personal_page.dart # lib/pages/things_page/widget/add_fixed_submit_page.darthmxc
commit
0897efe0ef
@ -1 +1 @@
|
||||
1639ba717cd75e55d448599066f95969
|
||||
08772c882ade7695c518fdf7d64d7a30
|
@ -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,78 @@
|
||||
// Package imports:
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/model/common/img_model.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,71 @@
|
||||
// Package imports:
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/model/common/img_model.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,83 +0,0 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/widget/app_bar_action.dart';
|
||||
|
||||
class HomeAppBar extends StatefulWidget {
|
||||
HomeAppBar({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_HomeAppBarState createState() => _HomeAppBarState();
|
||||
}
|
||||
|
||||
class _HomeAppBarState extends State<HomeAppBar> {
|
||||
List<Map<String, dynamic>> _actionsList = [
|
||||
{'title': '扫一扫', 'icon': AntDesign.scan1, 'funtion': null},
|
||||
{'title': '消息', 'icon': AntDesign.bells, 'funtion': null}
|
||||
];
|
||||
|
||||
List<Widget> _actions() {
|
||||
return _actionsList
|
||||
.map((item) => AppBarAction(
|
||||
title: item['title'],
|
||||
icon: item['icon'],
|
||||
))
|
||||
.toList();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [Color(0xffffd000), Color(0xffffbd00)],
|
||||
),
|
||||
),
|
||||
child: AppBar(
|
||||
elevation: 0,
|
||||
title: Text(
|
||||
'皇冠花园二期',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 36.sp,
|
||||
color: Color(0xff333333),
|
||||
),
|
||||
),
|
||||
centerTitle: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
leading: Container(
|
||||
margin: EdgeInsets.only(left: 32.w),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'深圳',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 24.sp,
|
||||
color: Color(0xff333333),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'阴 27℃',
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp,
|
||||
color: Color(0xff333333),
|
||||
),
|
||||
)
|
||||
]),
|
||||
),
|
||||
actions: _actions(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,229 +0,0 @@
|
||||
// Dart imports:
|
||||
import 'dart:convert';
|
||||
|
||||
// Flutter imports:
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:image_stack/image_stack.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/pages/activities_page/activities_details_page/activities_details_page.dart';
|
||||
import 'package:akuCommunity/pages/goods_details/goods_details_page.dart';
|
||||
import 'package:akuCommunity/routers/page_routers.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
import 'package:akuCommunity/widget/cached_image_wrapper.dart';
|
||||
|
||||
class HomeCard extends StatefulWidget {
|
||||
final String title;
|
||||
final String subtitleOne;
|
||||
final String subtitleTwo;
|
||||
final bool isActivity;
|
||||
final String imagePath;
|
||||
HomeCard(
|
||||
{this.title,
|
||||
this.subtitleOne,
|
||||
this.subtitleTwo,
|
||||
this.imagePath,
|
||||
this.isActivity,
|
||||
Key key})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_HomeCardState createState() => _HomeCardState();
|
||||
}
|
||||
|
||||
class _HomeCardState extends State<HomeCard> {
|
||||
List<String> images = [
|
||||
"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1151143562,4115642159&fm=26&gp=0.jpg",
|
||||
"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=2551412680,857245643&fm=26&gp=0.jpg",
|
||||
"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=3604827221,1047385274&fm=26&gp=0.jpg",
|
||||
];
|
||||
|
||||
Widget _button(String buttonName) {
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
switch (widget.isActivity) {
|
||||
case true:
|
||||
ActivitiesDetailsPage(
|
||||
bundle: Bundle()
|
||||
..putMap('details', {
|
||||
'title': widget.title,
|
||||
'imagePath': widget.imagePath,
|
||||
'isOver': false,
|
||||
'isVoteOver': false,
|
||||
'isVote': false,
|
||||
'memberList': images
|
||||
}),
|
||||
).to;
|
||||
break;
|
||||
case false:
|
||||
var shopInfo;
|
||||
shopInfo = {
|
||||
'itemid': '1',
|
||||
'itemtitle': widget.title,
|
||||
'taobao_image': "${widget.imagePath},${widget.imagePath}",
|
||||
'itemprice': '69.9',
|
||||
'itemshorttitle': widget.title,
|
||||
'itempic_copy': widget.imagePath,
|
||||
'itemdesc': widget.title,
|
||||
'itempic': widget.imagePath
|
||||
};
|
||||
GoodsDetailsPage(
|
||||
bundle: Bundle()
|
||||
..putString('shoplist', json.encode(shopInfo).toString()),
|
||||
).to;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
height: 44.w,
|
||||
width: 120.w,
|
||||
alignment: Alignment.center,
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xffffc40c),
|
||||
borderRadius: BorderRadius.all(Radius.circular(22.w)),
|
||||
),
|
||||
padding: EdgeInsets.symmetric(vertical: 8.w),
|
||||
child: Text(
|
||||
buttonName,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xff4a4b51),
|
||||
fontSize: 20.sp),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: Colors.white,
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: 32.w,
|
||||
),
|
||||
padding: EdgeInsets.only(
|
||||
left: 24.w,
|
||||
right: 24.w,
|
||||
bottom: 40.w,
|
||||
),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8.w)),
|
||||
border: Border.all(color: Color(0xffe8e8e8), width: 2.w),
|
||||
),
|
||||
padding: EdgeInsets.only(bottom: 24.w),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
children: [
|
||||
Container(
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(8.w),
|
||||
topRight: Radius.circular(8.w),
|
||||
),
|
||||
child: CachedImageWrapper(
|
||||
url: widget.imagePath,
|
||||
width: 638.w,
|
||||
height: 210.w,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 16.w,
|
||||
left: 24.w,
|
||||
),
|
||||
child: Text(
|
||||
widget.title,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xff4a4b51),
|
||||
fontSize: 28.sp),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 16.w,
|
||||
left: 24.w,
|
||||
right: 24.w,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
children: <InlineSpan>[
|
||||
TextSpan(
|
||||
text: widget.isActivity ? '地点:' : '原产地区:',
|
||||
style: TextStyle(color: Color(0xff999999))),
|
||||
TextSpan(
|
||||
text: widget.subtitleOne,
|
||||
style: TextStyle(color: Color(0xff4a4b51))),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(top: 8.w),
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
style: TextStyle(fontSize: 24.sp),
|
||||
children: <InlineSpan>[
|
||||
TextSpan(
|
||||
text: widget.isActivity ? '活动时间:' : '预计到货:',
|
||||
style: TextStyle(color: Color(0xff999999))),
|
||||
TextSpan(
|
||||
text: widget.subtitleTwo,
|
||||
style: TextStyle(color: Color(0xff4a4b51))),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
widget.isActivity ? SizedBox() : _button('去团购')
|
||||
],
|
||||
),
|
||||
),
|
||||
widget.isActivity
|
||||
? Container(
|
||||
margin: EdgeInsets.only(
|
||||
top: 16.w,
|
||||
right: 24.w,
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 80.w),
|
||||
child: ImageStack(
|
||||
imageList: images,
|
||||
imageRadius: 44.sp,
|
||||
imageCount: 3,
|
||||
imageBorderWidth: 1,
|
||||
totalCount: 3,
|
||||
),
|
||||
),
|
||||
_button('去看看'),
|
||||
],
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -1,106 +0,0 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:flutter_icons/flutter_icons.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/base/assets_image.dart';
|
||||
import 'package:akuCommunity/utils/headers.dart';
|
||||
|
||||
class HomeTagBar extends StatefulWidget {
|
||||
final String title;
|
||||
final String tag;
|
||||
final bool isShowImage,isShowTitle;
|
||||
final Function fun;
|
||||
HomeTagBar({Key key, this.title, this.tag, this.isShowImage,this.isShowTitle = false,this.fun})
|
||||
: super(key: key);
|
||||
|
||||
@override
|
||||
_HomeTagBarState createState() => _HomeTagBarState();
|
||||
}
|
||||
|
||||
class _HomeTagBarState extends State<HomeTagBar> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
color: widget.isShowTitle ? Colors.transparent : Colors.white,
|
||||
margin: EdgeInsets.symmetric(
|
||||
horizontal: 32.w,
|
||||
),
|
||||
padding: EdgeInsets.all(24.w),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
widget.isShowImage
|
||||
? Container(
|
||||
margin: EdgeInsets.only(right: 24.w),
|
||||
child: Image.asset(
|
||||
AssetsImage.NOTIFICATION,
|
||||
height: 38.w,
|
||||
width: 38.w,
|
||||
),
|
||||
)
|
||||
: SizedBox(),
|
||||
Text(
|
||||
widget.title,
|
||||
style: TextStyle(
|
||||
fontSize: widget.isShowImage
|
||||
? 28.sp
|
||||
: 32.sp,
|
||||
fontWeight: widget.isShowImage
|
||||
? FontWeight.normal
|
||||
: FontWeight.w600,
|
||||
color: Color(0xff4a4b51)),
|
||||
),
|
||||
],
|
||||
),
|
||||
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
|
||||
? SizedBox()
|
||||
: Positioned(
|
||||
top: 30.w,
|
||||
left: 0,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Color(0xffffc40c).withOpacity(0.4),
|
||||
boxShadow: <BoxShadow>[
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.1),
|
||||
offset: Offset(1.1, 1.1),
|
||||
blurRadius: 10.0),
|
||||
],
|
||||
),
|
||||
width: 126.w,
|
||||
height: 8.w),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/const/resource.dart';
|
||||
import 'package:akuCommunity/constants/api.dart';
|
||||
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/widget/others/stack_avatar.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,189 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:shimmer/shimmer.dart';
|
||||
|
||||
// Project imports:
|
||||
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';
|
||||
|
||||
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,53 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
|
||||
// Project imports:
|
||||
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/utils/headers.dart';
|
||||
import 'package:akuCommunity/widget/bee_scaffold.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,72 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/const/resource.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/utils/headers.dart';
|
||||
import 'package:akuCommunity/widget/bee_scaffold.dart';
|
||||
import 'package:akuCommunity/widget/others/stack_avatar.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,16 @@
|
||||
// Project imports:
|
||||
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,54 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/const/resource.dart';
|
||||
import 'package:akuCommunity/utils/headers.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,65 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
import 'package:velocity_x/velocity_x.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/base/base_style.dart';
|
||||
import 'package:akuCommunity/utils/headers.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,
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
// Flutter imports:
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Project imports:
|
||||
import 'package:akuCommunity/const/resource.dart';
|
||||
import 'package:akuCommunity/constants/api.dart';
|
||||
import 'package:akuCommunity/utils/headers.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]),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
import 'package:grinder/grinder.dart';
|
||||
|
||||
main(args) => grind(args);
|
||||
|
||||
@Task()
|
||||
test() => new TestRunner().testAsync();
|
||||
|
||||
@DefaultTask()
|
||||
@Depends(test)
|
||||
build() {
|
||||
Pub.build();
|
||||
}
|
||||
|
||||
@Task()
|
||||
clean() => defaultClean();
|
Loading…
Reference in new issue