fix: 调整蓝牙开锁时出现重复响应,增加防抖处理。调整动画控制器在初始化之前进行赋值
This commit is contained in:
parent
8fd0a5243e
commit
8a5de7d442
@ -131,12 +131,12 @@ jobs:
|
|||||||
echo "🔍 Getting version info from basic-setup job..."
|
echo "🔍 Getting version info from basic-setup job..."
|
||||||
|
|
||||||
# 设置默认版本号,如果环境变量为空
|
# 设置默认版本号,如果环境变量为空
|
||||||
if [ -z "$NEXT_VERSION" ]; then
|
if [ -z "${{ needs.basic-setup.outputs.NEXT_VERSION }}" ]; then
|
||||||
VERSION_FOR_FILENAME="1-0-0"
|
VERSION_FOR_FILENAME="1-0-0"
|
||||||
echo "⚠️ Version not found, using default: $VERSION_FOR_FILENAME"
|
echo "⚠️ Version not found, using default: $VERSION_FOR_FILENAME"
|
||||||
else
|
else
|
||||||
# 格式化版本号用于文件名
|
# 格式化版本号用于文件名
|
||||||
VERSION_FOR_FILENAME=$(echo "$NEXT_VERSION" | sed 's/v//g' | sed 's/\./-/g')
|
VERSION_FOR_FILENAME=$(echo "${{ needs.basic-setup.outputs.NEXT_VERSION }}" | sed 's/v//g' | sed 's/\./-/g')
|
||||||
echo "✅ Version found: $VERSION_FOR_FILENAME"
|
echo "✅ Version found: $VERSION_FOR_FILENAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -165,12 +165,12 @@ jobs:
|
|||||||
echo "🔍 Getting version info from basic-setup job..."
|
echo "🔍 Getting version info from basic-setup job..."
|
||||||
|
|
||||||
# 设置默认版本号,如果环境变量为空
|
# 设置默认版本号,如果环境变量为空
|
||||||
if [ -z "$NEXT_VERSION" ]; then
|
if [ -z "${{ needs.basic-setup.outputs.NEXT_VERSION }}" ]; then
|
||||||
VERSION_FOR_FILENAME="1-0-0"
|
VERSION_FOR_FILENAME="1-0-0"
|
||||||
echo "⚠️ Version not found, using default: $VERSION_FOR_FILENAME"
|
echo "⚠️ Version not found, using default: $VERSION_FOR_FILENAME"
|
||||||
else
|
else
|
||||||
# 格式化版本号用于文件名
|
# 格式化版本号用于文件名
|
||||||
VERSION_FOR_FILENAME=$(echo "$NEXT_VERSION" | sed 's/v//g' | sed 's/\./-/g')
|
VERSION_FOR_FILENAME=$(echo "${{ needs.basic-setup.outputs.NEXT_VERSION }}" | sed 's/v//g' | sed 's/\./-/g')
|
||||||
echo "✅ Version found: $VERSION_FOR_FILENAME"
|
echo "✅ Version found: $VERSION_FOR_FILENAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -200,12 +200,12 @@ jobs:
|
|||||||
echo "🔍 Getting version info from basic-setup job..."
|
echo "🔍 Getting version info from basic-setup job..."
|
||||||
|
|
||||||
# 设置默认版本号,如果环境变量为空
|
# 设置默认版本号,如果环境变量为空
|
||||||
if [ -z "$NEXT_VERSION" ]; then
|
if [ -z "${{ needs.basic-setup.outputs.NEXT_VERSION }}" ]; then
|
||||||
VERSION_FOR_FILENAME="1-0-0"
|
VERSION_FOR_FILENAME="1-0-0"
|
||||||
echo "⚠️ Version not found, using default: $VERSION_FOR_FILENAME"
|
echo "⚠️ Version not found, using default: $VERSION_FOR_FILENAME"
|
||||||
else
|
else
|
||||||
# 格式化版本号用于文件名
|
# 格式化版本号用于文件名
|
||||||
VERSION_FOR_FILENAME=$(echo "$NEXT_VERSION" | sed 's/v//g' | sed 's/\./-/g')
|
VERSION_FOR_FILENAME=$(echo "${{ needs.basic-setup.outputs.NEXT_VERSION }}" | sed 's/v//g' | sed 's/\./-/g')
|
||||||
echo "✅ Version found: $VERSION_FOR_FILENAME"
|
echo "✅ Version found: $VERSION_FOR_FILENAME"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -217,7 +217,7 @@ jobs:
|
|||||||
echo "🔧 Configuring iOS automatic code signing for CI environment..."
|
echo "🔧 Configuring iOS automatic code signing for CI environment..."
|
||||||
|
|
||||||
# 构建iOS IPA,使用自动签名模式
|
# 构建iOS IPA,使用自动签名模式
|
||||||
flutter build ipa --no-tree-shake-icons --release --flavor sky -t lib/main_sky_full.dart --build-number=$BUILD_NUMBER --build-name="sky-star-lock-release-$VERSION_FOR_FILENAME.ipa" --codesign="auto"
|
flutter build ipa --no-tree-shake-icons --release --flavor sky -t lib/main_sky_full.dart --build-number=$BUILD_NUMBER --build-name="sky-star-lock-release-$VERSION_FOR_FILENAME.ipa" --codesign
|
||||||
|
|
||||||
# 重命名IPA文件
|
# 重命名IPA文件
|
||||||
mv build/ios/ipa/*.ipa "$IPA_FILENAME"
|
mv build/ios/ipa/*.ipa "$IPA_FILENAME"
|
||||||
@ -247,5 +247,5 @@ jobs:
|
|||||||
echo " ✅ IPA: sky-star-lock-release-*.ipa"
|
echo " ✅ IPA: sky-star-lock-release-*.ipa"
|
||||||
fi
|
fi
|
||||||
echo ""
|
echo ""
|
||||||
echo "🏷️ Version: $NEXT_VERSION"
|
echo "🏷️ Version: ${{ needs.basic-setup.outputs.NEXT_VERSION }}"
|
||||||
echo "📁 Files available in artifacts section"
|
echo "📁 Files available in artifacts section"
|
||||||
|
|||||||
@ -54,12 +54,27 @@ class LockDetailLogic extends BaseGetXController {
|
|||||||
//节流器,用来限制开锁按钮的触发频率
|
//节流器,用来限制开锁按钮的触发频率
|
||||||
FunctionBlocker functionBlocker = FunctionBlocker(duration: const Duration(seconds: 2));
|
FunctionBlocker functionBlocker = FunctionBlocker(duration: const Duration(seconds: 2));
|
||||||
|
|
||||||
|
|
||||||
|
// 防抖Timer
|
||||||
|
Timer? _openDoorReplyDebounceTimer;
|
||||||
|
|
||||||
|
// 带防抖控制的开门回复处理
|
||||||
|
void _handleOpenDoorReplyWithDebounce(Reply reply) {
|
||||||
|
// 取消之前的Timer
|
||||||
|
_openDoorReplyDebounceTimer?.cancel();
|
||||||
|
|
||||||
|
// 设置新的Timer,200ms后执行
|
||||||
|
_openDoorReplyDebounceTimer = Timer(const Duration(milliseconds: 300), () {
|
||||||
|
_replyOpenLock(reply);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 监听设备返回的数据
|
// 监听设备返回的数据
|
||||||
void initReplySubscription() {
|
void initReplySubscription() {
|
||||||
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
state.replySubscription = EventBusManager().eventBus!.on<Reply>().listen((Reply reply) async {
|
||||||
// 开门
|
// 开门
|
||||||
if (reply is OpenDoorReply) {
|
if (reply is OpenDoorReply) {
|
||||||
_replyOpenLock(reply);
|
_handleOpenDoorReplyWithDebounce(reply);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 开完锁之后上传记录
|
// 开完锁之后上传记录
|
||||||
|
|||||||
@ -34,11 +34,7 @@ import '../../lockMian/entity/lockListInfo_entity.dart';
|
|||||||
import 'lockDetail_logic.dart';
|
import 'lockDetail_logic.dart';
|
||||||
|
|
||||||
class LockDetailPage extends StatefulWidget {
|
class LockDetailPage extends StatefulWidget {
|
||||||
const LockDetailPage(
|
const LockDetailPage({required this.isOnlyOneData, required this.lockListInfoItemEntity, Key? key}) : super(key: key);
|
||||||
{required this.isOnlyOneData,
|
|
||||||
required this.lockListInfoItemEntity,
|
|
||||||
Key? key})
|
|
||||||
: super(key: key);
|
|
||||||
final bool isOnlyOneData;
|
final bool isOnlyOneData;
|
||||||
final LockListInfoItemEntity lockListInfoItemEntity;
|
final LockListInfoItemEntity lockListInfoItemEntity;
|
||||||
|
|
||||||
@ -46,18 +42,14 @@ class LockDetailPage extends StatefulWidget {
|
|||||||
State<LockDetailPage> createState() => _LockDetailPageState();
|
State<LockDetailPage> createState() => _LockDetailPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _LockDetailPageState extends State<LockDetailPage>
|
class _LockDetailPageState extends State<LockDetailPage> with TickerProviderStateMixin, RouteAware {
|
||||||
with TickerProviderStateMixin, RouteAware {
|
|
||||||
// with RouteAware
|
// with RouteAware
|
||||||
final LockDetailLogic logic = Get.put(LockDetailLogic());
|
final LockDetailLogic logic = Get.put(LockDetailLogic());
|
||||||
final LockDetailState state = Get.find<LockDetailLogic>().state;
|
final LockDetailState state = Get.find<LockDetailLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
state.animationController = AnimationController(duration: const Duration(seconds: 1), vsync: this);
|
||||||
|
|
||||||
state.animationController =
|
|
||||||
AnimationController(duration: const Duration(seconds: 1), vsync: this);
|
|
||||||
state.animationController!.repeat();
|
state.animationController!.repeat();
|
||||||
//动画开始、结束、向前移动或向后移动时会调用StatusListener
|
//动画开始、结束、向前移动或向后移动时会调用StatusListener
|
||||||
state.animationController!.addStatusListener((AnimationStatus status) {
|
state.animationController!.addStatusListener((AnimationStatus status) {
|
||||||
@ -69,6 +61,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
state.animationController!.forward();
|
state.animationController!.forward();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
super.initState();
|
||||||
|
|
||||||
state.pageController.addListener(() {
|
state.pageController.addListener(() {
|
||||||
state.currentPage.value = state.pageController.page!.round();
|
state.currentPage.value = state.pageController.page!.round();
|
||||||
@ -77,9 +70,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
_initRefreshLockDetailInfoDataEventAction();
|
_initRefreshLockDetailInfoDataEventAction();
|
||||||
logic.initReplySubscription();
|
logic.initReplySubscription();
|
||||||
logic.initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction();
|
logic.initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction();
|
||||||
logic.loadData(
|
logic.loadData(lockListInfoItemEntity: widget.lockListInfoItemEntity, isOnlyOneData: widget.isOnlyOneData);
|
||||||
lockListInfoItemEntity: widget.lockListInfoItemEntity,
|
|
||||||
isOnlyOneData: widget.isOnlyOneData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -95,9 +86,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
void _initRefreshLockDetailInfoDataEventAction() {
|
void _initRefreshLockDetailInfoDataEventAction() {
|
||||||
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
// 蓝牙协议通知传输跟蓝牙之外的数据传输类不一样 eventBus
|
||||||
_lockRefreshLockDetailInfoDataEvent = eventBus
|
_lockRefreshLockDetailInfoDataEvent =
|
||||||
.on<RefreshLockDetailInfoDataEvent>()
|
eventBus.on<RefreshLockDetailInfoDataEvent>().listen((RefreshLockDetailInfoDataEvent event) {
|
||||||
.listen((RefreshLockDetailInfoDataEvent event) {
|
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -109,17 +99,12 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
//鑫泓佳布局
|
//鑫泓佳布局
|
||||||
Widget xhjWidget() {
|
Widget xhjWidget() {
|
||||||
final bool isShowTip = (state.keyInfos.value.keyType ==
|
final bool isShowTip = (state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime ||
|
||||||
XSConstantMacro.keyTypeTime ||
|
|
||||||
state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) &&
|
state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) &&
|
||||||
(DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <=
|
(DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= 15 &&
|
||||||
15 &&
|
DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= 0) &&
|
||||||
DateTool()
|
|
||||||
.compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >=
|
|
||||||
0) &&
|
|
||||||
(state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse ||
|
(state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse ||
|
||||||
state.keyInfos.value.keyStatus ==
|
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitReceive);
|
||||||
XSConstantMacro.keyStatusWaitReceive);
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: Colors.white,
|
backgroundColor: Colors.white,
|
||||||
body: Obx(() {
|
body: Obx(() {
|
||||||
@ -141,8 +126,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(color: const Color(0xffCBA74B), fontSize: 24.sp)),
|
||||||
color: const Color(0xffCBA74B), fontSize: 24.sp)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
@ -161,10 +145,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
height: 20.h,
|
height: 20.h,
|
||||||
),
|
),
|
||||||
labelText(
|
labelText(img: 'images/icon_slider_horizontal.png', text: '功能'.tr, child: bottomWidget()),
|
||||||
img: 'images/icon_slider_horizontal.png',
|
|
||||||
text: '功能'.tr,
|
|
||||||
child: bottomWidget()),
|
|
||||||
btnText(
|
btnText(
|
||||||
img: 'images/main/icon_main_set.png',
|
img: 'images/main/icon_main_set.png',
|
||||||
text: '设置'.tr,
|
text: '设置'.tr,
|
||||||
@ -172,17 +153,13 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
if (state.openDoorBtnisUneable.value == false) {
|
if (state.openDoorBtnisUneable.value == false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Get.toNamed(Routers.lockSetPage,
|
Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{
|
||||||
arguments: <String, Object?>{
|
'lockId': state.keyInfos.value.lockId,
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'isOnlyOneData': state.isOnlyOneData
|
||||||
'isOnlyOneData': state.isOnlyOneData
|
});
|
||||||
});
|
|
||||||
}),
|
}),
|
||||||
if (!F.isProductionEnv)
|
if (!F.isProductionEnv)
|
||||||
labelText(
|
labelText(img: 'images/icon_puzzlepiece_extension.png', text: '配件'.tr, child: attachmentWidget()),
|
||||||
img: 'images/icon_puzzlepiece_extension.png',
|
|
||||||
text: '配件'.tr,
|
|
||||||
child: attachmentWidget()),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -201,24 +178,21 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget btnText(
|
Widget btnText({required String img, required String text, required var onTap}) {
|
||||||
{required String img, required String text, required var onTap}) {
|
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: Container(
|
child: Container(
|
||||||
margin: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 15.h),
|
margin: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 15.h),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 30.h),
|
padding: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 30.h),
|
||||||
decoration: BoxDecoration(
|
decoration:
|
||||||
color: Colors.white,
|
BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(16.r), boxShadow: <BoxShadow>[
|
||||||
borderRadius: BorderRadius.circular(16.r),
|
BoxShadow(
|
||||||
boxShadow: <BoxShadow>[
|
color: Colors.black.withOpacity(0.15),
|
||||||
BoxShadow(
|
offset: const Offset(0, 0),
|
||||||
color: Colors.black.withOpacity(0.15),
|
blurRadius: 5.r,
|
||||||
offset: const Offset(0, 0),
|
spreadRadius: 0,
|
||||||
blurRadius: 5.r,
|
),
|
||||||
spreadRadius: 0,
|
]),
|
||||||
),
|
|
||||||
]),
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
FlavorsImg(
|
FlavorsImg(
|
||||||
@ -247,22 +221,18 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget labelText(
|
Widget labelText({required String img, required String text, required Widget child}) {
|
||||||
{required String img, required String text, required Widget child}) {
|
|
||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 15.h),
|
margin: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 15.h),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 15.h),
|
padding: EdgeInsets.symmetric(horizontal: 0.05.sw, vertical: 15.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(16.r), boxShadow: <BoxShadow>[
|
||||||
color: Colors.white,
|
BoxShadow(
|
||||||
borderRadius: BorderRadius.circular(16.r),
|
color: Colors.black.withOpacity(0.15),
|
||||||
boxShadow: <BoxShadow>[
|
offset: const Offset(0, 0),
|
||||||
BoxShadow(
|
blurRadius: 5.r,
|
||||||
color: Colors.black.withOpacity(0.15),
|
spreadRadius: 0,
|
||||||
offset: const Offset(0, 0),
|
),
|
||||||
blurRadius: 5.r,
|
]),
|
||||||
spreadRadius: 0,
|
|
||||||
),
|
|
||||||
]),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
@ -328,13 +298,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Image.asset(showElectricIcon(state.electricQuantity.value),
|
Image.asset(showElectricIcon(state.electricQuantity.value), width: 30.w, height: 24.w),
|
||||||
width: 30.w, height: 24.w),
|
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
Text('${state.electricQuantity.value}%',
|
Text('${state.electricQuantity.value}%',
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)),
|
||||||
fontSize: 18.sp,
|
|
||||||
color: AppColors.darkGrayTextColor)),
|
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
Icon(
|
Icon(
|
||||||
Icons.info, // 使用内置的 warning 图标,它是一个叹号
|
Icons.info, // 使用内置的 warning 图标,它是一个叹号
|
||||||
@ -345,24 +312,17 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: state
|
visible: state.keyInfos.value.lockFeature!.isSupportBackupBattery == 1,
|
||||||
.keyInfos.value.lockFeature!.isSupportBackupBattery ==
|
|
||||||
1,
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
FlavorsImg(
|
FlavorsImg(
|
||||||
child: Image.asset(
|
child: Image.asset(showElectricIcon(state.electricQuantityStandby.value),
|
||||||
showElectricIcon(
|
width: 30.w, height: 24.w),
|
||||||
state.electricQuantityStandby.value),
|
|
||||||
width: 30.w,
|
|
||||||
height: 24.w),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
Text('${state.electricQuantityStandby.value}%',
|
Text('${state.electricQuantityStandby.value}%',
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)),
|
||||||
fontSize: 18.sp,
|
|
||||||
color: AppColors.darkGrayTextColor)),
|
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
FlavorsImg(
|
FlavorsImg(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
@ -386,8 +346,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (state.openDoorBtnisUneable.value == true) {
|
if (state.openDoorBtnisUneable.value == true) {
|
||||||
logic.functionBlocker
|
logic.functionBlocker.block(isNeedRealNameAuthThenOpenLock);
|
||||||
.block(isNeedRealNameAuthThenOpenLock);
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLongPressStart: (LongPressStartDetails details) {
|
onLongPressStart: (LongPressStartDetails details) {
|
||||||
@ -457,12 +416,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
right: 90.w,
|
right: 90.w,
|
||||||
bottom: 1,
|
bottom: 1,
|
||||||
child: Obx(() => Visibility(
|
child: Obx(() => Visibility(
|
||||||
visible:
|
visible: state.keyInfos.value.lockSetting!.remoteUnlock == 1,
|
||||||
state.keyInfos.value.lockSetting!.remoteUnlock == 1,
|
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
ShowCupertinoAlertView().isToRemoteUnLockAlert(
|
ShowCupertinoAlertView().isToRemoteUnLockAlert(remoteUnlockAction: () {
|
||||||
remoteUnlockAction: () {
|
|
||||||
if (state.keyInfos.value.hasGateway != 1) {
|
if (state.keyInfos.value.hasGateway != 1) {
|
||||||
logic.showToast('附近没有可用网关'.tr);
|
logic.showToast('附近没有可用网关'.tr);
|
||||||
}
|
}
|
||||||
@ -508,34 +465,24 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
return ListView(
|
return ListView(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Visibility(
|
Visibility(
|
||||||
visible:
|
visible: (state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime ||
|
||||||
(state.keyInfos.value.keyType == XSConstantMacro.keyTypeTime ||
|
state.keyInfos.value.keyType == XSConstantMacro.keyTypeLoop) && // 限时、循环
|
||||||
state.keyInfos.value.keyType ==
|
(DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) <= 15 &&
|
||||||
XSConstantMacro.keyTypeLoop) && // 限时、循环
|
DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!) >= 0) && // 0到30天
|
||||||
(DateTool().compareTimeGetDaysFromNow(
|
(state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusNormalUse ||
|
||||||
state.keyInfos.value.endDate!) <=
|
state.keyInfos.value.keyStatus == XSConstantMacro.keyStatusWaitReceive) // 正常使用、待接收
|
||||||
15 &&
|
|
||||||
DateTool().compareTimeGetDaysFromNow(
|
|
||||||
state.keyInfos.value.endDate!) >=
|
|
||||||
0) && // 0到30天
|
|
||||||
(state.keyInfos.value.keyStatus ==
|
|
||||||
XSConstantMacro.keyStatusNormalUse ||
|
|
||||||
state.keyInfos.value.keyStatus ==
|
|
||||||
XSConstantMacro.keyStatusWaitReceive) // 正常使用、待接收
|
|
||||||
,
|
,
|
||||||
child: Container(
|
child: Container(
|
||||||
// height: 30.h,
|
// height: 30.h,
|
||||||
width: 1.sw,
|
width: 1.sw,
|
||||||
color: const Color(0xFFFBEFD4),
|
color: const Color(0xFFFBEFD4),
|
||||||
padding:
|
padding: EdgeInsets.only(top: 8.h, bottom: 8.h, right: 10.w, left: 10.h),
|
||||||
EdgeInsets.only(top: 8.h, bottom: 8.h, right: 10.w, left: 10.h),
|
|
||||||
child: Text(
|
child: Text(
|
||||||
"${"钥匙将在".tr}${DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!)}${"天后失效".tr}",
|
"${"钥匙将在".tr}${DateTool().compareTimeGetDaysFromNow(state.keyInfos.value.endDate!)}${"天后失效".tr}",
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style:
|
style: TextStyle(color: const Color(0xffCBA74B), fontSize: 24.sp)),
|
||||||
TextStyle(color: const Color(0xffCBA74B), fontSize: 24.sp)),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Stack(children: <Widget>[
|
Stack(children: <Widget>[
|
||||||
@ -618,16 +565,11 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
FlavorsImg(
|
FlavorsImg(
|
||||||
child: Image.asset(
|
child: Image.asset(showElectricIcon(state.electricQuantity.value), width: 30.w, height: 24.w),
|
||||||
showElectricIcon(state.electricQuantity.value),
|
|
||||||
width: 30.w,
|
|
||||||
height: 24.w),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
Text('${state.electricQuantity.value}%',
|
Text('${state.electricQuantity.value}%',
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)),
|
||||||
fontSize: 18.sp,
|
|
||||||
color: AppColors.darkGrayTextColor)),
|
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
state.keyInfos.value.network?.isOnline == 1
|
state.keyInfos.value.network?.isOnline == 1
|
||||||
? Icon(
|
? Icon(
|
||||||
@ -649,24 +591,17 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: state
|
visible: state.keyInfos.value.lockFeature!.isSupportBackupBattery == 1,
|
||||||
.keyInfos.value.lockFeature!.isSupportBackupBattery ==
|
|
||||||
1,
|
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
FlavorsImg(
|
FlavorsImg(
|
||||||
child: Image.asset(
|
child: Image.asset(showElectricIcon(state.electricQuantityStandby.value),
|
||||||
showElectricIcon(
|
width: 30.w, height: 24.w),
|
||||||
state.electricQuantityStandby.value),
|
|
||||||
width: 30.w,
|
|
||||||
height: 24.w),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
Text('${state.electricQuantityStandby.value}%',
|
Text('${state.electricQuantityStandby.value}%',
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 18.sp, color: AppColors.darkGrayTextColor)),
|
||||||
fontSize: 18.sp,
|
|
||||||
color: AppColors.darkGrayTextColor)),
|
|
||||||
SizedBox(width: 2.w),
|
SizedBox(width: 2.w),
|
||||||
FlavorsImg(
|
FlavorsImg(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
@ -756,12 +691,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
right: 90.w,
|
right: 90.w,
|
||||||
bottom: 1,
|
bottom: 1,
|
||||||
child: Obx(() => Visibility(
|
child: Obx(() => Visibility(
|
||||||
visible:
|
visible: state.keyInfos.value.lockSetting!.remoteUnlock == 1,
|
||||||
state.keyInfos.value.lockSetting!.remoteUnlock == 1,
|
|
||||||
child: GestureDetector(
|
child: GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
ShowCupertinoAlertView().isToRemoteUnLockAlert(
|
ShowCupertinoAlertView().isToRemoteUnLockAlert(remoteUnlockAction: () {
|
||||||
remoteUnlockAction: () {
|
|
||||||
if (state.keyInfos.value.hasGateway != 1) {
|
if (state.keyInfos.value.hasGateway != 1) {
|
||||||
logic.showToast('附近没有可用网关'.tr);
|
logic.showToast('附近没有可用网关'.tr);
|
||||||
}
|
}
|
||||||
@ -792,10 +725,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
logic.getKeyStatusTextAndShow(),
|
logic.getKeyStatusTextAndShow(),
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
style: TextStyle(
|
style: TextStyle(fontSize: 22.sp, color: AppColors.btnDisableColor, fontWeight: FontWeight.w500),
|
||||||
fontSize: 22.sp,
|
|
||||||
color: AppColors.btnDisableColor,
|
|
||||||
fontWeight: FontWeight.w500),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -818,8 +748,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
Widget adminInfoView({bool center = true, bool max = true}) {
|
Widget adminInfoView({bool center = true, bool max = true}) {
|
||||||
return Row(
|
return Row(
|
||||||
mainAxisAlignment:
|
mainAxisAlignment: center ? MainAxisAlignment.center : MainAxisAlignment.start,
|
||||||
center ? MainAxisAlignment.center : MainAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Row(
|
Row(
|
||||||
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
|
mainAxisSize: max ? MainAxisSize.max : MainAxisSize.min,
|
||||||
@ -834,11 +763,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
Text(
|
Text(
|
||||||
state.keyInfos.value.isLockOwner == 1
|
state.keyInfos.value.isLockOwner == 1
|
||||||
? '超级管理员英文'.tr
|
? '超级管理员英文'.tr
|
||||||
: (state.keyInfos.value.keyRight == 1
|
: (state.keyInfos.value.keyRight == 1 ? '授权管理员英文'.tr : '普通用户'.tr),
|
||||||
? '授权管理员英文'.tr
|
style: TextStyle(fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
||||||
: '普通用户'.tr),
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 40.w),
|
SizedBox(width: 40.w),
|
||||||
],
|
],
|
||||||
@ -860,9 +786,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
'网关设备英文'.tr,
|
'网关设备英文'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp,
|
fontSize: 20.sp,
|
||||||
color: state.keyInfos.value.hasGateway == 1
|
color: state.keyInfos.value.hasGateway == 1 ? AppColors.mainColor : AppColors.btnDisableColor),
|
||||||
? AppColors.mainColor
|
|
||||||
: AppColors.btnDisableColor),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 20.w),
|
SizedBox(width: 20.w),
|
||||||
],
|
],
|
||||||
@ -874,18 +798,14 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
child: Image.asset('images/main/icon_lockDetail_needNetwork.png',
|
child: Image.asset('images/main/icon_lockDetail_needNetwork.png',
|
||||||
width: 24.w,
|
width: 24.w,
|
||||||
height: 20.w,
|
height: 20.w,
|
||||||
color: state.isOpenLockNeedOnline.value == 1
|
color: state.isOpenLockNeedOnline.value == 1 ? AppColors.mainColor : AppColors.btnDisableColor),
|
||||||
? AppColors.mainColor
|
|
||||||
: AppColors.btnDisableColor),
|
|
||||||
),
|
),
|
||||||
SizedBox(width: 6.w),
|
SizedBox(width: 6.w),
|
||||||
Text(
|
Text(
|
||||||
'手机需联网英文'.tr,
|
'手机需联网英文'.tr,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp,
|
fontSize: 20.sp,
|
||||||
color: state.isOpenLockNeedOnline.value == 1
|
color: state.isOpenLockNeedOnline.value == 1 ? AppColors.mainColor : AppColors.btnDisableColor),
|
||||||
? AppColors.mainColor
|
|
||||||
: AppColors.btnDisableColor),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
@ -894,8 +814,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
}
|
}
|
||||||
|
|
||||||
//旋转动画
|
//旋转动画
|
||||||
Widget xhjBuildRotationTransition(
|
Widget xhjBuildRotationTransition({required double width, required double height}) {
|
||||||
{required double width, required double height}) {
|
|
||||||
return Positioned(
|
return Positioned(
|
||||||
child: RotationTransition(
|
child: RotationTransition(
|
||||||
//设置动画的旋转中心
|
//设置动画的旋转中心
|
||||||
@ -907,17 +826,14 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
'images/icon_circle_dotted.png',
|
'images/icon_circle_dotted.png',
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
color: state.isOpenPassageMode.value == 1
|
color: state.isOpenPassageMode.value == 1 ? Colors.red : AppColors.mainColor,
|
||||||
? Colors.red
|
|
||||||
: AppColors.mainColor,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
//旋转动画
|
//旋转动画
|
||||||
Widget buildRotationTransition(
|
Widget buildRotationTransition({required double width, required double height}) {
|
||||||
{required double width, required double height}) {
|
|
||||||
return Positioned(
|
return Positioned(
|
||||||
child: RotationTransition(
|
child: RotationTransition(
|
||||||
//设置动画的旋转中心
|
//设置动画的旋转中心
|
||||||
@ -949,9 +865,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
margin: EdgeInsets.symmetric(vertical: 10.0.w, horizontal: 6.0.w),
|
margin: EdgeInsets.symmetric(vertical: 10.0.w, horizontal: 6.0.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
shape: BoxShape.circle,
|
shape: BoxShape.circle,
|
||||||
color: state.currentPage.value == index
|
color: state.currentPage.value == index ? AppColors.mainColor : Colors.grey,
|
||||||
? AppColors.mainColor
|
|
||||||
: Colors.grey,
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
@ -997,8 +911,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
// '开门器', state.bottomBtnisUneable.value, () {}));
|
// '开门器', state.bottomBtnisUneable.value, () {}));
|
||||||
|
|
||||||
// 新增配件
|
// 新增配件
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件'.tr,
|
showWidgetArr.add(bottomItem('images/main/icon_main_addLock.png', '新增配件'.tr, state.bottomBtnisEable.value, () {
|
||||||
state.bottomBtnisEable.value, () {
|
|
||||||
Navigator.pushNamed(context, Routers.accessoriesListPage);
|
Navigator.pushNamed(context, Routers.accessoriesListPage);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -1015,8 +928,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
crossAxisSpacing: 0.h,
|
crossAxisSpacing: 0.h,
|
||||||
mainAxisExtent: 90.0, // 设置每个 item 的固定高度
|
mainAxisExtent: 90.0, // 设置每个 item 的固定高度
|
||||||
),
|
),
|
||||||
itemCount: (state.keyInfos.value.isLockOwner == 1 ||
|
itemCount: (state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1)
|
||||||
state.keyInfos.value.keyRight == 1)
|
|
||||||
? getAllWidget().length
|
? getAllWidget().length
|
||||||
: getNormalWidget().length,
|
: getNormalWidget().length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
@ -1041,8 +953,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
// 根据权限显示不同的底部按钮
|
// 根据权限显示不同的底部按钮
|
||||||
List<Widget> getBottomWidget() {
|
List<Widget> getBottomWidget() {
|
||||||
if (state.keyInfos.value.isLockOwner == 1 ||
|
if (state.keyInfos.value.isLockOwner == 1 || state.keyInfos.value.keyRight == 1) {
|
||||||
state.keyInfos.value.keyRight == 1) {
|
|
||||||
// 超级管理员、授权管理员
|
// 超级管理员、授权管理员
|
||||||
return getAllWidget();
|
return getAllWidget();
|
||||||
} else {
|
} else {
|
||||||
@ -1062,22 +973,17 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
// }));
|
// }));
|
||||||
// }
|
// }
|
||||||
// 操作记录
|
// 操作记录
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_operatingRecord.png',
|
showWidgetArr
|
||||||
'操作记录'.tr, state.bottomBtnisEable.value, () {
|
.add(bottomItem('images/main/icon_main_operatingRecord.png', '操作记录'.tr, state.bottomBtnisEable.value, () {
|
||||||
Get.toNamed(Routers.doorLockLogPage,
|
Get.toNamed(Routers.doorLockLogPage,
|
||||||
arguments: <String, LockListInfoItemEntity>{
|
arguments: <String, LockListInfoItemEntity>{'keyInfo': state.keyInfos.value});
|
||||||
'keyInfo': state.keyInfos.value
|
|
||||||
});
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 设置
|
// 设置
|
||||||
if (F.isSKY) {
|
if (F.isSKY) {
|
||||||
showWidgetArr
|
showWidgetArr.add(bottomItem('images/main/icon_main_set.png', '设置'.tr, true, () {
|
||||||
.add(bottomItem('images/main/icon_main_set.png', '设置'.tr, true, () {
|
Get.toNamed(Routers.lockSetPage,
|
||||||
Get.toNamed(Routers.lockSetPage, arguments: <String, Object?>{
|
arguments: <String, Object?>{'lockId': state.keyInfos.value.lockId, 'isOnlyOneData': state.isOnlyOneData});
|
||||||
'lockId': state.keyInfos.value.lockId,
|
|
||||||
'isOnlyOneData': state.isOnlyOneData
|
|
||||||
});
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1097,26 +1003,22 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
// 电子钥匙
|
// 电子钥匙
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_electronicKey.png',
|
showWidgetArr
|
||||||
'电子钥匙'.tr, state.bottomBtnisEable.value, () {
|
.add(bottomItem('images/main/icon_main_electronicKey.png', '电子钥匙'.tr, state.bottomBtnisEable.value, () {
|
||||||
Get.toNamed(Routers.electronicKeyListPage);
|
Get.toNamed(Routers.electronicKeyListPage);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
// 密码
|
// 密码
|
||||||
if (state.keyInfos.value.lockFeature!.password == 1) {
|
if (state.keyInfos.value.lockFeature!.password == 1) {
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_password.png',
|
showWidgetArr.add(bottomItem('images/main/icon_main_password.png', '密码'.tr, state.bottomBtnisEable.value, () {
|
||||||
'密码'.tr, state.bottomBtnisEable.value, () {
|
|
||||||
Get.toNamed(Routers.passwordKeyListPage,
|
Get.toNamed(Routers.passwordKeyListPage,
|
||||||
arguments: <String, LockListInfoItemEntity>{
|
arguments: <String, LockListInfoItemEntity>{'keyInfo': state.keyInfos.value});
|
||||||
'keyInfo': state.keyInfos.value
|
|
||||||
});
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
// ic卡
|
// ic卡
|
||||||
if (state.keyInfos.value.lockFeature!.icCard == 1) {
|
if (state.keyInfos.value.lockFeature!.icCard == 1) {
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_icCard.png', '卡'.tr,
|
showWidgetArr.add(bottomItem('images/main/icon_main_icCard.png', '卡'.tr, state.bottomBtnisEable.value, () {
|
||||||
state.bottomBtnisEable.value, () {
|
|
||||||
Get.toNamed(Routers.cardListPage, arguments: <String, int?>{
|
Get.toNamed(Routers.cardListPage, arguments: <String, int?>{
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'lockId': state.keyInfos.value.lockId,
|
||||||
});
|
});
|
||||||
@ -1125,8 +1027,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
// 指纹
|
// 指纹
|
||||||
if (state.keyInfos.value.lockFeature!.fingerprint == 1) {
|
if (state.keyInfos.value.lockFeature!.fingerprint == 1) {
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png',
|
showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', '指纹'.tr, state.bottomBtnisEable.value, () {
|
||||||
'指纹'.tr, state.bottomBtnisEable.value, () {
|
|
||||||
Get.toNamed(Routers.fingerprintListPage, arguments: <String, int?>{
|
Get.toNamed(Routers.fingerprintListPage, arguments: <String, int?>{
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'lockId': state.keyInfos.value.lockId,
|
||||||
});
|
});
|
||||||
@ -1135,8 +1036,8 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
// 遥控
|
// 遥控
|
||||||
if (state.keyInfos.value.lockFeature!.bluetoothRemoteControl == 1) {
|
if (state.keyInfos.value.lockFeature!.bluetoothRemoteControl == 1) {
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_remoteControl.png',
|
showWidgetArr
|
||||||
'遥控'.tr, state.bottomBtnisEable.value, () {
|
.add(bottomItem('images/main/icon_main_remoteControl.png', '遥控'.tr, state.bottomBtnisEable.value, () {
|
||||||
Get.toNamed(Routers.remoteControlListPage, arguments: <String, int?>{
|
Get.toNamed(Routers.remoteControlListPage, arguments: <String, int?>{
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'lockId': state.keyInfos.value.lockId,
|
||||||
});
|
});
|
||||||
@ -1146,9 +1047,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
//可视对讲门锁新增->人脸
|
//可视对讲门锁新增->人脸
|
||||||
if (state.keyInfos.value.lockFeature!.d3Face == 1) {
|
if (state.keyInfos.value.lockFeature!.d3Face == 1) {
|
||||||
showWidgetArr.add(
|
showWidgetArr.add(
|
||||||
bottomItem(
|
bottomItem('images/main/icon_face.png', '人脸'.tr, state.bottomBtnisEable.value, () {
|
||||||
'images/main/icon_face.png', '人脸'.tr, state.bottomBtnisEable.value,
|
|
||||||
() {
|
|
||||||
Get.toNamed(Routers.faceListPage, arguments: <String, int?>{
|
Get.toNamed(Routers.faceListPage, arguments: <String, int?>{
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'lockId': state.keyInfos.value.lockId,
|
||||||
});
|
});
|
||||||
@ -1158,9 +1057,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
if (state.keyInfos.value.lockFeature!.isSupportIris == 1) {
|
if (state.keyInfos.value.lockFeature!.isSupportIris == 1) {
|
||||||
showWidgetArr.add(
|
showWidgetArr.add(
|
||||||
bottomItem(
|
bottomItem('images/main/icon_iris.png', '虹膜'.tr, state.bottomBtnisEable.value, () {
|
||||||
'images/main/icon_iris.png', '虹膜'.tr, state.bottomBtnisEable.value,
|
|
||||||
() {
|
|
||||||
Get.toNamed(Routers.irisListPage, arguments: <String, int?>{
|
Get.toNamed(Routers.irisListPage, arguments: <String, int?>{
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'lockId': state.keyInfos.value.lockId,
|
||||||
});
|
});
|
||||||
@ -1170,9 +1067,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
if (state.keyInfos.value.lockFeature!.palmVein == 1) {
|
if (state.keyInfos.value.lockFeature!.palmVein == 1) {
|
||||||
showWidgetArr.add(
|
showWidgetArr.add(
|
||||||
bottomItem(
|
bottomItem('images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value, () {
|
||||||
'images/main/icon_palm.png', '掌静脉'.tr, state.bottomBtnisEable.value,
|
|
||||||
() {
|
|
||||||
Get.toNamed(Routers.palmListPage, arguments: <String, int?>{
|
Get.toNamed(Routers.palmListPage, arguments: <String, int?>{
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'lockId': state.keyInfos.value.lockId,
|
||||||
});
|
});
|
||||||
@ -1183,8 +1078,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
//可视对讲门锁新增->监控
|
//可视对讲门锁新增->监控
|
||||||
if (state.keyInfos.value.lockFeature!.isSupportCatEye == 1) {
|
if (state.keyInfos.value.lockFeature!.isSupportCatEye == 1) {
|
||||||
showWidgetArr.add(
|
showWidgetArr.add(
|
||||||
bottomItem('images/main/icon_catEyes.png', '监控'.tr,
|
bottomItem('images/main/icon_catEyes.png', '监控'.tr, state.bottomBtnisEable.value, () async {
|
||||||
state.bottomBtnisEable.value, () async {
|
|
||||||
logic.sendMonitorMessage();
|
logic.sendMonitorMessage();
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@ -1192,33 +1086,28 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
// 授权管理员
|
// 授权管理员
|
||||||
if (state.keyInfos.value.isLockOwner == 1) {
|
if (state.keyInfos.value.isLockOwner == 1) {
|
||||||
showWidgetArr.add(bottomItem('images/main/icon_main_authorizedAdmin.png',
|
showWidgetArr
|
||||||
'授权管理员'.tr, state.bottomBtnisEable.value, () {
|
.add(bottomItem('images/main/icon_main_authorizedAdmin.png', '授权管理员'.tr, state.bottomBtnisEable.value, () {
|
||||||
Get.toNamed(Routers.authorizedAdminListPage,
|
Get.toNamed(Routers.authorizedAdminListPage,
|
||||||
arguments: <String, LockListInfoItemEntity>{
|
arguments: <String, LockListInfoItemEntity>{'keyInfo': state.keyInfos.value});
|
||||||
'keyInfo': state.keyInfos.value
|
|
||||||
});
|
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
final List<Widget> endWiddget = <Widget>[];
|
final List<Widget> endWiddget = <Widget>[];
|
||||||
endWiddget.add(
|
endWiddget.add(
|
||||||
// 操作记录
|
// 操作记录
|
||||||
bottomItem('images/main/icon_main_operatingRecord.png', '操作记录'.tr,
|
bottomItem('images/main/icon_main_operatingRecord.png', '操作记录'.tr, state.bottomBtnisEable.value, () {
|
||||||
state.bottomBtnisEable.value, () {
|
|
||||||
// Get.toNamed(Routers.lockOperatingRecordPage,
|
// Get.toNamed(Routers.lockOperatingRecordPage,
|
||||||
// arguments: {"keyInfo": state.keyInfos.value});
|
// arguments: {"keyInfo": state.keyInfos.value});
|
||||||
Get.toNamed(Routers.doorLockLogPage,
|
Get.toNamed(Routers.doorLockLogPage,
|
||||||
arguments: <String, LockListInfoItemEntity>{
|
arguments: <String, LockListInfoItemEntity>{'keyInfo': state.keyInfos.value});
|
||||||
'keyInfo': state.keyInfos.value
|
|
||||||
});
|
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
if (state.keyInfos.value.lockFeature!.isSupportCatEye == 1) {
|
if (state.keyInfos.value.lockFeature!.isSupportCatEye == 1) {
|
||||||
//视频日志
|
//视频日志
|
||||||
endWiddget.add(bottomItem('images/main/icon_lockDetail_videoLog.png',
|
endWiddget
|
||||||
'视频日志'.tr, state.bottomBtnisEable.value, () {
|
.add(bottomItem('images/main/icon_lockDetail_videoLog.png', '视频日志'.tr, state.bottomBtnisEable.value, () {
|
||||||
Get.toNamed(Routers.videoLogPage, arguments: <String, int?>{
|
Get.toNamed(Routers.videoLogPage, arguments: <String, int?>{
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'lockId': state.keyInfos.value.lockId,
|
||||||
});
|
});
|
||||||
@ -1227,12 +1116,10 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
if (!F.isProductionEnv) {
|
if (!F.isProductionEnv) {
|
||||||
endWiddget.add(
|
endWiddget.add(
|
||||||
// 消息提醒
|
// 消息提醒
|
||||||
bottomItem('images/main/icon_lockDetail_messageReminding.png',
|
bottomItem('images/main/icon_lockDetail_messageReminding.png', '消息提醒'.tr, state.bottomBtnisEable.value, () {
|
||||||
'消息提醒'.tr, state.bottomBtnisEable.value, () {
|
|
||||||
Get.toNamed(Routers.msgNotificationPage, arguments: <String, int?>{
|
Get.toNamed(Routers.msgNotificationPage, arguments: <String, int?>{
|
||||||
'lockId': state.keyInfos.value.lockId,
|
'lockId': state.keyInfos.value.lockId,
|
||||||
'isSupportCatEye':
|
'isSupportCatEye': state.keyInfos.value.lockFeature!.isSupportCatEye,
|
||||||
state.keyInfos.value.lockFeature!.isSupportCatEye,
|
|
||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@ -1254,8 +1141,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
return showWidgetArr;
|
return showWidgetArr;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget bottomItem(
|
Widget bottomItem(String iconUrl, String name, bool bottomBtnisEable, Function() onClick) {
|
||||||
String iconUrl, String name, bool bottomBtnisEable, Function() onClick) {
|
|
||||||
final Widget child = F.sw(
|
final Widget child = F.sw(
|
||||||
skyCall: () => Container(
|
skyCall: () => Container(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@ -1268,9 +1154,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
child: Image.asset(iconUrl,
|
child: Image.asset(iconUrl,
|
||||||
width: 42.w,
|
width: 42.w,
|
||||||
height: 42.w,
|
height: 42.w,
|
||||||
color: bottomBtnisEable
|
color: bottomBtnisEable ? AppColors.mainColor : AppColors.lockDetailBottomBtnUneable,
|
||||||
? AppColors.mainColor
|
|
||||||
: AppColors.lockDetailBottomBtnUneable,
|
|
||||||
fit: BoxFit.fitWidth),
|
fit: BoxFit.fitWidth),
|
||||||
),
|
),
|
||||||
SizedBox(height: 5.h),
|
SizedBox(height: 5.h),
|
||||||
@ -1278,9 +1162,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
child: Text(name,
|
child: Text(name,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp,
|
fontSize: 20.sp,
|
||||||
color: bottomBtnisEable
|
color: bottomBtnisEable ? AppColors.blackColor : AppColors.lockDetailBottomBtnUneable),
|
||||||
? AppColors.blackColor
|
|
||||||
: AppColors.lockDetailBottomBtnUneable),
|
|
||||||
textAlign: TextAlign.center))
|
textAlign: TextAlign.center))
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -1298,9 +1180,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
child: Image.asset(iconUrl,
|
child: Image.asset(iconUrl,
|
||||||
width: 42.w,
|
width: 42.w,
|
||||||
height: 42.w,
|
height: 42.w,
|
||||||
color: bottomBtnisEable
|
color: bottomBtnisEable ? AppColors.mainColor : AppColors.lockDetailBottomBtnUneable,
|
||||||
? AppColors.mainColor
|
|
||||||
: AppColors.lockDetailBottomBtnUneable,
|
|
||||||
fit: BoxFit.fitWidth),
|
fit: BoxFit.fitWidth),
|
||||||
),
|
),
|
||||||
SizedBox(height: 15.h),
|
SizedBox(height: 15.h),
|
||||||
@ -1313,9 +1193,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 20.sp,
|
fontSize: 20.sp,
|
||||||
height: 1.0,
|
height: 1.0,
|
||||||
color: bottomBtnisEable
|
color: bottomBtnisEable ? AppColors.blackColor : AppColors.lockDetailBottomBtnUneable),
|
||||||
? AppColors.blackColor
|
|
||||||
: AppColors.lockDetailBottomBtnUneable),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -1347,18 +1225,14 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
|
|
||||||
Widget _unlockSuccessWidget() {
|
Widget _unlockSuccessWidget() {
|
||||||
String lockAlias = state.keyInfos.value.lockAlias!;
|
String lockAlias = state.keyInfos.value.lockAlias!;
|
||||||
final TextStyle lockAliasTextStyle =
|
final TextStyle lockAliasTextStyle = TextStyle(color: AppColors.placeholderTextColor, fontSize: 24.sp);
|
||||||
TextStyle(color: AppColors.placeholderTextColor, fontSize: 24.sp);
|
|
||||||
final TextPainter textPainter = TextPainter(
|
final TextPainter textPainter = TextPainter(
|
||||||
text: TextSpan(text: lockAlias, style: lockAliasTextStyle),
|
text: TextSpan(text: lockAlias, style: lockAliasTextStyle), maxLines: 1, textDirection: TextDirection.ltr)
|
||||||
maxLines: 1,
|
|
||||||
textDirection: TextDirection.ltr)
|
|
||||||
..layout(minWidth: 0, maxWidth: double.infinity);
|
..layout(minWidth: 0, maxWidth: double.infinity);
|
||||||
|
|
||||||
final double textSizeWidth = textPainter.size.width; // 获取文本的尺寸
|
final double textSizeWidth = textPainter.size.width; // 获取文本的尺寸
|
||||||
if (textSizeWidth > 358.w * 2 - 20) {
|
if (textSizeWidth > 358.w * 2 - 20) {
|
||||||
lockAlias =
|
lockAlias = '${lockAlias.substring(0, lockAlias.length > 25 ? 25 : lockAlias.length)}...';
|
||||||
'${lockAlias.substring(0, lockAlias.length > 25 ? 25 : lockAlias.length)}...';
|
|
||||||
}
|
}
|
||||||
return Center(
|
return Center(
|
||||||
child: Stack(
|
child: Stack(
|
||||||
@ -1378,17 +1252,13 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
Text(state.iSOpenLock.value == true ? '已开锁'.tr : '已闭锁'.tr,
|
Text(state.iSOpenLock.value == true ? '已开锁'.tr : '已闭锁'.tr,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
style: TextStyle(
|
style: TextStyle(color: AppColors.mainColor, fontSize: 32.sp, fontWeight: FontWeight.w600)),
|
||||||
color: AppColors.mainColor,
|
|
||||||
fontSize: 32.sp,
|
|
||||||
fontWeight: FontWeight.w600)),
|
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 10.h,
|
height: 10.h,
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
lockAlias,
|
lockAlias,
|
||||||
style: TextStyle(
|
style: TextStyle(color: AppColors.placeholderTextColor, fontSize: 24.sp),
|
||||||
color: AppColors.placeholderTextColor, fontSize: 24.sp),
|
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
),
|
),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
@ -1396,8 +1266,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
getCurrentFormattedTime(),
|
getCurrentFormattedTime(),
|
||||||
style: TextStyle(
|
style: TextStyle(color: AppColors.darkGrayTextColor, fontSize: 24.sp),
|
||||||
color: AppColors.darkGrayTextColor, fontSize: 24.sp),
|
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
@ -1476,10 +1345,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
// AppLog.log('点击开锁 state.openDoorModel = 0 不需要联网');
|
// AppLog.log('点击开锁 state.openDoorModel = 0 不需要联网');
|
||||||
// FlutterBuglyPlugin.reportException(exceptionName: '点击了不需要联网开锁');
|
// FlutterBuglyPlugin.reportException(exceptionName: '点击了不需要联网开锁');
|
||||||
BuglyTool.uploadException(
|
BuglyTool.uploadException(
|
||||||
message: '点击了不需要联网开锁',
|
message: '点击了不需要联网开锁', detail: '点击了不需要联网开锁 openDoorModel:${state.openDoorModel}', upload: false, begin: true);
|
||||||
detail: '点击了不需要联网开锁 openDoorModel:${state.openDoorModel}',
|
|
||||||
upload: false,
|
|
||||||
begin: true);
|
|
||||||
AppLog.log('点击开锁 state.openDoorModel = 0 不需要联网');
|
AppLog.log('点击开锁 state.openDoorModel = 0 不需要联网');
|
||||||
logic.openDoorAction();
|
logic.openDoorAction();
|
||||||
} else {
|
} else {
|
||||||
@ -1488,10 +1354,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
// AppLog.log('点击开锁 state.openDoorModel = 2 需要联网');
|
// AppLog.log('点击开锁 state.openDoorModel = 2 需要联网');
|
||||||
// FlutterBuglyPlugin.reportException(exceptionName: '点击了需要联网开锁');
|
// FlutterBuglyPlugin.reportException(exceptionName: '点击了需要联网开锁');
|
||||||
BuglyTool.uploadException(
|
BuglyTool.uploadException(
|
||||||
message: '点击了需要联网开锁',
|
message: '点击了需要联网开锁', detail: '点击了需要联网开锁 openDoorModel:${state.openDoorModel}', upload: false, begin: true);
|
||||||
detail: '点击了需要联网开锁 openDoorModel:${state.openDoorModel}',
|
|
||||||
upload: false,
|
|
||||||
begin: true);
|
|
||||||
AppLog.log('点击开锁 state.openDoorModel = 2 需要联网');
|
AppLog.log('点击开锁 state.openDoorModel = 2 需要联网');
|
||||||
logic.getLockNetToken();
|
logic.getLockNetToken();
|
||||||
}
|
}
|
||||||
@ -1526,8 +1389,7 @@ class _LockDetailPageState extends State<LockDetailPage>
|
|||||||
state.closedUnlockSuccessfulTimer?.cancel();
|
state.closedUnlockSuccessfulTimer?.cancel();
|
||||||
_lockRefreshLockDetailInfoDataEvent?.cancel();
|
_lockRefreshLockDetailInfoDataEvent?.cancel();
|
||||||
state.replySubscription.cancel();
|
state.replySubscription.cancel();
|
||||||
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent
|
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent?.cancel();
|
||||||
?.cancel();
|
|
||||||
state.LockSetChangeSetRefreshLockDetailWithTypeSubscription?.cancel();
|
state.LockSetChangeSetRefreshLockDetailWithTypeSubscription?.cancel();
|
||||||
if (state.animationController != null) {
|
if (state.animationController != null) {
|
||||||
state.animationController!.dispose();
|
state.animationController!.dispose();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user