diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index 2d881de2..eb41eae7 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -696,6 +696,10 @@ "管理员密码": "Administrator password", "如需修改,请输入新的管理员密码(6位),点击确定即可修改": "If you need to modify, please enter a new administrator password (6 digits), click OK to modify", "修改": "Modify", + "网络摄像头": "Network camera", + "重命名": "Rename", + "分组下的锁将被移到未分组里": "The locks under the group will be moved to ungrouped", + "编辑成功": "Edit success", "相机": "camera", "相册": "photos", diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index 617ab49d..a9f40be7 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -695,6 +695,10 @@ "管理员密码": "管理员密码", "如需修改,请输入新的管理员密码(6位),点击确定即可修改": "如需修改,请输入新的管理员密码(6位),点击确定即可修改", "修改": "修改", + "网络摄像头": "网络摄像头", + "重命名": "重命名", + "分组下的锁将被移到未分组里": "分组下的锁将被移到未分组里", + "编辑成功": "编辑成功", "相机": "相机", "相册": "相册", diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index 790574ae..918bc8d9 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -697,6 +697,10 @@ "管理员密码": "管理员密码", "如需修改,请输入新的管理员密码(6位),点击确定即可修改": "如需修改,请输入新的管理员密码(6位),点击确定即可修改", "修改": "修改", + "网络摄像头": "网络摄像头", + "重命名": "重命名", + "分组下的锁将被移到未分组里": "分组下的锁将被移到未分组里", + "编辑成功": "编辑成功", "相机": "相机", "相册": "相册", diff --git a/star_lock/ios/Podfile.lock b/star_lock/ios/Podfile.lock index 780716ea..bc49045f 100644 --- a/star_lock/ios/Podfile.lock +++ b/star_lock/ios/Podfile.lock @@ -13,7 +13,7 @@ PODS: - AlicloudUTDID (1.5.0.94) - AlicloudUtils (1.4.1): - AlicloudUTDID - - AMap3DMap (9.7.0): + - AMap3DMap (10.0.600): - AMapFoundation (>= 1.8.0) - amap_flutter_location (0.0.1): - AMapLocation @@ -94,7 +94,7 @@ PODS: - FlutterMacOS - permission_handler_apple (9.3.0): - Flutter - - ReachabilitySwift (5.0.0) + - ReachabilitySwift (5.2.2) - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS @@ -103,7 +103,7 @@ PODS: - FlutterMacOS - system_settings (0.0.1): - Flutter - - Toast (4.0.0) + - Toast (4.1.1) - url_launcher_ios (0.0.1): - Flutter - video_player_avfoundation (0.0.1): @@ -248,7 +248,7 @@ SPEC CHECKSUMS: AlicloudUT: 6d1cf30d57d096b7e9bb4b069dd0ba6ad59a3338 AlicloudUTDID: 7323c443dcdf9a73e2224dc6ce51703671d7a765 AlicloudUtils: 873a76615bebcee8b1996f20820d366e433c3eab - AMap3DMap: dce25dd3e51e6b92109caa7d0c97fc6055830fb3 + AMap3DMap: d104a679c2bad573c908e0ddadf26bc399678b24 amap_flutter_location: 44ff5beb64f42e0bf5feb402fe299dac0013af6f amap_flutter_map: 979e54d227cedac6c7504a2151bfbf3bcf96760a AMapFoundation: 9885c48fc3a78fdfb84a0299a2293e56ea3c9fec @@ -283,11 +283,11 @@ SPEC CHECKSUMS: package_info_plus: 6c92f08e1f853dc01228d6f553146438dafcd14e path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2 - ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 + ReachabilitySwift: 2128f3a8c9107e1ad33574c6e58e8285d460b149 shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec system_settings: 8f5cdbfa72c677fc8d665b863bcc20d393d87e9d - Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 + Toast: 1f5ea13423a1e6674c4abdac5be53587ae481c4e url_launcher_ios: bbd758c6e7f9fd7b5b1d4cde34d2b95fcce5e812 video_player_avfoundation: 02011213dab73ae3687df27ce441fbbcc82b5579 webview_flutter_wkwebview: 4f3e50f7273d31e5500066ed267e3ae4309c5ae4 diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index c4cd51c3..d6e210aa 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -129,7 +129,6 @@ import 'main/lockMian/demoMode/demoModeLockSet/demoModeLockSet_page.dart'; import 'mine/about/about_page.dart'; import 'mine/addLock/addLock/addLock_page.dart'; import 'main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart'; -import 'main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart'; import 'main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart'; import 'main/lockDetail/authorizedAdmin/volumeAuthorizationLock/volumeAuthorizationLockManage/volumeAuthorizationLockManage_page.dart'; import 'main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart'; @@ -546,10 +545,6 @@ abstract class AppRouters { name: Routers.authorizedAdminListPage, page: () => const AuthorizedAdminListPage(), ), - GetPage( - name: Routers.authorizedAdminDetailPage, - page: () => const AuthorizedAdminDetailPage(), - ), GetPage( name: Routers.authorizedAdminManagePage, page: () => const AuthorizedAdminManagePage(), diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart index 8cf069de..00103bad 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdmin_page.dart @@ -475,7 +475,7 @@ class _AuthorizedAdminPageState extends State { overlayColor: MaterialStateProperty.all(Colors.white)), child: Text( - '取消', + '取消'.tr, style: TextStyle( color: Colors.black, fontSize: ScreenUtil().setSp(24)), ), diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart deleted file mode 100644 index d1b70faa..00000000 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart +++ /dev/null @@ -1,258 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_easyloading/flutter_easyloading.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; -import 'package:star_lock/tools/baseGetXController.dart'; - -import '../../../../appRouters.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../network/api_repository.dart'; -import '../../../../tools/commonItem.dart'; -import '../../../../tools/showIosTipView.dart'; -import '../../../../tools/submitBtn.dart'; -import '../../../../tools/titleAppBar.dart'; -import '../../../../translations/trans_lib.dart'; -import '../../electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; - -class AuthorizedAdminDetailPage extends StatefulWidget { - const AuthorizedAdminDetailPage({Key? key}) : super(key: key); - - @override - State createState() => - _AuthorizedAdminDetailPageState(); -} - -class _AuthorizedAdminDetailPageState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: - "${TranslationLoader.lanKeys!.authorizedAdmin!.tr}${TranslationLoader.lanKeys!.detail!.tr}", - haveBack: true, - backgroundColor: AppColors.mainColor, - actionsList: [ - TextButton( - child: Text( - TranslationLoader.lanKeys!.share!.tr, - style: TextStyle(color: Colors.white, fontSize: 24.sp), - ), - onPressed: () {}, - ), - ], - ), - body: Column( - children: [ - CommonItem( - leftTitel: TranslationLoader.lanKeys!.password!.tr, - rightTitle: "98765432", - isHaveDirection: true, - isHaveLine: true, - action: () { - showCupertinoAlertDialog(context); - }), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.name!.tr, - rightTitle: "你好", - isHaveDirection: true, - isHaveLine: true, - action: () { - showCupertinoAlertDialog(context); - }), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, - rightTitle: "永久", - isHaveDirection: true, - action: () { - Navigator.pushNamed( - context, Routers.electronicKeyDetailChangeDate); - }), - Container(height: 10.h), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.sender!.tr, - rightTitle: "15080825640", - action: () {}), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.senderTime!.tr, - rightTitle: "2020.06.21 11:49", - action: () {}), - Container(height: 10.h), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, - rightTitle: "", - isHaveDirection: true, - action: () { - Navigator.pushNamed(context, Routers.keyOperationRecordPage); - }), - Container(height: 40.h), - SubmitBtn( - btnName: TranslationLoader.lanKeys!.delete!.tr, - isDelete: true, - borderRadius: 20.w, - margin: EdgeInsets.only( - left: 30.w, right: 30.w, top: 30.w, bottom: 30.w), - padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () { - showIosTipViewDialog(context); - }), - ], - ), - ); - } - - Widget commonItem(String leftTitle, String rightTitle, - {bool isHaveDirection = false, - bool isHaveLine = false, - bool isHaveRightWidget = false, - Widget? rightWidget, - Function()? action}) { - return GestureDetector( - onTap: action, - child: Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - // height: 80.h, - color: Colors.white, - padding: EdgeInsets.only( - left: 20.w, right: 10.w, top: 20.w, bottom: 20.w), - child: Row( - children: [ - SizedBox(width: 20.w), - Text( - leftTitle, - style: - TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), - ), - SizedBox(width: 20.w), - Expanded( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - isHaveRightWidget - ? rightWidget! - : Text( - rightTitle, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 28.sp, fontWeight: FontWeight.w500), - ) - ], - ), - ), - SizedBox(width: 5.w), - isHaveDirection - ? Image.asset( - 'images/icon_right.png', - width: 50.w, - height: 50.w, - ) - : SizedBox(width: 10.w), - // SizedBox(width:10.w), - ], - ), - ), - isHaveLine - ? Container( - height: 0.5.h, - color: Colors.grey, - ) - : Container() - ], - ), - ); - } - - void showCupertinoAlertDialog(BuildContext context) { - showDialog( - context: context, - builder: (BuildContext context) { - return Card( - color: const Color(0x00FFFFFF), - child: CupertinoAlertDialog( - title: const Text("修改密码"), - content: Column( - children: [ - const SizedBox( - height: 10, - ), - Container( - height: 80.h, - // color: Colors.white, - margin: EdgeInsets.all(10.w), - child: const TextField( - //输入框一行 - maxLines: 1, - // controller: _controller, - autofocus: false, - decoration: InputDecoration( - //输入里面输入文字内边距设置 - // contentPadding: const EdgeInsets.only( - // top: 12.0, left: -19.0, right: -15.0, bottom: 8.0), - hintText: "请输入要修改的名字", - //不需要输入框下划线 - border: InputBorder.none, - ), - ), - ) - ], - ), - actions: [ - CupertinoDialogAction( - child: const Text("取消"), - onPressed: () { - Navigator.pop(context); - // print("取消"); - }, - ), - CupertinoDialogAction( - child: const Text("确定"), - onPressed: () { - Navigator.pop(context); - // print("确定"); - }, - ), - ], - ), - ); - } - ); - } - - void showIosTipViewDialog(BuildContext context) { - showDialog( - context: context, - builder: (BuildContext context) { - return ShowIosTipView( - title: "提示", - tipTitle: "确定要删除吗?", - sureClick: () { - Get.back(); - // deleteKeyRequest(); - }, - cancelClick: () { - Get.back(); - }, - ); - } - ); - } - - //删除电子钥匙名称请求 - Future deleteKeyRequest(String keyId) async { - ElectronicKeyListEntity entity = - await ApiRepository.to.deleteElectronicKey( - keyId:keyId, - includeUnderlings: 0 - ); - if (entity.errorCode!.codeIsSuccessful) { - EasyLoading.showToast("删除成功",duration: 2000.milliseconds); - setState(() { - Get.back(); - }); - } - } - -} diff --git a/star_lock/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart b/star_lock/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart index 692b41ed..e67b80ff 100644 --- a/star_lock/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart +++ b/star_lock/lib/main/lockDetail/fingerprint/fingerprintDetail/fingerprintDetail_page.dart @@ -234,26 +234,6 @@ class _FingerprintDetailPageState extends State with Rout }); } - // void showIosTipViewDialog(BuildContext context) { - // showDialog( - // context: context, - // builder: (BuildContext context) { - // return ShowIosTipView( - // title: "提示", - // tipTitle: "确定要删除吗?", - // sureClick: () { - // Get.back(); - // // 指纹 - // logic.senderAddFingerprint(); - // }, - // cancelClick: () { - // Get.back(); - // }, - // ); - // } - // ); - // } - @override void didChangeDependencies() { // TODO: implement didChangeDependencies diff --git a/star_lock/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart b/star_lock/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart index 86f741bc..daff5fd2 100644 --- a/star_lock/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart +++ b/star_lock/lib/main/lockDetail/fingerprint/fingerprintList/fingerprintList_page.dart @@ -253,61 +253,6 @@ class _FingerprintListPageState extends State with RouteAwa ); } - // void showIosTipViewDialog(int? fingerprintId) { - // showDialog( - // context: Get.context!, - // builder: (BuildContext context) { - // return ShowIosTipView( - // title: "提示", - // tipTitle: "确定要删除吗?", - // sureClick: () async { - // Get.back(); - // state.isDeletFingerprintData = true; - // state.isDeletAll = false; - // state.deletKeyID = fingerprintId.toString(); - // state.deletUserID = (await Storage.getUid())!; - // logic.senderAddFingerprint(); - // }, - // cancelClick: () { - // Get.back(); - // }, - // ); - // }, - // ); - // } - - // void showDeletAlertDialog() { - // showCupertinoDialog( - // context: Get.context!, - // builder: (context) { - // return CupertinoAlertDialog( - // title: const Text("提示"), - // content: const Text('重置后,该锁的指纹都将被删除哦,确认要重置吗?'), - // actions: [ - // CupertinoDialogAction( - // child: Text(TranslationLoader.lanKeys!.cancel!.tr), - // onPressed: () { - // Navigator.pop(context); - // }, - // ), - // CupertinoDialogAction( - // child: Text(TranslationLoader.lanKeys!.sure!.tr), - // onPressed: () { - // Navigator.pop(context); - // state.isDeletFingerprintData = true; - // state.isDeletAll = true; - // state.deletKeyID = "1"; - // state.deletUserID = "DeleteAll!@#"; - // state.deletFingerNo = 255; - // logic.senderAddFingerprint(); - // }, - // ), - // ], - // ); - // }, - // ); - // } - @override void didChangeDependencies() { // TODO: implement didChangeDependencies diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart index 2ce51085..3060ee52 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart @@ -277,7 +277,7 @@ class _PasswordKeyDetailPageState extends State { overlayColor: MaterialStateProperty.all(Colors.white)), child: Text( - '取消', + '取消'.tr, style: TextStyle( color: Colors.black, fontSize: ScreenUtil().setSp(24)), ), diff --git a/star_lock/lib/main/lockMian/lockMain/lockMain_logic.dart b/star_lock/lib/main/lockMian/lockMain/lockMain_logic.dart index 673e018c..22da7622 100644 --- a/star_lock/lib/main/lockMian/lockMain/lockMain_logic.dart +++ b/star_lock/lib/main/lockMian/lockMain/lockMain_logic.dart @@ -19,6 +19,7 @@ class LockMainLogic extends BaseGetXController { pageNo: pageNo, pageSize: 50, ); + Get.log("entity.errorCode!:${entity.errorCode!}"); if (entity.errorCode!.codeIsSuccessful) { loadMainDataLogic(entity.data!); Storage.saveMainListData(entity.data!); diff --git a/star_lock/lib/mine/addLock/selectLockType/selectLockType_page.dart b/star_lock/lib/mine/addLock/selectLockType/selectLockType_page.dart index 64c01a0b..bbce8288 100644 --- a/star_lock/lib/mine/addLock/selectLockType/selectLockType_page.dart +++ b/star_lock/lib/mine/addLock/selectLockType/selectLockType_page.dart @@ -85,7 +85,7 @@ class _SelectLockTypePageState extends State // Navigator.pushNamed(context, Routers.gatewayListPage); }), if (!F.isLite) - lockTypeItem('images/lockType/lockType_camera.png', '网络摄像头', + lockTypeItem('images/lockType/lockType_camera.png', '网络摄像头'.tr, () { // Navigator.pushNamed(context, Routers.gatewayListPage); }), diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart index 014ba326..4382ad11 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_logic.dart @@ -37,18 +37,16 @@ class MinePersonInfoLogic extends BaseGetXController { } // 上传头像 - void uploadFile( - MinePersonGetUploadFileInfoEntity - minePersonGetUploadFileInfoEntity) async { - Map user = - minePersonGetUploadFileInfoEntity.data!.formData!; + void uploadFile(MinePersonGetUploadFileInfoEntity minePersonGetUploadFileInfoEntity) async { + // Map user = minePersonGetUploadFileInfoEntity.data!.formData!; var bytes = File(state.image!.path); var enc = await bytes.readAsBytes(); - user[minePersonGetUploadFileInfoEntity.data!.fileField!] = enc; - final form = FormData({ - 'file': MultipartFile(enc, - filename: minePersonGetUploadFileInfoEntity.data!.formData!["key"]), - }); + // user[minePersonGetUploadFileInfoEntity.data!.fileField!] = enc; + // Get.log("minePersonGetUploadFileInfoEntity.data!.fileField!:${minePersonGetUploadFileInfoEntity.data!.fileField!}\n minePersonGetUploadFileInfoEntity.data!.formData![key]:${minePersonGetUploadFileInfoEntity.data!.formData!["key"]} \n enc.length:${enc.length} enc:$enc"); + + final form = FormData(minePersonGetUploadFileInfoEntity.data!.formData!); + form.files.add(MapEntry(minePersonGetUploadFileInfoEntity.data!.fileField!, MultipartFile(enc, filename: minePersonGetUploadFileInfoEntity.data!.formData!["key"]))); + var entity = await ApiRepository.to.uploadFile( url: minePersonGetUploadFileInfoEntity.data!.uploadUrl!, body: form); if (entity.errorCode! == -1) { diff --git a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart index 0d5e1802..7942bf90 100644 --- a/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart +++ b/star_lock/lib/mine/minePersonInfo/minePersonInfoPage/minePersonInfo_page.dart @@ -131,7 +131,7 @@ class _MinePersonInfoPageState extends State { Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.safetyProblem!.tr, rightTitle: - state.mineInfoData.value.haveSafeAnswer == 0 ? "去设置" : "", + state.mineInfoData.value.haveSafeAnswer == 0 ? "去设置".tr : "", isHaveLine: true, isHaveDirection: true, action: () { diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_logic.dart b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_logic.dart index 5c35a561..ad25b09c 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_logic.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_logic.dart @@ -1,6 +1,8 @@ import 'dart:async'; +import 'package:get/get.dart'; + import '../../../../main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; import '../../../../network/api_repository.dart'; import '../../../../tools/baseGetXController.dart'; @@ -26,7 +28,7 @@ class LockGroupListLogic extends BaseGetXController { MassSendLockGroupListEntity entity = await ApiRepository.to.addLockGroup(state.changeNameController.text, '0'); if (entity.errorCode!.codeIsSuccessful) { - showToast("创建成功"); + showToast("创建成功".tr); mockNetworkDataRequest(); } } @@ -35,7 +37,7 @@ class LockGroupListLogic extends BaseGetXController { Future editLockGroupRequest(int groupId) async { var entity = await ApiRepository.to.editLockGroupRequest(groupId:groupId, groupName:state.changeNameController.text); if (entity.errorCode!.codeIsSuccessful) { - showToast("编辑成功"); + showToast("编辑成功".tr); mockNetworkDataRequest(); } } @@ -44,7 +46,7 @@ class LockGroupListLogic extends BaseGetXController { Future deleteLockGroupRequest(int groupId) async { var entity = await ApiRepository.to.deleteGroup(groupId); if (entity.errorCode!.codeIsSuccessful) { - showToast("删除成功"); + showToast("删除成功".tr); mockNetworkDataRequest(); } } diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart index f36768e4..9b18b364 100644 --- a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart +++ b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList/lockGroupList_page.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; -import 'package:star_lock/tools/showTFView.dart'; +import 'package:star_lock/tools/showTipView.dart'; import '../../../../../../appRouters.dart'; import '../../../../../../app_settings/app_colors.dart'; @@ -42,7 +42,15 @@ class _LockGroupListPageState extends State { onPressed: () { // 处理操作按钮的点击事件-添加锁分组 state.changeNameController.text = ""; - showCupertinoAlertDialog(context, true, 0); + // showCupertinoAlertDialog(context, true, 0); + ShowTipView().showTFViewAlertDialog(state.changeNameController, TranslationLoader.lanKeys!.createNewGroup!.tr, TranslationLoader.lanKeys!.pleaseEnter!.tr, (){ + //发送编辑钥匙名称请求 + if (state.changeNameController.text.isNotEmpty) { + logic.addLockGroupRequest(); + } else { + logic.showToast(TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr); + } + }); }, ), ], @@ -119,40 +127,43 @@ class _LockGroupListPageState extends State { }); } - void showCupertinoAlertDialog(BuildContext context, bool isAdd, int groupId) { - showDialog( - context: context, - builder: (BuildContext context) { - return ShowTFView( - title: isAdd ? TranslationLoader.lanKeys!.createNewGroup!.tr : "修改名称", - tipTitle: TranslationLoader.lanKeys!.pleaseEnter!.tr, - controller: state.changeNameController, - sureClick: () { - //发送编辑钥匙名称请求 - if (state.changeNameController.text.isNotEmpty) { - if(isAdd == true){ - logic.addLockGroupRequest(); - }else{ - logic.editLockGroupRequest(groupId); - } - Navigator.pop(context); - } else { - logic.showToast(TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr); - } - }, - cancelClick: () { - Navigator.pop(context); - }, - ); - }, - ); - } + // void showCupertinoAlertDialog(BuildContext context, bool isAdd, int groupId) { + // showDialog( + // context: context, + // builder: (BuildContext context) { + // return ShowTFView( + // title: isAdd ? TranslationLoader.lanKeys!.createNewGroup!.tr : "修改名称", + // tipTitle: TranslationLoader.lanKeys!.pleaseEnter!.tr, + // controller: state.changeNameController, + // sureClick: () { + // //发送编辑钥匙名称请求 + // if (state.changeNameController.text.isNotEmpty) { + // if(isAdd == true){ + // logic.addLockGroupRequest(); + // }else{ + // logic.editLockGroupRequest(groupId); + // } + // Get.back(); + // } else { + // logic.showToast(TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr); + // } + // }, + // cancelClick: () { + // Get.back(); + // }, + // ); + // }, + // ); + // } Widget _buildDeleteBtn(GroupListItem groupListItem) { return GestureDetector( onTap: () { // 省略: 弹出是否删除的确认对话框。 - showIosTipViewDialog(context, groupListItem); + // showIosTipViewDialog(context, groupListItem); + ShowTipView().showIosTipWithContentDialog("分组下的锁将被移到未分组里".tr, (){ + logic.deleteLockGroupRequest(groupListItem.keyGroupId!); + }); }, child: Container( width: 100.w, @@ -176,14 +187,22 @@ class _LockGroupListPageState extends State { onTap: () { // 编辑 state.changeNameController.text = groupListItem.keyGroupName!; - showCupertinoAlertDialog(context, false, groupListItem.keyGroupId!); + // showCupertinoAlertDialog(context, false, groupListItem.keyGroupId!); + + ShowTipView().showTFViewAlertDialog(state.changeNameController, TranslationLoader.lanKeys!.createNewGroup!.tr, TranslationLoader.lanKeys!.pleaseEnter!.tr, (){ + if (state.changeNameController.text.isNotEmpty) { + logic.editLockGroupRequest(groupListItem.keyGroupId!); + } else { + logic.showToast(TranslationLoader.lanKeys!.pleaseEnterAGroupName!.tr); + } + }); }, child: Container( width: 100.w, color: AppColors.mainColor, alignment: Alignment.center, child: Text( - "重命名", + "重命名".tr, style: const TextStyle( fontSize: 16, fontWeight: FontWeight.w500, @@ -195,23 +214,23 @@ class _LockGroupListPageState extends State { ); } - void showIosTipViewDialog(BuildContext context, GroupListItem groupListItem) { - showDialog( - context: context, - builder: (BuildContext context) { - return ShowIosTipView( - title: TranslationLoader.lanKeys!.hint!.tr, - tipTitle: "分组下的锁将被移到未分组里", - sureClick: () { - Get.back(); - logic.deleteLockGroupRequest(groupListItem.keyGroupId!); - }, - cancelClick: () { - Get.back(); - }, - ); - } - ); - } + // void showIosTipViewDialog(BuildContext context, GroupListItem groupListItem) { + // showDialog( + // context: context, + // builder: (BuildContext context) { + // return ShowIosTipView( + // title: TranslationLoader.lanKeys!.hint!.tr, + // tipTitle: "分组下的锁将被移到未分组里", + // sureClick: () { + // Get.back(); + // logic.deleteLockGroupRequest(groupListItem.keyGroupId!); + // }, + // cancelClick: () { + // Get.back(); + // }, + // ); + // } + // ); + // } } diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart index 020b4c37..57476c88 100644 --- a/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart +++ b/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation/recipientInformation_page.dart @@ -348,7 +348,7 @@ class _RecipientInformationPageState extends State { borderRadius: BorderRadius.all(Radius.circular(2)), ), ), - child: Text('取消', style: TextStyle(fontSize: 22.sp)), + child: Text('取消'.tr, style: TextStyle(fontSize: 22.sp)), ), ElevatedButton( onPressed: () { diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart index 521e126a..241a22a2 100644 --- a/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart +++ b/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch/selectBranch_page.dart @@ -201,7 +201,7 @@ class _SelectBranchPageState extends State { borderRadius: BorderRadius.all(Radius.circular(2)), ), ), - child: Text('取消', style: TextStyle(fontSize: 22.sp)), + child: Text('取消'.tr, style: TextStyle(fontSize: 22.sp)), ), ElevatedButton( onPressed: () { diff --git a/star_lock/lib/network/api_provider_base.dart b/star_lock/lib/network/api_provider_base.dart index d58aae24..3e2c36d7 100644 --- a/star_lock/lib/network/api_provider_base.dart +++ b/star_lock/lib/network/api_provider_base.dart @@ -53,6 +53,7 @@ class BaseProvider extends GetConnect with Api { if (res.body == null) { if (EasyLoading.isShow) await EasyLoading.dismiss(animation: true); EasyLoading.showToast("网络访问失败,请检查网络是否正常".tr, duration: 2000.milliseconds); + Get.log("111网络访问失败,请检查网络是否正常"); // EasyLoading.showToast("Network Error!", duration: 2000.milliseconds); // if (res.statusCode == null) { // EasyLoading.showToast("Network Error!", duration: 2000.milliseconds); diff --git a/star_lock/lib/tools/appFirstEnterHandle.dart b/star_lock/lib/tools/appFirstEnterHandle.dart index fce022fe..d2b92638 100644 --- a/star_lock/lib/tools/appFirstEnterHandle.dart +++ b/star_lock/lib/tools/appFirstEnterHandle.dart @@ -132,13 +132,13 @@ class AppFirstEnterHandle { content: const Text('请开启位置权限,应用需要位置权限才可以完成智能锁和网关的蓝牙操作'), actions: [ CupertinoDialogAction( - child: const Text('取消'), + child: Text('取消'.tr), onPressed: () { Navigator.of(context).pop(); }, ), CupertinoDialogAction( - child: const Text('确定'), + child: Text('确定'.tr), onPressed: () { Storage.setString(isAgreePosition, isAgreePosition); Navigator.of(context).pop(); diff --git a/star_lock/lib/tools/pickers/style/default_style.dart b/star_lock/lib/tools/pickers/style/default_style.dart index 56e43d9b..16d7131a 100644 --- a/star_lock/lib/tools/pickers/style/default_style.dart +++ b/star_lock/lib/tools/pickers/style/default_style.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:get/get.dart'; import 'package:star_lock/tools/pickers/style/picker_style.dart'; // import 'package:flutter_pickers/style/picker_style.dart'; @@ -33,8 +34,7 @@ class DefaultPickerStyle extends PickerStyle { } if (title != null && title != '') { this.title = Center( - child: Text(title, - style: const TextStyle(color: Colors.grey, fontSize: 14))); + child: Text(title, style: const TextStyle(color: Colors.grey, fontSize: 14))); } } @@ -43,15 +43,13 @@ class DefaultPickerStyle extends PickerStyle { commitButton = Container( alignment: Alignment.center, padding: const EdgeInsets.only(left: 12, right: 22), - child: const Text('确定', - style: TextStyle(color: Colors.white, fontSize: 16.0)), + child: Text('确定'.tr, style: const TextStyle(color: Colors.white, fontSize: 16.0)), ); cancelButton = Container( alignment: Alignment.center, padding: const EdgeInsets.only(left: 22, right: 12), - child: const Text('取消', - style: TextStyle(color: Colors.white, fontSize: 16.0)), + child: Text('取消'.tr, style: const TextStyle(color: Colors.white, fontSize: 16.0)), ); headDecoration = BoxDecoration( @@ -142,10 +140,8 @@ class RaisedPickerStyle extends PickerStyle { commitButton = Container( padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 3), margin: const EdgeInsets.only(right: 22), - decoration: - BoxDecoration(color: color, borderRadius: BorderRadius.circular(4)), - child: const Text('确定', - style: TextStyle(color: Colors.white, fontSize: 15.0)), + decoration: BoxDecoration(color: color, borderRadius: BorderRadius.circular(4)), + child: Text('确定'.tr, style: const TextStyle(color: Colors.white, fontSize: 15.0)), ); cancelButton = Container( @@ -154,7 +150,7 @@ class RaisedPickerStyle extends PickerStyle { decoration: BoxDecoration( border: Border.all(color: color, width: 1), borderRadius: BorderRadius.circular(4)), - child: Text('取消', style: TextStyle(color: color, fontSize: 15.0)), + child: Text('取消'.tr, style: TextStyle(color: color, fontSize: 15.0)), ); if (title != null && title != '') { @@ -179,8 +175,7 @@ class RaisedPickerStyle extends PickerStyle { margin: const EdgeInsets.only(right: 22), decoration: BoxDecoration( color: color ?? Colors.blue, borderRadius: BorderRadius.circular(4)), - child: const Text('确定', - style: TextStyle(color: Colors.white, fontSize: 15.0)), + child: Text('确定'.tr, style: const TextStyle(color: Colors.white, fontSize: 15.0)), ); cancelButton = Container( @@ -189,14 +184,12 @@ class RaisedPickerStyle extends PickerStyle { decoration: BoxDecoration( border: Border.all(color: Colors.white, width: 1), borderRadius: BorderRadius.circular(4)), - child: const Text('取消', - style: TextStyle(color: Colors.white, fontSize: 15.0)), + child: Text('取消'.tr, style: const TextStyle(color: Colors.white, fontSize: 15.0)), ); if (title != null && title != '') { this.title = Center( - child: Text(title, - style: const TextStyle(color: Colors.white, fontSize: 14))); + child: Text(title, style: const TextStyle(color: Colors.white, fontSize: 14))); } backgroundColor = Colors.grey[800]!; diff --git a/star_lock/pubspec.yaml b/star_lock/pubspec.yaml index c6c9e80f..043560a5 100644 --- a/star_lock/pubspec.yaml +++ b/star_lock/pubspec.yaml @@ -33,7 +33,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # 1.0.27+2024041102:打包预发布环境给田总测试 -version: 1.0.27+2024041102 +version: 1.0.27+2024041701 environment: sdk: '>=2.12.0 <3.0.0'