Commit 3cdd1b01 authored by 宁天庆's avatar 宁天庆

修改代码

parent 478b8b33
......@@ -30,7 +30,7 @@ void initSysConfig() {
GlobalConfig.gatewayUrl = HttpConfig.GateWayURL;
/// 配置 login 模块
LoginGlobalConfig.showSysConfig = true;
LoginGlobalConfig.showSysConfig = false;
LoginGlobalConfig.gatewayUrl = HttpConfig.GateWayURL;
LoginGlobalConfig.imageUrl = HttpConfig.ImageUrl;
// LoginGlobalConfig.mqttUrl = HttpConfig.mqttUrl;
......
......@@ -40,13 +40,13 @@ class _NewQrPageState extends State<NewQrPage> {
///扫码
Future<void> scan() async {
getContent('13513A00018');
// String result = await methodChannel.invokeMethod('scan');
// if (result != null && result.isNotEmpty) {
// getContent(result);
// } else {
// Navigator.pop(context);
// }
// getContent('13513A00018');
String result = await methodChannel.invokeMethod('scan');
if (result != null && result.isNotEmpty) {
getContent(result);
} else {
Navigator.pop(context);
}
}
Future<void> getContent(String no) async {
......
......@@ -3,6 +3,12 @@ import 'package:amos_flutter_ui/amos_flutter_ui.dart';
import './MeasurementScanCode.dart';
import './../scanOnce/DeviceDetailPage.dart';
Map<String, String> bizTypeNames = {
'submission': '送检',
'receive': '接收',
'recaption': '领取'
};
class InspectionPage extends StatefulWidget {
final String bizType;
......@@ -45,7 +51,7 @@ class _InspectionPageState extends State<InspectionPage> {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("送检"),
title: Text(bizTypeNames[widget.bizType] ?? '送检'),
// 低版本AppBar返回按钮适配
leading: IconButton(
icon: Icon(Icons.arrow_back),
......@@ -70,7 +76,7 @@ class _InspectionPageState extends State<InspectionPage> {
Container(
padding: EdgeInsets.fromLTRB(12,12,0,6),
child: Text(
"已送检设备列表",
"已" + (bizTypeNames[widget.bizType] ?? '送检') + "设备列表",
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
......@@ -146,7 +152,7 @@ class _InspectionPageState extends State<InspectionPage> {
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
Text(
"设备扫码送检",
"设备扫码" + bizTypeNames[widget.bizType] ?? '送检',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
......
......@@ -5,6 +5,7 @@ import 'package:permission_handler/permission_handler.dart';
import '../../services/qis.dart';
class MeasurementScanCode extends StatefulWidget {
final String bizType; // 接收扫码传递的设备编码
......@@ -41,13 +42,13 @@ class _MeasurementScanCodeState extends State<MeasurementScanCode> {
///扫码
Future<void> scan() async {
getContent('13513A00012');
// String result = await methodChannel.invokeMethod('scan');
// if (result != null && result.isNotEmpty) {
// getContent(result);
// } else {
// Navigator.pop(context);
// }
// getContent('13513A00012');
String result = await methodChannel.invokeMethod('scan');
if (result != null && result.isNotEmpty) {
getContent(result);
} else {
Navigator.pop(context);
}
}
Future<void> getContent(String no) async {
......@@ -56,6 +57,8 @@ class _MeasurementScanCodeState extends State<MeasurementScanCode> {
if (data['message'] != null) {
shortMessage(data['message']).then((v) {
// scan();
Navigator.pop(context);
});
} else {
shortMessage('送检成功');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment