diff --git a/lib/models/facility/facility_type_detail_model.dart b/lib/models/facility/facility_type_detail_model.dart index d0e2556d..f76614c5 100644 --- a/lib/models/facility/facility_type_detail_model.dart +++ b/lib/models/facility/facility_type_detail_model.dart @@ -1,5 +1,6 @@ import 'package:common_utils/common_utils.dart'; import 'package:equatable/equatable.dart'; +import 'package:intl/intl.dart'; import 'package:json_annotation/json_annotation.dart'; import '../../model/common/img_model.dart'; @@ -16,9 +17,9 @@ class FacilityTypeDetailModel extends Equatable { final String openEndDate; final List? imgList; - DateTime? get openStartDt => DateUtil.getDateTime(openStartDate); + DateTime? get openStartDT => DateFormat('HH:mm:ss').parse(openStartDate); - DateTime? get openEndDt => DateUtil.getDateTime(openEndDate); + DateTime? get openEndDT => DateFormat('HH:mm:ss').parse(openEndDate); FacilityTypeDetailModel({ required this.id, diff --git a/lib/pages/setting_page/agreement_page/privacy_page.dart b/lib/pages/setting_page/agreement_page/privacy_page.dart index 4cae3f93..f447af24 100644 --- a/lib/pages/setting_page/agreement_page/privacy_page.dart +++ b/lib/pages/setting_page/agreement_page/privacy_page.dart @@ -18,8 +18,6 @@ class _PrivacyPageState extends State { padding: EdgeInsets.all(16.sp), child: Text( ''' -版本更新日期:2022年4月20日 -  【前言】欢迎使用“小蜜蜂”(包括小蜜蜂网站、App、小程序及其他移动应用程序,以下统称“小蜜蜂”)提供的产品和服务。深圳市凯达来科技有限公司(注册地址:深圳市龙岗区横岗街道沙荷路40-11号)及其关联公司作为小蜜蜂运营者(或简称“我们”)深知个人信息对使用我们的产品和服务(以下统称“小蜜蜂服务”)之用户(以下统称“用户”或“您”)的重要性,我们一向庄严承诺保护您的个人信息及隐私安全。您在使用小蜜蜂服务时,我们可能会收集和使用您的相关个人信息。我们希望通过《小蜜蜂隐私政策》(以下简称“本政策”)向您说明我们在收集和使用您相关个人信息时对应的处理规则,以及我们为您提供的访问、更正、删除和保护这些个人信息的方式,以便更好的保障您的权益。 本政策适用于小蜜蜂提供的所有产品和服务,如与《小蜜蜂用户服务协议》条款之约定存在冲突的,以本政策为准。 需要特别说明的是,本政策不适用于其他第三方向您提供的服务,第三方向您提供的服务适用其向您另行说明的隐私政策。 @@ -62,7 +60,7 @@ class _PrivacyPageState extends State { 2、向您提供商品或服务信息展示及通知等基础功能 为向您提供更契合您需求的页面展示和搜索结果、了解产品适配性、识别账号异常状态,我们可能会直接或者间接地收集关于您使用的服务以及使用方式的信息并将这些信息进行关联,这些信息包括:    日志信息:当您使用我们的网站或客户端提供的产品或服务时,我们会自动收集您对我们服务的详细使用情况,作为有关网络日志保存。例如:您的浏览和搜索查询记录、收藏及分享、加购物车记录、IP地址、电信运营商、使用的语言、访问日期和时间。 -   设备信息:我们会根据您在软件安装及使用中的具体操作,接收并记录您所使用的设备相关信息。例如:设备型号、操作系统版本、MAC地址、设备设置、设备标识符(IMEI/Android ID/IDFA/OpenUDID/GUID/SIM 卡IMSI 信息)、移动应用列表等软硬件及设备环境信息、设备所在位置相关信息(包括IP 地址、GPS位置以及WLAN接入点、蓝牙和基站等传感器信息)和设备权限信息(包括存储权限),以确保设备操作环境的安全以及提供小蜜蜂服务所必需,防止恶意程序和反作弊。 +    设备信息:我们会根据您在软件安装及使用中的具体操作,接收并记录您所使用的设备相关信息。具体如下:(1)设备型号、操作系统版本、MAC地址、设备设置,用于识别用户的设备类型、设备型号、系统版本等,确保推送消息准确下发;(2)设备标识符(IMEI/Android ID/IDFA/OpenUDID/GUID/SIM 卡IMSI 信息),用于识别唯一用户,保证推送信息的精准送达;(3)设备环境信息、设备所在位置相关信息(包括IP 地址、GPS位置以及WLAN接入点、蓝牙和基站等传感器信息)和设备权限信息(包括存储权限),用于优化SDK与服务器的网络连接请求,保证服务的稳定性和连续性;(4)app应用列表及活跃状态信息,用于当同个设备有多个推送链路同时活跃时,我们会随机合并成一条链路,以达到为用户节省电量的目的;我们会向您提供智能推送服务,通过该消息推荐符合您需要的推送内容,减少无用信息对您的打扰。以上信息的获取同时也为确保设备操作环境的安全以及提供小蜜蜂管家端服务所必需,防止恶意程序和反作弊。 请注意,单独的设备信息、日志信息等是无法识别特定自然人身份的信息。如果我们将这类非个人信息与其他信息结合用于识别特定自然人身份,或者将其与个人信息结合使用,则在结合使用期间,这类非个人信息将被视为个人信息,除取得您授权或法律法规另有规定外,我们会将该类个人信息做匿名化、去标识化处理。 3、为您提供一键报警功能 在您使用小蜜蜂的过程中,如果您碰到了紧急情况,可以主动选择将当前定位信息发送至物业后台并提示警报,我们会收集包括您设备的定位信息用于实现上述功能及其他我们明确告知的目的。 diff --git a/lib/ui/community/facility/facility_preorder_date_picker.dart b/lib/ui/community/facility/facility_preorder_date_picker.dart index 997885f3..dc7bb09b 100644 --- a/lib/ui/community/facility/facility_preorder_date_picker.dart +++ b/lib/ui/community/facility/facility_preorder_date_picker.dart @@ -1,11 +1,22 @@ import 'package:aku_new_community/constants/saas_api.dart'; +import 'package:aku_new_community/models/facility/facility_type_detail_model.dart'; import 'package:aku_new_community/utils/headers.dart'; +import 'package:aku_new_community/widget/picker/bee_choose_date_picker.dart'; +import 'package:common_utils/common_utils.dart'; import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; +import 'package:get/get_core/src/get_main.dart'; +import 'package:intl/intl.dart'; +import '../../../utils/network/base_model.dart'; import '../../../utils/network/net_util.dart'; import '../../../widget/buttons/bee_check_radio.dart'; class FacilityPreorderDatePicker extends StatefulWidget { - const FacilityPreorderDatePicker({Key? key}) : super(key: key); + FacilityTypeDetailModel typeModel; + + FacilityPreorderDatePicker({Key? key, required this.typeModel}) + : super(key: key); @override State createState() => @@ -13,46 +24,100 @@ class FacilityPreorderDatePicker extends StatefulWidget { } class _FacilityPreorderDatePickerState extends State { - List get _num => List.generate(48, (index) => index + 1); - List? _models; + List get _num => List.generate( + getNum(widget.typeModel.openEndDT!) - + getNum(widget.typeModel.openStartDT!), + (index) => index + 1); + DateTime? start; + List models=[]; - @override - void initState() async{ - var base = - await NetUtil().get(SAASAPI.facilities.allAppointmentPeriod, params: { - 'facilitiesManageId': widget, - 'todayDate':DateTime.now(), + static Future> getPreorderData(int id) async { + BaseModel model = + await NetUtil().get(SAASAPI.facilities.allAppointmentPeriod, params: { + 'facilitiesManageId': id, + 'todayDate': DateTime.now(), }); - if (base.success) { - _models = (base.data as List).toList(); + if (model.success) { + return (model.data as List).toList(); } - super.initState(); + return []; } @override Widget build(BuildContext context) { - return ListView( - children: _num - .map((e) => Center( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20.w), - child: - Text(e.toString() + '年', textAlign: TextAlign.center), - ), - )) - .toList()); + return BeeChooseDatePicker( + height: 700.h, + onPressed: () { + Get.back(); + }, + body: Container( + height: 600.h, + child: ListView.separated( + padding: EdgeInsets.all(32.w), + itemBuilder: (context, index) { + return Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _datesList(index), + 20.hb, + Divider(height: 1.0,color: Colors.black12,), + ], + ); + }, + separatorBuilder: (context, index) => 32.hb, + itemCount: _num.length, + ), + ), + ); } - Widget _datesList() { - DateTime date=DateTime.now(); - return Row( + Widget _datesList(int index) { + DateTime start=widget.typeModel.openStartDT!; + ()async{ + BaseModel model = + await NetUtil().get(SAASAPI.facilities.allAppointmentPeriod, params: { + 'facilitiesManageId': widget.typeModel.id, + 'todayDate': DateTime.now(), + }); + if (model.success) { + models=(model.data as List).toList(); + } + }; + return GestureDetector( + onTap: (){ + + }, + child:Row( + crossAxisAlignment: CrossAxisAlignment.center, children: [ BeeCheckRadio( - value: _num, - // groupValue: SAASAPI.facilities.allAppointmentPeriod, + value: getNum(start)+index, + groupValue: models, + backColor: start.isAfter(DateTime.now())?Colors.grey:Colors.white, ), - Text('${date}~${date.add(Duration(minutes: 30))}'), + 30.wb, + Text( + '${DateUtil.formatDate(start.add(Duration(minutes: 30*index)),format: 'HH:mm')}' + '~${DateUtil.formatDate(start.add(Duration(minutes: 30*(index+1))),format: 'HH:mm')}', + style: TextStyle( + fontSize: 30.sp, + ), + ), + Spacer(), + start.isAfter(DateTime.now())?'已过期'.text.size(30.sp).color(Colors.black.withOpacity(0.45)).make(): + models.contains(getNum(start))?'已被他人预约'.text.size(30.sp).color(Colors.black.withOpacity(0.45)).make():SizedBox(), ], + ), ); } } + +int getNum(DateTime dateTime) { + int hour, minute; + hour = dateTime.hour; + minute = dateTime.minute; + if (minute > 0) { + return hour * 2 + 1; + } + return hour * 2; +} diff --git a/lib/ui/community/facility/facility_preorder_page.dart b/lib/ui/community/facility/facility_preorder_page.dart index 2c36a98e..d7b5b234 100644 --- a/lib/ui/community/facility/facility_preorder_page.dart +++ b/lib/ui/community/facility/facility_preorder_page.dart @@ -4,6 +4,7 @@ import 'package:aku_new_community/constants/app_theme.dart'; import 'package:aku_new_community/models/facility/facility_type_detail_model.dart'; import 'package:aku_new_community/provider/app_provider.dart'; import 'package:aku_new_community/provider/user_provider.dart'; +import 'package:aku_new_community/ui/community/facility/facility_preorder_date_picker.dart'; import 'package:aku_new_community/ui/community/facility/facility_type_detail_page.dart'; import 'package:aku_new_community/ui/community/facility/facility_order_date_list_page.dart'; import 'package:aku_new_community/ui/profile/house/pick_my_house_page.dart'; @@ -22,6 +23,7 @@ import 'package:provider/provider.dart'; import '../../../constants/saas_api.dart'; import '../../../models/facility/facility_type_model.dart'; +import '../../../widget/picker/bee_choose_date_picker.dart'; import '../../../widget/picker/bee_day_picker.dart'; import '../../manager/advice/advice_house_page.dart'; @@ -98,7 +100,7 @@ class _FacilityPreorderPageState extends State { height: 120.w, onPressed: () async { DateTime? date = await BeeDayPicker.pick(DateTime.now()); - BeeDayPicker.pick(DateTime.now()); + await Get.bottomSheet(FacilityPreorderDatePicker(typeModel: widget.typeModel,)); if (date != null) { startDate = date; setState(() {}); diff --git a/lib/ui/community/facility/facility_type_detail_card.dart b/lib/ui/community/facility/facility_type_detail_card.dart index 5587f244..dbd2c37e 100644 --- a/lib/ui/community/facility/facility_type_detail_card.dart +++ b/lib/ui/community/facility/facility_type_detail_card.dart @@ -36,14 +36,15 @@ class FacilityTypeDetailCard extends StatelessWidget { Material( borderRadius: BorderRadius.circular(10.w), clipBehavior: Clip.antiAliasWithSaveLayer, - child: FadeInImage.assetNetwork( + child:FadeInImage.assetNetwork( placeholder: R.ASSETS_IMAGES_PLACEHOLDER_WEBP, image: SAASAPI.image(ImgModel.first(model.imgList)), - height: 120.h, - width: 150.w, + height: 150.h, + width: 200.w, fit: BoxFit.cover, ), ), + 30.wb, Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -55,7 +56,7 @@ class FacilityTypeDetailCard extends StatelessWidget { ), ), 15.hb, - '${model.openStartDate.substring(0, model.openStartDate.length - 3)}-${model.openEndDate.substring(0, model.openEndDate.length - 3)} 开放' + '${DateUtil.formatDate(model.openStartDT,format: 'HH:mm')}-${DateUtil.formatDate(model.openEndDT,format: 'HH:mm')} 开放' .text .size(20.sp) .make(), diff --git a/pubspec.lock b/pubspec.lock index d4e08ca8..f8605156 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -760,6 +760,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.12.11" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3" meta: dependency: transitive description: @@ -1207,7 +1214,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.3" + version: "0.4.8" time: dependency: transitive description: