From 5900cfc6726ff2ab86e054ca079e04efe88093ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Tue, 11 Jul 2023 18:37:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=80=83=E5=8B=A4=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E9=83=A8=E5=88=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/images/icon_add_white.png | Bin 0 -> 421 bytes star_lock/images/lan/lan_en.json | 10 +- star_lock/images/lan/lan_keys.json | 9 + star_lock/images/lan/lan_zh.json | 9 + .../main/icon_lockDetail_checkIn_set.png | Bin 0 -> 1837 bytes .../main/icon_lockDetail_checkIn_topTitle.png | Bin 0 -> 3658 bytes star_lock/lib/appRouters.dart | 36 ++++ .../checkingInList/checkingInList_page.dart | 132 ++++++++++++++ .../checkingInSet/checkingInSet_page.dart | 68 +++++++ .../checkingInAddStaff_page.dart | 129 +++++++++++++ .../checkingInStaffManage_page.dart | 78 ++++++++ .../checkingInSetWorkTime_page.dart | 77 ++++++++ .../checkingInSetWorkdaySet_page.dart | 171 ++++++++++++++++++ .../electronicKeyDetail_page.dart | 73 +------- .../electronicKeyDetailChangeDate_page.dart | 51 +----- .../lockDetail/lockDetail_page.dart | 4 +- star_lock/lib/tools/showSeletDateTime.dart | 67 +++++++ star_lock/lib/tools/showTFView.dart | 86 +++++++++ star_lock/lib/tools/titleAppBar.dart | 6 +- star_lock/lib/translations/lanKeyEntity.dart | 38 +++- 20 files changed, 926 insertions(+), 118 deletions(-) create mode 100644 star_lock/images/icon_add_white.png create mode 100644 star_lock/images/main/icon_lockDetail_checkIn_set.png create mode 100644 star_lock/images/main/icon_lockDetail_checkIn_topTitle.png create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffManage/checkingInStaffManage_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart create mode 100644 star_lock/lib/tools/showSeletDateTime.dart create mode 100644 star_lock/lib/tools/showTFView.dart diff --git a/star_lock/images/icon_add_white.png b/star_lock/images/icon_add_white.png new file mode 100644 index 0000000000000000000000000000000000000000..d355806f1e3b58752558688995f9a097d14b0ff4 GIT binary patch literal 421 zcmV;W0b2fvP)q4ukWh~q4*vM{}mjx zn_R2npRp~Swde}~T0Aw&oMC_^nl1W*0WF@IWzI0b63rHU!GIP|%`)c)6nm~gxH=lf P00000NkvXXu0mjff0C{Q literal 0 HcmV?d00001 diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index d2c03c74..b1e773e2 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -68,12 +68,20 @@ "amend":"Amend", "sure":"Sure", "cancel":"Cancel", - "add":"Add", "accountNumber":"AccountNumber", "volumeAuthorizationLock":"Volume Authorization Lock", "authorizedAdminTip":"The authorized administrator has important access to this lock, so make sure you only send it to people you trust", "lockOperatingRecordTip":"The historical records can be retained only for a certain period of time. If you want to retain historical records, export them in the upper right corner", + "rankingList":"Ranking List", + "earlyArrivalList":"Early Arrival List", + "lateList":"Late List", + "hardWorkingList":"Hard Working List", + "company":"Company", + "staff":"Staff", + "work":"Work", + "workday":"Workday", + "holidays":"Holidays", "basicInformation":"Basic Information", "wirelessKeyboard":"Wireless Keyboard", diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index a3ca2ae2..92a56b4c 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -73,6 +73,15 @@ "volumeAuthorizationLock":"volumeAuthorizationLock", "authorizedAdminTip":"authorizedAdminTip", "lockOperatingRecordTip":"lockOperatingRecordTip", + "rankingList":"rankingList", + "earlyArrivalList":"earlyArrivalList", + "lateList":"lateList", + "hardWorkingList":"hardWorkingList", + "company":"company", + "staff":"staff", + "work":"work", + "workday":"workday", + "holidays":"holidays", "basicInformation":"basicInformation", "wirelessKeyboard":"wirelessKeyboard", diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index 6fd56a6d..3f91ecc8 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -73,6 +73,15 @@ "volumeAuthorizationLock":"批量授权锁", "authorizedAdminTip":"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人", "lockOperatingRecordTip":"只能保留一定时间内的记录,如果您需要保留历史记录,可以在右上角导出", + "rankingList":"排列榜", + "earlyArrivalList":"早到榜", + "lateList":"迟到榜", + "hardWorkingList":"勤奋榜", + "company":"公司", + "staff":"员工", + "work":"工作", + "workday":"工作日", + "holidays":"节假日", "basicInformation":"基本信息", "wirelessKeyboard":"无线键盘", diff --git a/star_lock/images/main/icon_lockDetail_checkIn_set.png b/star_lock/images/main/icon_lockDetail_checkIn_set.png new file mode 100644 index 0000000000000000000000000000000000000000..7b0aa399b14806c4986b08d079d5e8dd7bc2a628 GIT binary patch literal 1837 zcmV+|2h#Y7P)DgsDY_wG_O4961&ztVoU*pckD}Oq#eE%D30M;7NG6HvZcfE&)hZ8Jwl)2RS z@$vC&Z*Omw`CiuWR!!jg`uZ)T`O@ih_Oqmt!2saL*4Ea+_V)Io&ij^kS_R%5nBia29|&!-qq`I3(b0Qz&- z;8$%n`f36Je|!z`O+8eHQp`2u--;N#Eb!pI}aIx*L$| zz!F4R0bnrGGYC)gRe^HsSmBQn5TP|Z`DW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H=^1ezD8E bdJXswMQ9F;5M=5l00000NkvXXu0mjfzzJE# literal 0 HcmV?d00001 diff --git a/star_lock/images/main/icon_lockDetail_checkIn_topTitle.png b/star_lock/images/main/icon_lockDetail_checkIn_topTitle.png new file mode 100644 index 0000000000000000000000000000000000000000..fc148b62620f434013d4345b94ebc3d61dc29b2c GIT binary patch literal 3658 zcmV-Q4z=-#P)o~e0U(=kB~m#6 z8k69-?JT)OiAx|h$W2ZRfp|IOp$y6@AFBwym@gG_=@C*+5j}#Fm&c)dx_i>&rTJMx z(Pymwf1f;&Vpun96j^RkH0<4>{bf8(s1o}@e2~itOM;jQac_YzH5TGv08l%Ld_p3` zQ4sSKxhX7&T_LW|l7^>190>6pfg)0g#{qzu6bq8mAU1NoLU$5 zC07=b0kIRrEdoAU88bVGA4~HSl|0S>;4~gTGz?;B2hJ4A*~x>rTvm`2rnVEmUMvWS zRqG;9ayU`(5IaEZz!ya%s^=lZNaXR#IpH^oV$ccbKn8@MK!vga2jsyTQ$ZV)aVXdh~*BTfL{X83+V!g zCV~#tNFlT^5B4E&Q~_z(5RcTNmXB9itG0nYXn)V3mVA{hoME{SwuL~t7!<=1*^qCz zG0wop!sd_1-~l*8B_)L%MZirpK3+98r1gX6O5b{hwa$dLj`V)yiVdyeDJUg}-y-Ot zcyN7W(3-bUCU;Q!FMcjJQ#eT^RZA1t(`wZtrPAp_?xkgYttCfI0R6_2lji|_uTIms zVH@e~c;l37l-81ei0Y@deH_)ek$I!aB;F@^19cIu5-t-S5Uv9{?0+V-6S^U~OSlJr zw}r{6(=ZVnL}ZV?U#pv7ND( z@tpDCL;M&w8NV{x8CxOc3APG5j2*+8ux6|c(BW4zb_#1!p}p8q_&e}7J0kltJ3^UZ z+`%27q{;_#aO7SY=`(9YG?e^9Ynbyl`8_g+lxz9lSu}ErjT(`6>WGO3Gf4PRJy2Vm4yi+#CRSA=4&+pF za0dPTtB>@Lyi|H79GM#k73PL;L=E{|?V^9Q*HWOY5X@4^%T(1ttdf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-XVPcye_!(4^!d&| z#{JRKAK(ArMc#{nmldx}U+sF$eBJsc?aiZsS#L>i*Zn#A&*pd0@9w?Nd;k952@m*U zPUK>R0000uWmrjOO-%qQ0000800D<-00aO40096102%-Q00002paK8{000010000U zpaTE|000010000G00000R=KNQ0002JNkl5R3EfRuI6o%o;;1DPz8qrE7Yj*=| zK-Z!hkPYYpSb*JXHIhga0y7M+aF}uY;R2WMlr!_4rya$Kr8z1rl0`bfQc7WSHRa6( zyQN)lNR4=k)61T_+-CC|?g#BwJnpmj9q)$<_jye62mSyR9yHG}-nM~;3SX0HdB%E# z3J=K#c}_S%g+~;BydauEg>NXoc*%Aq6~3c-^NO7T6&_OyuZaz*@I6gC2R&WsD=X=K c$vW#VUMbr9f>n^o*8l(j07*qoM6N<$f-D>J5&!@I literal 0 HcmV?d00001 diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index 8b66f312..2c83e4be 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -6,6 +6,12 @@ import 'login/forgetPassword/starLock_forgetPassword_page.dart'; import 'login/login/starLock_login_page.dart'; import 'login/register/starLock_register_page.dart'; import 'login/seletCountryRegion/seletCountryRegion_page.dart'; +import 'main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart'; +import 'main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart'; +import 'main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart'; +import 'main/lockDetail/checkingIn/checkingInSetStaffManage/checkingInStaffManage_page.dart'; +import 'main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart'; +import 'main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart'; import 'main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart'; import 'main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart'; import 'main/lockDetail/lcokSet/basicInformation/basicInformation/basicInformation_page.dart'; @@ -115,6 +121,12 @@ abstract class Routers { static const importOtherLockDataPage = '/ImportOtherLockDataPage';// 导入其他锁数据 static const lockEscalationPage = '/LockEscalationPage';// 锁升级 static const markedHouseStatePage = '/MarkedHouseStatePage';// 标记房态 + static const checkingInListPage = '/CheckingInListPage';// 考勤 + static const checkingInSetPage = '/CheckingInSetPage';// 考勤设置 + static const checkingInStaffManagePage = '/CheckingInStaffManagePage';// 员工管理 + static const checkingInAddStaffPage = '/CheckingInAddStaffPage';// 添加员工 + static const checkingInSetWorkTimePage = '/CheckingInSetWorkTimePage';// 工作时间设置 + static const checkingInSetWorkdaySet = '/CheckingInSetWorkdaySet';// 工作日设置 static const mineSetPage = '/MineSetPage';// 我的设置 static const mineMultiLanguagePage = '/MineMultiLanguagePage';// 我的设置 @@ -363,5 +375,29 @@ abstract class AppRouters { name: Routers.markedHouseStatePage, page: () => const MarkedHouseStatePage(), ), + GetPage( + name: Routers.checkingInListPage, + page: () => const CheckingInListPage(), + ), + GetPage( + name: Routers.checkingInSetPage, + page: () => const CheckingInSetPage(), + ), + GetPage( + name: Routers.checkingInStaffManagePage, + page: () => const CheckingInStaffManagePage(), + ), + GetPage( + name: Routers.checkingInAddStaffPage, + page: () => const CheckingInAddStaffPage(), + ), + GetPage( + name: Routers.checkingInSetWorkTimePage, + page: () => const CheckingInSetWorkTimePage(), + ), + GetPage( + name: Routers.checkingInSetWorkdaySet, + page: () => const CheckingInSetWorkdaySet(), + ), ]; } \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart new file mode 100644 index 00000000..7739a719 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart @@ -0,0 +1,132 @@ + +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/showBottomSheetTool.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class CheckingInListPage extends StatefulWidget { + const CheckingInListPage({Key key}) : super(key: key); + + @override + State createState() => _CheckingInListPageState(); +} + +class _CheckingInListPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(haveTitleWidget: true, titleWidget:titleWidget(), haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + GestureDetector( + onTap: (){ + Navigator.pushNamed(context, Routers.checkingInSetPage); + }, + child: Image.asset('images/main/icon_lockDetail_checkIn_set.png', width: 50.w, height: 50.w,) + ), + SizedBox(width: 30.w,), + ], + ), + body: ListView.builder( + itemCount:10, + itemBuilder: (c, index){ + return _checkingInListItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + // Navigator.pushNamed(context, Routers.electronicKeyDetailPage); + }); + } + ) + ); + } + + Widget _checkingInListItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 100.h, + margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10.w), + ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Image.asset(lockTypeIcon, width: 50.w, height: 50.w,), + SizedBox(width: 30.w,), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + // color: Colors.red, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + SizedBox(width:20.w), + Text("待接收", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.w), + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text("2023.6.21 11.15-2023.6.21 11.15", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + SizedBox(width:20.h), + ], + ), + ), + ); + } + + Widget titleWidget(){ + return GestureDetector( + onTap: (){ + showListType(); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(TranslationLoader.lanKeys.earlyArrivalList.tr, style: const TextStyle(color: Colors.white),), + SizedBox(width: 5.w,), + Image.asset('images/main/icon_lockDetail_checkIn_topTitle.png', width: 30.w, height: 16.w,) + ], + ), + ); + } + + Widget showListType(){ + var list = [TranslationLoader.lanKeys.earlyArrivalList.tr, TranslationLoader.lanKeys.lateList.tr, TranslationLoader.lanKeys.hardWorkingList.tr]; + ShowBottomSheetTool().showSingleRowPicker( + //上下文 + context, + //默认的索引 + normalIndex: 0, + title: TranslationLoader.lanKeys.rankingList.tr, + cancelTitle: TranslationLoader.lanKeys.cancel.tr, + sureTitle: TranslationLoader.lanKeys.sure.tr, + //要显示的列表 + //可自定义数据适配器 + //adapter: PickerAdapter(), + data: list, + //选择事件的回调 + clickCallBack: (int index, var str) { + + } + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart new file mode 100644 index 00000000..7c84039a --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart @@ -0,0 +1,68 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/app_settings/app_colors.dart'; + +import '../../../../appRouters.dart'; +import '../../../../tools/commonItem.dart'; +import '../../../../tools/showTFView.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class CheckingInSetPage extends StatefulWidget { + const CheckingInSetPage({Key key}) : super(key: key); + + @override + State createState() => _CheckingInSetPageState(); +} + +class _CheckingInSetPageState extends State { + TextEditingController _changeNameController; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.checkingIn.tr} ${TranslationLoader.lanKeys.set.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + CommonItem(leftTitel:"${TranslationLoader.lanKeys.company.tr} ${TranslationLoader.lanKeys.name.tr}", rightTitle:"深圳市志超科技", isHaveLine: true, isHaveDirection: true, action: (){ + showCupertinoAlertDialog(context); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.staff.tr, rightTitle:"0", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.checkingInStaffManagePage); + }), + CommonItem(leftTitel:"${TranslationLoader.lanKeys.work.tr} ${TranslationLoader.lanKeys.time.tr}", rightTitle:"9:00 - 18:00", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.checkingInSetWorkTimePage); + }), + CommonItem(leftTitel:"${TranslationLoader.lanKeys.workday.tr} ${TranslationLoader.lanKeys.set.tr}", rightTitle:"1,2,3,4,5", isHaveLine: true, isHaveDirection: true, action: (){ + Navigator.pushNamed(context, Routers.checkingInSetWorkdaySet); + }), + CommonItem(leftTitel:TranslationLoader.lanKeys.holidays.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ + // Navigator.pushNamed(context, Routers.lockEscalationPage); + }), + SizedBox(height: 30.h,), + SubmitBtn(btnName: "${TranslationLoader.lanKeys.delete.tr} ${TranslationLoader.lanKeys.company.tr}", + borderRadius: 20.w, + fontSize: 32.sp, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ), + ); + } + + void showCupertinoAlertDialog(BuildContext context) { + showDialog( + context: context, + builder: (BuildContext context) { + return ShowTFView(title:"${TranslationLoader.lanKeys.amend.tr} ${TranslationLoader.lanKeys.name.tr}", tipTitle:"", controller: _changeNameController); + }); + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart new file mode 100644 index 00000000..820f2811 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart @@ -0,0 +1,129 @@ + +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/showBottomSheetTool.dart'; +import '../../../../tools/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class CheckingInAddStaffPage extends StatefulWidget { + const CheckingInAddStaffPage({Key key}) : super(key: key); + + @override + State createState() => _CheckingInAddStaffPageState(); +} + +class _CheckingInAddStaffPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle:"${TranslationLoader.lanKeys.add.tr} ${TranslationLoader.lanKeys.staff.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body: Column( + children: [ + CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget(TranslationLoader.lanKeys.pleaseEnter.tr)), + CommonItem(leftTitel:"打卡方式", rightTitle:"APP", isHaveLine: false, isHaveDirection: true, action: (){ + _showSeletClockInType(); + }), + SizedBox(height: 10.h,), + CommonItem(leftTitel:"员工是否有钥匙", rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: Row( + children: [ + whetherTheEmployeeHasAKeyWidget("有", (){ + + }), + SizedBox(width: 30.w,), + whetherTheEmployeeHasAKeyWidget("无", (){ + + }), + ], + )), + Visibility( + visible:true, + child: CommonItem(leftTitel:"账号", rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget("请输入员工账号")), + ), + Visibility( + visible:true, + child: CommonItem(leftTitel:"选择钥匙", rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){ + _showSeletClockInType(); + }), + ), + SizedBox(height: 50.w,), + SubmitBtn(btnName: TranslationLoader.lanKeys.sure.tr, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: (){ + + } + ), + ], + ), + ); + } + + Widget getTFWidget(String tfStr){ + return Container( + height: 50.h, + width: 500.w, + child: Row( + children: [ + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + // controller: _controller, + autofocus: false, + textAlign:TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + SizedBox(width: 10.w,), + ], + ), + ); + } + + Widget _showSeletClockInType(){ + var list = ["15080825640",]; + ShowBottomSheetTool().showSingleRowPicker( + //上下文 + context, + //默认的索引 + normalIndex: 0, + title: "选择钥匙", + cancelTitle: TranslationLoader.lanKeys.cancel.tr, + sureTitle: TranslationLoader.lanKeys.sure.tr, + //要显示的列表 + //可自定义数据适配器 + //adapter: PickerAdapter(), + data: list, + //选择事件的回调 + clickCallBack: (int index, var str) { + + } + ); + } + + Widget whetherTheEmployeeHasAKeyWidget(String title, Function action){ + return GestureDetector( + onTap: (){ + + }, + child: Row( + children: [ + Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,), + SizedBox(width: 5.w,), + Text(title), + ], + ), + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffManage/checkingInStaffManage_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffManage/checkingInStaffManage_page.dart new file mode 100644 index 00000000..10dda49e --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffManage/checkingInStaffManage_page.dart @@ -0,0 +1,78 @@ + +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 CheckingInStaffManagePage extends StatefulWidget { + const CheckingInStaffManagePage({Key key}) : super(key: key); + + @override + State createState() => _CheckingInStaffManagePageState(); +} + +class _CheckingInStaffManagePageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: Colors.white, + appBar: TitleAppBar(barTitle: TranslationLoader.lanKeys.staff.tr, haveBack:true, backgroundColor: AppColors.mainColor, actionsList: [ + GestureDetector( + onTap: (){ + Navigator.pushNamed(context, Routers.checkingInAddStaffPage); + }, + child: Image.asset('images/icon_add_white.png', width: 50.w, height: 50.w,) + ), + SizedBox(width: 30.w,), + ], + ), + body: ListView.separated( + itemCount:10, + itemBuilder: (c, index){ + return _checkingInStaffManageItem('images/icon_lock.png', "张三", "2023.6.21 11.15", "2023.6.21 11.15",(){ + // Navigator.pushNamed(context, Routers.electronicKeyDetailPage); + }); + }, + separatorBuilder: (context, index) { + return const Divider(height:1, indent: 20, color: Colors.grey); + }, + ) + ); + } + + Widget _checkingInStaffManageItem(String lockTypeIcon, String lockTypeTitle, String beginTime, String endTime, Function action){ + return GestureDetector( + onTap: action, + child: Container( + height: 70.h, + margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 10.h, bottom: 10.h), + // decoration: BoxDecoration( + // color: Colors.white, + // borderRadius: BorderRadius.circular(10.w), + // ), + child: Row( + children: [ + SizedBox(width: 30.w,), + Container( + width: 60.h, height: 60.h, + decoration: BoxDecoration( + color: AppColors.mainColor, + border: Border.all(width: 1, color: AppColors.mainColor), + borderRadius: BorderRadius.circular(30.h), + ), + padding: EdgeInsets.all(10.w), + child: Image.asset('images/mine/icon_mine_main_defaultAvatar.png', width: 40.w, height: 40.w, color: Colors.white,) + ), + SizedBox(width: 30.w,), + Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ), + ], + ), + ), + ); + } + +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart new file mode 100644 index 00000000..0b9bd7b5 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart @@ -0,0 +1,77 @@ +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/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class CheckingInSetWorkTimePage extends StatefulWidget { + const CheckingInSetWorkTimePage({Key key}) : super(key: key); + + @override + State createState() => _CheckingInSetWorkTimePageState(); +} + +class _CheckingInSetWorkTimePageState extends State { + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.work.tr} ${TranslationLoader.lanKeys.time.tr} ${TranslationLoader.lanKeys.set.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body: buildMainUI(), + ); + } + + Widget buildMainUI(){ + return Column( + children: [ + CommonItem(leftTitel:"上班时间", rightTitle:"11:49", isHaveDirection: true, isHaveLine: true, action:(){ + // ShowSeletDateTime().showDatePicker(context, '2100-01-01 00:00', '1900-01-01 00:00', getNowDate(),'yyyy-MMMM-dd HH:mm', (dateTime, List index) { + // + // }); + }), + CommonItem(leftTitel:"下班时间", rightTitle:"11:49", isHaveDirection: true, action:(){ + // ShowSeletDateTime().showDatePicker(context, '00:00', '00:00', getNowDate(),'HH:mm', (dateTime, List index) { + // + // }); + }), + SizedBox(height: 30.h,), + SubmitBtn(btnName: TranslationLoader.lanKeys.sure.tr, + borderRadius: 20.w, + fontSize: 32.sp, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ); + } + + String getNowDate(){ + // 获取当前时间对象 + DateTime today = DateTime.now(); + String dateSlug ="${today.hour.toString().padLeft(2,'0')}:${today.minute.toString().padLeft(2,'0')}"; + + // //获取当前时间的年 + // int year = now.year; + // //获取当前时间的月 + // int month = now.month; + // //获取当前时间的日 + // int day = now.day; + // //获取当前时间的时 + // int hour = now.hour; + // //获取当前时间的分 + // int minute = now.minute; + // //获取当前时间的秒 + // int millisecond = now.millisecond; + + // print("组合 $year-$month-$day $hour:$minute:$millisecond"); + return dateSlug; + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart new file mode 100644 index 00000000..8d9db141 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart @@ -0,0 +1,171 @@ + +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/submitBtn.dart'; +import '../../../../tools/titleAppBar.dart'; +import '../../../../translations/trans_lib.dart'; + +class CheckingInSetWorkdaySet extends StatefulWidget { + const CheckingInSetWorkdaySet({Key key}) : super(key: key); + + @override + State createState() => _CheckingInSetWorkdaySetState(); +} + +class _CheckingInSetWorkdaySetState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar(barTitle: "${TranslationLoader.lanKeys.workday.tr} ${TranslationLoader.lanKeys.set.tr}", haveBack:true, backgroundColor: AppColors.mainColor), + body: ListView( + children: [ + topBtnWidget(), + Visibility( + visible:false, + child: bottomCustomSeletBtn() + ), + Visibility( + visible:true, + child: bottomOddOrEvenDaysOffSeletBtn() + ), + SizedBox(height: 50.h,), + SubmitBtn(btnName:TranslationLoader.lanKeys.sure.tr, + borderRadius: 20.w, + fontSize: 32.sp, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), + padding: EdgeInsets.only(top: 20.w, bottom: 20.w), + onClick: () { + + } + ), + ], + ),); + } + + Widget topBtnWidget(){ + return Container( + width: 1.sw, + height: 120.h, + // color: Colors.red, + padding: EdgeInsets.all(10.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + width: (1.sw - 5.w*2)/2, + height: 120.h, + color: AppColors.mainColor, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center(child: Text("自定义", style: TextStyle(fontSize: 32.sp, color: Colors.white))), + ], + ), + ), + // SizedBox(width: 10.w,), + Container( + width: (1.sw - 10*3)/2, + height: 120.h, + color: Colors.grey, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Center(child: Text("单双休", style: TextStyle(fontSize: 32.sp, color: Colors.white))), + ], + ), + ), + ], + ), + ); + } + + Widget bottomOddOrEvenDaysOffSeletBtn(){ + return Container( + padding: EdgeInsets.only(left:10.w, right: 10.w), + child: Column( + children: [ + CommonItem(leftTitel:"本周", rightTitle:"", allHeight:70.h, isHaveLine: true), + CommonItem(leftTitel:"单休", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:"双休", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + + ], + ), + ); + } + + Widget bottomCustomSeletBtn(){ + return Container( + padding: EdgeInsets.only(left:10.w, right: 10.w), + child: Column( + children: [ + CommonItem(leftTitel:"星期一", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:"星期二", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:"星期三", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:"星期四", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:"星期五", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:"星期六", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + CommonItem(leftTitel:"星期日", rightTitle:"", allHeight:70.h, isHaveLine: false, isHaveRightWidget: true, + rightWidget: GestureDetector( + onTap: (){ + + }, + child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),) + ), + ], + ), + ); + } +} 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 7db1eb95..4c429aa9 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 @@ -6,6 +6,7 @@ import 'package:get/get.dart'; import '../../../../../appRouters.dart'; import '../../../../../app_settings/app_colors.dart'; import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/showTFView.dart'; import '../../../../../tools/submitBtn.dart'; import '../../../../../tools/titleAppBar.dart'; import '../../../../../translations/trans_lib.dart'; @@ -18,6 +19,8 @@ class ElectronicKeyDetailPage extends StatefulWidget { } class _ElectronicKeyDetailPageState extends State { + TextEditingController _changeNameController; + @override Widget build(BuildContext context) { return Scaffold( @@ -113,78 +116,10 @@ class _ElectronicKeyDetailPageState extends State { } void showCupertinoAlertDialog(BuildContext context) { - showDialog( context: context, builder: (BuildContext context) { - return Card( - color: const Color(0x00FFFFFF), - child: CupertinoAlertDialog( - title: const Text("修改密码"), - content: Column( - children: [ - const SizedBox(height: 10,), - Container( - height: 50.h, - // color: Colors.white, - // padding: EdgeInsets.only(left:20.w, right: 110.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15.w) - ), - child: TextField( - //输入框一行 - maxLines: 1, - // controller: _controller, - autofocus: false, - decoration: InputDecoration( - //输入里面输入文字内边距设置 - contentPadding: EdgeInsets.only(top: 20.h, left: 15.0, bottom: 13.h), - hintText: "请输入要修改的名字", - hintStyle:TextStyle(fontSize: 28.sp), - //不需要输入框下划线 - 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,), - // ), - // //右边图标设置 - // suffixIcon: GestureDetector( - // onTap: () { - // //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次 - // // SchedulerBinding.instance.addPostFrameCallback((_) { - // // _controller.text = ""; - // // }); - // }, - // child: Padding( - // padding: EdgeInsets.all(8), - // child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), - // ), - // ) - ), - ), - ) - ], - ), - actions: [ - CupertinoDialogAction( - child: Text("取消"), - onPressed: () { - Navigator.pop(context); - print("取消"); - }, - ), - CupertinoDialogAction( - child: Text("确定"), - onPressed: () { - Navigator.pop(context); - print("确定"); - }, - ), - ], - ), - ); + return ShowTFView(title:"${TranslationLoader.lanKeys.amend.tr} ${TranslationLoader.lanKeys.name.tr}", tipTitle:"", controller: _changeNameController); }); } diff --git a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart index 7bcfcd49..80a77cb4 100644 --- a/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart +++ b/star_lock/lib/main/lockDetail/electronicKey/electronicKeyDetail/electronicKeyDetailChangeDate/electronicKeyDetailChangeDate_page.dart @@ -5,6 +5,7 @@ import 'package:get/get.dart'; import '../../../../../app_settings/app_colors.dart'; import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/showSeletDateTime.dart'; import '../../../../../tools/titleAppBar.dart'; import '../../../../../translations/trans_lib.dart'; @@ -34,59 +35,23 @@ class _ElectronicKeyDetailChangeDateState extends State index) { + + }); }), CommonItem(leftTitel:TranslationLoader.lanKeys.failureTime.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, action:(){ - _showDatePicker(); + ShowSeletDateTime().showDatePicker(context, '00:00', '00:00', getNowDate(),'HH:mm', (dateTime, List index) { + + }); }), ], ); } - void _showDatePicker() { - String MIN_DATETIME = '1900-01-01 00:00'; - String MAX_DATETIME = '2100-01-01 00:00'; - String INIT_DATETIME = getNowDate(); - DateTime _dateTime = DateTime.parse(INIT_DATETIME); - DateTimePickerLocale _locale = DateTimePickerLocale.zh_cn; - String _format = 'yyyy-MMMM-dd HH:mm'; - - DatePicker.showDatePicker( - context, - onMonthChangeStartWithFirstDate: true, - pickerTheme:const DateTimePickerTheme( - cancel: Text('取消', style: TextStyle(color: Colors.black)), - showTitle: true, - confirm: Text('确认', style: TextStyle(color: Colors.black)), - ), - minDateTime: DateTime.parse(MIN_DATETIME), - maxDateTime: DateTime.parse(MAX_DATETIME), - initialDateTime: _dateTime, - dateFormat: _format, - locale: _locale, - onClose: () { - - }, - onCancel: () { - - }, - onChange: (dateTime, List index) { - setState(() { - _dateTime = dateTime; - }); - }, - onConfirm: (dateTime, List index) { - setState(() { - _dateTime = dateTime; - }); - }, - ); - } - String getNowDate(){ // 获取当前时间对象 DateTime today = DateTime.now(); - String dateSlug ="${today.year.toString()}-${today.month.toString().padLeft(2,'0')}-${today.day.toString().padLeft(2,'0')} ${today.hour.toString().padLeft(2,'0')}:${today.minute.toString().padLeft(2,'0')}"; + String dateSlug ="${today.hour.toString().padLeft(2,'0')}:${today.minute.toString().padLeft(2,'0')}"; // //获取当前时间的年 // int year = now.year; diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index eed584dc..f5bf3551 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -70,7 +70,7 @@ class _LockDetailPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text(TranslationLoader.lanKeys.clickUnlockAndHoldDownClose.tr,style: TextStyle(fontSize: 28.sp, color: const Color(0xFFB3B3B3), fontWeight: FontWeight.w500),), + Text(TranslationLoader.lanKeys.clickUnlockAndHoldDownClose.tr, style: TextStyle(fontSize: 28.sp, color: const Color(0xFFB3B3B3), fontWeight: FontWeight.w500),), ], ), SizedBox(height: 40.h,), @@ -92,7 +92,7 @@ class _LockDetailPageState extends State { physics: const NeverScrollableScrollPhysics(), children: [ bottomItem('images/main/icon_main_clockingIn.png', TranslationLoader.lanKeys.checkingIn.tr, (){ - + Navigator.pushNamed(context, Routers.checkingInListPage); }), bottomItem('images/main/icon_main_electronicKey.png', TranslationLoader.lanKeys.electronicKey.tr, (){ Navigator.pushNamed(context, Routers.electronicKeyListPage); diff --git a/star_lock/lib/tools/showSeletDateTime.dart b/star_lock/lib/tools/showSeletDateTime.dart new file mode 100644 index 00000000..f47b2c20 --- /dev/null +++ b/star_lock/lib/tools/showSeletDateTime.dart @@ -0,0 +1,67 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_cupertino_datetime_picker/flutter_cupertino_datetime_picker.dart'; +import 'package:get/get.dart'; + +import '../translations/trans_lib.dart'; + +typedef DateValueCallback(DateTime dateTime, List selectedIndex); + +class ShowSeletDateTime { + + void showDatePicker(BuildContext context, String maxT, String minT, String nowDate, String formatStr, DateValueCallback onConfirm,) { + // String MIN_DATETIME = '1900-01-01 00:00'; + // String MAX_DATETIME = '2100-01-01 00:00'; + // String INIT_DATETIME = getNowDate(); + DateTime _dateTime = DateTime.parse(nowDate); + DateTimePickerLocale _locale = DateTimePickerLocale.zh_cn; + String _format = formatStr; + + DatePicker.showDatePicker( + context, + onMonthChangeStartWithFirstDate: true, + pickerTheme: DateTimePickerTheme( + cancel: Text(TranslationLoader.lanKeys.cancel.tr, style: const TextStyle(color: Colors.black)), + showTitle: true, + confirm: Text(TranslationLoader.lanKeys.sure.tr, style: const TextStyle(color: Colors.black)), + ), + minDateTime: DateTime.parse(minT), + maxDateTime: DateTime.parse(maxT), + initialDateTime: _dateTime, + dateFormat: _format, + locale: _locale, + onClose: () { + + }, + onCancel: () { + + }, + onChange: (dateTime, List index) { + + }, + onConfirm: onConfirm, + ); + } + + // String getNowDate(){ + // // 获取当前时间对象 + // DateTime today = DateTime.now(); + // String dateSlug ="${today.year.toString()}-${today.month.toString().padLeft(2,'0')}-${today.day.toString().padLeft(2,'0')} ${today.hour.toString().padLeft(2,'0')}:${today.minute.toString().padLeft(2,'0')}"; + // + // // //获取当前时间的年 + // // int year = now.year; + // // //获取当前时间的月 + // // int month = now.month; + // // //获取当前时间的日 + // // int day = now.day; + // // //获取当前时间的时 + // // int hour = now.hour; + // // //获取当前时间的分 + // // int minute = now.minute; + // // //获取当前时间的秒 + // // int millisecond = now.millisecond; + // + // // print("组合 $year-$month-$day $hour:$minute:$millisecond"); + // return dateSlug; + // } +} diff --git a/star_lock/lib/tools/showTFView.dart b/star_lock/lib/tools/showTFView.dart new file mode 100644 index 00000000..9bcc2d92 --- /dev/null +++ b/star_lock/lib/tools/showTFView.dart @@ -0,0 +1,86 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../translations/trans_lib.dart'; + +class ShowTFView extends StatelessWidget { + String title; + String tipTitle; + TextEditingController controller; + + ShowTFView({Key key, this.title, this.tipTitle, this.controller}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Card( + color: const Color(0x00FFFFFF), + child: CupertinoAlertDialog( + title: Text(title), + content: Column( + children: [ + const SizedBox(height: 10,), + Container( + height: 50.h, + // color: Colors.white, + // padding: EdgeInsets.only(left:20.w, right: 110.w), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15.w) + ), + child: TextField( + //输入框一行 + maxLines: 1, + 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), + //不需要输入框下划线 + 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,), + // ), + // //右边图标设置 + // suffixIcon: GestureDetector( + // onTap: () { + // //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次 + // // SchedulerBinding.instance.addPostFrameCallback((_) { + // // _controller.text = ""; + // // }); + // }, + // child: Padding( + // padding: EdgeInsets.all(8), + // child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,), + // ), + // ) + ), + ), + ) + ], + ), + actions: [ + CupertinoDialogAction( + child: Text(TranslationLoader.lanKeys.cancel.tr), + onPressed: () { + Navigator.pop(context); + // print("取消"); + }, + ), + CupertinoDialogAction( + child: Text(TranslationLoader.lanKeys.sure.tr), + onPressed: () { + Navigator.pop(context); + // print("确定"); + }, + ), + ], + ), + ); + } +} diff --git a/star_lock/lib/tools/titleAppBar.dart b/star_lock/lib/tools/titleAppBar.dart index 9d5b302c..35dd894d 100644 --- a/star_lock/lib/tools/titleAppBar.dart +++ b/star_lock/lib/tools/titleAppBar.dart @@ -8,12 +8,14 @@ class TitleAppBar extends AppBar { final String barTitle; final Color titleColor; final Color iconColor; + final bool haveTitleWidget; + final Widget titleWidget; final bool haveBack; final bool haveOtherLeftWidget; final Widget leftWidget; List actionsList; - TitleAppBar({Key key,this.barTitle,this.titleColor,this.iconColor,this.backgroundColor,this.actionsList, this.haveBack, this.haveOtherLeftWidget = false , this.leftWidget}) : super(key: key); + TitleAppBar({Key key,this.barTitle,this.titleColor, this.haveTitleWidget = false, this.titleWidget, this.iconColor,this.backgroundColor,this.actionsList, this.haveBack, this.haveOtherLeftWidget = false , this.leftWidget}) : super(key: key); @override _TitleAppBarState createState() => _TitleAppBarState(); @@ -30,7 +32,7 @@ class _TitleAppBarState extends State { onPressed: () => Navigator.of(context).pop(), ):Container()), backgroundColor: widget.backgroundColor??Colors.white, - title: Text(widget.barTitle??'', style: TextStyle(color: widget.titleColor??Colors.white,fontSize: 36.sp, fontWeight:FontWeight.w500)), + title: widget.haveTitleWidget?widget.titleWidget:Text(widget.barTitle??'', style: TextStyle(color: widget.titleColor??Colors.white,fontSize: 36.sp, fontWeight:FontWeight.w500)), centerTitle: true, actions: widget.actionsList??[] ); diff --git a/star_lock/lib/translations/lanKeyEntity.dart b/star_lock/lib/translations/lanKeyEntity.dart index c161a23b..f5189989 100644 --- a/star_lock/lib/translations/lanKeyEntity.dart +++ b/star_lock/lib/translations/lanKeyEntity.dart @@ -74,6 +74,10 @@ class LanKeyEntity { this.volumeAuthorizationLock, this.authorizedAdminTip, this.lockOperatingRecordTip, + this.rankingList, + this.earlyArrivalList, + this.lateList, + this.hardWorkingList, this.basicInformation, this.wirelessKeyboard, @@ -142,6 +146,11 @@ class LanKeyEntity { this.upgrade, this.leisure, this.checkedIn, + this.company, + this.staff, + this.work, + this.workday, + this.holidays, this.lanEnglish, this.lanChinese, @@ -350,6 +359,15 @@ class LanKeyEntity { nearbyEquipment = json['nearbyEquipment']; noData = json['noData']; doorMagneticListTopTip = json['doorMagneticListTopTip']; + rankingList = json['rankingList']; + earlyArrivalList = json['earlyArrivalList']; + lateList = json['lateList']; + hardWorkingList = json['hardWorkingList']; + company = json['company']; + staff = json['staff']; + work = json['work']; + workday = json['workday']; + holidays = json['holidays']; lanEnglish = json['lanEnglish']; lanChinese = json['lanChinese']; @@ -521,6 +539,15 @@ class LanKeyEntity { String upgrade; String leisure; String checkedIn; + String rankingList; + String earlyArrivalList; + String lateList; + String hardWorkingList; + String company; + String staff; + String work; + String workday; + String holidays; String basicInformation; String wirelessKeyboard; @@ -730,6 +757,10 @@ class LanKeyEntity { map['upgrade'] = upgrade; map['leisure'] = leisure; map['checkedIn'] = checkedIn; + map['rankingList'] = rankingList; + map['earlyArrivalList'] = earlyArrivalList; + map['lateList'] = lateList; + map['hardWorkingList'] = hardWorkingList; map['basicInformation'] = basicInformation; map['wirelessKeyboard'] = wirelessKeyboard; @@ -765,7 +796,12 @@ class LanKeyEntity { map['nearbyEquipment'] = nearbyEquipment; map['noData'] = noData; map['doorMagneticListTopTip'] = doorMagneticListTopTip; - + map['company'] = company; + map['staff'] = staff; + map['work'] = work; + map['workday'] = workday; + map['holidays'] = holidays; + map['lanEnglish'] = lanEnglish; map['lanChinese'] = lanChinese; map['multilingual'] = multilingual;