no message

This commit is contained in:
1147192855@qq.com 2024-06-11 18:39:40 +08:00
parent a481b05782
commit 8a1d7a1dec
14 changed files with 818 additions and 210 deletions

View File

@ -54,6 +54,60 @@
<div class="content unicode" style="display: block;"> <div class="content unicode" style="display: block;">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont">&#xe62c;</span>
<div class="name">Frame-1</div>
<div class="code-name">&amp;#xe62c;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62a;</span>
<div class="name">Frame-2</div>
<div class="code-name">&amp;#xe62a;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe62b;</span>
<div class="name">Frame</div>
<div class="code-name">&amp;#xe62b;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe63f;</span>
<div class="name">Frame 2223726</div>
<div class="code-name">&amp;#xe63f;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe640;</span>
<div class="name">Frame 2223727</div>
<div class="code-name">&amp;#xe640;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe641;</span>
<div class="name">Frame 2223723</div>
<div class="code-name">&amp;#xe641;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe642;</span>
<div class="name">Frame 2223725</div>
<div class="code-name">&amp;#xe642;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe643;</span>
<div class="name">Frame 2223728</div>
<div class="code-name">&amp;#xe643;</div>
</li>
<li class="dib">
<span class="icon iconfont">&#xe644;</span>
<div class="name">Frame 2223724</div>
<div class="code-name">&amp;#xe644;</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont">&#xe63e;</span> <span class="icon iconfont">&#xe63e;</span>
<div class="name">Frame</div> <div class="name">Frame</div>
@ -414,9 +468,9 @@
<pre><code class="language-css" <pre><code class="language-css"
>@font-face { >@font-face {
font-family: 'iconfont'; font-family: 'iconfont';
src: url('iconfont.woff2?t=1710142362036') format('woff2'), src: url('iconfont.woff2?t=1718091057560') format('woff2'),
url('iconfont.woff?t=1710142362036') format('woff'), url('iconfont.woff?t=1718091057560') format('woff'),
url('iconfont.ttf?t=1710142362036') format('truetype'); url('iconfont.ttf?t=1718091057560') format('truetype');
} }
</code></pre> </code></pre>
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3> <h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
@ -442,6 +496,87 @@
<div class="content font-class"> <div class="content font-class">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<span class="icon iconfont icon-Frame-114"></span>
<div class="name">
Frame-1
</div>
<div class="code-name">.icon-Frame-114
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-Frame-25"></span>
<div class="name">
Frame-2
</div>
<div class="code-name">.icon-Frame-25
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-Frame15"></span>
<div class="name">
Frame
</div>
<div class="code-name">.icon-Frame15
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223726"></span>
<div class="name">
Frame 2223726
</div>
<div class="code-name">.icon-a-Frame2223726
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223727"></span>
<div class="name">
Frame 2223727
</div>
<div class="code-name">.icon-a-Frame2223727
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223723"></span>
<div class="name">
Frame 2223723
</div>
<div class="code-name">.icon-a-Frame2223723
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223725"></span>
<div class="name">
Frame 2223725
</div>
<div class="code-name">.icon-a-Frame2223725
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223728"></span>
<div class="name">
Frame 2223728
</div>
<div class="code-name">.icon-a-Frame2223728
</div>
</li>
<li class="dib">
<span class="icon iconfont icon-a-Frame2223724"></span>
<div class="name">
Frame 2223724
</div>
<div class="code-name">.icon-a-Frame2223724
</div>
</li>
<li class="dib"> <li class="dib">
<span class="icon iconfont icon-Frame14"></span> <span class="icon iconfont icon-Frame14"></span>
<div class="name"> <div class="name">
@ -982,6 +1117,78 @@
<div class="content symbol"> <div class="content symbol">
<ul class="icon_lists dib-box"> <ul class="icon_lists dib-box">
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-Frame-114"></use>
</svg>
<div class="name">Frame-1</div>
<div class="code-name">#icon-Frame-114</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-Frame-25"></use>
</svg>
<div class="name">Frame-2</div>
<div class="code-name">#icon-Frame-25</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-Frame15"></use>
</svg>
<div class="name">Frame</div>
<div class="code-name">#icon-Frame15</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223726"></use>
</svg>
<div class="name">Frame 2223726</div>
<div class="code-name">#icon-a-Frame2223726</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223727"></use>
</svg>
<div class="name">Frame 2223727</div>
<div class="code-name">#icon-a-Frame2223727</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223723"></use>
</svg>
<div class="name">Frame 2223723</div>
<div class="code-name">#icon-a-Frame2223723</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223725"></use>
</svg>
<div class="name">Frame 2223725</div>
<div class="code-name">#icon-a-Frame2223725</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223728"></use>
</svg>
<div class="name">Frame 2223728</div>
<div class="code-name">#icon-a-Frame2223728</div>
</li>
<li class="dib">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-a-Frame2223724"></use>
</svg>
<div class="name">Frame 2223724</div>
<div class="code-name">#icon-a-Frame2223724</div>
</li>
<li class="dib"> <li class="dib">
<svg class="icon svg-icon" aria-hidden="true"> <svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icon-Frame14"></use> <use xlink:href="#icon-Frame14"></use>

View File

@ -1,8 +1,8 @@
@font-face { @font-face {
font-family: "iconfont"; /* Project id 3423846 */ font-family: "iconfont"; /* Project id 3423846 */
src: url('iconfont.woff2?t=1710142362036') format('woff2'), src: url('iconfont.woff2?t=1718091057560') format('woff2'),
url('iconfont.woff?t=1710142362036') format('woff'), url('iconfont.woff?t=1718091057560') format('woff'),
url('iconfont.ttf?t=1710142362036') format('truetype'); url('iconfont.ttf?t=1718091057560') format('truetype');
} }
.iconfont { .iconfont {
@ -13,6 +13,42 @@
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
.icon-Frame-114:before {
content: "\e62c";
}
.icon-Frame-25:before {
content: "\e62a";
}
.icon-Frame15:before {
content: "\e62b";
}
.icon-a-Frame2223726:before {
content: "\e63f";
}
.icon-a-Frame2223727:before {
content: "\e640";
}
.icon-a-Frame2223723:before {
content: "\e641";
}
.icon-a-Frame2223725:before {
content: "\e642";
}
.icon-a-Frame2223728:before {
content: "\e643";
}
.icon-a-Frame2223724:before {
content: "\e644";
}
.icon-Frame14:before { .icon-Frame14:before {
content: "\e63e"; content: "\e63e";
} }

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,69 @@
"css_prefix_text": "icon-", "css_prefix_text": "icon-",
"description": "", "description": "",
"glyphs": [ "glyphs": [
{
"icon_id": "40679475",
"name": "Frame-1",
"font_class": "Frame-114",
"unicode": "e62c",
"unicode_decimal": 58924
},
{
"icon_id": "40679413",
"name": "Frame-2",
"font_class": "Frame-25",
"unicode": "e62a",
"unicode_decimal": 58922
},
{
"icon_id": "40679411",
"name": "Frame",
"font_class": "Frame15",
"unicode": "e62b",
"unicode_decimal": 58923
},
{
"icon_id": "39942228",
"name": "Frame 2223726",
"font_class": "a-Frame2223726",
"unicode": "e63f",
"unicode_decimal": 58943
},
{
"icon_id": "39942227",
"name": "Frame 2223727",
"font_class": "a-Frame2223727",
"unicode": "e640",
"unicode_decimal": 58944
},
{
"icon_id": "39942225",
"name": "Frame 2223723",
"font_class": "a-Frame2223723",
"unicode": "e641",
"unicode_decimal": 58945
},
{
"icon_id": "39942224",
"name": "Frame 2223725",
"font_class": "a-Frame2223725",
"unicode": "e642",
"unicode_decimal": 58946
},
{
"icon_id": "39942226",
"name": "Frame 2223728",
"font_class": "a-Frame2223728",
"unicode": "e643",
"unicode_decimal": 58947
},
{
"icon_id": "39942223",
"name": "Frame 2223724",
"font_class": "a-Frame2223724",
"unicode": "e644",
"unicode_decimal": 58948
},
{ {
"icon_id": "39483566", "icon_id": "39483566",
"name": "Frame", "name": "Frame",

View File

@ -1,4 +1,5 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:get/get_connect/http/src/request/request.dart';
import 'package:json_annotation/json_annotation.dart'; import 'package:json_annotation/json_annotation.dart';
part 'do_paper_details_result.g.dart'; part 'do_paper_details_result.g.dart';
@ -127,33 +128,43 @@ class StudentQuestions extends Object {
@JsonKey(name: 'questionNo') @JsonKey(name: 'questionNo')
int questionNo; int questionNo;
//
@JsonKey(name: 'score') @JsonKey(name: 'score')
int? score; int? score;
//
@JsonKey(name: 'scoreStep') @JsonKey(name: 'scoreStep')
int? scoreStep; int? scoreStep;
//
@JsonKey(name: 'isNeedAnnotate') @JsonKey(name: 'isNeedAnnotate')
bool isNeedAnnotate; bool isNeedAnnotate;
//
@JsonKey(name: 'studentScore') @JsonKey(name: 'studentScore')
int? studentScore; int? studentScore;
//
@JsonKey(name: 'isCorrect') @JsonKey(name: 'isCorrect')
bool? isCorrect; bool? isCorrect;
//
@JsonKey(name: 'correctRate') @JsonKey(name: 'correctRate')
int correctRate; int correctRate;
StudentQuestions( @JsonKey(name: 'height')
this.questionNo, double height;
StudentQuestions({
required this.height,
required this.questionNo,
required this.correctRate,
required this.isNeedAnnotate,
this.score, this.score,
this.scoreStep, this.scoreStep,
this.isNeedAnnotate,
this.studentScore, this.studentScore,
this.isCorrect, this.isCorrect,
this.correctRate, });
);
factory StudentQuestions.fromJson(Map<String, dynamic> srcJson) => _$StudentQuestionsFromJson(srcJson); factory StudentQuestions.fromJson(Map<String, dynamic> srcJson) => _$StudentQuestionsFromJson(srcJson);

View File

@ -0,0 +1,61 @@
import 'package:json_annotation/json_annotation.dart';
part 'do_test_questions_image_info.g.dart';
@JsonSerializable()
class TestQuestionsImageInfo extends Object {
@JsonKey(name: 'boxHeight')
double boxHeight;
@JsonKey(name: 'boxWidth')
double boxWidth;
@JsonKey(name: 'imageWidth') //
double imageWidth;
@JsonKey(name: 'imageHeight') //
double imageHeight;
@JsonKey(name: 'url')
String url;
@JsonKey(name: 'actualImgWidth') //
double actualImgWidth;
@JsonKey(name: 'actualImgHeight') //
double actualImgHeight;
@JsonKey(name: 'remainingHeight') // .()
double remainingHeight;
//
@JsonKey(name: 'scaleRatio')
double scaleRatio;
//
@JsonKey(name: 'zoom')
double zoom;
TestQuestionsImageInfo({
required this.url,
required this.boxWidth,
required this.boxHeight,
required this.imageWidth,
required this.imageHeight,
this.scaleRatio = 1,
this.zoom = 1,
this.actualImgWidth = 0,
this.actualImgHeight = 0,
this.remainingHeight = 0,
}) {
//
scaleRatio = boxWidth / imageWidth;
actualImgWidth = imageWidth * scaleRatio;
actualImgHeight = imageHeight * scaleRatio;
remainingHeight = boxHeight - actualImgHeight;
}
factory TestQuestionsImageInfo.fromJson(Map<String, dynamic> srcJson) => _$TestQuestionsImageInfoFromJson(srcJson);
Map<String, dynamic> toJson() => _$TestQuestionsImageInfoToJson(this);
}

View File

@ -20,6 +20,9 @@ Widget $theCachedNetworkImage(ImageWidgetBuilder imageBuilder, {required String
imageUrl: imageUrl, imageUrl: imageUrl,
imageBuilder: imageBuilder, imageBuilder: imageBuilder,
placeholder: (context, url) => Center(child: SpinKitWave(color: Theme.of(context).primaryColor, size: 50.r)), placeholder: (context, url) => Center(child: SpinKitWave(color: Theme.of(context).primaryColor, size: 50.r)),
errorListener: (e) {
print('图片报错.............$e');
},
errorWidget: (context, url, error) { errorWidget: (context, url, error) {
return GestureDetector( return GestureDetector(
onTap: () => (useImgRefsh.imageKey.value = UniqueKey()), onTap: () => (useImgRefsh.imageKey.value = UniqueKey()),

View File

@ -4,6 +4,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart'; import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
import 'package:making_school_asignment_app/common/utils/utils.dart'; import 'package:making_school_asignment_app/common/utils/utils.dart';
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
import '../configuration_files/index.dart'; import '../configuration_files/index.dart';
@ -53,102 +54,155 @@ class _BottomAnnotationSwitchJobState extends State<BottomAnnotationSwitch> with
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double iconSize = 24.sp; double iconSize = 18.sp;
Color actionColor = Colors.white; Color actionColor = Colors.white;
Color defaultColor = const Color.fromRGBO(132, 146, 163, 1); Color defaultColor = const Color.fromRGBO(132, 146, 163, 1);
return Container( return Container(
width: double.infinity, width: double.infinity,
height: _animationController.value * 44.h, height: _animationController.value * 64.h,
color: const Color.fromRGBO(83, 83, 83, 1), color: const Color.fromRGBO(83, 83, 83, 1),
padding: EdgeInsets.symmetric(vertical: 1.h), // padding: EdgeInsets.symmetric(vertical: 1.h),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
Expanded( Expanded(
flex: 8, flex: 7,
child: Row( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
InkWell( Expanded(
onTap: () => easyThrottle('BottomAnnotationSwitch', () { child: Row(
// if (jobNotesModel != null) { children: [
// return AchievementView( //
// elevation: 5, Expanded(
// duration: Duration(seconds: 1), child: SizedBox(
// title: "笔记回显提示", width: double.infinity,
// subTitle: "当前正处于笔记回显", height: double.infinity,
// color: Theme.of(context).primaryColor, child: IconButton(
// ).show(context); icon: Obx(() {
// }
// easyThrottle('setSwitchBrush', () => ref.read(annotationGraffitiSwitchProvider.notifier).setSwitchBrush());
_logicControl.pen.value = !_logicControl.pen.value;
}),
child: Obx(() {
return Icon( return Icon(
const IconData(0xe635, fontFamily: "AlibabaIcon"), const IconData(0xe635, fontFamily: "AlibabaIcon"),
size: iconSize, size: iconSize,
color: _logicControl.pen.value ? actionColor : defaultColor, color: _logicControl.pen.value ? actionColor : defaultColor,
); );
}), }),
), onPressed: () => easyThrottle('homework_bottom_action_bar_annotations', () {
InkWell( _logicControl.gestureMove.value = false;
onTap: () => easyThrottle('BottomAnnotationSwitch', () {
// if (jobNotesModel != null) {
// return AchievementView(
// elevation: 5,
// duration: Duration(seconds: 1),
// title: "笔记回显提示",
// subTitle: "当前正处于笔记回显",
// color: Theme.of(context).primaryColor,
// ).show(context);
// }
// easyThrottle('setSwitchBrush', () => ref.read(annotationGraffitiSwitchProvider.notifier).setSwitchBrush());
_logicControl.pen.value = !_logicControl.pen.value; _logicControl.pen.value = !_logicControl.pen.value;
}), }),
child: Icon(const IconData(0xe638, fontFamily: "AlibabaIcon"), size: iconSize, color: defaultColor),
), ),
InkWell( ),
onTap: () => easyThrottle('BottomAnnotationSwitch', () { ),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
//
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: IconButton(
icon: Obx(
() {
return Icon(
const IconData(0xe636, fontFamily: "AlibabaIcon"),
size: iconSize,
color: _logicControl.gestureMove.value ? actionColor : defaultColor,
);
},
),
onPressed: () => easyThrottle('homework_bottom_action_bar_annotations', () {
_logicControl.pen.value = false;
_logicControl.gestureMove.value = !_logicControl.gestureMove.value; _logicControl.gestureMove.value = !_logicControl.gestureMove.value;
}), }),
// IconData(0xe62f, fontFamily: "AlibabaIcon")
child: Icon(const IconData(0xe636, fontFamily: "AlibabaIcon"),
size: iconSize, color: _logicControl.gestureMove.value ? actionColor : defaultColor),
), ),
InkWell( ),
onTap: () => easyThrottle('BottomAnnotationSwitch', () { ),
// TODO Container(width: 0.3.w, height: double.infinity, color: Colors.white),
}), //
child: Icon(const IconData(0xe637, fontFamily: "AlibabaIcon"), size: iconSize, color: defaultColor), Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: TextButton(
child: quickText('全 对', color: Colors.white, size: 12.sp),
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () {}),
),
),
), ),
], ],
), ),
), ),
Container(width: double.infinity, color: Colors.white, height: 0.5.h),
Expanded( Expanded(
flex: 2, child: Row(
child: Container( children: [
child: InkWell( //
onTap: () => easyThrottle('BottomAnnotationSwitch', () { Expanded(
// if (jobNotesModel != null) { child: SizedBox(
// return AchievementView( width: double.infinity,
// elevation: 5, height: double.infinity,
// duration: Duration(seconds: 1), child: IconButton(
// title: "笔记回显提示", onPressed: () => easyThrottle('homework_bottom_action_bar_annotations', () {}),
// subTitle: "当前正处于笔记回显", icon: Icon(const IconData(0xe638, fontFamily: "AlibabaIcon"), size: iconSize, color: defaultColor),
// color: Theme.of(context).primaryColor,
// ).show(context);
// }
// easyThrottle('setSwitchBrush', () => ref.read(annotationGraffitiSwitchProvider.notifier).setSwitchBrush());
_logicControl.opControl.value = !_logicControl.opControl.value;
}),
child: Icon(
const IconData(0xe639, fontFamily: "AlibabaIcon"),
size: iconSize,
color: _logicControl.opControl.value ? actionColor : defaultColor,
), ),
), ),
), ),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: IconButton(
icon: Icon(const IconData(0xe637, fontFamily: "AlibabaIcon"), size: iconSize, color: defaultColor),
onPressed: () => easyThrottle('homework_bottom_action_bar_annotations', () {}),
),
),
),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
//
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: TextButton(
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () {}),
child: quickText('全 错', color: Colors.white, size: 12.sp),
),
),
),
],
),
),
],
),
),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
Expanded(
flex: 3,
child: Row(
children: [
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: TextButton(
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () {}),
child: quickText('取 消', size: 12.sp, color: Colors.white),
),
),
),
Container(width: 0.3.w, height: double.infinity, color: Colors.white),
Expanded(
child: SizedBox(
width: double.infinity,
height: double.infinity,
child: TextButton(
onPressed: () => easyThrottle('homework_bottom_operation_bar_scoring_related', () {}),
child: quickText('提 交', size: 12.sp, color: const Color.fromRGBO(76, 199, 147, 1)),
),
),
),
],
),
), ),
], ],
), ),

View File

@ -165,7 +165,7 @@ Widget $continueToReview(BuildContext context, {bool isFloatingAction = false})
tooltip: "继续批阅", tooltip: "继续批阅",
backgroundColor: Colors.white, backgroundColor: Colors.white,
onPressed: callFun, onPressed: callFun,
child: Icon(Icons.flip_camera_android_outlined, size: 30.sp, color: Theme.of(context).primaryColor), child: Icon(Icons.flip_camera_android_outlined, size: 20.sp, color: Theme.of(context).primaryColor),
); );
} }
return Expanded( return Expanded(

View File

@ -1,3 +1,5 @@
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
@ -6,9 +8,12 @@ import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/config/request_config.dart'; import 'package:making_school_asignment_app/common/config/request_config.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart'; import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart'; import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_test_questions_image_info.dart';
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart'; import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
import 'package:making_school_asignment_app/common/utils/cached_network_img.dart'; import 'package:making_school_asignment_app/common/utils/cached_network_img.dart';
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
import 'package:making_school_asignment_app/page/home_page/children/homework_review/configuration_files/index.dart'; import 'package:making_school_asignment_app/page/home_page/children/homework_review/configuration_files/index.dart';
import 'package:percent_indicator/linear_percent_indicator.dart';
import 'dropdown_switch_students_type.dart'; import 'dropdown_switch_students_type.dart';
@ -28,14 +33,23 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) { return Row(
children: [
//
Expanded(
flex: 7,
child: LayoutBuilder(builder: (BuildContext context, BoxConstraints constraints) {
var maxWidth = constraints.maxWidth; var maxWidth = constraints.maxWidth;
var maxHeight = constraints.maxHeight; var maxHeight = constraints.maxHeight;
return Stack( return Stack(
children: [ children: [
$MainBox(maxWidth, maxHeight), //
$QuestionImageView(maxWidth, maxHeight, sateData),
//
Positioned(right: 3.w, bottom: 4.h, child: const $ContinueToReview(isFloatingAction: true)),
//
Positioned( Positioned(
left: 3.w, left: 2.w,
top: (maxHeight / 2) - 20.h, top: (maxHeight / 2) - 20.h,
child: Obx(() { child: Obx(() {
LastPage? lastPageVal = sateData.data.value?.lastPage; LastPage? lastPageVal = sateData.data.value?.lastPage;
@ -57,6 +71,7 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
); );
}), }),
), ),
//
Positioned( Positioned(
right: 2.w, right: 2.w,
top: (maxHeight / 2) - 20.h, top: (maxHeight / 2) - 20.h,
@ -81,65 +96,31 @@ class _QuestionPaperViewState extends State<QuestionPaperView> {
), ),
], ],
); );
});
}
}
@swidget
Widget $mainBox(double maxWidth, double maxHeight) {
final sateData = Get.find<HomeworkReviewLogic>().state;
final scrollController = useScrollController();
//
useEffect(() {
scrollController.addListener(() {
//
print(scrollController.offset);
});
//
return () => scrollController.dispose();
}, [scrollController]);
// ScrollController? controller;
return Row(
children: [
Expanded(
flex: 7,
child: Stack(
alignment: const FractionalOffset(0.94, 0.94),
children: [
Container(
width: maxWidth,
height: maxHeight,
alignment: Alignment.center,
child: SingleChildScrollView(
controller: scrollController,
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical, //
child: Obx(() {
var imageUrl = sateData.data.value?.zgtAnswer;
if (imageUrl == null) return const SizedBox();
return $TheCachedNetworkImage(
(context, imageProvider) {
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
// imageStream?.removeListener(theImageStreamListener);
// imageStream = imageWidget.image.resolve(ImageConfiguration())..addListener(theImageStreamListener);
return imageWidget;
},
imageUrl: RequestConfig.imgUrl + imageUrl,
);
}), }),
), ),
), //
// Expanded(flex: 2, child: $QuestionNumberView(sateData)),
const $ContinueToReview(isFloatingAction: true)
], ],
), );
), }
Expanded( }
flex: 2,
child: Container( //
padding: EdgeInsets.only(bottom: 14.h, top: 6.h), @hwidget
Widget $questionNumberView(BuildContext context, HomeworkReviewState sateData) {
final scrollControllerNum = useScrollController(); //
useEffect(() {
StreamSubscription listenVal = sateData.slide.listen((e) => scrollControllerNum.jumpTo(e));
//
return () {
listenVal.cancel();
};
}, []);
return Container(
height: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: const Color.fromRGBO(159, 159, 159, 0.97), color: const Color.fromRGBO(159, 159, 159, 0.97),
boxShadow: [ boxShadow: [
@ -151,8 +132,184 @@ Widget $mainBox(double maxWidth, double maxHeight) {
) )
], ],
), ),
child: SingleChildScrollView(
controller: scrollControllerNum,
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical, //
child: Obx(() {
var imageVal = sateData.imageScale.value;
if (imageVal == null) return const SizedBox();
var studentQuestions = sateData.data.value?.studentQuestions;
return Padding(
padding: EdgeInsets.only(top: imageVal.remainingHeight > 0 ? imageVal.remainingHeight / 2 : 0),
child: Column(
children: studentQuestions?.asMap().keys.map((e) => $ScoringQuestionsView(studentQuestions[e], imageVal.scaleRatio)).toList() ?? [],
),
);
}),
),
);
}
//
@hwidget
Widget $scoringQuestionsView(BuildContext context, StudentQuestions item, double scaleRatio) {
var studentScore = useState<int?>(item.studentScore);
useValueChanged<int?, void>(studentScore.value, (_, __) {
item.studentScore = studentScore.value;
});
return Container(
alignment: Alignment.topCenter,
height: item.height * scaleRatio,
child: Stack(
children: [
Row(
children: [
//
Expanded(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), //
),
child: Icon(
size: 22.sp,
color: studentScore.value == 2 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
const IconData(0xe62b, fontFamily: "AlibabaIcon"),
),
onPressed: () => easyThrottle('scoring_homework_questions', () {
studentScore.value = studentScore.value == 2 ? null : 2;
}),
),
),
//
Expanded(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), //
),
child: Icon(
size: 22.sp,
color: studentScore.value == 1 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
const IconData(0xe62c, fontFamily: "AlibabaIcon"),
),
onPressed: () => easyThrottle('scoring_homework_questions', () {
studentScore.value = studentScore.value == 1 ? null : 1;
}),
),
),
//
Expanded(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
padding: EdgeInsets.only(top: 7.h, bottom: 3.h),
backgroundColor: const Color.fromRGBO(237, 237, 237, 1), //
shape: const RoundedRectangleBorder(borderRadius: BorderRadius.zero), //
),
child: Icon(
size: 22.sp,
color: studentScore.value == 0 ? const Color.fromRGBO(255, 152, 0, 1) : const Color.fromRGBO(114, 114, 114, 1),
const IconData(0xe62a, fontFamily: "AlibabaIcon"),
),
onPressed: () => easyThrottle('scoring_homework_questions', () {
studentScore.value = studentScore.value == 0 ? null : 0;
}),
), ),
), ),
], ],
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(width: 1.1.w),
quickText('${item.questionNo}', color: Theme.of(context).primaryColor.withOpacity(0.7), size: 8.sp),
if (item.correctRate > 0) quickText(' 正确率', color: Colors.grey, size: 5.sp),
if (item.correctRate > 0)
Expanded(
child: LinearPercentIndicator(
lineHeight: 6.h,
percent: item.correctRate / 100,
barRadius: Radius.circular(1.2.r),
alignment: MainAxisAlignment.center,
progressColor: const Color.fromRGBO(76, 199, 147, 0.6),
backgroundColor: const Color(0xFFB8C7CB).withOpacity(0.35),
center: quickText("${item.correctRate}%", size: 5.sp, align: TextAlign.center, color: Colors.white),
),
)
],
)
],
));
}
//
@hwidget
Widget $questionImageView(double maxWidth, double maxHeight, HomeworkReviewState sateData) {
final scrollControllerQuestion = useScrollController(); //
ImageStream? imageStream;
ImageStreamListener imageStreamListener = ImageStreamListener((ImageInfo info, bool _) {
print('屏幕宽高:宽:${maxWidth} 高:${maxHeight}');
print('图片的宽高width${info.image.width.toDouble()};高:${info.image.height.toDouble()}');
WidgetsBinding.instance.addPostFrameCallback((_) {
sateData.imageScale.value = TestQuestionsImageInfo(
boxWidth: maxWidth,
boxHeight: maxHeight,
imageWidth: info.image.width.toDouble(),
imageHeight: info.image.height.toDouble(),
url: sateData.data.value!.zgtAnswer,
);
});
});
//
useEffect(() {
scrollControllerQuestion.addListener(() {
//
sateData.slide.value = scrollControllerQuestion.offset;
});
//
return () {
imageStream?.removeListener(imageStreamListener);
};
}, []);
return Container(
height: maxHeight,
// padding: EdgeInsets.only(bottom: 2.h, top: 2.h),
alignment: Alignment.center,
child: SingleChildScrollView(
controller: scrollControllerQuestion,
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.zero,
scrollDirection: Axis.vertical, //
child: Obx(() {
var imageUrl = sateData.data.value?.zgtAnswer;
print(imageUrl);
if (imageUrl == null) return const SizedBox();
// return Container(
// color: Colors.green,
// height: 394.45145018915514,
// );
return $TheCachedNetworkImage(
(context, imageProvider) {
Image imageWidget = Image(image: imageProvider, fit: BoxFit.fitWidth);
imageStream?.removeListener(imageStreamListener);
imageStream = imageWidget.image.resolve(const ImageConfiguration())..addListener(imageStreamListener);
return imageWidget;
},
imageUrl: RequestConfig.imgUrl + imageUrl,
// imageUrl: 'https://cdn3-banquan.ituchong.com/weili/image/l/2000260200787476490.jpeg',
);
}),
),
); );
} }

View File

@ -3,6 +3,7 @@ import 'dart:async';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart'; import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_param.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart'; import 'package:making_school_asignment_app/common/job/marking_models/do_paper_details_result.dart';
import 'package:making_school_asignment_app/common/job/marking_models/do_test_questions_image_info.dart';
import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart'; import 'package:making_school_asignment_app/common/mixins/request_tool_mixin.dart';
import 'package:making_school_asignment_app/common/utils/toast_utils.dart'; import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
@ -14,6 +15,8 @@ class HomeworkReviewState {
// late String homeworkName; // late String homeworkName;
late Rx<DoPaperDetailsParam> param; late Rx<DoPaperDetailsParam> param;
late Rx<DoPaperDetailsResult?> data; late Rx<DoPaperDetailsResult?> data;
late Rx<double> slide; //
late Rx<TestQuestionsImageInfo?> imageScale;
// late String dateEnd = ''; // late String dateEnd = '';
// late int knowledgeId = 0; // late int knowledgeId = 0;
@ -40,6 +43,7 @@ class HomeworkReviewBinding extends Bindings {
class HomeworkReviewLogic extends GetxController with RequestToolMixin { class HomeworkReviewLogic extends GetxController with RequestToolMixin {
late StreamSubscription<DoPaperDetailsParam> _paramListen; late StreamSubscription<DoPaperDetailsParam> _paramListen;
late StreamSubscription<DoPaperDetailsResult?> _dataListen;
final HomeworkReviewState state = HomeworkReviewState(); final HomeworkReviewState state = HomeworkReviewState();
final HomeworkReviewAnnotationsControlState annotationState = HomeworkReviewAnnotationsControlState(); final HomeworkReviewAnnotationsControlState annotationState = HomeworkReviewAnnotationsControlState();
@ -53,13 +57,18 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
subject: Get.arguments['subject'], subject: Get.arguments['subject'],
).obs; ).obs;
state.data = Rx<DoPaperDetailsResult?>(null); state.data = Rx<DoPaperDetailsResult?>(null);
state.imageScale = Rx<TestQuestionsImageInfo?>(null);
state.slide = 0.0.obs;
getData(); getData();
// //
_paramListen = state.param.listen((e) => getData()); _paramListen = state.param.listen((e) => getData());
//
_dataListen = state.data.listen((e) => state.imageScale.value = null);
} }
@override @override
void disposeId(Object id) { void disposeId(Object id) {
_dataListen.cancel();
_paramListen.cancel(); _paramListen.cancel();
super.disposeId(id); super.disposeId(id);
} }
@ -68,6 +77,13 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
var timerControl = Timer(const Duration(milliseconds: 300), () => ToastUtils.showLoading()); var timerControl = Timer(const Duration(milliseconds: 300), () => ToastUtils.showLoading());
try { try {
DoPaperDetailsResult? data = await getClient().getDoPaperDetails(state.param.value); DoPaperDetailsResult? data = await getClient().getDoPaperDetails(state.param.value);
// var studentQuestions = data.studentQuestions;
// // 0
// for (var i = 0; i < studentQuestions.length; i++) {
// var item = studentQuestions[i];
// item.topHeight = itemPre.height;
// }
state.data.value = data; state.data.value = data;
} finally { } finally {
if (timerControl.isActive) timerControl.cancel(); if (timerControl.isActive) timerControl.cancel();