diff --git a/marking_app/lib/components/TestPaperItem.dart b/marking_app/lib/components/TestPaperItem.dart index 813c8f1..4293660 100644 --- a/marking_app/lib/components/TestPaperItem.dart +++ b/marking_app/lib/components/TestPaperItem.dart @@ -29,9 +29,7 @@ class TestPaperItem extends ConsumerWidget with CommonMixin { final bool isHomeworkCorrection; final VoidCallback? call; final MarkingListType? markingtype; - const TestPaperItem( - {required this.markingItem, this.markingtype, this.isHomeworkCorrection = false, this.call, Key? key}) - : super(key: key); + const TestPaperItem({required this.markingItem, this.markingtype, this.isHomeworkCorrection = false, this.call, Key? key}) : super(key: key); @override Widget build(BuildContext context, WidgetRef ref) { @@ -65,7 +63,7 @@ class TestPaperItem extends ConsumerWidget with CommonMixin { padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 10.h), constraints: BoxConstraints( minHeight: 120.h, - maxHeight: 130.h, + maxHeight: 144.h, ), decoration: BoxDecoration( color: Colors.white, @@ -117,8 +115,7 @@ class TestPaperItem extends ConsumerWidget with CommonMixin { margin: EdgeInsets.only(right: 8.w), alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: - BorderRadius.only(topLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), + borderRadius: BorderRadius.only(topLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), color: const Color.fromRGBO(245, 108, 108, 0.236), ), child: Text( @@ -137,8 +134,7 @@ class TestPaperItem extends ConsumerWidget with CommonMixin { margin: EdgeInsets.only(right: 8.w), alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: - BorderRadius.only(topLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), + borderRadius: BorderRadius.only(topLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), color: const Color.fromRGBO(4, 201, 208, 0.10), ), child: Text( @@ -157,8 +153,7 @@ class TestPaperItem extends ConsumerWidget with CommonMixin { margin: EdgeInsets.only(right: 8.w), alignment: Alignment.center, decoration: BoxDecoration( - borderRadius: - BorderRadius.only(topLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), + borderRadius: BorderRadius.only(topLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), color: const Color.fromRGBO(231, 236, 255, 1), ), child: Text( @@ -270,10 +265,7 @@ class TestPaperItem extends ConsumerWidget with CommonMixin { Text( '${markingItem.finishCount}', style: TextStyle( - color: markingItem.isFinish && isHomeworkCorrection - ? Colors.green - : Theme.of(context).primaryColor, - fontSize: 12.sp), + color: markingItem.isFinish && isHomeworkCorrection ? Colors.green : Theme.of(context).primaryColor, fontSize: 12.sp), ), Text( '/', @@ -299,8 +291,7 @@ class TestPaperItem extends ConsumerWidget with CommonMixin { style: TextStyle(color: Colors.white, fontSize: 8.sp), ), // linearStrokeCap: LinearStrokeCap.butt, - progressColor: - markingItem.isFinish && isHomeworkCorrection ? Colors.green : Theme.of(context).primaryColor, + progressColor: markingItem.isFinish && isHomeworkCorrection ? Colors.green : Theme.of(context).primaryColor, backgroundColor: const Color.fromRGBO(219, 224, 243, 1), barRadius: Radius.circular(10.r), ), @@ -503,9 +494,7 @@ class TestPaperItem extends ConsumerWidget with CommonMixin { RestClient client = await getClient(); BaseStructureResult result = await client.endMarkingTask(markingUserId); if (result.code == RequestConfig.successCode && result.data == null ? false : result.data!) { - ref - .read(currentTaskIdProvider.notifier) - .setDoTaskEntity(CurrentReviewTask(taskId: markingItem.markingUserId, refresh: true)); + ref.read(currentTaskIdProvider.notifier).setDoTaskEntity(CurrentReviewTask(taskId: markingItem.markingUserId, refresh: true)); } else { ToastUtils.getFluttertoast(context: context, msg: '提交失败'); } diff --git a/marking_app/lib/pages/homework_correction/job_home.dart b/marking_app/lib/pages/homework_correction/job_home.dart index 9492963..c144930 100644 --- a/marking_app/lib/pages/homework_correction/job_home.dart +++ b/marking_app/lib/pages/homework_correction/job_home.dart @@ -624,7 +624,7 @@ class _JobHomeState extends State @override Widget build(BuildContext context) { super.build(context); - var spaceWidth = SizedBox(height: ScreenUtil().screenWidth / 19); + return AnnotatedRegion( value: const SystemUiOverlayStyle( systemNavigationBarColor: Color(0xFF000000), @@ -639,7 +639,7 @@ class _JobHomeState extends State taskIndependence: true, enableControlFinishLoad: true, enableControlFinishRefresh: true, - emptyWidget: jobDatas.isEmpty ? const MyEmptyWidget() : null, + emptyWidget: jobDatas.isEmpty ? $TheJobMainBox(emptyWidget: MyEmptyWidget()) : null, controller: _refreshController, header: MaterialHeader(), footer: TaurusFooter(), @@ -658,28 +658,10 @@ class _JobHomeState extends State // // ), // child: Image.asset('assets/images/job_home_top_bgm.png', fit: BoxFit.fitWidth), // ), - SizedBox(height: MediaQuery.of(context).padding.top + 20.h), - SlidingData([ - EntranceModel(title: '作业批阅', image: 'assets/images/job_home_marking.png', navigationUrl: RouterManager.jobMainListPagePath), - EntranceModel( - title: '学生历史作业', - image: 'assets/images/job_home_history.png', - navigationUrl: '${RouterManager.jobStudentGroupPath}?page=history', - ), - EntranceModel(title: '知识点点掌握', image: 'assets/images/job_home_knowledge.png', navigationUrl: RouterManager.jobKnowledgePointsPath) - ]), - spaceWidth, - $TermRow([ - EntranceModel(title: '答题轨迹', image: 'assets/images/job_home_answer_record.png', navigationUrl: RouterManager.answerTrajectoryPath), - EntranceModel( - title: '优先批阅设定', - image: 'assets/images/job_home_youxian.png', - navigationUrl: '${RouterManager.jobStudentGroupPath}?page=set', - ) - ], 0), + $TheJobMainBox(), // spaceWidth, // $TermRow([EntranceModel(title: '批阅设置', image: 'assets/images/job_home_marking_set.png', navigationUrl: '')], 0), - spaceWidth, + Container( padding: EdgeInsets.symmetric(horizontal: 12.w), child: Column( @@ -844,3 +826,36 @@ class SlidingData extends HookWidget with EventBusMixin { return $TermRow(items, dataNumber.value?.num ?? 0); } } + +// 作业主页 +@swidget +Widget $theJobMainBox(BuildContext context, {Widget? emptyWidget}) { + var spaceWidth = SizedBox(height: ScreenUtil().screenWidth / 19); + + return Column( + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(height: MediaQuery.of(context).padding.top + 20.h), + SlidingData([ + EntranceModel(title: '作业批阅', image: 'assets/images/job_home_marking.png', navigationUrl: RouterManager.jobMainListPagePath), + EntranceModel( + title: '学生历史作业', + image: 'assets/images/job_home_history.png', + navigationUrl: '${RouterManager.jobStudentGroupPath}?page=history', + ), + EntranceModel(title: '知识点点掌握', image: 'assets/images/job_home_knowledge.png', navigationUrl: RouterManager.jobKnowledgePointsPath) + ]), + spaceWidth, + $TermRow([ + EntranceModel(title: '答题轨迹', image: 'assets/images/job_home_answer_record.png', navigationUrl: RouterManager.answerTrajectoryPath), + EntranceModel( + title: '优先批阅设定', + image: 'assets/images/job_home_youxian.png', + navigationUrl: '${RouterManager.jobStudentGroupPath}?page=set', + ) + ], 0), + if (emptyWidget != null) emptyWidget, + spaceWidth, + ], + ); +}