diff --git a/star_lock/images/icon_bar_share.png b/star_lock/images/icon_bar_share.png new file mode 100644 index 00000000..e4ed055c Binary files /dev/null and b/star_lock/images/icon_bar_share.png differ diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index 995f0824..b089d2a4 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -203,6 +203,7 @@ "touchUnlock":"Touch Unlock", "pushNotification":"Push Notification", "lockUserManagement":"Lock User Management", + "ownedKey":"Owned key", "authorityManagement":"Authority management", "associatedDevice":"Associated device", "associatedName":"Associated name", diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index 46c0d7e5..22f3f9d0 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -203,6 +203,7 @@ "touchUnlock":"touchUnlock", "pushNotification":"pushNotification", "lockUserManagement":"lockUserManagement", + "ownedKey":"ownedKey", "authorityManagement":"authorityManagement", "associatedDevice":"associatedDevice", "associatedName":"associatedName", diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index b55e3ff3..05cf5f74 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -203,6 +203,7 @@ "touchUnlock":"触摸开锁", "pushNotification":"消息推送", "lockUserManagement":"锁用户管理", + "ownedKey":"拥有的钥匙", "authorityManagement":"权限管理", "associatedDevice":"关联设备", "associatedName":"关联姓名", diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart index 1a8ed05f..05410444 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminDetail/authorizedAdminDetail_page.dart @@ -78,7 +78,9 @@ class _AuthorizedAdminDetailPageState extends State { leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, rightTitle: "", isHaveDirection: true, - action: () {}), + action: () { + Navigator.pushNamed(context, Routers.keyOperationRecordPage); + }), Container(height: 40.h), SubmitBtn( btnName: TranslationLoader.lanKeys!.delete!.tr, diff --git a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart index 7de67ee0..ff504eec 100644 --- a/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart +++ b/star_lock/lib/main/lockDetail/authorizedAdmin/authorizedAdminList/authorizedAdminList_page.dart @@ -47,11 +47,6 @@ class _AuthorizedAdminListPageState extends State { Navigator.pushNamed(context, Routers.authorizedAdminManagePage); }, ), - // SubmitBtn( - // btnName: TranslationLoader.lanKeys!.authorizedAdmin!.tr, - // onClick: () { - // Navigator.pushNamed(context, Routers.authorizedAdminManagePage); - // }), SizedBox( height: 64.h, ) @@ -66,7 +61,8 @@ class _AuthorizedAdminListPageState extends State { itemBuilder: (c, index) { return _electronicKeyItem('images/controls_user.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15", () { - Navigator.pushNamed(context, Routers.authorizedAdminDetailPage); + // Navigator.pushNamed(context, Routers.authorizedAdminDetailPage); + Navigator.pushNamed(context, Routers.electronicKeyDetailPage); }); }); } @@ -125,18 +121,16 @@ class _AuthorizedAdminListPageState extends State { ], ), SizedBox(height: 5.h), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - "2023.6.21 11.15 永久", - style: TextStyle( - fontSize: 18.sp, - color: AppColors.placeholderTextColor), - ), - ], - ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "2023.6.21 11.15 永久", + style: TextStyle( + fontSize: 18.sp, + color: AppColors.placeholderTextColor), + ), + ], ), SizedBox(width: 20.h), ], diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart index 28690fb9..c2bf0922 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetail/electronicKeyDetail_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/tools/jh_pop_menus.dart'; import '../../../../../appRouters.dart'; import '../../../../../app_settings/app_colors.dart'; @@ -30,6 +31,25 @@ class _ElectronicKeyDetailPageState extends State { appBar: TitleAppBar( barTitle: TranslationLoader.lanKeys!.keyDetail!.tr, haveBack: true, + actionsList: [ + IconButton( + icon: Image.asset( + 'images/icon_bar_more.png', + height: 30.h, + width: 10.w, + ), + onPressed: () { + JhPopMenus.showLinePop(context, + clickCallback: (index, selText) { + print('选中index: $index'); + print('选中text: $selText'); + }, listData: [ + {'text': '冻结'}, + {'text': '取消授权'} + ]); + }, + ), + ], backgroundColor: AppColors.mainColor), body: Column( children: [ @@ -78,7 +98,8 @@ class _ElectronicKeyDetailPageState extends State { rightTitle: "", isHaveDirection: true, action: () { - Navigator.pushNamed(context, Routers.keyOperationRecordPage, arguments: {}); + Navigator.pushNamed(context, Routers.keyOperationRecordPage, + arguments: {}); }), Container(height: 40.h), SubmitBtn( diff --git a/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart b/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart index c362f9ed..ea7faba7 100644 --- a/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart +++ b/star_lock/lib/main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart @@ -42,10 +42,15 @@ class _LockOperatingRecordPageState extends State { if (selText == '扫一扫') { // _scan(); } - }); + }, listData: [ + {'text': '读取记录'}, + {'text': '清空记录'}, + {'text': '导出记录'}, + ]); }, ), ], + /* actionsList: [ TextButton( diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart index 94bc7074..e4a23b14 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart @@ -80,7 +80,9 @@ class _OtherTypeKeyDetailPageState extends State { leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, rightTitle: "", isHaveDirection: true, - action: () {}), + action: () { + Navigator.pushNamed(context, Routers.keyOperationRecordPage); + }), Container(height: 40.h), SubmitBtn( btnName: TranslationLoader.lanKeys!.delete!.tr, 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 feb3e201..5e267bf9 100644 --- a/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/passwordKey/passwordKeyDetail/passwordKeyDetail_page.dart @@ -27,14 +27,24 @@ class _PasswordKeyDetailPageState extends State { haveBack: true, backgroundColor: AppColors.mainColor, actionsList: [ - TextButton( - child: Text( - "分享", - style: TextStyle(color: Colors.white, fontSize: 24.sp), + IconButton( + icon: Image.asset( + 'images/icon_bar_share.png', + height: 30.h, + width: 30.w, ), onPressed: () {}, ), ], + // actionsList: [ + // TextButton( + // child: Text( + // "分享", + // style: TextStyle(color: Colors.white, fontSize: 24.sp), + // ), + // onPressed: () {}, + // ), + // ], ), body: Column( children: [ @@ -76,7 +86,9 @@ class _PasswordKeyDetailPageState extends State { leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, rightTitle: "", isHaveDirection: true, - action: () {}), + action: () { + Navigator.pushNamed(context, Routers.keyOperationRecordPage); + }), Container(height: 40.h), SubmitBtn( btnName: TranslationLoader.lanKeys!.delete!.tr, diff --git a/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart b/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart index 9710bcc6..20be0f8a 100644 --- a/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart +++ b/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart @@ -90,7 +90,8 @@ class _AuthorizedAdministratorListPageState itemBuilder: (c, index) { return _electronicKeyItem('images/controls_user.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15", () { - Navigator.pushNamed(context, Routers.authorizedAdminDetailPage); + // Navigator.pushNamed(context, Routers.authorizedAdminDetailPage); + Navigator.pushNamed(context, Routers.electronicKeyDetailPage); }); }); } diff --git a/star_lock/lib/mine/mineSet/lockUserManage/ownedKeyList_page.dart b/star_lock/lib/mine/mineSet/lockUserManage/ownedKeyList_page.dart index e85c34f6..30ae047d 100644 --- a/star_lock/lib/mine/mineSet/lockUserManage/ownedKeyList_page.dart +++ b/star_lock/lib/mine/mineSet/lockUserManage/ownedKeyList_page.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get_utils/get_utils.dart'; +import 'package:star_lock/translations/trans_lib.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; @@ -18,7 +20,7 @@ class _OwnedKeyListPageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: "拥有的钥匙", + barTitle: TranslationLoader.lanKeys!.ownedKey!.tr, haveBack: true, backgroundColor: AppColors.mainColor, ), @@ -38,9 +40,9 @@ class _OwnedKeyListPageState extends State { // margin: EdgeInsets.only(left: 30.w, top: 30.w, right: 30.w, bottom: 30.w), child: Padding( padding: - EdgeInsets.only(left: 30.w, top: 30.w, right: 20.w, bottom: 10.w), + EdgeInsets.only(left: 30.w, top: 20.w, right: 20.w, bottom: 10.w), child: Text( - "拥有的钥匙", + TranslationLoader.lanKeys!.ownedKey!.tr, style: TextStyle(fontSize: 24.sp), ), ), diff --git a/star_lock/lib/tools/jh_pop_menus.dart b/star_lock/lib/tools/jh_pop_menus.dart index bbc4e692..74f51050 100644 --- a/star_lock/lib/tools/jh_pop_menus.dart +++ b/star_lock/lib/tools/jh_pop_menus.dart @@ -2,11 +2,11 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'screen_utils.dart'; -List _listData = [ - {'text': '读取记录'}, - {'text': '清空记录'}, - {'text': '导出记录'}, -]; +// List _listData = [ +// {'text': '读取记录'}, +// {'text': '清空记录'}, +// {'text': '导出记录'}, +// ]; const Color _bgColor = Color(0xFF2D2D2D); const double _fontSize = 20.0; @@ -17,6 +17,7 @@ class JhPopMenus { /// 显示pop static void show( BuildContext context, { + required List listData, Function(int selectIndex, String selectText)? clickCallback, }) { // Cell @@ -31,7 +32,7 @@ class JhPopMenus { color: _bgColor, child: InkWell( onTap: () { - clickCallback?.call(index, _listData[index]['text']); + clickCallback?.call(index, listData[index]['text']); Navigator.pop(context); }, child: Row( @@ -74,13 +75,14 @@ class JhPopMenus { } Navigator.of(context) - .push(DialogRouter(_BasePopMenus(child: menusView(_listData)))); + .push(DialogRouter(_BasePopMenus(child: menusView(listData)))); } /// 显示带线带背景 pop static void showLinePop( BuildContext context, { bool isShowBg = false, + required List listData, Function(int selectIndex, String selectText)? clickCallback, }) { // 带线 @@ -94,7 +96,7 @@ class JhPopMenus { color: _bgColor, child: InkWell( onTap: () { - clickCallback?.call(index, _listData[index]['text']); + clickCallback?.call(index, listData[index]['text']); Navigator.pop(context); }, child: SizedBox( @@ -158,12 +160,12 @@ class JhPopMenus { context: context, barrierDismissible: false, builder: (context) { - return _BasePopMenus(child: menusView(_listData)); + return _BasePopMenus(child: menusView(listData)); }, ); } else { Navigator.of(context) - .push(DialogRouter(_BasePopMenus(child: menusView(_listData)))); + .push(DialogRouter(_BasePopMenus(child: menusView(listData)))); } } } diff --git a/star_lock/lib/translations/lanKeyEntity.dart b/star_lock/lib/translations/lanKeyEntity.dart index 455a1d3a..7713fa1f 100644 --- a/star_lock/lib/translations/lanKeyEntity.dart +++ b/star_lock/lib/translations/lanKeyEntity.dart @@ -199,6 +199,7 @@ class LanKeyEntity { this.touchUnlock, this.pushNotification, this.lockUserManagement, + this.ownedKey, this.authorityManagement, this.associatedDevice, this.associatedName, @@ -581,6 +582,7 @@ class LanKeyEntity { touchUnlock = json['touchUnlock']; pushNotification = json['pushNotification']; lockUserManagement = json['lockUserManagement']; + ownedKey = json['ownedKey']; authorityManagement = json['authorityManagement']; associatedDevice = json['associatedDevice']; associatedName = json['associatedName']; @@ -979,6 +981,7 @@ class LanKeyEntity { String? touchUnlock; String? pushNotification; String? lockUserManagement; + String? ownedKey; String? authorityManagement; String? associatedDevice; String? associatedName; @@ -1374,6 +1377,7 @@ class LanKeyEntity { map['touchUnlock'] = touchUnlock; map['pushNotification'] = pushNotification; map['lockUserManagement'] = lockUserManagement; + map['ownedKey'] = ownedKey; map['authorityManagement'] = authorityManagement; map['associatedDevice'] = associatedDevice; map['associatedName'] = associatedName;