From 62c58222c02809df0ea6b59e4dde718d09a033a8 Mon Sep 17 00:00:00 2001 From: zhangmeng <494089941@qq.com> Date: Wed, 14 Jul 2021 10:51:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AE=B6=E6=94=BF=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=20=E6=9C=8D=E5=8A=A1=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../house_keeping/house_keeping_card.dart | 33 +++++- .../house_keeping_detail_page.dart | 110 ++++++++++++++++++ 2 files changed, 138 insertions(+), 5 deletions(-) create mode 100644 lib/ui/manager/house_keeping/house_keeping_detail_page.dart diff --git a/lib/ui/manager/house_keeping/house_keeping_card.dart b/lib/ui/manager/house_keeping/house_keeping_card.dart index 3b020d96..207a1787 100644 --- a/lib/ui/manager/house_keeping/house_keeping_card.dart +++ b/lib/ui/manager/house_keeping/house_keeping_card.dart @@ -2,11 +2,14 @@ import 'package:aku_community/base/base_style.dart'; import 'package:aku_community/const/resource.dart'; import 'package:aku_community/constants/api.dart'; import 'package:aku_community/models/house_keeping/house_keeping_list_model.dart'; +import 'package:aku_community/ui/manager/house_keeping/house_keeping_detail_page.dart'; +import 'package:aku_community/utils/headers.dart'; import 'package:aku_community/widget/buttons/card_bottom_button.dart'; import 'package:aku_community/widget/others/aku_chip_box.dart'; import 'package:flustars/flustars.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:velocity_x/velocity_x.dart'; class HouseKeepingCard extends StatelessWidget { @@ -18,9 +21,12 @@ class HouseKeepingCard extends StatelessWidget { @override Widget build(BuildContext context) { return GestureDetector( - onTap: () async {}, + onTap: () async { + Get.to(() => HouseKeepingDetailPage(model: model)); + }, child: Container( padding: EdgeInsets.all(24.w), + child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, @@ -40,9 +46,7 @@ class HouseKeepingCard extends StatelessWidget { ), Text( model.statusString, - style: TextStyle( - color: - model.statusColor), + style: TextStyle(color: model.statusColor), ), ], ), @@ -58,6 +62,21 @@ class HouseKeepingCard extends StatelessWidget { ), 16.w.heightBox, _buildImgs(), + Row( + children: [ + Image.asset( + R.ASSETS_IMAGES_PLACEHOLDER_WEBP, + width: 40.w, + height: 40.w, + ), + 12.w.widthBox, + '${S.of(context)!.tempPlotName}·${model.roomName}' + .text + .size(28.sp) + .color(ktextSubColor) + .make() + ], + ), _getBottomCard(), ], ), @@ -120,7 +139,11 @@ class HouseKeepingCard extends StatelessWidget { ]; case 3: return [ - CardBottomButton.white(onPressed: () async {}, text: ('查看详情')), + CardBottomButton.white( + onPressed: () async { + Get.to(() => HouseKeepingDetailPage(model: model)); + }, + text: ('查看详情')), ]; case 4: return [ diff --git a/lib/ui/manager/house_keeping/house_keeping_detail_page.dart b/lib/ui/manager/house_keeping/house_keeping_detail_page.dart new file mode 100644 index 00000000..9d48e340 --- /dev/null +++ b/lib/ui/manager/house_keeping/house_keeping_detail_page.dart @@ -0,0 +1,110 @@ +import 'package:aku_community/base/base_style.dart'; +import 'package:aku_community/const/resource.dart'; +import 'package:aku_community/models/house_keeping/house_keeping_list_model.dart'; +import 'package:aku_community/utils/headers.dart'; +import 'package:aku_community/widget/bee_scaffold.dart'; +import 'package:aku_community/widget/views/bee_grid_image_view.dart'; +import 'package:flustars/flustars.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:velocity_x/velocity_x.dart'; + +class HouseKeepingDetailPage extends StatefulWidget { + final HouseKeepingListModel model; + HouseKeepingDetailPage({Key? key, required this.model}) : super(key: key); + + @override + _HouseKeepingDetailPageState createState() => _HouseKeepingDetailPageState(); +} + +class _HouseKeepingDetailPageState extends State { + @override + Widget build(BuildContext context) { + return BeeScaffold( + title: '服务详情', + body: ListView( + padding: EdgeInsets.symmetric(vertical: 24.w), + children: [ + _buildInfo(), + ], + ), + ); + } + + Widget _buildInfo() { + return Container( + color: Colors.white, + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 24.w), + child: Column( + children: [ + Row( + children: [ + '服务信息'.text.size(36.sp).bold.black.make(), + Spacer(), + widget.model.statusString.text + .size(32.sp) + .color(widget.model.statusColor) + .make() + ], + ), + 40.w.heightBox, + _buildTile(R.ASSETS_ICONS_ARTICLE_COUNT_PNG, '申请人', + widget.model.proposerName), + 16.w.heightBox, + _buildTile( + R.ASSETS_ICONS_PHONE_PNG, '联系电话', widget.model.proposerTel), + 16.w.heightBox, + _buildTile(R.ASSETS_ICONS_APPOINTMENT_ADDRESS_PNG, '地址', + '${S.of(context)!.tempPlotName}·${widget.model.roomName}'), + 56.w.heightBox, + BeeGridImageView( + urls: widget.model.submitImgList.map((e) => e.url).toList()), + ], + ), + ); + } + + Widget _buildTile(String iconPath, String title, String suffix) { + return Row( + children: [ + Image.asset( + iconPath, + width: 40.w, + height: 40.w, + ), + 8.w.widthBox, + title.text.size(28.sp).color(ktextSubColor).make(), + Spacer(), + suffix.text.size(28.sp).black.make(), + ], + ); + } + + Widget _buidProcess() { + return Container( + padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 24.w), + width: double.infinity, + child: Column( + children: [ + Row( + children: [ + '服务进程'.text.size(36.sp).bold.black.make(), + ], + ), + ], + ), + ); + } + + Widget _buidProcessTile(String title, DateTime date) { + return Row(children: [ + title.text.size(28.sp).color(ktextSubColor).make(), + Spacer(), + '${DateUtil.formatDate(date, format: 'yyyy-MM-dd HH:mm:ss')}' + .text + .size(28.sp) + .black + .make(), + ]); + } +}