Merge remote-tracking branch 'origin/mcy_new' into mcy_new
This commit is contained in:
commit
bd8ef8bb57
|
|
@ -298,17 +298,19 @@ class _AnnotateItemState extends State<AnnotateItem> {
|
|||
: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () => easyThrottle('TO_GO_REVIEWHOMEWORK', () {
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky, overlays: []).then((_) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
Get.toNamed(Routes.reviewHomework, arguments: {
|
||||
'homeworkId': widget.homeworkId,
|
||||
'homeworkName': widget.name,
|
||||
'classId': itemData.classId,
|
||||
'subject': widget.logic.state.subject,
|
||||
});
|
||||
onTap: () => easyThrottle('TO_GO_REVIEWHOMEWORK', () async {
|
||||
await SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
Future.delayed(const Duration(milliseconds: 300), () {
|
||||
Get.toNamed(Routes.reviewHomework, arguments: {
|
||||
'homeworkId': widget.homeworkId,
|
||||
'homeworkName': widget.name,
|
||||
'classId': itemData.classId,
|
||||
'subject': widget.logic.state.subject,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Get.toNamed(Routes.reviewHomework, arguments: {
|
||||
// 'homeworkId': widget.homeworkId,
|
||||
// 'homeworkName': widget.name,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ class QuestionNumberView extends GetView<HomeworkReviewLogic> {
|
|||
var studentQuestions = sateData.studentQuestions.value ?? [];
|
||||
|
||||
return $QuestionNumberScrollView(
|
||||
controller:controller,
|
||||
controller: controller,
|
||||
sateData: sateData,
|
||||
sateZoomData: sateZoomData,
|
||||
studentQuestions: studentQuestions,
|
||||
|
|
@ -141,27 +141,34 @@ Widget $questionNumberScrollView({
|
|||
|
||||
// 单道题得分框
|
||||
@hwidget
|
||||
Widget $scoringQuestionsView(BuildContext context, List<StudentQuestions>? studentQuestions,StudentQuestions item, HomeworkReviewLogic logic, double scaleRatio, double initScale) {
|
||||
Widget $scoringQuestionsView(BuildContext context, List<StudentQuestions>? studentQuestions, StudentQuestions item, HomeworkReviewLogic logic, double scaleRatio, double initScale) {
|
||||
var studentScore = useState<int?>(item.studentScore);
|
||||
|
||||
useValueChanged<int?, void>(studentScore.value, (_, __) {
|
||||
item.studentScore = studentScore.value;
|
||||
|
||||
// 校验是否自动提交 对于已经批阅过的试题 不重复自动提交
|
||||
var annotateTime = logic.state.data.value?.annotateTime;
|
||||
if (annotateTime == null) {
|
||||
var noRatingGiven = studentQuestions!.firstWhereOrNull((e) => e.studentScore == null);
|
||||
if (noRatingGiven == null) logic.submit(context);
|
||||
}
|
||||
});
|
||||
|
||||
useValueChanged<StudentQuestions, void>(item, (_, __) {
|
||||
useValueChanged<int?, void>(item.studentScore, (_, __) {
|
||||
studentScore.value = item.studentScore;
|
||||
});
|
||||
|
||||
useEffect(() {
|
||||
return () {};
|
||||
/// 学生打分数据
|
||||
studentScoreListener() {
|
||||
item.studentScore = studentScore.value;
|
||||
if (item.studentScore == null) return;
|
||||
|
||||
// 校验是否自动提交 对于已经批阅过的试题 不重复自动提交
|
||||
var annotateTime = logic.state.data.value?.annotateTime;
|
||||
if (annotateTime == null) {
|
||||
var noRatingGiven = studentQuestions!.firstWhereOrNull((e) => e.studentScore == null);
|
||||
if (noRatingGiven == null) logic.submit(context);
|
||||
}
|
||||
}
|
||||
|
||||
studentScore.addListener(studentScoreListener);
|
||||
|
||||
return () {
|
||||
studentScore.removeListener(studentScoreListener);
|
||||
};
|
||||
}, []);
|
||||
|
||||
var padinVal = item.correctRate > 0 ? EdgeInsets.only(top: 6.4.h) : EdgeInsets.symmetric(vertical: 2.h);
|
||||
return Container(
|
||||
height: item.height! * scaleRatio * initScale,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import 'package:making_school_asignment_app/common/job/marking_models/do_test_qu
|
|||
import 'package:making_school_asignment_app/common/mixins/event_bus_mixin.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/toast_utils.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:zoom_widget/zoom_widget.dart';
|
||||
|
|
@ -307,7 +308,6 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
|||
sateData.zoomOffset = Offset(sateData.zoomOffset!.dx, -sateData.slide.value);
|
||||
}
|
||||
initPosition.value = sateData.zoomOffset;
|
||||
print("赋值 initPosition.value ${initPosition.value}");
|
||||
}
|
||||
});
|
||||
return () {
|
||||
|
|
@ -347,7 +347,17 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
|||
sateData.data.value?.zgtAnnotate = null;
|
||||
sateData.data.value?.showZgtAnnotate = null;
|
||||
if (sateData.data.value != null) {
|
||||
sateData.data.update((_) => logic.submit(Get.context ?? context));
|
||||
sateData.data.update((_) {
|
||||
var theStudentQuestions = sateData.studentQuestions.value;
|
||||
if (theStudentQuestions?.isNotEmpty ?? false) {
|
||||
var noMarking = theStudentQuestions?.firstWhereOrNull((e) => e.studentScore == null);
|
||||
if (noMarking != null) {
|
||||
ToastUtils.showInfo("未提交!请为第${noMarking.questionNo}题打分,再手动提交");
|
||||
return;
|
||||
}
|
||||
}
|
||||
logic.submit(Get.context ?? context);
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
|
|
@ -468,7 +478,7 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
|||
(dy - max(0, imageHeightOffsetStart) + ((zoomFile.imageHeightOffsetStart == null || zoomFile.imageHeightOffsetStart! <= 0.1) ? (sateData.zoomOffset?.dy.abs() ?? 0) : 0)) / theScale,
|
||||
);
|
||||
|
||||
print("最终位置 : $localPosition");
|
||||
// print("最终位置 : $localPosition");
|
||||
vnHandWritings.value = List.from(vnHandWritings.value)..add(localPosition);
|
||||
sateData.handwritings = vnHandWritings.value;
|
||||
},
|
||||
|
|
@ -496,19 +506,29 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
|||
backgroundColor: Colors.transparent,
|
||||
onScaleUpdate: logic.zoomLogic.onScaleUpdate,
|
||||
onPositionUpdate: logic.zoomLogic.onPanUpPosition,
|
||||
child: RepaintBoundary(
|
||||
key: logic.pictureOverviewKey,
|
||||
child: CustomPaint(
|
||||
// isComplex: true,
|
||||
// size: customPaintSize.value,
|
||||
foregroundPainter: DrawingPainter(ctrl: vnHandWritings),
|
||||
child: $TheCachedNetworkImage(
|
||||
child: Stack(
|
||||
children: [
|
||||
$TheCachedNetworkImage(
|
||||
imgWidth: maxWidth,
|
||||
imageUrl: showZgtAnnotate ?? sateData.data.value!.zgtAnswer,
|
||||
imageUrl: sateData.data.value!.zgtAnswer,
|
||||
(_, imageProvider) => Image(image: imageProvider, fit: BoxFit.fitWidth),
|
||||
),
|
||||
// child: showZgtAnnotate != null ? $TheCachedNetworkImage(imgWidth: maxWidth, imageUrl: showZgtAnnotate, (_, imageProvider) => Image(image: imageProvider, fit: BoxFit.fitWidth)) : null,
|
||||
),
|
||||
RepaintBoundary(
|
||||
key: logic.pictureOverviewKey,
|
||||
child: CustomPaint(
|
||||
// isComplex: true,
|
||||
size: Size(maxWidth, zoomState.zoomFile.value!.actualHeight!),
|
||||
foregroundPainter: DrawingPainter(ctrl: vnHandWritings),
|
||||
// child: $TheCachedNetworkImage(
|
||||
// imgWidth: maxWidth,
|
||||
// imageUrl: showZgtAnnotate ?? sateData.data.value!.zgtAnswer,
|
||||
// (_, imageProvider) => Image(image: imageProvider, fit: BoxFit.fitWidth),
|
||||
|
||||
// ),
|
||||
child: showZgtAnnotate != null ? $TheCachedNetworkImage(imgWidth: maxWidth, imageUrl: showZgtAnnotate, (_, imageProvider) => Image(image: imageProvider, fit: BoxFit.fitWidth)) : null,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -524,7 +544,7 @@ class DrawingPainter extends CustomPainter {
|
|||
final Paint paintBrush = Paint()
|
||||
..color = Colors.red
|
||||
..strokeCap = StrokeCap.round
|
||||
..strokeWidth = 0.75.sp;
|
||||
..strokeWidth = 0.7.sp;
|
||||
DrawingPainter({required this.ctrl}) : super(repaint: ctrl);
|
||||
|
||||
@override
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
|||
// var theImageScaleZoom = state.imageScaleZoom.value;
|
||||
// if (theImageScaleZoom == null || theImageScaleZoom.url != e?.url) state.imageScaleZoom.value = e;
|
||||
// });
|
||||
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => getData());
|
||||
super.onInit();
|
||||
}
|
||||
|
|
@ -173,7 +173,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
|||
|
||||
state.param.value.templateId ??= data.templateId;
|
||||
state.param.value.studentId ??= data.studentId;
|
||||
|
||||
|
||||
state.data.value = data;
|
||||
} catch (e) {
|
||||
print('获取数据报错了:$e');
|
||||
|
|
@ -189,28 +189,26 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
|||
void cancelAllRatings() {
|
||||
var studentQuestions = state.studentQuestions.value;
|
||||
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
|
||||
List<StudentQuestions> data = [];
|
||||
for (var e in studentQuestions!) {
|
||||
var newe = StudentQuestions.fromJson(e.toJson());
|
||||
newe.studentScore = null;
|
||||
data.add(newe);
|
||||
if (e.studentScore != null) {
|
||||
e.studentScore = null;
|
||||
}
|
||||
}
|
||||
state.studentQuestions.value = data;
|
||||
state.data.value?.studentQuestions = data;
|
||||
// state.studentQuestions.value = data;
|
||||
// state.data.value?.studentQuestions = data;
|
||||
state.studentQuestions.update((_) {});
|
||||
}
|
||||
|
||||
// 全部统一打分
|
||||
void allRating(int score) {
|
||||
var studentQuestions = state.studentQuestions.value;
|
||||
if (state.data.value?.studentQuestions.isEmpty ?? true) return;
|
||||
List<StudentQuestions> data = [];
|
||||
for (var e in studentQuestions!) {
|
||||
var newe = StudentQuestions.fromJson(e.toJson());
|
||||
newe.studentScore = score;
|
||||
data.add(newe);
|
||||
e.studentScore = score;
|
||||
}
|
||||
state.studentQuestions.value = data;
|
||||
state.data.value?.studentQuestions = data;
|
||||
// state.studentQuestions.value = data;
|
||||
// state.data.value?.studentQuestions = data;
|
||||
state.studentQuestions.update((_) {});
|
||||
}
|
||||
|
||||
// 全对评分
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:making_school_asignment_app/page/global_widget/ReturnToHomepage.dart';
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ class AnnotateList extends StatefulWidget {
|
|||
final int assessType;
|
||||
|
||||
const AnnotateList(
|
||||
{Key? key, required this.tabIndex, required this.assessType})
|
||||
: super(key: key);
|
||||
{super.key, required this.tabIndex, required this.assessType});
|
||||
|
||||
@override
|
||||
State<AnnotateList> createState() => _AnnotateListState();
|
||||
|
|
@ -72,6 +71,14 @@ class _AnnotateListState extends State<AnnotateList>
|
|||
getAnnotateList();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
refreshController1.dispose();
|
||||
refreshController2.dispose();
|
||||
tabController2.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
//待批阅列表
|
||||
void getUnAnnotateList() async {
|
||||
WorkStudent data = WorkStudent([], 0);
|
||||
|
|
@ -85,7 +92,7 @@ class _AnnotateListState extends State<AnnotateList>
|
|||
refreshController1.finishRefresh();
|
||||
refreshController2.finishRefresh();
|
||||
EasyLoading.dismiss();
|
||||
print('state.unAnnotateList.length=${unAnnotateList.length}');
|
||||
// print('state.unAnnotateList.length=${unAnnotateList.length}');
|
||||
}
|
||||
|
||||
//已批阅列表
|
||||
|
|
@ -102,7 +109,7 @@ class _AnnotateListState extends State<AnnotateList>
|
|||
refreshController1.finishRefresh();
|
||||
refreshController2.finishRefresh();
|
||||
EasyLoading.dismiss();
|
||||
print('state.annotateList.length=${annotateList.length}');
|
||||
// print('state.annotateList.length=${annotateList.length}');
|
||||
}
|
||||
|
||||
/// 刷新方法
|
||||
|
|
@ -264,7 +271,7 @@ Widget $easyRefresh({
|
|||
emptyWidget: data.isEmpty ? const MyEmptyWidget() : null,
|
||||
controller: controller,
|
||||
header: MaterialHeader(),
|
||||
footer: TaurusFooter(),
|
||||
footer: MaterialFooter(),
|
||||
child: completed && isPadFlag
|
||||
? GridView(
|
||||
padding: EdgeInsets.only(
|
||||
|
|
|
|||
|
|
@ -27,10 +27,7 @@ class Protocol extends Dialog {
|
|||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
quickText('用户协议与隐私政策',
|
||||
size: 15.sp,
|
||||
color: const Color.fromRGBO(37, 37, 37, 1),
|
||||
fontWeight: FontWeight.bold),
|
||||
quickText('用户协议与隐私政策', size: 15.sp, color: const Color.fromRGBO(37, 37, 37, 1), fontWeight: FontWeight.bold),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
|
|
@ -38,22 +35,15 @@ class Protocol extends Dialog {
|
|||
children: [
|
||||
Text.rich(TextSpan(children: [
|
||||
TextSpan(
|
||||
text:
|
||||
'感谢您选择点智学APP ! 我们非常重视您的个人信息和隐私保护。为了更好地保障您的个人权益,在您使用我们的产品前,请务必审慎阅读',
|
||||
style: TextStyle(
|
||||
fontSize: 13.sp,
|
||||
color: const Color.fromRGBO(51, 51, 51, 1)),
|
||||
text: '感谢您选择点智学APP ! 我们非常重视您的个人信息和隐私保护。为了更好地保障您的个人权益,在您使用我们的产品前,请务必审慎阅读',
|
||||
style: TextStyle(fontSize: 13.sp, color: const Color.fromRGBO(51, 51, 51, 1)),
|
||||
),
|
||||
TextSpan(
|
||||
text: '《隐私政策》',
|
||||
style: TextStyle(
|
||||
fontSize: 13.sp,
|
||||
color: Theme.of(context).primaryColor),
|
||||
style: TextStyle(fontSize: 13.sp, color: Theme.of(context).primaryColor),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () async {
|
||||
Get.toNamed(Routes.agreementPage, arguments: {
|
||||
"type": AGREEMENT_KEY.PRIVACY_GREEMENT.name
|
||||
});
|
||||
Get.toNamed(Routes.agreementPage, arguments: {"type": AGREEMENT_KEY.PRIVACY_GREEMENT.name});
|
||||
// RouterManager.router.navigateTo(
|
||||
// context,
|
||||
// '${RouterManager.agreementPath}?type=${AGREEMENT_KEY.PRIVACY_GREEMENT.name}',
|
||||
|
|
@ -63,20 +53,14 @@ class Protocol extends Dialog {
|
|||
),
|
||||
TextSpan(
|
||||
text: '和',
|
||||
style: TextStyle(
|
||||
fontSize: 13.sp,
|
||||
color: Color.fromRGBO(51, 51, 51, 1)),
|
||||
style: TextStyle(fontSize: 13.sp, color: const Color.fromRGBO(51, 51, 51, 1)),
|
||||
),
|
||||
TextSpan(
|
||||
text: '《用户协议》',
|
||||
style: TextStyle(
|
||||
fontSize: 13.sp,
|
||||
color: Theme.of(context).primaryColor),
|
||||
style: TextStyle(fontSize: 13.sp, color: Theme.of(context).primaryColor),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () async {
|
||||
Get.toNamed(Routes.agreementPage, arguments: {
|
||||
"type": AGREEMENT_KEY.USER_AGREEMENT.name
|
||||
});
|
||||
Get.toNamed(Routes.agreementPage, arguments: {"type": AGREEMENT_KEY.USER_AGREEMENT.name});
|
||||
// RouterManager.router.navigateTo(
|
||||
// context,
|
||||
// '${RouterManager.agreementPath}?type=${AGREEMENT_KEY.USER_AGREEMENT.name}',
|
||||
|
|
@ -85,11 +69,8 @@ class Protocol extends Dialog {
|
|||
},
|
||||
),
|
||||
TextSpan(
|
||||
text:
|
||||
'内的所有条款,尤其是:1.我们对您的个人信息的收集/保存/使用/对外提供/保护等规则条款,以及您的用户权利等条款;2.约定我们的限制责任、免责条款;3.其他以颜色或加粗进行标识的重要条款。如您对以上协议有任何疑问,可通过发邮件至yuanxuanjiaoyu@gmail.com与我们联系。您点击"同意并继续”的行为即表示您已阅读完毕并同意以上协议的全部内容。如您同意以上协议内容,请点击"同意并继续”,开始使用我们的产品和服务!',
|
||||
style: TextStyle(
|
||||
fontSize: 13.sp,
|
||||
color: const Color.fromRGBO(51, 51, 51, 1)),
|
||||
text: '内的所有条款,尤其是:1.我们对您的个人信息的收集/保存/使用/对外提供/保护等规则条款,以及您的用户权利等条款;2.约定我们的限制责任、免责条款;3.其他以颜色或加粗进行标识的重要条款。如您对以上协议有任何疑问,可通过发邮件至yuanxuanjiaoyu@gmail.com与我们联系。您点击"同意并继续”的行为即表示您已阅读完毕并同意以上协议的全部内容。如您同意以上协议内容,请点击"同意并继续”,开始使用我们的产品和服务!',
|
||||
style: TextStyle(fontSize: 13.sp, color: const Color.fromRGBO(51, 51, 51, 1)),
|
||||
),
|
||||
])),
|
||||
],
|
||||
|
|
@ -108,12 +89,8 @@ class Protocol extends Dialog {
|
|||
padding: EdgeInsets.only(top: 15.h),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
width: 0.5.r,
|
||||
color: const Color.fromRGBO(238, 238, 238, 1)),
|
||||
right: BorderSide(
|
||||
width: 0.5.r,
|
||||
color: const Color.fromRGBO(238, 238, 238, 1)),
|
||||
top: BorderSide(width: 0.5.r, color: const Color.fromRGBO(238, 238, 238, 1)),
|
||||
right: BorderSide(width: 0.5.r, color: const Color.fromRGBO(238, 238, 238, 1)),
|
||||
),
|
||||
),
|
||||
child: quickText('退出APP', size: 14.sp),
|
||||
|
|
@ -123,8 +100,7 @@ class Protocol extends Dialog {
|
|||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
StorageService.to
|
||||
.write(AppStorageKey.privacyAgreement.value, true);
|
||||
StorageService.to.write(AppStorageKey.privacyAgreement.value, true);
|
||||
Navigator.of(context).pop(true);
|
||||
},
|
||||
child: Container(
|
||||
|
|
@ -132,13 +108,10 @@ class Protocol extends Dialog {
|
|||
padding: EdgeInsets.only(top: 15.h),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(
|
||||
width: 0.5.r,
|
||||
color: const Color.fromRGBO(238, 238, 238, 1)),
|
||||
top: BorderSide(width: 0.5.r, color: const Color.fromRGBO(238, 238, 238, 1)),
|
||||
),
|
||||
),
|
||||
child: quickText('同意并继续',
|
||||
color: Theme.of(context).primaryColor, size: 14.sp),
|
||||
child: quickText('同意并继续', color: Theme.of(context).primaryColor, size: 14.sp),
|
||||
),
|
||||
),
|
||||
)
|
||||
|
|
@ -153,8 +126,7 @@ class Protocol extends Dialog {
|
|||
|
||||
/// 系统协议
|
||||
Future<void> sysProtocol(BuildContext context) async {
|
||||
bool? sysProtocol =
|
||||
StorageService.to.hasData(AppStorageKey.privacyAgreement.value);
|
||||
bool? sysProtocol = StorageService.to.hasData(AppStorageKey.privacyAgreement.value);
|
||||
|
||||
if (!sysProtocol) {
|
||||
return showDialog(
|
||||
|
|
@ -165,3 +137,114 @@ Future<void> sysProtocol(BuildContext context) async {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 辅助阅读协议
|
||||
Future<bool> assistedReadingProtocol(BuildContext context) async {
|
||||
var flag = await showDialog<bool>(
|
||||
context: context,
|
||||
barrierDismissible: false,
|
||||
// useRootNavigator: false,
|
||||
builder: (ctx) => const ProtocolAssistedGuidance(),
|
||||
);
|
||||
print("点击返回值 :$flag");
|
||||
return flag ?? false;
|
||||
}
|
||||
|
||||
/// 协议辅助引导
|
||||
class ProtocolAssistedGuidance extends Dialog {
|
||||
const ProtocolAssistedGuidance({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Container(
|
||||
width: isPad() ? 216.w : 260.w,
|
||||
height: 200.h,
|
||||
padding: EdgeInsets.symmetric(horizontal: 4.w,vertical: 16.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(12.r),
|
||||
),
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
quickText('协议及政策阅读指引', size: 16.sp, color: const Color.fromRGBO(37, 37, 37, 1), fontWeight: FontWeight.bold),
|
||||
Expanded(
|
||||
child: ListView(
|
||||
physics: const BouncingScrollPhysics(),
|
||||
padding: EdgeInsets.fromLTRB(10.w, 14.h, 10.w, 10.h),
|
||||
children: [
|
||||
Text.rich(TextSpan(children: [
|
||||
TextSpan(
|
||||
text: '感谢您选择点智学,在使用当前APP服务之前,请仔细阅读',
|
||||
style: TextStyle(fontSize: 13.sp, color: const Color.fromRGBO(51, 51, 51, 1)),
|
||||
),
|
||||
TextSpan(
|
||||
text: '《隐私政策》',
|
||||
style: TextStyle(fontSize: 13.sp, color: Theme.of(context).primaryColor),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () async {
|
||||
Get.toNamed(Routes.agreementPage, arguments: {"type": AGREEMENT_KEY.PRIVACY_GREEMENT.name});
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: '和',
|
||||
style: TextStyle(fontSize: 13.sp, color: const Color.fromRGBO(51, 51, 51, 1)),
|
||||
),
|
||||
TextSpan(
|
||||
text: '《用户协议》',
|
||||
style: TextStyle(fontSize: 13.sp, color: Theme.of(context).primaryColor),
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () async {
|
||||
Get.toNamed(Routes.agreementPage, arguments: {"type": AGREEMENT_KEY.USER_AGREEMENT.name});
|
||||
},
|
||||
),
|
||||
TextSpan(
|
||||
text: '如果你已经阅读并同意此协议及政策,请点击“同意并继续”开始使用。',
|
||||
style: TextStyle(fontSize: 13.sp, color: const Color.fromRGBO(51, 51, 51, 1)),
|
||||
),
|
||||
])),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10.h),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () => Navigator.of(context).pop(false),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(top: 15.h),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(width: 0.5.r, color: const Color.fromRGBO(238, 238, 238, 1)),
|
||||
right: BorderSide(width: 0.5.r, color: const Color.fromRGBO(238, 238, 238, 1)),
|
||||
),
|
||||
),
|
||||
child: quickText('拒绝', size: 14.sp),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () => Navigator.of(context).pop(true),
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
padding: EdgeInsets.only(top: 15.h),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
top: BorderSide(width: 0.5.r, color: const Color.fromRGBO(238, 238, 238, 1)),
|
||||
),
|
||||
),
|
||||
child: quickText('同意并继续', color: Theme.of(context).primaryColor, size: 15.sp),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import 'package:making_school_asignment_app/common/store/user_store.dart';
|
|||
import 'package:making_school_asignment_app/common/utils/storage.dart';
|
||||
import 'package:making_school_asignment_app/common/utils/toast_utils.dart';
|
||||
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
||||
import 'package:making_school_asignment_app/page/login_page/children/sys_protocol.dart';
|
||||
import 'package:making_school_asignment_app/routes/app_pages.dart';
|
||||
import 'package:making_school_asignment_app/common/store/app_storage_key.dart';
|
||||
|
||||
|
|
@ -53,10 +54,10 @@ class LoginLogic extends GetxController with RequestToolMixin {
|
|||
state.isShowPwd.value = !state.isShowPwd.value;
|
||||
}
|
||||
|
||||
// 前往登录
|
||||
/// 前往登录
|
||||
void toLogin(BuildContext context) async {
|
||||
if (!state.canLogin.value) return;
|
||||
|
||||
Utils.hideKeyboard();
|
||||
state.canLogin.value = false;
|
||||
|
||||
void toMsg(msg) {
|
||||
|
|
@ -64,13 +65,15 @@ class LoginLogic extends GetxController with RequestToolMixin {
|
|||
state.canLogin.value = true;
|
||||
}
|
||||
|
||||
Utils.hideKeyboard();
|
||||
|
||||
String userName = state.userNameController.text.trim();
|
||||
String userPwd = state.passwordController.text.trim();
|
||||
if (userName == '') return toMsg('请填写用户账号');
|
||||
if (userPwd == '') return toMsg('请填写密码再试');
|
||||
if (!state.readAgreement.value) return toMsg('请阅读用户协议');
|
||||
if (!state.readAgreement.value) {
|
||||
var consent = await assistedReadingProtocol(context); // 辅助阅读协议阅读引导
|
||||
if (!consent) return toMsg('请阅读用户协议、隐私协议');
|
||||
state.readAgreement.value = true;
|
||||
}
|
||||
|
||||
EasyLoading.show(status: 'loading...');
|
||||
|
||||
|
|
@ -148,14 +151,14 @@ class LoginLogic extends GetxController with RequestToolMixin {
|
|||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
void onClose() {
|
||||
state.userNameController
|
||||
..removeListener(userNameListener)
|
||||
..dispose();
|
||||
state.passwordController.dispose();
|
||||
state.pwdFocus.dispose();
|
||||
state.theFocus.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
/// 是否展示用户附加功能
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:making_school_asignment_app/common/const_text.dart';
|
||||
import 'package:making_school_asignment_app/common/utils/anti_shake_throttling.dart';
|
||||
import 'package:making_school_asignment_app/common/utils/app_upgrade/upgradeLogic.dart';
|
||||
import 'package:making_school_asignment_app/common/utils/utils.dart';
|
||||
import 'package:making_school_asignment_app/page/global_widget/my_text.dart';
|
||||
|
|
@ -166,7 +167,12 @@ class _LoginPageState extends State<LoginPage> {
|
|||
obscureText: state.isShowPwd.value,
|
||||
//隐藏密码显示
|
||||
// textInputAction: state.isShowPwd.value?TextInputAction.go:TextInputAction.next,
|
||||
// onSubmitted: (val) => toLogin(),
|
||||
textInputAction: TextInputAction.send,
|
||||
onSubmitted: (_) => easyThrottle('LOGIN_EASYTHROTTLE', () async{
|
||||
Utils.hideKeyboard();
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => logic.toLogin(context));
|
||||
}),
|
||||
style: TextStyle(
|
||||
color: const Color(0xFF434343),
|
||||
fontSize: 14.sp,
|
||||
|
|
@ -281,10 +287,11 @@ class _LoginPageState extends State<LoginPage> {
|
|||
],
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
logic.toLogin(context);
|
||||
// Get.toNamed(Routes.home);
|
||||
},
|
||||
onTap: () => easyThrottle('LOGIN_EASYTHROTTLE', () async{
|
||||
Utils.hideKeyboard();
|
||||
await Future.delayed(Duration.zero);
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) => logic.toLogin(context));
|
||||
}),
|
||||
child: Obx(() {
|
||||
return Container(
|
||||
margin: EdgeInsets.symmetric(vertical: 10.h),
|
||||
|
|
|
|||
|
|
@ -17,10 +17,15 @@ class WorkLogic extends GetxController with RequestToolMixin, GetTickerProviderS
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
void onClose() {
|
||||
tabController.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
// @override
|
||||
// void dispose() {
|
||||
// super.dispose();
|
||||
// tabController.dispose();
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
|||
import 'work_logic.dart';
|
||||
|
||||
class WorkPage extends StatefulWidget {
|
||||
const WorkPage({Key? key}) : super(key: key);
|
||||
const WorkPage({super.key});
|
||||
|
||||
@override
|
||||
State<WorkPage> createState() => _WorkPageState();
|
||||
|
|
|
|||
Loading…
Reference in New Issue