我的-更新签名缺失上传代码
parent
6fd181636e
commit
566ab85147
Binary file not shown.
After Width: | Height: | Size: 345 KiB |
|
@ -1511,6 +1511,28 @@ U6Hzm1ninpWeE+awIDAQAB
|
|||
},
|
||||
);
|
||||
}
|
||||
/// 更新签字信息
|
||||
static Future<Map<String, dynamic>> refreshSignInfo(String imagePath) async{
|
||||
final file = File(imagePath);
|
||||
if (!await file.exists()) {
|
||||
throw ApiException('file_not_found', '图片不存在:$imagePath');
|
||||
}
|
||||
final fileName = file.path.split(Platform.pathSeparator).last;
|
||||
|
||||
return HttpManager().uploadFaceImage(
|
||||
baseUrl: basePath,
|
||||
path: '/app/user/updateUserSign',
|
||||
fromData: {
|
||||
'CORPINFO_ID': SessionService.instance.corpinfoId,
|
||||
'USER_ID': SessionService.instance.loginUserId,
|
||||
'FFILE': await MultipartFile.fromFile(
|
||||
file.path,
|
||||
filename: fileName
|
||||
),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/// 问题反馈图片
|
||||
static Future<Map<String, dynamic>> reloadFeedBack(String imagePath) async {
|
||||
|
@ -3444,8 +3466,8 @@ U6Hzm1ninpWeE+awIDAQAB
|
|||
},
|
||||
);
|
||||
}
|
||||
///NFC任务详情列表
|
||||
static Future<Map<String, dynamic>> nfcTaskDetailList(int showCount, int currentPage) {
|
||||
///NFC任务详情
|
||||
static Future<Map<String, dynamic>> nfcTaskDetailList(int showCount, int currentPage, String PATROL_TASK_ID) {
|
||||
return HttpManager().request(
|
||||
baseNFCPath,
|
||||
'/pipelineInspection/getPatrolTaskDetailList?showCount=$showCount¤tPage=$currentPage',
|
||||
|
@ -3453,7 +3475,7 @@ U6Hzm1ninpWeE+awIDAQAB
|
|||
data: {
|
||||
"CORPINFO_ID":SessionService.instance.corpinfoId,
|
||||
"USER_ID":SessionService.instance.loginUserId,
|
||||
|
||||
"PATROL_TASK_ID":PATROL_TASK_ID
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,15 @@
|
|||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:qhd_prevention/http/ApiService.dart';
|
||||
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
|
||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||
import 'package:qhd_prevention/tools/tools.dart';
|
||||
|
||||
class HomeNfcDetailPage extends StatefulWidget {
|
||||
const HomeNfcDetailPage({super.key, required this.info});
|
||||
|
||||
final Map<String, dynamic> info;
|
||||
|
||||
@override
|
||||
|
@ -10,26 +17,146 @@ class HomeNfcDetailPage extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _HomeNfcDetailPageState extends State<HomeNfcDetailPage> {
|
||||
List<ProgressItem> items = [];
|
||||
int currentPage = 1;
|
||||
final int pageSize = 10;
|
||||
|
||||
final List<ProgressItem> demoData = const [
|
||||
ProgressItem(status: '未查', location: '到期哦i维护经费欺废气阀我废费欺废气阀我废费欺废气阀我废气阀', code: 'XJ1001'),
|
||||
ProgressItem(status: '已查', location: 'B区-配电室', code: 'XJ1002', checkTime: '2025-07-28 15:32'),
|
||||
ProgressItem(status: '已查', location: 'B区-配电室', code: 'XJ1002', checkTime: '2025-07-28 15:32'),
|
||||
ProgressItem(status: '已查', location: 'B区-配电室', code: 'XJ1002', checkTime: '2025-07-28 15:32'),
|
||||
ProgressItem(status: '已查', location: 'B区-配电室', code: 'XJ1002', checkTime: '2025-07-28 15:32'),
|
||||
ProgressItem(status: '已查', location: 'B区-配电室', code: 'XJ1002', checkTime: '2025-07-28 15:32'),
|
||||
ProgressItem(status: '已查', location: 'B区-配电室', code: 'XJ1002', checkTime: '2025-07-28 15:32'),
|
||||
ProgressItem(status: '已查', location: 'B区-配电室', code: 'XJ1002', checkTime: '2025-07-28 15:32'),
|
||||
ProgressItem(status: '已查', location: 'B区-配电室', code: 'XJ1002', checkTime: '2025-07-28 15:32'),
|
||||
ProgressItem(status: '已查', location: 'B区-配电室', code: 'XJ1002', checkTime: '2025-07-28 15:32'),
|
||||
bool isLoading = false; // 当前请求中
|
||||
bool hasMore = true; // 是否还有更多数据
|
||||
bool firstLoad = true; // 第一次加载标志
|
||||
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_loadInitial();
|
||||
|
||||
// 监听滚动到底部触发加载更多
|
||||
_scrollController.addListener(() {
|
||||
if (_scrollController.position.pixels >=
|
||||
_scrollController.position.maxScrollExtent - 200 &&
|
||||
!isLoading &&
|
||||
hasMore) {
|
||||
_getTaskDetail(); // 加载下一页
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _loadInitial() async {
|
||||
await _getTaskDetail(refresh: true);
|
||||
firstLoad = false;
|
||||
}
|
||||
|
||||
/// pageSize: 每页条数;currentPage 初始为 1
|
||||
Future<void> _getTaskDetail({bool refresh = false}) async {
|
||||
if (isLoading) return;
|
||||
setState(() {
|
||||
isLoading = true;
|
||||
});
|
||||
|
||||
if (refresh) {
|
||||
currentPage = 1;
|
||||
hasMore = true;
|
||||
}
|
||||
|
||||
try {
|
||||
// 调用后端 API:我保持你原来的签名 ApiService.nfcTaskDetailList(pageSize, page)
|
||||
final result = await ApiService.nfcTaskDetailList(
|
||||
pageSize,
|
||||
currentPage,
|
||||
widget.info['PATROL_TASK_ID'] ?? '',
|
||||
);
|
||||
|
||||
if (result == null) {
|
||||
_showMessage('请求失败:结果为 null');
|
||||
return;
|
||||
}
|
||||
printLongString(jsonEncode(result));
|
||||
if (result['result'] == 'success') {
|
||||
// 兼容常见返回字段,尽量从 data / rows / list 里取
|
||||
final dynamic rawList = result['varList'];
|
||||
|
||||
List<ProgressItem> fetched = [];
|
||||
if (rawList is List) {
|
||||
fetched =
|
||||
rawList.map<ProgressItem>((e) {
|
||||
if (e is ProgressItem) return e;
|
||||
if (e is Map<String, dynamic>) return ProgressItem.fromJson(e);
|
||||
return ProgressItem(
|
||||
status: '未查',
|
||||
location: e?.toString() ?? '',
|
||||
code: '',
|
||||
checkTime: null,
|
||||
);
|
||||
}).toList();
|
||||
}
|
||||
|
||||
setState(() {
|
||||
if (refresh) {
|
||||
items = fetched;
|
||||
} else {
|
||||
items.addAll(fetched);
|
||||
}
|
||||
// 如果本次返回少于 pageSize 则说明没有更多
|
||||
if (fetched.length < pageSize) {
|
||||
hasMore = false;
|
||||
} else {
|
||||
// 成功拿到一页,页码自增
|
||||
currentPage++;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
final msg = result['message'] ?? result['msg'] ?? '加载失败';
|
||||
_showMessage('请求出错:$msg');
|
||||
}
|
||||
} catch (e) {
|
||||
_showMessage('请求异常:$e');
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
isLoading = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void _showMessage(String msg) {
|
||||
if (!mounted) return;
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(msg)));
|
||||
}
|
||||
|
||||
Future<void> _startCheckItem(ProgressItem item, int index) async {
|
||||
// TODO: 根据业务替换为真实逻辑(例如跳转到检查页面或调用写 NFC)
|
||||
// 这里示例:将当前项标记为已查并设置检查时间(仅本地更新)
|
||||
final now = DateTime.now();
|
||||
setState(() {
|
||||
items[index] = items[index].copyWith(
|
||||
status: '已查',
|
||||
checkTime:
|
||||
'${now.year}-${_two(now.month)}-${_two(now.day)} ${_two(now.hour)}:${_two(now.minute)}',
|
||||
);
|
||||
});
|
||||
|
||||
// 额外:你可能需要调用后端接口上报检查结果
|
||||
// await ApiService.reportCheck(items[index].code, ...);
|
||||
}
|
||||
|
||||
String _two(int v) => v.toString().padLeft(2, '0');
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_scrollController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
];
|
||||
Widget _pendingTopCard(Map<String, dynamic> item) {
|
||||
return SizedBox(
|
||||
height: 180,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
// 背景图片(上部)
|
||||
ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: Image.asset(
|
||||
|
@ -45,7 +172,7 @@ class _HomeNfcDetailPageState extends State<HomeNfcDetailPage> {
|
|||
top: 12,
|
||||
left: 12,
|
||||
child: Text(
|
||||
item['title']!,
|
||||
item['TASK_NAME']?.toString() ?? '',
|
||||
style: const TextStyle(
|
||||
color: Colors.black87,
|
||||
fontSize: 18,
|
||||
|
@ -60,30 +187,35 @@ class _HomeNfcDetailPageState extends State<HomeNfcDetailPage> {
|
|||
height: 30,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.blue.withOpacity(0.7),
|
||||
color: Colors.blue.withOpacity(0.3),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Center(
|
||||
child: Center(
|
||||
child: Text(
|
||||
item['status']!,
|
||||
style: const TextStyle(color: Colors.white, fontSize: 14),
|
||||
item['PATROL_TYPE_NAME'] ?? '',
|
||||
style: TextStyle(
|
||||
color: Colors.blue,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// 白色信息区域(盖住图片部分)
|
||||
// 白色信息区域(覆盖图片底部)
|
||||
Positioned(
|
||||
left: 0,
|
||||
right: 0,
|
||||
top: 50, // 盖住图片底部
|
||||
top: 50, // 覆盖图片底部
|
||||
child: Container(
|
||||
margin: const EdgeInsets.symmetric(horizontal: 0),
|
||||
padding: const EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
blurRadius: 4,
|
||||
|
@ -98,163 +230,56 @@ class _HomeNfcDetailPageState extends State<HomeNfcDetailPage> {
|
|||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// 构建信息网格
|
||||
Widget _buildInfoGrid(Map<String, dynamic> item) {
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
return Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('负责部门:${item['DEPARTMENT_NAME'] ?? ''}'),
|
||||
const SizedBox(height: 8),
|
||||
Text('巡检类型:${item['PATROL_TYPE_NAME'] ?? ''}'),
|
||||
const SizedBox(height: 8),
|
||||
Text('已巡点位:${item['INSPECTED_POINTS'] ?? '0'}'),
|
||||
],
|
||||
// const SizedBox(height: 8),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '负责部门',
|
||||
isEditable: false,
|
||||
text: item['DEPARTMENT_NAME'] ?? '',
|
||||
),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '负责人',
|
||||
isEditable: false,
|
||||
text: item['USER_NAME'] ?? '',
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text('负责人:${item['USER_NAME'] ?? ''}'),
|
||||
const SizedBox(height: 8),
|
||||
Text('巡检周期:${item['PATROL_PERIOD_NAME'] ?? ''}'),
|
||||
|
||||
// isFinish
|
||||
// ? Text('涉及管道区域:${item['department'] ?? ''}')
|
||||
// : const SizedBox(height: 25),
|
||||
],
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '涉及管道区域:',
|
||||
isEditable: false,
|
||||
text: item['PIPELINE_AREAS_NAMES'] ?? '',
|
||||
),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '巡检周期',
|
||||
isEditable: false,
|
||||
text: item['PATROL_PERIOD_NAME'] ?? '',
|
||||
),
|
||||
ItemListWidget.singleLineTitleText(
|
||||
label: '任务时间',
|
||||
isEditable: false,
|
||||
text: item['OPERATTIME'] ?? '',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
Future<void> _startCheckItem(ProgressItem item) async {
|
||||
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: MyAppbar(title: '任务详情'),
|
||||
body: SafeArea(child: Padding(padding: EdgeInsets.all(16), child: Column(
|
||||
children: [
|
||||
_pendingTopCard(widget.info),
|
||||
Expanded(child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
child: SingleChildScrollView(
|
||||
child: ProgressList(
|
||||
items: demoData,
|
||||
onStartCheck: (idx) {
|
||||
_startCheckItem(demoData[idx]);
|
||||
print('开始检查第 $idx 项');
|
||||
},
|
||||
),
|
||||
)
|
||||
))
|
||||
],
|
||||
),)),
|
||||
);
|
||||
}
|
||||
}
|
||||
/// 单条进度数据模型
|
||||
class ProgressItem {
|
||||
final String status; // “未查” 或 “已查”
|
||||
final String location; // 地点
|
||||
final String code; // 编码
|
||||
final String? checkTime; // 检查时间(已查时有值)
|
||||
|
||||
const ProgressItem({
|
||||
required this.status,
|
||||
required this.location,
|
||||
required this.code,
|
||||
this.checkTime,
|
||||
});
|
||||
}
|
||||
|
||||
/// 进度列表组件
|
||||
class ProgressList extends StatelessWidget {
|
||||
/// 数据源
|
||||
final List<ProgressItem> items;
|
||||
|
||||
/// 点击“开始检查”后的回调,index 对应 items 的下标
|
||||
final void Function(int index) onStartCheck;
|
||||
|
||||
const ProgressList({
|
||||
Key? key,
|
||||
required this.items,
|
||||
required this.onStartCheck,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// 整体用 Column 包裹标题和列表
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// 标题
|
||||
const Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Text(
|
||||
'已查点位1/5',
|
||||
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
|
||||
// 列表
|
||||
ListView.builder(
|
||||
physics: const NeverScrollableScrollPhysics(), // 让父级滚动
|
||||
shrinkWrap: true,
|
||||
itemCount: items.length,
|
||||
itemBuilder: (ctx, idx) {
|
||||
return _ProgressListItem(
|
||||
item: items[idx],
|
||||
onStart: () => onStartCheck(idx),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 单行进度条目
|
||||
class _ProgressListItem extends StatelessWidget {
|
||||
final ProgressItem item;
|
||||
final VoidCallback onStart;
|
||||
|
||||
const _ProgressListItem({
|
||||
Key? key,
|
||||
required this.item,
|
||||
required this.onStart,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
Widget _buildListItem(BuildContext context, int idx) {
|
||||
final item = items[idx];
|
||||
final bool unchecked = item.status == '未查';
|
||||
|
||||
return Container(
|
||||
height: 100,
|
||||
margin: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
// 左侧状态区
|
||||
Column(children: [
|
||||
Column(
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
@ -273,21 +298,12 @@ class _ProgressListItem extends StatelessWidget {
|
|||
style: const TextStyle(color: Colors.white, fontSize: 14),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
SizedBox(height: 15,),
|
||||
Positioned(
|
||||
// bottom: 0,
|
||||
// right: 17,
|
||||
child: Image.asset(
|
||||
'assets/images/xjjd_top.png',
|
||||
width: 15,
|
||||
height: 30,
|
||||
const SizedBox(height: 8),
|
||||
Image.asset('assets/images/xjjd_top.png', width: 15, height: 30),
|
||||
],
|
||||
),
|
||||
),
|
||||
],),
|
||||
|
||||
|
||||
const SizedBox(width: 20),
|
||||
|
||||
|
@ -295,7 +311,6 @@ class _ProgressListItem extends StatelessWidget {
|
|||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.location,
|
||||
|
@ -308,14 +323,11 @@ class _ProgressListItem extends StatelessWidget {
|
|||
),
|
||||
const SizedBox(height: 4),
|
||||
Text('NFC编码:${item.code}'),
|
||||
|
||||
const SizedBox(height: 6),
|
||||
unchecked
|
||||
? InkWell(
|
||||
onTap: onStart,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 5,),
|
||||
Container(
|
||||
onTap: () => _startCheckItem(item, idx),
|
||||
child: Container(
|
||||
height: 35,
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.symmetric(vertical: 1),
|
||||
|
@ -330,11 +342,9 @@ class _ProgressListItem extends StatelessWidget {
|
|||
style: TextStyle(color: Colors.white, fontSize: 14),
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
)
|
||||
: Text(
|
||||
'检查时间:' + (item.checkTime ?? ''),
|
||||
'检查时间:${item.checkTime ?? ''}',
|
||||
style: const TextStyle(fontSize: 14),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
|
@ -342,17 +352,193 @@ class _ProgressListItem extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
|
||||
// 操作区或时间
|
||||
// 右侧箭头
|
||||
const SizedBox(width: 8),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Icon(Icons.chevron_right, color: Colors.grey),
|
||||
SizedBox()
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: MyAppbar(title: '任务详情'),
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
_pendingTopCard(widget.info),
|
||||
const SizedBox(height: 60),
|
||||
Expanded(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () => _getTaskDetail(refresh: true),
|
||||
child:
|
||||
firstLoad && isLoading
|
||||
? const Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
)
|
||||
: items.isEmpty
|
||||
? ListView(
|
||||
controller: _scrollController,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
children: [
|
||||
const SizedBox(height: 80),
|
||||
Center(
|
||||
child: Text(isLoading ? '加载中...' : '暂无数据'),
|
||||
),
|
||||
],
|
||||
)
|
||||
: ListView.builder(
|
||||
controller: _scrollController,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
itemCount: items.length + 1, // 多一个用于加载状态/底部提示
|
||||
itemBuilder: (ctx, idx) {
|
||||
if (idx < items.length) {
|
||||
return _buildListItem(ctx, idx);
|
||||
} else {
|
||||
// 底部加载/没有更多提示
|
||||
if (hasMore) {
|
||||
// 触发加载(以防没有触发)
|
||||
if (!isLoading) {
|
||||
// 预防性触发下一页
|
||||
// _getTaskDetail(); // 不在此直接调用,scroll listener 会负责
|
||||
}
|
||||
return const Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 12,
|
||||
),
|
||||
child: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return const Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 12,
|
||||
),
|
||||
child: Center(child: Text('没有更多了')),
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// 单条进度数据模型
|
||||
class ProgressItem {
|
||||
final String status; // “未查” 或 “已查”
|
||||
final String location; // 地点
|
||||
final String code; // 编码
|
||||
final String? checkTime; // 检查时间(已查时有值)
|
||||
|
||||
ProgressItem({
|
||||
required this.status,
|
||||
required this.location,
|
||||
required this.code,
|
||||
this.checkTime,
|
||||
});
|
||||
|
||||
ProgressItem copyWith({
|
||||
String? status,
|
||||
String? location,
|
||||
String? code,
|
||||
String? checkTime,
|
||||
}) {
|
||||
return ProgressItem(
|
||||
status: status ?? this.status,
|
||||
location: location ?? this.location,
|
||||
code: code ?? this.code,
|
||||
checkTime: checkTime ?? this.checkTime,
|
||||
);
|
||||
}
|
||||
|
||||
/// 宽容解析后端返回(根据常见字段名)
|
||||
factory ProgressItem.fromJson(Map<String, dynamic> json) {
|
||||
String status =
|
||||
(json['status'] ??
|
||||
json['STATUS'] ??
|
||||
(json['checked'] == true ? '已查' : null) ??
|
||||
(json['is_checked'] == 1 ? '已查' : null) ??
|
||||
json['state'] ??
|
||||
json['check_status'])
|
||||
?.toString() ??
|
||||
'';
|
||||
|
||||
if (status.isEmpty) {
|
||||
// 有些 API 用 0/1 表示
|
||||
final s = json['status'] ?? json['STATUS'] ?? json['check_status'];
|
||||
if (s is num) {
|
||||
status = (s == 0) ? '未查' : '已查';
|
||||
} else if (s is String && (s == '0' || s == '1')) {
|
||||
status = (s == '0') ? '未查' : '已查';
|
||||
}
|
||||
}
|
||||
if (status.isEmpty) status = '未查';
|
||||
|
||||
final location =
|
||||
(json['location'] ??
|
||||
json['LOCATION'] ??
|
||||
json['point_name'] ??
|
||||
json['address'] ??
|
||||
json['point'] ??
|
||||
'')
|
||||
.toString();
|
||||
final code =
|
||||
(json['code'] ??
|
||||
json['CODE'] ??
|
||||
json['nfcCode'] ??
|
||||
json['nfc_code'] ??
|
||||
json['NFC_CODE'] ??
|
||||
json['id'] ??
|
||||
'')
|
||||
.toString();
|
||||
final checkTime =
|
||||
(json['checkTime'] ??
|
||||
json['CHECK_TIME'] ??
|
||||
json['checked_at'] ??
|
||||
json['check_time'] ??
|
||||
json['inspect_time'] ??
|
||||
null)
|
||||
?.toString();
|
||||
|
||||
return ProgressItem(
|
||||
status: status,
|
||||
location: location,
|
||||
code: code,
|
||||
checkTime: checkTime,
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'status': status,
|
||||
'location': location,
|
||||
'code': code,
|
||||
'checkTime': checkTime,
|
||||
};
|
||||
}
|
|
@ -86,14 +86,15 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
_recordScrollController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
String _checkStatusName(String status) {
|
||||
if (status == '0') {
|
||||
return '已巡检';
|
||||
}else if (status == '1') {
|
||||
} else if (status == '1') {
|
||||
return '超期未巡检';
|
||||
}else if (status == '2') {
|
||||
} else if (status == '2') {
|
||||
return '巡检中';
|
||||
}else{
|
||||
} else {
|
||||
return '待巡检';
|
||||
}
|
||||
}
|
||||
|
@ -155,7 +156,8 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
if (res['result'] == 'success') {
|
||||
List<dynamic> list = res['varList'];
|
||||
|
||||
final parsed = list.map<Map<String, dynamic>>((e) {
|
||||
final parsed =
|
||||
list.map<Map<String, dynamic>>((e) {
|
||||
return e;
|
||||
}).toList();
|
||||
|
||||
|
@ -174,15 +176,19 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
setState(() {
|
||||
_pendingList.addAll(parsed);
|
||||
_pendingPage = page;
|
||||
if (parsed.isEmpty) _pendingHasMore = false;
|
||||
else if (parsed.length < _pageSize) _pendingHasMore = false;
|
||||
if (parsed.isEmpty)
|
||||
_pendingHasMore = false;
|
||||
else if (parsed.length < _pageSize)
|
||||
_pendingHasMore = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
// 错误处理
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('获取待巡检列表失败:$e')));
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('获取待巡检列表失败:$e')));
|
||||
}
|
||||
} finally {
|
||||
if (mounted) {
|
||||
|
@ -193,12 +199,15 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
}
|
||||
}
|
||||
|
||||
Future<void> _getTaskDetailList({required int page, required bool replace}) async {
|
||||
Future<void> _getTaskDetailList({
|
||||
required int page,
|
||||
required bool replace,
|
||||
}) async {
|
||||
setState(() {
|
||||
_recordLoading = true;
|
||||
});
|
||||
try {
|
||||
final res = await ApiService.nfcTaskDetailList(_pageSize, page);
|
||||
// final res = await ApiService.nfcTaskDetailList(_pageSize, page);
|
||||
List<dynamic>? list;
|
||||
// if (res == null) {
|
||||
// list = [];
|
||||
|
@ -253,7 +262,9 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
// }
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text('获取巡检记录失败:$e')));
|
||||
ScaffoldMessenger.of(
|
||||
context,
|
||||
).showSnackBar(SnackBar(content: Text('获取巡检记录失败:$e')));
|
||||
}
|
||||
} finally {
|
||||
if (mounted) {
|
||||
|
@ -269,7 +280,9 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: MyAppbar(title: '巡检列表', actions: [
|
||||
appBar: MyAppbar(
|
||||
title: '巡检列表',
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
pushPage(const HomeNfcAddPage(), context);
|
||||
|
@ -278,8 +291,9 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
"NFC绑定",
|
||||
style: TextStyle(color: Colors.white, fontSize: 16),
|
||||
),
|
||||
)
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
child: Column(
|
||||
children: [
|
||||
|
@ -435,7 +449,10 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
right: 12,
|
||||
child: Container(
|
||||
height: 30,
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 4),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
|
@ -443,7 +460,13 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
child: Center(
|
||||
child: Text(
|
||||
item['INSPECTED_POINTS'] > 0 ? '巡检中' : '待巡检',
|
||||
style: TextStyle(color: item['INSPECTED_POINTS'] as int > 0 ? Colors.blue : Colors.deepOrange, fontSize: 14),
|
||||
style: TextStyle(
|
||||
color:
|
||||
item['INSPECTED_POINTS'] as int > 0
|
||||
? Colors.blue
|
||||
: Colors.deepOrange,
|
||||
fontSize: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
@ -483,7 +506,6 @@ class _HomeNfcListPageState extends State<HomeNfcListPage>
|
|||
|
||||
/// 构建信息网格
|
||||
Widget _buildInfoGrid(Map<String, dynamic> item, bool isFinish) {
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
Expanded(
|
||||
|
|
|
@ -22,9 +22,6 @@ class DangerProjectPage extends StatefulWidget {
|
|||
}
|
||||
|
||||
class _DangerProjectPageState extends State<DangerProjectPage> {
|
||||
// 单选按钮的值
|
||||
// String? _selectedValue;
|
||||
|
||||
// 单选按钮选项
|
||||
final List<Map<String, dynamic>> _options = [
|
||||
{
|
||||
|
@ -49,63 +46,53 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
|
||||
List<dynamic> listDates = [];
|
||||
List<dynamic> listDatesSelect = [];
|
||||
String unqualifiedInspectionItemID="";
|
||||
Map<String, dynamic> nullResult={};
|
||||
List<dynamic> upDataItemList=[];
|
||||
String unqualifiedInspectionItemID = "";
|
||||
Map<String, dynamic> nullResult = {};
|
||||
List<dynamic> upDataItemList = [];
|
||||
|
||||
String yinHuanText="";
|
||||
String yinHuanText = "";
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
// TODO: implement initState
|
||||
super.initState();
|
||||
|
||||
SessionService.instance.setUnqualifiedInspectionItemIDJson("");
|
||||
|
||||
_getData();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
void _getData(){
|
||||
void _getData() {
|
||||
listDates.clear();
|
||||
switch(widget.type ){
|
||||
case 1://隐患排查
|
||||
switch (widget.type) {
|
||||
case 1: //隐患排查
|
||||
_getInvestigationItemsYinHuan();
|
||||
break;
|
||||
case 2://标准排查
|
||||
case 2: //标准排查
|
||||
_getInvestigationItems();
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _getInvestigationItemsYinHuan( ) async {
|
||||
Future<void> _getInvestigationItemsYinHuan() async {
|
||||
try {
|
||||
|
||||
final result = await ApiService.getInvestigationItemsYinHuan(widget.item);
|
||||
if (result['result'] == 'success') {
|
||||
final List<dynamic> newList = result['varList'] ?? [];
|
||||
final List<dynamic> newListTwo = result['records'] ?? [];
|
||||
setState(() {
|
||||
|
||||
listDates.addAll(newList);
|
||||
|
||||
if(newListTwo.isNotEmpty){
|
||||
if (newListTwo.isNotEmpty) {
|
||||
listDatesSelect.addAll(newListTwo);
|
||||
}
|
||||
|
||||
|
||||
// listDatesTwo.addAll(newListTwo);option1
|
||||
for(int i=0;i<listDates.length;i++){
|
||||
if(newListTwo.isNotEmpty){
|
||||
for(int m=0;m<newListTwo.length;m++){
|
||||
if(newListTwo.isNotEmpty&&newListTwo[m]["LISTCHECKITEM_ID"]!=null){
|
||||
if( newListTwo[m]["LISTCHECKITEM_ID"]==listDates[i]["LISTCHECKITEM_ID"]){
|
||||
|
||||
if(listDatesSelect.isNotEmpty){
|
||||
switch(listDatesSelect[m]["ISNORMAL"] ){
|
||||
for (int i = 0; i < listDates.length; i++) {
|
||||
if (newListTwo.isNotEmpty) {
|
||||
for (int m = 0; m < newListTwo.length; m++) {
|
||||
if (newListTwo.isNotEmpty && newListTwo[m]["LISTCHECKITEM_ID"] != null) {
|
||||
if (newListTwo[m]["LISTCHECKITEM_ID"] == listDates[i]["LISTCHECKITEM_ID"]) {
|
||||
if (listDatesSelect.isNotEmpty) {
|
||||
switch (listDatesSelect[m]["ISNORMAL"]) {
|
||||
case 0:
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option1";
|
||||
break;
|
||||
|
@ -116,46 +103,38 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option3";
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "";
|
||||
}
|
||||
|
||||
if(listDatesSelect[m].containsKey("HIDDEN_ID")){
|
||||
if (listDatesSelect[m].containsKey("HIDDEN_ID")) {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = listDatesSelect[m]["HIDDEN_ID"];
|
||||
SessionService.instance.setUnqualifiedInspectionItemIDJson(listDatesSelect[m]["HIDDEN_ID"]);
|
||||
}else{
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
}
|
||||
|
||||
}else{
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
}else{
|
||||
} else {
|
||||
ToastUtil.showNormal(context, result['msg']);
|
||||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _getInvestigationItems( ) async {
|
||||
Future<void> _getInvestigationItems() async {
|
||||
try {
|
||||
|
||||
final result = await ApiService.getInvestigationItems(widget.item);
|
||||
if (result['result'] == 'success') {
|
||||
final List<dynamic> newList = result['varList'] ?? [];
|
||||
|
@ -163,19 +142,17 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
setState(() {
|
||||
listDates.addAll(newList);
|
||||
|
||||
if(newListTwo.isNotEmpty){
|
||||
if (newListTwo.isNotEmpty) {
|
||||
listDatesSelect.addAll(newListTwo);
|
||||
}
|
||||
|
||||
|
||||
for(int i=0;i<listDates.length;i++){
|
||||
if(newListTwo.isNotEmpty){
|
||||
for(int m=0;m<newListTwo.length;m++){
|
||||
if(newListTwo.isNotEmpty&&newListTwo[m]["CUSTOM_ITEM_ID"]!=null){
|
||||
if( newListTwo[m]["CUSTOM_ITEM_ID"]==listDates[i]["CUSTOM_ITEM_ID"]){
|
||||
|
||||
if(listDatesSelect.isNotEmpty){
|
||||
switch(listDatesSelect[m]["ISNORMAL"] ){
|
||||
for (int i = 0; i < listDates.length; i++) {
|
||||
if (newListTwo.isNotEmpty) {
|
||||
for (int m = 0; m < newListTwo.length; m++) {
|
||||
if (newListTwo.isNotEmpty && newListTwo[m]["CUSTOM_ITEM_ID"] != null) {
|
||||
if (newListTwo[m]["CUSTOM_ITEM_ID"] == listDates[i]["CUSTOM_ITEM_ID"]) {
|
||||
if (listDatesSelect.isNotEmpty) {
|
||||
switch (listDatesSelect[m]["ISNORMAL"]) {
|
||||
case 0:
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option1";
|
||||
break;
|
||||
|
@ -186,42 +163,33 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "option3";
|
||||
break;
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["REFERENCE_BASIS"] = "";
|
||||
}
|
||||
|
||||
if(listDatesSelect[m].containsKey("HIDDEN_ID")){
|
||||
if (listDatesSelect[m].containsKey("HIDDEN_ID")) {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = listDatesSelect[m]["HIDDEN_ID"];
|
||||
SessionService.instance.setUnqualifiedInspectionItemIDJson(listDatesSelect[m]["HIDDEN_ID"]);
|
||||
}else{
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
}
|
||||
|
||||
}else{
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
(listDates[i] as Map<String, dynamic>)["ids"] = "";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}else{
|
||||
} else {
|
||||
ToastUtil.showNormal(context, result['msg']);
|
||||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -233,9 +201,10 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
backgroundColor: h_backGroundColor(),
|
||||
appBar: MyAppbar(title: "排查项"),
|
||||
body: SafeArea(
|
||||
child:Column(
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(child: listDates.isEmpty
|
||||
Expanded(
|
||||
child: listDates.isEmpty
|
||||
? NoDataWidget.show()
|
||||
: ListView.separated(
|
||||
itemCount: listDates.length,
|
||||
|
@ -243,8 +212,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
itemBuilder: (context, index) {
|
||||
final item = listDates[index];
|
||||
return GestureDetector(
|
||||
// onTap: () => _selectItem(item),
|
||||
child: _itemCell(screenWidth,item),
|
||||
child: _itemCell(screenWidth, item),
|
||||
);
|
||||
},
|
||||
)),
|
||||
|
@ -253,9 +221,9 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
margin: const EdgeInsets.only(bottom: 20),
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.green ,
|
||||
color: Colors.green,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black12,
|
||||
blurRadius: 6,
|
||||
|
@ -263,13 +231,12 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
),
|
||||
],
|
||||
),
|
||||
child:
|
||||
SizedBox(
|
||||
child: SizedBox(
|
||||
width: screenWidth - 30,
|
||||
height: 50,
|
||||
child: TextButton(
|
||||
onPressed: _submit,//_selectedValue != null ? _submit : null,
|
||||
child: Text(
|
||||
onPressed: _submit,
|
||||
child: const Text(
|
||||
"提交",
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
|
@ -280,18 +247,13 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
),
|
||||
),
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
|
||||
// _itemCell(screenWidth),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Widget _itemCell(final screenWidth,final item) {
|
||||
Widget _itemCell(final screenWidth, final item) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
|
||||
child: Column(
|
||||
|
@ -305,7 +267,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if(widget.type==1)
|
||||
if (widget.type == 1)
|
||||
Text(
|
||||
"存在风险:${item["RISK_DESCR"]}",
|
||||
style: TextStyle(
|
||||
|
@ -323,7 +285,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
height: 1.5,
|
||||
),
|
||||
),
|
||||
if(widget.type==2)
|
||||
if (widget.type == 2)
|
||||
Text(
|
||||
"检查标准:${item["CHECK_STANDARD"]}",
|
||||
style: TextStyle(
|
||||
|
@ -336,8 +298,7 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
// 单选按钮组
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children:
|
||||
_options.map((option) {
|
||||
children: _options.map((option) {
|
||||
return _buildOptionButton(
|
||||
context: context,
|
||||
value: option['value'],
|
||||
|
@ -347,9 +308,9 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
screenWidth: screenWidth,
|
||||
item: item,
|
||||
onImageTap: () {
|
||||
if(item["REFERENCE_BASIS"]=="option1") {
|
||||
if (item["REFERENCE_BASIS"] == "option1") {
|
||||
_getAlreadyUpImages(item);
|
||||
}else if(item["REFERENCE_BASIS"]=="option2") {
|
||||
} else if (item["REFERENCE_BASIS"] == "option2") {
|
||||
_goUnqualifiedPage(item);
|
||||
}
|
||||
},
|
||||
|
@ -357,27 +318,24 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
}).toList(),
|
||||
),
|
||||
|
||||
if(item["REFERENCE_BASIS"]=="option1"&& widget.type==2)
|
||||
if (item["REFERENCE_BASIS"] == "option1" && widget.type == 2)
|
||||
Card(
|
||||
color: const Color(0xFFF1F1F1),
|
||||
child: Container(
|
||||
width: screenWidth,
|
||||
padding: EdgeInsets.all(10),
|
||||
child: Text(item["CHECK_QUALIFIED"],style:TextStyle(color: Colors.black,fontSize: 12)),
|
||||
)
|
||||
),
|
||||
|
||||
|
||||
padding: const EdgeInsets.all(10),
|
||||
child:
|
||||
Text(item["CHECK_QUALIFIED"], style: const TextStyle(color: Colors.black, fontSize: 12)),
|
||||
)),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
// Spacer(),
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _getAlreadyUpImages(Map item) async {
|
||||
try {
|
||||
final result = await ApiService.getAlreadyUpImages(item["RECORDITEM_ID"]);
|
||||
|
@ -390,20 +348,17 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
imgList.add(
|
||||
PhotoItem(
|
||||
id: id, // 新图片没有ID
|
||||
filePath: ApiService.baseImgPath+filePath,
|
||||
filePath: ApiService.baseImgPath + filePath,
|
||||
type: "1",
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
pushPage(DangerImageUpdataPage(item["RECORDITEM_ID"], imgList: imgList), context);
|
||||
|
||||
} else {
|
||||
ToastUtil.showNormal(context, "加载数据失败");
|
||||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
}
|
||||
|
@ -425,50 +380,59 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
return GestureDetector(
|
||||
onTap: () {
|
||||
setState(() {
|
||||
if(value!="option2") {
|
||||
if (value != "option2") {
|
||||
SessionService.instance.setUnqualifiedInspectionItemIDJson("");
|
||||
// _selectedValue = value;
|
||||
item["REFERENCE_BASIS"]=value;
|
||||
}else{
|
||||
item["REFERENCE_BASIS"] = value;
|
||||
} else {
|
||||
_goUnqualifiedPage(item);
|
||||
// pushPage(HazardRegistrationPage(item), context);
|
||||
}
|
||||
});
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
width: buttonWidth,
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
|
||||
child: Expanded(child: Row(
|
||||
// 不要在这里放 Expanded(非 Flex 父组件)
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(children: [
|
||||
SizedBox(
|
||||
height: 30,
|
||||
width: 90,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon, color: isSelected ? color : Colors.grey, size: 30),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
Flexible(
|
||||
child: Text(
|
||||
label,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: isSelected ? FontWeight.bold : FontWeight.normal,
|
||||
color: isSelected ? color : Colors.grey[600],
|
||||
),
|
||||
),
|
||||
],),
|
||||
if((value=="option1"&&item["REFERENCE_BASIS"]=="option1")||
|
||||
(value=="option2"&&item["REFERENCE_BASIS"]=="option2"&&item.containsKey("ids")&&item["ids"].toString().isNotEmpty))
|
||||
// 添加图片点击处理
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
if ((value == "option1" && item["REFERENCE_BASIS"] == "option1") ||
|
||||
(value == "option2" &&
|
||||
item["REFERENCE_BASIS"] == "option2" &&
|
||||
item.containsKey("ids") &&
|
||||
item["ids"].toString().isNotEmpty))
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
|
||||
// 防止事件冒泡到父级 GestureDetector
|
||||
if (onImageTap != null) {
|
||||
onImageTap();
|
||||
}
|
||||
},
|
||||
behavior: HitTestBehavior.opaque, // 确保透明区域也能点击
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Transform.translate(
|
||||
offset: Offset(0, -6), // Y轴负值向上移动
|
||||
offset: const Offset(0, -6),
|
||||
child: Image.asset(
|
||||
"assets/images/gantan-blue.png",
|
||||
width: 15,
|
||||
|
@ -477,220 +441,154 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
),
|
||||
),
|
||||
],
|
||||
)),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void _goUnqualifiedPage(item) {
|
||||
// String hiddenId=SessionService.instance.unqualifiedInspectionItemID.toString();
|
||||
String hiddenId=item["ids"];
|
||||
if(hiddenId.isNotEmpty) {
|
||||
switch(widget.type ){
|
||||
case 1://隐患排查
|
||||
_getTemporaryStorageOfHiddenYinHuan(item,hiddenId);
|
||||
String hiddenId = item["ids"] ?? "";
|
||||
if (hiddenId.isNotEmpty) {
|
||||
switch (widget.type) {
|
||||
case 1: //隐患排查
|
||||
_getTemporaryStorageOfHiddenYinHuan(item, hiddenId);
|
||||
break;
|
||||
case 2://标准排查
|
||||
_getTemporaryStorageOfHidden(item,hiddenId);
|
||||
case 2: //标准排查
|
||||
_getTemporaryStorageOfHidden(item, hiddenId);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
pushPage(HazardRegistrationPage(
|
||||
item,nullResult,widget.type,
|
||||
onClose: (String departmentId,String yinHuanText) {
|
||||
} else {
|
||||
pushPage(
|
||||
HazardRegistrationPage(item, nullResult, widget.type, onClose: (String departmentId, String yinHuanText) {
|
||||
setState(() {
|
||||
this.yinHuanText=yinHuanText;
|
||||
item["REFERENCE_BASIS"]="option2";
|
||||
// _selectedValue="option2";
|
||||
// unqualifiedInspectionItemID=departmentId;
|
||||
item["ids"]=departmentId;
|
||||
this.yinHuanText = yinHuanText;
|
||||
item["REFERENCE_BASIS"] = "option2";
|
||||
item["ids"] = departmentId;
|
||||
});
|
||||
|
||||
},
|
||||
), context);
|
||||
}), context);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _getTemporaryStorageOfHiddenYinHuan(Map item,String hiddenId) async {
|
||||
|
||||
Future<void> _getTemporaryStorageOfHiddenYinHuan(Map item, String hiddenId) async {
|
||||
try {
|
||||
final result = await ApiService.getTemporaryStorageOfHiddenYinHuan(hiddenId);
|
||||
if (result['result'] == 'success') {
|
||||
try{
|
||||
dynamic pd=result["pd"];
|
||||
if(pd["HIDDEN_CATEGORY"]!=null){
|
||||
if(pd["HIDDEN_CATEGORY"]=='aa0b9abb642146588bc71a12272942db'){
|
||||
result["pd"]["HIDDEN_CATEGORY_NAME"]= "技术负责人登记隐患";
|
||||
}else if(pd["HIDDEN_CATEGORY"]=='355ff0ead356428fa83a01330cfe10c6'){
|
||||
result["pd"]["HIDDEN_CATEGORY_NAME"]= "主要负责人登记隐患";
|
||||
}else if(pd["HIDDEN_CATEGORY"]=='a92911891ea847cc8f4cfac2455170bd'){
|
||||
result["pd"]["HIDDEN_CATEGORY_NAME"]= "其他隐患";
|
||||
}else if(pd["HIDDEN_CATEGORY"]=='44f8ce46372d4616a654cd07f1ec9a48'){
|
||||
result["pd"]["HIDDEN_CATEGORY_NAME"]= "操作负责人登记隐患";
|
||||
try {
|
||||
dynamic pd = result["pd"];
|
||||
if (pd["HIDDEN_CATEGORY"] != null) {
|
||||
if (pd["HIDDEN_CATEGORY"] == 'aa0b9abb642146588bc71a12272942db') {
|
||||
result["pd"]["HIDDEN_CATEGORY_NAME"] = "技术负责人登记隐患";
|
||||
} else if (pd["HIDDEN_CATEGORY"] == '355ff0ead356428fa83a01330cfe10c6') {
|
||||
result["pd"]["HIDDEN_CATEGORY_NAME"] = "主要负责人登记隐患";
|
||||
} else if (pd["HIDDEN_CATEGORY"] == 'a92911891ea847cc8f4cfac2455170bd') {
|
||||
result["pd"]["HIDDEN_CATEGORY_NAME"] = "其他隐患";
|
||||
} else if (pd["HIDDEN_CATEGORY"] == '44f8ce46372d4616a654cd07f1ec9a48') {
|
||||
result["pd"]["HIDDEN_CATEGORY_NAME"] = "操作负责人登记隐患";
|
||||
}
|
||||
|
||||
}
|
||||
}catch(e){
|
||||
} catch (e) {
|
||||
print('数据获取失败:$e');
|
||||
}
|
||||
|
||||
pushPage(HazardRegistrationPage(
|
||||
item,result,widget.type,
|
||||
onClose: (String departmentId,String yinHuanText) {
|
||||
pushPage(HazardRegistrationPage(item, result, widget.type, onClose: (String departmentId, String yinHuanText) {
|
||||
setState(() {
|
||||
this.yinHuanText=yinHuanText;
|
||||
item["REFERENCE_BASIS"]="option2";
|
||||
// _selectedValue="option2";
|
||||
// unqualifiedInspectionItemID=departmentId;
|
||||
item["ids"]=departmentId;
|
||||
this.yinHuanText = yinHuanText;
|
||||
item["REFERENCE_BASIS"] = "option2";
|
||||
item["ids"] = departmentId;
|
||||
});
|
||||
|
||||
},
|
||||
), context);
|
||||
|
||||
}), context);
|
||||
} else {
|
||||
ToastUtil.showNormal(context, "加载数据失败");
|
||||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _getTemporaryStorageOfHidden(Map item,String hiddenId) async {
|
||||
|
||||
Future<void> _getTemporaryStorageOfHidden(Map item, String hiddenId) async {
|
||||
try {
|
||||
final result = await ApiService.getTemporaryStorageOfHidden(hiddenId);
|
||||
if (result['result'] == 'success') {
|
||||
|
||||
pushPage(HazardRegistrationPage(
|
||||
item,result,widget.type,
|
||||
onClose: (String departmentId,String yinHuanText) {
|
||||
pushPage(HazardRegistrationPage(item, result, widget.type, onClose: (String departmentId, String yinHuanText) {
|
||||
setState(() {
|
||||
this.yinHuanText=yinHuanText;
|
||||
item["REFERENCE_BASIS"]="option2";
|
||||
// _selectedValue="option2";
|
||||
// unqualifiedInspectionItemID=departmentId;
|
||||
item["ids"]=departmentId;
|
||||
this.yinHuanText = yinHuanText;
|
||||
item["REFERENCE_BASIS"] = "option2";
|
||||
item["ids"] = departmentId;
|
||||
});
|
||||
|
||||
},
|
||||
), context);
|
||||
|
||||
// final List<dynamic> newList = result['imgs'] ?? [];
|
||||
// List<PhotoItem> imgList = [];
|
||||
// for (Map item in newList) {
|
||||
// String id = item['IMGFILES_ID'] ?? '';
|
||||
// String filePath = item['FILEPATH'] ?? '';
|
||||
// imgList.add(
|
||||
// PhotoItem(
|
||||
// id: id, // 新图片没有ID
|
||||
// filePath: ApiService.baseImgPath+filePath,
|
||||
// type: "1",
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// pushPage(DangerImageUpdataPage(item["RECORDITEM_ID"], imgList: imgList), context);
|
||||
|
||||
}), context);
|
||||
} else {
|
||||
ToastUtil.showNormal(context, "加载数据失败");
|
||||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void _submit() {
|
||||
// if (_selectedValue == null) return;
|
||||
LoadingDialogHelper.show();
|
||||
_submitInvestigationItems();
|
||||
// 这里可以添加导航到下一页的代码
|
||||
// Navigator.push(context, MaterialPageRoute(builder: (_) => NextPage()));
|
||||
}
|
||||
|
||||
|
||||
Future<void> _submitInvestigationItems() async {
|
||||
|
||||
//获取定位
|
||||
Position position = await _determinePosition();
|
||||
String longitude=position.longitude.toString();
|
||||
String latitude=position.latitude.toString();
|
||||
String longitude = position.longitude.toString();
|
||||
String latitude = position.latitude.toString();
|
||||
|
||||
upDataItemList.clear();
|
||||
bool hasNoSelectItem=false;
|
||||
String ids="";
|
||||
for(int i=0;i<listDates.length;i++){
|
||||
final item=listDates[i];
|
||||
// final itemTwo=listDatesTwo[i];
|
||||
if(item["REFERENCE_BASIS"]=="option1"){
|
||||
upDataItemList.add( {
|
||||
bool hasNoSelectItem = false;
|
||||
String ids = "";
|
||||
for (int i = 0; i < listDates.length; i++) {
|
||||
final item = listDates[i];
|
||||
if (item["REFERENCE_BASIS"] == "option1") {
|
||||
upDataItemList.add({
|
||||
"CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"],
|
||||
"LISTCHECKITEM_ID": item["LISTCHECKITEM_ID"],
|
||||
|
||||
"RECORDITEM_ID": item["RECORDITEM_ID"],
|
||||
"ISNORMAL": "0",
|
||||
"CHECK_RESULT": item["CHECK_QUALIFIED"],
|
||||
});
|
||||
}else if(item["REFERENCE_BASIS"]=="option2"){
|
||||
upDataItemList.add( {
|
||||
} else if (item["REFERENCE_BASIS"] == "option2") {
|
||||
upDataItemList.add({
|
||||
"CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"],
|
||||
"LISTCHECKITEM_ID": item["LISTCHECKITEM_ID"],
|
||||
|
||||
"RECORDITEM_ID": item["RECORDITEM_ID"],
|
||||
"ISNORMAL": "1",
|
||||
"CHECK_RESULT":yinHuanText.isNotEmpty?yinHuanText:item["CHECK_QUALIFIED"],
|
||||
"CHECK_RESULT": yinHuanText.isNotEmpty ? yinHuanText : item["CHECK_QUALIFIED"],
|
||||
});
|
||||
// upDataItemList.add(UpDataItem.fromJson(itemTwo["CUSTOM_ITEM_ID"], itemTwo["CUSTOM_ITEM_ID"], "1",
|
||||
// yinHuanText.isNotEmpty?yinHuanText:item["CHECK_QUALIFIED"]));
|
||||
}else if(item["REFERENCE_BASIS"]=="option3"){
|
||||
upDataItemList.add( {
|
||||
} else if (item["REFERENCE_BASIS"] == "option3") {
|
||||
upDataItemList.add({
|
||||
"CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"],
|
||||
"LISTCHECKITEM_ID": item["LISTCHECKITEM_ID"],
|
||||
|
||||
"RECORDITEM_ID": item["RECORDITEM_ID"],
|
||||
"ISNORMAL": "2",
|
||||
"CHECK_RESULT":"",
|
||||
"CHECK_RESULT": "",
|
||||
});
|
||||
// upDataItemList.add(UpDataItem.fromJson(itemTwo["CUSTOM_ITEM_ID"], itemTwo["CUSTOM_ITEM_ID"], "2", ""));
|
||||
}else{
|
||||
hasNoSelectItem=true;
|
||||
} else {
|
||||
hasNoSelectItem = true;
|
||||
}
|
||||
|
||||
if(item["ids"].toString().isNotEmpty) {
|
||||
if (item["ids"].toString().isNotEmpty) {
|
||||
if (ids.isEmpty) {
|
||||
ids = item["ids"];
|
||||
} else {
|
||||
ids = "$ids," + item["ids"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if(hasNoSelectItem){
|
||||
if (hasNoSelectItem) {
|
||||
ToastUtil.showNormal(context, "还有位选择的排查项");
|
||||
LoadingDialogHelper.hide();
|
||||
return;
|
||||
}
|
||||
String itemsString= jsonEncode(upDataItemList);
|
||||
String CHECKRECORD_ID= widget.checkrecordId?? "";
|
||||
String itemsString = jsonEncode(upDataItemList);
|
||||
String CHECKRECORD_ID = widget.checkrecordId ?? "";
|
||||
try {
|
||||
|
||||
final Map<String, dynamic> result;
|
||||
if(widget.type==1){
|
||||
result = await ApiService.submitInvestigationItemsYinHuan(
|
||||
widget.item,longitude,latitude,itemsString,ids,CHECKRECORD_ID);
|
||||
}else{
|
||||
result = await ApiService.submitInvestigationItems(
|
||||
widget.item,longitude,latitude,itemsString,ids,CHECKRECORD_ID);
|
||||
if (widget.type == 1) {
|
||||
result = await ApiService.submitInvestigationItemsYinHuan(widget.item, longitude, latitude, itemsString, ids, CHECKRECORD_ID);
|
||||
} else {
|
||||
result = await ApiService.submitInvestigationItems(widget.item, longitude, latitude, itemsString, ids, CHECKRECORD_ID);
|
||||
}
|
||||
|
||||
if (result['result'] == 'success') {
|
||||
|
@ -699,16 +597,12 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
Navigator.pop(context);
|
||||
LoadingDialogHelper.hide();
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
ToastUtil.showNormal(context, "加载数据失败");
|
||||
LoadingDialogHelper.hide();
|
||||
// _showMessage('加载数据失败');
|
||||
}
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide();
|
||||
// 出错时可以 Toast 或者在页面上显示错误状态
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
}
|
||||
|
@ -717,13 +611,11 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
bool serviceEnabled;
|
||||
LocationPermission permission;
|
||||
|
||||
// 检查定位服务是否启用
|
||||
serviceEnabled = await Geolocator.isLocationServiceEnabled();
|
||||
if (!serviceEnabled) {
|
||||
return Future.error('Location services are disabled.');
|
||||
}
|
||||
|
||||
// 获取权限
|
||||
permission = await Geolocator.checkPermission();
|
||||
if (permission == LocationPermission.denied) {
|
||||
permission = await Geolocator.requestPermission();
|
||||
|
@ -733,11 +625,9 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
}
|
||||
|
||||
if (permission == LocationPermission.deniedForever) {
|
||||
return Future.error(
|
||||
'Location permissions are permanently denied, we cannot request permissions.');
|
||||
return Future.error('Location permissions are permanently denied, we cannot request permissions.');
|
||||
}
|
||||
|
||||
// 获取当前位置
|
||||
return await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
|
||||
}
|
||||
|
||||
|
@ -745,11 +635,8 @@ class _DangerProjectPageState extends State<DangerProjectPage> {
|
|||
if (text.length <= maxLength) return text;
|
||||
return '${text.substring(0, maxLength)}...';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 模拟数据模版
|
||||
class UpDataItem {
|
||||
final String CUSTOM_ITEM_ID;
|
||||
|
@ -757,24 +644,9 @@ class UpDataItem {
|
|||
final String ISNORMAL;
|
||||
final String CHECK_RESULT;
|
||||
|
||||
UpDataItem(
|
||||
this.CUSTOM_ITEM_ID,
|
||||
this.RECORDITEM_ID,
|
||||
this.ISNORMAL,
|
||||
this.CHECK_RESULT,
|
||||
);
|
||||
UpDataItem(this.CUSTOM_ITEM_ID, this.RECORDITEM_ID, this.ISNORMAL, this.CHECK_RESULT);
|
||||
|
||||
factory UpDataItem.fromJson(
|
||||
String CUSTOM_ITEM_ID,
|
||||
String RECORDITEM_ID,
|
||||
String ISNORMAL,
|
||||
String CHECK_RESULT,
|
||||
) {
|
||||
return UpDataItem(
|
||||
CUSTOM_ITEM_ID, // 直接传递参数,不使用命名参数语法
|
||||
RECORDITEM_ID,
|
||||
ISNORMAL,
|
||||
CHECK_RESULT,
|
||||
);
|
||||
factory UpDataItem.fromJson(String CUSTOM_ITEM_ID, String RECORDITEM_ID, String ISNORMAL, String CHECK_RESULT) {
|
||||
return UpDataItem(CUSTOM_ITEM_ID, RECORDITEM_ID, ISNORMAL, CHECK_RESULT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,34 +1,42 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'dart:io';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
||||
import 'package:qhd_prevention/http/ApiService.dart';
|
||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||
|
||||
import '../../tools/tools.dart';
|
||||
import 'mine_sign_page.dart';
|
||||
|
||||
|
||||
|
||||
|
||||
class FirstSignPage extends StatefulWidget {
|
||||
const FirstSignPage({super.key});
|
||||
|
||||
|
||||
@override
|
||||
State<FirstSignPage> createState() => _SignatureUpdatePageState();
|
||||
}
|
||||
|
||||
class _SignatureUpdatePageState extends State<FirstSignPage> {
|
||||
String imagePath="";
|
||||
|
||||
|
||||
String imagePath = "";
|
||||
|
||||
Future<void> refreshSign() async {
|
||||
if (imagePath.isEmpty) {
|
||||
ToastUtil.showNormal(context, '请签字');
|
||||
return;
|
||||
}
|
||||
LoadingDialogHelper.show();
|
||||
final result = await ApiService.refreshSignInfo(imagePath);
|
||||
LoadingDialogHelper.hide();
|
||||
if (result['result'] == 'success') {
|
||||
ToastUtil.showSuccess(context, '保存成功');
|
||||
Navigator.pop(context);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: MyAppbar(title: "更新签字信息"),
|
||||
body:
|
||||
Container(
|
||||
body: Container(
|
||||
margin: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
@ -36,7 +44,7 @@ class _SignatureUpdatePageState extends State<FirstSignPage> {
|
|||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text("用户",style: TextStyle(color: Colors.black,fontSize: 16)),
|
||||
Text("用户", style: TextStyle(color: Colors.black, fontSize: 16)),
|
||||
_buildConfirmButton(),
|
||||
],
|
||||
),
|
||||
|
@ -45,7 +53,8 @@ class _SignatureUpdatePageState extends State<FirstSignPage> {
|
|||
Row(
|
||||
children: [
|
||||
if (imagePath.isNotEmpty)
|
||||
Text('签字照片:',
|
||||
Text(
|
||||
'签字照片:',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
@ -54,8 +63,12 @@ class _SignatureUpdatePageState extends State<FirstSignPage> {
|
|||
),
|
||||
const SizedBox(width: 15),
|
||||
if (imagePath.isNotEmpty)
|
||||
Image.file(File(imagePath),width: 230,height: 150,fit: BoxFit.cover,),
|
||||
|
||||
Image.file(
|
||||
File(imagePath),
|
||||
width: 230,
|
||||
height: 150,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
|
@ -66,19 +79,23 @@ class _SignatureUpdatePageState extends State<FirstSignPage> {
|
|||
],
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Widget _buildTrueButton() {
|
||||
return Center(
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
refreshSign();
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF4285F4),
|
||||
padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 80),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Text('确认', style: TextStyle(fontSize: 14, color: Colors.white)),
|
||||
),
|
||||
);
|
||||
}
|
||||
Widget _buildConfirmButton() {
|
||||
return SizedBox(
|
||||
width: 80,
|
||||
|
@ -97,14 +114,11 @@ class _SignatureUpdatePageState extends State<FirstSignPage> {
|
|||
setState(() {
|
||||
imagePath = path ?? '';
|
||||
});
|
||||
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF4285F4),
|
||||
padding: const EdgeInsets.symmetric(vertical: 5),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Text(
|
||||
'手写签字',
|
||||
|
@ -116,27 +130,3 @@ class _SignatureUpdatePageState extends State<FirstSignPage> {
|
|||
}
|
||||
|
||||
|
||||
Widget _buildTrueButton() {
|
||||
return Center(
|
||||
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF4285F4),
|
||||
padding: const EdgeInsets.symmetric(vertical:5,horizontal: 80),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'确认',
|
||||
style: TextStyle(fontSize: 14, color: Colors.white),
|
||||
),
|
||||
),
|
||||
|
||||
|
||||
);
|
||||
|
||||
}
|
Loading…
Reference in New Issue