diff --git a/lib/constants/saas_api.dart b/lib/constants/saas_api.dart index 614fd26b..1cf4f042 100644 --- a/lib/constants/saas_api.dart +++ b/lib/constants/saas_api.dart @@ -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'; -} \ No newline at end of file + String get cancel => '/app/user/facilities/cancel'; +} diff --git a/lib/models/bracelet/bracelet_model.dart b/lib/models/bracelet/bracelet_model.dart index 052aab2d..54981cc6 100644 --- a/lib/models/bracelet/bracelet_model.dart +++ b/lib/models/bracelet/bracelet_model.dart @@ -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; diff --git a/lib/models/bracelet/bracelet_model.g.dart b/lib/models/bracelet/bracelet_model.g.dart index c53c1495..a85caa3d 100644 --- a/lib/models/bracelet/bracelet_model.g.dart +++ b/lib/models/bracelet/bracelet_model.g.dart @@ -14,7 +14,7 @@ BraceletModel _$BraceletModelFromJson(Map 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, diff --git a/lib/pages/services/old_age/old_age_support_page_simple.dart b/lib/pages/services/old_age/old_age_support_page_simple.dart index 7dee08e2..56c9d837 100644 --- a/lib/pages/services/old_age/old_age_support_page_simple.dart +++ b/lib/pages/services/old_age/old_age_support_page_simple.dart @@ -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 { @override void initState() { var cancel = BotToast.showLoading(); - // getData(); + getData(); cancel(); super.initState(); } @@ -128,8 +130,9 @@ class _OldAgeSupportPageSimpleState extends State { } 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 { _date = DateTime.now(); } setState(() {}); + cancel(); } Container bottomCard() { @@ -437,7 +441,7 @@ class _OldAgeSupportPageSimpleState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ '剩余电量'.text.size(28.sp).color(Colors.black.withOpacity(0.65)).make(), - '${_model?.remainingPower}' + '${_model?.remainingPower??0}' .richText .withTextSpanChildren([ ' %'