Merge branch 'release' of gitee.com:starlock-cn/app-starlock into release

This commit is contained in:
Daisy 2024-06-17 17:17:11 +08:00
commit 062c5c0397
8 changed files with 151 additions and 135 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -198,6 +198,18 @@ android {
} }
buildTypes { buildTypes {
debug {
// release编译模式下应用闪退[Debug模式下运行正常但是打Release包时则闪退解决办法](https://blog.csdn.net/weixin_39370093/article/details/109631210)
// release模式设置混淆可以解决地图闪退问题
//
minifyEnabled false
shrinkResources false
productFlavors.local.signingConfig signingConfigs.debug
productFlavors.dev.signingConfig signingConfigs.debug
productFlavors.pre.signingConfig signingConfigs.debug
productFlavors.sky.signingConfig signingConfigs.sky
productFlavors.xhj.signingConfig signingConfigs.xhj
}
release { release {
// release编译模式下应用闪退[Debug模式下运行正常但是打Release包时则闪退解决办法](https://blog.csdn.net/weixin_39370093/article/details/109631210) // release编译模式下应用闪退[Debug模式下运行正常但是打Release包时则闪退解决办法](https://blog.csdn.net/weixin_39370093/article/details/109631210)
// release模式设置混淆可以解决地图闪退问题 // release模式设置混淆可以解决地图闪退问题

View File

@ -179,6 +179,7 @@ class LockDetailLogic extends BaseGetXController {
Future<void> loadData({ required LockListInfoItemEntity lockListInfoItemEntity,required bool isOnlyOneData}) async { Future<void> loadData({ required LockListInfoItemEntity lockListInfoItemEntity,required bool isOnlyOneData}) async {
state.keyInfos.value = lockListInfoItemEntity; state.keyInfos.value = lockListInfoItemEntity;
CommonDataManage().currentLockUserNo = state.keyInfos.value.lockUserNo!; CommonDataManage().currentLockUserNo = state.keyInfos.value.lockUserNo!;
CommonDataManage().initUserNo = state.keyInfos.value.initUserNo!;
CommonDataManage().currentKeyInfo = state.keyInfos.value; CommonDataManage().currentKeyInfo = state.keyInfos.value;
state.lockUserNo = state.keyInfos.value.lockUserNo!; state.lockUserNo = state.keyInfos.value.lockUserNo!;

View File

@ -1,6 +1,7 @@
import 'dart:async'; import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
@ -60,6 +61,9 @@ class _LockDetailPageState extends State<LockDetailPage>
_initRefreshLockDetailInfoDataEventAction(); _initRefreshLockDetailInfoDataEventAction();
logic.initReplySubscription(); logic.initReplySubscription();
logic.initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction(); logic.initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction();
logic.loadData(
lockListInfoItemEntity: widget.lockListInfoItemEntity,
isOnlyOneData: widget.isOnlyOneData);
} }
@override @override
@ -82,69 +86,8 @@ class _LockDetailPageState extends State<LockDetailPage>
}); });
} }
Future<void> loadData() async {
state.keyInfos.value = widget.lockListInfoItemEntity;
CommonDataManage().currentLockUserNo = state.keyInfos.value.lockUserNo!;
CommonDataManage().initUserNo = state.keyInfos.value.initUserNo!;
CommonDataManage().currentKeyInfo = state.keyInfos.value;
state.lockUserNo = state.keyInfos.value.lockUserNo!;
if (state.keyInfos.value.keyStatus ==
XSConstantMacro.keyStatusWaitIneffective ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusFrozen ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusExpired ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusDeleted ||
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusReset) {
state.openDoorBtnisUneable.value = false;
state.bottomBtnisEable.value = false;
} else {
state.openDoorBtnisUneable.value = true;
state.bottomBtnisEable.value = true;
}
state.isOnlyOneData = widget.isOnlyOneData;
state.senderUserId = state.keyInfos.value.senderUserId!;
state.isAttendance.value = state.keyInfos.value.lockSetting!.attendance!;
state.isOpenLockNeedOnline.value =
state.keyInfos.value.lockSetting!.appUnlockOnline!;
state.electricQuantity.value = state.keyInfos.value.electricQuantity!;
state.isOpenPassageMode.value = state.keyInfos.value.passageMode!;
state.lockAlias.value = state.keyInfos.value.lockAlias!;
Storage.setString(saveLockAlias, state.lockAlias.value);
BlueManage().connectDeviceName =
state.keyInfos.value.bluetooth!.bluetoothDeviceName!;
final List<int> publicKeyData =
state.keyInfos.value.bluetooth!.publicKey!.cast<int>();
final List<String> saveStrList = changeIntListToStringList(publicKeyData);
Storage.setStringList(saveBluePublicKey, saveStrList);
//
final List<int> privateKeyData =
state.keyInfos.value.bluetooth!.privateKey!.cast<int>();
final List<String> savePrivateKeyList =
changeIntListToStringList(privateKeyData);
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
// signKey
final List<int> signKeyData =
state.keyInfos.value.bluetooth!.signKey!.cast<int>();
final List<String> saveSignKeyList = changeIntListToStringList(signKeyData);
Storage.setStringList(saveBlueSignKey, saveSignKeyList);
final bool ifHaveKey = await Storage.ifHaveKey(saveBlueToken);
if (!ifHaveKey) {
final List<String> saveTokenList =
changeIntListToStringList(<int>[0, 0, 0, 0]);
Storage.setStringList(saveBlueToken, saveTokenList);
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
loadData();
return F.sw(skyCall: skWidget, xhjCall: xhjWidget); return F.sw(skyCall: skWidget, xhjCall: xhjWidget);
} }
@ -156,35 +99,50 @@ class _LockDetailPageState extends State<LockDetailPage>
final String lockAlias = state.keyInfos.value.lockAlias!; final String lockAlias = state.keyInfos.value.lockAlias!;
return Stack( return Stack(
children: <Widget>[ children: <Widget>[
Column( SingleChildScrollView(
children: <Widget>[ child: Column(
SizedBox( children: <Widget>[
height: 15.h, SizedBox(
), height: 15.h,
Padding(
padding: EdgeInsets.symmetric(horizontal: 24.w),
child: Text(
lockAlias,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 24.sp, color: Colors.black),
), ),
), Padding(
SizedBox( padding: EdgeInsets.symmetric(horizontal: 24.w),
height: 35.h, child: Text(
), lockAlias,
xhjInfoView(), textAlign: TextAlign.center,
SizedBox( style: TextStyle(fontSize: 24.sp, color: Colors.black),
height: 35.h, ),
), ),
labelText('images/icon_slider_horizontal.png', '功能'.tr, () { SizedBox(
Get.to(LockDetailListPage( height: 35.h,
title: '功能'.tr, items: getBottomWidget())); ),
}), xhjInfoView(),
labelText('images/icon_puzzlepiece_extension.png', '配件'.tr, () { SizedBox(
Get.to(LockDetailListPage( height: 35.h,
title: '配件'.tr, items: getAttachmentWidget())); ),
}), labelText(
], img: 'images/icon_slider_horizontal.png',
text: '功能'.tr,
child: bottomWidget()),
labelText(
img: 'images/icon_puzzlepiece_extension.png',
text: '配件'.tr,
child: attachmentWidget()),
btnText(
img: 'images/main/icon_main_set.png',
text: TranslationLoader.lanKeys!.set!.tr,
onTap: () {
if (state.openDoorBtnisUneable.value == false) {
return;
}
Get.toNamed(Routers.lockSetPage,
arguments: <String, Object?>{
'lockId': state.keyInfos.value.lockId,
'isOnlyOneData': state.isOnlyOneData
});
}),
],
),
), ),
Visibility( Visibility(
visible: state.iSClosedUnlockSuccessfulPopup.value, visible: state.iSClosedUnlockSuccessfulPopup.value,
@ -200,7 +158,8 @@ class _LockDetailPageState extends State<LockDetailPage>
); );
} }
Widget labelText(String img, String text, var onTap) { Widget btnText(
{required String img, required String text, required var onTap}) {
return GestureDetector( return GestureDetector(
onTap: onTap, onTap: onTap,
child: Container( child: Container(
@ -213,16 +172,19 @@ class _LockDetailPageState extends State<LockDetailPage>
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.15), color: Colors.black.withOpacity(0.15),
offset: const Offset(0, 0), offset: const Offset(0, 0),
blurRadius: 10.r, blurRadius: 5.r,
spreadRadius: 0, spreadRadius: 0,
), ),
]), ]),
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Image.asset( FlavorsImg(
img, black: true,
width: 32.r, child: Image.asset(
height: 32.r, img,
width: 32.r,
height: 32.r,
),
), ),
SizedBox( SizedBox(
width: 15.w, width: 15.w,
@ -242,6 +204,49 @@ class _LockDetailPageState extends State<LockDetailPage>
); );
} }
Widget labelText(
{required String img, required String text, required Widget child}) {
return Container(
margin: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 15.h),
padding: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 20.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(16.r),
boxShadow: <BoxShadow>[
BoxShadow(
color: Colors.black.withOpacity(0.15),
offset: const Offset(0, 0),
blurRadius: 5.r,
spreadRadius: 0,
),
]),
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Image.asset(
img,
width: 32.r,
height: 32.r,
),
SizedBox(
width: 15.w,
),
Text(
text,
style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor),
),
],
),
SizedBox(
height: 18.h,
),
child,
],
),
);
}
Widget xhjInfoView() { Widget xhjInfoView() {
return Container( return Container(
width: 0.9.sw, width: 0.9.sw,
@ -355,7 +360,7 @@ class _LockDetailPageState extends State<LockDetailPage>
BoxShadow( BoxShadow(
color: Colors.black.withOpacity(0.3), color: Colors.black.withOpacity(0.3),
offset: const Offset(0, 0), offset: const Offset(0, 0),
blurRadius: 10.r, blurRadius: 15.r,
spreadRadius: 0, spreadRadius: 0,
), ),
]), ]),
@ -897,6 +902,7 @@ class _LockDetailPageState extends State<LockDetailPage>
// childAspectRatio: 3, // childAspectRatio: 3,
crossAxisSpacing: 20.w, crossAxisSpacing: 20.w,
mainAxisSpacing: 0.h, mainAxisSpacing: 0.h,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
children: getAttachmentWidget()), children: getAttachmentWidget()),
); );
@ -941,7 +947,8 @@ class _LockDetailPageState extends State<LockDetailPage>
crossAxisCount: 4, crossAxisCount: 4,
// childAspectRatio: 3, // childAspectRatio: 3,
crossAxisSpacing: 25.h, crossAxisSpacing: 25.h,
mainAxisSpacing: 0.h, mainAxisSpacing: 5.h,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
children: getBottomWidget()), children: getBottomWidget()),
); );
@ -983,13 +990,15 @@ class _LockDetailPageState extends State<LockDetailPage>
})); }));
// //
showWidgetArr.add(bottomItem('images/main/icon_main_set.png', if (F.isSKY) {
TranslationLoader.lanKeys!.set!.tr, true, () { showWidgetArr.add(bottomItem('images/main/icon_main_set.png',
Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{ TranslationLoader.lanKeys!.set!.tr, true, () {
'lockId': state.keyInfos.value.lockId, Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{
'isOnlyOneData': state.isOnlyOneData 'lockId': state.keyInfos.value.lockId,
}); 'isOnlyOneData': state.isOnlyOneData
})); });
}));
}
return showWidgetArr; return showWidgetArr;
} }
@ -1167,17 +1176,19 @@ class _LockDetailPageState extends State<LockDetailPage>
}), }),
); );
endWiddget.add( if (F.isSKY) {
// endWiddget.add(
bottomItem('images/main/icon_main_set.png', //
TranslationLoader.lanKeys!.set!.tr, true, () { bottomItem('images/main/icon_main_set.png',
// logic.clickItemBtnAction(10); TranslationLoader.lanKeys!.set!.tr, true, () {
Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{ // logic.clickItemBtnAction(10);
'lockId': state.keyInfos.value.lockId, Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{
'isOnlyOneData': state.isOnlyOneData, 'lockId': state.keyInfos.value.lockId,
}); 'isOnlyOneData': state.isOnlyOneData,
}), });
); }),
);
}
showWidgetArr.addAll(endWiddget); showWidgetArr.addAll(endWiddget);
return showWidgetArr; return showWidgetArr;
} }
@ -1219,13 +1230,13 @@ class _LockDetailPageState extends State<LockDetailPage>
xhjCall: () => Container( xhjCall: () => Container(
color: Colors.white, color: Colors.white,
margin: EdgeInsets.symmetric(vertical: 5.h), margin: EdgeInsets.symmetric(vertical: 5.h),
padding: EdgeInsets.symmetric(vertical: 15.h, horizontal: 15.w), child: Column(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
width: 42.w, width: 42.w,
height: 42.h, height: 42.w,
child: FlavorsImg( child: FlavorsImg(
black: true, black: true,
child: Image.asset(iconUrl, child: Image.asset(iconUrl,
@ -1237,7 +1248,7 @@ class _LockDetailPageState extends State<LockDetailPage>
fit: BoxFit.fitWidth), fit: BoxFit.fitWidth),
), ),
), ),
SizedBox(width: 20.w), SizedBox(height: 20.h),
Text( Text(
name, name,
style: TextStyle( style: TextStyle(

View File

@ -569,15 +569,10 @@ class LockSetLogic extends BaseGetXController {
); );
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
BlueManage().connectDeviceMacAddress = ''; BlueManage().connectDeviceMacAddress = '';
final bool isXHJ = F.isXHJ;
final bool isOnlyOneData = state.isOnlyOneData.value == true; final bool isOnlyOneData = state.isOnlyOneData.value == true;
await Future<dynamic>.delayed(const Duration(milliseconds: 200)) await Future<dynamic>.delayed(const Duration(milliseconds: 200))
.then((e) { .then((e) {
if (isXHJ) { Get.close(isOnlyOneData ? 1 : 2);
Get.close(3);
} else {
Get.close(isOnlyOneData ? 1 : 2);
}
}); });
SchedulerBinding.instance.addPostFrameCallback((_) { SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());
@ -594,17 +589,10 @@ class LockSetLogic extends BaseGetXController {
state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0); state.deleteAdministratorIsHaveAllData.value == true ? 1 : 0);
if (entity.errorCode!.codeIsSuccessful) { if (entity.errorCode!.codeIsSuccessful) {
BlueManage().connectDeviceMacAddress = ''; BlueManage().connectDeviceMacAddress = '';
final bool isXHJ = F.isXHJ;
final bool isOnlyOneData = state.isOnlyOneData.value == true; final bool isOnlyOneData = state.isOnlyOneData.value == true;
await Future<dynamic>.delayed(const Duration(milliseconds: 200)) await Future<dynamic>.delayed(const Duration(milliseconds: 200))
.then((e) { .then((e) {
if (isXHJ) { Get.close(isOnlyOneData ? 1 : 2);
Get.close(3);
} else {
final int onlyOneDataInt = isOnlyOneData ? 1 : 2;
Get.close(onlyOneDataInt);
}
}); });
SchedulerBinding.instance.addPostFrameCallback((_) { SchedulerBinding.instance.addPostFrameCallback((_) {
eventBus.fire(RefreshLockListInfoDataEvent()); eventBus.fire(RefreshLockListInfoDataEvent());

View File

@ -285,6 +285,9 @@ class NearbyLockLogic extends BaseGetXController {
index = index + 20; index = index + 20;
AppLog.log('mac地址 macAddressStr:$macAddressStr'); AppLog.log('mac地址 macAddressStr:$macAddressStr');
//
state.lockInfo['timezoneOffset'] = DateTime.now().timeZoneOffset.inSeconds;
// //
final int featureValueLength = reply.data[index]; final int featureValueLength = reply.data[index];
index = index + 1; index = index + 1;

View File

@ -23,7 +23,7 @@ abstract class Api {
final String getLockNetTokenURL = '/lock/getLockNetToken'; //token final String getLockNetTokenURL = '/lock/getLockNetToken'; //token
final String updateLockUserNoURL = '/key/updateLockUserNo'; //NO final String updateLockUserNoURL = '/key/updateLockUserNo'; //NO
final String bindingBlueAdminURL = '/lock/bindAdmin'; // final String bindingBlueAdminURL = '/v2/lock/bindAdmin'; //
final String modifyKeyNameURL = '/key/modifyKeyName'; // final String modifyKeyNameURL = '/key/modifyKeyName'; //
final String updateLockNameURL = '/lock/updateLockName'; //() final String updateLockNameURL = '/lock/updateLockName'; //()
final String modifyKeyNameForAdminURL = final String modifyKeyNameForAdminURL =

View File

@ -72,8 +72,9 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 1.0.61+2024061103xhj 线上环境,对外发布,提交测试:处理华为拒审 # 1.0.61+2024061103xhj 线上环境,对外发布,提交测试:处理华为拒审
# 1.0.62+2024061301xhj 线上环境,对外发布,提交测试:处理华为拒审 # 1.0.62+2024061301xhj 线上环境,对外发布,提交测试:处理华为拒审
# 1.0.63+2024061302xhj 线上环境,提交测试:回归 bug # 1.0.63+2024061302xhj 线上环境,提交测试:回归 bug
# 1.0.65+2024061801xhj 线上环境,提交测试:回归 bug
version: 1.0.63+2024061302 version: 1.0.65+2024061801
environment: environment:
sdk: '>=2.12.0 <3.0.0' sdk: '>=2.12.0 <3.0.0'