Merge branch 'master' into newHost

# Conflicts:
#	lib/constants/api.dart
pull/1/head
张萌 3 years ago
commit e28c64eb19

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 492 KiB

@ -24,6 +24,12 @@ class API {
static _Search search = _Search();
static _Pay pay = _Pay();
static _House house = _House();
static _Bracelet bracelet = _Bracelet();
}
class _Bracelet {
///
String get data => '/user/aqg/getData';
}
class _Login {

@ -17,6 +17,7 @@ import 'package:aku_new_community/pages/one_alarm/widget/alarm_page.dart';
import 'package:aku_new_community/pages/opening_code_page/opening_code_page.dart';
import 'package:aku_new_community/pages/renovation_manage/new_renovation/new_renovation_page.dart';
import 'package:aku_new_community/pages/service_browse/service_browse_page.dart';
import 'package:aku_new_community/pages/services/old_age/old_age_support_page_simple.dart';
import 'package:aku_new_community/pages/setting_page/settings_page.dart';
import 'package:aku_new_community/pages/surrounding_enterprises/surrounding_enterprises_page.dart';
import 'package:aku_new_community/pages/things_page/fixed_submit_page.dart';
@ -45,10 +46,10 @@ class AO {
this.page,
);
AO.fromRaw(String raw) {
AO.fromRaw(String raw, {String? replaceTitle}) {
appObjects.forEach((element) {
if (element.title == raw) {
this.title = element.title;
this.title = replaceTitle ?? element.title;
this.path = element.path;
this.page = element.page;
}
@ -96,7 +97,7 @@ List<AO> appObjects = [
AO('地理信息', R.ASSETS_ICONS_FUNC_DLXX_PNG, () => GeographicInformationPage()),
AO('周边企业', R.ASSETS_ICONS_FUNC_ZBQY_PNG, () => SurroundingEnterprisesPage()),
AO('住房说明', R.ASSETS_ICONS_FUNC_ZFSM_PNG, () => HouseIntroducePage()),
AO('智慧养老', Assets.icons.provideAged.path, null),
AO('智慧养老', Assets.icons.provideAged.path, () => OldAgeSupportPageSimple()),
AO('周边服务', Assets.icons.nearbyService.path, null),
AO('小蜜蜂任务', Assets.icons.beeTask.path, null),
AO('自营商城', Assets.icons.shoppingMall.path, null),
@ -104,6 +105,7 @@ List<AO> appObjects = [
AO('共享停车', Assets.icons.sharePark.path, null),
AO('二手市场', Assets.icons.secondHandMarket.path, null),
AO('共享投屏', Assets.icons.projectionScreen.path, null),
AO('全部应用', Assets.icons.funcAll.path, () => AllApplicationPage()),
// AO(
// '小区教育',

@ -157,6 +157,10 @@ class $AssetsIconsGen {
/// File path: assets/icons/bee_task.png
AssetGenImage get beeTask => const AssetGenImage('assets/icons/bee_task.png');
/// File path: assets/icons/blood_ressure.png
AssetGenImage get bloodRessure =>
const AssetGenImage('assets/icons/blood_ressure.png');
/// File path: assets/icons/borrow_failure.png
AssetGenImage get borrowFailure =>
const AssetGenImage('assets/icons/borrow_failure.png');
@ -239,6 +243,10 @@ class $AssetsIconsGen {
AssetGenImage get facility =>
const AssetGenImage('assets/icons/facility.png');
/// File path: assets/icons/falldown.png
AssetGenImage get falldown =>
const AssetGenImage('assets/icons/falldown.png');
/// File path: assets/icons/file.png
AssetGenImage get file => const AssetGenImage('assets/icons/file.png');
@ -252,6 +260,9 @@ class $AssetsIconsGen {
AssetGenImage get fireAlarm =>
const AssetGenImage('assets/icons/fire_alarm.png');
/// File path: assets/icons/foot.png
AssetGenImage get foot => const AssetGenImage('assets/icons/foot.png');
/// File path: assets/icons/func_all.png
AssetGenImage get funcAll => const AssetGenImage('assets/icons/func_all.png');
@ -365,6 +376,10 @@ class $AssetsIconsGen {
AssetGenImage get groupbuyTabUnselected =>
const AssetGenImage('assets/icons/groupbuy_tab_unselected.png');
/// File path: assets/icons/heartbeat.png
AssetGenImage get heartbeat =>
const AssetGenImage('assets/icons/heartbeat.png');
/// File path: assets/icons/hot_fire.png
AssetGenImage get hotFire => const AssetGenImage('assets/icons/hot_fire.png');
@ -625,6 +640,9 @@ class $AssetsIconsGen {
AssetGenImage get nearbyService =>
const AssetGenImage('assets/icons/nearby_service.png');
/// File path: assets/icons/oxygen.png
AssetGenImage get oxygen => const AssetGenImage('assets/icons/oxygen.png');
/// File path: assets/icons/pay.png
AssetGenImage get pay => const AssetGenImage('assets/icons/pay.png');
@ -712,6 +730,9 @@ class $AssetsIconsGen {
AssetGenImage get shoppingMall =>
const AssetGenImage('assets/icons/shopping_mall.png');
/// File path: assets/icons/sos.png
AssetGenImage get sos => const AssetGenImage('assets/icons/sos.png');
/// File path: assets/icons/system_notice.png
AssetGenImage get systemNotice =>
const AssetGenImage('assets/icons/system_notice.png');
@ -1079,6 +1100,10 @@ class $AssetsJsonGen {
class $AssetsStaticGen {
const $AssetsStaticGen();
/// File path: assets/static/bracelet_header.png
AssetGenImage get braceletHeader =>
const AssetGenImage('assets/static/bracelet_header.png');
/// File path: assets/static/car_card_grey.webp
AssetGenImage get carCardGrey =>
const AssetGenImage('assets/static/car_card_grey.webp');
@ -1111,6 +1136,10 @@ class $AssetsStaticGen {
AssetGenImage get integralBackground =>
const AssetGenImage('assets/static/integral_background.png');
/// File path: assets/static/old_age_back.png
AssetGenImage get oldAgeBack =>
const AssetGenImage('assets/static/old_age_back.png');
/// File path: assets/static/parking_grey.webp
AssetGenImage get parkingGrey =>
const AssetGenImage('assets/static/parking_grey.webp');

@ -0,0 +1,54 @@
import 'package:json_annotation/json_annotation.dart';
part 'bracelet_model.g.dart';
@JsonSerializable()
class BraceletModel {
final int sbp;
final int todaySteps;
final int bloodOxygen;
final int switchType;
final int dbp;
final int heartRate;
final int remainingPower;
final int detectionDays;
final int alarmNums;
final int fallNums;
factory BraceletModel.fromJson(Map<String, dynamic> json) =>
_$BraceletModelFromJson(json);
String get switchTypeString {
switch (switchType) {
case 0:
return '开机';
case 1:
return '关机';
case 2:
return '开机';
case 3:
return '低电通知';
default:
return '';
}
}
bool get heartNormal => heartRate >= 60 && heartRate <= 100;
bool get sbpNormal => sbp >= 90 && sbp <= 139;
bool get dbpNormal => dbp >= 60 && dbp <= 89;
const BraceletModel({
required this.sbp,
required this.todaySteps,
required this.bloodOxygen,
required this.switchType,
required this.dbp,
required this.heartRate,
required this.remainingPower,
required this.detectionDays,
required this.alarmNums,
required this.fallNums,
});
}

@ -0,0 +1,21 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'bracelet_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
BraceletModel _$BraceletModelFromJson(Map<String, dynamic> json) =>
BraceletModel(
sbp: json['sbp'] as int,
todaySteps: json['todaySteps'] as int,
bloodOxygen: json['bloodOxygen'] as int,
switchType: json['switchType'] as int,
dbp: json['dbp'] as int,
heartRate: json['heartRate'] as int,
remainingPower: json['remainingPower'] as int,
detectionDays: json['detectionDays'] as int,
alarmNums: json['alarmNums'] as int,
fallNums: json['fallNums'] as int,
);

@ -2,23 +2,19 @@
import 'package:aku_new_community/const/resource.dart';
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/constants/application_objects.dart';
import 'package:aku_new_community/model/common/img_model.dart';
import 'package:aku_new_community/model/community/activity_item_model.dart';
import 'package:aku_new_community/model/community/board_model.dart';
import 'package:aku_new_community/model/community/swiper_model.dart';
import 'package:aku_new_community/pages/home/widget/animate_app_bar.dart';
import 'package:aku_new_community/pages/life_pay/life_pay_choose_page.dart';
import 'package:aku_new_community/pages/message_center_page/message_center_page.dart';
import 'package:aku_new_community/pages/one_alarm/widget/alarm_page.dart';
import 'package:aku_new_community/pages/things_page/fixed_submit_page.dart';
import 'package:aku_new_community/pages/visitor_access_page/visitor_access_page.dart';
import 'package:aku_new_community/provider/app_provider.dart';
import 'package:aku_new_community/ui/community/activity/activity_card.dart';
import 'package:aku_new_community/ui/community/activity/activity_list_page.dart';
import 'package:aku_new_community/ui/community/community_func.dart';
import 'package:aku_new_community/ui/community/facility/facility_appointment_page.dart';
import 'package:aku_new_community/ui/home/application/all_application.dart';
import 'package:aku_new_community/ui/home/home_notification.dart';
import 'package:aku_new_community/ui/home/home_title.dart';
import 'package:aku_new_community/ui/home/public_infomation/public_information_detail_page.dart';
@ -514,14 +510,10 @@ class _HomePageState extends State<HomePage>
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
getFunctionBtn(
'报事报修', R.ASSETS_ICONS_FUNC_BSBX_PNG, () => FixedSubmitPage()),
getFunctionBtn('设施预约', R.ASSETS_ICONS_FUNC_SSYY_PNG,
() => FacilityAppointmentPage()),
getFunctionBtn('生活缴费', R.ASSETS_ICONS_FUNC_SHJF_PNG,
() => LifePayChoosePage()),
getFunctionBtn('智慧养老', Assets.icons.provideAged.path, null,
unComplete: true),
getFunctionBtn(AO.fromRaw('报事报修')),
getFunctionBtn(AO.fromRaw('设施预约')),
getFunctionBtn(AO.fromRaw('生活缴费')),
getFunctionBtn(AO.fromRaw('智慧养老')),
],
),
32.hb,
@ -529,44 +521,39 @@ class _HomePageState extends State<HomePage>
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
getFunctionBtn('周边服务', Assets.icons.nearbyService.path, null,
unComplete: true),
getFunctionBtn('任务发布', Assets.icons.beeTask.path, null,
unComplete: true),
getFunctionBtn('邻家宠物', Assets.icons.nearbyPet.path, null,
unComplete: true),
getFunctionBtn('全部应用', R.ASSETS_ICONS_FUNC_ALL_PNG,
() => AllApplicationPage()),
getFunctionBtn(AO.fromRaw('周边服务')),
getFunctionBtn(AO.fromRaw('小蜜蜂任务', replaceTitle: '任务发布')),
getFunctionBtn(AO.fromRaw('邻家宠物')),
getFunctionBtn(AO.fromRaw('全部应用')),
],
),
],
);
}
Widget getFunctionBtn(String title, String path, dynamic page,
{bool unComplete = false}) {
Widget getFunctionBtn(AO ao) {
return MaterialButton(
shape: StadiumBorder(),
padding: EdgeInsets.zero,
onPressed: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(title)) return;
if (unComplete) {
if (!LoginUtil.haveRoom(ao.title)) return;
if (ao.page == null) {
BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else {
Get.to(page);
Get.to(ao.page);
}
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
path,
ao.path,
height: 80.w,
width: 80.w,
),
16.hb,
title.text.size(22.sp).color(Color(0xA6000000)).bold.make(),
ao.title.text.size(22.sp).color(Color(0xA6000000)).bold.make(),
],
),
);

@ -439,13 +439,17 @@ class _PropertyPageState extends State<PropertyPage>
),
SliverToBoxAdapter(
child: _getFunctionView(
wisdomServiceApp, '智慧服务', Color(0xFFFA5858),
unComplete: true),
wisdomServiceApp,
'智慧服务',
Color(0xFFFA5858),
),
),
SliverToBoxAdapter(
child: _getFunctionView(
nearbyShoppingApp, '附近市场', Color(0xFFFA5858),
unComplete: true),
nearbyShoppingApp,
'附近市场',
Color(0xFFFA5858),
),
)
],
),
@ -453,8 +457,11 @@ class _PropertyPageState extends State<PropertyPage>
);
}
_getFunctionView(List<AO> item, String title, Color color,
{bool unComplete = false}) {
_getFunctionView(
List<AO> item,
String title,
Color color,
) {
return Container(
margin: EdgeInsets.only(left: 32.w, right: 32.w, top: 32.w),
decoration: BoxDecoration(
@ -492,7 +499,6 @@ class _PropertyPageState extends State<PropertyPage>
ApplicationView.custom(
items: item,
needAllApp: false,
unComplete: unComplete,
),
],
),

@ -0,0 +1,160 @@
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/widget/bee_back_button.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
@Deprecated('第一版带图表,暂时不做')
class OldAgeSupportPage extends StatefulWidget {
const OldAgeSupportPage({Key? key}) : super(key: key);
@override
_OldAgeSupportPageState createState() => _OldAgeSupportPageState();
}
class _OldAgeSupportPageState extends State<OldAgeSupportPage> {
@override
Widget build(BuildContext context) {
var date = Row(
children: [
Container(
height: 52.w,
alignment: Alignment.center,
padding: EdgeInsets.symmetric(horizontal: 24.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(52.w),
color: Colors.white.withOpacity(0.25)),
child: '数据更新自 2022年1月1日 18:21:15'
.text
.size(26.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
),
],
);
var data = Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
10.w.widthBox,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'58 %'
.text
.size(40.sp)
.color(Colors.black.withOpacity(0.85))
.make(),
'剩余电量'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.65))
.make(),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Icon(
CupertinoIcons.circle_fill,
size: 12.sp,
color: Color(0xFF57DAD2),
),
4.w.widthBox,
'设备 已开机'
.text
.size(22.sp)
.lineHeight(1.2)
.color(Colors.black.withOpacity(0.45))
.make()
],
)
],
),
Spacer(),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'检测天数'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
'58'
.richText
.withTextSpanChildren([
''
.textSpan
.size(22.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
])
.size(56.sp)
.color(Color(0xFF17928A))
.make()
],
),
80.w.widthBox,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'报警次数'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
'5'
.richText
.withTextSpanChildren([
''
.textSpan
.size(22.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
])
.size(56.sp)
.color(Color(0xFFF5222D))
.make()
],
)
],
);
return Scaffold(
appBar: AppBar(
title: '智慧养老'.text.size(32.sp).black.make(),
backgroundColor: Colors.transparent,
leading: BeeBackButton(),
),
extendBody: true,
extendBodyBehindAppBar: true,
body: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
color: Colors.white,
image: DecorationImage(
alignment: Alignment.topCenter,
image: AssetImage(Assets.static.oldAgeBack.path))),
child: SafeArea(
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w),
children: [
38.w.heightBox,
date,
48.w.heightBox,
data,
50.w.heightBox,
Container(
width: 331.w,
height: 204.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.w)),
child: Column(
children: [],
),
),
],
)),
),
);
}
}

@ -0,0 +1,508 @@
import 'package:aku_new_community/constants/api.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/models/bracelet/bracelet_model.dart';
import 'package:aku_new_community/utils/network/net_util.dart';
import 'package:aku_new_community/widget/bee_divider.dart';
import 'package:aku_new_community/widget/bee_scaffold.dart';
import 'package:bot_toast/bot_toast.dart';
import 'package:dio/dio.dart';
import 'package:flustars/flustars.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:velocity_x/velocity_x.dart';
class OldAgeSupportPageSimple extends StatefulWidget {
const OldAgeSupportPageSimple({Key? key}) : super(key: key);
@override
_OldAgeSupportPageSimpleState createState() =>
_OldAgeSupportPageSimpleState();
}
class _OldAgeSupportPageSimpleState extends State<OldAgeSupportPageSimple> {
BraceletModel? _model;
DateTime? _date;
@override
void initState() {
var cancel = BotToast.showLoading();
getData();
cancel();
super.initState();
}
@override
void dispose() {
BotToast.closeAllLoading();
super.dispose();
}
@override
Widget build(BuildContext context) {
var open = Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(
CupertinoIcons.circle_fill,
size: 16.w,
color: Color(0xFF57DAD2),
),
4.w.widthBox,
'设备 ${_model?.switchTypeString}'
.text
.size(26.sp)
.lineHeight(1.2)
.color(Colors.black.withOpacity(0.45))
.make(),
],
);
return BeeScaffold(
title: 'X5手环',
extendBody: true,
body: Container(
width: double.infinity,
height: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
alignment: Alignment.topCenter,
image: AssetImage(Assets.static.braceletHeader.path)),
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [Colors.white, Color(0xFFC0E5DC).withOpacity(0.355)]),
),
child: _model == null
? Container()
: SafeArea(
child: ListView(
padding: EdgeInsets.symmetric(horizontal: 32.w),
children: [
400.w.heightBox,
open,
16.w.heightBox,
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
'数据更新自 ${DateUtil.formatDate(_date!, format: DateFormats.full)}'
.text
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
40.w.heightBox,
],
),
40.w.heightBox,
overview(),
24.w.heightBox,
statusCard(),
40.w.heightBox,
bottomCard(),
40.w.heightBox,
],
),
),
),
);
}
Future getData() async {
Response base =
await NetUtil().dio!.get(API.bracelet.data, queryParameters: {
'imei': 863204050238280,
});
if (base.data != null) {
_model = BraceletModel.fromJson(base.data);
_date = DateTime.now();
}
setState(() {});
}
Container bottomCard() {
var left = Column(
children: [
Row(
children: [
Assets.icons.bloodRessure.image(width: 40.w, height: 40.w),
'血压监督'
.text
.size(26.sp)
.bold
.color(Colors.black.withOpacity(0.85))
.make(),
],
)
],
);
var mid = Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'${_model?.sbp}'
.richText
.withTextSpanChildren([])
.size(48.sp)
.bold
.color(_model!.sbpNormal ? Color(0xFF37C6BD) : Colors.red)
.make(),
8.w.widthBox,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
16.w.heightBox,
' mmhg'
.text
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
Spacer(),
'收缩压'.text.size(22.sp).color(Colors.black.withOpacity(0.65)).make(),
Spacer(),
'90-139'
.text
.size(20.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
],
),
],
);
var right = Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'${_model?.dbp}'
.richText
.withTextSpanChildren([])
.size(48.sp)
.bold
.color(_model!.dbpNormal ? Color(0xFF37C6BD) : Colors.red)
.make(),
8.w.widthBox,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
16.w.heightBox,
' mmhg'
.text
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
Spacer(),
'舒张压'.text.size(22.sp).color(Colors.black.withOpacity(0.65)).make(),
Spacer(),
'60-89'
.text
.size(20.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
],
),
],
);
return Container(
width: double.infinity,
height: 164.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.w),
),
padding: EdgeInsets.symmetric(vertical: 24.w),
child: Row(
children: [
32.w.widthBox,
left,
Spacer(),
mid,
32.w.widthBox,
right,
24.w.widthBox,
],
),
);
}
Column statusCard() {
var heart = Container(
width: 331.w,
height: 204.w,
padding: EdgeInsets.all(24.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Assets.icons.heartbeat.image(width: 40.w, height: 40.w),
8.w.widthBox,
'心率'
.text
.size(26.sp)
.bold
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
Spacer(),
'${_model?.heartRate}'
.richText
.withTextSpanChildren([
' 次/分'
.textSpan
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.make()
])
.size(56.sp)
.bold
.color(_model!.heartNormal ? Color(0xFF37C6BD) : Colors.red)
.make(),
Spacer(),
'正常为60-100次/分'
.text
.size(20.sp)
.color(Colors.black.withOpacity(0.25))
.make()
],
),
);
var fallDown = Container(
width: 331.w,
height: 204.w,
padding: EdgeInsets.all(24.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Assets.icons.falldown.image(width: 40.w, height: 40.w),
8.w.widthBox,
'跌倒次数'
.text
.size(26.sp)
.bold
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
Spacer(),
'${_model?.fallNums}'
.richText
.withTextSpanChildren([
''
.textSpan
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.make()
])
.size(56.sp)
.bold
.color(Colors.red)
.make(),
Spacer(),
'如跌倒会报警至物业后台'
.text
.size(20.sp)
.color(Colors.black.withOpacity(0.25))
.make()
],
),
);
var footSteps = Container(
width: 331.w,
height: 176.w,
padding: EdgeInsets.all(24.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Assets.icons.foot.image(width: 40.w, height: 40.w),
8.w.widthBox,
'今日步数'
.text
.size(26.sp)
.bold
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
Spacer(),
'${_model?.todaySteps}'
.richText
.withTextSpanChildren([
''
.textSpan
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.make()
])
.size(56.sp)
.bold
.color(Color(0xFF37C6BD))
.make(),
],
),
);
var blood = Container(
width: 331.w,
height: 176.w,
padding: EdgeInsets.all(24.w),
decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(16.w)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Assets.icons.oxygen.image(width: 40.w, height: 40.w),
8.w.widthBox,
'血氧饱和度'
.text
.size(26.sp)
.bold
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
Spacer(),
Row(
children: [
'${_model?.bloodOxygen}'
.richText
.withTextSpanChildren([
' %'
.textSpan
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.make()
])
.size(56.sp)
.bold
.color(_model!.bloodOxygen >= 95
? Color(0xFF37C6BD)
: Colors.red)
.make(),
Spacer(),
'正常为95%以上'
.text
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
],
),
],
),
);
return Column(
children: [
Row(
children: [heart, 24.w.widthBox, fallDown],
),
40.w.heightBox,
Row(
children: [footSteps, 24.w.widthBox, blood],
)
],
);
}
Container overview() {
var left = Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'剩余电量'.text.size(28.sp).color(Colors.black.withOpacity(0.65)).make(),
'${_model?.remainingPower}'
.richText
.withTextSpanChildren([
' %'
.textSpan
.size(22.sp)
.color(Colors.black.withOpacity(0.25))
.make(),
])
.size(56.sp)
.bold
.color(Colors.black.withOpacity(0.85))
.make(),
],
),
);
var mid = Expanded(
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'检测天数'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
'${_model?.detectionDays}'
.richText
.withTextSpanChildren([
''
.textSpan
.size(22.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
])
.size(56.sp)
.color(Color(0xFF17928A))
.make()
],
),
),
);
var right = Expanded(
child: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'报警次数'
.text
.size(28.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
'${_model?.alarmNums}'
.richText
.withTextSpanChildren([
''
.textSpan
.size(22.sp)
.color(Colors.black.withOpacity(0.45))
.make(),
])
.size(56.sp)
.color(Color(0xFFF5222D))
.make()
],
),
),
);
return Container(
width: 686.w,
height: 160.w,
padding: EdgeInsets.symmetric(vertical: 26.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.w),
),
child: Row(
children: [
40.w.widthBox,
left,
BeeDivider.vertical(),
mid,
BeeDivider.vertical(),
right
],
),
);
}
}

@ -29,7 +29,6 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
_buildTile(
AO object, {
bool editMode = false,
bool unComplete = false,
}) {
return MaterialButton(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.w)),
@ -39,7 +38,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(object.title)) return;
if (unComplete) {
if (object.page == null) {
BotToast.showText(
text: '正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else {
@ -94,8 +93,7 @@ class _AllApplicationPageState extends State<AllApplicationPage> {
itemBuilder: (context, index) {
return Stack(
children: [
_buildTile(appProvider.myApplications[index],
editMode: _editMode, unComplete: index > 3),
_buildTile(appProvider.myApplications[index], editMode: _editMode),
Positioned(
right: 0,
top: 0,

@ -91,7 +91,7 @@ class _GoodsDetailPageState extends State<GoodsDetailPage> {
_goodsModel = GoodsDetailModel.fromJson(baseModel.data);
} else {
_goodsModel = GoodsDetailModel.fail();
BotToast.showText(text: baseModel.msg ?? '未知错误');
BotToast.showText(text: baseModel.msg);
}
baseModel = await NetUtil().get(API.market.suppliyerHotTop, params: {
"supplierId": _goodsModel.supplierId,

@ -102,12 +102,12 @@ class _GoodsOrderDetailPageState extends State<GoodsOrderDetailPage> {
);
if ((baseModel.success) && !baseModel.msg.isEmptyOrNull) {
bool result = await PayUtil()
.callAliPay(baseModel.msg!, API.pay.shoppingCheck);
.callAliPay(baseModel.msg, API.pay.shoppingCheck);
if (result) {
Get.off(() => PayFinishPage());
}
} else {
BotToast.showText(text: baseModel.msg!);
BotToast.showText(text: baseModel.msg);
}
cancel();
},

@ -1,36 +0,0 @@
class AlarmModel {
String? alarmNo;
String? alarmType;
String? deviceName;
String? deviceNo;
String? time;
int? type;
AlarmModel(
{this.alarmNo,
this.alarmType,
this.deviceName,
this.deviceNo,
this.time,
this.type});
AlarmModel.fromJson(Map<String, dynamic> json) {
alarmNo = json['alarmNo'];
alarmType = json['alarmType'];
deviceName = json['deviceName'];
deviceNo = json['deviceNo'];
time = json['time'];
type = json['type'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['alarmNo'] = this.alarmNo;
data['alarmType'] = this.alarmType;
data['deviceName'] = this.deviceName;
data['deviceNo'] = this.deviceNo;
data['time'] = this.time;
data['type'] = this.type;
return data;
}
}

@ -0,0 +1,24 @@
import 'package:json_annotation/json_annotation.dart';
part 'fall_model.g.dart';
@JsonSerializable()
class FallModel {
final String? userName;
final String? tel;
final String? address;
final num? lon;
final num? lat;
final int? type;
factory FallModel.fromJson(Map<String, dynamic> json) =>
_$FallModelFromJson(json);
const FallModel({
this.userName,
this.tel,
this.address,
this.lon,
this.lat,
this.type,
});
}

@ -0,0 +1,16 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'fall_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
FallModel _$FallModelFromJson(Map<String, dynamic> json) => FallModel(
userName: json['userName'] as String?,
tel: json['tel'] as String?,
address: json['address'] as String?,
lon: json['lon'] as num?,
lat: json['lat'] as num?,
type: json['type'] as int?,
);

@ -0,0 +1,25 @@
import 'package:json_annotation/json_annotation.dart';
part 'fire_model.g.dart';
@JsonSerializable()
class FireModel {
String? alarmNo;
String? alarmType;
String? deviceName;
String? deviceNo;
String? time;
int? type;
factory FireModel.fromJson(Map<String, dynamic> json) =>
_$FireModelFromJson(json);
FireModel({
this.alarmNo,
this.alarmType,
this.deviceName,
this.deviceNo,
this.time,
this.type,
});
}

@ -0,0 +1,16 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'fire_model.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
FireModel _$FireModelFromJson(Map<String, dynamic> json) => FireModel(
alarmNo: json['alarmNo'] as String?,
alarmType: json['alarmType'] as String?,
deviceName: json['deviceName'] as String?,
deviceNo: json['deviceNo'] as String?,
time: json['time'] as String?,
type: json['type'] as int?,
);

@ -1,29 +1,35 @@
import 'dart:convert';
import 'package:aku_new_community/extensions/num_ext.dart';
import 'package:aku_new_community/gen/assets.gen.dart';
import 'package:aku_new_community/pages/tab_navigator.dart';
import 'package:aku_new_community/utils/developer_util.dart';
import 'package:aku_new_community/utils/headers.dart';
import 'package:aku_new_community/utils/websocket/alarm_models/fall_model.dart';
import 'package:aku_new_community/utils/websocket/alarm_models/fire_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'AlarmModel.dart';
class FireDialog {
static fireAlarm(String content) async {
var json = jsonDecode(content);
AlarmModel alarmModel = AlarmModel.fromJson(json);
int type = json['type'] as int;
await Get.dialog(
CupertinoAlertDialog(
title: getImage(alarmModel),
title: getImage(type),
content: Column(
children: [
Text(getTitle(alarmModel)),
Text(
getTitle(type),
style: TextStyle(color: Colors.black, fontSize: 34.sp),
),
10.hb,
Text(getContent(alarmModel)),
Text(
getContent(json, type),
style: TextStyle(color: Colors.black, fontSize: 26.sp),
textAlign: TextAlign.start,
),
],
),
actions: [
@ -44,60 +50,89 @@ class FireDialog {
);
}
static String getTitle(AlarmModel alarmModel) {
switch (alarmModel.type) {
static String getTitle(int type) {
switch (type) {
case 1:
return '发现火灾!请立刻组织疏散人群!';
case 2:
return '设备故障';
case 3:
return '管家端APP报警';
case 4:
return '跌倒报警';
case 5:
return 'SOS紧急联系报警';
default:
return '';
}
}
static String getContent(AlarmModel alarmModel) {
switch (alarmModel.type) {
static String getContent(dynamic json, int type) {
switch (type) {
case 1:
var alarmModel = FireModel.fromJson(json);
return '${alarmModel.time},${alarmModel.deviceName}附近出现了火灾报警,请各位业主、租户保持镇静,不要慌乱,有序开始撤离!';
case 2:
var alarmModel = FireModel.fromJson(json);
return '${alarmModel.time},小区内有设备${alarmModel.deviceName}发生了报警,请物业负责人员尽快前往现场排查故障!';
case 3:
var alarmModel = FireModel.fromJson(json);
return '注意:\n${alarmModel.time},${alarmModel.deviceNo}${alarmModel.deviceName}' +
'在管家端app上点击了"一键报警",请尽快联系他沟通情况。\n' +
'${alarmModel.deviceName}联系方式:${alarmModel.alarmNo}\n' +
'如未能联系到${alarmModel.deviceName}。可择情报警';
case 4:
var alarmModel = FallModel.fromJson(json);
return '注意:\n\n有住户 ${alarmModel.userName} 发生跌倒情况,请及时上门或联系人员前往查看,住户联系方式:${alarmModel.tel}\n\n' +
'跌倒位置————\n${alarmModel.address},经度${alarmModel.lon},纬度${alarmModel.lat}\n\n如未能联系到住户,可择情报警';
case 5:
var alarmModel = FallModel.fromJson(json);
return '注意:\n\n有住户 ${alarmModel.userName} 使用了SOS紧急联系报警请及时上门或联系人员前往查看住户联系方式${alarmModel.tel}\n\n' +
'跌倒位置————\n${alarmModel.address},经度${alarmModel.lon},纬度${alarmModel.lat}\n\n如未能联系到住户,可择情报警';
default:
return '';
}
}
static Widget getImage(AlarmModel alarmModel) {
switch (alarmModel.type) {
static Widget getImage(int type) {
switch (type) {
case 1:
return Image.asset(
R.ASSETS_ICONS_FIRE_ALARM_PNG,
width: 110.w,
height: 110.w,
fit: BoxFit.fill,
fit: BoxFit.fitHeight,
);
case 2:
return Image.asset(
R.ASSETS_ICONS_DEVICE_ALARM_PNG,
width: 110.w,
height: 110.w,
fit: BoxFit.fill,
fit: BoxFit.fitHeight,
);
case 3:
return Image.asset(
R.ASSETS_ICONS_APP_ALARM_PNG,
width: 110.w,
height: 110.w,
fit: BoxFit.fill,
fit: BoxFit.fitHeight,
);
case 4:
return Image.asset(
R.ASSETS_ICONS_APP_ALARM_PNG,
width: 110.w,
height: 110.w,
fit: BoxFit.fitHeight,
);
case 5:
return Image.asset(
Assets.icons.sos.path,
width: 110.w,
height: 110.w,
fit: BoxFit.fitHeight,
);
default:
return SizedBox();
return SizedBox(width: 110.w, height: 110.w);
}
}
}

@ -6,7 +6,7 @@ import 'package:power_logger/power_logger.dart';
import 'package:web_socket_channel/io.dart';
import 'package:web_socket_channel/web_socket_channel.dart';
const String baseUri = 'wss://test.kaidalai.cn/websocket/app';
const String baseUri = 'wss://shop.kaidalai.cn/websocket/app';
enum SOCKETSTATUS {
CONNECTED, //
BREAKOFF, //

@ -19,6 +19,7 @@ class BeeScaffold extends StatelessWidget {
final PreferredSizeWidget? appBarBottom;
final FloatingActionButton? fab;
final double? titleSpacing;
final bool extendBody;
final SystemUiOverlayStyle systemStyle;
@ -35,6 +36,7 @@ class BeeScaffold extends StatelessWidget {
this.fab,
this.titleSpacing,
this.systemStyle = SystemStyle.initial,
this.extendBody = false,
}) : super(key: key);
BeeScaffold.white({
@ -49,6 +51,7 @@ class BeeScaffold extends StatelessWidget {
this.fab,
this.titleSpacing,
this.systemStyle = SystemStyle.initial,
this.extendBody = false,
}) : this.bodyColor = Colors.white,
super(key: key);
@ -64,7 +67,7 @@ class BeeScaffold extends StatelessWidget {
Widget? appBar;
if (title != null)
appBar = AppBar(
backgroundColor: bgColor,
backgroundColor: extendBody ? Colors.transparent : bgColor,
title: _titleWidget,
leading: leading ?? BeeBackButton(),
actions: actions,
@ -77,6 +80,8 @@ class BeeScaffold extends StatelessWidget {
child: Scaffold(
backgroundColor: bodyColor,
appBar: appBar as PreferredSizeWidget?,
extendBodyBehindAppBar: extendBody,
extendBody: extendBody,
body: body,
bottomNavigationBar: bottomNavi,
floatingActionButton: fab,

@ -11,18 +11,18 @@ import 'package:velocity_x/velocity_x.dart';
class ApplicationView extends StatefulWidget {
final List<AO>? items;
final bool needAllApp;
final bool unComplete;
ApplicationView({Key? key, this.needAllApp = true, this.unComplete = false})
: items = null,
ApplicationView({
Key? key,
this.needAllApp = true,
}) : items = null,
super(key: key);
ApplicationView.custom(
{Key? key,
required List<AO> this.items,
this.needAllApp = true,
this.unComplete = false})
: super(key: key);
ApplicationView.custom({
Key? key,
required List<AO> this.items,
this.needAllApp = true,
}) : super(key: key);
@override
_ApplicationViewState createState() => _ApplicationViewState();
@ -36,7 +36,7 @@ class _ApplicationViewState extends State<ApplicationView> {
onPressed: () {
if (LoginUtil.isNotLogin) return;
if (!LoginUtil.haveRoom(object.title)) return;
if (widget.unComplete) {
if (object.page == null) {
BotToast.showText(text: '该功能正在准备上线中,敬请期待', align: Alignment(0, 0.5));
} else {
Get.to(object.page);

Loading…
Cancel
Save