收集订正

This commit is contained in:
machuanyu 2024-05-28 16:17:32 +08:00
parent 3dcbf121aa
commit 8874d64281
6 changed files with 482 additions and 387 deletions

View File

@ -92,4 +92,10 @@ abstract class RetrofitClient {
@GET("/api/hms/HmsReport/GetQuestionStudentState") @GET("/api/hms/HmsReport/GetQuestionStudentState")
Future<List<Students>> getQuestionStudentState(@Query('HomeworkId') String homeworkId,@Query('TemplateId') int templateId,@Query('QuestionNo') int questionNo); Future<List<Students>> getQuestionStudentState(@Query('HomeworkId') String homeworkId,@Query('TemplateId') int templateId,@Query('QuestionNo') int questionNo);
//
@POST("/api/hms/Homework/Collect")
Future getCollect(@Field() String homeworkId);
} }

View File

@ -69,6 +69,8 @@ class Items extends Object {
@JsonKey(name: 'classCount') @JsonKey(name: 'classCount')
int? classCount; int? classCount;
@JsonKey(name: 'isFixed')
bool? isFixed;
Items(this.id,this.assessType,this.name,this.grade,this.subject,this.publishTime,this.state,this.collectRate,this.questionCount,this.annotateCount,this.annotateRate,this.classes,this.creatorName,this.creationTime,this.classCount); Items(this.id,this.assessType,this.name,this.grade,this.subject,this.publishTime,this.state,this.collectRate,this.questionCount,this.annotateCount,this.annotateRate,this.classes,this.creatorName,this.creationTime,this.classCount);

View File

@ -24,7 +24,9 @@ class KnowledgePointsGraspDetailPage extends StatefulWidget {
class _KnowledgePointsGraspDetailPageState class _KnowledgePointsGraspDetailPageState
extends State<KnowledgePointsGraspDetailPage> { extends State<KnowledgePointsGraspDetailPage> {
final logic = Get.find<KnowledgePointsGraspDetailLogic>(); final logic = Get.find<KnowledgePointsGraspDetailLogic>();
final state = Get.find<KnowledgePointsGraspDetailLogic>().state; final state = Get
.find<KnowledgePointsGraspDetailLogic>()
.state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -35,12 +37,15 @@ class _KnowledgePointsGraspDetailPageState
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertDialog( return AlertDialog(
insetPadding: insetPadding:
EdgeInsets.symmetric(vertical: 55.r, horizontal: 45.r), EdgeInsets.symmetric(vertical: 55.r, horizontal: 45.r),
contentPadding: EdgeInsets.all(0), contentPadding: EdgeInsets.all(0),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(15.r))), borderRadius: BorderRadius.all(Radius.circular(15.r))),
content: Container( content: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery
.of(context)
.size
.width,
// height: MediaQuery.of(context).size.height, // height: MediaQuery.of(context).size.height,
child: Image.network(imgUrl), child: Image.network(imgUrl),
), ),
@ -54,13 +59,17 @@ class _KnowledgePointsGraspDetailPageState
EasyLoading.dismiss(); EasyLoading.dismiss();
} }
void showStudent(homeworkId,templateId,questionNo, title) async { void showStudent(homeworkId, templateId, questionNo, title) async {
await logic.getStudents(homeworkId,templateId,questionNo); logic.getStudents(homeworkId, templateId, questionNo);
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return ShowStudentList(title:title,studentList:state.studentList.value,homeworkId: homeworkId,); return Obx(() {
return ShowStudentList(title: title,
studentList: state.studentList.value,
homeworkId: homeworkId,);
});
}, },
); );
EasyLoading.dismiss(); EasyLoading.dismiss();
@ -101,160 +110,162 @@ class _KnowledgePointsGraspDetailPageState
}, },
child: state.dataList.isNotEmpty child: state.dataList.isNotEmpty
? ListView.builder( ? ListView.builder(
itemCount: state.dataList.length, itemCount: state.dataList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
KnowledgeReportDetail item = state.dataList[index]; KnowledgeReportDetail item = state.dataList[index];
return InkWell( return InkWell(
onTap: () { onTap: () {
/* RouterManager.router.navigateTo( /* RouterManager.router.navigateTo(
context, context,
RouterManager.quickCheckPersonalPath + RouterManager.quickCheckPersonalPath +
'?jobId=${item.jobName}&studentId=$studentId', '?jobId=${item.jobName}&studentId=$studentId',
transition: getTransition(), transition: getTransition(),
);*/ );*/
}, },
child: Container( child: Container(
margin: EdgeInsets.symmetric( margin: EdgeInsets.symmetric(
vertical: 5.r, horizontal: 14.r), vertical: 5.r, horizontal: 14.r),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: 14.r, horizontal: 10.r), vertical: 14.r, horizontal: 10.r),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(10.r)), BorderRadius.all(Radius.circular(10.r)),
color: Colors.white), color: Colors.white),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
Row( Text(
mainAxisAlignment: MainAxisAlignment.start, item.publishTime.substring(0, 10),
crossAxisAlignment: CrossAxisAlignment.end, style: TextStyle(
children: [ fontSize: 14.sp,
Text( color: Color(0xFF505050)),
item.publishTime.substring(0, 10), ),
style: TextStyle( SizedBox(
fontSize: 14.sp, width: 10.r,
color: Color(0xFF505050)), ),
), Expanded(
SizedBox( child: Text(
width: 10.r,
),
Expanded(
child: Text(
item.homeworkName, item.homeworkName,
style: TextStyle( style: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
color: Color(0xFF505050)), color: Color(0xFF505050)),
)), )),
InkWell( InkWell(
onTap: () { onTap: () {
EasyLoading.show(status: 'loading...'); EasyLoading.show(status: 'loading...');
showImg(item.questionPicture, context); showImg(item.questionPicture, context);
}, },
child: Container( child: Container(
width: 49.r, width: 49.r,
height: 22.r, height: 22.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(20.r)), Radius.circular(20.r)),
border: Border.all( border: Border.all(
width: 1.r, width: 1.r,
color: Color(0xFF8B8B8B)), color: Color(0xFF8B8B8B)),
), ),
child: Center( child: Center(
child: Text( child: Text(
'${item.questionNo}', '${item.questionNo}',
style: TextStyle( style: TextStyle(
fontSize: 10.sp, fontSize: 10.sp,
color: Color(0xFF8B8B8B)), color: Color(0xFF8B8B8B)),
),
),
), ),
), ),
],
),
SizedBox(
height: 10.r,
),
Container(
margin: EdgeInsets.only(top: 8.h),
padding: EdgeInsets.zero,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
EasyLoading.show(status: 'loading...');
showStudent(
item.homeworkId, item.templateId,item.questionNo,item.homeworkName);
},
child: Container(
margin: EdgeInsets.only(right: 6.r),
width: 56.r,
height: 20.r,
decoration: BoxDecoration(
color: Color(0xFFD4FFED),
borderRadius:
BorderRadius.circular(20.r),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
quickText('正确率',
color: Color(0xFF4CC793),
size: 10.sp),
Image.asset(
'assets/images/icon_back_green.png',
width: 8.r,
height: 8.r,
)
],
)),
),
Expanded(
flex: 1,
child: Container(
child: Row(
children: [
Expanded(
child: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
10.r),
),
child: LinearPercentIndicator(
padding: EdgeInsets.zero,
animation: true,
lineHeight: 8.h,
animationDuration: 2500,
percent:
item.correctRate / 100,
progressColor:
Color(0xFF90E0BE),
backgroundColor:
Color(0xFFE8E8E8),
barRadius:
Radius.circular(10.r),
),
),
),
SizedBox(width: 4.w),
quickText(
'${item.correctRate.toStringAsFixed(0)}%',
size: 10.sp,
color: Color(0xFF606060))
],
),
),
),
],
), ),
), ),
/* progressBar(context, ],
),
SizedBox(
height: 10.r,
),
Container(
margin: EdgeInsets.only(top: 8.h),
padding: EdgeInsets.zero,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
EasyLoading.show(status: 'loading...');
showStudent(
item.homeworkId, item.templateId,
item.questionNo, item.homeworkName);
},
child: Container(
margin: EdgeInsets.only(right: 6.r),
width: 56.r,
height: 20.r,
decoration: BoxDecoration(
color: Color(0xFFD4FFED),
borderRadius:
BorderRadius.circular(20.r),
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
quickText('正确率',
color: Color(0xFF4CC793),
size: 10.sp),
Image.asset(
'assets/images/icon_back_green.png',
width: 8.r,
height: 8.r,
)
],
)),
),
Expanded(
flex: 1,
child: Container(
child: Row(
children: [
Expanded(
child: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(
10.r),
),
child: LinearPercentIndicator(
padding: EdgeInsets.zero,
animation: true,
lineHeight: 8.h,
animationDuration: 2500,
percent:
item.correctRate / 100,
progressColor:
Color(0xFF90E0BE),
backgroundColor:
Color(0xFFE8E8E8),
barRadius:
Radius.circular(10.r),
),
),
),
SizedBox(width: 4.w),
quickText(
'${item.correctRate.toStringAsFixed(
0)}%',
size: 10.sp,
color: Color(0xFF606060))
],
),
),
),
],
),
),
/* progressBar(context,
title: '正确率 >', title: '正确率 >',
color: Color(0xFF90E0BE), color: Color(0xFF90E0BE),
percent: item.correctRate / 100, percent: item.correctRate / 100,
@ -262,11 +273,11 @@ class _KnowledgePointsGraspDetailPageState
marginEdg: EdgeInsets.only(top: 8.h), marginEdg: EdgeInsets.only(top: 8.h),
studentCall:showStudent(item.questionId,item.jobName), studentCall:showStudent(item.questionId,item.jobName),
),*/ ),*/
], ],
), ),
), ),
); );
}) })
: const MyEmptyWidget(), : const MyEmptyWidget(),
); );
}), }),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:school_asignment_app/common/job/enum_subject.dart'; import 'package:school_asignment_app/common/job/enum_subject.dart';
@ -36,6 +37,7 @@ class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProvi
vsync: this, vsync: this,
); );
tabController2 = TabController(length: 4, vsync: this); tabController2 = TabController(length: 4, vsync: this);
EasyLoading.show(status:'loading...');
getList(); getList();
} }
// //
@ -52,6 +54,7 @@ class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProvi
state.workList.value = data.items; state.workList.value = data.items;
refreshController1.finishRefresh(); refreshController1.finishRefresh();
refreshController2.finishRefresh(); refreshController2.finishRefresh();
EasyLoading.dismiss();
print('state.workList.length=${state.workList.length}'); print('state.workList.length=${state.workList.length}');
} }
/// ///
@ -65,6 +68,11 @@ class ReadOverLogic extends GetxController with RequestToolMixin, GetTickerProvi
getList(); getList();
} }
void getCollect(item) async{
await getClient().getCollect(item.id);
getList();
}
/// ///
Future<void> onMyLoad(EasyRefreshController controller, int tab) async { Future<void> onMyLoad(EasyRefreshController controller, int tab) async {
/*params.page++; /*params.page++;

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart'; import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart'; import 'package:functional_widget_annotation/functional_widget_annotation.dart';
@ -25,9 +26,7 @@ class ReadOverPage extends StatefulWidget {
class _ReadOverPageState extends State<ReadOverPage> { class _ReadOverPageState extends State<ReadOverPage> {
final logic = Get.find<ReadOverLogic>(); final logic = Get.find<ReadOverLogic>();
final state = Get final state = Get.find<ReadOverLogic>().state;
.find<ReadOverLogic>()
.state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -48,10 +47,8 @@ class _ReadOverPageState extends State<ReadOverPage> {
children: <Widget>[ children: <Widget>[
Container( Container(
color: Colors.white, color: Colors.white,
margin: EdgeInsets.only(top: MediaQuery margin:
.of(context) EdgeInsets.only(top: MediaQuery.of(context).padding.top),
.padding
.top),
padding: EdgeInsets.only(bottom: 9.h, top: 4.h), padding: EdgeInsets.only(bottom: 9.h, top: 4.h),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -116,7 +113,7 @@ class _ReadOverPageState extends State<ReadOverPage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: state.tabIndex.value == 0 color: state.tabIndex.value == 0
? const Color.fromRGBO( ? const Color.fromRGBO(
255, 255, 255, 1) 255, 255, 255, 1)
: null, : null,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(8.r)), Radius.circular(8.r)),
@ -124,10 +121,10 @@ class _ReadOverPageState extends State<ReadOverPage> {
child: quickText( child: quickText(
'待批阅', '待批阅',
size: 14.sp, size: 14.sp,
color: state.tabIndex.value == 0 ? Theme color: state.tabIndex.value == 0
.of(context) ? Theme.of(context).primaryColor
.primaryColor : const Color.fromRGBO( : const Color.fromRGBO(
80, 94, 110, 1), 80, 94, 110, 1),
fontWeight: state.tabIndex.value == 0 fontWeight: state.tabIndex.value == 0
? FontWeight.bold ? FontWeight.bold
: null, : null,
@ -145,7 +142,7 @@ class _ReadOverPageState extends State<ReadOverPage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: state.tabIndex.value == 1 color: state.tabIndex.value == 1
? const Color.fromRGBO( ? const Color.fromRGBO(
255, 255, 255, 1) 255, 255, 255, 1)
: null, : null,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(8.r)), Radius.circular(8.r)),
@ -153,10 +150,10 @@ class _ReadOverPageState extends State<ReadOverPage> {
child: quickText( child: quickText(
'已批阅', '已批阅',
size: 14.sp, size: 14.sp,
color: state.tabIndex.value == 1 ? Theme color: state.tabIndex.value == 1
.of(context) ? Theme.of(context).primaryColor
.primaryColor : const Color.fromRGBO( : const Color.fromRGBO(
80, 94, 110, 1), 80, 94, 110, 1),
fontWeight: state.tabIndex.value == 1 fontWeight: state.tabIndex.value == 1
? FontWeight.bold ? FontWeight.bold
: null, : null,
@ -172,10 +169,8 @@ class _ReadOverPageState extends State<ReadOverPage> {
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
/* RouterManager.router Get.toNamed(Routes.studentHistoryWorkPage,
.navigateTo( arguments: {'page': 'set'});
context, RouterManager.jobStudentGroupPath,
transition: getTransition());*/
}, },
child: Icon( child: Icon(
const IconData(0xe63e, fontFamily: "AlibabaIcon"), const IconData(0xe63e, fontFamily: "AlibabaIcon"),
@ -186,79 +181,83 @@ class _ReadOverPageState extends State<ReadOverPage> {
], ],
), ),
), ),
Obx(() { Obx(() {
return state.tabIndex.value == 1? return state.tabIndex.value == 1
JobConditionFilter( ? JobConditionFilter(
customTimeStr: state.customTimeStr.value, customTimeStr: state.customTimeStr.value,
controller: logic.tabController2, controller: logic.tabController2,
hasAll:true, hasAll: true,
jobType: 1, jobType: 1,
customTime: logic.tabController2.index != 3 || customTime: logic.tabController2.index != 3 ||
(logic.params2.startDate == null && logic.params2.endDate == null) (logic.params2.startDate == null &&
? null logic.params2.endDate == null)
: PickerDateRange( ? null
logic.params2.startDate == null ? null : DateTime.parse( : PickerDateRange(
logic.params2.startDate!), logic.params2.startDate == null
logic.params2.endDate == null ? null : DateTime.parse(logic.params2.endDate!), ? null
), : DateTime.parse(
onTimeFilter: (String? startTime, String? endTime) { logic.params2.startDate!),
if (startTime == null && endTime == null && logic.params2.endDate == null
logic.tabController2.index == 3) { ? null
logic.tabController2.animateTo(0); : DateTime.parse(logic.params2.endDate!),
} ),
logic.params2.endDate = endTime; onTimeFilter: (String? startTime, String? endTime) {
logic.params2.startDate = startTime; if (startTime == null &&
state.page = 1; endTime == null &&
logic.getList(); logic.tabController2.index == 3) {
// logic.refreshController2.callRefresh(); logic.tabController2.animateTo(0);
}, }
refreshTime: (value) { logic.params2.endDate = endTime;
if (value != null && value.startDate != null) { logic.params2.startDate = startTime;
state.customTimeStr.value = state.page = 1;
value.startDate?.toString().substring(0, 10) ?? ''; logic.getList();
// logic.refreshController2.callRefresh();
},
refreshTime: (value) {
if (value != null && value.startDate != null) {
state.customTimeStr.value = value.startDate
?.toString()
.substring(0, 10) ??
'';
if (value.endDate != null) { if (value.endDate != null) {
if (!Utils.isPad() && if (!Utils.isPad() &&
value.startDate!.year == value.endDate!.year) { value.startDate!.year ==
state.customTimeStr.value = value.endDate!.year) {
'${value.startDate.toString().substring(5, 10)}~${value state.customTimeStr.value =
.endDate.toString().substring(5, 10)}'; '${value.startDate.toString().substring(5, 10)}~${value.endDate.toString().substring(5, 10)}';
} else { } else {
state.customTimeStr.value = state.customTimeStr.value =
'${state.customTimeStr.value}~${value.endDate '${state.customTimeStr.value}~${value.endDate?.toString().substring(0, 10)}';
?.toString() }
.substring( }
0, 10)}'; }
} })
} : Container();
} }),
} Expanded(child: Obx(() {
):Container(); return IndexedStack(
}), index: state.tabIndex.value,
Expanded( children: <Widget>[
child: Obx(() { $easyRefresh(
return IndexedStack( controller: logic.refreshController1,
index: state.tabIndex.value, tab: 1,
children: <Widget>[ type: state.active,
$easyRefresh( data: state.workList,
controller: logic.refreshController1, onLoad: logic.onMyLoad,
tab: 1, onRefresh: logic.onMyRefresh,
type: state.active, logic: logic),
data: state.workList, $easyRefresh(
onLoad: logic.onMyLoad, controller: logic.refreshController2,
onRefresh: logic.onMyRefresh, tab: 2,
logic: logic), type: state.active,
$easyRefresh( data: state.workList,
controller: logic.refreshController2, onLoad: logic.onMyLoad,
tab: 2, onRefresh: logic.onMyRefresh,
type: state.active, logic: logic),
data: state.workList, ],
onLoad: logic.onMyLoad, );
onRefresh: logic.onMyRefresh, })),
logic: logic),
],
);
})),
], ],
); );
}, },
@ -274,17 +273,16 @@ class _ReadOverPageState extends State<ReadOverPage> {
} }
} }
/// ///
/// OnRefreshCallback? onRefresh /// OnRefreshCallback? onRefresh
/// ///
@swidget @swidget
Widget $easyRefresh({ Widget $easyRefresh({
required EasyRefreshController controller, required EasyRefreshController controller,
required Future< required Future<void> Function(EasyRefreshController controller, int tab)
void> Function(EasyRefreshController controller, int tab) onRefresh, onRefresh,
required Future< required Future<void> Function(EasyRefreshController controller, int tab)
void> Function(EasyRefreshController controller, int tab) onLoad, onLoad,
required List<Items> data, required List<Items> data,
required int tab, required int tab,
required int type, required int type,
@ -304,34 +302,35 @@ Widget $easyRefresh({
footer: TaurusFooter(), footer: TaurusFooter(),
child: completed && isPadFlag child: completed && isPadFlag
? GridView( ? GridView(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, //widget crossAxisCount: 2, //widget
mainAxisSpacing: 10.h, mainAxisSpacing: 10.h,
crossAxisSpacing: 6.w, crossAxisSpacing: 6.w,
childAspectRatio: 1.81 //1widget childAspectRatio: 1.81 //1widget
), ),
children: List.generate(data.length, (index) { children: List.generate(data.length, (index) {
Items item = data[index]; Items item = data[index];
String subjectName = EnumUtils.formatSubject(item.subject); String subjectName = EnumUtils.formatSubject(item.subject);
return $reviewedItem( return $reviewedItem(
jobTaskItem: item, type: type, subjectName: subjectName); jobTaskItem: item, type: type, subjectName: subjectName,logic: logic);
}), }),
) )
: ListView.builder( : ListView.builder(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 11.h, bottom: 10.h, left: 12.w, right: 12.w), top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
itemBuilder: (context, index) { itemBuilder: (context, index) {
Items item = data[index]; Items item = data[index];
return TaskListItem( return TaskListItem(
completed: completed, completed: completed,
jobTaskItem: item, jobTaskItem: item,
type: type, type: type,
); logic: logic,
}, );
itemCount: data.length, },
), itemCount: data.length,
),
onRefresh: () => onRefresh(controller, tab), onRefresh: () => onRefresh(controller, tab),
onLoad: () => onLoad(controller, tab), onLoad: () => onLoad(controller, tab),
); );
@ -340,12 +339,20 @@ Widget $easyRefresh({
@swidget @swidget
Widget $reviewedItem( Widget $reviewedItem(
{required Items jobTaskItem, required int type, required String subjectName}) { {required Items jobTaskItem,
required int type,
required String subjectName,
required ReadOverLogic logic,}) {
EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w); EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w);
return InkWell( return InkWell(
onTap: () { onTap: () {
Get.toNamed(Routes.annotateClassPage,arguments: {'id':jobTaskItem.id,'name':jobTaskItem.name,'grade':jobTaskItem.grade,'completed':true}); Get.toNamed(Routes.annotateClassPage, arguments: {
'id': jobTaskItem.id,
'name': jobTaskItem.name,
'grade': jobTaskItem.grade,
'completed': true
});
}, },
child: Container( child: Container(
padding: EdgeInsets.only(top: 10.h), padding: EdgeInsets.only(top: 10.h),
@ -387,31 +394,47 @@ Widget $reviewedItem(
), ),
), ),
margin: EdgeInsets.only(right: 4.w), margin: EdgeInsets.only(right: 4.w),
child: quickText(type == 1 ? '作业' : '考试', color: Colors.white, child: quickText(type == 1 ? '作业' : '考试',
size: 10.sp), color: Colors.white, size: 10.sp),
), ),
Expanded( Expanded(
child: quickText(jobTaskItem.name, size: 14.sp, child: quickText(jobTaskItem.name,
size: 14.sp,
color: const Color.fromRGBO(70, 70, 70, 1), color: const Color.fromRGBO(70, 70, 70, 1),
maxLines: 2), maxLines: 2),
) )
], ],
), ),
), ),
if(jobTaskItem.isFixed!)
Padding(
padding: padEdg,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(
'已订正',
style: TextStyle(
fontSize: 10.sp, color: const Color(0xFFF16262)),
),
],
),
),
Padding( Padding(
padding: padEdg, padding: padEdg,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
quickText( quickText(
DateTime.parse(jobTaskItem.publishTime).toString().substring( DateTime.parse(jobTaskItem.publishTime)
0, 10), .toString()
.substring(0, 10),
color: const Color.fromRGBO(97, 97, 97, 1), color: const Color.fromRGBO(97, 97, 97, 1),
size: 10.sp, size: 10.sp,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
), ),
quickText(' / ', color: const Color.fromRGBO(76, 199, 147, 1), quickText(' / ',
color: const Color.fromRGBO(76, 199, 147, 1),
size: 10.sp, size: 10.sp,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
quickText( quickText(
@ -424,7 +447,8 @@ Widget $reviewedItem(
color: const Color.fromRGBO(76, 199, 147, 1), color: const Color.fromRGBO(76, 199, 147, 1),
size: 10.sp, size: 10.sp,
), ),
quickText(' / ', color: const Color.fromRGBO(116, 145, 253, 1), quickText(' / ',
color: const Color.fromRGBO(116, 145, 253, 1),
size: 10.sp, size: 10.sp,
fontWeight: FontWeight.w500), fontWeight: FontWeight.w500),
quickText( quickText(
@ -443,37 +467,64 @@ Widget $reviewedItem(
margin: EdgeInsets.only(top: 4.h, bottom: 6.h), margin: EdgeInsets.only(top: 4.h, bottom: 6.h),
), ),
),*/ ),*/
GestureDetector( Container(
onTap: () { padding: EdgeInsets.symmetric(vertical: 6.h),
Get.toNamed(Routes.jobReportPage,arguments: {'title':jobTaskItem.name,'homeworkId':jobTaskItem.id,'grade':jobTaskItem.grade}); decoration: BoxDecoration(
}, borderRadius: BorderRadius.only(
child: Container( bottomLeft: Radius.circular(6.r),
padding: EdgeInsets.symmetric(vertical: 6.h), bottomRight: Radius.circular(6.r)),
decoration: BoxDecoration( color: Colors.white,
borderRadius: BorderRadius.only( boxShadow: const [
bottomLeft: Radius.circular(6.r), BoxShadow(
bottomRight: Radius.circular(6.r)), color: Color.fromRGBO(0, 0, 0, 0.15),
color: Colors.white, offset: Offset(0, -0.0001), //y轴偏移量
boxShadow: const [ blurRadius: 4, //
BoxShadow( spreadRadius: 0, //
color: Color.fromRGBO(0, 0, 0, 0.15), )
offset: Offset(0, -0.0001), //y轴偏移量 ],
blurRadius: 4, // ),
spreadRadius: 0, // child: Row(children: [
) if (!jobTaskItem.isFixed!)
],
),
child: Row(children: [
Expanded( Expanded(
flex: 1,
child: InkWell(
onTap: (){
if(!jobTaskItem.isFixed!){
EasyLoading.show(status:'loading...');
logic.getCollect(jobTaskItem);
}
},
child: Container(
alignment: Alignment.center,
decoration: BoxDecoration(
border: Border(
right: BorderSide(
width: 1.r, color: const Color(0xFFDCDCDC))),
),
child: quickText('收集订正',
color: const Color(0xFF4CC793), size: 11.sp),
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Get.toNamed(Routes.jobReportPage, arguments: {
'title': jobTaskItem.name,
'homeworkId': jobTaskItem.id,
'grade': jobTaskItem.grade
});
},
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
child: quickText( child: quickText('查看报告',
'查看报告', color: const Color.fromRGBO(118, 118, 118, 1), color: const Color.fromRGBO(118, 118, 118, 1),
size: 11.sp), size: 11.sp),
), ),
), ),
]), ),
), ]),
), ),
], ],
), ),

View File

@ -1,26 +1,30 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:percent_indicator/percent_indicator.dart'; import 'package:percent_indicator/percent_indicator.dart';
import 'package:school_asignment_app/common/job/work_student.dart'; import 'package:school_asignment_app/common/job/work_student.dart';
import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:school_asignment_app/common/utils/enum_untils.dart'; import 'package:school_asignment_app/common/utils/enum_untils.dart';
import 'package:school_asignment_app/common/utils/toast_utils.dart';
import 'package:school_asignment_app/page/global_widget/my_text.dart'; import 'package:school_asignment_app/page/global_widget/my_text.dart';
import 'package:school_asignment_app/common/utils/utils.dart'; import 'package:school_asignment_app/common/utils/utils.dart';
import 'package:school_asignment_app/page/home_page/children/read_over/read_over_logic.dart';
import 'package:school_asignment_app/routes/app_pages.dart'; import 'package:school_asignment_app/routes/app_pages.dart';
class TaskListItem extends StatefulWidget { class TaskListItem extends StatefulWidget {
final bool completed; final bool completed;
final Items jobTaskItem; final Items jobTaskItem;
final int type; final int type;
final ReadOverLogic logic;
const TaskListItem({Key? key,required this.completed,required this.jobTaskItem,required this.type}) : super(key: key); const TaskListItem({Key? key,required this.completed,required this.jobTaskItem,required this.type,required this.logic}) : super(key: key);
@override @override
State<TaskListItem> createState() => _TaskListItemState(); State<TaskListItem> createState() => _TaskListItemState();
} }
class _TaskListItemState extends State<TaskListItem> { class _TaskListItemState extends State<TaskListItem>{
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -159,94 +163,107 @@ class _TaskListItemState extends State<TaskListItem> {
children: [ children: [
Container( Container(
margin: EdgeInsets.only(bottom: 16.h), margin: EdgeInsets.only(bottom: 16.h),
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 10.w),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: const Color.fromRGBO(255, 255, 255, 1),
boxShadow: const [
BoxShadow(
color: Color.fromRGBO(210, 216, 241, 1),
offset: Offset.zero, //y轴偏移量
blurRadius: 5.8, //
spreadRadius: 0, //
)
],
),
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 30.h), SizedBox(height: 30.h),
Container( Row(
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 10.w), crossAxisAlignment: CrossAxisAlignment.start,
width: double.infinity, children: [
decoration: BoxDecoration( Container(
borderRadius: BorderRadius.circular(6.r), width: Utils.isPad() ? 32.w : 38.w,
color: const Color.fromRGBO(255, 255, 255, 1), height: 18.h,
boxShadow: const [ alignment: Alignment.center,
BoxShadow( padding: EdgeInsets.only(left: Utils.isPad() ? 2.w : 3.w),
color: Color.fromRGBO(210, 216, 241, 1), decoration: BoxDecoration(
offset: Offset.zero, //y轴偏移量 color: widget.type == 1
blurRadius: 5.8, // ? const Color.fromRGBO(104, 136, 253, 1)
spreadRadius: 0, // : const Color.fromRGBO(255, 175, 56, 1),
) borderRadius: BorderRadius.only(
], topLeft: Radius.circular(14.r),
), topRight: Radius.circular(3.r),
child: Column( bottomLeft: Radius.circular(4.r),
mainAxisAlignment: MainAxisAlignment.spaceBetween, bottomRight: Radius.circular(4.r),
children: [ ),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: Utils.isPad() ? 32.w : 38.w,
height: 18.h,
alignment: Alignment.center,
padding: EdgeInsets.only(left: Utils.isPad() ? 2.w : 3.w),
decoration: BoxDecoration(
color: widget.type == 1
? const Color.fromRGBO(104, 136, 253, 1)
: const Color.fromRGBO(255, 175, 56, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(14.r),
topRight: Radius.circular(3.r),
bottomLeft: Radius.circular(4.r),
bottomRight: Radius.circular(4.r),
),
),
margin: EdgeInsets.only(right: 4.w),
child: quickText(widget.type == 1?'作业':'考试', color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(
widget.jobTaskItem.name,
maxLines: 2,
size: Utils.isPad() ? 14.sp : 16.sp,
color: const Color.fromRGBO(70, 70, 70, 1),
fontWeight: FontWeight.bold,
),
)
],
), ),
SizedBox(height: 10.h), margin: EdgeInsets.only(right: 4.w),
Row( child: quickText(widget.type == 1?'作业':'考试', color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(
widget.jobTaskItem.name,
maxLines: 2,
size: Utils.isPad() ? 14.sp : 16.sp,
color: const Color.fromRGBO(70, 70, 70, 1),
fontWeight: FontWeight.bold,
),
)
],
),
SizedBox(height: 10.h),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
quickText(
EnumUtils.formatSubject(widget.jobTaskItem.subject),
color: const Color.fromRGBO(97, 97, 97, 1),
size: 12.sp,
),
quickText(' / ',
color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
quickText('题量:', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp),
quickText( quickText(
EnumUtils.formatSubject(widget.jobTaskItem.subject), '10',
color: const Color.fromRGBO(97, 97, 97, 1), color: const Color.fromRGBO(97, 97, 97, 1),
size: 12.sp, size: 13.sp,
), ),
quickText(' / ',
color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
quickText('题量:', color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp),
quickText(
'10',
color: const Color.fromRGBO(97, 97, 97, 1),
size: 13.sp,
),
],
),
),
quickText(' / ',
color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
quickText(DateTime.parse(widget.jobTaskItem.publishTime).toString().substring(0,10),
color: const Color.fromRGBO(97, 97, 97, 1), size: 12.sp),
], ],
), ),
// FavoriteButton(jobTaskItem.id, jobTaskItem.title), ),
], quickText(' / ',
color: const Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
quickText(DateTime.parse(widget.jobTaskItem.publishTime).toString().substring(0,10),
color: const Color.fromRGBO(97, 97, 97, 1), size: 12.sp),
],
),
SizedBox(height: 10.h),
InkWell(
onTap: (){
if(!widget.jobTaskItem.isFixed!){
EasyLoading.show(status:'loading...');
widget.logic.getCollect(widget.jobTaskItem);
}
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 4.r,horizontal: 20.r),
decoration: BoxDecoration(
color: widget.jobTaskItem.isFixed!?Color(0xFFF4F4F4):Color(0xFFF2FFFA),
border: Border.all(width: 1.r,color:widget.jobTaskItem.isFixed!?Colors.transparent:Color(0xFF4CC793)),
borderRadius: BorderRadius.all(Radius.circular(20.r)),
),
child: Text(widget.jobTaskItem.isFixed!?'已订正':'收集订正',style: TextStyle(fontSize: 10.sp,color: const Color(0xFF4CC793)),),
), ),
), ),
// FavoriteButton(jobTaskItem.id, jobTaskItem.title),
], ],
), ),
), ),