Merge remote-tracking branch 'origin/master'

This commit is contained in:
葛佳祥 2024-01-17 18:43:40 +08:00
commit a854157111
4 changed files with 48 additions and 34 deletions

View File

@ -118,7 +118,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance?.addObserver(this); WidgetsBinding.instance.addObserver(this);
openBlueScan(); openBlueScan();

View File

@ -42,8 +42,7 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
body: ListView( body: ListView(
children: [ children: [
CommonItem( CommonItem(
leftTitel: leftTitel: TranslationLoader.lanKeys!.lockNumber!.tr,
TranslationLoader.lanKeys!.lockNumber!.tr,
rightTitle: state.lockBasicInfo.value.lockName, rightTitle: state.lockBasicInfo.value.lockName,
allHeight: 70.h, allHeight: 70.h,
isHaveLine: true), isHaveLine: true),
@ -56,19 +55,18 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
height: 10.h, height: 10.h,
), ),
CommonItem( CommonItem(
leftTitel: TranslationLoader leftTitel: TranslationLoader.lanKeys!.electricQuantity!.tr,
.lanKeys!.electricQuantity!.tr,
rightTitle: "${state.lockBasicInfo.value.electricQuantity}%", rightTitle: "${state.lockBasicInfo.value.electricQuantity}%",
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Navigator.pushNamed(
Routers.uploadElectricQuantityPage, context, Routers.uploadElectricQuantityPage, arguments: {
arguments: {'lockSetInfoData': state.lockSetInfoData.value}); 'lockSetInfoData': state.lockSetInfoData.value
});
}), }),
CommonItem( CommonItem(
leftTitel: TranslationLoader leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
.lanKeys!.periodValidity!.tr,
rightTitle: getUseDateStr(state.lockBasicInfo.value), rightTitle: getUseDateStr(state.lockBasicInfo.value),
allHeight: 70.h, allHeight: 70.h,
isHaveLine: false), isHaveLine: false),
@ -76,28 +74,28 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
height: 10.h, height: 10.h,
), ),
CommonItem( CommonItem(
leftTitel: leftTitel: TranslationLoader.lanKeys!.lockName!.tr,
TranslationLoader.lanKeys!.lockName!.tr,
rightTitle: state.lockBasicInfo.value.lockAlias, rightTitle: state.lockBasicInfo.value.lockAlias,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
var data = await Get.toNamed(Routers.editLockNamePage, arguments: {'lockSetInfoData': state.lockSetInfoData.value}); var data = await Get.toNamed(Routers.editLockNamePage,
if(data != null) { arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
if (data != null) {
setState(() { setState(() {
state.lockBasicInfo.value = data["lockBasicInfo"]; state.lockBasicInfo.value = data["lockBasicInfo"];
}); });
} }
}), }),
CommonItem( CommonItem(
leftTitel: leftTitel: TranslationLoader.lanKeys!.lockGrouping!.tr,
TranslationLoader.lanKeys!.lockGrouping!.tr,
// rightTitle: state.getKeyInfosData.value.groupName == "" ? _groupName : itemData.groupName, // rightTitle: state.getKeyInfosData.value.groupName == "" ? _groupName : itemData.groupName,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () async { action: () async {
Navigator.pushNamed( Navigator.pushNamed(context, Routers.lockSeletGroupingPage,
context, Routers.lockSeletGroupingPage,
arguments: { arguments: {
'lockSetInfoData': state.lockSetInfoData.value 'lockSetInfoData': state.lockSetInfoData.value
}).then((val) { }).then((val) {
@ -108,16 +106,22 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
}); });
}), }),
Visibility( Visibility(
visible: (state.lockBasicInfo.value.isLockOwner == 1 || state.lockBasicInfo.value.keyRight == 1) ? true : false, visible: (state.lockBasicInfo.value.isLockOwner == 1 ||
state.lockBasicInfo.value.keyRight == 1)
? true
: false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.adminOpenLockPassword!.tr, leftTitel:
TranslationLoader.lanKeys!.adminOpenLockPassword!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.adminOpenLockPasswordPage); Navigator.pushNamed(
context, Routers.adminOpenLockPasswordPage);
}), }),
), ),
/* 2024-01-12 by DaisyWu
CommonItem( CommonItem(
leftTitel: leftTitel:
TranslationLoader.lanKeys!.unlockQRCode!.tr, TranslationLoader.lanKeys!.unlockQRCode!.tr,
@ -127,9 +131,9 @@ class _BasicInformationPageState extends State<BasicInformationPage> {
action: () { action: () {
Get.toNamed(Routers.unlockQRCodePage); Get.toNamed(Routers.unlockQRCodePage);
}), }),
*/
], ],
) ));
);
} }
//使 //使

View File

@ -60,7 +60,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
List<Widget> getListWidget() { List<Widget> getListWidget() {
print( print(
"state.lockBasicInfo.value.isLockOwner:${state.lockBasicInfo.value.isLockOwner} state.lockBasicInfo.value.keyRight:${state.lockBasicInfo.value.keyRight}"); "state.lockBasicInfo.value.isLockOwner:${state.lockBasicInfo.value.isLockOwner} state.lockBasicInfo.value.keyRight:${state.lockBasicInfo.value.keyRight}");
if (state.lockBasicInfo.value.isLockOwner == 1 || state.lockBasicInfo.value.keyRight == 1) { if (state.lockBasicInfo.value.isLockOwner == 1 ||
state.lockBasicInfo.value.keyRight == 1) {
// //
return getAllWidget(); return getAllWidget();
} else { } else {
@ -105,7 +106,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
// //
Obx(() => Visibility( Obx(() => Visibility(
// visible: state.lockFeature.value.passageMode == 1 ? true : false, // visible: state.lockFeature.value.passageMode == 1 ? true : false,
visible:true, visible: true,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr, leftTitel: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1 rightTitle: (state.lockSettingInfo.value.passageMode ?? 0) == 1
@ -418,8 +419,9 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
Get.toNamed(Routers.motorPowerPage); Get.toNamed(Routers.motorPowerPage);
})), })),
// 广使 // 广使
/* 2024-01-12 广 by DaisyWu
Obx(() => Visibility( Obx(() => Visibility(
visible: true, visible: true,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.bluetoothBroadcast!.tr, leftTitel: TranslationLoader.lanKeys!.bluetoothBroadcast!.tr,
rightTitle: "", rightTitle: "",
@ -427,6 +429,7 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: _lockBlueBroadcastSwitch()))), rightWidget: _lockBlueBroadcastSwitch()))),
SizedBox(height: 10.h), SizedBox(height: 10.h),
*/
//----- //-----
// //
Obx(() { Obx(() {
@ -450,7 +453,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
})); }));
}), }),
// //
Obx(() => Visibility( Obx(
() => Visibility(
visible: state.lockFeature.value.attendance == 1 ? true : false, visible: state.lockFeature.value.attendance == 1 ? true : false,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr,
@ -596,7 +600,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
// //
CupertinoSwitch _openCheckInSwitch() { CupertinoSwitch _openCheckInSwitch() {
print("111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}"); print(
"111111state.lockSettingInfo.value.attendance:${state.lockSettingInfo.value.attendance}");
return CupertinoSwitch( return CupertinoSwitch(
activeColor: CupertinoColors.activeBlue, activeColor: CupertinoColors.activeBlue,
trackColor: CupertinoColors.systemGrey5, trackColor: CupertinoColors.systemGrey5,
@ -814,10 +819,11 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
print("lockSet===didPop"); print("lockSet===didPop");
logic.cancelBlueConnetctToastTimer(); logic.cancelBlueConnetctToastTimer();
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true); if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
if(state.deletWaitScanTimer != null){ if (state.deletWaitScanTimer != null) {
state.deletWaitScanTimer!.cancel(); state.deletWaitScanTimer!.cancel();
} }
if(state.deletWaitScanCompleter != null && !state.deletWaitScanCompleter!.isCompleted){ if (state.deletWaitScanCompleter != null &&
!state.deletWaitScanCompleter!.isCompleted) {
state.deletWaitScanCompleter!.complete(); state.deletWaitScanCompleter!.complete();
} }
BlueManage().stopScan(); BlueManage().stopScan();
@ -840,10 +846,11 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
logic.cancelBlueConnetctToastTimer(); logic.cancelBlueConnetctToastTimer();
if (EasyLoading.isShow) EasyLoading.dismiss(animation: true); if (EasyLoading.isShow) EasyLoading.dismiss(animation: true);
if(state.deletWaitScanTimer != null){ if (state.deletWaitScanTimer != null) {
state.deletWaitScanTimer!.cancel(); state.deletWaitScanTimer!.cancel();
} }
if(state.deletWaitScanCompleter != null && !state.deletWaitScanCompleter!.isCompleted){ if (state.deletWaitScanCompleter != null &&
!state.deletWaitScanCompleter!.isCompleted) {
state.deletWaitScanCompleter!.complete(); state.deletWaitScanCompleter!.complete();
} }
BlueManage().stopScan(); BlueManage().stopScan();

View File

@ -45,6 +45,7 @@ class _MineSetPageState extends State<MineSetPage> {
Widget getListDataView() { Widget getListDataView() {
return Column( return Column(
children: [ children: [
/* 2024-01-12 by DaisyWu
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.prompTone!.tr, leftTitel: TranslationLoader.lanKeys!.prompTone!.tr,
rightTitle: "", rightTitle: "",
@ -63,6 +64,7 @@ class _MineSetPageState extends State<MineSetPage> {
width: 60.w, width: 60.w,
height: 50.h, height: 50.h,
child: Obx(() => _isTouchUnlockSwitch()))), child: Obx(() => _isTouchUnlockSwitch()))),
*/
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr, leftTitel: TranslationLoader.lanKeys!.pushNotification!.tr,
rightTitle: "", rightTitle: "",
@ -137,6 +139,7 @@ class _MineSetPageState extends State<MineSetPage> {
state.currentLanguage.value = result['currentLanguage']; state.currentLanguage.value = result['currentLanguage'];
} }
})), })),
/* 2024-01-12 by DaisyWu
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.lockScreen!.tr, leftTitel: TranslationLoader.lanKeys!.lockScreen!.tr,
rightTitle: (state.lockScreen.value == 1 rightTitle: (state.lockScreen.value == 1
@ -150,6 +153,7 @@ class _MineSetPageState extends State<MineSetPage> {
logic.userSettingsInfoRequest(); logic.userSettingsInfoRequest();
}); });
})), })),
*/
Obx(() => CommonItem( Obx(() => CommonItem(
leftTitel: leftTitel:
TranslationLoader.lanKeys!.hideInvalidUnlockPermissions!.tr, TranslationLoader.lanKeys!.hideInvalidUnlockPermissions!.tr,
@ -197,8 +201,7 @@ class _MineSetPageState extends State<MineSetPage> {
logic.showToast("功能暂未开放"); logic.showToast("功能暂未开放");
}), }),
CommonItem( CommonItem(
leftTitel: TranslationLoader leftTitel: TranslationLoader.lanKeys!.xiaomiIOTPlatform!.tr,
.lanKeys!.xiaomiIOTPlatform!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,