Merge branch 'release' of https://gitee.com/starlock-cn/app-starlock into release
This commit is contained in:
commit
ee97a645f7
@ -59,11 +59,6 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
Get.offNamedUntil(Routers.starLockMain, (Route route) => false);
|
||||||
BlueManage().scanDevices.clear(); //清除设备缓存
|
BlueManage().scanDevices.clear(); //清除设备缓存
|
||||||
// 初始化JPush服务并绑定设备ID
|
|
||||||
final XSJPushProvider jpushProvider = XSJPushProvider();
|
|
||||||
await jpushProvider.initJPushService();
|
|
||||||
await jpushProvider.bindDeviceID();
|
|
||||||
await jpushProvider.initLocalNotification(isCancelLocalPush: false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -111,7 +106,7 @@ class StarLockLoginLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//刷新设备信息
|
//刷新设备信息
|
||||||
void flushedDeviceInfo() {
|
Future<void> flushedDeviceInfo() async {
|
||||||
XSConstantMacro().getDeviceInfoData().then((Map<String, dynamic> data) {
|
XSConstantMacro().getDeviceInfoData().then((Map<String, dynamic> data) {
|
||||||
state.deviceInfoMap.value = data;
|
state.deviceInfoMap.value = data;
|
||||||
}).catchError((dynamic error) {
|
}).catchError((dynamic error) {
|
||||||
|
|||||||
@ -50,16 +50,29 @@ class AddFamilyLogic extends BaseGetXController {
|
|||||||
await ApiRepository.to.updateLockNoticeSettingAccount(
|
await ApiRepository.to.updateLockNoticeSettingAccount(
|
||||||
lockNoticeSettingAccountId: state.familyData.value.id!,
|
lockNoticeSettingAccountId: state.familyData.value.id!,
|
||||||
settingValue: {
|
settingValue: {
|
||||||
'openDoorId': state.familyData.value.settingValue!.openDoorId!,
|
'openDoorId': state.isDetail.value
|
||||||
'openDoorType': state.familyData.value.settingValue!.openDoorType!,
|
? state.lockUserKeys.value.currentOpenDoorID
|
||||||
'remark': state.changeNameController.text,
|
: state.familyData.value.settingValue!.openDoorId!,
|
||||||
|
'openDoorType': state.isDetail.value
|
||||||
|
? state.lockUserKeys.value.currentKeyType
|
||||||
|
: state.familyData.value.settingValue!.openDoorType!,
|
||||||
|
'remark': state.isDetail.value
|
||||||
|
? state.lockUserKeys.value.currentKeyName
|
||||||
|
: state.changeNameController.text,
|
||||||
'noticeWay': state.familyData.value.settingValue!.noticeWayList,
|
'noticeWay': state.familyData.value.settingValue!.noticeWayList,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (entity.errorCode!.codeIsSuccessful) {
|
if (entity.errorCode!.codeIsSuccessful) {
|
||||||
showToast('更新成功'.tr);
|
showToast('更新成功'.tr);
|
||||||
state.lockUserKeys.value.currentKeyName = state.changeNameController.text;
|
if (!state.isDetail.value) {
|
||||||
Get.back(result: true);
|
state.lockUserKeys.value.currentKeyName =
|
||||||
|
state.changeNameController.text;
|
||||||
|
state.lockUserKeys.refresh();
|
||||||
|
|
||||||
|
Get.back(result: true);
|
||||||
|
} else {
|
||||||
|
state.lockUserKeys.refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -48,11 +48,16 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
|
|||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
//锁用户
|
//锁用户
|
||||||
Get.toNamed(Routers.lockUserPage, arguments: <String, int>{
|
Get.toNamed(Routers.lockUserPage, arguments: {
|
||||||
'getLockId': state.getLockId.value
|
'getLockId': state.getLockId.value,
|
||||||
|
'openDoorId': state.openDoorId.value,
|
||||||
})?.then((val) {
|
})?.then((val) {
|
||||||
if (val != null) {
|
if (val != null) {
|
||||||
state.lockUserKeys.value = val;
|
state.lockUserKeys.value = val;
|
||||||
|
|
||||||
|
if (state.isDetail.value) {
|
||||||
|
logic.updateLockNoticeSetting();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
@ -169,7 +174,7 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//修改家人名称弹窗
|
//修改家人名称弹窗
|
||||||
void showCupertinoAlertDialog() {
|
void showCupertinoAlertDialog() {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
@ -179,6 +184,10 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
|
|||||||
'${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}',
|
'${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}',
|
||||||
tipTitle: '请输入'.tr,
|
tipTitle: '请输入'.tr,
|
||||||
controller: state.changeNameController,
|
controller: state.changeNameController,
|
||||||
|
inputFormatters: <TextInputFormatter>[
|
||||||
|
FilteringTextInputFormatter.deny('\n'),
|
||||||
|
LengthLimitingTextInputFormatter(50),
|
||||||
|
],
|
||||||
sureClick: () {
|
sureClick: () {
|
||||||
//发送编辑钥匙名称请求
|
//发送编辑钥匙名称请求
|
||||||
if (state.changeNameController.text.isNotEmpty) {
|
if (state.changeNameController.text.isNotEmpty) {
|
||||||
|
|||||||
@ -4,21 +4,8 @@ import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.d
|
|||||||
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/openDoorNotify/openDoorNotify_entity.dart';
|
||||||
|
|
||||||
class AddFamilyState {
|
class AddFamilyState {
|
||||||
final TextEditingController changeNameController = TextEditingController();
|
|
||||||
RxInt getLockId = 0.obs;
|
|
||||||
Rx<LockUserListKeys> lockUserKeys = LockUserListKeys().obs;
|
|
||||||
RxList emailReceiverList = [].obs;
|
|
||||||
var phoneReceiverList = [].obs;
|
|
||||||
var emailListStr = ''.obs;
|
|
||||||
var phontListStr = ''.obs;
|
|
||||||
|
|
||||||
var openDoorId = 0.obs;
|
|
||||||
var openDoorType = 0.obs;
|
|
||||||
var familyData = DataList().obs;
|
|
||||||
var isDetail = false.obs;
|
|
||||||
|
|
||||||
AddFamilyState() {
|
AddFamilyState() {
|
||||||
Map map = Get.arguments;
|
final Map map = Get.arguments;
|
||||||
if (map['lockId'] != null) {
|
if (map['lockId'] != null) {
|
||||||
getLockId.value = map['lockId'];
|
getLockId.value = map['lockId'];
|
||||||
}
|
}
|
||||||
@ -31,6 +18,19 @@ class AddFamilyState {
|
|||||||
familyData.value = map['itemData'];
|
familyData.value = map['itemData'];
|
||||||
lockUserKeys.value.currentKeyName =
|
lockUserKeys.value.currentKeyName =
|
||||||
familyData.value.settingValue!.remark!;
|
familyData.value.settingValue!.remark!;
|
||||||
|
openDoorId.value = familyData.value.settingValue!.openDoorId!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
final TextEditingController changeNameController = TextEditingController();
|
||||||
|
RxInt getLockId = 0.obs;
|
||||||
|
Rx<LockUserListKeys> lockUserKeys = LockUserListKeys().obs;
|
||||||
|
RxList emailReceiverList = [].obs;
|
||||||
|
RxList phoneReceiverList = [].obs;
|
||||||
|
RxString emailListStr = ''.obs;
|
||||||
|
RxString phontListStr = ''.obs;
|
||||||
|
|
||||||
|
RxInt openDoorId = 0.obs;
|
||||||
|
RxInt openDoorType = 0.obs;
|
||||||
|
Rx<DataList> familyData = DataList().obs;
|
||||||
|
RxBool isDetail = false.obs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import 'package:get/get.dart';
|
|||||||
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
import 'package:star_lock/common/XSConstantMacro/XSConstantMacro.dart';
|
||||||
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
|
||||||
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_state.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_state.dart';
|
||||||
|
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
|
||||||
import 'package:star_lock/network/api_repository.dart';
|
import 'package:star_lock/network/api_repository.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
import 'package:star_lock/tools/dateTool.dart';
|
import 'package:star_lock/tools/dateTool.dart';
|
||||||
@ -73,6 +74,17 @@ class LockUserLogic extends BaseGetXController {
|
|||||||
state.lockUserList.addAll(data5.lockUserList!);
|
state.lockUserList.addAll(data5.lockUserList!);
|
||||||
|
|
||||||
state.lockUserList.refresh();
|
state.lockUserList.refresh();
|
||||||
|
|
||||||
|
if (state.selectedOpenDoorId.value != null) {
|
||||||
|
for (int i = 0; i < state.lockUserList.length; i++) {
|
||||||
|
if (state.lockUserList[i].currentOpenDoorID ==
|
||||||
|
state.selectedOpenDoorId.value) {
|
||||||
|
state.isSelectIndex.value = i;
|
||||||
|
state.isSelectIndex.refresh();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class _LockUserPageState extends State<LockUserPage> {
|
|||||||
final LockUserState state = Get.find<LockUserLogic>().state;
|
final LockUserState state = Get.find<LockUserLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
logic.getLockKeysList();
|
logic.getLockKeysList();
|
||||||
@ -86,7 +86,7 @@ class _LockUserPageState extends State<LockUserPage> {
|
|||||||
if (selectIndex == i) {
|
if (selectIndex == i) {
|
||||||
item.isCurrentSelect = true;
|
item.isCurrentSelect = true;
|
||||||
} else {
|
} else {
|
||||||
item.isCurrentSelect = true;
|
item.isCurrentSelect = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -144,13 +144,13 @@ class _LockUserPageState extends State<LockUserPage> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Image.asset(
|
Obx(() => Image.asset(
|
||||||
state.isSelectIndex.value == selectIndex
|
state.isSelectIndex.value == selectIndex
|
||||||
? 'images/icon_round_select.png'
|
? 'images/icon_round_select.png'
|
||||||
: 'images/icon_round_unSelect.png',
|
: 'images/icon_round_unSelect.png',
|
||||||
width: 30.w,
|
width: 30.w,
|
||||||
height: 30.w,
|
height: 30.w,
|
||||||
),
|
)),
|
||||||
SizedBox(width: 20.h),
|
SizedBox(width: 20.h),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -3,17 +3,21 @@ import 'package:get/get.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
|
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
|
||||||
|
|
||||||
class LockUserState {
|
class LockUserState {
|
||||||
TextEditingController searchController = TextEditingController(); //邮箱/手机号输入框
|
//锁所有用户列表
|
||||||
var isSelectUser = false.obs;
|
|
||||||
var isSelectIndex = 0.obs;
|
|
||||||
|
|
||||||
var getLockId = 0.obs;
|
|
||||||
var lockUserList = <LockUserListKeys>[].obs; //锁所有用户列表
|
|
||||||
|
|
||||||
LockUserState() {
|
LockUserState() {
|
||||||
Map map = Get.arguments;
|
final Map map = Get.arguments;
|
||||||
if (map['getLockId'] != null) {
|
if (map['getLockId'] != null) {
|
||||||
getLockId.value = map['getLockId'];
|
getLockId.value = map['getLockId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selectedOpenDoorId.value = map['openDoorId'];
|
||||||
}
|
}
|
||||||
|
TextEditingController searchController = TextEditingController(); //邮箱/手机号输入框
|
||||||
|
RxBool isSelectUser = false.obs;
|
||||||
|
RxInt selectedOpenDoorId = 0.obs;
|
||||||
|
RxInt isSelectIndex = 0.obs;
|
||||||
|
|
||||||
|
RxInt getLockId = 0.obs;
|
||||||
|
RxList<LockUserListKeys> lockUserList = <LockUserListKeys>[].obs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,57 +24,60 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
logic.lockNoticeSettingAccountList();
|
logic.lockNoticeSettingAccountList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: '家人到家'.tr,
|
barTitle: '家人到家'.tr,
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
_topTipsWidget(),
|
_topTipsWidget(),
|
||||||
SizedBox(
|
SizedBox(height: 20.h),
|
||||||
height: 20.h,
|
Expanded(
|
||||||
|
child: Obx(
|
||||||
|
() => state.openDoorNotifyList.value.isNotEmpty
|
||||||
|
? _buildMainUI()
|
||||||
|
: NoData(),
|
||||||
),
|
),
|
||||||
Expanded(
|
),
|
||||||
child: Obx(() => state.openDoorNotifyList.value.isNotEmpty
|
AddBottomWhiteBtn(
|
||||||
? _buildMainUI()
|
btnName: '添加家人'.tr,
|
||||||
: NoData())),
|
onClick: () {
|
||||||
AddBottomWhiteBtn(
|
Get.toNamed(Routers.addFamilyPage, arguments: {
|
||||||
btnName: '添加家人'.tr,
|
'lockId': state.getLockId.value,
|
||||||
onClick: () {
|
'isDetail': false,
|
||||||
Get.toNamed(Routers.addFamilyPage, arguments: {
|
})?.then((value) {
|
||||||
'lockId': state.getLockId.value,
|
if (value != null) {
|
||||||
'isDetail': false
|
logic.lockNoticeSettingAccountList();
|
||||||
})?.then((value) {
|
}
|
||||||
if (value != null) {
|
});
|
||||||
logic.lockNoticeSettingAccountList();
|
},
|
||||||
}
|
),
|
||||||
});
|
SizedBox(height: 64.h),
|
||||||
},
|
],
|
||||||
),
|
),
|
||||||
SizedBox(
|
);
|
||||||
height: 64.h,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _topTipsWidget() {
|
Widget _topTipsWidget() {
|
||||||
return Container(
|
return Container(
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
||||||
child: Text(
|
child: Text(
|
||||||
'若锁没有联网,除电子钥匙外,密码、卡、指纹等开门提醒无法及时发送,请根据你的实际情况选择。'.tr,
|
'若锁没有联网,除电子钥匙外,密码、卡、指纹等开门提醒无法及时发送,请根据你的实际情况选择。'.tr,
|
||||||
style: TextStyle(color: AppColors.darkGrayTextColor, fontSize: 20.sp),
|
style: TextStyle(
|
||||||
));
|
color: AppColors.darkGrayTextColor,
|
||||||
|
fontSize: 20.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMainUI() {
|
Widget _buildMainUI() {
|
||||||
@ -99,11 +102,9 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
|
|||||||
Get.toNamed(Routers.addFamilyPage, arguments: {
|
Get.toNamed(Routers.addFamilyPage, arguments: {
|
||||||
'itemData': itemData,
|
'itemData': itemData,
|
||||||
'lockId': state.getLockId.value,
|
'lockId': state.getLockId.value,
|
||||||
'isDetail': true
|
'isDetail': true,
|
||||||
})?.then((value) {
|
})?.then((value) {
|
||||||
if (value != null) {
|
logic.lockNoticeSettingAccountList();
|
||||||
logic.lockNoticeSettingAccountList();
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -111,33 +112,30 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
|
|||||||
height: 90.h,
|
height: 90.h,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
SizedBox(
|
SizedBox(width: 30.w),
|
||||||
width: 30.w,
|
|
||||||
),
|
|
||||||
Image.asset(
|
Image.asset(
|
||||||
'images/controls_user.png',
|
'images/controls_user.png',
|
||||||
width: 60.w,
|
width: 60.w,
|
||||||
height: 60.w,
|
height: 60.w,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(width: 20.w),
|
||||||
width: 20.w,
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Text(
|
|
||||||
itemData.settingValue!.remark ?? '',
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 24.sp, color: AppColors.blackColor),
|
|
||||||
),
|
|
||||||
SizedBox(width: 10.w),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SizedBox(
|
child: Text(
|
||||||
width: 20.w,
|
itemData.settingValue!.remark ?? '',
|
||||||
))
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp,
|
||||||
|
color: AppColors.blackColor,
|
||||||
|
),
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
@ -147,8 +145,9 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
|
|||||||
Text(
|
Text(
|
||||||
logic.getKeyTypeStr(itemData),
|
logic.getKeyTypeStr(itemData),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 18.sp,
|
fontSize: 18.sp,
|
||||||
color: AppColors.placeholderTextColor),
|
color: AppColors.placeholderTextColor,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -135,6 +135,7 @@ class LockListLogic extends BaseGetXController {
|
|||||||
String getKeyEffective(LockListInfoItemEntity keyInfo) {
|
String getKeyEffective(LockListInfoItemEntity keyInfo) {
|
||||||
// 当是限时、循环的时候
|
// 当是限时、循环的时候
|
||||||
if (keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
if (keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
||||||
|
keyInfo.keyType == XSConstantMacro.keyTypeLong ||
|
||||||
keyInfo.keyType == XSConstantMacro.keyTypeLoop) {
|
keyInfo.keyType == XSConstantMacro.keyTypeLoop) {
|
||||||
// 当是正常使用跟待接收状态的时候
|
// 当是正常使用跟待接收状态的时候
|
||||||
if (keyInfo.keyStatus == XSConstantMacro.keyStatusNormalUse ||
|
if (keyInfo.keyStatus == XSConstantMacro.keyStatusNormalUse ||
|
||||||
@ -158,6 +159,11 @@ class LockListLogic extends BaseGetXController {
|
|||||||
XSConstantMacro.keyStatusFrozen,
|
XSConstantMacro.keyStatusFrozen,
|
||||||
XSConstantMacro.keyStatusExpired,
|
XSConstantMacro.keyStatusExpired,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
//新增以上组合未包含--永久&&冻结状态 显示
|
||||||
|
final bool isLongFrozenStatus =
|
||||||
|
keyInfo.keyType == XSConstantMacro.keyTypeLong &&
|
||||||
|
keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen;
|
||||||
final DateTime endDate =
|
final DateTime endDate =
|
||||||
DateTime.fromMillisecondsSinceEpoch(keyInfo.endDate ?? 0);
|
DateTime.fromMillisecondsSinceEpoch(keyInfo.endDate ?? 0);
|
||||||
final DateTime now = DateTime.now();
|
final DateTime now = DateTime.now();
|
||||||
@ -165,7 +171,8 @@ class LockListLogic extends BaseGetXController {
|
|||||||
final bool isKeyStatus = keyStatus.contains(keyInfo.keyStatus);
|
final bool isKeyStatus = keyStatus.contains(keyInfo.keyStatus);
|
||||||
final Duration difference = endDate.difference(now);
|
final Duration difference = endDate.difference(now);
|
||||||
final bool isExpirationSoon = isKeyType && difference.inDays <= 15;
|
final bool isExpirationSoon = isKeyType && difference.inDays <= 15;
|
||||||
final bool isShow = isKeyType && isKeyStatus || isExpirationSoon;
|
final bool isShow =
|
||||||
|
isKeyType && isKeyStatus || isExpirationSoon || isLongFrozenStatus;
|
||||||
return isShow;
|
return isShow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -110,6 +110,7 @@ class _LockListPageState extends State<LockListPage> with RouteAware {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
if ((keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
||||||
|
keyInfo.keyType == XSConstantMacro.keyTypeLong ||
|
||||||
keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
|
keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
|
||||||
(keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen)) {
|
(keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen)) {
|
||||||
logic.showToast('您的钥匙已冻结'.tr);
|
logic.showToast('您的钥匙已冻结'.tr);
|
||||||
@ -143,12 +144,16 @@ class _LockListPageState extends State<LockListPage> with RouteAware {
|
|||||||
? EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w, bottom: 20.w)
|
? EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w, bottom: 20.w)
|
||||||
: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ((keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
color: (((keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
||||||
keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
|
keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
|
||||||
(keyInfo.keyStatus ==
|
(keyInfo.keyStatus ==
|
||||||
XSConstantMacro.keyStatusWaitIneffective ||
|
XSConstantMacro.keyStatusWaitIneffective ||
|
||||||
keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen ||
|
keyInfo.keyStatus ==
|
||||||
keyInfo.keyStatus == XSConstantMacro.keyStatusExpired))
|
XSConstantMacro.keyStatusFrozen ||
|
||||||
|
keyInfo.keyStatus ==
|
||||||
|
XSConstantMacro.keyStatusExpired)) ||
|
||||||
|
(keyInfo.keyType == XSConstantMacro.keyTypeLong &&
|
||||||
|
keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen))
|
||||||
? AppColors.greyBackgroundColor
|
? AppColors.greyBackgroundColor
|
||||||
: Colors.white,
|
: Colors.white,
|
||||||
borderRadius: BorderRadius.circular(20.w),
|
borderRadius: BorderRadius.circular(20.w),
|
||||||
|
|||||||
@ -209,6 +209,7 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
if ((keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
||||||
|
keyInfo.keyType == XSConstantMacro.keyTypeLong ||
|
||||||
keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
|
keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
|
||||||
(keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen)) {
|
(keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen)) {
|
||||||
logic.showToast('您的钥匙已冻结'.tr);
|
logic.showToast('您的钥匙已冻结'.tr);
|
||||||
@ -255,12 +256,16 @@ class _LockListXHJPageState extends State<LockListXHJPage> with RouteAware {
|
|||||||
onTap: action,
|
onTap: action,
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: ((keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
color: (((keyInfo.keyType == XSConstantMacro.keyTypeTime ||
|
||||||
keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
|
keyInfo.keyType == XSConstantMacro.keyTypeLoop) &&
|
||||||
(keyInfo.keyStatus ==
|
(keyInfo.keyStatus ==
|
||||||
XSConstantMacro.keyStatusWaitIneffective ||
|
XSConstantMacro.keyStatusWaitIneffective ||
|
||||||
keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen ||
|
keyInfo.keyStatus ==
|
||||||
keyInfo.keyStatus == XSConstantMacro.keyStatusExpired))
|
XSConstantMacro.keyStatusFrozen ||
|
||||||
|
keyInfo.keyStatus ==
|
||||||
|
XSConstantMacro.keyStatusExpired)) ||
|
||||||
|
(keyInfo.keyType == XSConstantMacro.keyTypeLong &&
|
||||||
|
keyInfo.keyStatus == XSConstantMacro.keyStatusFrozen))
|
||||||
? AppColors.greyBackgroundColor
|
? AppColors.greyBackgroundColor
|
||||||
: Colors.white.withOpacity(0.8),
|
: Colors.white.withOpacity(0.8),
|
||||||
borderRadius: BorderRadius.circular(20.w),
|
borderRadius: BorderRadius.circular(20.w),
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import 'package:star_lock/flavors.dart';
|
|||||||
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_logic.dart';
|
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_logic.dart';
|
||||||
import 'package:star_lock/main/lockMian/lockList/lockList_logic.dart';
|
import 'package:star_lock/main/lockMian/lockList/lockList_logic.dart';
|
||||||
import 'package:star_lock/tools/eventBusEventManage.dart';
|
import 'package:star_lock/tools/eventBusEventManage.dart';
|
||||||
|
import 'package:star_lock/tools/push/xs_jPhush.dart';
|
||||||
import 'package:star_lock/tools/showTipView.dart';
|
import 'package:star_lock/tools/showTipView.dart';
|
||||||
|
|
||||||
import '../../../app_settings/app_settings.dart';
|
import '../../../app_settings/app_settings.dart';
|
||||||
@ -267,8 +268,14 @@ class LockMainLogic extends BaseGetXController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
Future<void> onReady() async {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
// 初始化JPush服务并绑定设备ID
|
||||||
|
final XSJPushProvider jpushProvider = XSJPushProvider();
|
||||||
|
await jpushProvider.initJPushService();
|
||||||
|
await jpushProvider.bindDeviceID();
|
||||||
|
await jpushProvider.initLocalNotification(isCancelLocalPush: false);
|
||||||
|
|
||||||
// 开启UDP
|
// 开启UDP
|
||||||
UdpHelp().openUDP();
|
UdpHelp().openUDP();
|
||||||
BlueManage();
|
BlueManage();
|
||||||
|
|||||||
@ -69,7 +69,13 @@ class XSJPushProvider {
|
|||||||
Future<void> bindDeviceID() async {
|
Future<void> bindDeviceID() async {
|
||||||
try {
|
try {
|
||||||
AppLog.log('Fetching registration ID...');
|
AppLog.log('Fetching registration ID...');
|
||||||
final String rid = await jpush.getRegistrationID();
|
String rid;
|
||||||
|
rid = await jpush.getRegistrationID();
|
||||||
|
if (rid.isEmpty) {
|
||||||
|
AppLog.log('Registration ID is empty.');
|
||||||
|
rid = await jpush.getRegistrationID();
|
||||||
|
return;
|
||||||
|
}
|
||||||
AppLog.log('flutter get registration id : $rid');
|
AppLog.log('flutter get registration id : $rid');
|
||||||
await Storage.setString(pushDeviceID, rid);
|
await Storage.setString(pushDeviceID, rid);
|
||||||
await pushBindDeviceID(rid, Platform.isAndroid ? 10 : 20);
|
await pushBindDeviceID(rid, Platform.isAndroid ? 10 : 20);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user