From 0b5f169a91432ee786b05f6726f71301f8eb91f9 Mon Sep 17 00:00:00 2001 From: hs <873121290@qq.com> Date: Thu, 5 Mar 2026 16:12:47 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/http/ApiService.dart | 3 + lib/http/HttpManager.dart | 5 ++ lib/http/modules/basic_info_api.dart | 14 +++++ .../home/Study/study_class_list_page.dart | 1 + lib/pages/home/Study/study_tab_list_page.dart | 1 + .../home/Study/study_take_exam_page.dart | 4 +- lib/pages/home/home_page.dart | 12 +++- .../certificate/certificate_detail_page.dart | 61 ++++++++++--------- 8 files changed, 68 insertions(+), 33 deletions(-) diff --git a/lib/http/ApiService.dart b/lib/http/ApiService.dart index c7bc837..6297a60 100644 --- a/lib/http/ApiService.dart +++ b/lib/http/ApiService.dart @@ -9,6 +9,7 @@ class ApiService { static final bool isProduct = true; /// 登录及其他管理后台接口 + // static final String basePath = "http://192.168.198.8:30140"; static final String basePath = isProduct ? "https://gbs-gateway.qhdsafety.com" @@ -20,6 +21,8 @@ class ApiService { isProduct ? "https://jpfz.qhdsafety.com/gbsFileTest/" : "http://192.168.20.240:9787/mnt/"; //内网图片地址 + // static final String baseImgPath = "https://skqhdg.porthebei.com:9004/file/"; + static const publicKey = '0402df2195296d4062ac85ad766994d73e871b887e18efb9a9a06b4cebc72372869b7da6c347c129dee2b46a0f279ff066b01c76208c2a052af75977c722a2ccee'; diff --git a/lib/http/HttpManager.dart b/lib/http/HttpManager.dart index 5897631..e380b51 100644 --- a/lib/http/HttpManager.dart +++ b/lib/http/HttpManager.dart @@ -2,9 +2,14 @@ import 'dart:convert'; import 'dart:io'; import 'dart:ui'; import 'package:dio/dio.dart'; +import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'package:qhd_prevention/main.dart'; import 'package:qhd_prevention/services/SessionService.dart'; import 'package:qhd_prevention/tools/tools.dart'; +import 'package:flutter/widgets.dart'; + /// 全局接口异常 class ApiException implements Exception { diff --git a/lib/http/modules/basic_info_api.dart b/lib/http/modules/basic_info_api.dart index 0395997..e88d5f1 100644 --- a/lib/http/modules/basic_info_api.dart +++ b/lib/http/modules/basic_info_api.dart @@ -221,3 +221,17 @@ class CertificateApi { } } +// 待办事项 +class TodoApi { + static Future> getTodoList(Map data) { + return HttpManager().request( + ApiService.basePath + '/appmenu', + '/todoList/list', + method: Method.post, + data: { + 'eqFlag' : 1, + ...data + }, + ); + } +} diff --git a/lib/pages/home/Study/study_class_list_page.dart b/lib/pages/home/Study/study_class_list_page.dart index aca1be0..6ec2b02 100644 --- a/lib/pages/home/Study/study_class_list_page.dart +++ b/lib/pages/home/Study/study_class_list_page.dart @@ -196,6 +196,7 @@ class _StudyClassListPageState extends State { Text("培训结束时间: ${item["endTime"] ?? ''}"), Text("班级状态: ${getStatusName(item['state'])}"), const SizedBox(height: 8), + if (item['state'] == 3) Row( crossAxisAlignment: CrossAxisAlignment.center, children: buttonRowChildren, diff --git a/lib/pages/home/Study/study_tab_list_page.dart b/lib/pages/home/Study/study_tab_list_page.dart index 35bb276..3a7edb9 100644 --- a/lib/pages/home/Study/study_tab_list_page.dart +++ b/lib/pages/home/Study/study_tab_list_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:qhd_prevention/customWidget/IconBadgeButton.dart'; +import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart'; import 'package:qhd_prevention/pages/home/Study/study_class_list_page.dart'; import 'package:qhd_prevention/pages/home/scan_page.dart'; import 'package:qhd_prevention/pages/my_appbar.dart'; diff --git a/lib/pages/home/Study/study_take_exam_page.dart b/lib/pages/home/Study/study_take_exam_page.dart index 3089ff5..57f7787 100644 --- a/lib/pages/home/Study/study_take_exam_page.dart +++ b/lib/pages/home/Study/study_take_exam_page.dart @@ -208,7 +208,6 @@ class _StudyTakeExamPageState extends State { } Future _submit() async { - LoadingDialogHelper.show(message: '正在提交'); // 按原逻辑:若多选题需要去掉逗号(保留你的业务要求) for (var q in questions) { @@ -233,6 +232,9 @@ class _StudyTakeExamPageState extends State { 'examTimeEnd': DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()), 'questionList': questionList, // 这里放真正的 List> }; + // final r = await CustomAlertDialog.showConfirm(context, title: '参数', content: jsonEncode(data)); + // if (!r) return; + LoadingDialogHelper.show(message: '正在提交'); final res = await EduApi.submitExam(data); LoadingDialogHelper.hide(); diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index dc8e665..9b3a946 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -174,6 +174,7 @@ class HomePageState extends RouteAwareState // 通知滚动 PageController _notifPageController = PageController(initialPage: 0); + _getToDoWorkList(); // 启动定时器:每 3 秒切换一条通知 _notifTimer = Timer.periodic(const Duration(seconds: 3), (timer) { @@ -189,7 +190,7 @@ class HomePageState extends RouteAwareState ); } catch (_) {} _getNeedSafetyCommitment(); - + // 获取待办事项 setState(() {}); }); @@ -200,8 +201,15 @@ class HomePageState extends RouteAwareState Future.delayed(const Duration(seconds: 1), () { _firstLoad = true; }); - } + } + // 获取待办事项 + void _getToDoWorkList() async { + final result = await TodoApi.getTodoList({}); + setState(() { + totalList = result['data']; + }); + } /// 校验是否入职 Future _getNeedSafetyCommitment() async { if (_isShowCheckLogin) { diff --git a/lib/pages/mine/certificate/certificate_detail_page.dart b/lib/pages/mine/certificate/certificate_detail_page.dart index 3768a54..d120cc3 100644 --- a/lib/pages/mine/certificate/certificate_detail_page.dart +++ b/lib/pages/mine/certificate/certificate_detail_page.dart @@ -536,6 +536,35 @@ class _CertificateDetailPageState extends State { const Divider(), if (_chooseMode == CertifitcateTypeMode.specialWorker) ...[ + ItemListWidget.selectableLineTitleTextRightButton( + label: '行业类别:', + isEditable: _isEdit, + text: pd['industryCategoryName'] ?? '请选择', + isRequired: _isEdit, + onTap: () async { + final found = await BottomPicker.show( + context, + items: _specialWorkList, + itemBuilder: + (i) => Text( + i['dictLabel']!, + textAlign: TextAlign.center, + ), + initialIndex: 0, + ); + //FocusHelper.clearFocus(context); + if (found != null) { + setState(() { + pd['industryCategoryName'] = found['dictLabel']; + pd['industryCategoryCode'] = found['dictValue']; + _chooseWorkTypeList = found['children'] ?? []; + pd['industryOperatingItemsName'] = ''; + pd['industryOperatingItemsCode'] = ''; + }); + } + }, + ), + const Divider(), ItemListWidget.selectableLineTitleTextRightButton( label: '操作项目:', isEditable: _isEdit, @@ -564,38 +593,10 @@ class _CertificateDetailPageState extends State { }, ), const Divider(), - ItemListWidget.selectableLineTitleTextRightButton( - label: '行业类别:', - isEditable: _isEdit, - text: pd['industryCategoryName'] ?? '请选择', - isRequired: _isEdit, - onTap: () async { - final found = await BottomPicker.show( - context, - items: _specialWorkList, - itemBuilder: - (i) => Text( - i['dictLabel']!, - textAlign: TextAlign.center, - ), - initialIndex: 0, - ); - //FocusHelper.clearFocus(context); - if (found != null) { - setState(() { - pd['industryCategoryName'] = found['dictLabel']; - pd['industryCategoryCode'] = found['dictValue']; - _chooseWorkTypeList = found['children'] ?? []; - pd['industryOperatingItemsName'] = ''; - pd['industryOperatingItemsCode'] = ''; - }); - } - }, - ), - const Divider(), + ], - if (_chooseMode == CertifitcateTypeMode.specialEquipment) ...[ + if (_chooseMode == CertifitcateTypeMode.specialEquipment ) ...[ ItemListWidget.selectableLineTitleTextRightButton( label: '操作项目:', isEditable: _isEdit,