no message

This commit is contained in:
1147192855@qq.com 2024-03-20 14:41:44 +08:00
parent ee487e63bd
commit 6a963c20e2
4 changed files with 80 additions and 80 deletions

View File

@ -11,7 +11,8 @@ import 'package:marking_app/utils/request/rest_client.dart';
/// isFavorite /// isFavorite
/// favoriteNum /// favoriteNum
class FavoriteWidget extends StatefulWidget { class FavoriteWidget extends StatefulWidget {
FavoriteWidget({Key? key}) : super(key: key); final Function call;
FavoriteWidget(this.call, {Key? key}) : super(key: key);
@override @override
_FavoriteState createState() => _FavoriteState(); _FavoriteState createState() => _FavoriteState();
@ -56,6 +57,7 @@ class _FavoriteState extends State<FavoriteWidget> with EventBusMixin<JobQuestio
BaseStructureResult<bool> res = await _client.toJobFavoriteCancel(favoriteVal); BaseStructureResult<bool> res = await _client.toJobFavoriteCancel(favoriteVal);
if (res.success) { if (res.success) {
_future = getData(favoriteVal.taskId, favoriteVal.studentId, _eventModel!.paperId); _future = getData(favoriteVal.taskId, favoriteVal.studentId, _eventModel!.paperId);
widget.call();
toUpState(setState, () {}, mounted); toUpState(setState, () {}, mounted);
} else { } else {
ToastUtils.showError(res.message ?? '操作失败,请重试'); ToastUtils.showError(res.message ?? '操作失败,请重试');

View File

@ -170,6 +170,7 @@ Widget $completedHomeworkView(BuildContext context,
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w), padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: isPad() ? 32.w : 36.w, width: isPad() ? 32.w : 36.w,
@ -188,11 +189,14 @@ Widget $completedHomeworkView(BuildContext context,
margin: EdgeInsets.only(right: 4.w), margin: EdgeInsets.only(right: 4.w),
child: quickText('作业', color: Colors.white, size: 10.sp), child: quickText('作业', color: Colors.white, size: 10.sp),
), ),
quickText( Expanded(
child: quickText(
jobTaskItem.title, jobTaskItem.title,
maxLines: 2,
size: 16.sp, size: 16.sp,
color: Color.fromRGBO(70, 70, 70, 1), color: Color.fromRGBO(70, 70, 70, 1),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
) )
], ],
), ),
@ -566,6 +570,7 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: isPad() ? 32.w : 38.w, width: isPad() ? 32.w : 38.w,
@ -586,11 +591,14 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
margin: EdgeInsets.only(right: 4.w), margin: EdgeInsets.only(right: 4.w),
child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp), child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp),
), ),
quickText( Expanded(
child: quickText(
jobTaskItem.title, jobTaskItem.title,
maxLines: 2,
size: isPad() ? 14.sp : 16.sp, size: isPad() ? 14.sp : 16.sp,
color: Color.fromRGBO(70, 70, 70, 1), color: Color.fromRGBO(70, 70, 70, 1),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
) )
], ],
), ),

View File

@ -73,7 +73,7 @@ class DoPapersJob extends HookWidget with EventBusMixin<DoPapersJobRefreshBus> {
backgroundColor: Colors.white, backgroundColor: Colors.white,
elevation: 0, elevation: 0,
actions: [ actions: [
FavoriteWidget(), FavoriteWidget(() => refresh = true),
// Container( // Container(
// padding: EdgeInsets.only(right: 4.w), // padding: EdgeInsets.only(right: 4.w),
// alignment: Alignment.center, // alignment: Alignment.center,
@ -156,6 +156,7 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
print('点击了...'); print('点击了...');
List<JobConcernedWithStudent>? students = await getStudents(); List<JobConcernedWithStudent>? students = await getStudents();
if (students == null) return; if (students == null) return;
students = students..sort((e, e1) => e.studentName.compareTo(e1.studentName));
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
elevation: 10, elevation: 10,
@ -189,14 +190,15 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
spacing: 6.0, // () spacing: 6.0, // ()
runSpacing: 4.0, // runSpacing: 4.0, //
alignment: WrapAlignment.spaceAround, //沿 alignment: WrapAlignment.spaceAround, //沿
children: students.map((e) { children: students!.map((e) {
return Chip( return Chip(
labelPadding: EdgeInsets.symmetric(vertical: 1.5.h, horizontal: 5.w),
backgroundColor: Color.fromRGBO(239, 242, 255, 1), backgroundColor: Color.fromRGBO(239, 242, 255, 1),
avatar: CircleAvatar( // avatar: CircleAvatar(
backgroundColor: Colors.white, // backgroundColor: Colors.white,
child: quickText(e.studentName.substring(0, 1), // child: quickText(e.studentName.substring(0, 1),
size: 12.sp, color: Theme.of(context).primaryColor), // size: 12.sp, color: Theme.of(context).primaryColor),
), // ),
label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp), label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp),
); );
}).toList(), }).toList(),

View File

@ -159,7 +159,7 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
).show(context); ).show(context);
} }
print('进入页面................');
if (task.isFinish) { if (task.isFinish) {
return AchievementView( return AchievementView(
elevation: 0.5, elevation: 0.5,
@ -175,8 +175,10 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) { RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) {
if (value == true) { if (value == true) {
isRefresh = true; isRefresh = true;
getListOfJobFavoritesData().then((value) {
_future = getData(); _future = getData();
toUpState(setState, () {}, mounted); toUpState(setState, () {}, mounted);
});
} }
}); });
} }
@ -279,8 +281,11 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
transition: getTransition(), transition: getTransition(),
) )
.then((value) async { .then((value) async {
_future = getData() isRefresh = true;
..then((value) => getListOfJobFavoritesData().then((value) => toUpState(setState, () {}, mounted))); getListOfJobFavoritesData().then((value) {
_future = getData();
toUpState(setState, () {}, mounted);
});
}); });
} }
@ -321,7 +326,7 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
if (_result.data?.isEmpty ?? true) { if (_result.data?.isEmpty ?? true) {
return ToastUtils.showError('获取到的学生列表为空'); return ToastUtils.showError('获取到的学生列表为空');
} }
students = _result.data!; students = _result.data!..sort((e, e1) => e.studentName.compareTo(e1.studentName));
} catch (e) { } catch (e) {
return ToastUtils.showError('获取学生列表失败'); return ToastUtils.showError('获取学生列表失败');
} finally { } finally {
@ -363,11 +368,12 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
children: students.map((e) { children: students.map((e) {
return Chip( return Chip(
backgroundColor: Color.fromRGBO(239, 242, 255, 1), backgroundColor: Color.fromRGBO(239, 242, 255, 1),
avatar: CircleAvatar( labelPadding: EdgeInsets.symmetric(vertical: 1.5.h, horizontal: 5.w),
backgroundColor: Colors.white, // avatar: CircleAvatar(
child: quickText(e.studentName.substring(0, 1), // backgroundColor: Colors.white,
size: 12.sp, color: Theme.of(context).primaryColor), // child: quickText(e.studentName.substring(0, 1),
), // size: 12.sp, color: Theme.of(context).primaryColor),
// ),
label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp), label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp),
); );
}).toList(), }).toList(),
@ -624,19 +630,21 @@ class TabletEndCompleted extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Material( child: Material(
color: Color.fromRGBO(104, 136, 253, 1), color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
child: InkWell( child: InkWell(
onTap: () => easyThrottle( onTap: () => easyThrottle(
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className, true)), 'OneClickReview', () => showStudentList([taskItem.id], taskItem.className, true)),
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
splashColor: Theme.of(context).primaryColor,
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 4.h), padding: EdgeInsets.symmetric(vertical: 4.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
), ),
child: quickText('已提交:${taskItem.commitStudentCount}', size: 8.sp, color: Colors.white), child: quickText('已提交:${taskItem.commitStudentCount}',
size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
), ),
), ),
), ),
@ -650,6 +658,7 @@ class TabletEndCompleted extends StatelessWidget {
child: InkWell( child: InkWell(
onTap: () => easyThrottle( onTap: () => easyThrottle(
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className)), 'OneClickReview', () => showStudentList([taskItem.id], taskItem.className)),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -669,6 +678,7 @@ class TabletEndCompleted extends StatelessWidget {
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: InkWell( child: InkWell(
onTap: () => bookmarks(taskItem), onTap: () => bookmarks(taskItem),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -886,9 +896,7 @@ class MobileEndCompleted extends StatelessWidget {
) )
], ],
), ),
child: Row( child: Row(children: [
children: task.isFinish
? [
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(task)), onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(task)),
@ -907,28 +915,7 @@ class MobileEndCompleted extends StatelessWidget {
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp), child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp),
), ),
)), )),
] ]),
: [
Expanded(
child: InkWell(
onTap: () => easyThrottle('go_to_review_homework', () {}),
child: Container(
alignment: Alignment.center,
child: quickText('批阅', color: Color.fromRGBO(79, 79, 79, 1), size: 13.sp),
),
),
),
Container(width: 1.w, height: 36.h, color: Color.fromRGBO(221, 221, 221, 1)),
Expanded(
child: InkWell(
onTap: () => easyThrottle('go_to_end_review_homework', () => {}),
child: Container(
alignment: Alignment.center,
child: quickText('结束批阅', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp),
),
)),
],
),
), ),
], ],
)); ));
@ -1066,9 +1053,10 @@ Widget $itemDataViewOfPad(
Expanded( Expanded(
flex: 4, flex: 4,
child: Material( child: Material(
color: Color.fromRGBO(104, 136, 253, 1), color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
child: InkWell( child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => easyThrottle('OneClickReview', () { onTap: () => easyThrottle('OneClickReview', () {
if (!task.canMarking) { if (!task.canMarking) {
return AchievementView( return AchievementView(
@ -1085,10 +1073,8 @@ Widget $itemDataViewOfPad(
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 3.h), padding: EdgeInsets.symmetric(vertical: 3.h),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
borderRadius: BorderRadius.circular(20.r), child: quickText('一键批阅', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
child: quickText('一键批阅', size: 8.sp, color: Colors.white),
), ),
), ),
), ),
@ -1101,6 +1087,7 @@ Widget $itemDataViewOfPad(
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: InkWell( child: InkWell(
onTap: () => quickDataCheck(task), onTap: () => quickDataCheck(task),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -1118,6 +1105,7 @@ Widget $itemDataViewOfPad(
color: Color.fromRGBO(244, 244, 244, 1), color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: InkWell( child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => bookmarks(task), onTap: () => bookmarks(task),
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
@ -1582,7 +1570,7 @@ Widget $completedHomeworkProgressBar(
percent: percent, percent: percent,
center: Text( center: Text(
percentStr, percentStr,
style: TextStyle(color: Colors.white, fontSize: 6.sp), style: TextStyle(color: Colors.white, fontSize: 4.5.sp),
), ),
// linearStrokeCap: LinearStrokeCap.butt, // linearStrokeCap: LinearStrokeCap.butt,
progressColor: color, progressColor: color,