功能分类

首页改版
pull/1/head
张萌 3 years ago
parent d04128cf2b
commit 5cc5022158

@ -100,7 +100,7 @@ List<AO> appObjects = [
AO('住房说明', R.ASSETS_ICONS_FUNC_ZFSM_PNG, () => HouseIntroducePage()),
AO('智慧养老', Assets.home.icZhyl.path, () => OldAgeSupportPageSimple()),
AO('周边服务', Assets.home.icZbfw.path, null),
AO('小蜜蜂任务', Assets.home.icRwfb.path, () => TaskPage()),
AO('任务发布', Assets.home.icRwfb.path, () => TaskPage()),
AO('自营商城', Assets.icons.shoppingMall.path, null),
AO('邻家宠物', Assets.home.icLjcw.path, null),
AO('共享停车', Assets.icons.sharePark.path, null),
@ -157,28 +157,9 @@ List<AO> userAppObjects = [
AO allApp =
AO('全部应用', R.ASSETS_APPLICATIONS_ALL_APP_PNG, () => AllApplicationPage());
/// original value
///线 original value
List<String> _recommendApp = [
// if (false) '一键开门',
'访客邀请',
'报事报修',
'建议咨询',
'一键报警',
'共享投屏',
'二手市场',
'共享停车',
];
///
List<AO> get recommendApp => _recommendApp.map((e) => AO.fromRaw(e)).toList();
/// original value
List<String> _smartManagerApp = [
// if (false) '一键开门',
'开门码',
'访客邀请',
'报事报修',
'生活缴费',
'业委会',
'建议咨询',
'便民电话',
@ -186,24 +167,34 @@ List<String> _smartManagerApp = [
'物品出门',
'投诉表扬',
'问卷调查',
'装修管理',
'借还管理',
'一键报警',
'设施预约',
'快递包裹',
'电子商务',
'服务浏览',
'社区介绍',
'家政服务',
'地理信息',
'周边企业',
'住房说明'
'住房说明',
'智慧养老',
'周边服务',
'自营商城',
'邻家宠物',
'共享停车',
'二手市场',
'共享投屏',
];
// '小区教育',
// '健康运动',
// '家政服务',
// '居家养老',
// '物业租赁',
///
List<AO> get recommendApp => _recommendApp.map((e) => AO.fromRaw(e)).toList();
/// original value
List<String> _smartManagerApp = [
'开门码',
'报事报修',
'生活缴费',
'一键报警',
'任务发布',
];
///
@ -268,7 +259,7 @@ List<String> _aboutCommunityApp = [
List<AO> get aboutCommunityApp =>
_aboutCommunityApp.map((e) => AO.fromRaw(e)).toList();
List<String> _wisdomServiceApp = ['智慧养老', '周边服务', '小蜜蜂任务', '共享投屏'];
List<String> _wisdomServiceApp = ['智慧养老', '周边服务', '任务发布', '共享投屏'];
List<AO> get wisdomServiceApp =>
_wisdomServiceApp.map((e) => AO.fromRaw(e)).toList();

@ -210,7 +210,7 @@ class _HomePageState extends State<HomePage>
child: Container(
margin: EdgeInsets.symmetric(horizontal: 32.w),
padding:
EdgeInsets.only(top: 20.w, left: 36.w, right: 36.w),
EdgeInsets.only(top: 20.w, left: 0.w, right: 0.w),
child: _applications(), //ApplicationView(),
decoration: BoxDecoration(
color: Colors.white,
@ -230,7 +230,7 @@ class _HomePageState extends State<HomePage>
child: Row(
children: [
Expanded(
flex: 1,
flex: 2,
child: GestureDetector(
child: Container(
padding:
@ -250,7 +250,7 @@ class _HomePageState extends State<HomePage>
'访客邀请',
style: TextStyle(
color: Color(0xD9000000),
fontSize: 26.sp,
fontSize: 28.sp,
fontWeight: FontWeight.bold),
),
10.hb,
@ -271,7 +271,7 @@ class _HomePageState extends State<HomePage>
),
BeeGradientDivider.vertical(),
Expanded(
flex: 2,
flex: 3,
child: Column(
children: [
Expanded(
@ -297,7 +297,7 @@ class _HomePageState extends State<HomePage>
'一键报警',
style: TextStyle(
color: Color(0xD9000000),
fontSize: 26.sp,
fontSize: 28.sp,
fontWeight: FontWeight.bold),
),
10.hb,
@ -340,7 +340,7 @@ class _HomePageState extends State<HomePage>
'建议咨询',
style: TextStyle(
color: Color(0xD9000000),
fontSize: 26.sp,
fontSize: 28.sp,
fontWeight: FontWeight.bold),
),
10.hb,
@ -368,45 +368,55 @@ class _HomePageState extends State<HomePage>
),
),
SliverToBoxAdapter(
child: Column(
children: [
HomeTitle(
title: '社区活动',
suffixTitle: '查看全部',
onTap: () => Get.to(() => ActivityListPage()),
),
_activityItemModels == []
? SizedBox()
: Container(
height: 480.w,
padding: EdgeInsets.only(left: 32.w),
child: ListView.separated(
padding: EdgeInsets.zero,
separatorBuilder: (context, index) {
return SizedBox(
width: 16.w,
);
},
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return Container(
width: 500.w,
child: Builder(
builder: (context) {
return ActivityCard(
model:
_activityItemModels[index]);
},
),
);
},
itemCount: _activityItemModels.length,
child: Container(
padding: EdgeInsets.all(32.w),
margin: EdgeInsets.symmetric(horizontal: 32.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.w)),
child: Column(
children: [
HomeTitle(
title: '社区活动',
suffixTitle: '查看全部',
onTap: () => Get.to(() => ActivityListPage()),
),
24.hb,
_activityItemModels == []
? SizedBox()
: Container(
height: 460.w,
child: ListView.separated(
padding: EdgeInsets.zero,
separatorBuilder: (context, index) {
return SizedBox(
width: 16.w,
);
},
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
return Container(
width: 500.w,
child: Builder(
builder: (context) {
return ActivityCard(
model:
_activityItemModels[index]);
},
),
);
},
itemCount: _activityItemModels.length,
),
),
),
// : ActivityCard(model: _activityItemModel)
// .pSymmetric(h: 24.w, v: 24.w),
],
// : ActivityCard(model: _activityItemModel)
// .pSymmetric(h: 24.w, v: 24.w),
],
),
)),
SliverToBoxAdapter(
child: 48.hb,
)
],
),
),
@ -529,7 +539,7 @@ class _HomePageState extends State<HomePage>
crossAxisAlignment: CrossAxisAlignment.center,
children: [
getFunctionBtn(AO.fromRaw('周边服务')),
getFunctionBtn(AO.fromRaw('小蜜蜂任务', replaceTitle: '任务发布')),
getFunctionBtn(AO.fromRaw('任务发布', replaceTitle: '任务发布')),
getFunctionBtn(AO.fromRaw('邻家宠物')),
getFunctionBtn(AO.fromRaw('全部应用')),
],

@ -18,7 +18,7 @@ class ActivityCard extends StatelessWidget {
this.home = false,
}) : super(key: key);
bool get outdate => ActivityFunc.dateCheck(model!.end) == '';
bool get outdate => model!.end?.isBefore(DateTime.now()) ?? true;
Widget build(BuildContext context) {
return ConstrainedBox(
@ -29,81 +29,72 @@ class ActivityCard extends StatelessWidget {
padding: EdgeInsets.zero,
onPressed: () => Get.to(() => ActivityDetailPage(id: model!.id)),
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(24.w),
),
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Hero(
tag: ImgModel.first(model!.imgList),
child: Material(
color: Colors.grey,
child: BeeImageNetwork(
imgs: model!.imgList ?? [],
width: double.infinity,
height: home! ? 240.w : 340.w,
),
),
),
Padding(
padding: EdgeInsets.only(left: 24.w, top: 24.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
constraints: BoxConstraints(maxWidth: 340.w),
child: Text(
model == null ? '' : model!.title,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xD9000000),
fontSize: 28.sp,
fontWeight: FontWeight.bold),
Stack(
clipBehavior: Clip.antiAliasWithSaveLayer,
children: [
Hero(
tag: ImgModel.first(model!.imgList),
child: Material(
color: Colors.grey,
borderRadius: BorderRadius.circular(16.w),
clipBehavior: Clip.antiAliasWithSaveLayer,
child: BeeImageNetwork(
imgs: model!.imgList ?? [],
width: double.infinity,
height: home! ? 240.w : 340.w,
),
),
Spacer(),
GestureDetector(
),
Positioned(
top: 0,
left: 0,
child: Container(
//color: Color(0x80FEBF76),
// shape: StadiumBorder(),
alignment: Alignment.center,
height: 39.w,
width: 98.w,
decoration: BoxDecoration(
color: outdate
? Colors.black.withOpacity(0.06)
: Color(0x80FEBF76),
borderRadius: BorderRadius.all(Radius.circular(4)),
color: outdate ? Color(0xFFE8E8E8) : Color(0xFFFDE019),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(16.w),
bottomRight: Radius.circular(12.w)),
),
child: outdate
? '已结束'
.text
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.color(Color(0xFF999999))
.make()
: '报名中'
.text
.size(22.sp)
.color(Color(0xFFF48117))
.color(Color(0xFF333333))
.make(),
),
onTap: () {
outdate
? null
: () {
Get.to(() => ActivityDetailPage(id: model!.id));
};
},
))
],
),
24.hb,
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
constraints: BoxConstraints(maxWidth: 340.w),
child: Text(
model == null ? '' : model!.title,
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Color(0xD9000000),
fontSize: 28.sp,
fontWeight: FontWeight.bold),
),
24.wb
],
),
),
Spacer(),
],
),
Spacer(),
[
@ -116,13 +107,14 @@ class ActivityCard extends StatelessWidget {
),
),
// Spacer(),
ActivityFunc.dateCheck(model!.end)
.text
.size(24.sp)
.black
.make(),
].row().pSymmetric(h: 24.w),
20.hb,
Offstage(
offstage: ActivityFunc.dateCheck(model!.end) == '已结束',
child: ActivityFunc.dateCheck(model!.end)
.text
.size(24.sp)
.black
.make()),
].row(),
],
),
),

@ -9,6 +9,7 @@ import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:aku_new_community/widget/buttons/bottom_button.dart';
import 'package:aku_new_community/widget/others/stack_avatar.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:common_utils/common_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -151,6 +152,10 @@ class _ActivityDetailPageState extends State<ActivityDetailPage> {
bottomNavi: BottomButton(
child: '立即报名'.text.size(32.sp).color(Colors.black).bold.make(),
onPressed: () async {
if (_model!.regisEndTime?.isBefore(DateTime.now()) ?? false) {
BotToast.showText(text: '报名时间已结束');
return;
}
var re = await NetUtil().get(SAASAPI.activity.registration,
params: {'activityId': _model!.id}, showMessage: true);
if (re.success) {

@ -5,7 +5,7 @@ class ActivityFunc {
}
var nowDate = DateTime.now();
if (date.isBefore(nowDate)) {
return '';
return '已结束';
} else {
var days = date.difference(nowDate).inDays;
if (days > 0) {

@ -1,11 +1,3 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/base/base_style.dart';
import 'package:aku_new_community/constants/application_objects.dart';
import 'package:aku_new_community/provider/app_provider.dart';
@ -13,6 +5,12 @@ import 'package:aku_new_community/ui/search/bee_search.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/login_util.dart';
import 'package:aku_new_community/widget/bee_back_button.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';
import 'package:velocity_x/velocity_x.dart';
class AllApplicationPage extends StatefulWidget {
AllApplicationPage({Key? key}) : super(key: key);
@ -211,8 +209,8 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
child: ListView(
padding: EdgeInsets.zero,
children: [
_buildListTile('为您推荐', 0),
_buildListTile('智慧管家', 1),
_buildListTile('暂未上线', 0),
// _buildListTile('商城购物', 2),
],
),
@ -222,8 +220,8 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
scrollDirection: Axis.vertical,
controller: _pageController,
children: [
_buildView(recommendApp),
_buildView(smartManagerApp),
_buildView(recommendApp),
],
).expand(),
],

@ -1,10 +1,8 @@
import 'package:aku_new_community/utils/headers.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:velocity_x/velocity_x.dart';
import 'package:aku_new_community/utils/headers.dart';
class HomeTitle extends StatelessWidget {
final String title;
final String suffixTitle;
@ -21,27 +19,10 @@ class HomeTitle extends StatelessWidget {
Widget build(BuildContext context) {
return Row(
children: [
85.hb,
32.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(),
],
),
title.text.size(32.sp).bold.make(),
Spacer(),
MaterialButton(
shape: StadiumBorder(),
padding: EdgeInsets.symmetric(horizontal: 12.w),
onPressed: onTap,
GestureDetector(
onTap: onTap,
child: Row(
children: [
suffixTitle.text.size(24.sp).color(Color(0xFF999999)).make(),
@ -54,7 +35,6 @@ class HomeTitle extends StatelessWidget {
],
),
),
12.wb,
],
);
}

Loading…
Cancel
Save