对接 智慧养老手环数据接收

pull/1/head
张萌 3 years ago
parent 0acbfd595e
commit 53ee58cf1c

@ -43,6 +43,7 @@ class SAASAPI {
static _Advice advice = _Advice();
static _Vote vote = _Vote();
static _Facilities facilities = _Facilities();
static _Bracelet bracelet = _Bracelet();
///
static _ProfileApi profile = _ProfileApi();
@ -54,6 +55,11 @@ class _City {
String get allCity => '/app/city/allCity';
}
class _Bracelet {
///
String get data => '/app/user/elderlyCareEquipment/getAqgData';
}
class _User {
///app()
String get sendTelCodeUpdateTel => '/app/user/sendTelCodeUpdateTel';
@ -323,9 +329,9 @@ class _Pay {
///
String get livingExpensesOrderCheckAlipay =>
'/app/user/alipay/livingExpensesOrderCheckAlipay';
///
String get settlement =>
'/app/user/shop/cart/settlement';
String get settlement => '/app/user/shop/cart/settlement';
}
class _LifePay {
@ -358,51 +364,72 @@ class _CommunityIntroduce {
class _ConveniencePhone {
///app便
String get list => '/app/user/conveniencePhone/list';
String get recordAlarmInfo => '/app/user/alarm/insertAlarmRecord';
}
class _CommitteeStaff {
///
String get list => '/app/user/industryCommittee/list';
}
class _Advice{
class _Advice {
///
String get list => '/app/user/advice/list';
////
String get insert => '/app/user/advice/insert';
////id /
String get find => '/app/user/advice/findById';
///
String get reQuestion => '/app/user/advice/reQuestion';
///
String get complete => '/app/user/advice/complete';
///
String get evaluate => '/app/user/advice/evaluate';
////
String get delete => '/app/user/advice/delete';
}
class _Vote{
class _Vote {
///
String get list =>'/app/user/vote/list';
String get list => '/app/user/vote/list';
///
String get vote =>'/app/user/vote/vote';
String get vote => '/app/user/vote/vote';
///
String get details =>'/app/user/vote/details';
String get details => '/app/user/vote/details';
}
class _Facilities{
class _Facilities {
///
String get list =>'/app/user/facilities/list';
String get list => '/app/user/facilities/list';
///
String get categoryList =>'/app/user/facilities/categoryList';
String get categoryList => '/app/user/facilities/categoryList';
///id
String get manageList =>'/app/user/facilities/manageList';
String get manageList => '/app/user/facilities/manageList';
///
String get insert =>'/app/user/facilities/insert';
String get insert => '/app/user/facilities/insert';
///
String get allAppointmentPeriod =>'/app/user/facilities/allAppointmentPeriod';
String get allAppointmentPeriod =>
'/app/user/facilities/allAppointmentPeriod';
///
String get signIn =>'/app/user/facilities/signIn';
String get signIn => '/app/user/facilities/signIn';
///使
String get useStop =>'/app/user/facilities/useStop';
String get useStop => '/app/user/facilities/useStop';
///
String get cancel =>'/app/user/facilities/cancel';
}
String get cancel => '/app/user/facilities/cancel';
}

@ -10,7 +10,7 @@ class BraceletModel {
final int switchType;
final int dbp;
final int heartRate;
final int remainingPower;
final int? remainingPower;
final int detectionDays;
final int alarmNums;
final int fallNums;

@ -14,7 +14,7 @@ BraceletModel _$BraceletModelFromJson(Map<String, dynamic> json) =>
switchType: json['switchType'] as int,
dbp: json['dbp'] as int,
heartRate: json['heartRate'] as int,
remainingPower: json['remainingPower'] as int,
remainingPower: json['remainingPower'] as int?,
detectionDays: json['detectionDays'] as int,
alarmNums: json['alarmNums'] as int,
fallNums: json['fallNums'] as int,

@ -1,3 +1,5 @@
import 'package:aku_new_community/constants/saas_api.dart';
import 'package:aku_new_community/utils/network/base_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
@ -32,7 +34,7 @@ class _OldAgeSupportPageSimpleState extends State<OldAgeSupportPageSimple> {
@override
void initState() {
var cancel = BotToast.showLoading();
// getData();
getData();
cancel();
super.initState();
}
@ -128,8 +130,9 @@ class _OldAgeSupportPageSimpleState extends State<OldAgeSupportPageSimple> {
}
Future getData() async {
Response base =
await NetUtil().dio!.get(API.bracelet.data, queryParameters: {
var cancel = BotToast.showLoading();
BaseModel base =
await NetUtil().get(SAASAPI.bracelet.data, params: {
'imei': 863204050238280,
});
if (base.data != null) {
@ -137,6 +140,7 @@ class _OldAgeSupportPageSimpleState extends State<OldAgeSupportPageSimple> {
_date = DateTime.now();
}
setState(() {});
cancel();
}
Container bottomCard() {
@ -437,7 +441,7 @@ class _OldAgeSupportPageSimpleState extends State<OldAgeSupportPageSimple> {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
'剩余电量'.text.size(28.sp).color(Colors.black.withOpacity(0.65)).make(),
'${_model?.remainingPower}'
'${_model?.remainingPower??0}'
.richText
.withTextSpanChildren([
' %'

Loading…
Cancel
Save