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

修改代码

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