1、注册、登录添加选择国家编号功能。2、绑定手机号添加选择国家编号功能。

This commit is contained in:
魏少阳 2024-04-12 18:03:40 +08:00
parent 02419fca61
commit f84be34b7d
26 changed files with 191 additions and 415 deletions

View File

@ -663,6 +663,9 @@
"用户无权限": "User has no permission",
"创建公司后,考勤功能才能使用": "After creating the company, the attendance function can be used",
"是否删除钥匙?": "Whether to delete the key?",
"邮箱绑定成功": "Email binding success",
"手机绑定成功": "Mobile phone binding success",
"网络访问失败,请检查网络是否正常": "网络访问失败,请检查网络是否正常",
"相机": "camera",
"相册": "photos",

View File

@ -662,6 +662,9 @@
"用户无权限": "用户无权限",
"创建公司后,考勤功能才能使用": "创建公司后,考勤功能才能使用",
"是否删除钥匙?": "是否删除钥匙?",
"邮箱绑定成功": "邮箱绑定成功",
"手机绑定成功": "手机绑定成功",
"网络访问失败,请检查网络是否正常": "网络访问失败,请检查网络是否正常",
"相机": "相机",
"相册": "相册",

View File

@ -664,6 +664,9 @@
"用户无权限": "用户无权限",
"创建公司后,考勤功能才能使用": "创建公司后,考勤功能才能使用",
"是否删除钥匙?": "是否删除钥匙?",
"邮箱绑定成功": "邮箱绑定成功",
"手机绑定成功": "手机绑定成功",
"网络访问失败,请检查网络是否正常": "网络访问失败,请检查网络是否正常",
"相机": "相机",
"相册": "相册",

View File

@ -1,291 +0,0 @@
PODS:
- aj_captcha_flutter (0.0.1):
- Flutter
- AlicloudPush (1.9.9.8):
- AlicloudSender
- AlicloudUT
- AlicloudUtils
- AlicloudSender (1.0.0.3):
- AlicloudUTDID
- EMASRest
- AlicloudUT (5.2.0.16):
- AlicloudUTDID
- AlicloudUTDID (1.5.0.94)
- AlicloudUtils (1.4.1):
- AlicloudUTDID
- AMap3DMap (9.7.0):
- AMapFoundation (>= 1.8.0)
- amap_flutter_location (0.0.1):
- AMapLocation
- Flutter
- amap_flutter_map (0.0.1):
- AMap3DMap
- Flutter
- AMapFoundation (1.8.2)
- AMapLocation (2.10.0):
- AMapFoundation (>= 1.8.0)
- app_settings (5.1.1):
- Flutter
- audio_service (0.0.1):
- Flutter
- audio_session (0.0.1):
- Flutter
- audioplayers_darwin (0.0.1):
- Flutter
- auto_orientation (0.0.1):
- Flutter
- camera_avfoundation (0.0.1):
- Flutter
- connectivity_plus (0.0.1):
- Flutter
- ReachabilitySwift
- device_info_plus (0.0.1):
- Flutter
- EMASRest (11.1.1.2)
- Flutter (1.0.0)
- flutter_blue_plus (0.0.1):
- Flutter
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_native_contact_picker (0.0.1):
- Flutter
- flutter_pcm_sound (0.0.1):
- Flutter
- flutter_voice_processor (1.1.1):
- Flutter
- ios-voice-processor (~> 1.1.0)
- fluttertoast (0.0.2):
- Flutter
- Toast
- g711_flutter (0.0.1):
- Flutter
- google_maps_flutter_ios (0.0.1):
- Flutter
- GoogleMaps (< 9.0)
- GoogleMaps (6.2.1):
- GoogleMaps/Maps (= 6.2.1)
- GoogleMaps/Base (6.2.1)
- GoogleMaps/Maps (6.2.1):
- GoogleMaps/Base
- image_gallery_saver (2.0.2):
- Flutter
- image_picker_ios (0.0.1):
- Flutter
- ios-voice-processor (1.1.0)
- JCore (4.4.0)
- JPush (5.2.0):
- JCore (>= 2.0.0)
- jpush_flutter (0.0.2):
- Flutter
- JCore (= 4.4.0)
- JPush (= 5.2.0)
- just_audio (0.0.1):
- Flutter
- network_info_plus (0.0.1):
- Flutter
- package_info_plus (0.4.5):
- Flutter
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.1.1):
- Flutter
- ReachabilitySwift (5.0.0)
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.3):
- Flutter
- FlutterMacOS
- system_settings (0.0.1):
- Flutter
- Toast (4.0.0)
- url_launcher_ios (0.0.1):
- Flutter
- video_player_avfoundation (0.0.1):
- Flutter
- FlutterMacOS
- webview_flutter_wkwebview (0.0.1):
- Flutter
DEPENDENCIES:
- aj_captcha_flutter (from `.symlinks/plugins/aj_captcha_flutter/ios`)
- AlicloudPush (~> 1.9.9)
- amap_flutter_location (from `.symlinks/plugins/amap_flutter_location/ios`)
- amap_flutter_map (from `.symlinks/plugins/amap_flutter_map/ios`)
- app_settings (from `.symlinks/plugins/app_settings/ios`)
- audio_service (from `.symlinks/plugins/audio_service/ios`)
- audio_session (from `.symlinks/plugins/audio_session/ios`)
- audioplayers_darwin (from `.symlinks/plugins/audioplayers_darwin/ios`)
- auto_orientation (from `.symlinks/plugins/auto_orientation/ios`)
- camera_avfoundation (from `.symlinks/plugins/camera_avfoundation/ios`)
- connectivity_plus (from `.symlinks/plugins/connectivity_plus/ios`)
- device_info_plus (from `.symlinks/plugins/device_info_plus/ios`)
- Flutter (from `Flutter`)
- flutter_blue_plus (from `.symlinks/plugins/flutter_blue_plus/ios`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_native_contact_picker (from `.symlinks/plugins/flutter_native_contact_picker/ios`)
- flutter_pcm_sound (from `.symlinks/plugins/flutter_pcm_sound/ios`)
- flutter_voice_processor (from `.symlinks/plugins/flutter_voice_processor/ios`)
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
- g711_flutter (from `.symlinks/plugins/g711_flutter/ios`)
- google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`)
- image_gallery_saver (from `.symlinks/plugins/image_gallery_saver/ios`)
- image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
- JPush
- jpush_flutter (from `.symlinks/plugins/jpush_flutter/ios`)
- just_audio (from `.symlinks/plugins/just_audio/ios`)
- network_info_plus (from `.symlinks/plugins/network_info_plus/ios`)
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- system_settings (from `.symlinks/plugins/system_settings/ios`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- video_player_avfoundation (from `.symlinks/plugins/video_player_avfoundation/darwin`)
- webview_flutter_wkwebview (from `.symlinks/plugins/webview_flutter_wkwebview/ios`)
SPEC REPOS:
https://github.com/aliyun/aliyun-specs.git:
- AlicloudPush
- AlicloudSender
- AlicloudUT
- AlicloudUTDID
- AlicloudUtils
- EMASRest
https://github.com/CocoaPods/Specs.git:
- AMap3DMap
- AMapFoundation
- AMapLocation
- GoogleMaps
- ios-voice-processor
- JCore
- JPush
- ReachabilitySwift
- Toast
EXTERNAL SOURCES:
aj_captcha_flutter:
:path: ".symlinks/plugins/aj_captcha_flutter/ios"
amap_flutter_location:
:path: ".symlinks/plugins/amap_flutter_location/ios"
amap_flutter_map:
:path: ".symlinks/plugins/amap_flutter_map/ios"
app_settings:
:path: ".symlinks/plugins/app_settings/ios"
audio_service:
:path: ".symlinks/plugins/audio_service/ios"
audio_session:
:path: ".symlinks/plugins/audio_session/ios"
audioplayers_darwin:
:path: ".symlinks/plugins/audioplayers_darwin/ios"
auto_orientation:
:path: ".symlinks/plugins/auto_orientation/ios"
camera_avfoundation:
:path: ".symlinks/plugins/camera_avfoundation/ios"
connectivity_plus:
:path: ".symlinks/plugins/connectivity_plus/ios"
device_info_plus:
:path: ".symlinks/plugins/device_info_plus/ios"
Flutter:
:path: Flutter
flutter_blue_plus:
:path: ".symlinks/plugins/flutter_blue_plus/ios"
flutter_local_notifications:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_native_contact_picker:
:path: ".symlinks/plugins/flutter_native_contact_picker/ios"
flutter_pcm_sound:
:path: ".symlinks/plugins/flutter_pcm_sound/ios"
flutter_voice_processor:
:path: ".symlinks/plugins/flutter_voice_processor/ios"
fluttertoast:
:path: ".symlinks/plugins/fluttertoast/ios"
g711_flutter:
:path: ".symlinks/plugins/g711_flutter/ios"
google_maps_flutter_ios:
:path: ".symlinks/plugins/google_maps_flutter_ios/ios"
image_gallery_saver:
:path: ".symlinks/plugins/image_gallery_saver/ios"
image_picker_ios:
:path: ".symlinks/plugins/image_picker_ios/ios"
jpush_flutter:
:path: ".symlinks/plugins/jpush_flutter/ios"
just_audio:
:path: ".symlinks/plugins/just_audio/ios"
network_info_plus:
:path: ".symlinks/plugins/network_info_plus/ios"
package_info_plus:
:path: ".symlinks/plugins/package_info_plus/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/darwin"
system_settings:
:path: ".symlinks/plugins/system_settings/ios"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
video_player_avfoundation:
:path: ".symlinks/plugins/video_player_avfoundation/darwin"
webview_flutter_wkwebview:
:path: ".symlinks/plugins/webview_flutter_wkwebview/ios"
SPEC CHECKSUMS:
aj_captcha_flutter: dd7af1aa064bdd621ae335b819bab07309c3c023
AlicloudPush: 88529c9b796e4ece0601de0867b30359f55b61f7
AlicloudSender: 1f468b6bd962a099ffc19d45e3608b0fe98f259d
AlicloudUT: 6d1cf30d57d096b7e9bb4b069dd0ba6ad59a3338
AlicloudUTDID: 7323c443dcdf9a73e2224dc6ce51703671d7a765
AlicloudUtils: 873a76615bebcee8b1996f20820d366e433c3eab
AMap3DMap: dce25dd3e51e6b92109caa7d0c97fc6055830fb3
amap_flutter_location: 44ff5beb64f42e0bf5feb402fe299dac0013af6f
amap_flutter_map: 979e54d227cedac6c7504a2151bfbf3bcf96760a
AMapFoundation: 9885c48fc3a78fdfb84a0299a2293e56ea3c9fec
AMapLocation: 5248aec2455ebb5d104b367813c946430a2ee033
app_settings: 017320c6a680cdc94c799949d95b84cb69389ebc
audio_service: f509d65da41b9521a61f1c404dd58651f265a567
audio_session: 4f3e461722055d21515cf3261b64c973c062f345
audioplayers_darwin: 877d9a4d06331c5c374595e46e16453ac7eafa40
auto_orientation: 102ed811a5938d52c86520ddd7ecd3a126b5d39d
camera_avfoundation: 8b8d780bcfb6a4a02b0fbe2b4bd17b5b71946e68
connectivity_plus: bf0076dd84a130856aa636df1c71ccaff908fa1d
device_info_plus: e5c5da33f982a436e103237c0c85f9031142abed
EMASRest: 8df6f87836767a9415ad5cc4af739bc9d215b475
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_blue_plus: 4837da7d00cf5d441fdd6635b3a57f936778ea96
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
flutter_pcm_sound: de0572ca4f99091cc2abfcc31601b8a4ddd33c0e
flutter_voice_processor: 2b89b93d69b02227ae3fd58589ee0bcfa3ca2a82
fluttertoast: 31b00dabfa7fb7bacd9e7dbee580d7a2ff4bf265
g711_flutter: 8f2769052d2cf3549f83d11e1c42d81d94441123
google_maps_flutter_ios: d1318b4ff711612cab16862d7a87e31a7403d458
GoogleMaps: 20d7b12be49a14287f797e88e0e31bc4156aaeb4
image_gallery_saver: cb43cc43141711190510e92c460eb1655cd343cb
image_picker_ios: 99dfe1854b4fa34d0364e74a78448a0151025425
ios-voice-processor: 8e32d7f980a06d392d128ef1cd19cf6ddcaca3c1
JCore: 05f0f3489672ea3fa55338bae4866224bc092b1f
JPush: 76668b765fcfd7c15f86b05ca0e5cdc01945ce23
jpush_flutter: 1f436f1a02db5c5ef9e9b42378f557096ccd328b
just_audio: baa7252489dbcf47a4c7cc9ca663e9661c99aafa
network_info_plus: 6d0c3eb8367b8164fa3fb0c19875e3f59d49697f
package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812
video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579
webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4
PODFILE CHECKSUM: 317f9473a5705c6fe4d79d95e81676f248048fdc
COCOAPODS: 1.14.3

View File

@ -180,6 +180,7 @@ class BlueManage {
FlutterBluePlus.startScan(timeout: Duration(seconds: timeout));
Completer<dynamic> completer = Completer<dynamic>();
var subscription = FlutterBluePlus.scanResults.listen((results) {
Get.log("startScanSingle扫描到的设备:$results");
bool isExit = results.any((element) => element.device.platformName == deviceName);
if (isExit) {
for (var scanResult in results) {
@ -442,7 +443,7 @@ class BlueManage {
_subScribeToCharacteristic(BluetoothCharacteristic characteristic) async {
final subscription = characteristic.onValueReceived.listen((data) {
Get.log("启动对特性的通知。当特性的值发生变化时,设备会发送一个通知");
// Get.log("启动对特性的通知。当特性的值发生变化时,设备会发送一个通知");
Get.log("订阅获取的数据:$data");
if (data == lastTimeData || data.isEmpty) {
return;
@ -455,14 +456,14 @@ class BlueManage {
//
//
dataLen = data[8] * 256 + data[9]; // 16
// Get.log("dataLen1111:$dataLen getDataLength:${data.length}");
Get.log("dataLen1111:$dataLen getDataLength:${data.length} data:$data");
if (dataLen! + 12 > data.length) {
//
allData.addAll(data);
} else {
//
allData.addAll(data);
// Get.log("dataLen2222:$dataLen getDataLength:${data.length}");
Get.log("dataLen2222:$dataLen getDataLength:${data.length}");
CommandReciverManager.appDataReceive(allData);
//
allData = <int>[];
@ -471,9 +472,9 @@ class BlueManage {
//
allData.addAll(data);
// var len = allData[8] * 256 + allData[9];
// print("dataLen3333:$dataLen");
print("dataLen3333:$dataLen allData.length:${allData.length} allData:$allData");
if ((dataLen! + 14) <= allData.length) {
// print("44444数据被解析了");
print("44444数据被解析了");
//
CommandReciverManager.appDataReceive(allData);
//

View File

@ -67,7 +67,7 @@ class CommandReciverManager {
var dataLen = data[8] * 256 + data[9]; // 16
var oriLen = data[10] * 256 + data[11]; // 16
// print("dataLen:$dataLen oriLen:$oriLen");
print("dataLen:$dataLen oriLen:$oriLen");
// List<int> dataList = [];
List<int> oriDataList = [];
switch (tmpType) {

View File

@ -17,8 +17,11 @@ class StarLockLoginLogic extends BaseGetXController {
final stateMyLogic = Get.put(StarLockMineLogic()).state;
void login() async {
var entity = await ApiRepository.to
.login("1", state.pwd.value, "+86", state.emailOrPhone.value);
var entity = await ApiRepository.to.login(
loginType:"1",
password:state.pwd.value,
countryCode:state.countryCode.value,
username:state.emailOrPhone.value);
if (entity.errorCode!.codeIsSuccessful) {
Storage.saveLoginData(entity.data);
eventBus.fire(MineInfoChangeRefreshUI());

View File

@ -8,6 +8,7 @@ import 'package:star_lock/flavors.dart';
import '../../appRouters.dart';
import '../../app_settings/app_colors.dart';
import '../../common/XSConstantMacro/XSConstantMacro.dart';
import '../../tools/commonItem.dart';
import '../../tools/tf_loginInput.dart';
import '../../tools/submitBtn.dart';
import '../../tools/titleAppBar.dart';
@ -61,6 +62,28 @@ class _StarLockLoginPageState extends State<StarLockLoginPage> {
child: Image.asset('images/icon_main_1024.png',
width: 110.w, height: 110.w))),
SizedBox(height: 50.w),
CommonItem(
leftTitel: "${"你所在的".tr}${TranslationLoader.lanKeys!.countryAndRegion!.tr}",
rightTitle: "",
isHaveLine: true,
isPadding: false,
isHaveRightWidget: true,
isHaveDirection: true,
rightWidget: Text(
'${state.countryName.value} +${state.countryCode.value}',
textAlign: TextAlign.end,
style:
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
),
action: () async {
var result = await Get.toNamed(Routers.selectCountryRegionPage);
if (result != null) {
result as Map<String, dynamic>;
state.countryCode.value = result['code'];
state.countryName.value = result['countryName'];
}
},
),
LoginInput(
controller: state.emailOrPhoneController,
onchangeAction: (v) {

View File

@ -5,6 +5,9 @@ class StarLockLoginState {
var passwordShow = true.obs;
var agree = false.obs;
var countryCode = '86'.obs;
var countryName = '中国'.obs;
var emailOrPhone = ''.obs;
var pwd = ''.obs;
var canNext = false.obs;

View File

@ -31,7 +31,7 @@ class StarLockRegisterLogic extends BaseGetXController {
void register() async {
var entity = await ApiRepository.to.register(
receiverType: state.isIphoneType.value == true ? 1 : 2,
countryCode: state.countryCode.value,
countryCode: int.parse(state.countryCode.value),
account: state.phoneOrEmailStr.value,
password: state.pwd.value,
verificationCode: state.verificationCode.value);

View File

@ -143,16 +143,15 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
SizedBox(height: 60.h),
GestureDetector(
onTap: () async {
var result = await Navigator.pushNamed(
context, Routers.selectCountryRegionPage);
var result = await Get.toNamed(Routers.selectCountryRegionPage);
if (result != null) {
result as Map<String, dynamic>;
state.countryCode.value = result['code'];
state.countryName.value = result['countryName'];
}
// print("路由返回值: ${result}, countryCode:${logic.state.countryCode} ,countryId:${logic.state.countryId}");
Get.log("路由返回值: $result, countryCode:${logic.state.countryCode}");
},
child: SizedBox(
child: Obx(() => SizedBox(
height: 70.h,
child: Row(
children: [
@ -165,14 +164,14 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Obx(() => Text(
state.isIphoneType.value
? '${state.countryName} +${state.countryCode}'
: "${state.countryName}",
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 26.sp, color: AppColors.blackColor),
))
Text(
state.isIphoneType.value
? '${state.countryName.value} +${state.countryCode.value}'
: state.countryName.value,
textAlign: TextAlign.end,
style: TextStyle(
fontSize: 26.sp, color: AppColors.blackColor),
)
],
),
SizedBox(width: 5.w),
@ -183,7 +182,7 @@ class _StarLockRegisterPageState extends State<StarLockRegisterPage> {
),
],
),
),
)),
),
Container(
height: 0.5.h,

View File

@ -10,7 +10,7 @@ class StarLockRegisterState {
final TextEditingController sureController = TextEditingController();
final TextEditingController codeController = TextEditingController();
var countryCode = 86.obs;
var countryCode = "86".obs;
var countryName = '中国'.tr.obs;
var phoneOrEmailStr = ''.obs;

View File

@ -451,9 +451,7 @@ class LockDetailLogic extends BaseGetXController {
// );
Get.log("openMode:${state.openDoorModel}");
BlueManage()
.bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!,
(BluetoothConnectionState deviceConnectionState) async {
BlueManage().bludSendData(state.keyInfos.value.bluetooth!.bluetoothDeviceName!, (BluetoothConnectionState deviceConnectionState) async {
if (deviceConnectionState == BluetoothConnectionState.connected) {
IoSenderManage.senderOpenLock(
keyID: BlueManage().connectDeviceName,
@ -636,12 +634,16 @@ class LockDetailLogic extends BaseGetXController {
// token
void getLockNetToken() async {
LockNetTokenEntity entity = await ApiRepository.to
.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
LockNetTokenEntity entity = await ApiRepository.to.getLockNetToken(lockId: state.keyInfos.value.lockId.toString());
if (entity.errorCode!.codeIsSuccessful) {
state.lockNetToken = entity.data!.token!;
Get.log("state.lockNetToken:${state.lockNetToken}");
openDoorAction();
}else{
showToast("获取联网token失败", something: (){
state.openLockBtnState.value = 0;
cancelBlueConnetctToastTimer();
});
}
}
@ -649,7 +651,8 @@ class LockDetailLogic extends BaseGetXController {
void _updateLockUserNo() async {
LockNetTokenEntity entity = await ApiRepository.to.updateLockUserNo(
keyId: state.keyInfos.value.keyId.toString(),
lockUserNo: state.lockUserNo.toString());
lockUserNo: state.lockUserNo.toString()
);
if (entity.errorCode!.codeIsSuccessful) {
eventBus.fire(RefreshLockDetailInfoDataEvent());
SchedulerBinding.instance.addPostFrameCallback((_) {
@ -718,19 +721,16 @@ class LockDetailLogic extends BaseGetXController {
void initLockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceAction() {
// eventBus
state.lockSetOpenOrCloseCheckInRefreshLockDetailWithAttendanceEvent =
eventBus
.on<LockSetChangeSetRefreshLockDetailWithType>()
.listen((event) {
eventBus.on<LockSetChangeSetRefreshLockDetailWithType>().listen((event) {
if (event.type == 0) {
// 0
state.isAttendance.value = int.parse(event.setResult);
state.keyInfos.value.lockSetting!.attendance =
int.parse(event.setResult);
state.keyInfos.value.lockSetting!.attendance = int.parse(event.setResult);
} else if (event.type == 1) {
// 1
state.isOpenLockNeedOnline.value = int.parse(event.setResult);
state.keyInfos.value.lockSetting!.appUnlockOnline =
int.parse(event.setResult);
state.keyInfos.value.lockSetting!.appUnlockOnline = int.parse(event.setResult);
state.lockNetToken = "";// token
Get.log(
"state.isOpenLockNeedOnline.value:${state.isOpenLockNeedOnline.value}");
} else if (event.type == 2) {

View File

@ -46,6 +46,8 @@ class _EditLockNamePageState extends State<EditLockNamePage> {
controller: state.changeLockNameController,
leftWidget: const SizedBox(),
hintText: "请输入名称".tr,
isHaveLeftWidget: true,
isSuffixIcon: true,
inputFormatters: [
LengthLimitingTextInputFormatter(50),
]),

View File

@ -1,6 +1,5 @@
import 'dart:async';
// import 'package:flutter_reactive_ble/flutter_reactive_ble.dart';
import 'package:flutter_blue_plus/flutter_blue_plus.dart';
import 'package:get/get.dart';
import 'package:star_lock/blue/io_protocol/io_getPrivateKey.dart';
@ -28,7 +27,6 @@ class NearbyLockLogic extends BaseGetXController {
IoSenderManage.getPublicKey(lockId: deviceName);
}else if (state == BluetoothConnectionState.disconnected) {
dismissEasyLoading();
// showBlueConnetctToast();
}
}, isAddEquipment: true);
}
@ -36,8 +34,7 @@ class NearbyLockLogic extends BaseGetXController {
//
late StreamSubscription<Reply> _replySubscription;
void _initReplySubscription() {
_replySubscription =
EventBusManager().eventBus!.on<Reply>().listen((reply) {
_replySubscription = EventBusManager().eventBus!.on<Reply>().listen((reply) {
if (reply is GetPublicKeyReply) {
_replyGetPublicKey(reply);
}
@ -58,7 +55,7 @@ class NearbyLockLogic extends BaseGetXController {
switch (reply.status) {
case 0x00:
//
print("获取公钥成功");
Get.log("获取公钥成功");
//
var publicKey = reply.data.sublist(3);
var saveStrList = changeIntListToStringList(publicKey);
@ -75,15 +72,15 @@ class NearbyLockLogic extends BaseGetXController {
break;
case 0x07:
//
print("获取公钥无权限");
Get.log("获取公钥无权限");
break;
case 0x0f:
//
print("获取公钥用户已存在");
Get.log("获取公钥用户已存在");
break;
default:
//
print("获取公钥失败");
Get.log("获取公钥失败");
break;
}
}
@ -92,19 +89,19 @@ class NearbyLockLogic extends BaseGetXController {
switch (reply.status) {
case 0x00:
//
print('获取私钥成功');
Get.log('获取私钥成功');
reply.data.removeAt(0);
print("reply.data:${reply.data}");
Get.log("reply.data:${reply.data}");
//
List<int> privateKey = reply.data.sublist(0, 16);
print("privateKey:$privateKey");
Get.log("privateKey:$privateKey");
var savePrivateKeyList = changeIntListToStringList(privateKey);
Storage.setStringList(saveBluePrivateKey, savePrivateKeyList);
// signKey
List<int> signKey = reply.data.sublist(16, 32);
print("signKey:$signKey");
Get.log("signKey:$signKey");
var saveSignKeyList = changeIntListToStringList(signKey);
Storage.setStringList(saveBlueSignKey, saveSignKeyList);
@ -114,23 +111,21 @@ class NearbyLockLogic extends BaseGetXController {
(0xff & timestamp[1]) << 16 |
(0xff & timestamp[2]) << 8 |
(0xFF & timestamp[3]));
// String timestampValueStr = DateTool().dateToYMDHNSString(timestampValue.toString());
// print("timestamp:$timestamp timestampValue:$timestampValue timestampValueStr:$timestampValueStr");
_getStarLockStatus();
break;
case 0x07:
//
print('获取私钥无权限');
Get.log('获取私钥无权限');
break;
case 0x0f:
//
print('获取私钥:用户已存在');
Get.log('获取私钥:用户已存在');
break;
default:
//
print('获取私钥失败');
Get.log('获取私钥失败');
break;
}
}
@ -145,63 +140,62 @@ class NearbyLockLogic extends BaseGetXController {
//
var vendor = reply.data.sublist(3, 23);
print("vendor:$vendor reply.data:${reply.data}");
Get.log("vendor:$vendor reply.data:${reply.data}");
var vendorStr = utf8String(vendor);
state.lockInfo["vendor"] = vendorStr;
// print("vendor:$vendor vendorStr:$vendorStr vendorStr.length${vendorStr.length}");
//
var product = reply.data[23];
state.lockInfo["product"] = product;
// print("product:$product");
// Get.log("product:$product");
//
var model = reply.data.sublist(24, 44);
var modelStr = utf8String(model);
state.lockInfo["model"] = modelStr;
// print("model:$model modelStr:$modelStr modelStr:${modelStr.length}");
// Get.log("model:$model modelStr:$modelStr modelStr:${modelStr.length}");
//
var fwVersion = reply.data.sublist(44, 64);
var fwVersionStr = utf8String(fwVersion);
state.lockInfo["fwVersion"] = fwVersionStr;
// print("fwVersion:$fwVersion fwVersionStr:$fwVersionStr fwVersionStr:${fwVersionStr.length}");
// Get.log("fwVersion:$fwVersion fwVersionStr:$fwVersionStr fwVersionStr:${fwVersionStr.length}");
//
var hwVersion = reply.data.sublist(64, 84);
var hwVersionStr = utf8String(hwVersion);
state.lockInfo["hwVersion"] = hwVersionStr;
// print("hwVersion:$hwVersion hwVersionStr:${hwVersionStr.length}");
// Get.log("hwVersion:$hwVersion hwVersionStr:${hwVersionStr.length}");
//
var serialNum0 = reply.data.sublist(84, 100);
var serialNum0Str = utf8String(serialNum0);
state.lockInfo["serialNum0"] = serialNum0Str;
// state.lockInfo["serialNum0"] = "${DateTime.now().millisecondsSinceEpoch ~/ 10}";
print("serialNum0Str:$serialNum0Str serialNum0Str:${serialNum0Str.length}");
Get.log("serialNum0Str:$serialNum0Str serialNum0Str:${serialNum0Str.length}");
//
var serialNum1 = reply.data.sublist(100, 116);
var serialNum1Str = utf8String(serialNum1);
state.lockInfo["serialNum1"] = serialNum1Str;
// print("serialNum1Str:$serialNum1Str serialNum1Str:${serialNum1Str.length}");
// Get.log("serialNum1Str:$serialNum1Str serialNum1Str:${serialNum1Str.length}");
//
var btDeviceName = reply.data.sublist(116, 132);
var btDeviceNameStr = utf8String(btDeviceName);
state.lockInfo["btDeviceName"] = btDeviceNameStr;
// print("btDeviceName:$btDeviceName btDeviceNameStr:$btDeviceNameStr btDeviceNameStr:${btDeviceNameStr.length}");
// Get.log("btDeviceName:$btDeviceName btDeviceNameStr:$btDeviceNameStr btDeviceNameStr:${btDeviceNameStr.length}");
//
var battRemCap = reply.data[132];
state.lockInfo["electricQuantity"] = battRemCap;
// print("battRemCap:$battRemCap");
// Get.log("battRemCap:$battRemCap");
//
var restoreCounter = reply.data.sublist(133, 135);
state.lockInfo["restoreCount"] =
restoreCounter[0] * 256 + restoreCounter[1];
// print("restoreCounter:$restoreCounter");
// Get.log("restoreCounter:$restoreCounter");
//
var restoreDate = reply.data.sublist(135, 139);
@ -211,13 +205,13 @@ class NearbyLockLogic extends BaseGetXController {
(0xFF & restoreDate[3]));
// String restoreDateStr = DateTool().dateToYMDHNSString(restoreDateValue.toString());
state.lockInfo["restoreDate"] = restoreDateValue * 1000;
// print("restoreDate:$restoreDate restoreDateValue:$restoreDateValue");
// Get.log("restoreDate:$restoreDate restoreDateValue:$restoreDateValue");
//
var icPartNo = reply.data.sublist(139, 149);
var icPartNoStr = utf8String(icPartNo);
state.lockInfo["icPartNo"] = icPartNoStr;
// print("icPartNo:$icPartNo icPartNoStr:$icPartNoStr");
// Get.log("icPartNo:$icPartNo icPartNoStr:$icPartNoStr");
//
var indate = reply.data.sublist(149, 153);
@ -227,13 +221,13 @@ class NearbyLockLogic extends BaseGetXController {
(0xFF & indate[3]));
// String indateStr = DateTool().dateToYMDHNSString("$indateValue");
state.lockInfo["indate"] = indateValue * 1000;
// print("indate:$indate indateValue:$indateValue");
// Get.log("indate:$indate indateValue:$indateValue");
// mac地址
var macAddress = reply.data.sublist(153, 173);
var macAddressStr = utf8String(macAddress);
state.lockInfo["mac"] = macAddressStr;
print("macAddress:$macAddress macAddressStr:$macAddressStr");
Get.log("macAddress:$macAddress macAddressStr:$macAddressStr");
var index = 173;
//
@ -249,7 +243,7 @@ class NearbyLockLogic extends BaseGetXController {
String featureValueStr = asciiString(featureValue);
state.featureValue = featureValueStr;
// List allFeatureValueTwoList = charListChangeIntList(featureValue);
// print("featureValueLength:$featureValueLength featureValue:$featureValue \n featureValueStr:$featureValueStr");
// Get.log("featureValueLength:$featureValueLength featureValue:$featureValue \n featureValueStr:$featureValueStr");
index = index + featureValueLength + 1;
// 使
@ -264,7 +258,7 @@ class NearbyLockLogic extends BaseGetXController {
String featureEnValStr = asciiString(featureEnVal);
state.featureSettingValue = featureEnValStr;
// List allFeatureEnValTwoList = charListChangeIntList(featureEnVal);
// print("featureEnValLength:$featureEnValLength featureEnVal:$featureEnVal \n featureEnValStr:$featureEnValStr");
// Get.log("featureEnValLength:$featureEnValLength featureEnVal:$featureEnVal \n featureEnValStr:$featureEnValStr");
index = index + featureEnValLength + 1;
//
@ -272,7 +266,7 @@ class NearbyLockLogic extends BaseGetXController {
var featureParaTotalList = reply.data.sublist(index);
state.featureSettingParams = featureParaTotalList;
// print("featureParaTotalList:$featureParaTotalList");
// Get.log("featureParaTotalList:$featureParaTotalList");
Get.toNamed(Routers.lockAddressGaoDePage, arguments: {
"pwdTimestamp": state.timestampValue * 1000,
@ -285,23 +279,19 @@ class NearbyLockLogic extends BaseGetXController {
break;
case 0x06:
//
print("${reply.commandType}需要鉴权");
Get.log("${reply.commandType}需要鉴权");
break;
case 0x07:
//
print("${reply.commandType}用户无权限");
Get.log("${reply.commandType}用户无权限");
break;
case 0x09:
//
print("${reply.commandType}权限校验错误");
Get.log("${reply.commandType}权限校验错误");
break;
default:
//
print("${reply.commandType}失败");
Get.log("${reply.commandType}失败");
break;
}
}

View File

@ -1,3 +1,4 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

View File

@ -51,7 +51,7 @@ class MineBindPhoneOrEmailLogic extends BaseGetXController {
state.verificationCode.value,
state.unbindToken.value);
if (entity.errorCode!.codeIsSuccessful) {
showToast("邮箱绑定成功", something: () async {
showToast("邮箱绑定成功".tr, something: () async {
final loginData = await Storage.getLoginData();
loginData!.email = state.inputAccount.value;
Storage.saveLoginData(loginData);
@ -69,7 +69,7 @@ class MineBindPhoneOrEmailLogic extends BaseGetXController {
state.verificationCode.value,
state.unbindToken.value);
if (entity.errorCode!.codeIsSuccessful) {
showToast("手机绑定成功", something: () async {
showToast("手机绑定成功".tr, something: () async {
final loginData = await Storage.getLoginData();
loginData!.mobile = state.inputAccount.value;
Storage.saveLoginData(loginData);

View File

@ -4,7 +4,9 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/mineBindPhoneOrEmail_logic.dart';
import '../../../appRouters.dart';
import '../../../app_settings/app_colors.dart';
import '../../../tools/commonItem.dart';
import '../../../tools/submitBtn.dart';
import '../../../tools/tf_loginInput.dart';
import '../../../tools/titleAppBar.dart';
@ -33,6 +35,7 @@ class _MineBindPhoneOrEmailPageState extends State<MineBindPhoneOrEmailPage> {
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Container(
color: Colors.white,
padding: EdgeInsets.only(top: 10.h, left: 30.w, right: 30.w),
child: Column(
children: [
@ -45,6 +48,28 @@ class _MineBindPhoneOrEmailPageState extends State<MineBindPhoneOrEmailPage> {
: TranslationLoader.lanKeys!.changeEmailTip!.tr,
style: TextStyle(fontSize: 20.sp),
)),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr,
rightTitle: "",
isHaveLine: true,
isPadding: false,
isHaveRightWidget: true,
isHaveDirection: true,
rightWidget: Text(
'${state.countryName.value} +${state.countryCode.value}',
textAlign: TextAlign.end,
style:
TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor),
),
action: () async {
var result = await Get.toNamed(Routers.selectCountryRegionPage);
if (result != null) {
result as Map<String, dynamic>;
state.countryCode.value = result['code'];
state.countryName.value = result['countryName'];
}
},
),
LoginInput(
controller: state.accountController,
isPwd: false,

View File

@ -10,11 +10,12 @@ class MineBindPhoneOrEmailState {
return DateTime.now().millisecondsSinceEpoch;
}
var countryCode = '+86'.obs;
var countryCode = '86'.obs;
var countryName = '中国'.obs;
var countryId = '9'.obs;
var codeType = '4'.obs; //123456 7
var channel = '1'.obs; // 1 2
var uniqueid = 'B748F838-94EE-4BDB-A0E6-7B2D16849792'.obs;
var verificationCode = ''.obs;
var xWidth = ''.obs; //
var canSub = false.obs;

View File

@ -40,7 +40,7 @@ class _GroupEditLockPageState extends State<GroupEditLockPage> {
),
),
Expanded(child: _buildMainUI()),
SubmitBtn(btnName: TranslationLoader.lanKeys!.send!.tr, onClick: () async {
SubmitBtn(btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () async {
var idList = [];
for(int i = 0; i<state.lockList.length; i++){
LockListItem lockListItem = state.lockList[i];

View File

@ -10,7 +10,6 @@ import '../../../../../../tools/titleAppBar.dart';
import '../../../../../../translations/trans_lib.dart';
import '../../../../appRouters.dart';
import '../../../../tools/custom_bottom_sheet.dart';
import '../../../../tools/jh_pop_menus.dart';
class LockItemListPage extends StatefulWidget {
const LockItemListPage({Key? key}) : super(key: key);

View File

@ -308,33 +308,33 @@ class _MineSetPageState extends State<MineSetPage> with WidgetsBindingObserver {
}
//
void _showDialog(widgetContext) {
showCupertinoDialog(
context: widgetContext,
builder: (context) {
return CupertinoAlertDialog(
title: Text(TranslationLoader.lanKeys!.deleteAccountTips!.tr),
actions: [
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.cancel!.tr),
onPressed: () {
Navigator.of(context).pop();
},
),
CupertinoDialogAction(
child: Text(TranslationLoader.lanKeys!.sure!.tr),
onPressed: () {
Get.back();
//
Get.toNamed(Routers.safeVerifyPage);
setState(() {});
},
),
],
);
},
);
}
// void _showDialog(widgetContext) {
// showCupertinoDialog(
// context: widgetContext,
// builder: (context) {
// return CupertinoAlertDialog(
// title: Text(TranslationLoader.lanKeys!.deleteAccountTips!.tr),
// actions: [
// CupertinoDialogAction(
// child: Text(TranslationLoader.lanKeys!.cancel!.tr),
// onPressed: () {
// Navigator.of(context).pop();
// },
// ),
// CupertinoDialogAction(
// child: Text(TranslationLoader.lanKeys!.sure!.tr),
// onPressed: () {
// Get.back();
// //
// Get.toNamed(Routers.safeVerifyPage);
// setState(() {});
// },
// ),
// ],
// );
// },
// );
// }
// void showLoginOutAlertTipDialog() {
// showCupertinoDialog(

View File

@ -52,11 +52,11 @@ class BaseProvider extends GetConnect with Api {
// print('res.body======>${res.body}');
if (res.body == null) {
if (EasyLoading.isShow) await EasyLoading.dismiss(animation: true);
EasyLoading.showToast("数据请求失败", duration: 2000.milliseconds);
EasyLoading.showToast("网络访问失败,请检查网络是否正常".tr, duration: 2000.milliseconds);
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
if (res.statusCode == null) {
EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
}
// if (res.statusCode == null) {
// EasyLoading.showToast("Network Error!", duration: 2000.milliseconds);
// }
var rs = {
"errorMsg": "Network Error!",
"errorCode": -1,

View File

@ -100,8 +100,13 @@ class ApiRepository {
}
//
Future<LoginEntity> login(String loginType, String password,
String countryCode, String username) async {
Future<LoginEntity> login(
{
required String loginType,
required String password,
required String countryCode,
required String username
}) async {
final res =
await apiProvider.login(loginType, password, countryCode, username);
return LoginEntity.fromJson(res.body);
@ -269,8 +274,7 @@ class ApiRepository {
}
// NO
Future<LockNetTokenEntity> updateLockUserNo(
{required String keyId, required String lockUserNo}) async {
Future<LockNetTokenEntity> updateLockUserNo({required String keyId, required String lockUserNo}) async {
final res = await apiProvider.updateLockUserNo(keyId, lockUserNo);
return LockNetTokenEntity.fromJson(res.body);
}

View File

@ -13,6 +13,7 @@ class CommonItem extends StatelessWidget {
Function()? tipsImgAction;
double? allHeight;
bool? isTipsImg;
bool? isPadding;
CommonItem(
{Key? key,
@ -22,6 +23,7 @@ class CommonItem extends StatelessWidget {
this.isHaveDirection = false,
this.isHaveLine = false,
this.isHaveRightWidget = false,
this.isPadding = true,
this.rightWidget,
this.isTipsImg,
this.action,
@ -38,8 +40,7 @@ class CommonItem extends StatelessWidget {
Container(
height: allHeight ?? 65.h,
color: Colors.white,
padding: EdgeInsets.only(
left: 20.w, right: 10.w), // , top: 20.w, bottom: 20.w
padding: isPadding == true ? EdgeInsets.only(left: 20.w, right: 10.w) : EdgeInsets.zero, // , top: 20.w, bottom: 20.w
child: Row(
children: [
// SizedBox(width: 20.w),
@ -99,8 +100,8 @@ class CommonItem extends StatelessWidget {
isHaveLine!
? Divider(
color: AppColors.greyLineColor,
indent: 20.w,
endIndent: 20.w,
indent: isPadding == true ? 20.w : 0,
endIndent: isPadding == true ? 20.w : 0,
height: 1,
)
: Container()

View File

@ -20,6 +20,7 @@ class LoginInput extends StatelessWidget {
Widget? leftWidget;
String? label;
bool? isPwd;
bool? isSuffixIcon;
Widget? rightSlot;
BlockStrCallback? onchangeAction;
BlockClickCallback? onTapAction;
@ -30,6 +31,7 @@ class LoginInput extends StatelessWidget {
this.rightSlot,
this.label,
this.isPwd,
this.isSuffixIcon,
this.inputFormatters,
this.keyboardType,
this.background,
@ -67,6 +69,10 @@ class LoginInput extends StatelessWidget {
hintText: hintText,
//线
border: InputBorder.none,
suffixIcon: isSuffixIcon! ? IconButton(
icon: const Icon(Icons.clear),
onPressed: controller!.clear,
) : null,
//
icon: isHaveLeftWidget == true
? leftWidget