完成考勤设置部分功能
This commit is contained in:
parent
e555d0df5b
commit
5900cfc672
BIN
star_lock/images/icon_add_white.png
Normal file
BIN
star_lock/images/icon_add_white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 421 B |
@ -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",
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -73,6 +73,15 @@
|
||||
"volumeAuthorizationLock":"批量授权锁",
|
||||
"authorizedAdminTip":"授权管理员拥有操作这把锁的重要权限,请确保只发给我你信任的人",
|
||||
"lockOperatingRecordTip":"只能保留一定时间内的记录,如果您需要保留历史记录,可以在右上角导出",
|
||||
"rankingList":"排列榜",
|
||||
"earlyArrivalList":"早到榜",
|
||||
"lateList":"迟到榜",
|
||||
"hardWorkingList":"勤奋榜",
|
||||
"company":"公司",
|
||||
"staff":"员工",
|
||||
"work":"工作",
|
||||
"workday":"工作日",
|
||||
"holidays":"节假日",
|
||||
|
||||
"basicInformation":"基本信息",
|
||||
"wirelessKeyboard":"无线键盘",
|
||||
|
||||
BIN
star_lock/images/main/icon_lockDetail_checkIn_set.png
Normal file
BIN
star_lock/images/main/icon_lockDetail_checkIn_set.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
BIN
star_lock/images/main/icon_lockDetail_checkIn_topTitle.png
Normal file
BIN
star_lock/images/main/icon_lockDetail_checkIn_topTitle.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@ -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(),
|
||||
),
|
||||
];
|
||||
}
|
||||
@ -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<CheckingInListPage> createState() => _CheckingInListPageState();
|
||||
}
|
||||
|
||||
class _CheckingInListPageState extends State<CheckingInListPage> {
|
||||
@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) {
|
||||
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -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<CheckingInSetPage> createState() => _CheckingInSetPageState();
|
||||
}
|
||||
|
||||
class _CheckingInSetPageState extends State<CheckingInSetPage> {
|
||||
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);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -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<CheckingInAddStaffPage> createState() => _CheckingInAddStaffPageState();
|
||||
}
|
||||
|
||||
class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
|
||||
@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),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -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<CheckingInStaffManagePage> createState() => _CheckingInStaffManagePageState();
|
||||
}
|
||||
|
||||
class _CheckingInStaffManagePageState extends State<CheckingInStaffManagePage> {
|
||||
@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), ),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@ -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<CheckingInSetWorkTimePage> createState() => _CheckingInSetWorkTimePageState();
|
||||
}
|
||||
|
||||
class _CheckingInSetWorkTimePageState extends State<CheckingInSetWorkTimePage> {
|
||||
|
||||
@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<int> index) {
|
||||
//
|
||||
// });
|
||||
}),
|
||||
CommonItem(leftTitel:"下班时间", rightTitle:"11:49", isHaveDirection: true, action:(){
|
||||
// ShowSeletDateTime().showDatePicker(context, '00:00', '00:00', getNowDate(),'HH:mm', (dateTime, List<int> 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;
|
||||
}
|
||||
}
|
||||
@ -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<CheckingInSetWorkdaySet> createState() => _CheckingInSetWorkdaySetState();
|
||||
}
|
||||
|
||||
class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
|
||||
@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,),],),)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -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<ElectronicKeyDetailPage> {
|
||||
TextEditingController _changeNameController;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -113,78 +116,10 @@ class _ElectronicKeyDetailPageState extends State<ElectronicKeyDetailPage> {
|
||||
}
|
||||
|
||||
void showCupertinoAlertDialog(BuildContext context) {
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return Card(
|
||||
color: const Color(0x00FFFFFF),
|
||||
child: CupertinoAlertDialog(
|
||||
title: const Text("修改密码"),
|
||||
content: Column(
|
||||
children: <Widget>[
|
||||
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: <Widget>[
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -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<ElectronicKeyDetailChang
|
||||
return Column(
|
||||
children: [
|
||||
CommonItem(leftTitel:TranslationLoader.lanKeys.effectiveTime.tr, rightTitle:"2020.06.20 11:49", isHaveDirection: true, isHaveLine: true, action:(){
|
||||
_showDatePicker();
|
||||
ShowSeletDateTime().showDatePicker(context, '2100-01-01 00:00', '1900-01-01 00:00', getNowDate(),'yyyy-MMMM-dd HH:mm', (dateTime, List<int> 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<int> 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<int> index) {
|
||||
setState(() {
|
||||
_dateTime = dateTime;
|
||||
});
|
||||
},
|
||||
onConfirm: (dateTime, List<int> 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;
|
||||
|
||||
@ -70,7 +70,7 @@ class _LockDetailPageState extends State<LockDetailPage> {
|
||||
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<LockDetailPage> {
|
||||
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);
|
||||
|
||||
67
star_lock/lib/tools/showSeletDateTime.dart
Normal file
67
star_lock/lib/tools/showSeletDateTime.dart
Normal file
@ -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<int> 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<int> 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;
|
||||
// }
|
||||
}
|
||||
86
star_lock/lib/tools/showTFView.dart
Normal file
86
star_lock/lib/tools/showTFView.dart
Normal file
@ -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: <Widget>[
|
||||
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: <Widget>[
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys.cancel.tr),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
// print("取消");
|
||||
},
|
||||
),
|
||||
CupertinoDialogAction(
|
||||
child: Text(TranslationLoader.lanKeys.sure.tr),
|
||||
onPressed: () {
|
||||
Navigator.pop(context);
|
||||
// print("确定");
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -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<Widget> 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<TitleAppBar> {
|
||||
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??[]
|
||||
);
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user