hmxc
张萌 3 years ago
parent 5905d35f5c
commit 5e734ca3e8

@ -1,5 +1,6 @@
import 'package:common_utils/common_utils.dart';
import 'package:json_annotation/json_annotation.dart';
part 'today_clock_record_model.g.dart';
@JsonSerializable()
@ -12,7 +13,7 @@ class TodayClockRecordModel {
final String clockName;
final String clockTel;
final String createDate;
final String status;
final int status;
final String? firstTimeStart;
final String? firstTimeEnd;
final String? secondTimeStart;

@ -17,7 +17,7 @@ TodayClockRecordModel _$TodayClockRecordModelFromJson(
clockName: json['clockName'] as String,
clockTel: json['clockTel'] as String,
createDate: json['createDate'] as String,
status: json['status'] as String,
status: json['status'] as int,
firstTimeStart: json['firstTimeStart'] as String?,
firstTimeEnd: json['firstTimeEnd'] as String?,
secondTimeStart: json['secondTimeStart'] as String?,

@ -27,6 +27,7 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage>
Timer? _clockSetState;
DateTime? _lastPressed;
TodayClockRecordModel? _model;
bool get canTap {
if (_lastPressed == null ||
DateTime.now().difference(_lastPressed!) > Duration(seconds: 15)) {
@ -81,7 +82,9 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage>
setState(() {});
},
child: Container(
child: _model == null
? Container()
: Container(
margin: EdgeInsets.all(32.w),
padding: EdgeInsets.all(32.w),
width: double.infinity,
@ -93,7 +96,8 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage>
.color(kTextPrimaryColor)
.make(),
16.w.heightBox,
WeekDaysToChinese.fromString(DateUtil.getWeekday(DateTime.now()))
WeekDaysToChinese.fromString(
DateUtil.getWeekday(DateTime.now()))
.text
.size(24.sp)
.color(kTextPrimaryColor)
@ -114,7 +118,12 @@ class _ClockInOutMainPageState extends State<ClockInOutMainPage>
_buildClock(),
65.w.heightBox,
'今日工时'.text.size(24.sp).bold.color(kTextSubColor).make(),
'$getWorkHours'.text.size(24.sp).bold.color(kTextSubColor).make(),
'$getWorkHours'
.text
.size(24.sp)
.bold
.color(kTextSubColor)
.make(),
],
),
),

@ -40,12 +40,14 @@ class _ClockInOutPageState extends State<ClockInOutPage>
Center(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 24.w, horizontal: 32.w),
child: InkWell(child: '工作申请'.text.size(30.sp).color(kTextPrimaryColor).make(),onTap: (){
child: InkWell(
child: '工作申请'.text.size(30.sp).color(kTextPrimaryColor).make(),
onTap: () {
Get.to(() => WorkApplyPage());
},),
},
),
),
),
],
appBarBottom: PreferredSize(
child: AkuTabBar(controller: _tabController!, tabs: _tabs),
@ -54,7 +56,6 @@ class _ClockInOutPageState extends State<ClockInOutPage>
body: TabBarView(
controller: _tabController,
children: List.generate(_tabs.length, (index) {
if (index == 0) {
return ClockInOutMainPage();
} else {

Loading…
Cancel
Save