parent
5e9db879a5
commit
b013c55984
@ -0,0 +1,75 @@
|
|||||||
|
import 'package:aku_new_community/model/common/img_model.dart';
|
||||||
|
import 'package:common_utils/common_utils.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'activity_detail_model.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class ActivityDetailModel {
|
||||||
|
final int id;
|
||||||
|
final List<ImgModel> imgList;
|
||||||
|
final String title;
|
||||||
|
final int status;
|
||||||
|
final String registrationStartTime;
|
||||||
|
final String registrationEndTime;
|
||||||
|
final String activityStartTime;
|
||||||
|
final String activityEndTime;
|
||||||
|
final String activityAddress;
|
||||||
|
final List<Registration> registrationList;
|
||||||
|
final int registrationNum;
|
||||||
|
final int registrationNumMax;
|
||||||
|
final double registrationCost;
|
||||||
|
final String activityContact;
|
||||||
|
final String activityTel;
|
||||||
|
final String content;
|
||||||
|
final String unit;
|
||||||
|
final String contact;
|
||||||
|
final String tel;
|
||||||
|
final List<ImgModel> organizerImgList;
|
||||||
|
|
||||||
|
factory ActivityDetailModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$ActivityDetailModelFromJson(json);
|
||||||
|
|
||||||
|
DateTime? get regisStartTime => DateUtil.getDateTime(registrationStartTime);
|
||||||
|
DateTime? get regisEndTime => DateUtil.getDateTime(registrationEndTime);
|
||||||
|
DateTime? get activeTime => DateUtil.getDateTime(activityStartTime);
|
||||||
|
DateTime? get activeEndTime => DateUtil.getDateTime(activityEndTime);
|
||||||
|
const ActivityDetailModel({
|
||||||
|
required this.id,
|
||||||
|
required this.imgList,
|
||||||
|
required this.title,
|
||||||
|
required this.status,
|
||||||
|
required this.registrationStartTime,
|
||||||
|
required this.registrationEndTime,
|
||||||
|
required this.activityStartTime,
|
||||||
|
required this.activityEndTime,
|
||||||
|
required this.activityAddress,
|
||||||
|
required this.registrationList,
|
||||||
|
required this.registrationNum,
|
||||||
|
required this.registrationNumMax,
|
||||||
|
required this.registrationCost,
|
||||||
|
required this.activityContact,
|
||||||
|
required this.activityTel,
|
||||||
|
required this.content,
|
||||||
|
required this.unit,
|
||||||
|
required this.contact,
|
||||||
|
required this.tel,
|
||||||
|
required this.organizerImgList,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class Registration {
|
||||||
|
final int id;
|
||||||
|
final String name;
|
||||||
|
final List<ImgModel> avatarImgList;
|
||||||
|
|
||||||
|
factory Registration.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$RegistrationFromJson(json);
|
||||||
|
|
||||||
|
const Registration({
|
||||||
|
required this.id,
|
||||||
|
required this.name,
|
||||||
|
required this.avatarImgList,
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,45 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'activity_detail_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
ActivityDetailModel _$ActivityDetailModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
ActivityDetailModel(
|
||||||
|
id: json['id'] as int,
|
||||||
|
imgList: (json['imgList'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
title: json['title'] as String,
|
||||||
|
status: json['status'] as int,
|
||||||
|
registrationStartTime: json['registrationStartTime'] as String,
|
||||||
|
registrationEndTime: json['registrationEndTime'] as String,
|
||||||
|
activityStartTime: json['activityStartTime'] as String,
|
||||||
|
activityEndTime: json['activityEndTime'] as String,
|
||||||
|
activityAddress: json['activityAddress'] as String,
|
||||||
|
registrationList: (json['registrationList'] as List<dynamic>)
|
||||||
|
.map((e) => Registration.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
registrationNum: json['registrationNum'] as int,
|
||||||
|
registrationNumMax: json['registrationNumMax'] as int,
|
||||||
|
registrationCost: (json['registrationCost'] as num).toDouble(),
|
||||||
|
activityContact: json['activityContact'] as String,
|
||||||
|
activityTel: json['activityTel'] as String,
|
||||||
|
content: json['content'] as String,
|
||||||
|
unit: json['unit'] as String,
|
||||||
|
contact: json['contact'] as String,
|
||||||
|
tel: json['tel'] as String,
|
||||||
|
organizerImgList: (json['organizerImgList'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
Registration _$RegistrationFromJson(Map<String, dynamic> json) => Registration(
|
||||||
|
id: json['id'] as int,
|
||||||
|
name: json['name'] as String,
|
||||||
|
avatarImgList: (json['avatarImgList'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
@ -0,0 +1,34 @@
|
|||||||
|
import 'package:aku_new_community/model/common/img_model.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'announce_detail_model.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class AnnounceDetailModel {
|
||||||
|
final int id;
|
||||||
|
final String title;
|
||||||
|
final int object;
|
||||||
|
final int status;
|
||||||
|
final String content;
|
||||||
|
final int readingVolume;
|
||||||
|
final int downloadNum;
|
||||||
|
final String modifyDate;
|
||||||
|
final List<ImgModel> coverImgList;
|
||||||
|
final List<ImgModel> annexImgList;
|
||||||
|
|
||||||
|
factory AnnounceDetailModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$AnnounceDetailModelFromJson(json);
|
||||||
|
|
||||||
|
const AnnounceDetailModel({
|
||||||
|
required this.id,
|
||||||
|
required this.title,
|
||||||
|
required this.object,
|
||||||
|
required this.status,
|
||||||
|
required this.content,
|
||||||
|
required this.readingVolume,
|
||||||
|
required this.downloadNum,
|
||||||
|
required this.modifyDate,
|
||||||
|
required this.coverImgList,
|
||||||
|
required this.annexImgList,
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'announce_detail_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
AnnounceDetailModel _$AnnounceDetailModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
AnnounceDetailModel(
|
||||||
|
id: json['id'] as int,
|
||||||
|
title: json['title'] as String,
|
||||||
|
object: json['object'] as int,
|
||||||
|
status: json['status'] as int,
|
||||||
|
content: json['content'] as String,
|
||||||
|
readingVolume: json['readingVolume'] as int,
|
||||||
|
downloadNum: json['downloadNum'] as int,
|
||||||
|
modifyDate: json['modifyDate'] as String,
|
||||||
|
coverImgList: (json['coverImgList'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
annexImgList: (json['annexImgList'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
@ -0,0 +1,67 @@
|
|||||||
|
import 'package:aku_new_community/base/base_style.dart';
|
||||||
|
import 'package:aku_new_community/model/common/img_model.dart';
|
||||||
|
import 'package:common_utils/common_utils.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'home_activity_model.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class HomeActivityModel {
|
||||||
|
final int id;
|
||||||
|
final String title;
|
||||||
|
final int status;
|
||||||
|
final String registrationStartTime;
|
||||||
|
final String registrationEndTime;
|
||||||
|
final String activityStartTime;
|
||||||
|
final String activityEndTime;
|
||||||
|
final List<ImgModel>? imgList;
|
||||||
|
final int? registrationNum;
|
||||||
|
factory HomeActivityModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$HomeActivityModelFromJson(json);
|
||||||
|
|
||||||
|
DateTime? get begin => DateUtil.getDateTime(registrationStartTime);
|
||||||
|
|
||||||
|
DateTime? get end => DateUtil.getDateTime(registrationEndTime);
|
||||||
|
String get statusString {
|
||||||
|
switch (this.status) {
|
||||||
|
case 1:
|
||||||
|
return '未开始';
|
||||||
|
case 2:
|
||||||
|
return '进行中';
|
||||||
|
case 3:
|
||||||
|
return '已结束';
|
||||||
|
case 4:
|
||||||
|
return '已投票';
|
||||||
|
default:
|
||||||
|
return '未知';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Color get statusColor {
|
||||||
|
switch (this.status) {
|
||||||
|
case 1:
|
||||||
|
return kPrimaryColor;
|
||||||
|
case 2:
|
||||||
|
return Colors.black;
|
||||||
|
case 3:
|
||||||
|
return ktextSubColor;
|
||||||
|
case 4:
|
||||||
|
return ktextSubColor;
|
||||||
|
default:
|
||||||
|
return Colors.red;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const HomeActivityModel({
|
||||||
|
required this.id,
|
||||||
|
required this.title,
|
||||||
|
required this.status,
|
||||||
|
required this.registrationStartTime,
|
||||||
|
required this.registrationEndTime,
|
||||||
|
required this.activityStartTime,
|
||||||
|
required this.activityEndTime,
|
||||||
|
this.imgList,
|
||||||
|
this.registrationNum,
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'home_activity_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
HomeActivityModel _$HomeActivityModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
HomeActivityModel(
|
||||||
|
id: json['id'] as int,
|
||||||
|
title: json['title'] as String,
|
||||||
|
status: json['status'] as int,
|
||||||
|
registrationStartTime: json['registrationStartTime'] as String,
|
||||||
|
registrationEndTime: json['registrationEndTime'] as String,
|
||||||
|
activityStartTime: json['activityStartTime'] as String,
|
||||||
|
activityEndTime: json['activityEndTime'] as String,
|
||||||
|
imgList: (json['imgList'] as List<dynamic>?)
|
||||||
|
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
registrationNum: json['registrationNum'] as int?,
|
||||||
|
);
|
@ -0,0 +1,24 @@
|
|||||||
|
import 'package:aku_new_community/model/common/img_model.dart';
|
||||||
|
import 'package:common_utils/common_utils.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'home_announce_model.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class HomeAnnounceModel {
|
||||||
|
final int id;
|
||||||
|
final String title;
|
||||||
|
final String content;
|
||||||
|
final List<ImgModel> imgList;
|
||||||
|
final String createDate;
|
||||||
|
factory HomeAnnounceModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$HomeAnnounceModelFromJson(json);
|
||||||
|
DateTime? get createDateString => DateUtil.getDateTime(createDate);
|
||||||
|
const HomeAnnounceModel({
|
||||||
|
required this.id,
|
||||||
|
required this.title,
|
||||||
|
required this.content,
|
||||||
|
required this.imgList,
|
||||||
|
required this.createDate,
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'home_announce_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
HomeAnnounceModel _$HomeAnnounceModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
HomeAnnounceModel(
|
||||||
|
id: json['id'] as int,
|
||||||
|
title: json['title'] as String,
|
||||||
|
content: json['content'] as String,
|
||||||
|
imgList: (json['imgList'] as List<dynamic>)
|
||||||
|
.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
createDate: json['createDate'] as String,
|
||||||
|
);
|
@ -0,0 +1,23 @@
|
|||||||
|
import 'package:aku_new_community/model/common/img_model.dart';
|
||||||
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
|
||||||
|
part 'home_swiper_model.g.dart';
|
||||||
|
|
||||||
|
@JsonSerializable()
|
||||||
|
class HomeSwiperModel {
|
||||||
|
final int id;
|
||||||
|
final int type;
|
||||||
|
final String? customizeUrl;
|
||||||
|
final int? associationId;
|
||||||
|
final List<ImgModel>? imgList;
|
||||||
|
factory HomeSwiperModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$HomeSwiperModelFromJson(json);
|
||||||
|
|
||||||
|
const HomeSwiperModel({
|
||||||
|
required this.id,
|
||||||
|
required this.type,
|
||||||
|
this.customizeUrl,
|
||||||
|
this.associationId,
|
||||||
|
this.imgList,
|
||||||
|
});
|
||||||
|
}
|
@ -0,0 +1,18 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'home_swiper_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
HomeSwiperModel _$HomeSwiperModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
HomeSwiperModel(
|
||||||
|
id: json['id'] as int,
|
||||||
|
type: json['type'] as int,
|
||||||
|
customizeUrl: json['customizeUrl'] as String?,
|
||||||
|
associationId: json['associationId'] as int?,
|
||||||
|
imgList: (json['imgList'] as List<dynamic>?)
|
||||||
|
?.map((e) => ImgModel.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
@ -1,126 +0,0 @@
|
|||||||
import 'package:aku_new_community/constants/api.dart';
|
|
||||||
import 'package:aku_new_community/constants/application_objects.dart';
|
|
||||||
import 'package:aku_new_community/model/community/board_model.dart';
|
|
||||||
import 'package:aku_new_community/ui/community/notice/notice_card.dart';
|
|
||||||
import 'package:aku_new_community/utils/headers.dart';
|
|
||||||
import 'package:aku_new_community/utils/network/base_list_model.dart';
|
|
||||||
import 'package:aku_new_community/utils/network/net_util.dart';
|
|
||||||
import 'package:aku_new_community/widget/bee_scaffold.dart';
|
|
||||||
import 'package:aku_new_community/widget/views/application_box.dart';
|
|
||||||
import 'package:aku_new_community/widget/views/application_view.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
|
||||||
|
|
||||||
import 'widget/property_card.dart';
|
|
||||||
|
|
||||||
//TODO CLEAN BOTTOM CODES.
|
|
||||||
@Deprecated("sh*t property_index need to be cleaned.")
|
|
||||||
class PropertyIndex extends StatefulWidget {
|
|
||||||
PropertyIndex({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
@override
|
|
||||||
_PropertyIndexState createState() => _PropertyIndexState();
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO CLEAN BOTTOM CODES.
|
|
||||||
@Deprecated("sh*t property_index need to be cleaned.")
|
|
||||||
class _PropertyIndexState extends State<PropertyIndex>
|
|
||||||
with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin {
|
|
||||||
@override
|
|
||||||
bool get wantKeepAlive => true;
|
|
||||||
|
|
||||||
EasyRefreshController _refreshController = EasyRefreshController();
|
|
||||||
int _page = 1;
|
|
||||||
int? _pageCount = 0;
|
|
||||||
List<BoardItemModel> _models = [];
|
|
||||||
|
|
||||||
Future<List<BoardItemModel>> _getItems() async {
|
|
||||||
BaseListModel model = await NetUtil().getList(
|
|
||||||
API.community.boardList,
|
|
||||||
params: {
|
|
||||||
'pageNum': _page,
|
|
||||||
'size': 10,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
_pageCount = model.total;
|
|
||||||
return model.rows.map((e) => BoardItemModel.fromJson(e)).toList();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
void dispose() {
|
|
||||||
super.dispose();
|
|
||||||
_refreshController.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
super.build(context);
|
|
||||||
return BeeScaffold(
|
|
||||||
title: '物业',
|
|
||||||
body: EasyRefresh(
|
|
||||||
controller: _refreshController,
|
|
||||||
firstRefresh: true,
|
|
||||||
header: MaterialHeader(),
|
|
||||||
footer: MaterialFooter(),
|
|
||||||
onRefresh: () async {
|
|
||||||
_page = 1;
|
|
||||||
_models = await _getItems();
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
onLoad: () async {
|
|
||||||
_page++;
|
|
||||||
_models.addAll(await _getItems());
|
|
||||||
if (_page >= _pageCount!) _refreshController.finishLoad(noMore: true);
|
|
||||||
setState(() {});
|
|
||||||
},
|
|
||||||
child: CustomScrollView(
|
|
||||||
slivers: [
|
|
||||||
SliverToBoxAdapter(
|
|
||||||
child: ApplicationBox(
|
|
||||||
child: ApplicationView.custom(items: smartManagerApp),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SliverToBoxAdapter(
|
|
||||||
child: PropertyCard(),
|
|
||||||
),
|
|
||||||
// PropertyBar(
|
|
||||||
// title: '社区活动',
|
|
||||||
// subtitle: '精彩往期',
|
|
||||||
// more: '更多活动',
|
|
||||||
// fun: activityRouter,
|
|
||||||
// ),
|
|
||||||
// SliverToBoxAdapter(
|
|
||||||
// child: PropertyActivityCard(fun: activityDetailsRouter),
|
|
||||||
// ),
|
|
||||||
// PropertyBar(
|
|
||||||
// title: '社区公告',
|
|
||||||
// subtitle: '看看小区最近发生什么?',
|
|
||||||
// ),
|
|
||||||
SliverToBoxAdapter(
|
|
||||||
child: ListView.builder(
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics: NeverScrollableScrollPhysics(),
|
|
||||||
itemBuilder: (context, index) => SizedBox(),
|
|
||||||
itemCount: 3,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SliverList(
|
|
||||||
delegate: SliverChildBuilderDelegate(
|
|
||||||
(context, index) {
|
|
||||||
final BoardItemModel model = _models[index];
|
|
||||||
BoardItemModel? preModel;
|
|
||||||
if (index >= 1) preModel = _models[index - 1];
|
|
||||||
return Padding(
|
|
||||||
padding: EdgeInsets.only(bottom: 8.w),
|
|
||||||
child: NoticeCard(model: model, preModel: preModel),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
childCount: _models.length,
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,180 +0,0 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
|
||||||
|
|
||||||
import 'package:aku_new_community/utils/headers.dart';
|
|
||||||
|
|
||||||
class PropertyCard extends StatelessWidget {
|
|
||||||
PropertyCard({Key? key}) : super(key: key);
|
|
||||||
|
|
||||||
final List<Map<String, dynamic>> _listCard = [
|
|
||||||
{
|
|
||||||
'title': '电话物业',
|
|
||||||
'subtitle': '24小时在线',
|
|
||||||
'image': R.ASSETS_ICONS_PROPERTY_PNG,
|
|
||||||
'coloList': [Color(0xff42ceff), Color(0xff198cfb)],
|
|
||||||
'shapeColoList': [Color(0xff42ceff), Color(0xff0b69c4)]
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
Future<void> _phoneCall(String url) async {
|
|
||||||
if (await canLaunch(url)) {
|
|
||||||
await launch(url);
|
|
||||||
} else {
|
|
||||||
throw 'Could not launch $url';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void _showDialog(BuildContext context, String url) {
|
|
||||||
showCupertinoDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (context) {
|
|
||||||
return CupertinoAlertDialog(
|
|
||||||
title: Text(
|
|
||||||
url,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 34.sp,
|
|
||||||
color: Color(0xff030303),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
actions: <Widget>[
|
|
||||||
CupertinoDialogAction(
|
|
||||||
child: Text(
|
|
||||||
'取消',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 34.sp,
|
|
||||||
color: Color(0xff333333),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
CupertinoDialogAction(
|
|
||||||
child: Text(
|
|
||||||
'呼叫',
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
fontSize: 34.sp,
|
|
||||||
color: Color(0xffff8200),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
onPressed: () {
|
|
||||||
_phoneCall('tel:$url');
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return Container(
|
|
||||||
margin: EdgeInsets.symmetric(
|
|
||||||
horizontal: 32.w,
|
|
||||||
vertical: 20.w,
|
|
||||||
),
|
|
||||||
child: GridView.builder(
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics: NeverScrollableScrollPhysics(),
|
|
||||||
itemCount: _listCard.length,
|
|
||||||
itemBuilder: (BuildContext context, int index) {
|
|
||||||
return InkWell(
|
|
||||||
onTap: () {
|
|
||||||
switch (_listCard[index]['title']) {
|
|
||||||
case '电话物业':
|
|
||||||
_showDialog(context, '0574-87760023');
|
|
||||||
break;
|
|
||||||
case '语音管家':
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
padding: EdgeInsets.symmetric(
|
|
||||||
horizontal: 19.w,
|
|
||||||
vertical: 36.w,
|
|
||||||
),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: Alignment.centerLeft,
|
|
||||||
end: Alignment.centerRight,
|
|
||||||
colors: _listCard[index]['coloList'],
|
|
||||||
),
|
|
||||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
|
||||||
boxShadow: <BoxShadow>[
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.grey.withOpacity(0.2),
|
|
||||||
offset: Offset(1.1, 1.1),
|
|
||||||
blurRadius: 10.0),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
Container(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
height: 88.w,
|
|
||||||
width: 88.w,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
shape: BoxShape.circle,
|
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: _listCard[index]['shapeColoList'],
|
|
||||||
),
|
|
||||||
boxShadow: <BoxShadow>[
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.grey.withOpacity(0.2),
|
|
||||||
offset: Offset(1.1, 1.1),
|
|
||||||
blurRadius: 10.0),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: Image.asset(
|
|
||||||
_listCard[index]['image'],
|
|
||||||
fit: BoxFit.fill,
|
|
||||||
height: 64.w,
|
|
||||||
width: 77.w,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 24.w),
|
|
||||||
Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
SizedBox(height: 5.w),
|
|
||||||
Text(
|
|
||||||
_listCard[index]['title'],
|
|
||||||
style: TextStyle(
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
fontSize: 32.sp,
|
|
||||||
color: Color(0xffffffff),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(height: 4.w),
|
|
||||||
Text(
|
|
||||||
_listCard[index]['subtitle'],
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20.sp,
|
|
||||||
color: Color(0xffffffff),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
||||||
crossAxisCount: 1,
|
|
||||||
crossAxisSpacing: 40.w,
|
|
||||||
childAspectRatio: 600.w / 160.w),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -0,0 +1,24 @@
|
|||||||
|
class ActivityFunc {
|
||||||
|
static String dateCheck(DateTime? date) {
|
||||||
|
if (date == null) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
var nowDate = DateTime.now();
|
||||||
|
if (date.isBefore(nowDate)) {
|
||||||
|
return '已结束';
|
||||||
|
} else {
|
||||||
|
var days = date.difference(nowDate).inDays;
|
||||||
|
if (days > 0) {
|
||||||
|
return '${days}天后结束';
|
||||||
|
} else {
|
||||||
|
var hours = date.difference(nowDate).inHours;
|
||||||
|
if (hours > 0) {
|
||||||
|
return '${hours}小时后结束';
|
||||||
|
} else {
|
||||||
|
var mins = date.difference(nowDate).inMinutes;
|
||||||
|
return '$mins分钟后结束';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue