diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index 3be9ca46..9a22f24c 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -134,7 +134,7 @@ "lockEscalation":"锁升级", "markedHouseState":"标记房态", "unlockReminder":"开锁提醒", - "unlockQRCode":"开锁二维码", + "unlockQRCode":"微信二维码", "lockNumber":"锁编号", "electricQuantity":"电量", "lockName":"名称", diff --git a/star_lock/images/lockType/lockType_NFCLock.png b/star_lock/images/lockType/lockType_NFCLock.png new file mode 100644 index 00000000..735c5139 Binary files /dev/null and b/star_lock/images/lockType/lockType_NFCLock.png differ diff --git a/star_lock/images/lockType/lockType_allLocks.png b/star_lock/images/lockType/lockType_allLocks.png index cf16d55f..20aea7e5 100644 Binary files a/star_lock/images/lockType/lockType_allLocks.png and b/star_lock/images/lockType/lockType_allLocks.png differ diff --git a/star_lock/images/lockType/lockType_doorLock.png b/star_lock/images/lockType/lockType_doorLock.png index a7be3c3a..46a27100 100644 Binary files a/star_lock/images/lockType/lockType_doorLock.png and b/star_lock/images/lockType/lockType_doorLock.png differ diff --git a/star_lock/images/lockType/lockType_entranceGuardLock.png b/star_lock/images/lockType/lockType_entranceGuardLock.png new file mode 100644 index 00000000..363f70aa Binary files /dev/null and b/star_lock/images/lockType/lockType_entranceGuardLock.png differ diff --git a/star_lock/images/lockType/lockType_gatewayLock.png b/star_lock/images/lockType/lockType_gatewayLock.png new file mode 100644 index 00000000..f14724c9 Binary files /dev/null and b/star_lock/images/lockType/lockType_gatewayLock.png differ diff --git a/star_lock/images/main/icon_catEyes.png b/star_lock/images/main/icon_catEyes.png new file mode 100644 index 00000000..55887621 Binary files /dev/null and b/star_lock/images/main/icon_catEyes.png differ diff --git a/star_lock/images/main/icon_face.png b/star_lock/images/main/icon_face.png new file mode 100644 index 00000000..0aa2397c Binary files /dev/null and b/star_lock/images/main/icon_face.png differ diff --git a/star_lock/images/main/icon_main_openLockBtn.png b/star_lock/images/main/icon_main_openLockBtn.png index f2e2bda5..f45ef04a 100644 Binary files a/star_lock/images/main/icon_main_openLockBtn.png and b/star_lock/images/main/icon_main_openLockBtn.png differ diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index b3b29042..6a83a207 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -1,13 +1,10 @@ -import 'package:flutter/widgets.dart'; import 'package:get/get.dart'; import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart'; import 'package:star_lock/login/register/starLock_register_binding.dart'; -import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart'; -import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserList_page.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart'; import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart'; -import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart'; import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart'; import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart'; @@ -75,7 +72,6 @@ import 'main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyP import 'main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart'; import 'main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_page.dart'; import 'main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart'; -import 'main/lockDetail/lockDetail/lockDetail_page.dart'; import 'main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart'; import 'main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart'; import 'main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart'; @@ -746,7 +742,7 @@ abstract class AppRouters { GetPage( name: Routers.configuringWifiPage, page: () => const ConfiguringWifiPage()), - GetPage( + GetPage( name: Routers.massSendLockGroupPage, page: () => const MassSendLockGroupListPage()), GetPage( @@ -754,6 +750,5 @@ abstract class AppRouters { page: () => const MassSendReceiverPage()), GetPage( name: Routers.lockUserListPage, page: () => const LockUserListPage()) - ]; } diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey_page.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey_page.dart index 3f88d9e5..4a9a5a1d 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicKey_page.dart @@ -1,4 +1,6 @@ import 'package:flutter/cupertino.dart'; +import 'package:flutter_pickers/pickers.dart'; +import 'package:flutter_pickers/time_picker/model/date_mode.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:flutter_native_contact_picker/flutter_native_contact_picker.dart'; @@ -22,6 +24,13 @@ class MassSendElectronicKeyPage extends StatefulWidget { class _MassSendElectronicKeyPageState extends State { final FlutterContactPicker _contactPicker = FlutterContactPicker(); late Contact _contact; + var _selectEffectiveDate = ''; //生效时间 + var _selectFailureDate = ''; //失效时间 + late DateTime _effectiveDateTime; + late DateTime _failureDateTime; + late bool _isSendSuccess; + late bool _isRemote; //是否远程开锁 + List _receiverList = []; @override Widget build(BuildContext context) { @@ -31,6 +40,16 @@ class _MassSendElectronicKeyPageState extends State { @override void initState() { super.initState(); + + DateTime dateTime = DateTime.now(); + _effectiveDateTime = dateTime; + _failureDateTime = dateTime; + _selectEffectiveDate = + '${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //默认为当前时间 + _selectFailureDate = + '${dateTime.year}-${dateTime.month}-${dateTime.day} ${dateTime.hour}:${dateTime.minute}'; //默认为当前时间 + _isSendSuccess = false; + _isRemote = false; } Widget indexChangeWidget() { @@ -82,11 +101,21 @@ class _MassSendElectronicKeyPageState extends State { Container(height: 10.h), CommonItem( leftTitel: TranslationLoader.lanKeys!.receiver!.tr, - rightTitle: TranslationLoader.lanKeys!.pleaseAdd!.tr, + rightTitle: _receiverList.isEmpty + ? TranslationLoader.lanKeys!.pleaseAdd!.tr + : _receiverList.length.toString(), isHaveLine: true, isHaveDirection: true, action: () { - Navigator.pushNamed(context, Routers.massSendReceiverPage); + Navigator.pushNamed(context, Routers.massSendReceiverPage) + .then((value) { + if (value != null) { + value as Map; + _receiverList = value['lockUserList']; + + setState(() {}); + } + }); }), CommonItem( leftTitel: TranslationLoader.lanKeys!.lock!.tr, @@ -106,12 +135,33 @@ class _MassSendElectronicKeyPageState extends State { children: [ CommonItem( leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, - rightTitle: "2020.06.20 11:49", - isHaveLine: true), + rightTitle: _selectEffectiveDate, + isHaveLine: true, + isHaveDirection: true, + action: () { + Pickers.showDatePicker(context, mode: DateMode.YMDHM, + onConfirm: (p) { + setState(() { + _selectEffectiveDate = + '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'; + _effectiveDateTime = DateTime.parse(_selectEffectiveDate); + }); + }); + }), CommonItem( - leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, - rightTitle: "2020.06.20 11:49", - ), + leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, + rightTitle: _selectFailureDate, + isHaveDirection: true, + action: () { + Pickers.showDatePicker(context, mode: DateMode.YMDHM, + onConfirm: (p) { + setState(() { + _selectFailureDate = + '${p.year}-${intToStr(p.month!)}-${intToStr(p.day!)} ${intToStr(p.hour!)}:${intToStr(p.minute!)}'; + _failureDateTime = DateTime.parse(_selectFailureDate); + }); + }); + }), Container(height: 10.h), ], ); @@ -162,17 +212,20 @@ class _MassSendElectronicKeyPageState extends State { } CupertinoSwitch _switch() { - bool _isOn = false; return CupertinoSwitch( activeColor: CupertinoColors.activeBlue, trackColor: CupertinoColors.systemGrey5, thumbColor: CupertinoColors.white, - value: _isOn, + value: _isRemote, onChanged: (value) { setState(() { - _isOn = value; + _isRemote = !_isRemote; }); }, ); } + + String intToStr(int v) { + return (v < 10) ? "0$v" : "$v"; + } } diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart similarity index 100% rename from star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart rename to star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserList_page.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart similarity index 98% rename from star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserList_page.dart rename to star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart index 7faa87ac..c8a45f62 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserList_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart @@ -1,10 +1,8 @@ -import 'dart:ui'; - import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/utils.dart'; import 'package:star_lock/app_settings/app_colors.dart'; -import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart'; import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/submitBtn.dart'; diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart new file mode 100644 index 00000000..1a5c3c6e --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart @@ -0,0 +1,92 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; + +class massSendLockGroupCell extends StatelessWidget { + final int currentIndex; + // LockListItem itemData; + List lockListByGroup; + final VoidCallback selectLockAction; + + massSendLockGroupCell(int index, + {Key? key, + required this.currentIndex, + required this.lockListByGroup, + // required this.itemData, + required this.selectLockAction}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return ListView.separated( + physics: const NeverScrollableScrollPhysics(), + shrinkWrap: true, + itemCount: lockListByGroup.length, + itemBuilder: (_, itemIndex) { + LockListItem itemData = lockListByGroup[itemIndex]; + return _itemBuilder(itemData); + }, + separatorBuilder: (BuildContext context, int index) { + return const Divider( + height: 1, + color: AppColors.greyLineColor, + ); + }, + ); + } + + Widget _itemBuilder(LockListItem itemData) { + return GestureDetector( + child: Container( + height: 60.h, + color: Colors.white, + width: ScreenUtil().screenWidth, + child: Row( + children: [ + SizedBox( + width: 30.w, + ), + Image.asset( + 'images/mine/icon_mine_gatewaySignal_prompt.png', + width: 36.w, + height: 36.w, + ), + SizedBox( + width: 10.w, + ), + Text( + itemData.lockAlias!, + style: TextStyle( + fontSize: 20.sp, color: AppColors.darkGrayTextColor), + ), + Expanded( + child: SizedBox( + width: 20.w, + )), + Image.asset( + itemData.isCheck! + ? "images/icon_round_selet.png" + : "images/icon_round_unSelet.png", + width: 30.w, + height: 30.w, + ), + SizedBox( + width: 30.w, + ) + ], + ), + ), + onTap: () { + selectLockAction(); + // selectNameIndex = index; + // setState(() { + // if (selectNameIndex == index) { + // isNameSelect = !isNameSelect; + // } + // }); + }, + ); + } +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart index 0e94a4c2..44a24ba3 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart @@ -52,9 +52,10 @@ class LockListData { class LockListItem { int? lockId; String? lockAlias; + bool? isCheck = false; bool? isRefresh = false; - LockListItem({this.lockId, this.lockAlias, this.isRefresh}); + LockListItem({this.lockId, this.lockAlias, this.isRefresh, this.isCheck}); LockListItem.fromJson(Map json) { lockId = json['lockId']; diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart index e1a8d322..5ca6b000 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart @@ -2,11 +2,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/utils.dart'; import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupCell.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart'; import 'package:star_lock/network/api_repository.dart'; import 'package:star_lock/tools/ExpandedListView.dart'; import 'package:star_lock/tools/baseGetXController.dart'; +import 'package:star_lock/tools/submitBtn.dart'; import 'package:star_lock/translations/trans_lib.dart'; class MassSendLockGroupListPage extends StatefulWidget { @@ -22,6 +24,7 @@ class _MassSendLockGroupListPageState extends State { List lockListByGroup = []; List lockGroupList = []; List clickIndexList = []; + int clickIndex = -1; @override void initState() { @@ -66,6 +69,12 @@ class _MassSendLockGroupListPageState extends State { height: 10.h, ), Expanded(child: _buildListView(context, lockGroupList)), + SubmitBtn( + btnName: '确定', + onClick: () { + Navigator.pop(context); + }, + ), SizedBox( height: 40.h, ) @@ -97,9 +106,10 @@ class _MassSendLockGroupListPageState extends State { dataList = entity.data!.lockList!; } } - lockListByGroup = dataList; - setState(() {}); + setState(() { + lockListByGroup = dataList; + }); return dataList; } @@ -125,68 +135,15 @@ class _MassSendLockGroupListPageState extends State { onTap: () { listLockByGroup(itemData.keyGroupId.toString()); clickIndexList.add(index); + clickIndex = index; }, title: itemData.keyGroupName!, imgName: '', typeImgList: const [], - child: ListView.separated( - physics: const NeverScrollableScrollPhysics(), - shrinkWrap: true, - itemCount: lockListByGroup.length, - itemBuilder: (_, itemIndex) { - LockListItem itemData = lockListByGroup[itemIndex]; - return _buildNameWidget(context, itemIndex, - 'images/icon_password.png', itemData.lockAlias); - }, - separatorBuilder: (BuildContext context, int index) { - return const Divider( - height: 1, - color: AppColors.greyLineColor, - ); - }, - ), - ); - } - - //单个姓名行 - Widget _buildNameWidget(context, index, imageName, getName) { - return GestureDetector( - child: Container( - height: 60.h, - color: Colors.white, - width: ScreenUtil().screenWidth, - child: Row( - children: [ - SizedBox( - width: 30.w, - ), - Image.asset( - 'images/mine/icon_mine_gatewaySignal_prompt.png', - width: 36.w, - height: 36.w, - ), - SizedBox( - width: 10.w, - ), - Text( - getName, - style: TextStyle( - fontSize: 20.sp, color: AppColors.darkGrayTextColor), - ), - SizedBox( - width: 30.w, - ) - ], - ), - ), - onTap: () { - // selectNameIndex = index; - // setState(() { - // if (selectNameIndex == index) { - // isNameSelect = !isNameSelect; - // } - // }); - }, + child: massSendLockGroupCell(index, + currentIndex: index, + lockListByGroup: lockListByGroup, + selectLockAction: () {}), ); } } diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart new file mode 100644 index 00000000..6a105a21 --- /dev/null +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart @@ -0,0 +1,155 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get_utils/get_utils.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart'; +import 'package:star_lock/tools/commonItem.dart'; +import 'package:star_lock/translations/trans_lib.dart'; + +class MassSendReceiverCell extends StatelessWidget { + final int currentIndex; + LockUserData userData; + final VoidCallback clickDeleteUser; + + MassSendReceiverCell(int index, + {Key? key, + required this.currentIndex, + required this.userData, + required this.clickDeleteUser}) + : super(key: key); + + @override + Widget build(BuildContext context) { + TextEditingController emailOrPhoneController = TextEditingController(); + TextEditingController keyNameController = TextEditingController(); + + return Container( + color: Colors.white, + child: Row( + children: [ + GestureDetector( + child: SizedBox( + width: 40.w, + child: Row( + children: [ + SizedBox( + width: 10.w, + ), + Image.asset( + 'images/icon_massSend_delete.png', + width: 26.w, + height: 26.w, + ) + ], + ), + ), + onTap: () { + clickDeleteUser(); + // _lockUserList.removeAt(index - 1); + // setState(() {}); + }, + ), + Expanded( + child: Column( + children: [ + CommonItem( + leftTitel: TranslationLoader.lanKeys!.receiver!.tr, + rightTitle: userData.userid ?? ' ', + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: getTFWidget( + true, + TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, + 1, + userData)), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: userData.nickname ?? ' ', + isHaveRightWidget: true, + rightWidget: getTFWidget( + false, + TranslationLoader.lanKeys!.enterYourName!.tr, + 2, + userData)), + ], + )) + ], + ), + ); + } + + TextEditingController _receiverController(String getStr) { + TextEditingController controller = TextEditingController(text: getStr); + controller.addListener(() { + print(controller.text); + }); + + return controller; + } + + TextEditingController _nickNameController(String getStr) { + TextEditingController controller = TextEditingController(text: getStr); + controller.addListener(() { + print(controller.text); + }); + + return controller; + } + + // 接受者信息输入框 + Widget getTFWidget( + bool isHaveBtn, String tfStr, int lineIndex, LockUserData userData) { + return SizedBox( + height: 50.h, + width: 320.w, + child: Row( + children: [ + Expanded( + child: TextField( + controller: lineIndex == 1 + ? _receiverController(userData.userid ?? '') + : _nickNameController(userData.nickname ?? ''), + //输入框一行 + maxLines: 1, + autofocus: false, + textAlign: TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + hintStyle: TextStyle(fontSize: 22.sp), + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + SizedBox( + width: 10.w, + ), + isHaveBtn + ? Container( + width: 32.w, + height: 32.w, + decoration: const BoxDecoration( + color: Colors.white, + image: DecorationImage( + image: AssetImage('images/icon_addressBook.png'), + fit: BoxFit.fill), + ), + alignment: Alignment.center, + child: InkWell( + onTap: () async { + // Contact? currentContact = + // await _contactPicker.selectContact(); + // setState(() { + // _contact = currentContact!; + // // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}"); + // }); + }, + ), + ) + : Container() + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart index d13115a5..b211cf54 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart @@ -3,7 +3,8 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/utils.dart'; import 'package:star_lock/appRouters.dart'; import 'package:star_lock/app_settings/app_colors.dart'; -import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiverCell.dart'; import 'package:star_lock/tools/commonItem.dart'; import 'package:star_lock/translations/trans_lib.dart'; @@ -49,6 +50,19 @@ class _MassSendReceiverPageState extends State { icon: const Icon(Icons.arrow_back_ios, color: Colors.white), onPressed: () => Navigator.of(context).pop(), ), + actions: [ + TextButton( + child: Text( + TranslationLoader.lanKeys!.save!.tr, + style: TextStyle(color: Colors.white, fontSize: 24.sp), + ), + onPressed: () { + Map resultMap = {}; + resultMap['lockUserList'] = _lockUserList; + Navigator.pop(context, resultMap); + }, + ), + ], ), body: Column( children: [ @@ -83,6 +97,9 @@ class _MassSendReceiverPageState extends State { child: ListView.separated( itemBuilder: (BuildContext context, int index) { LockUserData data = _lockUserList[index]; + emailOrPhoneController.text = data.userid ?? ''; + keyNameController.text = data.nickname ?? ''; + return _itemBuilder(index, data); }, itemCount: _lockUserList.length, @@ -149,110 +166,14 @@ class _MassSendReceiverPageState extends State { } Widget _itemBuilder(int index, LockUserData userData) { - return Container( - color: Colors.white, - child: Row( - children: [ - GestureDetector( - child: SizedBox( - width: 40.w, - child: Row( - children: [ - SizedBox( - width: 10.w, - ), - Image.asset( - 'images/icon_massSend_delete.png', - width: 26.w, - height: 26.w, - ) - ], - ), - ), - onTap: () { - _lockUserList.removeAt(index - 1); - setState(() {}); - }, - ), - Expanded( - child: Column( - children: [ - CommonItem( - leftTitel: TranslationLoader.lanKeys!.receiver!.tr, - rightTitle: userData.userid ?? ' ', - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: getTFWidget( - true, - TranslationLoader.lanKeys!.pleaseEnterNumberOrEmail!.tr, - 1)), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.name!.tr, - rightTitle: userData.nickname ?? ' ', - isHaveRightWidget: true, - rightWidget: getTFWidget( - false, TranslationLoader.lanKeys!.enterYourName!.tr, 2)), - ], - )) - ], - ), - ); - } - - // 接受者信息输入框 - Widget getTFWidget(bool isHaveBtn, String tfStr, int lineIndex) { - return SizedBox( - height: 50.h, - width: 320.w, - child: Row( - children: [ - Expanded( - child: TextField( - controller: - lineIndex == 1 ? emailOrPhoneController : keyNameController, - //输入框一行 - maxLines: 1, - // controller: _controller, - autofocus: false, - textAlign: TextAlign.end, - decoration: InputDecoration( - //输入里面输入文字内边距设置 - contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), - hintText: tfStr, - hintStyle: TextStyle(fontSize: 22.sp), - //不需要输入框下划线 - border: InputBorder.none, - ), - ), - ), - SizedBox( - width: 10.w, - ), - isHaveBtn - ? Container( - width: 32.w, - height: 32.w, - decoration: const BoxDecoration( - color: Colors.white, - image: DecorationImage( - image: AssetImage('images/icon_addressBook.png'), - fit: BoxFit.fill), - ), - alignment: Alignment.center, - child: InkWell( - onTap: () async { - // Contact? currentContact = - // await _contactPicker.selectContact(); - // setState(() { - // _contact = currentContact!; - // // print("object111111111111 ${_contact.fullName} ${_contact.phoneNumbers}"); - // }); - }, - ), - ) - : Container() - ], - ), + return MassSendReceiverCell( + index, + currentIndex: index, + userData: userData, + clickDeleteUser: () { + _lockUserList.removeAt(index - 1); + setState(() {}); + }, ); } } diff --git a/star_lock/lib/main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart index 12914a66..d07aaea1 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart @@ -128,12 +128,21 @@ class _BasicInformationPageState extends State { leftTitel: TranslationLoader .lanKeys!.adminOpenLockPassword!.tr, rightTitle: "", - isHaveLine: false, + isHaveLine: true, isHaveDirection: true, action: () { Navigator.pushNamed(context, Routers.adminOpenLockPasswordPage); }), + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.unlockQRCode!.tr, + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.unlockQRCodePage); + }), ], ), ), diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart index 58045c35..81d5e389 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockSet/lockSet_page.dart @@ -65,57 +65,43 @@ class _LockSetPageState extends State { height: 10.h, ), CommonItem( - leftTitel: - TranslationLoader.lanKeys!.wirelessKeyboard!.tr, + leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, action: () { - // Get.toNamed(Routers.wirelessKeyboardPage); - Toast.show(msg: "功能暂未开放"); + Get.toNamed(Routers.doorMagneticPage); + // Toast.show(msg: "功能暂未开放"); }), CommonItem( - leftTitel: TranslationLoader.lanKeys!.doorMagnetic!.tr, + leftTitel: + TranslationLoader.lanKeys!.wirelessKeyboard!.tr, rightTitle: "", isHaveLine: false, isHaveDirection: true, action: () { - // Get.toNamed(Routers.doorMagneticPage); - Toast.show(msg: "功能暂未开放"); + Get.toNamed(Routers.wirelessKeyboardPage); + // Toast.show(msg: "功能暂未开放"); }), SizedBox( height: 10.h, ), - Obx(()=> CommonItem( - leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr, - rightTitle: state.getKeyInfosData.value.remoteEnable == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.remoteUnlockingPage, arguments: state.getKeyInfosData.value); - })), Obx(() => CommonItem( leftTitel: - TranslationLoader.lanKeys!.automaticBlocking!.tr, - rightTitle: state.getKeyInfosData.value.autoLockTime! > -1 ? "${state.getKeyInfosData.value.autoLockTime!.toString()}s" : TranslationLoader.lanKeys!.closed!.tr, + TranslationLoader.lanKeys!.automaticBlocking!.tr, + rightTitle: state.getKeyInfosData.value.autoLockTime! > -1 + ? "${state.getKeyInfosData.value.autoLockTime!.toString()}s" + : TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed(Routers.automaticBlockingPage, arguments: state.getKeyInfosData.value); + Get.toNamed(Routers.automaticBlockingPage, + arguments: state.getKeyInfosData.value); })), - Obx(() => CommonItem( - leftTitel: - TranslationLoader.lanKeys!.normallyOpenMode!.tr, - rightTitle: state.getKeyInfosData.value.passageMode == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.normallyOpenModePage, arguments: state.getKeyInfosData.value); - }),), Obx(() { var titleStr = ""; - if(state.getKeyInfosData.value.lockSound == 1){ - switch(state.getKeyInfosData.value.volume){ + if (state.getKeyInfosData.value.lockSound == 1) { + switch (state.getKeyInfosData.value.volume) { case 1: titleStr = TranslationLoader.lanKeys!.low!.tr; break; @@ -132,7 +118,7 @@ class _LockSetPageState extends State { titleStr = TranslationLoader.lanKeys!.higher!.tr; break; } - }else{ + } else { titleStr = TranslationLoader.lanKeys!.closed!.tr; } return CommonItem( @@ -141,51 +127,113 @@ class _LockSetPageState extends State { isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed(Routers.lockSoundSetPage, arguments: state.getKeyInfosData.value); + Get.toNamed(Routers.lockSoundSetPage, + arguments: state.getKeyInfosData.value); }); }), Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.burglarAlarm!.tr, - rightTitle: state.getKeyInfosData.value.tamperAlert == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr, + rightTitle: state.getKeyInfosData.value.tamperAlert == 1 + ? TranslationLoader.lanKeys!.opened!.tr + : TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed(Routers.burglarAlarmPage, arguments: state.getKeyInfosData.value); + Get.toNamed(Routers.burglarAlarmPage, + arguments: state.getKeyInfosData.value); + })), + SizedBox( + height: 10.h, + ), + Obx( + () => CommonItem( + leftTitel: + TranslationLoader.lanKeys!.normallyOpenMode!.tr, + rightTitle: state.getKeyInfosData.value.passageMode == 1 + ? TranslationLoader.lanKeys!.opened!.tr + : TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.normallyOpenModePage, + arguments: state.getKeyInfosData.value); + }), + ), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.remoteUnlocking!.tr, + rightTitle: state.getKeyInfosData.value.remoteEnable == 1 + ? TranslationLoader.lanKeys!.opened!.tr + : TranslationLoader.lanKeys!.closed!.tr, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.remoteUnlockingPage, + arguments: state.getKeyInfosData.value); })), Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.resetButton!.tr, - rightTitle: state.getKeyInfosData.value.resetButton == 1 ? TranslationLoader.lanKeys!.opened!.tr : TranslationLoader.lanKeys!.closed!.tr, + rightTitle: state.getKeyInfosData.value.resetButton == 1 + ? TranslationLoader.lanKeys!.opened!.tr + : TranslationLoader.lanKeys!.closed!.tr, isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed(Routers.resetButtonPage, arguments: state.getKeyInfosData.value); + Get.toNamed(Routers.resetButtonPage, + arguments: state.getKeyInfosData.value); })), + SizedBox( + height: 10.h, + ), + Obx(() { + var title = ""; + if (state.getKeyInfosData.value.roomStatus == 1) { + title = TranslationLoader.lanKeys!.checkedIn!.tr; + } else if (state.getKeyInfosData.value.roomStatus == 2) { + title = TranslationLoader.lanKeys!.leisure!.tr; + } + return CommonItem( + leftTitel: + TranslationLoader.lanKeys!.markedHouseState!.tr, + rightTitle: title, + isHaveLine: true, + isHaveDirection: true, + action: () { + Get.toNamed(Routers.markedHouseStatePage, + arguments: state.getKeyInfosData.value); + }); + }), CommonItem( - leftTitel: TranslationLoader.lanKeys!.unlockQRCode!.tr, + leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, rightTitle: "", isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.unlockQRCodePage); - }), + isHaveRightWidget: true, + rightWidget: SizedBox(width: 60.w, child: _switch())), CommonItem( - leftTitel: TranslationLoader.lanKeys!.wifiDistributionNetwork!.tr, + leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr, rightTitle: "", isHaveLine: false, + isHaveRightWidget: true, + rightWidget: SizedBox(width: 60.w, child: _switch())), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: TranslationLoader + .lanKeys!.wifiDistributionNetwork!.tr, + rightTitle: "", + isHaveLine: true, isHaveDirection: true, action: () { Get.toNamed(Routers.configuringWifiPage); }), - SizedBox( - height: 10.h, - ), CommonItem( leftTitel: TranslationLoader.lanKeys!.lockTime!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, action: () { - Get.toNamed(Routers.lockTimePage, arguments: state.getKeyInfosData.value); + Get.toNamed(Routers.lockTimePage, + arguments: state.getKeyInfosData.value); }), CommonItem( leftTitel: TranslationLoader.lanKeys!.diagnose!.tr, @@ -220,53 +268,6 @@ class _LockSetPageState extends State { action: () { Get.toNamed(Routers.lockEscalationPage); }), - SizedBox( - height: 10.h, - ), - CommonItem( - leftTitel: "Amazon Alexa", - rightTitle: "", - isHaveLine: true, - isHaveDirection: true, - action: () {}), - CommonItem( - leftTitel: "Google Home", - rightTitle: "", - isHaveLine: true, - isHaveDirection: true, - action: () {}), - SizedBox( - height: 10.h, - ), - Obx((){ - var title = ""; - if(state.getKeyInfosData.value.roomStatus == 1){ - title = TranslationLoader.lanKeys!.checkedIn!.tr; - }else if(state.getKeyInfosData.value.roomStatus == 2){ - title = TranslationLoader.lanKeys!.leisure!.tr; - } - return CommonItem( - leftTitel: - TranslationLoader.lanKeys!.markedHouseState!.tr, - rightTitle: title, - isHaveLine: true, - isHaveDirection: true, - action: () { - Get.toNamed(Routers.markedHouseStatePage, arguments: state.getKeyInfosData.value); - }); - }), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.checkingIn!.tr, - rightTitle: "", - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: SizedBox(width: 60.w, child: _switch())), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.unlockReminder!.tr, - rightTitle: "", - isHaveLine: false, - isHaveRightWidget: true, - rightWidget: SizedBox(width: 60.w, child: _switch())), SizedBox( height: 30.h, ), diff --git a/star_lock/lib/main/lockDetail/lcokSet/unlockQRCode/unlockQRCode_page.dart b/star_lock/lib/main/lockDetail/lcokSet/unlockQRCode/unlockQRCode_page.dart index 70c7e107..c089ce5a 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/unlockQRCode/unlockQRCode_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/unlockQRCode/unlockQRCode_page.dart @@ -21,7 +21,7 @@ class _UnlockQRCodePageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.burglarAlarm!.tr, + barTitle: TranslationLoader.lanKeys!.unlockQRCode!.tr, haveBack: true, backgroundColor: AppColors.mainColor), body: Column( diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index b5b69cdc..d44ee097 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -56,7 +56,8 @@ class _LockDetailPageState extends State { Storage.setStringList(saveBluePrivateKey, savePrivateKeyList); // signKey - List signKeyData = state.keyInfos.value.bluetooth!.signKey!.cast(); + List signKeyData = + state.keyInfos.value.bluetooth!.signKey!.cast(); var saveSignKeyList = changeIntListToStringList(signKeyData); Storage.setStringList(saveBlueSignKey, saveSignKeyList); // print("publicKeyData:$publicKeyData saveStrList:$saveStrList privateKeyData:$privateKeyData savePrivateKeyList:$savePrivateKeyList"); @@ -129,7 +130,8 @@ class _LockDetailPageState extends State { width: 268.w, height: 268.w), )), Visibility( - visible: state.keyInfos.value.remoteEnable == 1 ? true: false, + visible: + state.keyInfos.value.remoteEnable == 1 ? true : false, child: Align( alignment: const Alignment(0.6, 1), child: Image.asset( @@ -174,92 +176,99 @@ class _LockDetailPageState extends State { // color: Colors.blue, child: SizedBox( child: GridView.count( - crossAxisCount: 4, - // childAspectRatio: 3, - crossAxisSpacing: 20.w, - mainAxisSpacing: 0.h, - physics: const NeverScrollableScrollPhysics(), - children: getShowWidget() - ), + crossAxisCount: 4, + // childAspectRatio: 3, + crossAxisSpacing: 20.w, + mainAxisSpacing: 0.h, + physics: const NeverScrollableScrollPhysics(), + children: getShowWidget()), ), ); } - List getShowWidget(){ + List getShowWidget() { var showWidgetArr = []; // 考勤 showWidgetArr.add(bottomItem('images/main/icon_main_clockingIn.png', TranslationLoader.lanKeys!.checkingIn!.tr, () { - Get.toNamed( Routers.checkingInListPage); - })); + Get.toNamed(Routers.checkingInListPage); + })); var defaultWidgetArr = [ // 电子钥匙 - bottomItem('images/main/icon_main_electronicKey.png', TranslationLoader.lanKeys!.electronicKey!.tr, () { + bottomItem('images/main/icon_main_electronicKey.png', + TranslationLoader.lanKeys!.electronicKey!.tr, () { Get.toNamed(Routers.electronicKeyListPage, arguments: { - "lockMainEntity": widget.lockMainEntity, - "keyInfo": widget.keyInfo - }); - }), + "lockMainEntity": widget.lockMainEntity, + "keyInfo": widget.keyInfo + }); + }), // 密码 - bottomItem('images/main/icon_main_password.png', TranslationLoader.lanKeys!.password!.tr, () { - Get.toNamed(Routers.passwordKeyListPage, - arguments: { - "lockMainEntity": widget.lockMainEntity, - "keyInfo": widget.keyInfo - }); - }), + bottomItem('images/main/icon_main_password.png', + TranslationLoader.lanKeys!.password!.tr, () { + Get.toNamed(Routers.passwordKeyListPage, arguments: { + "lockMainEntity": widget.lockMainEntity, + "keyInfo": widget.keyInfo + }); + }), // ic卡 - bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () { - Get.toNamed(Routers.otherTypeKeyListPage, - arguments: 0); - }), + bottomItem('images/main/icon_main_icCard.png', + TranslationLoader.lanKeys!.card!.tr, () { + Get.toNamed(Routers.otherTypeKeyListPage, arguments: 0); + }), // 指纹 - bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, () { - Get.toNamed(Routers.otherTypeKeyListPage, - arguments: 1); - }), + bottomItem('images/main/icon_main_fingerprint.png', + TranslationLoader.lanKeys!.fingerprint!.tr, () { + Get.toNamed(Routers.otherTypeKeyListPage, arguments: 1); + }), // 遥控 - bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys!.remoteControl!.tr, () { - Get.toNamed(Routers.otherTypeKeyListPage, - arguments: 2); - }), + bottomItem('images/main/icon_main_remoteControl.png', + TranslationLoader.lanKeys!.remoteControl!.tr, () { + Get.toNamed(Routers.otherTypeKeyListPage, arguments: 2); + }), ]; showWidgetArr.addAll(defaultWidgetArr); //可视对讲门锁新增->人脸 - showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', '人脸', () { - // Navigator.pushNamed(context, Routers.otherTypeKeyListPage, - // arguments: 1); - }),); + showWidgetArr.add( + bottomItem('images/main/icon_face.png', '人脸', () { + // Navigator.pushNamed(context, Routers.otherTypeKeyListPage, + // arguments: 1); + }), + ); //可视对讲门锁新增->监控 - showWidgetArr.add(bottomItem('images/main/icon_main_fingerprint.png', '监控', () { - // Navigator.pushNamed(context, Routers.otherTypeKeyListPage, - // arguments: 1); - }),); + showWidgetArr.add( + bottomItem('images/main/icon_catEyes.png', '监控', () { + // Navigator.pushNamed(context, Routers.otherTypeKeyListPage, + // arguments: 1); + }), + ); var endWiddget = [ // 授权管理员 - bottomItem('images/main/icon_main_authorizedAdmin.png', TranslationLoader.lanKeys!.authorizedAdmin!.tr, () { - Get.toNamed(Routers.authorizedAdminListPage, arguments: { - "lockMainEntity": widget.lockMainEntity, - "keyInfo": widget.keyInfo - }); - }), + bottomItem('images/main/icon_main_authorizedAdmin.png', + TranslationLoader.lanKeys!.authorizedAdmin!.tr, () { + Get.toNamed(Routers.authorizedAdminListPage, arguments: { + "lockMainEntity": widget.lockMainEntity, + "keyInfo": widget.keyInfo + }); + }), // 操作记录 - bottomItem('images/main/icon_main_operatingRecord.png', TranslationLoader.lanKeys!.operatingRecord!.tr, () { - Get.toNamed(Routers.lockOperatingRecordPage, - arguments: { - "lockMainEntity": widget.lockMainEntity, - "keyInfo": widget.keyInfo - }); - }), + bottomItem('images/main/icon_main_operatingRecord.png', + TranslationLoader.lanKeys!.operatingRecord!.tr, () { + Get.toNamed(Routers.lockOperatingRecordPage, arguments: { + "lockMainEntity": widget.lockMainEntity, + "keyInfo": widget.keyInfo + }); + }), // 设置 - bottomItem('images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, () { - Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo); - }), + bottomItem( + 'images/main/icon_main_set.png', TranslationLoader.lanKeys!.set!.tr, + () { + Get.toNamed(Routers.lockSetPage, arguments: widget.keyInfo); + }), ]; showWidgetArr.addAll(endWiddget); return showWidgetArr; diff --git a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart index f5989215..905c0cb5 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyManage/passwordKeyManage_tabbar.dart @@ -86,8 +86,8 @@ class _PasswordKeyManageTabbarPageState Tab _tab(ItemView item) { return Tab( // text: item.title, - child: Container( - width: 1.sw / 8, + child: SizedBox( + width: item.title.length > 2 ? 1.sw / 8 : 1.sw / 12, // margin: EdgeInsets.all(10.w), // color: Colors.red, child: Text( diff --git a/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart b/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart index 1edaa1d1..9ebeef55 100644 --- a/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart +++ b/star_lock/lib/mine/addLock/seletLockType/seletLockType_page.dart @@ -41,7 +41,7 @@ class _SeletLockTypePageState extends State with BaseWidget { TranslationLoader.lanKeys!.doorLock!.tr, () { Navigator.pushNamed(context, Routers.addLockPage); }), - lockTypeItem('images/lockType/lockType_doorLock.png', + lockTypeItem('images/lockType/lockType_NFCLock.png', TranslationLoader.lanKeys!.NFCPassiveLock!.tr, () { Navigator.pushNamed(context, Routers.addLockPage); }), @@ -57,8 +57,7 @@ class _SeletLockTypePageState extends State with BaseWidget { TranslationLoader.lanKeys!.parkingLock!.tr, () { Navigator.pushNamed(context, Routers.addLockPage); }), - lockTypeItem( - 'images/lockType/lockType_intelligentLockCore.png', + lockTypeItem('images/lockType/lockType_entranceGuardLock.png', TranslationLoader.lanKeys!.itelligentAccessControl!.tr, () { Navigator.pushNamed(context, Routers.addLockPage); @@ -68,7 +67,7 @@ class _SeletLockTypePageState extends State with BaseWidget { // TranslationLoader.lanKeys!.bicycleLock!.tr, () { // Navigator.pushNamed(context, Routers.addLockPage); // }), - lockTypeItem('images/lockType/lockType_remoteControl.png', + lockTypeItem('images/lockType/lockType_gatewayLock.png', TranslationLoader.lanKeys!.gateway!.tr, () { Navigator.pushNamed(context, Routers.gatewayListPage); }), @@ -138,8 +137,8 @@ class _SeletLockTypePageState extends State with BaseWidget { SizedBox(width: 30.w), Image.asset( lockTypeIcon, - width: 32.w, - height: 48.w, + width: 48.w, + height: 60.w, ), SizedBox(width: 20.w), Expanded( diff --git a/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart index 30a781d5..0b3fa821 100644 --- a/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart +++ b/star_lock/lib/mine/mineMultiLanguage/mineMultiLanguage_page.dart @@ -17,32 +17,62 @@ class MineMultiLanguagePage extends StatefulWidget { } class _MineMultiLanguagePageState extends State { - final logic = Get.put(MineMultiLanguageLogic()); final state = Get.find().state; - @override Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys!.multilingual!.tr, haveBack:true, backgroundColor: AppColors.mainColor), - body: Column( - mainAxisAlignment: MainAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: _children(), - ) - ); + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.multilingual!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Column( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: _children(), + )); } - List _children(){ + List _children() { List l = []; - for(int i = 0; i < state.languages.length; i++){ + l.add( + CommonItem( + leftTitel: '跟随系统', + rightTitle: "", + allHeight: 90.h, + isHaveLine: true, + isHaveDirection: false, + isHaveRightWidget: true, + rightWidget: Container(), + action: () { + // logic.changeLanguage(e); + }), + ); + for (int i = 0; i < state.languages.length; i++) { var e = state.languages[i]; var lanType = ExtensionLanguageType.fromLanguageCode(e.languageCode); - l.add(CommonItem(leftTitel:lanType.lanTitle, rightTitle:"", allHeight: 90.h, isHaveLine: true, isHaveDirection:false, isHaveRightWidget: true, rightWidget: Obx(() => state.currentLanguageType.value == lanType ? Image(image: const AssetImage("images/icon_item_checked.png"),width:30.w,height:30.w, fit: BoxFit.contain,): Container()), action: (){ - logic.changeLanguage(e); - }),); + l.add( + CommonItem( + leftTitel: lanType.lanTitle, + rightTitle: "", + allHeight: 90.h, + isHaveLine: true, + isHaveDirection: false, + isHaveRightWidget: true, + rightWidget: Obx(() => state.currentLanguageType.value == lanType + ? Image( + image: const AssetImage("images/icon_item_checked.png"), + width: 30.w, + height: 30.w, + fit: BoxFit.contain, + ) + : Container()), + action: () { + logic.changeLanguage(e); + }), + ); } return l; } diff --git a/star_lock/lib/mine/mineSet/mineSet_page.dart b/star_lock/lib/mine/mineSet/mineSet_page.dart index 74eb72b6..58e3258a 100644 --- a/star_lock/lib/mine/mineSet/mineSet_page.dart +++ b/star_lock/lib/mine/mineSet/mineSet_page.dart @@ -153,6 +153,21 @@ class _MineSetPageState extends State { Navigator.pushNamed(context, Routers.aPPUnlockNeedMobileNetworkingLockPage); }), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: "Amazon Alexa", + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () {}), + CommonItem( + leftTitel: "Google Home", + rightTitle: "", + isHaveLine: true, + isHaveDirection: true, + action: () {}), // CommonItem(leftTitel:TranslationLoader.lanKeys!.valueAddedServices!.tr, rightTitle:"", isHaveDirection: true, action: (){ // // }), diff --git a/star_lock/lib/network/api.dart b/star_lock/lib/network/api.dart index 8924547d..b7465fcc 100644 --- a/star_lock/lib/network/api.dart +++ b/star_lock/lib/network/api.dart @@ -46,7 +46,8 @@ abstract class Api { final String getWifiServiceIpURL = '/wifiLock/getWifiServiceIp'; // 获取Wifi锁服务器 final String updateSpecialValueUrl = '/room/updateSpecialValue'; // 开启/关闭 远程开锁 final String setAutoLockTimeUrl = '/room/setAutoLockTime'; // 自动闭锁 - final String getPassageModeConfigUrl = '/room/getPassageModeConfig'; // 获取锁的常开模式设置 + final String getPassageModeConfigUrl = + '/room/getPassageModeConfig'; // 获取锁的常开模式设置 final String configPassageModeUrl = '/room/configPassageMode'; // 配置锁的常开模式 final String updateSettingUrl = '/room/updateSetting'; // 锁声音/防撬报警/重置键/考勤 final String roomQueryDateUrl = '/room/queryDate'; // 获取网关时间 @@ -56,5 +57,4 @@ abstract class Api { final String lockUserListURL = '/keyUser/listKeyUser'; //锁用户列表 final String canSendKeyURL = '/keyUser/canSendKey'; //群发钥匙检查 final String batchSendKeyURL = '/key/batchSend'; //批处理群发钥匙 - } diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index a9210ad5..76d8a944 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -297,10 +297,8 @@ class ApiProvider extends BaseProvider { })); // 获取Wifi锁服务器 - Future getWifiLockServiceIpAndPort() => post( - getWifiServiceIpURL.toUrl, - jsonEncode({ - })); + Future getWifiLockServiceIpAndPort() => + post(getWifiServiceIpURL.toUrl, jsonEncode({})); Future passwordKeyList( String keyStatus, @@ -428,10 +426,10 @@ class ApiProvider extends BaseProvider { lockListByGroupURL.toUrl, jsonEncode({'type': type, 'keyGroupId': keyGroupId})); - -/// 锁设置模块 + /// 锁设置模块 // 远程开锁 - Future remoteUnlockingOpenOrCloseLoadData(String lockId, String featureValue) => + Future remoteUnlockingOpenOrCloseLoadData( + String lockId, String featureValue) => post( updateSpecialValueUrl.toUrl, jsonEncode({ @@ -440,7 +438,8 @@ class ApiProvider extends BaseProvider { })); // 自动闭锁 - Future setAutoUnlockLoadData(String lockId, String autoLockTime, String type) => + Future setAutoUnlockLoadData( + String lockId, String autoLockTime, String type) => post( setAutoLockTimeUrl.toUrl, jsonEncode({ @@ -450,15 +449,22 @@ class ApiProvider extends BaseProvider { })); // 获取锁的常开模式设置 - Future getPassageModeConfigLoadData(String lockId) => - post( - getPassageModeConfigUrl.toUrl, - jsonEncode({ - 'lockId': lockId, - })); + Future getPassageModeConfigLoadData(String lockId) => post( + getPassageModeConfigUrl.toUrl, + jsonEncode({ + 'lockId': lockId, + })); // 获取锁的常开模式设置 - Future configPassageMode(String lockId, String passageMode, String autoUnlock, String type, String startDate, String endDate, String isAllDay, List weekDays) => + Future configPassageMode( + String lockId, + String passageMode, + String autoUnlock, + String type, + String startDate, + String endDate, + String isAllDay, + List weekDays) => post( configPassageModeUrl.toUrl, jsonEncode({ @@ -473,7 +479,8 @@ class ApiProvider extends BaseProvider { })); // 获取锁的常开模式设置 - Future setLockSetGeneralSetting(String lockId, String changeType, String isOn, String type) => + Future setLockSetGeneralSetting( + String lockId, String changeType, String isOn, String type) => post( updateSettingUrl.toUrl, jsonEncode({ @@ -484,27 +491,25 @@ class ApiProvider extends BaseProvider { })); // 通过网关获取锁的时间 - Future getLockTimeFromGatewayLoadData(String lockId) => - post( - roomQueryDateUrl.toUrl, - jsonEncode({ - 'lockId': lockId, - })); + Future getLockTimeFromGatewayLoadData(String lockId) => post( + roomQueryDateUrl.toUrl, + jsonEncode({ + 'lockId': lockId, + })); // 获取服务器当前时间 - Future getServerDatetimeLoadData(String lockId) => - post( - getServerDatetimeUrl.toUrl, - jsonEncode({ - 'lockId': lockId, - })); + Future getServerDatetimeLoadData(String lockId) => post( + getServerDatetimeUrl.toUrl, + jsonEncode({ + 'lockId': lockId, + })); // 获取锁版本信息 - Future getLockVersionInfoLoadData(String lockId) => - post( - getLockVersionInfoUrl.toUrl, - jsonEncode({ - 'lockId': lockId,})); + Future getLockVersionInfoLoadData(String lockId) => post( + getLockVersionInfoUrl.toUrl, + jsonEncode({ + 'lockId': lockId, + })); Future listLockByGroup(String type, String keyGroupId) => post( listLockByGroupURL.toUrl, @@ -532,6 +537,25 @@ class ApiProvider extends BaseProvider { 'keyGroupIdList': keyGroupIdList, 'lockIdList': lockIdList })); + + Future batchSendKey( + String endDate, + String keyGroupIdList, + String lockIdList, + String createUser, + String isRemoteUnlock, + String keyNameForAdmin, + String receiverUsername, + String startDate, + String countryCode, + String usernameType) => + post( + batchSendKeyURL.toUrl, + jsonEncode({ + 'endDate': endDate, + 'keyGroupIdList': keyGroupIdList, + 'lockIdList': lockIdList + })); } extension ExtensionString on String { diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index 8d78bc59..c1edad0e 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -2,8 +2,8 @@ import 'package:get/get.dart'; import 'package:star_lock/login/seletCountryRegion/common/countryRegionEntity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecordEntity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; +import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserListEntity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupListEntity.dart'; -import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserListEntity.dart'; import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/basicInformation/KeyDetailEntity.dart'; import 'package:star_lock/main/lockDetail/lcokSet/basicInformation/lockSeletGrouping/LockGroupListEntity.dart'; import 'package:star_lock/main/lockDetail/passwordKey/passwordKeyList/passwordKeyListEntity.dart'; @@ -408,105 +408,93 @@ class ApiRepository { return PasswordKeyEntity.fromJson(res.body); } - // 获取Wifi锁服务器 Future getWifiLockServiceIpAndPort() async { final res = await apiProvider.getWifiLockServiceIpAndPort(); return ConfiguringWifiEntity.fromJson(res.body); } -/// 锁设置模块 + /// 锁设置模块 // 远程开锁开/关 - Future remoteUnlockingOpenOrClose( - { + Future remoteUnlockingOpenOrClose({ required String lockId, required String featureValue, }) async { - final res = - await apiProvider.remoteUnlockingOpenOrCloseLoadData(lockId, featureValue); + final res = await apiProvider.remoteUnlockingOpenOrCloseLoadData( + lockId, featureValue); return LoginEntity.fromJson(res.body); } // 自动闭锁 - Future setAutoUnlock( - { - required String lockId, - required String autoLockTime, - required String type, - }) async { + Future setAutoUnlock({ + required String lockId, + required String autoLockTime, + required String type, + }) async { final res = - await apiProvider.setAutoUnlockLoadData(lockId, autoLockTime, type); + await apiProvider.setAutoUnlockLoadData(lockId, autoLockTime, type); return LoginEntity.fromJson(res.body); } // 获取锁的常开模式设置 configPassageMode - Future getPassageModeConfig( - { - required String lockId, - }) async { - final res = - await apiProvider.getPassageModeConfigLoadData(lockId); + Future getPassageModeConfig({ + required String lockId, + }) async { + final res = await apiProvider.getPassageModeConfigLoadData(lockId); return GetPassageModeConfigEntity.fromJson(res.body); } // 配置锁的常开模式 - Future configPassageModeLoadData( - { - required String lockId, - required String passageMode, - required String autoUnlock, - required String type, - required String startDate, - required String endDate, - required String isAllDay, - required List weekDays, - }) async { - final res = - await apiProvider.configPassageMode(lockId, passageMode, autoUnlock, type, startDate, endDate, isAllDay, weekDays); + Future configPassageModeLoadData({ + required String lockId, + required String passageMode, + required String autoUnlock, + required String type, + required String startDate, + required String endDate, + required String isAllDay, + required List weekDays, + }) async { + final res = await apiProvider.configPassageMode(lockId, passageMode, + autoUnlock, type, startDate, endDate, isAllDay, weekDays); return GetPassageModeConfigEntity.fromJson(res.body); } // 配置锁的常规设置 - Future setLockSetGeneralSettingData( - { - required String lockId, - required String changeType, - required String isOn, - required String type, - }) async { - final res = - await apiProvider.setLockSetGeneralSetting(lockId, changeType, isOn, type); + Future setLockSetGeneralSettingData({ + required String lockId, + required String changeType, + required String isOn, + required String type, + }) async { + final res = await apiProvider.setLockSetGeneralSetting( + lockId, changeType, isOn, type); return LoginEntity.fromJson(res.body); } // 获取锁时间 通过网关 - Future getLockTimeFromGateway( - { - required String lockId, - }) async { - final res = - await apiProvider.getLockTimeFromGatewayLoadData(lockId); + Future getLockTimeFromGateway({ + required String lockId, + }) async { + final res = await apiProvider.getLockTimeFromGatewayLoadData(lockId); return GetPassageModeConfigEntity.fromJson(res.body); } // 获取服务器当前时间 - Future getServerDatetimeData( - { - required String lockId, - }) async { - final res = - await apiProvider.getServerDatetimeLoadData(lockId); + Future getServerDatetimeData({ + required String lockId, + }) async { + final res = await apiProvider.getServerDatetimeLoadData(lockId); return GetServerDatetimeEntity.fromJson(res.body); } // 获取锁版本信息 - Future getLockVersionInfoData( - { - required String lockId, - }) async { - final res = - await apiProvider.getLockVersionInfoLoadData(lockId); - return GetServerDatetimeEntity.fromJson(res.body);} + Future getLockVersionInfoData({ + required String lockId, + }) async { + final res = await apiProvider.getLockVersionInfoLoadData(lockId); + return GetServerDatetimeEntity.fromJson(res.body); + } //分组下的锁列表 Future listLockByGroup( @@ -535,4 +523,30 @@ class ApiRepository { await apiProvider.canSendKey(endDate, keyGroupIdList, lockIdList); return KeyDetailEntity.fromJson(res.body); } + + //群发钥匙检查 + Future batchSendKey( + String endDate, + String keyGroupIdList, + String lockIdList, + String createUser, + String isRemoteUnlock, + String keyNameForAdmin, + String receiverUsername, + String startDate, + String countryCode, + String usernameType) async { + final res = await apiProvider.batchSendKey( + endDate, + keyGroupIdList, + lockIdList, + createUser, + isRemoteUnlock, + keyNameForAdmin, + receiverUsername, + startDate, + countryCode, + usernameType); + return KeyDetailEntity.fromJson(res.body); + } } diff --git a/star_lock/lib/network/request_interceptor.dart b/star_lock/lib/network/request_interceptor.dart index 8aa66a81..84c70a45 100644 --- a/star_lock/lib/network/request_interceptor.dart +++ b/star_lock/lib/network/request_interceptor.dart @@ -2,6 +2,7 @@ import 'dart:async'; import 'dart:convert'; import 'package:get/get.dart'; import 'package:get/get_connect/http/src/request/request.dart'; +import 'package:star_lock/login/login/entity/LoginData.dart'; import '../login/login/entity/LoginEntity.dart'; import '../tools/platform_info_services.dart'; @@ -18,7 +19,10 @@ FutureOr requestInterceptor(Request request) async { String? xToken = ''; final data = await Storage.getString('userLoginData'); if (data != null && data.isNotEmpty) { - xToken = LoginEntity.fromJson(jsonDecode(data)).data!.accessToken; + LoginData loginData = LoginData.fromJson(jsonDecode(data)); + xToken = loginData.accessToken; + + // xToken = LoginEntity.fromJson(jsonDecode(data)).data!.accessToken; } request.headers['Authorization'] = "Bearer ${xToken ?? ''}"; return request; diff --git a/star_lock/lib/tools/showTFView.dart b/star_lock/lib/tools/showTFView.dart index c6b8ce79..4fc01340 100644 --- a/star_lock/lib/tools/showTFView.dart +++ b/star_lock/lib/tools/showTFView.dart @@ -45,11 +45,10 @@ class ShowTFView extends StatelessWidget { controller: controller, autofocus: false, decoration: InputDecoration( - //输入里面输入文字内边距设置 contentPadding: - EdgeInsets.only(top: 20.h, left: 15.0, bottom: 13.h), - hintText: tipTitle, - hintStyle: TextStyle(fontSize: 28.sp), + const EdgeInsets.only(left: 5, top: -8, bottom: 6), + hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr, + hintStyle: TextStyle(fontSize: 22.sp, height: 1.0), //不需要输入框下划线 border: InputBorder.none, //左边图标设置