diff --git a/star_lock/images/icon_addressBook.png b/star_lock/images/icon_addressBook.png new file mode 100644 index 00000000..09aa9ba3 Binary files /dev/null and b/star_lock/images/icon_addressBook.png differ diff --git a/star_lock/images/icon_lockGroup_item.png b/star_lock/images/icon_lockGroup_item.png new file mode 100644 index 00000000..68fa570c Binary files /dev/null and b/star_lock/images/icon_lockGroup_item.png differ diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index 398e0481..6e9c5107 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -199,9 +199,12 @@ "touchUnlock":"Touch Unlock", "pushNotification":"Push Notification", "lockUserManagement":"Lock User Management", + "aboutToExpire":"About to expire", "authorizedAdmin":"Authorized Admin", "lockGroup":"Lock Group", "transferSmartLock":"Transfer Smart Lock", + "selectiveLock":"Selective lock", + "recipientInformation":"recipientInformation", "transferGateway":"Transfer Gateway", "multiLanguage":"Multi Language", "lockScreen":"Lock Screen", @@ -236,7 +239,6 @@ "problemTwo":"Problem Two", "problemThree":"Problem Three", "pleaseEnterYourAnswer":"Please Enter Your Answer", - "aboutToExpire":"About to expire", "designation": "designation", "state": "State", diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index 833edfed..79399173 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -202,6 +202,8 @@ "authorizedAdmin":"authorizedAdmin", "lockGroup":"lockGroup", "transferSmartLock":"transferSmartLock", + "selectiveLock":"selectiveLock", + "recipientInformation":"recipientInformation", "transferGateway":"transferGateway", "multiLanguage":"multiLanguage", "lockScreen":"lockScreen", @@ -236,7 +238,7 @@ "problemTwo":"problemTwo", "problemThree":"problemThree", "pleaseEnterYourAnswer":"pleaseEnterYourAnswer", - "aboutToExpire":"About to expire", + "aboutToExpire":"aboutToExpire", "designation": "designation", "state": "state", diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index bd462406..91d7a2b5 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -202,6 +202,8 @@ "authorizedAdmin":"授权管理员", "lockGroup":"锁分组", "transferSmartLock":"转移智能锁", + "selectiveLock":"选择锁", + "recipientInformation":"接收人信息", "transferGateway":"转移网关", "multiLanguage":"多语言", "lockScreen":"锁屏", diff --git a/star_lock/images/normal_circle.png b/star_lock/images/normal_circle.png new file mode 100644 index 00000000..7884e181 Binary files /dev/null and b/star_lock/images/normal_circle.png differ diff --git a/star_lock/images/select_circle.png b/star_lock/images/select_circle.png new file mode 100644 index 00000000..a14a5c4f Binary files /dev/null and b/star_lock/images/select_circle.png differ diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index 6b0e6cc2..7311e0af 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -1,7 +1,11 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; -import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageListPage.dart'; +import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart'; +import 'package:star_lock/mine/mineSet/lockUserManage/lockUserManageList_page.dart'; import 'package:star_lock/mine/mineSet/mineSet_page.dart'; +import 'package:star_lock/mine/mineSet/transferSmartLock/recipientInformation_page.dart'; +import 'package:star_lock/mine/mineSet/transferSmartLock/selectBranch_page.dart'; +import 'package:star_lock/mine/mineSet/transferSmartLock/transferSmartLock_page.dart'; import 'login/forgetPassword/starLock_forgetPassword_page.dart'; import 'login/login/starLock_login_page.dart'; @@ -86,6 +90,7 @@ import 'mine/minePersonInfo/minePersonInfoResetPassword/minePersonInfoResetPassw import 'mine/minePersonInfo/minePersonInfoSetSafetyProblem/minePersonInfoSetSafetyProblem_page.dart'; import 'mine/mineSet/appUnlockNeedMobileNetworkingLock/appUnlockNeedMobileNetworkingLock_page.dart'; import 'mine/mineSet/hideInvalidUnlockPermissions/hideInvalidUnlockPermissions_page.dart'; +import 'mine/mineSet/lockGroup/lockItemList_page.dart'; import 'mine/mineSet/lockScreen/lockScreen_page.dart'; import 'mine/mine_page.dart'; import 'mine/supportStaff/supportStaff_page.dart'; @@ -99,7 +104,7 @@ import 'mine/valueAddedServices/valueAddedServicesNoteAndEmailDetail/valueAddedS import 'mine/valueAddedServices/valueAddedServicesRealName/valueAddedServicesRealName_page.dart'; import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesAddSMSTemplate/valueAddedServicesAddSMSTemplate_page.dart'; import 'mine/valueAddedServices/valueAddedServicesSMSTemplate/valueAddedServicesListSMSTemplate/valueAddedServicesListSMSTemplate_page.dart'; -import 'mine/mineSet/authorizedAdministrator/authorizedAdministratorListPage.dart'; +import 'mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart'; import 'starLockApplication.dart'; abstract class Routers { @@ -241,6 +246,11 @@ abstract class Routers { static const lockUserManageLisPage = '/LockUserManageLisPage'; //我的设置-锁用户管理 static const authorizedAdministratorListPage = '/AuthorizedAdministratorListPage'; //我的设置-授权管理员 + static const lockGroupListPage = '/LockGroupListPage'; //我的设置-锁分组 + static const lockItemListPage = '/LockItemListPage'; //锁分组-锁列表 + static const transferSmartLockPage = '/transferSmartLockPage'; //转移智能锁 + static const recipientInformationPage = '/recipientInformationPage'; //接受人信息 + static const selectBranchPage = '/SelectBranchPage'; //选择分店 static const starLockLoginPage = '/StarLockLoginPage'; // 登录 static const starLockRegisterPage = '/StarLockRegisterPage'; // 注册 @@ -648,6 +658,18 @@ abstract class AppRouters { page: () => const AuthorizedAdministratorListPage()), GetPage( name: Routers.lockUserManageLisPage, - page: () => const LockUserManageListListPage()) + page: () => const LockUserManageListListPage()), + GetPage( + name: Routers.lockGroupListPage, page: () => const LockGroupListPage()), + GetPage( + name: Routers.lockItemListPage, page: () => const LockItemListPage()), + GetPage( + name: Routers.transferSmartLockPage, + page: () => const TransferSmartLockPage()), + GetPage( + name: Routers.recipientInformationPage, + page: () => const RecipientInformationPage()), + GetPage( + name: Routers.selectBranchPage, page: () => const SelectBranchPage()) ]; } diff --git a/star_lock/lib/app_settings/app_colors.dart b/star_lock/lib/app_settings/app_colors.dart index 5901a74d..746a9ab9 100644 --- a/star_lock/lib/app_settings/app_colors.dart +++ b/star_lock/lib/app_settings/app_colors.dart @@ -116,4 +116,6 @@ class AppColors { static Color progressValueColor = const Color(0xFF0093E5); static const greyLineColor = Color.fromRGBO(240, 240, 240, 1); //灰色分割线 + static const darkGrayTextColor = Color.fromRGBO(65, 65, 65, 1); //深灰色字体 + static const placeholderTextColor = Color.fromRGBO(128, 128, 128, 1); //占位字体颜色 } diff --git a/star_lock/lib/main.dart b/star_lock/lib/main.dart index 5e81342f..7fc3b1e4 100644 --- a/star_lock/lib/main.dart +++ b/star_lock/lib/main.dart @@ -23,19 +23,18 @@ void main() async { } class MyApp extends StatefulWidget { - const MyApp({GlobalKey? key}):super(key: key); + const MyApp({GlobalKey? key}) : super(key: key); @override State createState() => _MyAppState(); } class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { - @override Widget build(BuildContext context) { return ScreenUtilInit( designSize: const Size(750, 1334), - builder: (w, a) => _initMaterialApp()); + builder: (w, a) => _initMaterialApp()); } GetMaterialApp _initMaterialApp() => GetMaterialApp( @@ -47,17 +46,19 @@ class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { GlobalCupertinoLocalizations.delegate, GlobalWidgetsLocalizations.delegate, ], - localeResolutionCallback: (locale,supportedLocales){ - if(!supportedLocales.contains(locale)) { - int idx = appSupportedLocales.indexWhere((element) => element.languageCode == locale!.languageCode); - if(idx != -1) { + localeResolutionCallback: (locale, supportedLocales) { + if (!supportedLocales.contains(locale)) { + int idx = appSupportedLocales.indexWhere( + (element) => element.languageCode == locale!.languageCode); + if (idx != -1) { locale = appSupportedLocales[idx]; - }else { + } else { locale = const Locale('zh', 'CN'); } } // print("localelocalelocalelocalelocale locale:${locale} locale.languageCode:${locale.languageCode} locale.countryCode:${locale.countryCode} supportedLocales:${supportedLocales}"); - AppManager().setLanCode(code: '${locale!.languageCode}_${locale.countryCode}'); + AppManager() + .setLanCode(code: '${locale!.languageCode}_${locale.countryCode}'); return locale; }, // locale: StoreService.to.getLanguageCode().isNotEmpty ? appDept.deptSupportedLocales.where((element) => element.languageCode == StoreService.to.getLanguageCode()).first : Get.deviceLocale, @@ -68,21 +69,19 @@ class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { backgroundColor: const Color(0xFFF6F6F6), primaryColor: const Color(0xFFFFFFFF), textTheme: TextTheme( - //用在非Material组件上的文字显示, - bodyText1: TextStyle( - fontSize: 28.sp, color: const Color(0xff2E2B2B)), + //用在非Material组件上的文字显示, + bodyText1: + TextStyle(fontSize: 28.sp, color: const Color(0xff2E2B2B)), //Material组件上的文字显示 - bodyText2: TextStyle( - fontSize: 28.sp, color: const Color(0xff2E2B2B)), + bodyText2: + TextStyle(fontSize: 28.sp, color: const Color(0xff2E2B2B)), button: TextStyle(fontSize: 28.sp)), - iconTheme: - IconThemeData(size: 28.sp, color: const Color(0xff2E2B2B)), + iconTheme: IconThemeData(size: 28.sp, color: const Color(0xff2E2B2B)), appBarTheme: AppBarTheme( backgroundColor: const Color(0xFFFFFFFF), elevation: 0, centerTitle: true, - iconTheme: - IconThemeData(color: const Color(0xff333333), size: 36.sp), + iconTheme: IconThemeData(color: const Color(0xff333333), size: 36.sp), titleTextStyle: TextStyle( color: const Color(0xff333333), fontWeight: FontWeight.w400, @@ -93,8 +92,7 @@ class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { ), debugShowCheckedModeBanner: false, getPages: AppRouters.routePages, - initialRoute: '/' - ); + initialRoute: '/'); @override void initState() { @@ -117,15 +115,14 @@ class _MyAppState extends State with WidgetsBindingObserver, BaseWidget { print("应用进入后台"); } } - } // 设置国际化信息 Future _initTranslation() async => TranslationLoader.loadTranslation( - zhSource: "images/lan/lan_zh.json", - enSource: "images/lan/lan_en.json", - keySource: "images/lan/lan_keys.json", -); + zhSource: "images/lan/lan_zh.json", + enSource: "images/lan/lan_en.json", + keySource: "images/lan/lan_keys.json", + ); // 设置包名服务设备信息 Future _setCommonServices() async { diff --git a/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart b/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart index 2827c7ba..82073e45 100644 --- a/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart +++ b/star_lock/lib/mine/mineSet/authorizedAdministrator/authorizedAdministratorList_page.dart @@ -27,7 +27,7 @@ class _AuthorizedAdministratorListPageState backgroundColor: AppColors.mainColor, actionsList: [ IconButton( - icon: const Icon(Icons.add), + icon: Image.asset('images/icon_add_white.png'), onPressed: () { // 处理操作按钮的点击事件 Navigator.pushNamed(context, Routers.authorizedAdminManagePage); diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart new file mode 100644 index 00000000..6d22bf78 --- /dev/null +++ b/star_lock/lib/mine/mineSet/lockGroup/lockGroupList_page.dart @@ -0,0 +1,71 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class LockGroupListPage extends StatefulWidget { + const LockGroupListPage({Key? key}) : super(key: key); + + @override + State createState() => _LockGroupListPageState(); +} + +class _LockGroupListPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.basicInformation!.tr, + haveBack: true, + actionsList: [ + IconButton( + icon: Image.asset('images/icon_add_white.png'), + onPressed: () { + // 处理操作按钮的点击事件-添加锁分组 + }, + ), + ], + backgroundColor: AppColors.mainColor), + body: Column( + children: [ + Expanded(child: _buildMainUI()), + ], + ), + ); + } + + Widget _buildMainUI() { + return ListView.builder( + itemCount: 2, + itemBuilder: (c, index) { + if (index == 1) { + return Center( + child: SizedBox( + height: 40.h, + child: const Text( + '锁数量:1', + style: TextStyle( + color: AppColors.darkGrayTextColor, fontSize: 14), + ), + ), + ); + } else { + return CommonItem( + leftTitel: "未分组(1)", + rightTitle: "", + allHeight: 70.h, + isHaveLine: true, + action: () { + Navigator.pushNamed(context, Routers.lockItemListPage); + }); + } + }); + } +} diff --git a/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart b/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart new file mode 100644 index 00000000..9b87feec --- /dev/null +++ b/star_lock/lib/mine/mineSet/lockGroup/lockItemList_page.dart @@ -0,0 +1,66 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; + +class LockItemListPage extends StatefulWidget { + const LockItemListPage({Key? key}) : super(key: key); + + @override + State createState() => _LockItemListPageState(); +} + +class _LockItemListPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.basicInformation!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: ListView.builder( + itemBuilder: (context, index) { + return _listItemView(); + }, + itemCount: 2, + ), + ); + } + + Widget _listItemView() { + return GestureDetector( + child: Container( + color: Colors.white, + height: 70.h, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 20.w, + ), + Image.asset( + 'images/icon_lockGroup_item.png', + width: 30, + height: 30, + fit: BoxFit.fill, + ), + SizedBox( + width: 8.w, + ), + const Text( + 'Daisy', + style: TextStyle(fontSize: 14), + ) + ], + ), + ), + onTap: () {}, + ); + } +} diff --git a/star_lock/lib/mine/mineSet/lockUserManage/lockUserManageList_page.dart b/star_lock/lib/mine/mineSet/lockUserManage/lockUserManageList_page.dart index 0e1a2fb7..ce9cc138 100644 --- a/star_lock/lib/mine/mineSet/lockUserManage/lockUserManageList_page.dart +++ b/star_lock/lib/mine/mineSet/lockUserManage/lockUserManageList_page.dart @@ -23,7 +23,7 @@ class _LockUserManageListListPageState return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.authorizedAdmin!.tr, + barTitle: TranslationLoader.lanKeys!.lockUserManagement!.tr, haveBack: true, backgroundColor: AppColors.mainColor, actionsList: [ diff --git a/star_lock/lib/mine/mineSet/mineSet_page.dart b/star_lock/lib/mine/mineSet/mineSet_page.dart index 782a14e4..6310488f 100644 --- a/star_lock/lib/mine/mineSet/mineSet_page.dart +++ b/star_lock/lib/mine/mineSet/mineSet_page.dart @@ -81,14 +81,19 @@ class _MineSetPageState extends State { rightTitle: "", isHaveLine: true, isHaveDirection: true, - action: () {}), + action: () { + Navigator.pushNamed(context, Routers.lockGroupListPage); + }), CommonItem( leftTitel: TranslationLoader.lanKeys!.transferSmartLock!.tr, rightTitle: "", isHaveLine: true, isHaveDirection: true, - action: () {}), + action: () { + Navigator.pushNamed( + context, Routers.transferSmartLockPage); + }), CommonItem( leftTitel: TranslationLoader.lanKeys!.transferGateway!.tr, rightTitle: "", diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation_page.dart new file mode 100644 index 00000000..dc8129ea --- /dev/null +++ b/star_lock/lib/mine/mineSet/transferSmartLock/recipientInformation_page.dart @@ -0,0 +1,198 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class RecipientInformationPage extends StatefulWidget { + const RecipientInformationPage({Key? key}) : super(key: key); + + @override + State createState() => + _RecipientInformationPageState(); +} + +class _RecipientInformationPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.recipientInformation!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + ), + body: Column( + children: [ + SizedBox(height: 150.h, child: _buildMainUI()), + SizedBox( + height: 20.h, + ), + _buildAccoutRow(), + _buildBottomText(), + _buildNextBtn(), + Expanded( + child: SizedBox( + height: 64.h, + )), + _buildRemoveBadLockBtn(), + SizedBox( + height: 64.h, + ) + ], + ), + ); + } + + Widget _buildMainUI() { + return ListView.separated( + itemCount: 2, + separatorBuilder: (context, index) { + return Divider( + height: 1, + indent: 20.w, + endIndent: 20.w, + color: AppColors.greyLineColor, + ); + }, + itemBuilder: (c, index) { + if (index == 0) { + return _electronicKeyItem( + 'images/select_circle.png', "个人用户", () {}); + } else { + return _electronicKeyItem( + 'images/normal_circle.png', "好房管家", () {}); + } + }); + } + + Widget _electronicKeyItem( + String leftIcon, String leftTitle, Function() action) { + return GestureDetector( + child: Container( + color: Colors.white, + height: 70.h, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 40.w, + ), + GestureDetector( + child: Image.asset( + leftIcon, + width: 16, + height: 16, + ), + ), + SizedBox( + width: 16.w, + ), + Text( + leftTitle, + style: TextStyle(fontSize: 28.sp), + ) + ], + ), + ), + onTap: () {}, + ); + } + + Widget _buildAccoutRow() { + return Container( + height: 60.h, + color: Colors.white, + child: Row( + children: [ + SizedBox( + width: 40.w, + ), + Text( + '账号', + style: + TextStyle(color: AppColors.darkGrayTextColor, fontSize: 24.sp), + ), + Expanded( + child: TextField( + textAlign: TextAlign.right, + keyboardType: TextInputType.text, + onChanged: (value) {}, + decoration: InputDecoration( + border: InputBorder.none, + hintText: '请输入手机号或email', + hintStyle: TextStyle( + color: AppColors.placeholderTextColor, + fontSize: ScreenUtil().setSp(24), + textBaseline: TextBaseline.alphabetic), + ), + )), + SizedBox( + width: 20.w, + ), + Image.asset( + 'images/icon_addressBook.png', + width: 28.w, + height: 28.h, + ), + SizedBox( + width: 40.w, + ) + ], + ), + ); + } + + Widget _buildBottomText() { + return Padding( + padding: EdgeInsets.only(top: 20.h, bottom: 80.h), + child: Text( + '选中的智能锁将会转移到您输入的账号中,您将失去锁的管理权', + style: + TextStyle(fontSize: 20.sp, color: AppColors.placeholderTextColor), + textAlign: TextAlign.left, + ), + ); + } + + Widget _buildNextBtn() { + return GestureDetector( + child: Container( + color: Colors.grey, + width: ScreenUtil().screenWidth - 80.w, + height: 64.h, + child: TextButton( + onPressed: () { + Navigator.pushNamed(context, Routers.selectBranchPage); + }, + child: Text( + '下一步', + style: TextStyle(fontSize: 28.sp, color: Colors.white), + )), + ), + ); + } + + Widget _buildRemoveBadLockBtn() { + return Row( + children: [ + const Expanded(child: SizedBox()), + TextButton( + onPressed: () {}, + child: Text( + '移除坏锁', + style: TextStyle( + fontSize: 28.sp, color: AppColors.darkGrayTextColor), + textAlign: TextAlign.end, + )), + SizedBox( + width: 10.h, + ) + ], + ); + } +} diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch_page.dart new file mode 100644 index 00000000..e6d63755 --- /dev/null +++ b/star_lock/lib/mine/mineSet/transferSmartLock/selectBranch_page.dart @@ -0,0 +1,134 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class SelectBranchPage extends StatefulWidget { + const SelectBranchPage({Key? key}) : super(key: key); + + @override + State createState() => _SelectBranchPageState(); +} + +class _SelectBranchPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.recipientInformation!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + ), + body: Column( + children: [ + _buildTopView(), + SizedBox( + height: 20.h, + ), + Expanded(child: _buildMainUI()), + _buildNextBtn(), + SizedBox( + height: 64.h, + ) + ], + ), + ); + } + + Widget _buildTopView() { + return Container( + height: 120.h, + width: ScreenUtil().screenWidth, + color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(left: 40.w, top: 20.h, bottom: 16.h), + child: Text( + '公寓', + style: TextStyle(fontSize: 28.sp), + ), + ), + Padding( + padding: EdgeInsets.only(left: 40.w), + child: Text('管理员:18682150237', + style: TextStyle( + color: AppColors.darkGrayTextColor, fontSize: 24.sp)), + ) + ], + ), + ); + } + + Widget _buildMainUI() { + return ListView.separated( + itemCount: 5, + separatorBuilder: (context, index) { + return Divider( + height: 1, + indent: 20.w, + endIndent: 20.w, + color: AppColors.greyLineColor, + ); + }, + itemBuilder: (c, index) { + return _electronicKeyItem('images/select_circle.png', "分组一", () {}); + }); + } + + Widget _electronicKeyItem( + String leftIcon, String leftTitle, Function() action) { + return GestureDetector( + child: Container( + color: Colors.white, + height: 70.h, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 40.w, + ), + GestureDetector( + child: Image.asset( + leftIcon, + width: 16, + height: 16, + ), + ), + SizedBox( + width: 16.w, + ), + Text( + leftTitle, + style: TextStyle(fontSize: 28.sp), + ) + ], + ), + ), + onTap: () {}, + ); + } + + Widget _buildNextBtn() { + return GestureDetector( + child: Container( + color: AppColors.mainColor, + width: ScreenUtil().screenWidth, + height: 64.h, + child: TextButton( + onPressed: () {}, + child: Text( + '下一步', + style: TextStyle(fontSize: 28.sp, color: Colors.white), + )), + ), + ); + } +} diff --git a/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLock_page.dart b/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLock_page.dart new file mode 100644 index 00000000..0101074a --- /dev/null +++ b/star_lock/lib/mine/mineSet/transferSmartLock/transferSmartLock_page.dart @@ -0,0 +1,166 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../appRouters.dart'; +import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class TransferSmartLockPage extends StatefulWidget { + const TransferSmartLockPage({Key? key}) : super(key: key); + + @override + State createState() => _TransferSmartLockPageState(); +} + +class _TransferSmartLockPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.selectiveLock!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + onPressed: () {}, + child: Text( + '全选', + style: TextStyle(color: Colors.white, fontSize: 28.sp), + )) + ], + ), + body: Column( + children: [ + _searchWidget(), + SizedBox( + height: 10.h, + ), + Expanded(child: _buildMainUI()), + SizedBox( + height: 20.h, + ), + _buildNextBtn(), + SizedBox( + height: 64.h, + ) + ], + ), + ); + } + + Widget _searchWidget() { + return Container( + height: 60.h, + margin: EdgeInsets.only(top: 20.w, left: 20.w, right: 20.w), + decoration: BoxDecoration( + color: Colors.white, borderRadius: BorderRadius.circular(5)), + child: 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: TranslationLoader.lanKeys!.pleaseEnter!.tr, + //不需要输入框下划线 + border: InputBorder.none, + //左边图标设置 + icon: Padding( + padding: EdgeInsets.only( + top: 30.w, bottom: 20.w, right: 20.w, left: 20.w), + child: Image.asset( + 'images/main/icon_main_search.png', + width: 40.w, + height: 40.w, + ), + ), + ), + ), + ); + } + + Widget _buildMainUI() { + return ListView.separated( + itemCount: 10, + separatorBuilder: (context, index) { + return Divider( + height: 1, + indent: 20.w, + endIndent: 20.w, + color: AppColors.greyLineColor, + ); + }, + itemBuilder: (c, index) { + return _electronicKeyItem('images/icon_lock.png', "张三", + "2023.6.21 11.15", "2023.6.21 11.15", () { + Navigator.pushNamed(context, Routers.authorizedAdminDetailPage); + }); + }); + } + + Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, + String beginTime, String endTime, Function() action) { + return GestureDetector( + child: Container( + color: Colors.white, + height: 70.h, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SizedBox( + width: 20.w, + ), + GestureDetector( + child: Image.asset( + 'images/icon_round_unSelet.png', + width: 16, + height: 16, + ), + ), + SizedBox( + width: 16.w, + ), + Image.asset( + 'images/icon_lockGroup_item.png', + width: 30, + height: 30, + fit: BoxFit.fill, + ), + SizedBox( + width: 8.w, + ), + const Text( + 'Daisy', + style: TextStyle(fontSize: 14), + ) + ], + ), + ), + onTap: () {}, + ); + } + + Widget _buildNextBtn() { + return GestureDetector( + child: Container( + color: Colors.grey, + width: ScreenUtil().screenWidth, + height: 64.h, + child: TextButton( + onPressed: () { + Navigator.pushNamed(context, Routers.recipientInformationPage); + }, + child: Text( + '下一步', + style: TextStyle(fontSize: 28.sp, color: Colors.white), + )), + ), + ); + } +} diff --git a/star_lock/lib/translations/lanKeyEntity.dart b/star_lock/lib/translations/lanKeyEntity.dart index ddf9fac9..30d51c93 100644 --- a/star_lock/lib/translations/lanKeyEntity.dart +++ b/star_lock/lib/translations/lanKeyEntity.dart @@ -198,6 +198,8 @@ class LanKeyEntity { this.authorizedAdmin, this.lockGroup, this.transferSmartLock, + this.selectiveLock, + this.recipientInformation, this.transferGateway, this.multiLanguage, this.lockScreen, @@ -564,6 +566,8 @@ class LanKeyEntity { authorizedAdmin = json['authorizedAdmin']; lockGroup = json['lockGroup']; transferSmartLock = json['transferSmartLock']; + selectiveLock = json['selectiveLock']; + recipientInformation = json['recipientInformation']; transferGateway = json['transferGateway']; multiLanguage = json['multiLanguage']; @@ -946,6 +950,8 @@ class LanKeyEntity { String? authorizedAdmin; String? lockGroup; String? transferSmartLock; + String? selectiveLock; + String? recipientInformation; String? transferGateway; String? multiLanguage; @@ -1324,6 +1330,8 @@ class LanKeyEntity { map['authorizedAdmin'] = authorizedAdmin; map['lockGroup'] = lockGroup; map['transferSmartLock'] = transferSmartLock; + map['selectiveLock'] = selectiveLock; + map['recipientInformation'] = recipientInformation; map['transferGateway'] = transferGateway; map['multiLanguage'] = multiLanguage;