Browse Source

发布29测试版本。极光推送弹窗,加app版本更新内容等。

liujq 1 month ago
parent
commit
70c5bcad11

+ 110 - 0
android/app/agconnect-services.json

@@ -0,0 +1,110 @@
1
+{
2
+	"agcgw":{
3
+		"backurl":"connect-drcn.hispace.hicloud.com",
4
+		"url":"connect-drcn.dbankcloud.cn",
5
+		"websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.com",
6
+		"websocketurl":"connect-ws-drcn.hispace.dbankcloud.cn"
7
+	},
8
+	"agcgw_all":{
9
+		"CN":"connect-drcn.dbankcloud.cn",
10
+		"CN_back":"connect-drcn.hispace.hicloud.com",
11
+		"DE":"connect-dre.dbankcloud.cn",
12
+		"DE_back":"connect-dre.hispace.hicloud.com",
13
+		"RU":"connect-drru.hispace.dbankcloud.ru",
14
+		"RU_back":"connect-drru.hispace.dbankcloud.cn",
15
+		"SG":"connect-dra.dbankcloud.cn",
16
+		"SG_back":"connect-dra.hispace.hicloud.com"
17
+	},
18
+	"websocketgw_all":{
19
+		"CN":"connect-ws-drcn.hispace.dbankcloud.cn",
20
+		"CN_back":"connect-ws-drcn.hispace.dbankcloud.com",
21
+		"DE":"connect-ws-dre.hispace.dbankcloud.cn",
22
+		"DE_back":"connect-ws-dre.hispace.dbankcloud.com",
23
+		"RU":"connect-ws-drru.hispace.dbankcloud.ru",
24
+		"RU_back":"connect-ws-drru.hispace.dbankcloud.cn",
25
+		"SG":"connect-ws-dra.hispace.dbankcloud.cn",
26
+		"SG_back":"connect-ws-dra.hispace.dbankcloud.com"
27
+	},
28
+	"client":{
29
+		"cp_id":"10086000825843698",
30
+		"product_id":"461323198429007241",
31
+		"client_id":"1552775666473135936",
32
+		"client_secret":"47FFD8BD85586C5FEDFB95670D3340A07CD184C8FB31DA8D7CA7F35595081F48",
33
+		"project_id":"461323198429007241",
34
+		"app_id":"112528505",
35
+		"api_key":"DQEDAMXALyk2R40s5BG8HMQqzKxc18SzwA3iPE34czrp931ylX1rClL3wjs1gd+pPFAL3/Gf3b/dV/BslOL+5tqpRw5VjTwn01+KQA==",
36
+		"package_name":"com.szls.lszlgl"
37
+	},
38
+	"oauth_client":{
39
+		"client_id":"112528505",
40
+		"client_type":1
41
+	},
42
+	"app_info":{
43
+		"app_id":"112528505",
44
+		"package_name":"com.szls.lszlgl"
45
+	},
46
+	"service":{
47
+		"analytics":{
48
+			"collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
49
+			"collector_url_ru":"datacollector-drru.dt.dbankcloud.ru,datacollector-drru.dt.hicloud.com",
50
+			"collector_url_sg":"datacollector-dra.dt.hicloud.com,datacollector-dra.dt.dbankcloud.cn",
51
+			"collector_url_de":"datacollector-dre.dt.hicloud.com,datacollector-dre.dt.dbankcloud.cn",
52
+			"collector_url_cn":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn",
53
+			"resource_id":"p1",
54
+			"channel_id":""
55
+		},
56
+		"edukit":{
57
+			"edu_url":"edukit.cloud.huawei.com.cn",
58
+			"dh_url":"edukit.cloud.huawei.com.cn"
59
+		},
60
+		"search":{
61
+			"url":"https://search-drcn.cloud.huawei.com"
62
+		},
63
+		"cloudstorage":{
64
+			"storage_url_sg_back":"https://agc-storage-dra.cloud.huawei.asia",
65
+			"storage_url_ru_back":"https://agc-storage-drru.cloud.huawei.ru",
66
+			"storage_url_ru":"https://agc-storage-drru.cloud.huawei.ru",
67
+			"storage_url_de_back":"https://agc-storage-dre.cloud.huawei.eu",
68
+			"storage_url_de":"https://ops-dre.agcstorage.link",
69
+			"storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn",
70
+			"storage_url_sg":"https://ops-dra.agcstorage.link",
71
+			"storage_url_cn_back":"https://agc-storage-drcn.cloud.huawei.com.cn",
72
+			"storage_url_cn":"https://agc-storage-drcn.platform.dbankcloud.cn"
73
+		},
74
+		"ml":{
75
+			"mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn"
76
+		}
77
+	},
78
+	"region":"CN",
79
+	"configuration_version":"3.0",
80
+	"appInfos":[
81
+		{
82
+			"package_name":"com.szls.lszlgl",
83
+			"client":{
84
+				"app_id":"112528505"
85
+			},
86
+			"app_info":{
87
+				"package_name":"com.szls.lszlgl",
88
+				"app_id":"112528505"
89
+			},
90
+			"oauth_client":{
91
+				"client_type":1,
92
+				"client_id":"112528505"
93
+			}
94
+		},
95
+		{
96
+			"package_name":"com.szls.lszlgl.debug",
97
+			"client":{
98
+				"app_id":"112525709"
99
+			},
100
+			"app_info":{
101
+				"package_name":"com.szls.lszlgl.debug",
102
+				"app_id":"112525709"
103
+			},
104
+			"oauth_client":{
105
+				"client_type":1,
106
+				"client_id":"112525709"
107
+			}
108
+		}
109
+	]
110
+}

+ 3 - 1
android/app/build.gradle

@@ -102,6 +102,7 @@ android {
102 102
 
103 103
     productFlavors {
104 104
         develop {
105
+           // applicationId "com.szls.lszlgl.debug"
105 106
             dimension "default"
106 107
             manifestPlaceholders = [
107 108
                     APP_NAME     : "国粮质检-测试",
@@ -113,12 +114,13 @@ android {
113 114
             applicationIdSuffix ".debug"
114 115
         }
115 116
         product {
117
+           // applicationId "com.szls.lszlgl"
116 118
             dimension "default"
117 119
             manifestPlaceholders = [
118 120
                     APP_NAME     : "国粮质检",
119 121
                     // 极光 注意测试环境的 packagename 和appkey 均不一样
120 122
                     JPUSH_PKGNAME: "com.szls.lszlgl",
121
-                    JPUSH_APPKEY : "2f42e3db4d0083b0bc5a3f6c", // 正式环境appkey需要再申请
123
+                    JPUSH_APPKEY : "336425aac947172a06b70cbb", // 正式环境appkey需要再申请
122 124
                     JPUSH_CHANNEL: "developer-default"
123 125
             ]
124 126
         }

BIN
assets/images/imgAppSetIcon.png


+ 3 - 1
lib/config/pics.dart

@@ -90,4 +90,6 @@ const String imgIconQYDQ = 'assets/images/imgIconQYDQ.png';
90 90
 const String imgIconQYRY = 'assets/images/imgIconQYRY.png';
91 91
 const String imgIconYPDJ = 'assets/images/imgIconYPDJ.png';
92 92
 const String imgIconQYSJ = 'assets/images/imgIconQYSJ.png';
93
-const String imgIconEdit = 'assets/images/imgIconEdit.png';
93
+const String imgIconEdit = 'assets/images/imgIconEdit.png';
94
+
95
+const String imgAppSetIcon = 'assets/images/imgAppSetIcon.png';

+ 3 - 1
lib/page/home/home_page.dart

@@ -84,6 +84,7 @@ class _HomePageState extends BaseState<HomePage> with AutomaticKeepAliveClientMi
84 84
 
85 85
   Widget imageTest(){
86 86
     return IconButton(
87
+        icon: const Icon(Icons.image,color: Colors.white,),
87 88
         onPressed: (){
88 89
           Navigator.push(context, MaterialPageRoute(builder: (ctx){
89 90
             return StockPointsWidget(
@@ -94,7 +95,8 @@ class _HomePageState extends BaseState<HomePage> with AutomaticKeepAliveClientMi
94 95
                 kHeight: MediaQuery.of(context).size.height - 8 ,
95 96
             );
96 97
           }));
97
-        }, icon: const Icon(Icons.image,color: Colors.white,));
98
+        },
99
+    );
98 100
   }
99 101
 
100 102
   Widget buildBanner() {

+ 0 - 2
lib/page/qrcode_scan/qrcode_scan_page.dart

@@ -1,9 +1,7 @@
1 1
 import 'dart:io';
2 2
 
3
-import 'package:flutter/cupertino.dart';
4 3
 import 'package:flutter/material.dart';
5 4
 import 'package:flutter/services.dart';
6
-import 'package:flutter/widgets.dart';
7 5
 import 'package:lszlgl/page/sample_task/reap_sample_detail/reap_sample_task_page.dart';
8 6
 import 'package:qr_code_scanner/qr_code_scanner.dart';
9 7
 

+ 1 - 1
lib/page/sample_task/reap_sample_detail/reap_sample_medicine_detail_page.dart

@@ -175,7 +175,7 @@ class _ReapSampleMedicineDetailPageState extends BaseLifecycleState<ReapSampleMe
175 175
                     ),
176 176
                     CardWidgets.buildEdit(
177 177
                       isDetail,
178
-                      '使用农药的数量(毫升/每亩地)',
178
+                      '使用农药的数量\n(毫升/每亩地)',
179 179
                       item.synysl?.toString(),
180 180
                       backgroundColor: null,
181 181
                       inputType: const TextInputType.numberWithOptions(decimal: true),

+ 3 - 0
lib/page/sample_task/reap_sample_detail/reap_sample_task_page.dart

@@ -522,6 +522,9 @@ class _ReapSampleTaskPageState extends BaseLifecycleState<ReapSampleTaskPage> wi
522 522
           actionsPadding:const EdgeInsets.symmetric(horizontal: 8.0,vertical: 4),
523 523
           title: const Text('退出当前界面?',textAlign: TextAlign.center,),
524 524
           actionsAlignment: MainAxisAlignment.spaceAround,
525
+          shape: RoundedRectangleBorder(
526
+            borderRadius: BorderRadius.circular(12.0),
527
+          ),
525 528
           actions: <Widget>[
526 529
             TextButton(
527 530
               child: const Text('取消',style: TextStyle(color: Colors.grey),),

+ 2 - 0
lib/page/sample_task/reap_sample_detail/reap_sample_variety_detail_page.dart

@@ -368,6 +368,8 @@ class _ReapSampleVarietyDetailPageState extends BaseLifecycleState<ReapSampleVar
368 368
               item.bdcnhhhzs,
369 369
               onChanged: (value) => item.bdcnhhhzs = value,
370 370
               backgroundColor: null,
371
+              leftRatio: 3,
372
+              rightRatio: 2
371 373
             ),
372 374
             CardWidgets.buildEdit(
373 375
               isDetail,

+ 1 - 1
lib/page/sample_task/sample_task_list_page.dart

@@ -310,7 +310,7 @@ class _SampleTaskListPageState extends BaseLifecycleState<SampleTaskListPage>
310 310
         ),
311 311
         const SizedBox(width: 4),
312 312
         const Text(
313
-          '扦样任务单号',
313
+          '样品单号',
314 314
           style: TextStyle(color: MyColor.c_333333, fontSize: 15, fontWeight: FontWeight.w500),
315 315
         ),
316 316
       ],

+ 33 - 2
lib/page/user_center/user_center_page.dart

@@ -225,14 +225,45 @@ class _UserCenterPageState extends BaseLifecycleState<UserCenterPage>
225 225
       width: MediaQuery.of(context).size.width,
226 226
       child: TextButton(
227 227
         onPressed: () {
228
-          SPUtils.getInstance().remove('accountpwd');
229
-          UserService.get().logout();
228
+          quiteLogin();
230 229
         },
231 230
         child: const Text('退出登录',style: TextStyle(color: Color(0xFF333333),fontSize: 15)),
232 231
       ),
233 232
     );
234 233
   }
235 234
 
235
+  void quiteLogin(){
236
+    showDialog<void>(
237
+      context: context,
238
+      builder: (BuildContext context) {
239
+        return AlertDialog(
240
+          titlePadding: const EdgeInsets.fromLTRB(8, 26, 8, 4),
241
+          actionsPadding:const EdgeInsets.symmetric(horizontal: 8.0,vertical: 4),
242
+          title: const Text('确定退出登录?',textAlign: TextAlign.center,),
243
+          actionsAlignment: MainAxisAlignment.spaceAround,
244
+          shape: RoundedRectangleBorder(
245
+            borderRadius: BorderRadius.circular(12.0),
246
+          ),
247
+          actions: <Widget>[
248
+            TextButton(
249
+              child: const Text('取消',style: TextStyle(color: Colors.grey),),
250
+              onPressed: () {
251
+                Navigator.pop(context);
252
+              },
253
+            ),
254
+            TextButton(
255
+              child: const Text('退出',style: TextStyle(color: MyColor.c_28A3ED,fontWeight: FontWeight.bold),),
256
+              onPressed: () {
257
+                SPUtils.getInstance().remove('accountpwd');
258
+                UserService.get().logout();
259
+              },
260
+            ),
261
+          ],
262
+        );
263
+      },
264
+    );
265
+  }
266
+
236 267
   @override
237 268
   bool get wantKeepAlive => true;
238 269
 }

+ 32 - 4
lib/service/jgpush_service.dart

@@ -1,6 +1,10 @@
1 1
 
2
+import 'package:flutter/material.dart';
2 3
 import 'package:jpush_flutter/jpush_flutter.dart';
4
+import 'package:lszlgl/base/base_lifecycle_state.dart';
3 5
 import 'package:lszlgl/config/app_config.dart';
6
+import 'package:lszlgl/config/colors.dart';
7
+import 'package:lszlgl/main.dart';
4 8
 
5 9
 class JGPushService{
6 10
   static final JPush jPush = JPush();
@@ -9,7 +13,7 @@ class JGPushService{
9 13
   static Future<void> jgInit(AppEnvironment env) async{
10 14
     jPush.setup(
11 15
       // 极光推送 正式环境appkey需要再申请
12
-      appKey: env == AppEnvironment.product ? '2f42e3db4d0083b0bc5a3f6c' : '2f42e3db4d0083b0bc5a3f6c',
16
+      appKey: env == AppEnvironment.product ? '336425aac947172a06b70cbb' : '2f42e3db4d0083b0bc5a3f6c',
13 17
       channel: 'developer-default',
14 18
       production: env == AppEnvironment.product ? true : false,
15 19
       debug: env == AppEnvironment.develop ? true : false
@@ -18,15 +22,39 @@ class JGPushService{
18 22
     jPush.addEventHandler(
19 23
       // 接收通知回调方法。
20 24
       onReceiveNotification: (Map<String, dynamic> message) async {
21
-        print("flutter onReceiveNotification: $message");
25
+        logger.d("极光消息:onReceiveNotification: $message");
22 26
       },
23 27
       // 点击通知回调方法。
24 28
       onOpenNotification: (Map<String, dynamic> message) async {
25
-        print("flutter onOpenNotification: $message");
29
+       // print("flutter onOpenNotification: $message");
30
+        logger.d('极光消息:$message');
31
+        MyNavigator.showDialog(
32
+          tag: 'jsPop',
33
+          builder: (ctx){
34
+          return AlertDialog(
35
+            titlePadding: const EdgeInsets.fromLTRB(8, 26, 8, 4),
36
+            actionsPadding:const EdgeInsets.symmetric(horizontal: 8.0,vertical: 4),
37
+            actionsAlignment: MainAxisAlignment.spaceAround,
38
+            shape: RoundedRectangleBorder(
39
+              borderRadius: BorderRadius.circular(12.0),
40
+            ),
41
+            title: Text(message['title'] ,textAlign: TextAlign.center,style: const TextStyle(fontWeight: FontWeight.bold),),
42
+            content: Text(message['alert'],),
43
+            actions: <Widget>[
44
+              TextButton(
45
+                child: const Text('知道了',style: TextStyle(color: MyColor.c_28A3ED,fontWeight: FontWeight.bold),),
46
+                onPressed: () {
47
+                  MyNavigator.dismiss(tag: 'jsPop');
48
+                },
49
+              ),
50
+            ],
51
+          );
52
+        },);
53
+
26 54
       },
27 55
       // 接收自定义消息回调方法。
28 56
       onReceiveMessage: (Map<String, dynamic> message) async {
29
-        print("flutter onReceiveMessage: $message");
57
+        logger.d("极光消息: onReceiveMessage: $message");
30 58
       },
31 59
     );
32 60
   }

+ 26 - 6
lib/service/upgrade_service.dart

@@ -3,6 +3,7 @@ import 'dart:io';
3 3
 import 'package:dio/dio.dart';
4 4
 import 'package:flutter/material.dart';
5 5
 import 'package:install_plugin/install_plugin.dart';
6
+import 'package:lszlgl/base/base_lifecycle_state.dart';
6 7
 import 'package:lszlgl/config/app_config.dart';
7 8
 import 'package:lszlgl/widget/button.dart';
8 9
 import 'package:path_provider/path_provider.dart';
@@ -10,7 +11,6 @@ import 'package:permission_handler/permission_handler.dart';
10 11
 
11 12
 import '../main.dart';
12 13
 import '../network/my_api.dart';
13
-import '../router/my_navigator.dart';
14 14
 import '../widget/upgrade_dialog.dart';
15 15
 
16 16
 class UpgradeService {
@@ -92,8 +92,8 @@ class UpgradeService {
92 92
               tag: 'pop',
93 93
               builder: (ctx) {
94 94
                 return Container(
95
-                  margin: const EdgeInsets.symmetric(horizontal: 24),
96
-                  padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 24),
95
+                  margin: const EdgeInsets.symmetric(horizontal: 12),
96
+                  padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 24),
97 97
                   decoration: const BoxDecoration(
98 98
                     color: Colors.white,
99 99
                     borderRadius: BorderRadius.all(Radius.circular(8)),
@@ -102,17 +102,37 @@ class UpgradeService {
102 102
                     mainAxisSize: MainAxisSize.min,
103 103
                     crossAxisAlignment: CrossAxisAlignment.stretch,
104 104
                     children: [
105
+                      Image.asset(
106
+                        imgAppSetIcon,
107
+                        width: 80,
108
+                        height: 80,
109
+                      ),
110
+                      const SizedBox(height: 12),
111
+                      const Align(
112
+                          child: Text(
113
+                        '国粮质检',
114
+                        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 18),
115
+                      )),
116
+                      const SizedBox(height: 2),
117
+                      Align(
118
+                        child: Text(
119
+                          '版本 ${AppConfig.packageInfo.version}',
120
+                          style: const TextStyle(fontSize: 15,color: Colors.grey),
121
+                        ),
122
+                      ),
123
+                      const SizedBox(height: 32),
105 124
                       const Text(
106 125
                         '当前版本更新内容:',
107
-                        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
126
+                        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
108 127
                       ),
109
-                      const SizedBox(height: 12),
128
+                      const SizedBox(height: 10),
110 129
                       Text(UpgradeService.getContentsString(contents) ?? ''),
111 130
                       const SizedBox(height: 22),
112 131
                       MyButton(
113 132
                         '知道了',
114 133
                         radius: 8,
115
-
134
+                        gradient:
135
+                            const LinearGradient(colors: [Color(0xFF3BD2E5), Color(0xFF247AF8)]),
116 136
                         onTap: () {
117 137
                           MyNavigator.dismiss(tag: 'pop');
118 138
                         },

+ 1 - 1
lib/widget/stock_points_widget.dart

@@ -48,7 +48,7 @@ class _StockPointsWidgetState extends BaseLifecycleState<StockPointsWidget> {
48 48
   }
49 49
 
50 50
   void getStockPoints() async {
51
-    var res = await MyApi.get(baseUrl: 'http://sx67bj.natappfree.cc').stockPoints(
51
+    var res = await MyApi.get().stockPoints(
52 52
         width: widget.width,
53 53
         length: widget.length,
54 54
         height: widget.height,

+ 1 - 1
pubspec.yaml

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
16 16
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
17 17
 # In Windows, build-name is used as the major, minor, and patch parts
18 18
 # of the product and file versions while build-number is used as the build suffix.
19
-version: 0.0.28+28
19
+version: 0.0.29+29
20 20
 
21 21
 environment:
22 22
   sdk: '>=3.1.5 <4.0.0'

+ 17 - 16
web/index.html

@@ -34,26 +34,27 @@
34 34
 
35 35
   <script>
36 36
     // The value below is injected by flutter build, do not touch.
37
-    const serviceWorkerVersion = null;
37
+  {{flutter_service_worker_version}}
38 38
   </script>
39 39
   <!-- This script adds the flutter initialization JS code -->
40 40
   <script src="flutter.js" defer></script>
41 41
 </head>
42 42
 <body>
43
-  <script>
44
-    window.addEventListener('load', function(ev) {
45
-      // Download main.dart.js
46
-      _flutter.loader.loadEntrypoint({
47
-        serviceWorker: {
48
-          serviceWorkerVersion: serviceWorkerVersion,
49
-        },
50
-        onEntrypointLoaded: function(engineInitializer) {
51
-          engineInitializer.initializeEngine().then(function(appRunner) {
52
-            appRunner.runApp();
53
-          });
54
-        }
55
-      });
56
-    });
57
-  </script>
43
+<!--  <script>-->
44
+<!--    window.addEventListener('load', function(ev) {-->
45
+<!--      // Download main.dart.js-->
46
+<!--      _flutter.loader.loadEntrypoint({-->
47
+<!--        serviceWorker: {-->
48
+<!--          serviceWorkerVersion: serviceWorkerVersion,-->
49
+<!--        },-->
50
+<!--        onEntrypointLoaded: function(engineInitializer) {-->
51
+<!--          engineInitializer.initializeEngine().then(function(appRunner) {-->
52
+<!--            appRunner.runApp();-->
53
+<!--          });-->
54
+<!--        }-->
55
+<!--      });-->
56
+<!--    });-->
57
+<!--  </script>-->
58
+<script src="flutter_bootstrap.js" async></script>
58 59
 </body>
59 60
 </html>