Merge branch 'master' of https://gitee.com/starlock-cn/app-starlock into starLock_wsy

This commit is contained in:
魏少阳 2024-04-19 18:22:55 +08:00
commit 3fd0d72730
54 changed files with 1366 additions and 959 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -25,6 +25,26 @@ if (flutterVersionName == null) {
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.android.application'
apply plugin: 'android-junk-code'
androidJunkCode {
variantConfig {
release {
//release是变体名称productFlavors就是buildType名称productFlavors就是flavor+buildTypefreeReleaseproRelease
packageBase = "cn.hx.plugin.ui" //java类根包名
packageCount = 30 //
activityCountPerPackage = 3 //Activity类数量
excludeActivityJavaFile = false
//Activity的Java文件,false(layout和写入AndroidManifest.xml还会执行)
otherCountPerPackage = 50 //
methodCountPerClass = 20 //
resPrefix = "junk_" //layoutdrawablestring等资源名前缀
drawableCount = 300 //drawable资源数量
stringCount = 300 //string数量
}
}
}
android {
signingConfigs {
@ -100,7 +120,7 @@ android {
dimension "flavor-type"
applicationId "com.xhjcn.lock"
signingConfig signingConfigs.xhj
resValue "string", "app_name", "锁"
resValue "string", "app_name", "星星锁"
manifestPlaceholders.JPUSH_PKGNAME = "com.xhjcn.lock"
}
}

View File

@ -17,6 +17,8 @@ buildscript {
classpath 'com.google.gms:google-services:4.3.8'
// hms
classpath 'com.huawei.agconnect:agcp:1.6.0.300'
//
classpath "com.github.qq549631030:android-junk-code:1.3.3"
}
}

View File

@ -39,7 +39,7 @@
# flutter run --flavor dev -t lib/main_dev.dart
# flutter run --flavor pre -t lib/main_pre.dart
# flutter run --flavor sky -t lib/main_sky_full.dart
# flutter run --flavor xhj -t lib/main_xhj.dart
# flutter run --flavor xhj -t lib/main_xhj_full.dart
# 下面是安卓发布编译命令
# flutter build apk --split-per-abi --release --flavor sky -t lib/main_sky_full.dart

View File

@ -726,5 +726,9 @@
"商城":"mall",
"我的":"my",
"微信公众号推送":"Wechat public account",
"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置":"To open wechat to receive alarm messages, you need to pay attention to Skye Smart Lock wechat public account first, please save the QR code and use wechat to scan the Settings"
"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置":"To open wechat to receive alarm messages, you need to pay attention to Skye Smart Lock wechat public account first, please save the QR code and use wechat to scan the Settings",
"蓝牙":"Bluetooth",
"需要访问蓝牙权限才能使用添加钥匙功能的位置信息":"Access to Bluetooth permissions is required to use the location information of the add key function",
"请输入Email":"Please enter Email",
"请输入手机号":"Please enter mobile phone number"
}

View File

@ -725,5 +725,9 @@
"商城":"mall",
"我的":"my",
"微信公众号推送":"微信公众号推送",
"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置":"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置"
"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置":"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置",
"蓝牙":"蓝牙",
"需要访问蓝牙权限才能使用添加钥匙功能的位置信息":"需要访问蓝牙权限才能使用添加钥匙功能的位置信息",
"请输入Email":"请输入Email",
"请输入手机号":"请输入手机号"
}

View File

@ -727,5 +727,9 @@
"商城":"商城",
"我的":"我的",
"微信公众号推送":"微信公众号推送",
"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置":"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置"
"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置":"开启微信接收报警消息需要先关注斯凯智能锁微信公众号,请保存二维码并使用微信扫一扫设置",
"蓝牙":"蓝牙",
"需要访问蓝牙权限才能使用添加钥匙功能的位置信息":"需要访问蓝牙权限才能使用添加钥匙功能的位置信息",
"请输入Email":"请输入Email",
"请输入手机号":"请输入手机号"
}

View File

@ -1,6 +1,6 @@
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main_xhj.dart
FLUTTER_TARGET=lib/main_xhj_full.dart
ASSET_PREFIX=xhj
BUNDLE_NAME=
BUNDLE_DISPLAY_NAME=
BUNDLE_NAME=星星
BUNDLE_DISPLAY_NAME=星星

View File

@ -1,6 +1,6 @@
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main_xhj.dart
FLUTTER_TARGET=lib/main_xhj_full.dart
ASSET_PREFIX=xhj
BUNDLE_NAME=
BUNDLE_DISPLAY_NAME=
BUNDLE_NAME=星星
BUNDLE_DISPLAY_NAME=星星

View File

@ -1,6 +1,6 @@
#include "Generated.xcconfig"
FLUTTER_TARGET=lib/main_xhj.dart
FLUTTER_TARGET=lib/main_xhj_lite.dart
ASSET_PREFIX=xhj
BUNDLE_NAME=
BUNDLE_DISPLAY_NAME=
BUNDLE_NAME=星星
BUNDLE_DISPLAY_NAME=星星

View File

@ -116,20 +116,7 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
04BFC44A2BCFE48600688FCA /* RunnerRelease-xhj.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerRelease-xhj.entitlements"; sourceTree = "<group>"; };
04BFC44B2BD0B50A00688FCA /* RunnerProfile-xhj.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerProfile-xhj.entitlements"; sourceTree = "<group>"; };
04BFC44C2BD0B51500688FCA /* RunnerDebug-xhj.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerDebug-xhj.entitlements"; sourceTree = "<group>"; };
04BFC44D2BD0B51D00688FCA /* RunnerRelease-sky.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerRelease-sky.entitlements"; sourceTree = "<group>"; };
04BFC44E2BD0B52300688FCA /* RunnerProfile-sky.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerProfile-sky.entitlements"; sourceTree = "<group>"; };
04BFC44F2BD0B52C00688FCA /* RunnerDebug-sky.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerDebug-sky.entitlements"; sourceTree = "<group>"; };
04BFC4502BD0B53400688FCA /* RunnerRelease-pre.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerRelease-pre.entitlements"; sourceTree = "<group>"; };
04BFC4512BD0B53B00688FCA /* RunnerProfile-pre.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerProfile-pre.entitlements"; sourceTree = "<group>"; };
04BFC4522BD0B54200688FCA /* RunnerDebug-pre.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerDebug-pre.entitlements"; sourceTree = "<group>"; };
04BFC4532BD0B54900688FCA /* RunnerRelease-dev.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerRelease-dev.entitlements"; sourceTree = "<group>"; };
04BFC4542BD0B55000688FCA /* RunnerProfile-dev.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerProfile-dev.entitlements"; sourceTree = "<group>"; };
04BFC4552BD0B55600688FCA /* RunnerDebug-dev.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerDebug-dev.entitlements"; sourceTree = "<group>"; };
04BFC4562BD0B55F00688FCA /* RunnerProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerProfile.entitlements; sourceTree = "<group>"; };
04BFC4572BD0B56600688FCA /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = "<group>"; };
04BFC4482BCFE05100688FCA /* RunnerRelease-xhj.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RunnerRelease-xhj.entitlements"; sourceTree = "<group>"; };
0BEB3ADCCEC961E2916B9004 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
0D02C18E16914A687A4A1AC2 /* devDebug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = devDebug.xcconfig; path = Flutter/devDebug.xcconfig; sourceTree = "<group>"; };
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
@ -406,20 +393,7 @@
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
04BFC4572BD0B56600688FCA /* RunnerRelease.entitlements */,
04BFC4562BD0B55F00688FCA /* RunnerProfile.entitlements */,
04BFC4552BD0B55600688FCA /* RunnerDebug-dev.entitlements */,
04BFC4542BD0B55000688FCA /* RunnerProfile-dev.entitlements */,
04BFC4532BD0B54900688FCA /* RunnerRelease-dev.entitlements */,
04BFC4522BD0B54200688FCA /* RunnerDebug-pre.entitlements */,
04BFC4512BD0B53B00688FCA /* RunnerProfile-pre.entitlements */,
04BFC4502BD0B53400688FCA /* RunnerRelease-pre.entitlements */,
04BFC44F2BD0B52C00688FCA /* RunnerDebug-sky.entitlements */,
04BFC44E2BD0B52300688FCA /* RunnerProfile-sky.entitlements */,
04BFC44D2BD0B51D00688FCA /* RunnerRelease-sky.entitlements */,
04BFC44C2BD0B51500688FCA /* RunnerDebug-xhj.entitlements */,
04BFC44B2BD0B50A00688FCA /* RunnerProfile-xhj.entitlements */,
04BFC44A2BCFE48600688FCA /* RunnerRelease-xhj.entitlements */,
04BFC4482BCFE05100688FCA /* RunnerRelease-xhj.entitlements */,
3364C3F32B0C902100AA5ABC /* lcokStarMain.png */,
82C026552AEB6C050011FE6A /* img */,
82C026532AE8AC6D0011FE6A /* AliyunEmasServices-Info.plist */,
@ -852,8 +826,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 22D858E988707FF26E068457 /* Pods-Runner.debug-xhj.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerDebug-xhj.entitlements";
DEVELOPMENT_TEAM = 7D53BZAN75;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
DEVELOPMENT_TEAM = P8997RW3V8;
PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
@ -866,8 +840,8 @@
isa = XCBuildConfiguration;
baseConfigurationReference = D62237D2D011BDC27FB2BC28 /* Pods-Runner.profile-xhj.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerProfile-xhj.entitlements";
DEVELOPMENT_TEAM = 7D53BZAN75;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
DEVELOPMENT_TEAM = P8997RW3V8;
PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
@ -881,7 +855,7 @@
baseConfigurationReference = CDC2B8ED804B514A774F187D /* Pods-Runner.release-xhj.xcconfig */;
buildSettings = {
CODE_SIGN_ENTITLEMENTS = "Runner/RunnerRelease-xhj.entitlements";
DEVELOPMENT_TEAM = 7D53BZAN75;
DEVELOPMENT_TEAM = P8997RW3V8;
PRODUCT_NAME = Runner;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;

View File

@ -116,23 +116,6 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver, BaseWidget {
}
}
void openBlueScan() {
if (Platform.isIOS) {
print("有蓝牙权限开始扫描");
// startScanAction();
} else {
getMicrophonePermission().then((value) {
if (value) {
//
print("有蓝牙权限开始扫描");
// startScanAction();
} else {
//
openAppSettings(); //app系统设置
}
});
}
}
Future<bool> getLoginStatus() async {
final data = await Storage.getString(saveUserLoginData);
@ -141,21 +124,3 @@ Future<bool> getLoginStatus() async {
}
return false;
}
///
Future<bool> getMicrophonePermission() async {
// You can request multiple permissions at once.
Map<Permission, PermissionStatus> statuses = await [
Permission.bluetoothScan,
Permission.bluetoothConnect,
Permission.location,
].request();
//granted denied permanentlyDenied
if (statuses[Permission.bluetoothScan]!.isGranted &&
statuses[Permission.bluetoothConnect]!.isGranted &&
statuses[Permission.location]!.isGranted) {
return true;
}
return false;
}

View File

@ -18,12 +18,12 @@ import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/catEyeSet/catEyeSet_
import 'package:star_lock/main/lockDetail/lockSet/catEyeSet/videoSlot/videoSlot_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/faceUnlock/faceUnlock_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/liveVideo/liveVideo_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockUser/lockUser_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/motorPower/motorPower_page.dart';
import 'package:star_lock/main/lockDetail/lockSet/openDoorDirection/openDoorDirection_page.dart';
import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/familyDetails/familyDetails_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprint/coerceFingerprint_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_page.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceOpenDoor/coerceOpenDoor_page.dart';

View File

@ -109,8 +109,8 @@ class F {
case Flavor.sky:
return 'https://lock.skychip.top';
case Flavor.xhj:
// return 'https://lock.xhjcn.ltd';
return 'https://pre.lock.star-lock.cn';
return 'https://lock.xhjcn.ltd';
// return 'https://pre.lock.star-lock.cn';
default:
throw Exception('flavor[$name] apiPrefix not found');
}

View File

@ -319,13 +319,6 @@ class LockDetailLogic extends BaseGetXController {
state.lockUserNo = reply.data[47];
_updateLockUserNo();
// if (state.isOpenLockNeedOnline.value == 0) {
// openDoorAction(1);
// } else {
// getLockNetToken();
// }
// eventBus.fire(RefreshLockDetailInfoDataEvent());
// clickPushBtnAction();
break;
case 0x06:
//
@ -468,91 +461,6 @@ class LockDetailLogic extends BaseGetXController {
});
}
//
// Future<void> editLockUserAction() async {
// BlueManage().bludSendData(BlueManage().connectDeviceMacAddress, BlueManage().connectDeviceName, (DeviceConnectionState state) async {
// if (state == DeviceConnectionState.connected){
// var publicKey = await Storage.getStringList(saveBluePublicKey);
// List<int> publicKeyDataList = changeStringListToIntList(publicKey!);
//
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
//
// var token = await Storage.getStringList(saveBlueToken);
// List<int> getTokenList = changeStringListToIntList(token!);
// print("openDoorTokenPubToken:$getTokenList");
//
// print("publicKey:$publicKey publicKeyDataList:$publicKeyDataList privateKey:$privateKey getPrivateKeyList:$getPrivateKeyList token:$token getTokenList:$getTokenList");
// IoSenderManage.senderEditUser(
// lockID:BlueManage().connectDeviceName,
// authUserID:await Storage.getUid(),
// keyID:"1",
// userID:await Storage.getUid(),
// openMode:1,
// keyType:1,
// startDate:0x11223344,
// expireDate:0x11223344,
// role:255,
// password:"123456",
// needAuthor:1,
// publicKey:publicKeyDataList,
// privateKey:getPrivateKeyList,
// token: getTokenList
// );
// }
// });
// }
//
// Future<void> _connectBlue(String bluetoothDeviceName) async {
// //
// BlueManage().connect(bluetoothDeviceName, (DeviceConnectionState state) async {
// if(EasyLoading.isShow){
// EasyLoading.dismiss();
// }
// if (state == DeviceConnectionState.connected){
// // var privateKey = await Storage.getStringList(saveBluePrivateKey);
// // List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
// // // IoSenderManage.senderGetLockStatu(
// // // lockID:BlueManage().connectDeviceName,
// // // userID:await Storage.getUid(),
// // // privateKey:getPrivateKeyList,
// // // );
// // IoSenderManage.senderGetStarLockStatuInfo(
// // lockID:BlueManage().connectDeviceName,
// // userID:await Storage.getUid(),
// // privateKey:getPrivateKeyList,
// // );
// }
// }, isShowLoading: false);
// }
//
// Future<void> getStarLockStatus() async {
// showEasyLoading();
// showBlueConnetctToastTimer(action: () {
// dismissEasyLoading();
// });
// BlueManage().bludSendData(BlueManage().connectDeviceName,
// (DeviceConnectionState deviceConnectionState) async {
// if (deviceConnectionState == DeviceConnectionState.connected) {
// dismissEasyLoading();
// var privateKey = await Storage.getStringList(saveBluePrivateKey);
// List<int> getPrivateKeyList = changeStringListToIntList(privateKey!);
// IoSenderManage.senderGetStarLockStatuInfo(
// lockID: BlueManage().connectDeviceName,
// userID: await Storage.getUid(),
// privateKey: getPrivateKeyList,
// );
// } else if (deviceConnectionState == DeviceConnectionState.disconnected) {
// dismissEasyLoading();
// cancelBlueConnetctToastTimer();
// if (state.ifCurrentScreen.value == true) {
// showBlueConnetctToast();
// }
// }
// });
// }
// ()
Future<void> senderReferEventRecordTime(int time) async {
@ -583,45 +491,6 @@ class LockDetailLogic extends BaseGetXController {
});
}
// // 0 1 2 3 4 5 6 7 8 9 10
// clickItemBtnAction(int type){
// state.clickNextType = type;
// if (state.lockUserNo == 0) {
// // lockUserNo为0
// addUserConnectBlue();
// } else {
// clickPushBtnAction();
// }
// }
//
// clickPushBtnAction(){
// // 0 1 2 3 4 5 6 7 8 9 10
// switch(state.clickNextType){
// case 0:
// //
// startOpenLock();
// break;
// case 1:
// //
// startUnLock();
// break;
// case 2:
// //
// Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value});
// break;
// case 3:
// //
// Get.toNamed(Routers.passwordKeyListPage, arguments: {"keyInfo": state.keyInfos.value});
// break;
// case 10:
// //
// Get.toNamed(Routers.lockSetPage, arguments: {
// "lockId": state.keyInfos.value.lockId,
// "isOnlyOneData": state.isOnlyOneData,
// });
// break;
// }
// }
// token
void getLockNetToken() async {
@ -696,17 +565,6 @@ class LockDetailLogic extends BaseGetXController {
}
}
//
// Future<void> uploadElectricQuantityRequest(String electricQuantity) async {
// KeyOperationRecordEntity entity = await ApiRepository.to
// .uploadElectricQuantity(
// electricQuantity, state.keyInfos.value.lockId.toString());
// if (entity.errorCode!.codeIsSuccessful) {
// showToast("电量更新成功", something: () {
// eventBus.fire(RefreshLockListInfoDataEvent());
// });
// }
// }
///
void initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() {
@ -763,81 +621,6 @@ class LockDetailLogic extends BaseGetXController {
return text;
}
// late StreamSubscription<List<DiscoveredDevice>>
// _scanListDiscoveredDeviceSubscription;
// void _scanListDiscoveredDeviceSubscriptionAction() {
// _scanListDiscoveredDeviceSubscription = EventBusManager().eventBus!.on<List<DiscoveredDevice>>().listen((List<DiscoveredDevice> list) {
// final knownDeviceIndex = list.indexWhere((d) => d.name == state.keyInfos.value.bluetooth!.bluetoothDeviceName!);
// if (knownDeviceIndex >= 0) {
// //
// state.currentDeviceUUid.value = (list[knownDeviceIndex].serviceUuids.isNotEmpty ? list[knownDeviceIndex].serviceUuids[0] : "").toString();
// }
// });
// }
//
// void _showFullScreenOverlay(BuildContext context) {
// Future.delayed(const Duration(seconds: 3), () {
// if (state.iSClosedUnlockSuccessfulPopup.value != true) {
// state.iSClosedUnlockSuccessfulPopup.value = true;
// Get.back();
// }
// });
// showModalBottomSheet(
// context: context,
// isScrollControlled: true,
// backgroundColor: Colors.transparent,
// builder: (BuildContext context) {
// return GestureDetector(
// onTap: () {
// if (state.iSClosedUnlockSuccessfulPopup.value != true) {
// state.iSClosedUnlockSuccessfulPopup.value = true;
// Get.back();
// }
// },
// child: Container(
// height: MediaQuery.of(context).size.height,
// width: MediaQuery.of(context).size.width,
// color: Colors.black.withOpacity(0.2),
// child: _unlockSuccessWidget(),
// ),
// );
// },
// );
// }
// Widget _unlockSuccessWidget() {
// return Stack(
// alignment: Alignment.center,
// children: [
// Image.asset(
// 'images/main/unlocked_bg.png',
// width: 358.w,
// height: 348.h,
// ),
// Positioned(
// top: ScreenUtil().screenHeight / 2,
// child: Column(
// children: [
// Text(
// state.keyInfos.value.lockAlias!,
// style: TextStyle(
// color: AppColors.placeholderTextColor, fontSize: 24.sp),
// ),
// SizedBox(
// height: 10.h,
// ),
// Text(
// getCurrentFormattedTime(),
// style: TextStyle(
// color: AppColors.darkGrayTextColor, fontSize: 24.sp),
// )
// ],
// ))
// ],
// );
// }
String getCurrentFormattedTime() {
//
DateTime now = DateTime.now();
@ -846,82 +629,23 @@ class LockDetailLogic extends BaseGetXController {
return formattedTime;
}
Future<void> positionPermissionAlert() async {
//
if (Platform.isAndroid) {
AppFirstEnterHandle().getAppFirstEnter(state.widgetContext, isAgreePosition);
var getFlag = await Storage.getString(isAgreePosition);
if (getFlag == isAgreePosition) {
openBlueSet();
}
} else {
openBlueSet();
}
}
openBlueSet() {
if (!Platform.isIOS) {
getMicrophonePermission().then((value) {
if (!value) {
// app系统设置
openAppSettings();
} else {
//
}
});
}
}
///
Future<bool> getMicrophonePermission() async {
// You can request multiple permissions at once.
Map<Permission, PermissionStatus> statuses = await [
Permission.bluetoothScan,
Permission.bluetoothConnect,
Permission.location,
].request();
//granted denied permanentlyDenied
if (statuses[Permission.bluetoothScan]!.isGranted &&
statuses[Permission.bluetoothConnect]!.isGranted &&
statuses[Permission.location]!.isGranted) {
return true;
}
return false;
}
@override
Future<void> onReady() async {
// TODO: implement onReady
super.onReady();
Get.log("LockDetailPage onReady");
// _initReplySubscription();
// _initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction();
// openBlueSet();
await PermissionDialog.request(Permission.location);
// positionPermissionAlert();
await PermissionDialog.requestBluetooth();
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
Get.log("LockDetailPage onInit");
//
// connectBlue();
}
@override
void onClose() {
// TODO: implement onClose
super.onClose();
Get.log("LockDetailPage onClose");
// _scanListDiscoveredDeviceSubscription.cancel();
}
}

View File

@ -1,10 +1,15 @@
import 'dart:async';
import 'package:colorfilter_generator/addons.dart';
import 'package:colorfilter_generator/colorfilter_generator.dart';
import 'package:colorfilter_generator/presets.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:intl/intl.dart';
import 'package:star_lock/flavors.dart';
import 'package:star_lock/tools/showTipView.dart';
import 'package:star_lock/widget/flavors_img.dart';
import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart';
@ -68,6 +73,7 @@ class _LockDetailPageState extends State<LockDetailPage>
}
StreamSubscription? _lockRefreshLockDetailInfoDataEvent;
void _initRefreshLockDetailInfoDataEventAction() {
// eventBus
_lockRefreshLockDetailInfoDataEvent =
@ -224,24 +230,33 @@ class _LockDetailPageState extends State<LockDetailPage>
Widget topWidget() {
return Column(
children: [
SizedBox(height: 50.h),
F.sw(
defaultCall: () => SizedBox(height: 50.h),
xhjCall: () => Padding(
padding: EdgeInsets.only(
top: 12.h,
left: 15.w,
bottom: 16.h,
right: 15.w,
),
child: adminInfoView(center: false, add: true),
),
),
Stack(
alignment: Alignment.center,
children: [
SizedBox(
width: 1.sw - 120.w * 2,
child: Center(
child: Text(
state.lockAlias.value,
style: TextStyle(
fontSize: 22.sp,
fontWeight: FontWeight.w400,
color: state.isOpenPassageMode.value == 1
? AppColors.openPassageModeColor
: AppColors.darkGrayTextColor),
))),
Center(
child: Text(
state.lockAlias.value,
style: TextStyle(
fontSize: 22.sp,
fontWeight: FontWeight.w400,
color: state.isOpenPassageMode.value == 1
? AppColors.openPassageModeColor
: AppColors.darkGrayTextColor),
)),
Positioned(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
GestureDetector(
onTap: () {
@ -252,20 +267,24 @@ class _LockDetailPageState extends State<LockDetailPage>
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(
showElectricIcon(state.electricQuantity.value),
width: 30.w,
height: 24.w),
FlavorsImg(
child: Image.asset(
showElectricIcon(state.electricQuantity.value),
width: 30.w,
height: 24.w),
),
SizedBox(width: 2.w),
Text("${state.electricQuantity.value}%",
style: TextStyle(
fontSize: 18.sp,
color: AppColors.darkGrayTextColor)),
SizedBox(width: 2.w),
Icon(
Icons.info, // 使 warning
color: AppColors.mainColor, //
size: 25.w, // 30
FlavorsImg(
child: Icon(
Icons.info, // 使 warning
color: AppColors.mainColor, //
size: 25.w, // 30
),
),
SizedBox(width: 20.w),
],
@ -274,18 +293,24 @@ class _LockDetailPageState extends State<LockDetailPage>
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Image.asset(showElectricIcon(state.electricQuantity.value),
width: 30.w, height: 24.w),
FlavorsImg(
child: Image.asset(
showElectricIcon(state.electricQuantity.value),
width: 30.w,
height: 24.w),
),
SizedBox(width: 2.w),
Text("--%",
style: TextStyle(
fontSize: 18.sp,
color: AppColors.darkGrayTextColor)),
SizedBox(width: 2.w),
Icon(
Icons.info, // 使 warning
color: AppColors.mainColor, //
size: 25.w, // 30
FlavorsImg(
child: Icon(
Icons.info, // 使 warning
color: AppColors.mainColor, //
size: 25.w, // 30
),
),
SizedBox(width: 20.w),
],
@ -294,7 +319,10 @@ class _LockDetailPageState extends State<LockDetailPage>
))
],
),
SizedBox(height: 30.h),
F.sw(
defaultCall: () => SizedBox(height: 30.h),
xhjCall: () => SizedBox(height: 15.h),
),
Container(
// width: 1.sw,
color: Colors.white,
@ -317,37 +345,43 @@ class _LockDetailPageState extends State<LockDetailPage>
setState(() {
startUnLock();
});
// startUnLock();
}
: null,
child: Stack(
children: [
Image.asset(
state.openDoorBtnisUneable.value == false
? 'images/main/icon_main_openLockBtn_grey.png'
: (state.isOpenPassageMode.value == 1
? 'images/main/icon_main_normallyOpenMode_center.png'
: 'images/main/icon_main_openLockBtn_center.png'),
width: 330.w,
height: 330.w,
FlavorsImg(
child: Image.asset(
state.openDoorBtnisUneable.value == false
? 'images/main/icon_main_openLockBtn_grey.png'
: (state.isOpenPassageMode.value == 1
? 'images/main/icon_main_normallyOpenMode_center.png'
: 'images/main/icon_main_openLockBtn_center.png'),
width: 330.w,
height: 330.w,
// color: AppColors.primaryTopColor,
),
),
state.openDoorBtnisUneable.value == false
? Positioned(
child: Image.asset(
'images/main/icon_main_openLockBtn_grey.png',
width: 330.w,
height: 330.w,
child: FlavorsImg(
child: Image.asset(
'images/main/icon_main_openLockBtn_grey.png',
width: 330.w,
height: 330.w,
),
),
)
: state.openLockBtnState.value == 1
? buildRotationTransition()
: Positioned(
child: FlavorsImg(
child: Image.asset(
state.isOpenPassageMode.value == 1
? 'images/main/icon_main_normallyOpenMode_circle.png'
: 'images/main/icon_main_openLockBtn_circle.png',
width: 330.w,
height: 330.w,
state.isOpenPassageMode.value == 1
? 'images/main/icon_main_normallyOpenMode_circle.png'
: 'images/main/icon_main_openLockBtn_circle.png',
width: 330.w,
height: 330.w,
),
)),
],
),
@ -358,21 +392,6 @@ class _LockDetailPageState extends State<LockDetailPage>
SizedBox(
height: 30.h,
),
// Row(
// mainAxisAlignment: MainAxisAlignment.center,
// children: [
// Text(
// '门已上锁',
// style: TextStyle(
// fontSize: 26.sp,
// color: Colors.black,
// fontWeight: FontWeight.w500),
// ),
// ],
// ),
// SizedBox(
// height: 6.h,
// ),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
@ -388,47 +407,7 @@ class _LockDetailPageState extends State<LockDetailPage>
SizedBox(
height: 30.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'images/icon_electronicKey_admin.png',
width: 24.w,
height: 20.w,
color: AppColors.blackColor, //
),
SizedBox(width: 6.w),
Text(
state.keyInfos.value.isLockOwner == 1
? TranslationLoader.lanKeys!.superAdmin!.tr
: (state.keyInfos.value.keyRight == 1
? TranslationLoader.lanKeys!.authorizedAdmin!.tr
: TranslationLoader.lanKeys!.normalUser!.tr),
style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
),
SizedBox(width: 80.w),
Image.asset(
state.keyInfos.value.remoteEnable == 1
? 'images/main/icon_main_remoteUnlocking.png'
: 'images/main/icon_main_remoteUnlocking_grey.png',
width: 24.w,
height: 20.w,
// color: state.keyInfos.value.remoteEnable == 1
// ? AppColors.btnDisableColor
// : AppColors.mainColor,
),
SizedBox(width: 6.w),
Text(
TranslationLoader.lanKeys!.gatewayDevice!.tr,
style: TextStyle(
fontSize: 20.sp,
color: state.keyInfos.value.remoteEnable == 1
? AppColors.mainColor
: AppColors.btnDisableColor),
),
],
),
F.sw(defaultCall: () => adminInfoView(), xhjCall: () => SizedBox()),
SizedBox(
height: 20.h,
),
@ -442,6 +421,77 @@ class _LockDetailPageState extends State<LockDetailPage>
);
}
Widget adminInfoView({bool center = true, bool add = false}) {
return Row(
mainAxisAlignment:
center ? MainAxisAlignment.center : MainAxisAlignment.start,
children: [
Image.asset(
'images/icon_electronicKey_admin.png',
width: 24.w,
height: 20.w,
color: AppColors.blackColor, //
),
SizedBox(width: 6.w),
Text(
state.keyInfos.value.isLockOwner == 1
? TranslationLoader.lanKeys!.superAdmin!.tr
: (state.keyInfos.value.keyRight == 1
? TranslationLoader.lanKeys!.authorizedAdmin!.tr
: TranslationLoader.lanKeys!.normalUser!.tr),
style: TextStyle(fontSize: 20.sp, color: AppColors.darkGrayTextColor),
),
if (add) SizedBox(width: 20.w) else SizedBox(width: 80.w),
FlavorsImg(
child: Image.asset(
state.keyInfos.value.remoteEnable == 1
? 'images/main/icon_main_remoteUnlocking.png'
: 'images/main/icon_main_remoteUnlocking_grey.png',
width: 24.w,
height: 20.w,
),
),
SizedBox(width: 6.w),
Text(
TranslationLoader.lanKeys!.gatewayDevice!.tr,
style: TextStyle(
fontSize: 20.sp,
color: state.keyInfos.value.remoteEnable == 1
? AppColors.mainColor
: AppColors.btnDisableColor),
),
if (add) ...[
const Spacer(),
GestureDetector(
onTap: () {
Get.toNamed(Routers.selectLockTypePage);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
FlavorsImg(
child: Image.asset(
'images/mine/icon_mine_main_addLock.png',
width: 24.w,
height: 20.w,
),
),
Text(
TranslationLoader.lanKeys!.addDevice!.tr,
style: TextStyle(
fontSize: 20.sp, color: AppColors.darkGrayTextColor),
)
],
),
),
),
]
],
);
}
//
Widget buildRotationTransition() {
return Positioned(
@ -451,12 +501,14 @@ class _LockDetailPageState extends State<LockDetailPage>
//
turns: state.animationController!,
//view
child: Image.asset(
state.isOpenPassageMode.value == 1
? 'images/main/icon_main_normallyOpenMode_circle.png'
: 'images/main/icon_main_openLockBtn_circle.png',
width: 330.w,
height: 330.w,
child: FlavorsImg(
child: Image.asset(
state.isOpenPassageMode.value == 1
? 'images/main/icon_main_normallyOpenMode_circle.png'
: 'images/main/icon_main_openLockBtn_circle.png',
width: 330.w,
height: 330.w,
),
),
),
);
@ -487,7 +539,7 @@ class _LockDetailPageState extends State<LockDetailPage>
return SizedBox(
width: ScreenUtil().screenWidth - 20.w,
child: GridView.count(
crossAxisCount: 4,
crossAxisCount: F.sw(defaultCall: () => 4, xhjCall: () => 3),
// childAspectRatio: 3,
crossAxisSpacing: 20.w,
mainAxisSpacing: 0.h,
@ -532,12 +584,14 @@ class _LockDetailPageState extends State<LockDetailPage>
return SizedBox(
width: ScreenUtil().screenWidth - 20.w,
child: GridView.count(
crossAxisCount: 4,
crossAxisCount: F.sw(defaultCall: () => 4, xhjCall: () => 3),
// childAspectRatio: 3,
crossAxisSpacing: 25.h,
mainAxisSpacing: 0.h,
physics: const NeverScrollableScrollPhysics(),
children: getBottomWidget()),
children: F.sw(
defaultCall: () => getBottomWidget(),
xhjCall: () => getBottomWidget().reversed.toList())),
);
}
@ -554,7 +608,7 @@ class _LockDetailPageState extends State<LockDetailPage>
//
List<Widget> getNormalWidget() {
var showWidgetArr = <Widget>[];
List<Widget> showWidgetArr = <Widget>[];
//
if (state.isAttendance.value == 1) {
showWidgetArr.add(bottomItem(
@ -630,9 +684,6 @@ class _LockDetailPageState extends State<LockDetailPage>
TranslationLoader.lanKeys!.card!.tr,
state.openDoorBtnisUneable.value,
state.bottomBtnisEable.value, () {
// logic.showToast("普通用户第一次需要在锁旁边操作哦。", something: () {
// logic.showEasyLoading();
// });
Get.toNamed(Routers.cardListPage, arguments: {
"lockId": state.keyInfos.value.lockId,
});
@ -727,10 +778,6 @@ class _LockDetailPageState extends State<LockDetailPage>
arguments: {"keyInfo": state.keyInfos.value});
}));
}
// bottomItem('images/main/icon_main_authorizedAdmin.png', TranslationLoader.lanKeys!.authorizedAdmin!.tr, state.bottomBtnisUneable.value, () {
// Get.toNamed(Routers.authorizedAdminListPage,
// arguments: {"keyInfo": state.keyInfos.value});
// })
var endWiddget = <Widget>[];
endWiddget.add(
@ -788,8 +835,8 @@ class _LockDetailPageState extends State<LockDetailPage>
//
Widget bottomItem(String iconUrl, String name, bool openDoorBtnisUneable,
bool bottomBtnisEable, Function() onClick) {
var width = 42.w;
var height = 42.h;
var width = F.sw(defaultCall: () => 42.w, xhjCall: () => 63.w);
var height = F.sw(defaultCall: () => 42.h, xhjCall: () => 63.h);
return GestureDetector(
onTap: openDoorBtnisUneable
? (bottomBtnisEable
@ -807,16 +854,16 @@ class _LockDetailPageState extends State<LockDetailPage>
SizedBox(
width: width,
height: height,
child: Image.asset(
iconUrl,
width: width,
height: height,
color: openDoorBtnisUneable
? (bottomBtnisEable
? AppColors.mainColor
: AppColors.lockDetailBottomBtnUneable)
: AppColors.lockDetailBottomBtnUneable,
// fit: BoxFit.fitWidth
child: FlavorsImg(
child: Image.asset(iconUrl,
width: width,
height: height,
color: openDoorBtnisUneable
? (bottomBtnisEable
? AppColors.mainColor
: AppColors.lockDetailBottomBtnUneable)
: AppColors.lockDetailBottomBtnUneable,
fit: BoxFit.fitWidth),
),
),
SizedBox(height: 10.w),
@ -933,25 +980,6 @@ class _LockDetailPageState extends State<LockDetailPage>
return formattedTime;
}
// void showDeletAlertDialog(BuildContext context, String dateStr) {
// showCupertinoDialog(
// context: context,
// builder: (context) {
// return CupertinoAlertDialog(
// content: Text('锁更新时间:$dateStr'),
// actions: [
// CupertinoDialogAction(
// child: Text(TranslationLoader.lanKeys!.sure!.tr),
// onPressed: () {
// Get.back();
// },
// ),
// ],
// );
// },
// );
// }
startOpenLock() {
if (state.openLockBtnState.value == 1) {
return;
@ -996,15 +1024,6 @@ class _LockDetailPageState extends State<LockDetailPage>
}
}
// @override
// void didChangeDependencies() {
// // TODO: implement didChangeDependencies
// super.didChangeDependencies();
//
// ///
// AppRouteObserver().routeObserver.subscribe(this, ModalRoute.of(context)!);
// }
@override
void dispose() {
// TODO: implement dispose
@ -1043,12 +1062,6 @@ class _LockDetailPageState extends State<LockDetailPage>
BlueManage().stopScan();
BlueManage().disconnect();
state.openLockBtnState.value = 0;
// if(state.animationController != null){
// state.animationController.reset();
// state.animationController.forward();
// state.animationController.dispose();
// }
}
///
@ -1068,9 +1081,5 @@ class _LockDetailPageState extends State<LockDetailPage>
logic.cancelBlueConnetctToastTimer();
BlueManage().stopScan();
state.openLockBtnState.value = 0;
// if (state.animationController!.isAnimating) {
// state.animationController!.stop();
// }
}
}

View File

@ -372,9 +372,8 @@ class _LockSetPageState extends State<LockSetPage> with RouteAware {
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.msgNotificationPage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value
});
Get.toNamed(Routers.msgNotificationPage,
arguments: {'lockId': state.lockSetInfoData.value.lockId});
})),
//
Obx(() => Visibility(

View File

@ -1,6 +0,0 @@
import 'package:star_lock/main/lockDetail/lockSet/lockUser/lockUser_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class LockUserLogic extends BaseGetXController {
final LockUserState state = LockUserState();
}

View File

@ -0,0 +1,6 @@
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class AddFamilyLogic extends BaseGetXController {
final AddFamilyState state = AddFamilyState();
}

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/main/lockDetail/messageWarn/addFamily/addFamily_logic.dart';
import 'package:star_lock/tools/commonItem.dart';
import 'package:star_lock/tools/submitBtn.dart';
@ -16,6 +17,9 @@ class AddFamilyPage extends StatefulWidget {
}
class _AddFamilyPageState extends State<AddFamilyPage> {
final logic = Get.put(AddFamilyLogic());
final state = Get.find<AddFamilyLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
@ -35,7 +39,8 @@ class _AddFamilyPageState extends State<AddFamilyPage> {
isHaveDirection: true,
action: () {
//
Get.toNamed(Routers.lockUserPage);
Get.toNamed(Routers.lockUserPage,
arguments: {'getLockId': state.getLockId.value});
}),
CommonItem(
leftTitel: '家人',

View File

@ -0,0 +1,12 @@
import 'package:get/get.dart';
class AddFamilyState {
var getLockId = 0.obs;
AddFamilyState() {
Map map = Get.arguments;
if (map['getLockId'] != null) {
getLockId.value = map['getLockId'];
}
}
}

View File

@ -4,4 +4,12 @@ import 'package:get/get.dart';
class FamilyDetailsState {
TextEditingController changeNameController = TextEditingController(); //
var familyName = ''.obs;
var getLockId = 0.obs;
FamilyDetailsState() {
Map map = Get.arguments;
if (map['lockId'] != null) {
getLockId.value = map['lockId'];
}
}
}

View File

@ -0,0 +1,312 @@
class LockUserEntity {
int? errorCode;
String? description;
String? errorMsg;
List<LockUserData>? data;
LockUserEntity({this.errorCode, this.description, this.errorMsg, this.data});
LockUserEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
if (json['data'] != null) {
data = <LockUserData>[];
json['data'].forEach((v) {
data!.add(LockUserData.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.map((v) => v.toJson()).toList();
}
return data;
}
}
class LockUserData {
int? openLockType;
String? openLockTypeName;
List<LockUserListKeys>? lockUserList;
LockUserData({this.openLockType, this.openLockTypeName, this.lockUserList});
LockUserData.fromJson(Map<String, dynamic> json) {
openLockType = json['openLockType'];
openLockTypeName = json['openLockTypeName'];
if (json['keys'] != null) {
lockUserList = <LockUserListKeys>[];
json['keys'].forEach((v) {
lockUserList!.add(LockUserListKeys.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['openLockType'] = openLockType;
data['openLockTypeName'] = openLockTypeName;
if (lockUserList != null) {
data['keys'] = lockUserList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class LockUserListKeys {
int? id;
String? clientId;
int? lockOwnerId;
int? apiUserId;
int? lockId;
int? senderUserId;
int? receiverUsernameType;
String? keyName;
int? keyType;
int? startDate;
int? endDate;
List? weekDays;
String? remarks;
int? remoteEnable;
int? isCameraEnable;
int? faceAuthentication;
int? lastFaceValidateTime;
int? keyRight;
int? remoteUnlockSwitch;
int? userType;
int? keyStatus;
int? groupId;
int? lockUserNo;
int? businessId;
String? createdAt;
String? updatedAt;
int? isOnlyManageSelf;
UserInfo? userInfo;
UserInfo? userSender;
int? keyboardPwdType;
int? keyboardPwdStatus;
String? keyboardPwdName;
String? keyboardPwd;
String? keyboardPwdHash;
int? addType;
int? pwdRight;
int? isCustom;
int? isCoerced;
int? hoursStart;
int? hoursEnd;
int? pwdUserNo;
String? senderUsername;
int? keyboardPwdId;
int? sendDate;
LockUserListKeys(
{this.id,
this.clientId,
this.lockOwnerId,
this.apiUserId,
this.lockId,
this.senderUserId,
this.receiverUsernameType,
this.keyName,
this.keyType,
this.startDate,
this.endDate,
this.weekDays,
this.remarks,
this.remoteEnable,
this.isCameraEnable,
this.faceAuthentication,
this.lastFaceValidateTime,
this.keyRight,
this.remoteUnlockSwitch,
this.userType,
this.keyStatus,
this.groupId,
this.lockUserNo,
this.businessId,
this.createdAt,
this.updatedAt,
this.isOnlyManageSelf,
this.userInfo,
this.userSender,
this.keyboardPwdType,
this.keyboardPwdStatus,
this.keyboardPwdName,
this.keyboardPwd,
this.keyboardPwdHash,
this.addType,
this.pwdRight,
this.isCustom,
this.isCoerced,
this.hoursStart,
this.hoursEnd,
this.pwdUserNo,
this.senderUsername,
this.keyboardPwdId,
this.sendDate});
LockUserListKeys.fromJson(Map<String, dynamic> json) {
id = json['id'];
clientId = json['clientId'];
lockOwnerId = json['lockOwnerId'];
apiUserId = json['apiUserId'];
lockId = json['lockId'];
senderUserId = json['senderUserId'];
receiverUsernameType = json['receiverUsernameType'];
keyName = json['keyName'];
keyType = json['keyType'];
startDate = json['startDate'];
endDate = json['endDate'];
if (json['weekDays'] != null) {
weekDays = [];
json['weekDays'].forEach((v) {
weekDays!.add(v);
});
}
remarks = json['remarks'];
remoteEnable = json['remoteEnable'];
isCameraEnable = json['isCameraEnable'];
faceAuthentication = json['faceAuthentication'];
lastFaceValidateTime = json['lastFaceValidateTime'];
keyRight = json['keyRight'];
remoteUnlockSwitch = json['remoteUnlockSwitch'];
userType = json['userType'];
keyStatus = json['keyStatus'];
groupId = json['groupId'];
lockUserNo = json['lockUserNo'];
businessId = json['businessId'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
isOnlyManageSelf = json['isOnlyManageSelf'];
userInfo =
json['user_info'] != null ? UserInfo.fromJson(json['user_info']) : null;
userSender = json['user_sender'] != null
? UserInfo.fromJson(json['user_sender'])
: null;
keyboardPwdType = json['keyboardPwdType'];
keyboardPwdStatus = json['keyboardPwdStatus'];
keyboardPwdName = json['keyboardPwdName'];
keyboardPwd = json['keyboardPwd'];
keyboardPwdHash = json['keyboardPwdHash'];
addType = json['addType'];
pwdRight = json['pwdRight'];
isCustom = json['isCustom'];
isCoerced = json['isCoerced'];
hoursStart = json['hoursStart'];
hoursEnd = json['hoursEnd'];
pwdUserNo = json['pwdUserNo'];
senderUsername = json['senderUsername'];
keyboardPwdId = json['keyboardPwdId'];
sendDate = json['sendDate'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['clientId'] = clientId;
data['lockOwnerId'] = lockOwnerId;
data['apiUserId'] = apiUserId;
data['lockId'] = lockId;
data['senderUserId'] = senderUserId;
data['receiverUsernameType'] = receiverUsernameType;
data['keyName'] = keyName;
data['keyType'] = keyType;
data['startDate'] = startDate;
data['endDate'] = endDate;
if (weekDays != null) {
data['weekDays'] = weekDays!.map((v) => v).toList();
}
data['remarks'] = remarks;
data['remoteEnable'] = remoteEnable;
data['isCameraEnable'] = isCameraEnable;
data['faceAuthentication'] = faceAuthentication;
data['lastFaceValidateTime'] = lastFaceValidateTime;
data['keyRight'] = keyRight;
data['remoteUnlockSwitch'] = remoteUnlockSwitch;
data['userType'] = userType;
data['keyStatus'] = keyStatus;
data['groupId'] = groupId;
data['lockUserNo'] = lockUserNo;
data['businessId'] = businessId;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
data['isOnlyManageSelf'] = isOnlyManageSelf;
if (userInfo != null) {
data['user_info'] = userInfo!.toJson();
}
if (userSender != null) {
data['user_sender'] = userSender!.toJson();
}
data['keyboardPwdType'] = keyboardPwdType;
data['keyboardPwdStatus'] = keyboardPwdStatus;
data['keyboardPwdName'] = keyboardPwdName;
data['keyboardPwd'] = keyboardPwd;
data['keyboardPwdHash'] = keyboardPwdHash;
data['addType'] = addType;
data['pwdRight'] = pwdRight;
data['isCustom'] = isCustom;
data['isCoerced'] = isCoerced;
data['hoursStart'] = hoursStart;
data['hoursEnd'] = hoursEnd;
data['pwdUserNo'] = pwdUserNo;
data['senderUsername'] = senderUsername;
data['keyboardPwdId'] = keyboardPwdId;
data['sendDate'] = sendDate;
return data;
}
}
class UserInfo {
int? id;
String? clientId;
String? username;
String? accountName;
String? businessQueryStr;
String? password;
int? date;
String? createdAt;
String? updatedAt;
UserInfo(
{this.id,
this.clientId,
this.username,
this.accountName,
this.businessQueryStr,
this.password,
this.date,
this.createdAt,
this.updatedAt});
UserInfo.fromJson(Map<String, dynamic> json) {
id = json['id'];
clientId = json['client_id'];
username = json['username'];
accountName = json['account_name'];
businessQueryStr = json['businessQueryStr'];
password = json['password'];
date = json['date'];
createdAt = json['created_at'];
updatedAt = json['updated_at'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['id'] = id;
data['client_id'] = clientId;
data['username'] = username;
data['account_name'] = accountName;
data['businessQueryStr'] = businessQueryStr;
data['password'] = password;
data['date'] = date;
data['created_at'] = createdAt;
data['updated_at'] = updatedAt;
return data;
}
}

View File

@ -0,0 +1,16 @@
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/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class LockUserLogic extends BaseGetXController {
final LockUserState state = LockUserState();
//
void getLockNoticeSetting() async {
LockUserEntity entity = await ApiRepository.to.getLockKeysList(
lockId: state.getLockId.value,
);
if (entity.errorCode!.codeIsSuccessful) {}
}
}

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockUser/lockUser_logic.dart';
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_logic.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
@ -18,6 +18,13 @@ class _LockUserPageState extends State<LockUserPage> {
final logic = Get.put(LockUserLogic());
final state = Get.find<LockUserLogic>().state;
@override
initState() {
super.initState();
logic.getLockNoticeSetting();
}
@override
Widget build(BuildContext context) {
return Scaffold(

View File

@ -4,4 +4,12 @@ import 'package:get/get.dart';
class LockUserState {
TextEditingController searchController = TextEditingController(); ///
var isCheck = false.obs;
var getLockId = 0.obs;
LockUserState() {
Map map = Get.arguments;
if (map['getLockId'] != null) {
getLockId.value = map['getLockId'];
}
}
}

View File

@ -0,0 +1,6 @@
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_state.dart';
import 'package:star_lock/tools/baseGetXController.dart';
class CoerceFingerprintListLogic extends BaseGetXController {
final CoerceFingerprintListState state = CoerceFingerprintListState();
}

View File

@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockUser/lockUser_logic.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/coerceOpenDoor/coerceFingerprintList/coerceFingerprintList_logic.dart';
import '../../../../../../app_settings/app_colors.dart';
import '../../../../../../tools/submitBtn.dart';
@ -17,8 +17,8 @@ class CoerceFingerprintListPage extends StatefulWidget {
}
class _CoerceFingerprintListPageState extends State<CoerceFingerprintListPage> {
final logic = Get.put(LockUserLogic());
final state = Get.find<LockUserLogic>().state;
final logic = Get.put(CoerceFingerprintListLogic());
final state = Get.find<CoerceFingerprintListLogic>().state;
@override
Widget build(BuildContext context) {

View File

@ -0,0 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
class CoerceFingerprintListState {
TextEditingController searchController = TextEditingController(); ///
var isCheck = false.obs;
}

View File

@ -0,0 +1,116 @@
class MsgNotificationEntity {
int? errorCode;
String? description;
String? errorMsg;
MsgNoticeData? data;
MsgNotificationEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
MsgNotificationEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? MsgNoticeData.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.toJson();
}
return data;
}
}
class MsgNoticeData {
List? openDoorNoticeList;
int? dayNotOpenDoorState;
int? dayNotOpenDoorValue;
List? dayNotOpenDoorNoticeWayList;
int? doorNotCloseState;
int? tamperAlarmState;
int? lowElecNoticeState;
List<void>? lowElecNoticeWayList;
List<void>? coercionOpenDoorNoticeList;
int? doorbellNoticeState;
int? someoneAtDoorNoticeState;
MsgNoticeData(
{this.openDoorNoticeList,
this.dayNotOpenDoorState,
this.dayNotOpenDoorValue,
this.dayNotOpenDoorNoticeWayList,
this.doorNotCloseState,
this.tamperAlarmState,
this.lowElecNoticeState,
this.lowElecNoticeWayList,
this.coercionOpenDoorNoticeList,
this.doorbellNoticeState,
this.someoneAtDoorNoticeState});
MsgNoticeData.fromJson(Map<String, dynamic> json) {
if (json['openDoorNoticeList'] != null) {
openDoorNoticeList = [];
json['openDoorNoticeList'].forEach((v) {
openDoorNoticeList!.add(v);
});
}
dayNotOpenDoorState = json['dayNotOpenDoorState'];
dayNotOpenDoorValue = json['dayNotOpenDoorValue'];
if (json['dayNotOpenDoorNoticeWayList'] != null) {
dayNotOpenDoorNoticeWayList = [];
json['dayNotOpenDoorNoticeWayList'].forEach((v) {
dayNotOpenDoorNoticeWayList!.add(v);
});
}
doorNotCloseState = json['doorNotCloseState'];
tamperAlarmState = json['tamperAlarmState'];
lowElecNoticeState = json['lowElecNoticeState'];
if (json['lowElecNoticeWayList'] != null) {
lowElecNoticeWayList = [];
json['lowElecNoticeWayList'].forEach((v) {
lowElecNoticeWayList!.add(v);
});
}
if (json['coercionOpenDoorNoticeList'] != null) {
coercionOpenDoorNoticeList = [];
json['coercionOpenDoorNoticeList'].forEach((v) {
coercionOpenDoorNoticeList!.add(v);
});
}
doorbellNoticeState = json['doorbellNoticeState'];
someoneAtDoorNoticeState = json['someoneAtDoorNoticeState'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (openDoorNoticeList != null) {
data['openDoorNoticeList'] =
openDoorNoticeList!.map((v) => v.toJson()).toList();
}
data['dayNotOpenDoorState'] = dayNotOpenDoorState;
data['dayNotOpenDoorValue'] = dayNotOpenDoorValue;
if (dayNotOpenDoorNoticeWayList != null) {
data['dayNotOpenDoorNoticeWayList'] =
dayNotOpenDoorNoticeWayList!.map((v) => v.toJson()).toList();
}
data['doorNotCloseState'] = doorNotCloseState;
data['tamperAlarmState'] = tamperAlarmState;
data['lowElecNoticeState'] = lowElecNoticeState;
if (lowElecNoticeWayList != null) {
data['lowElecNoticeWayList'] =
lowElecNoticeWayList!.map((v) => v).toList();
}
if (coercionOpenDoorNoticeList != null) {
data['coercionOpenDoorNoticeList'] =
coercionOpenDoorNoticeList!.map((v) => v).toList();
}
data['doorbellNoticeState'] = doorbellNoticeState;
data['someoneAtDoorNoticeState'] = someoneAtDoorNoticeState;
return data;
}
}

View File

@ -1,7 +1,78 @@
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'msgNotification_state.dart';
class MsgNotificationLogic extends BaseGetXController {
final MsgNotificationState state = MsgNotificationState();
//
void getLockNoticeSetting() async {
MsgNotificationEntity entity = await ApiRepository.to.getLockNoticeSetting(
lockId: state.getLockId.value,
);
if (entity.errorCode!.codeIsSuccessful) {
state.msgNoticeInfo.value = entity.data!;
state.nDaysNotOpenDoor.value =
entity.data!.dayNotOpenDoorState! == 0 ? '未启用' : '已启用'; //N天未开门
state.isDoorNotShut.value =
entity.data!.doorNotCloseState! == 0 ? false : true; //
state.isTamperAlarm.value =
entity.data!.tamperAlarmState! == 0 ? false : true; //
state.isLowBattery.value =
entity.data!.lowElecNoticeState! == 0 ? '未启用' : '已启用'; //
state.isSomeoneRing.value =
entity.data!.doorbellNoticeState! == 0 ? false : true; //
state.isSomeoneAppeared.value =
entity.data!.someoneAtDoorNoticeState! == 0 ? false : true; //
}
}
//
void updateDoorNotCloseSetting() async {
MsgNotificationEntity entity =
await ApiRepository.to.updateDoorNotCloseSetting(
lockId: state.getLockId.value,
doorNotCloseState: state.isDoorNotShut.value ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
//
void updateDoorbellNoticeStateSetting() async {
MsgNotificationEntity entity =
await ApiRepository.to.updateDoorbellNoticeStateSetting(
lockId: state.getLockId.value,
doorbellNoticeState: state.isSomeoneRing.value ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
//
void updateSomeoneAtDoorNoticeStateSetting() async {
MsgNotificationEntity entity =
await ApiRepository.to.updateSomeoneAtDoorNoticeStateSetting(
lockId: state.getLockId.value,
someoneAtDoorNoticeState: state.isSomeoneAppeared.value ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
//
void updateTamperAlarmStateSetting() async {
MsgNotificationEntity entity =
await ApiRepository.to.updateTamperAlarmStateSetting(
lockId: state.getLockId.value,
tamperAlarmState: state.isTamperAlarm.value ? 1 : 0,
);
if (entity.errorCode!.codeIsSuccessful) {
showToast('设置成功');
}
}
}

View File

@ -35,6 +35,12 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
style: subTipsStyle),
]);
@override
initState() {
super.initState();
logic.getLockNoticeSetting();
}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -72,19 +78,20 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
isHaveDirection: true,
action: () {
Get.toNamed(Routers.openDoorNotifyPage, arguments: {
'lockSetInfoData': state.lockSetInfoData.value,
'lockSetInfoData': state.msgNoticeInfo.value,
'lockId': state.getLockId.value
});
},
),
CommonItem(
leftTitel: 'N天未开门',
rightTitle: "已启用",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.nDaysUnopenedPage);
},
),
Obx(() => CommonItem(
leftTitel: 'N天未开门',
rightTitle: state.nDaysNotOpenDoor.value,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.nDaysUnopenedPage);
},
)),
// SizedBox(
// height: 20.h,
// ),
@ -102,21 +109,25 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
isHaveRightWidget: true,
rightWidget:
SizedBox(width: 60.w, height: 50.h, child: _switch(2)))),
CommonItem(
leftTitel: '防拆报警',
rightTitle: "已启用",
isHaveLine: true,
isHaveDirection: true,
),
CommonItem(
leftTitel: '低电量提醒',
rightTitle: "已启用",
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.lowBatteryReminderPage);
},
),
Obx(() => CommonItem(
leftTitel: '防拆报警',
rightTitle: '',
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: SizedBox(
width: 60.w,
height: 50.h,
child: _switch(5),
))),
Obx(() => CommonItem(
leftTitel: '低电量提醒',
rightTitle: state.isLowBattery.value,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.lowBatteryReminderPage);
},
)),
CommonItem(
leftTitel: '胁迫开门',
rightTitle: "",
@ -188,6 +199,11 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
case 4:
isCheck = state.isSomeoneAppeared.value;
break;
//
case 5:
isCheck = state.isTamperAlarm.value;
break;
//
default:
}
@ -204,15 +220,31 @@ class _MsgNotificationPageState extends State<MsgNotificationPage> {
break;
//
case 2:
state.isDoorNotShut.value = value;
{
state.isDoorNotShut.value = value;
logic.updateDoorNotCloseSetting();
}
break;
//
case 3:
state.isSomeoneRing.value = value;
{
state.isSomeoneRing.value = value;
logic.updateDoorbellNoticeStateSetting();
}
break;
//
case 4:
state.isSomeoneAppeared.value = value;
{
state.isSomeoneAppeared.value = value;
logic.updateSomeoneAtDoorNoticeStateSetting();
}
break;
//
case 5:
{
state.isTamperAlarm.value = value;
logic.updateTamperAlarmStateSetting();
}
break;
default:

View File

@ -1,9 +1,13 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
class MsgNotificationState {
var lockSetInfoData = LockSetInfoData().obs;
var msgNoticeInfo = MsgNoticeData().obs;
var getLockId = 0.obs;
var isCheck = false.obs;
var nDaysNotOpenDoor = '已启用'.obs; //N天未开门
var isTamperAlarm = false.obs; //
var isLowBattery = '已启用'.obs; //
var isLeaveHomeOpenDoor = false.obs; //
var isDoorNotShut = false.obs; //
var isSomeoneRing = false.obs; //
@ -11,8 +15,8 @@ class MsgNotificationState {
MsgNotificationState() {
Map map = Get.arguments;
if (map['lockSetInfoData'] != null) {
lockSetInfoData.value = map['lockSetInfoData'];
if (map['lockId'] != null) {
getLockId.value = map['lockId'];
}
}
}

View File

@ -1,16 +1,6 @@
import 'package:star_lock/network/api_repository.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import 'package:star_lock/versionUndate/versionUndate_entity.dart';
import 'openDoorNotify_state.dart';
class OpenDoorNotifyLogic extends BaseGetXController {
final OpenDoorNotifyState state = OpenDoorNotifyState();
//
void getLockNoticeSetting() async {
VersionUndateEntity entity = await ApiRepository.to.getLockNoticeSetting(
lockId: state.lockSetInfoData.value.lockId!,
);
if (entity.errorCode!.codeIsSuccessful) {}
}
}

View File

@ -22,8 +22,6 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
@override
void initState() {
super.initState();
logic.getLockNoticeSetting();
}
@override
@ -42,14 +40,11 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
height: 20.h,
),
Expanded(child: _buildMainUI()),
// Expanded(
// child: Obx(() => state.itemDataList.value.isEmpty
// ? const NoData()
// : _buildMainUI(state.itemDataList.value))),
AddBottomWhiteBtn(
btnName: '添加家人',
onClick: () {
Get.toNamed(Routers.addFamilyPage);
Get.toNamed(Routers.addFamilyPage,
arguments: {'getLockId': state.getLockId.value});
},
),
SizedBox(
@ -72,7 +67,7 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
Widget _buildMainUI() {
return ListView.separated(
shrinkWrap: true,
itemCount: 3,
itemCount: state.msgNoticeInfo.value.openDoorNoticeList?.length ?? 0,
itemBuilder: (c, index) {
return _electronicKeyItem(
'images/controls_user.png', '18682150237', '电子钥匙', () {
@ -113,7 +108,6 @@ class _OpenDoorNotifyPageState extends State<OpenDoorNotifyPage> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
familyAccount,

View File

@ -1,16 +1,20 @@
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/lockSet/lockSet/lockSetInfo_entity.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
class OpenDoorNotifyState {
var lockSetInfoData = LockSetInfoData().obs;
var msgNoticeInfo = MsgNoticeData().obs;
var pageNum = 1.obs; //
final pageSize = 20.obs; //
final itemDataList = [].obs;
var itemDataList = [].obs;
var getLockId = 0.obs;
OpenDoorNotifyState() {
Map map = Get.arguments;
if (map['lockSetInfoData'] != null) {
lockSetInfoData.value = map['lockSetInfoData'];
if (map['msgNoticeInfo'] != null) {
msgNoticeInfo.value = map['msgNoticeInfo'];
}
if (map['lockId'] != null) {
getLockId.value = map['lockId'];
}
}
}

View File

@ -128,7 +128,7 @@ class _NotificationModePageState extends State<NotificationModePage> {
height: 60.h,
),
SubmitBtn(
btnName: '确定',
btnName: '确定'.tr,
onClick: () {},
)
],
@ -175,8 +175,8 @@ class _NotificationModePageState extends State<NotificationModePage> {
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: isEmail
? getEmailTFWidget('请输入Email', 1)
: getPhoneWidget('请输入手机号', 1)),
? getEmailTFWidget('请输入Email'.tr, 1)
: getPhoneWidget('请输入手机号'.tr, 1)),
Divider(
color: AppColors.greyLineColor,
indent: 20.w,
@ -216,8 +216,6 @@ class _NotificationModePageState extends State<NotificationModePage> {
autofocus: false,
textAlign: TextAlign.end,
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0),
hintText: tfStr,
hintStyle: TextStyle(fontSize: 22.sp),
//线
@ -282,8 +280,6 @@ class _NotificationModePageState extends State<NotificationModePage> {
autofocus: false,
textAlign: TextAlign.end,
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(top: -12.0, bottom: 0.0),
hintText: tfStr,
hintStyle: TextStyle(fontSize: 22.sp),
//线

View File

@ -79,7 +79,7 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
),
),
bottomNavigationBar: Container(
height: 100.h + Get.bottomBarHeight,
padding: EdgeInsets.only(top: 20.h),
decoration: const BoxDecoration(
color: Colors.transparent,
border: Border(
@ -89,28 +89,32 @@ class _StarLockMainXHJPageState extends State<StarLockMainXHJPage>
),
),
),
child: Row(
children: [
// navigationBarItem(Icons.start, '场景', false, () {
// logic.setIndex(0);
// }),
child: SafeArea(
top: false,
child: Row(
children: [
// navigationBarItem(Icons.start, '场景', false, () {
// logic.setIndex(0);
// }),
navigationBarItem(Icons.devices,
TranslationLoader.lanKeys!.device!.tr, logic, 0, () {
logic.setIndex(0);
}),
navigationBarItem(Icons.message,
TranslationLoader.lanKeys!.message!.tr, logic, 1, () {
logic.setIndex(1);
}),
navigationBarItem(Icons.shopping_cart, '商城'.tr, logic, 2, () {
logic.setIndex(2);
}),
navigationBarItem(Icons.account_circle, '我的'.tr, logic, 3,
() {
logic.setIndex(3);
}),
],
navigationBarItem(Icons.devices,
TranslationLoader.lanKeys!.device!.tr, logic, 0, () {
logic.setIndex(0);
}),
navigationBarItem(Icons.message,
TranslationLoader.lanKeys!.message!.tr, logic, 1, () {
logic.setIndex(1);
}),
navigationBarItem(Icons.shopping_cart, '商城'.tr, logic, 2,
() {
logic.setIndex(2);
}),
navigationBarItem(Icons.account_circle, '我的'.tr, logic, 3,
() {
logic.setIndex(3);
}),
],
),
),
),
);

View File

@ -0,0 +1,9 @@
import 'flavors.dart';
import 'main.dart' as runner;
Future<void> main() async {
F.appFlavor = Flavor.xhj;
F.isLite = true;
await runner.main();
}

View File

@ -1,22 +1,23 @@
import 'dart:io';
import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:star_lock/appRouters.dart';
import 'package:star_lock/mine/addLock/addLock/addLock_state.dart';
import 'package:star_lock/permission/permission_dialog.dart';
import 'package:star_lock/tools/baseGetXController.dart';
import '../../../blue/blue_manage.dart';
class AddLockLogic extends BaseGetXController {
final AddLockState state = AddLockState();
@override
void onReady() {
// TODO: implement onReady
super.onReady();
// BlueManage().stopScan();
}
@override
void onInit() {
// TODO: implement onInit
super.onInit();
}
@ -24,4 +25,18 @@ class AddLockLogic extends BaseGetXController {
void onClose() {
// TODO: implement onClose
}
//
Future<void> getNearByLimits() async {
if (!Platform.isIOS) {
bool bluetoothRequest = await PermissionDialog.requestBluetooth();
bool locationRequest = await PermissionDialog.request(Permission.location);
if (!bluetoothRequest || !locationRequest) {
return;
}
}
Get.toNamed(Routers.nearbyLockPage);
}
}

View File

@ -23,125 +23,71 @@ class AddLockPage extends StatefulWidget {
}
class _AddLockPageState extends State<AddLockPage> with BaseWidget {
final logic = Get.put(AddLockLogic());
final state = Get.find<AddLockLogic>().state;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.addLock!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: ListView(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
TranslationLoader.lanKeys!.lightTouchScreen!.tr,
style: TextStyle(
fontSize: 24.sp,
return GetBuilder<AddLockLogic>(
init: AddLockLogic(),
builder: (AddLockLogic logic) {
return Scaffold(
backgroundColor: Colors.white,
appBar: TitleAppBar(
barTitle: TranslationLoader.lanKeys!.addLock!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor),
body: ListView(
// mainAxisAlignment: MainAxisAlignment.center,
// crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100.h,
),
),
],
),
SizedBox(
height: 120.h,
),
Obx(() => Image.asset(
state.lockTypeImg.value,
width: 278.w,
height: 278.w,
)),
SizedBox(
height: 120.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
style: TextStyle(fontSize: 20.sp, fontWeight: FontWeight.w500),
),
],
),
SizedBox(
height: 120.h,
),
Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w),
child: SubmitBtn(
btnName: TranslationLoader.lanKeys!.next!.tr,
borderRadius: 20.w,
onClick: () {
getNearByLimits();
}),
),
],
),
);
}
void onShow() {}
void onHide() {}
//
void getNearByLimits() {
if (Platform.isIOS) {
Navigator.pushNamed(context, Routers.nearbyLockPage);
} else {
positionPermissionAlert();
}
}
///
Future<bool> getMicrophonePermission() async {
// You can request multiple permissions at once.
Map<Permission, PermissionStatus> statuses = await [
Permission.bluetoothScan,
Permission.bluetoothConnect,
Permission.location,
].request();
//granted denied permanentlyDenied
if (statuses[Permission.bluetoothScan]!.isGranted &&
statuses[Permission.bluetoothConnect]!.isGranted &&
statuses[Permission.location]!.isGranted) {
return true;
}
return false;
}
Future<void> positionPermissionAlert() async {
//
if (Platform.isAndroid) {
AppFirstEnterHandle().getAppFirstEnter(context, isAgreePosition);
var getFlag = await Storage.getString(isAgreePosition);
if (getFlag == isAgreePosition) {
onPermissionPush();
}
} else {
onPermissionPush();
}
}
void onPermissionPush() {
getMicrophonePermission().then((value) {
if (value) {
//
Navigator.pushNamed(context, Routers.nearbyLockPage);
} else {
//
openAppSettings(); //app系统设置
}
});
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
TranslationLoader.lanKeys!.lightTouchScreen!.tr,
style: TextStyle(
fontSize: 24.sp,
),
),
],
),
SizedBox(
height: 120.h,
),
Obx(() => Image.asset(
logic.state.lockTypeImg.value,
width: 278.w,
height: 278.w,
)),
SizedBox(
height: 120.h,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
TranslationLoader.lanKeys!.lightTouchScreenTip!.tr,
style: TextStyle(
fontSize: 20.sp, fontWeight: FontWeight.w500),
),
],
),
SizedBox(
height: 120.h,
),
Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w),
child: SubmitBtn(
btnName: TranslationLoader.lanKeys!.next!.tr,
borderRadius: 20.w,
onClick: () {
logic.getNearByLimits();
}),
),
],
),
);
});
}
}

View File

@ -1,4 +1,3 @@
import 'dart:async';
import 'dart:io';
@ -11,6 +10,7 @@ import 'package:get/get.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:amap_flutter_map/amap_flutter_map.dart';
import 'package:amap_flutter_base/amap_flutter_base.dart';
import 'package:star_lock/permission/permission_dialog.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
@ -28,12 +28,14 @@ class LockAddressGaoDePage extends StatefulWidget {
State<LockAddressGaoDePage> createState() => _LockAddressGaoDePageState();
}
class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteAware{
class _LockAddressGaoDePageState extends State<LockAddressGaoDePage>
with RouteAware {
final logic = Get.put(LockAddressGaoDeLogic());
final state = Get.find<LockAddressGaoDeLogic>().state;
//
static AMapApiKey amapApiKeys = AMapApiKey(iosKey: F.aMapKey.iosKey, androidKey: F.aMapKey.androidKey);
static AMapApiKey amapApiKeys =
AMapApiKey(iosKey: F.aMapKey.iosKey, androidKey: F.aMapKey.androidKey);
AMapController? mapController;
AMapFlutterLocation location = AMapFlutterLocation();
@ -44,72 +46,29 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
@override
void initState() {
super.initState();
AMapFlutterLocation.updatePrivacyAgree(true);
AMapFlutterLocation.updatePrivacyShow(true, true);
requestPermission();
AMapFlutterLocation.setApiKey(F.aMapKey.androidKey, F.aMapKey.iosKey);
// EasyLoading.show();
// Future.delayed(const Duration(seconds: 10), () { //asynchronous delay
// print("10s之后 菊花没有隐藏的话,强制隐藏菊花");
// if(EasyLoading.isShow){
// EasyLoading.dismiss();
// }
// });
// requestLocation();
}
Future<void> requestPermission() async {
final status = await Permission.location.request();
print("Permission.location.request()=status:$status");
permissionStatus = status;
if(Platform.isIOS){
final status = await PermissionDialog.request(Permission.location);
if (Platform.isIOS || status) {
_setLocationOption();
requestIOSLocation();
}
switch (status) {
case PermissionStatus.denied:
// print("拒绝");
break;
case PermissionStatus.granted:
if(Platform.isIOS){
// _setLocationOption();
// requestIOSLocation();
}else{
requestAndroidLocation();
location.startLocation();
}
break;
case PermissionStatus.limited:
// print("限制");
break;
case PermissionStatus.permanentlyDenied:
// print("永久的否认");
break;
case PermissionStatus.provisional:
// print("临时");
break;
default:
// print("其他状态");
// requestLocation();
break;
}
}
Future<void> requestAndroidLocation() async {
location.onLocationChanged().listen((event) {
// print("listenLocationChanged$event");
// EasyLoading.dismiss();
if (event.isNotEmpty) {
setState(() {
addressInfo = event;
});
location.stopLocation();
}
});
if (event.isNotEmpty) {
setState(() {
addressInfo = event;
});
location.stopLocation();
}
});
}
Future<void> requestIOSLocation() async {
@ -136,25 +95,6 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
barTitle: TranslationLoader.lanKeys!.lockAddress!.tr,
haveBack: true,
backgroundColor: AppColors.mainColor,
// actionsList: [
// TextButton(
// child: Text(
// TranslationLoader.lanKeys!.next!.tr,
// style: TextStyle(color: Colors.white, fontSize: 24.sp),
// ),
// onPressed: () {
// if(addressInfo!.isEmpty){
// Toast.show(msg:"还未获取到位置信息哦,请耐心等待一下!");
// return;
// }
// Get.toNamed(Routers.saveLockPage, arguments: {
// "addressInfo": addressInfo,
// "pwdTimestamp": state.pwdTimestamp.value,
// });
// // Navigator.pushNamed(context, Routers.saveLockPage);
// },
// ),
// ],
),
body: ListView(
children: [
@ -168,74 +108,89 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
),
),
SizedBox(
child:
(addressInfo != null && addressInfo!.containsKey("latitude")) ?
Column(
children: [
SizedBox(
height: 1.sw/5*4,
width: 1.sw,
child: AMapWidget(
apiKey: amapApiKeys,
//
initialCameraPosition: (
CameraPosition(
target: LatLng(double.parse(addressInfo!['latitude'].toString()), double.parse(addressInfo!['longitude'].toString())),
zoom: 10.0,
)
),
//
myLocationStyleOptions: MyLocationStyleOptions(
true,
),
// normal,satellite,night, navi,bus,
mapType: MapType.normal,
//
minMaxZoomPreference: const MinMaxZoomPreference(3, 20),
//
privacyStatement: const AMapPrivacyStatement(hasAgree: true, hasContains: true, hasShow: true),
// AMapController
onMapCreated: (AMapController controller) {
mapController = controller;
},
),
),
Container(
// color: Colors.red,
margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
child: (addressInfo != null && addressInfo!.containsKey("latitude"))
? Column(
children: [
Flexible(child: Text("检查以确保以下地址是正确的".tr, style: TextStyle(fontSize: 24.sp))),
],
),
),
// SizedBox(height: 20.h),
Container(
// color: Colors.red,
// height: 45.h,
margin: EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w),
child:Column(
children: [
Row(
SizedBox(
height: 1.sw / 5 * 4,
width: 1.sw,
child: AMapWidget(
apiKey: amapApiKeys,
//
initialCameraPosition: (CameraPosition(
target: LatLng(
double.parse(
addressInfo!['latitude'].toString()),
double.parse(
addressInfo!['longitude'].toString())),
zoom: 10.0,
)),
//
myLocationStyleOptions: MyLocationStyleOptions(
true,
),
// normal,satellite,night, navi,bus,
mapType: MapType.normal,
//
minMaxZoomPreference:
const MinMaxZoomPreference(3, 20),
//
privacyStatement: const AMapPrivacyStatement(
hasAgree: true, hasContains: true, hasShow: true),
// AMapController
onMapCreated: (AMapController controller) {
mapController = controller;
},
),
),
Container(
// color: Colors.red,
margin:
EdgeInsets.only(left: 25.w, top: 20.h, right: 25.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Text(addressInfo!["address"].toString() ?? "", style: const TextStyle(color: Colors.grey, fontSize: 16, fontWeight: FontWeight.w500, overflow: TextOverflow.clip))
),
Flexible(
child: Text("检查以确保以下地址是正确的".tr,
style: TextStyle(fontSize: 24.sp))),
],
),
SizedBox(height: 5.h),
Container(height: 1.h, color: AppColors.mainColor,),
],
)
),
],
) : SizedBox(
height: 1.sw/5*4 + 65.h*2,
child: Center(child: Text('地图加载中,请稍候。。。'.tr)))
,
),
// SizedBox(height: 20.h),
Container(
// color: Colors.red,
// height: 45.h,
margin: EdgeInsets.only(
left: 25.w, top: 20.h, right: 25.w),
child: Column(
children: [
Row(
children: [
Expanded(
child: Text(
addressInfo!["address"].toString() ??
"",
style: const TextStyle(
color: Colors.grey,
fontSize: 16,
fontWeight: FontWeight.w500,
overflow: TextOverflow.clip))),
],
),
SizedBox(height: 5.h),
Container(
height: 1.h,
color: AppColors.mainColor,
),
],
)),
],
)
: SizedBox(
height: 1.sw / 5 * 4 + 65.h * 2,
child: Center(child: Text('地图加载中,请稍候。。。'.tr))),
),
SizedBox(height:200.h),
SizedBox(height: 200.h),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
@ -261,7 +216,7 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
style: TextStyle(color: Colors.black, fontSize: 24.sp),
),
onPressed: () {
if(addressInfo!.isEmpty){
if (addressInfo!.isEmpty) {
logic.showToast("还未获取到位置信息哦,请耐心等待一下!".tr);
return;
}
@ -279,50 +234,9 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
),
],
)
// Positioned(
// left: 20.w, right: 20.w, bottom: 100.h,
// child: Container(
// // height: h(106),
// decoration: BoxDecoration(
// color: AppColors.mainColor,
// borderRadius: BorderRadius.circular(15.w),
// ),
// child:Column(
// children: [
// Container(
// // height: h(53),
// padding: EdgeInsets.only(top: 15.h, bottom: 15, left:15.w, right: 15.w),
// child: Row(
// children: [
// Image.asset('images/main/icon_addUserShowAddress.png', width: 30.w, height: 30.w),
// SizedBox(width: 10.w),
// Expanded(
// child: Text(addressInfo!["address"].toString() ?? "", style: const TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500, overflow: TextOverflow.clip))
// ),
// ],
// ),
// ),
// // Container(height: 1.h, color: const Color(0xFF021732),),
// // Container(
// // // height: h(52),
// // padding: EdgeInsets.only(top: 15.h, bottom: 15, left:15.w, right: 15.w),
// // child: Row(
// // children: [
// // Image.asset('images/main/icon_addUserAddressShowTime.png', width: 30.w, height: 30.w),
// // SizedBox(width: 10.w,),
// // Expanded(
// // child: Text(DateTool().getNowDateYMDHM(), style: const TextStyle(color: Colors.white, fontSize: 16, fontWeight: FontWeight.w500),)
// // ),
// // ],
// // ),
// // ),
// ],
// )
// ),),
],
),
);
}
///
@ -338,7 +252,8 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
///
locationOption.geoLanguage = GeoLanguage.DEFAULT;
locationOption.desiredLocationAccuracyAuthorizationMode = AMapLocationAccuracyAuthorizationMode.ReduceAccuracy;
locationOption.desiredLocationAccuracyAuthorizationMode =
AMapLocationAccuracyAuthorizationMode.ReduceAccuracy;
locationOption.fullAccuracyPurposeKey = "AMapLocationScene";
@ -396,21 +311,18 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
@override
void didPush() {
super.didPush();
}
///
@override
void didPop() {
super.didPop();
}
///
@override
void didPopNext() {
super.didPopNext();
}
///
@ -421,5 +333,4 @@ class _LockAddressGaoDePageState extends State<LockAddressGaoDePage> with RouteA
location.stopLocation();
location.destroy();
}
}

View File

@ -161,6 +161,16 @@ class _MinePersonInfoPageState extends State<MinePersonInfoPage> {
Get.toNamed(Routers.valueAddedServicesPage);
},
),
if (widget.showAbout)
CommonItem(
leftTitel: TranslationLoader.lanKeys!.set!.tr,
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.back();
Get.toNamed(Routers.mineSetPage);
},
),
if (widget.showAbout)
CommonItem(
leftTitel: TranslationLoader.lanKeys!.about!.tr,

View File

@ -42,6 +42,12 @@ class _ValueAddedServicesRealNamePageState
style: TextStyle(
color: AppColors.darkGrayTextColor, fontSize: 20.sp),
)),
TextButton(
onPressed: () {
Get.toNamed(Routers.valueAddedServicesRecordPage,
arguments: UseRecordListArg.cloudauth);
},
child: Text('asdasd')),
middleWidget(),
bottomWidget()
],
@ -53,8 +59,6 @@ class _ValueAddedServicesRealNamePageState
Widget middleWidget() {
return Container(
width: 1.sw,
// height: 100,
// color: Colors.grey.shade300,
margin: EdgeInsets.all(10.h),
decoration: const BoxDecoration(
image: DecorationImage(
@ -76,11 +80,8 @@ class _ValueAddedServicesRealNamePageState
],
),
),
// SizedBox(height:20.h),
Container(
margin: const EdgeInsets.only(top: 10, bottom: 10),
// color: Colors.red,
// height: 100.h,
Padding(
padding: const EdgeInsets.only(top: 10, bottom: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
@ -91,8 +92,6 @@ class _ValueAddedServicesRealNamePageState
},
child: Container(
width: 200.w,
// height: 70.h,
// color: Colors.red,
child: Center(
child: Text(TranslationLoader.lanKeys!.record!.tr,
style: TextStyle(
@ -106,8 +105,7 @@ class _ValueAddedServicesRealNamePageState
},
child: Container(
width: 200.w,
// height: 70.h,
// color: Colors.red,
color: Colors.transparent,
child: Center(
child: Text(TranslationLoader.lanKeys!.buy!.tr,
style: TextStyle(

View File

@ -20,7 +20,7 @@ class ValueAddedServicesRecordLogic extends BaseGetXController {
void onInit() {
super.onInit();
dynamic data = Get.arguments;
if (data is! Map && data['type'] is! String) {
if (data is! Map || data['type'] is! String) {
Get.back();
return;
}

View File

@ -68,7 +68,7 @@ class _PurchaseRecordsState extends State<_PurchaseRecords> {
return EasyRefresh(
onRefresh: () async {},
onLoad: () async {},
child: ListView.builder(itemBuilder: (BuildContext context, int index) {
child: ListView.builder(itemCount: 0,itemBuilder: (BuildContext context, int index) {
return SizedBox();
}),
);

View File

@ -196,6 +196,10 @@ abstract class Api {
final String getLockNoticeSettingURL =
'/lockSetting/getLockNoticeSetting'; //
final String updateLockNoticeSettingURL =
'/lockSetting/updateLockNoticeSetting'; //
final String lockKeysListURL = '/lock/lockKeysList'; //
final String setWechatPushSwitchURL =
'/user/setMpWechatPushSwitch'; //
final String getMpWechatQrCodeURL = '/user/getMpWechatQrCode'; //

View File

@ -1683,9 +1683,8 @@ class ApiProvider extends BaseProvider {
}));
//
Future<Response> deletAllMessageLoadData() => post(
deletAllMessageURL.toUrl,
jsonEncode({}));
Future<Response> deletAllMessageLoadData() =>
post(deletAllMessageURL.toUrl, jsonEncode({}));
//
Future<Response> getVersionData(String brandName, String currentVersion) =>
@ -1787,6 +1786,73 @@ class ApiProvider extends BaseProvider {
'lockId': lockId,
}));
// N天未开门
Future<Response> updateNdaysNotCloseDoorNoticeSetting(
int lockId,
int dayNotOpenDoorState,
int dayNotOpenDoorValue,
List dayNotOpenDoorNoticeWayList) =>
post(
updateLockNoticeSettingURL.toUrl,
jsonEncode({
'lockId': lockId,
'dayNotOpenDoorState': dayNotOpenDoorState,
'dayNotOpenDoorValue': dayNotOpenDoorValue,
'dayNotOpenDoorNoticeWayList': dayNotOpenDoorNoticeWayList
}));
//
Future<Response> updateDoorNotCloseSetting(
int lockId,
int doorNotCloseState,
) =>
post(
updateLockNoticeSettingURL.toUrl,
jsonEncode({
'lockId': lockId,
'doorNotCloseState': doorNotCloseState,
}));
//
Future<Response> updateDoorbellNoticeStateSetting(
int lockId,
int doorbellNoticeState,
) =>
post(
updateLockNoticeSettingURL.toUrl,
jsonEncode({
'lockId': lockId,
'doorbellNoticeState': doorbellNoticeState,
}));
//
Future<Response> updateSomeoneAtDoorNoticeStateSetting(
int lockId,
int someoneAtDoorNoticeState,
) =>
post(
updateLockNoticeSettingURL.toUrl,
jsonEncode({
'lockId': lockId,
'someoneAtDoorNoticeState': someoneAtDoorNoticeState,
}));
//
Future<Response> updaTetamperAlarmStateSetting(
int lockId,
int tamperAlarmState,
) =>
post(
updateLockNoticeSettingURL.toUrl,
jsonEncode({
'lockId': lockId,
'tamperAlarmState': tamperAlarmState,
}));
//
Future<Response> getLockKeysList(int lockId) =>
post(lockKeysListURL.toUrl, jsonEncode({'lockId': lockId}));
//
Future<Response> setMpWechatPushSwitch(int mpWechatPushSwitch) => post(
setWechatPushSwitchURL.toUrl,

View File

@ -7,6 +7,8 @@ import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/ma
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart';
import 'package:star_lock/main/lockDetail/face/addFace/addFace_entity.dart';
import 'package:star_lock/main/lockDetail/lockSet/basicInformation/basicInformation/KeyDetailEntity.dart';
import 'package:star_lock/main/lockDetail/messageWarn/lockUser/lockUser_entity.dart';
import 'package:star_lock/main/lockDetail/messageWarn/msgNotification/msgNotification/msgNotification_entity.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart';
import 'package:star_lock/main/lockDetail/passwordKey/passwordKey_perpetual/passwordKeyEntity.dart';
import 'package:star_lock/mine/mall/lockMall_entity.dart';
@ -1811,10 +1813,67 @@ class ApiRepository {
}
//
Future<VersionUndateEntity> getLockNoticeSetting(
Future<MsgNotificationEntity> getLockNoticeSetting(
{required int lockId}) async {
final res = await apiProvider.getLockNoticeSetting(lockId);
return VersionUndateEntity.fromJson(res.body);
return MsgNotificationEntity.fromJson(res.body);
}
// N天未开门
Future<MsgNotificationEntity> updateNdaysNotCloseDoorNoticeSetting(
{required int lockId,
required int dayNotOpenDoorState,
required int dayNotOpenDoorValue,
required List dayNotOpenDoorNoticeWayList}) async {
final res = await apiProvider.updateNdaysNotCloseDoorNoticeSetting(lockId,
dayNotOpenDoorState, dayNotOpenDoorValue, dayNotOpenDoorNoticeWayList);
return MsgNotificationEntity.fromJson(res.body);
}
//
Future<MsgNotificationEntity> updateDoorNotCloseSetting({
required int lockId,
required int doorNotCloseState,
}) async {
final res =
await apiProvider.updateDoorNotCloseSetting(lockId, doorNotCloseState);
return MsgNotificationEntity.fromJson(res.body);
}
//
Future<MsgNotificationEntity> updateDoorbellNoticeStateSetting({
required int lockId,
required int doorbellNoticeState,
}) async {
final res = await apiProvider.updateDoorbellNoticeStateSetting(
lockId, doorbellNoticeState);
return MsgNotificationEntity.fromJson(res.body);
}
//
Future<MsgNotificationEntity> updateSomeoneAtDoorNoticeStateSetting({
required int lockId,
required int someoneAtDoorNoticeState,
}) async {
final res = await apiProvider.updateSomeoneAtDoorNoticeStateSetting(
lockId, someoneAtDoorNoticeState);
return MsgNotificationEntity.fromJson(res.body);
}
//
Future<MsgNotificationEntity> updateTamperAlarmStateSetting({
required int lockId,
required int tamperAlarmState,
}) async {
final res = await apiProvider.updaTetamperAlarmStateSetting(
lockId, tamperAlarmState);
return MsgNotificationEntity.fromJson(res.body);
}
//
Future<LockUserEntity> getLockKeysList({required int lockId}) async {
final res = await apiProvider.getLockKeysList(lockId);
return LockUserEntity.fromJson(res.body);
}
//

View File

@ -12,6 +12,9 @@ class PermissionDialog {
Permission.photos: '相册'.tr,
Permission.storage: '读写'.tr,
Permission.location: '定位'.tr,
Permission.bluetooth: '蓝牙'.tr,
Permission.bluetoothScan: '蓝牙'.tr,
Permission.bluetoothConnect: '蓝牙'.tr,
};
static Map<Permission, String> contents = {
@ -19,8 +22,67 @@ class PermissionDialog {
Permission.photos: '需要访问相机权限才能使用相册图片上传文件上传头像'.tr,
Permission.storage: '需要访问读写权限才能使用本地图片上传头像'.tr,
Permission.location: '需要访问定位权限才能使用添加钥匙功能的位置信息'.tr,
Permission.bluetooth: '需要访问蓝牙权限才能使用添加钥匙功能的位置信息'.tr,
Permission.bluetoothScan: '需要访问蓝牙权限才能使用添加钥匙功能的位置信息'.tr,
Permission.bluetoothConnect: '需要访问蓝牙权限才能使用添加钥匙功能的位置信息'.tr,
};
static Future<bool> requestBluetooth() async {
if (Get.context == null) {
return false;
}
bool application = true;
Map<Permission, PermissionStatus> statuses = await [
Permission.bluetoothScan,
Permission.bluetoothConnect,
].request();
Permission permission = Permission.bluetoothScan;
dynamic cache = await Storage.getString(titles[permission]);
bool isGranted = statuses.values.every((element) => element.isGranted);
if (AppPlatform.isAndroid && !isGranted && cache is! String) {
application = await showCupertinoDialog(
context: Get.context!,
builder: (context) {
return PopScope(
canPop: false,
child: CupertinoAlertDialog(
title: Text('${'申请'.tr}${titles[permission] ?? ''}${'权限'.tr}'),
content: Text(contents[permission] ?? ''),
actions: [
CupertinoDialogAction(
child: Text('不允许'.tr),
onPressed: () {
Get.back(result: false);
},
),
CupertinoDialogAction(
child: Text('允许'.tr),
onPressed: () {
Get.back(result: true);
},
),
],
));
},
);
if (application) {
await Storage.setString(titles[permission], titles[permission]);
}
} else if (cache is String) {
bool isDenied = statuses.values.every((element) => element.isDenied);
if (isDenied) {
showSet(permission);
return false;
}
}
if (application) {
PermissionStatus status = await permission.request();
return status.isGranted;
}
return false;
}
//
static Future<bool> request(Permission permission) async {
if (Get.context == null) {

View File

@ -15,7 +15,7 @@ class WxPayTool {
static Future<void> pay(Payment payment, WeChatResponseSubscriber listener) async {
if (!isInit) {
isInit = true;
await init(payment.appId, '123');
await init(payment.appId, 'https://lock.skychip.top/apple-app-site-association.json');
//
responseListener(WeChatResponse response) {
if (response is WeChatPaymentResponse) {

View File

@ -0,0 +1,27 @@
import 'package:colorfilter_generator/addons.dart';
import 'package:colorfilter_generator/colorfilter_generator.dart';
import 'package:flutter/material.dart';
import 'package:star_lock/flavors.dart';
class FlavorsImg extends StatelessWidget {
FlavorsImg({required this.child, key});
Widget child;
ColorFilterGenerator myFilter = ColorFilterGenerator(name: "xhj", filters: [
// ColorFilterAddons.addictiveColor(1, 22, 93),
ColorFilterAddons.addictiveColor(1, 22, 93),
// ColorFilterAddons.grayscale(),z
]);
@override
Widget build(BuildContext context) {
if (F.appFlavor != Flavor.xhj) {
return child;
}
return ColorFiltered(
colorFilter: ColorFilter.matrix(myFilter.matrix),
child: child,
);
}
}

View File

@ -31,9 +31,11 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# 1.0.26+20240408打包预发布环境给欧阳测试
# 1.0.27+2024041101打包提审
# 1.0.27+2024041102打包预发布环境给田总测试
# 1.0.28+2024041703打包给欧阳回归测试
# 1.0.28+2024041702打包给欧阳回归测试
# 1.0.27+2024041702 打包星星锁提审华为
# 1.0.27+2024041703 打包星星锁提审ios
version: 1.0.28+2024041703
version: 1.0.27+2024041803
environment:
sdk: '>=2.12.0 <3.0.0'
@ -161,6 +163,7 @@ dependencies:
fluwx: ^4.5.5
system_settings: ^2.0.0
expandable: ^5.0.1
colorfilter_generator: ^0.0.8
dev_dependencies: