Browse Source

开始扫描

周素华 1 year ago
parent
commit
76700e6d7c

+ 11 - 0
android/app/build.gradle

@@ -42,6 +42,8 @@ android {
42 42
         versionName flutterVersionName
43 43
     }
44 44
 
45
+    println "targetSdkVersion: ${flutter.targetSdkVersion}"
46
+
45 47
     // 签名配置
46 48
     signingConfigs {
47 49
         release {
@@ -86,6 +88,15 @@ android {
86 88
     dependencies {
87 89
         implementation fileTree(include: ['*.jar'], dir: 'libs')
88 90
         implementation 'com.amap.api:location:5.6.0'
91
+
92
+        //打印库
93
+        implementation files('libs/3.2.2-release.aar')
94
+        //接⼊机型包含B50/B50W/B11/T6/T7/T8系列打印机需要引⼊该包,如不包含则可以不引⼊
95
+        implementation files('libs/LPAPI-2019-11-20-R.jar')
96
+        implementation files('libs/image-1.8.4.6.aar')
97
+
98
+        //权限库
99
+        implementation 'com.guolindev.permissionx:permissionx:1.7.1'
89 100
     }
90 101
 }
91 102
 

BIN
android/app/libs/3.2.2-release.aar


BIN
android/app/libs/LPAPI-2019-11-20-R.jar


BIN
android/app/libs/image-1.8.4.6.aar


+ 16 - 1
android/app/src/main/AndroidManifest.xml

@@ -1,4 +1,5 @@
1
-<manifest xmlns:android="http://schemas.android.com/apk/res/android">
1
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2
+    xmlns:tools="http://schemas.android.com/tools">
2 3
     <!--允许访问网络,必选权限-->
3 4
     <uses-permission android:name="android.permission.INTERNET" />
4 5
 
@@ -38,6 +39,20 @@
38 39
     <!--允许安装应用-->
39 40
     <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
40 41
 
42
+    <!-- 蓝⽛打印机权限 -->
43
+    <!-- 蓝⽛权限 -->
44
+    <uses-permission android:name="android.permission.BLUETOOTH" />
45
+    <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
46
+    <!-- android 5以上 android 12以下,蓝⽛搜索需要位置权限 -->
47
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
48
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"
49
+        />
50
+    <!--android 12 需要申请蓝⽛搜索权限、连接权限 ⽆需申请位置权限 -->
51
+    <uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
52
+    <uses-permission android:name="android.permission.BLUETOOTH_SCAN" android:usesPermissionFlags="neverForLocation" tools:targetApi="s" />
53
+
54
+
55
+
41 56
     <application
42 57
         android:name="${applicationName}"
43 58
         android:icon="@drawable/ic_launcher"

+ 19 - 0
android/app/src/main/java/com/szls/lszlgl/MainActivity.java

@@ -1,6 +1,25 @@
1 1
 package com.szls.lszlgl;
2 2
 
3
+import android.util.Log;
4
+
5
+import androidx.annotation.NonNull;
6
+
3 7
 import io.flutter.embedding.android.FlutterActivity;
8
+import io.flutter.embedding.engine.FlutterEngine;
9
+import io.flutter.embedding.engine.plugins.util.GeneratedPluginRegister;
10
+import io.flutter.plugins.BluetoothPlugin;
4 11
 
5 12
 public class MainActivity extends FlutterActivity {
13
+    @Override
14
+    public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
15
+        super.configureFlutterEngine(flutterEngine);
16
+
17
+
18
+
19
+        Log.e("AAAA", ">>> configureFlutterEngine");
20
+        GeneratedPluginRegister.registerGeneratedPlugins(flutterEngine);
21
+
22
+        //插件实例的注册,就是自己写个类,然后实现Flutter提供的FlutterPlugin接口
23
+        flutterEngine.getPlugins().add(new BluetoothPlugin());
24
+    }
6 25
 }

+ 131 - 0
android/app/src/main/java/io/flutter/plugins/BluetoothPlugin.java

@@ -0,0 +1,131 @@
1
+package io.flutter.plugins;
2
+
3
+import android.Manifest;
4
+import android.bluetooth.BluetoothAdapter;
5
+import android.content.Context;
6
+import android.os.Build;
7
+import android.util.Log;
8
+import android.view.View;
9
+import android.widget.Toast;
10
+
11
+import androidx.annotation.NonNull;
12
+
13
+import com.permissionx.guolindev.PermissionX;
14
+
15
+import java.security.Permission;
16
+import java.util.List;
17
+
18
+import dev.fluttercommunity.plus.androidintent.IntentSender;
19
+import dev.fluttercommunity.plus.androidintent.MethodCallHandlerImpl;
20
+import io.flutter.embedding.engine.plugins.FlutterPlugin;
21
+import io.flutter.plugin.common.BinaryMessenger;
22
+import io.flutter.plugin.common.MethodCall;
23
+import io.flutter.plugin.common.MethodChannel;
24
+
25
+public class BluetoothPlugin implements FlutterPlugin, MethodChannel.MethodCallHandler {
26
+
27
+    private String methodChannelName = "io.flutter.plugins/bluetooth";
28
+    private MethodChannel methodChannel;
29
+
30
+
31
+    private BluetoothAdapter mBluetoothAdapter;
32
+
33
+    public BluetoothPlugin() {
34
+        mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
35
+
36
+    }
37
+
38
+    @Override
39
+    public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
40
+        setupChannels(flutterPluginBinding.getBinaryMessenger(), flutterPluginBinding.getApplicationContext());
41
+    }
42
+
43
+    private void setupChannels(BinaryMessenger binaryMessenger, Context applicationContext) {
44
+
45
+        methodChannel = new MethodChannel(binaryMessenger, methodChannelName);
46
+        applicationContext = applicationContext.getApplicationContext();
47
+        applicationContext.
48
+
49
+        methodChannel.setMethodCallHandler(this);
50
+
51
+    }
52
+
53
+    @Override
54
+    public void onDetachedFromEngine(@NonNull FlutterPluginBinding flutterPluginBinding) {
55
+        teardownChannels();
56
+    }
57
+
58
+    @Override
59
+    public void onMethodCall(@NonNull MethodCall methodCall, @NonNull MethodChannel.Result result) {
60
+        switch (methodCall.method) {
61
+
62
+            case "isSupportBle":
63
+                Log.d("ble", "isSupportBle");
64
+                result.success(true);
65
+                break;
66
+            case "startScan":
67
+                Log.d("ble", "startScan");
68
+                startScan(result);
69
+                break;
70
+            case "autoLogin":
71
+
72
+                break;
73
+            case "isLogined":
74
+
75
+                break;
76
+            case "currentAccount":
77
+                 break;
78
+            case "logout":
79
+                 break;
80
+            case "markAllMessagesRead":
81
+                 break;
82
+            default:
83
+            {
84
+                result.notImplemented();
85
+                break;
86
+            }
87
+        }
88
+    }
89
+
90
+
91
+    private void teardownChannels() {
92
+        methodChannel.setMethodCallHandler(null);
93
+        methodChannel = null;
94
+    }
95
+
96
+
97
+    void startScan(@NonNull MethodChannel.Result result) {
98
+
99
+        Log.d("ble", "开始搜索 ");
100
+        if (!mBluetoothAdapter.isEnabled()) {
101
+            result.success(1); //
102
+        } else {
103
+            permissionRequest();
104
+        }
105
+    }
106
+
107
+    private void permissionRequest() {
108
+        String[] permissions;
109
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
110
+            permissions = new String[]{Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT};
111
+        } else {
112
+            permissions = new String[]{Manifest.permission.ACCESS_COARSE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION};
113
+        }
114
+
115
+
116
+
117
+        PermissionX.init(requireActivity())
118
+                .permissions(permissions)
119
+                .request(this::handlePermissionResult);
120
+    }
121
+
122
+    private void handlePermissionResult(boolean allGranted, List<String> grantedList, List<String> deniedList) {
123
+        if (allGranted) {
124
+            Log.d("ble", "handleAllPermissionsGranted ");
125
+//            handleAllPermissionsGranted();
126
+        } else {
127
+            Log.d("ble", "权限打开失败 ");
128
+        }
129
+    }
130
+
131
+}

+ 160 - 0
lib/page/print/connect_print_page.dart

@@ -0,0 +1,160 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter/services.dart';
3
+import 'package:lszlgl/base/base_lifecycle_state.dart';
4
+import 'package:signature/signature.dart';
5
+import 'package:lszlgl/widget/button.dart';
6
+
7
+import '../../plugin/bluetooth_plugin.dart';
8
+import '../home/home_page.dart';
9
+
10
+class ConnectPrintPageArgs {
11
+  int count;
12
+
13
+  ConnectPrintPageArgs({this.count = 1});
14
+
15
+  @override
16
+  String toString() {
17
+    return {'count': count}.toString();
18
+  }
19
+}
20
+
21
+/// 电子签名
22
+class ConnectPrintPage extends StatefulWidget {
23
+  final ConnectPrintPageArgs args;
24
+
25
+  const ConnectPrintPage({
26
+    super.key,
27
+    required this.args,
28
+  });
29
+
30
+  @override
31
+  State<ConnectPrintPage> createState() => _ConnectPrintPageState();
32
+}
33
+
34
+class _ConnectPrintPageState extends BaseLifecycleState<ConnectPrintPage> {
35
+  late int count;
36
+  late List<SignatureController> ctrlList;
37
+  late PageController pageCtrl;
38
+
39
+  final previousEnable = false.notifier<bool>();
40
+  final nextEnable = false.notifier<bool>();
41
+  final submitEnable = false.notifier<bool>();
42
+
43
+  late List<ServiceModel> serviceList;
44
+
45
+  @override
46
+  void initState() {
47
+    super.initState();
48
+    serviceList = [
49
+      ServiceModel(name: '搜索', icon: imgHomeListPzjc, onTap: () => startScan()),
50
+    ];
51
+  }
52
+
53
+  /// 去连接
54
+  Future<void> startScan() async {
55
+
56
+    int result = await BluetoothPlugin.instance.startScan();
57
+    if(result == 1) {
58
+      // 蓝牙未开启
59
+      MyNavigator.showToast('蓝牙未开启');
60
+    }
61
+  }
62
+
63
+  /// 去打印
64
+  void startPrint() {
65
+
66
+  }
67
+
68
+  @override
69
+  void onInit() {
70
+
71
+    // 创建签名列表
72
+    count = widget.args.count;
73
+    ctrlList = List.generate(
74
+      count,
75
+          (index) => SignatureController(
76
+        penStrokeWidth: 6,
77
+        penColor: Colors.black,
78
+        strokeJoin: StrokeJoin.round,
79
+        strokeCap: StrokeCap.round,
80
+      ),
81
+    ).toList();
82
+    pageCtrl = PageController();
83
+    if (count == 1) {
84
+      submitEnable.value = true;
85
+    } else {
86
+      nextEnable.value = true;
87
+    }
88
+  }
89
+
90
+  @override
91
+  void onDestroy() {
92
+    SystemChrome.setPreferredOrientations([
93
+      DeviceOrientation.portraitUp,
94
+      DeviceOrientation.portraitDown,
95
+    ]);
96
+    for (var ctrl in ctrlList) {
97
+      ctrl.dispose();
98
+    }
99
+  }
100
+
101
+  @override
102
+  Widget build(BuildContext context) {
103
+    return myScaffold(
104
+      child: Column(
105
+        children: [
106
+          myAppBar(title: '连接打印机'),
107
+          const SizedBox(height: 18),
108
+          ...List.generate(
109
+            serviceList.length,
110
+                (index) => buildServiceItem(serviceList[index]),
111
+          ).toList(),
112
+        ],
113
+      ),
114
+    );
115
+  }
116
+
117
+  Widget buildServiceItem(ServiceModel service) {
118
+    return GestureDetector(
119
+      onTap: service.onTap,
120
+      child: Container(
121
+        margin: const EdgeInsets.only(left: 12, right: 12, bottom: 22),
122
+        padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 40),
123
+        clipBehavior: Clip.hardEdge,
124
+        decoration: BoxDecoration(
125
+          borderRadius: const BorderRadius.all(Radius.circular(12)),
126
+          boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.1), offset: const Offset(0, 5), blurRadius: 4)],
127
+          image: const DecorationImage(image: AssetImage(imgHomeListBg), fit: BoxFit.fill),
128
+        ),
129
+        child: Row(
130
+          children: [
131
+            Image.asset(service.icon, height: 64),
132
+            const SizedBox(width: 12),
133
+            Expanded(
134
+              child: Column(
135
+                mainAxisSize: MainAxisSize.min,
136
+                children: [
137
+                  Text(
138
+                    service.name,
139
+                    textAlign: TextAlign.center,
140
+                    style: const TextStyle(color: Color(0xFF333333), fontSize: 20, fontWeight: FontWeight.w500),
141
+                  ),
142
+                  service.nameEn != null
143
+                      ? Padding(
144
+                    padding: const EdgeInsets.only(top: 4),
145
+                    child: Text(
146
+                      service.nameEn!,
147
+                      textAlign: TextAlign.center,
148
+                      style: const TextStyle(color: Color(0xFF333333), fontSize: 12, fontWeight: FontWeight.w500),
149
+                    ),
150
+                  )
151
+                      : const SizedBox.shrink(),
152
+                ],
153
+              ),
154
+            ),
155
+          ],
156
+        ),
157
+      ),
158
+    );
159
+  }
160
+}

+ 158 - 0
lib/page/print/print_page.dart

@@ -0,0 +1,158 @@
1
+import 'package:flutter/material.dart';
2
+import 'package:flutter/services.dart';
3
+import 'package:lszlgl/base/base_lifecycle_state.dart';
4
+import 'package:lszlgl/page/print/connect_print_page.dart';
5
+import 'package:signature/signature.dart';
6
+import 'package:lszlgl/widget/button.dart';
7
+
8
+import '../home/home_page.dart';
9
+
10
+class PrintPageArgs {
11
+  /// 签名数量
12
+  int count;
13
+
14
+  PrintPageArgs({this.count = 1});
15
+
16
+  @override
17
+  String toString() {
18
+    return {'count': count}.toString();
19
+  }
20
+}
21
+
22
+/// 电子签名
23
+class PrintPage extends StatefulWidget {
24
+  final PrintPageArgs args;
25
+
26
+  const PrintPage({
27
+    super.key,
28
+    required this.args,
29
+  });
30
+
31
+  @override
32
+  State<PrintPage> createState() => _PrintPageState();
33
+}
34
+
35
+class _PrintPageState extends BaseLifecycleState<PrintPage> {
36
+  late int count;
37
+  late List<SignatureController> ctrlList;
38
+  late PageController pageCtrl;
39
+
40
+  final previousEnable = false.notifier<bool>();
41
+  final nextEnable = false.notifier<bool>();
42
+  final submitEnable = false.notifier<bool>();
43
+
44
+  late List<ServiceModel> serviceList;
45
+
46
+  @override
47
+  void initState() {
48
+    super.initState();
49
+    serviceList = [
50
+      ServiceModel(name: '连接', icon: imgHomeListPzjc, onTap: () => startConnect()),
51
+      ServiceModel(name: '打印', icon: imgHomeListZcjy, onTap: () => startPrint()),
52
+    ];
53
+  }
54
+
55
+  Future<void> startConnect() async {
56
+
57
+    var args = ConnectPrintPageArgs(count: 0);
58
+    await MyRouter.startConnectPrint(args: args);
59
+  }
60
+
61
+  /// 去打印
62
+  void startPrint() {
63
+
64
+  }
65
+
66
+  @override
67
+  void onInit() {
68
+
69
+    // 创建签名列表
70
+    count = widget.args.count;
71
+    ctrlList = List.generate(
72
+      count,
73
+          (index) => SignatureController(
74
+        penStrokeWidth: 6,
75
+        penColor: Colors.black,
76
+        strokeJoin: StrokeJoin.round,
77
+        strokeCap: StrokeCap.round,
78
+      ),
79
+    ).toList();
80
+    pageCtrl = PageController();
81
+    if (count == 1) {
82
+      submitEnable.value = true;
83
+    } else {
84
+      nextEnable.value = true;
85
+    }
86
+  }
87
+
88
+  @override
89
+  void onDestroy() {
90
+    SystemChrome.setPreferredOrientations([
91
+      DeviceOrientation.portraitUp,
92
+      DeviceOrientation.portraitDown,
93
+    ]);
94
+    for (var ctrl in ctrlList) {
95
+      ctrl.dispose();
96
+    }
97
+  }
98
+
99
+  @override
100
+  Widget build(BuildContext context) {
101
+    return myScaffold(
102
+      child: Column(
103
+        children: [
104
+          myAppBar(title: '打印二维码'),
105
+          const SizedBox(height: 18),
106
+          ...List.generate(
107
+            serviceList.length,
108
+                (index) => buildServiceItem(serviceList[index]),
109
+          ).toList(),
110
+        ],
111
+      ),
112
+    );
113
+  }
114
+
115
+  Widget buildServiceItem(ServiceModel service) {
116
+    return GestureDetector(
117
+      onTap: service.onTap,
118
+      child: Container(
119
+        margin: const EdgeInsets.only(left: 12, right: 12, bottom: 22),
120
+        padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 40),
121
+        clipBehavior: Clip.hardEdge,
122
+        decoration: BoxDecoration(
123
+          borderRadius: const BorderRadius.all(Radius.circular(12)),
124
+          boxShadow: [BoxShadow(color: Colors.black.withOpacity(0.1), offset: const Offset(0, 5), blurRadius: 4)],
125
+          image: const DecorationImage(image: AssetImage(imgHomeListBg), fit: BoxFit.fill),
126
+        ),
127
+        child: Row(
128
+          children: [
129
+            Image.asset(service.icon, height: 64),
130
+            const SizedBox(width: 12),
131
+            Expanded(
132
+              child: Column(
133
+                mainAxisSize: MainAxisSize.min,
134
+                children: [
135
+                  Text(
136
+                    service.name,
137
+                    textAlign: TextAlign.center,
138
+                    style: const TextStyle(color: Color(0xFF333333), fontSize: 20, fontWeight: FontWeight.w500),
139
+                  ),
140
+                  service.nameEn != null
141
+                      ? Padding(
142
+                    padding: const EdgeInsets.only(top: 4),
143
+                    child: Text(
144
+                      service.nameEn!,
145
+                      textAlign: TextAlign.center,
146
+                      style: const TextStyle(color: Color(0xFF333333), fontSize: 12, fontWeight: FontWeight.w500),
147
+                    ),
148
+                  )
149
+                      : const SizedBox.shrink(),
150
+                ],
151
+              ),
152
+            ),
153
+          ],
154
+        ),
155
+      ),
156
+    );
157
+  }
158
+}

+ 8 - 1
lib/page/sample_task/reap_sample_detail/reap_sample_task_page.dart

@@ -8,6 +8,7 @@ import 'package:image_gallery_saver/image_gallery_saver.dart';
8 8
 import 'package:lszlgl/base/base_lifecycle_state.dart';
9 9
 import 'package:lszlgl/config/colors.dart';
10 10
 import 'package:lszlgl/model/rsp/sample_task_rsp.dart';
11
+import 'package:lszlgl/page/print/print_page.dart';
11 12
 import 'package:lszlgl/page/sample_task/reap_sample_detail/reap_sample_basic_detail_page.dart';
12 13
 import 'package:lszlgl/page/sample_task/reap_sample_detail/reap_sample_disaster_detail_page.dart';
13 14
 import 'package:lszlgl/page/sample_task/reap_sample_detail/reap_sample_medicine_detail_page.dart';
@@ -18,6 +19,7 @@ import 'package:lszlgl/page/signature/signature_page.dart';
18 19
 import '../../../base/base_vm.dart';
19 20
 import '../../../main.dart';
20 21
 import '../../../network/my_api.dart';
22
+import '../../../plugin/bluetooth_plugin.dart';
21 23
 import '../../../utils/file_utils.dart';
22 24
 import '../../../widget/button.dart';
23 25
 import '../../../widget/page_widget.dart';
@@ -185,7 +187,7 @@ class _ReapSampleTaskPageState extends BaseLifecycleState<ReapSampleTaskPage> wi
185 187
             ),
186 188
             Row(
187 189
               children: [
188
-                const Expanded(child: MyButton('打印')),
190
+                Expanded(child: MyButton('打印', onTap: () => printPic(picInfo.name))),
189 191
                 const SizedBox(width: 16),
190 192
                 Expanded(child: MyButton('保存图片', onTap: () => savePic(picInfo.name))),
191 193
               ],
@@ -196,6 +198,11 @@ class _ReapSampleTaskPageState extends BaseLifecycleState<ReapSampleTaskPage> wi
196 198
     );
197 199
   }
198 200
 
201
+  Future<void> printPic(String? name) async {
202
+    var args = PrintPageArgs(count: 0);
203
+    await MyRouter.startPrint(args: args);
204
+  }
205
+
199 206
   void savePic(String? name) async {
200 207
     MyNavigator.showLoading(msg: '保存中...');
201 208
     Uint8List? bytes = await FileUtils.getBitmapFromContext(ewmKey.currentContext);

+ 35 - 0
lib/plugin/bluetooth_plugin.dart

@@ -0,0 +1,35 @@
1
+import 'dart:io';
2
+
3
+import 'package:flutter/services.dart';
4
+
5
+class BluetoothPlugin {
6
+  factory BluetoothPlugin() => _instance;
7
+  BluetoothPlugin._();
8
+  static final BluetoothPlugin _instance = BluetoothPlugin._();
9
+  static BluetoothPlugin get instance => _instance;
10
+
11
+  final MethodChannel _channel = const MethodChannel("io.flutter.plugins/bluetooth");
12
+
13
+  //开始扫描
14
+  Future<int> startScan() async {
15
+    if (Platform.isIOS) {
16
+      return 0;
17
+    }
18
+    return _channel.invokeMethod('startScan').then<int>((d) => d);
19
+  }
20
+
21
+  //设备是否支持蓝牙
22
+  Future<bool> isSupportBle() async {
23
+    if (Platform.isIOS) {
24
+      return true;
25
+    }
26
+    return _channel.invokeMethod('isSupportBle').then<bool>((d) => d);
27
+  }
28
+
29
+  //打开蓝牙
30
+  Future open() async {
31
+    if (Platform.isAndroid) {
32
+      _channel.invokeMethod('open');
33
+    }
34
+  }
35
+}

+ 18 - 0
lib/router/my_router.dart

@@ -1,5 +1,7 @@
1 1
 import 'package:lszlgl/page/login/login_page.dart';
2 2
 import 'package:lszlgl/page/main_tab_page.dart';
3
+import 'package:lszlgl/page/print/connect_print_page.dart';
4
+import 'package:lszlgl/page/print/print_page.dart';
3 5
 import 'package:lszlgl/page/sample_task/reap_sample_detail/reap_sample_task_page.dart';
4 6
 import 'package:lszlgl/page/sample_task/sample_task_list_tab_page.dart';
5 7
 import 'package:lszlgl/page/user_center/account_manage_page.dart';
@@ -28,6 +30,10 @@ const rReapSampleTaskPage = '/ReapSampleTaskPage';
28 30
 const rStockSampleTaskPage = '/StockSampleTaskPage';
29 31
 // 电子签名
30 32
 const rSignaturePage = '/SignaturePage';
33
+// 打印
34
+const rPrintPage = '/PrintPage';
35
+// 连接
36
+const rConnectPrintPage = '/ConnectPrintPage';
31 37
 
32 38
 final Map<String, MyNavigatorBuilder> rRouteMap = {
33 39
   // 根页面
@@ -40,6 +46,8 @@ final Map<String, MyNavigatorBuilder> rRouteMap = {
40 46
   rReapSampleTaskPage: (context, args) => ReapSampleTaskPage(args: args as ReapSampleTaskPageArgs),
41 47
   rStockSampleTaskPage: (context, args) => StockSampleTaskPage(args: args as StockSampleTaskPageArgs),
42 48
   rSignaturePage: (context, args) => SignaturePage(args: args as SignaturePageArgs),
49
+  rPrintPage: (context, args) => PrintPage(args: args as PrintPageArgs),
50
+  rConnectPrintPage: (context, args) => ConnectPrintPage(args: args as ConnectPrintPageArgs),
43 51
 };
44 52
 
45 53
 class MyRouter {
@@ -97,4 +105,14 @@ class MyRouter {
97 105
   static Future<dynamic> startSignature({SignaturePageArgs? args}) {
98 106
     return MyNavigator.push(rSignaturePage, args: args ?? SignaturePageArgs());
99 107
   }
108
+
109
+  /// 打印任务
110
+  static Future<dynamic> startPrint({PrintPageArgs? args}) {
111
+    return MyNavigator.push(rPrintPage, args: args ?? PrintPageArgs());
112
+  }
113
+
114
+  /// 打印任务
115
+  static Future<dynamic> startConnectPrint({ConnectPrintPageArgs? args}) {
116
+    return MyNavigator.push(rConnectPrintPage, args: args ?? ConnectPrintPageArgs());
117
+  }
100 118
 }