@extscreen/es-core 2.2.29 → 2.2.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +198 -76
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -116,23 +116,23 @@ var ESDevelopManager$1 = new ESDevelopManager();
116
116
  */
117
117
  class ESDeviceModule {
118
118
 
119
- getAndroidDevice() {
119
+ getDevice() {
120
120
  return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getAndroidDevice');
121
121
  }
122
122
 
123
- getWifiMac() {
124
- return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getWifiMac');
123
+ getDeviceEthMac() {
124
+ return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getEthMac');
125
125
  }
126
126
 
127
- getEthMac() {
128
- return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getEthMac');
127
+ getDeviceWifiMac() {
128
+ return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getWifiMac');
129
129
  }
130
130
 
131
- getTotalMemory() {
131
+ getDeviceTotalMemory() {
132
132
  return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getTotalMemory');
133
133
  }
134
134
 
135
- getAvailableMemory() {
135
+ getDeviceAvailMemory() {
136
136
  return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getAvailableMemory');
137
137
  }
138
138
 
@@ -198,29 +198,6 @@ var ESDeviceModule$1 = new ESDeviceModule();
198
198
  /**
199
199
  * 设备信息管理
200
200
  *
201
- * {
202
- "screenWidth": 1920,
203
- "clientType": "MiBOX4",
204
- "buildBoard": "transformers",
205
- "scaledDensity": "1.0",
206
- "mac": null,
207
- "uuid": null,
208
- "buildVersionRelease": "6.0.1",
209
- "buildManufacturer": "Xiaomi",
210
- "windowWidth": 0,
211
- "density": "1.0",
212
- "buildDevice": "transformers",
213
- "availableMemory": 0,
214
- "buildHardware": "amlogic",
215
- "screenHeight": 1080,
216
- "buildModel": "MiBOX4",
217
- "buildBrand": null,
218
- "densityDpi": "160.0",
219
- "resolution": "1920*1080",
220
- "totalMemory": 0,
221
- "buildProduct": "transformers"
222
- }
223
-
224
201
  */
225
202
  class ESDeviceManager {
226
203
 
@@ -254,23 +231,37 @@ class ESDeviceManager {
254
231
  _buildDevice = '';
255
232
  _buildProduct = '';
256
233
  _buildHardware = '';
257
- _buildSDKVersion = 1;
234
+
235
+ _buildBoard = '';
236
+ _buildTags = '';
237
+ _buildId = '';
238
+ _buildTime = '';
239
+ _buildType = '';
240
+ _buildUser = '';
241
+ _buildBootloader = '';
242
+ _buildDisplay = '';
243
+ _buildFingerPrint = '';
244
+ _buildVersionIncremental = '';
245
+ _buildVersionBaseOS = '';
246
+ _buildVersionCodeName = '';
247
+ _buildVersionSecurityPatch = '';
248
+ _buildVersionPreviewSDKInt = '';
249
+ _buildVersionSDKInt = '';
258
250
 
259
251
  _device = null;
260
252
 
261
253
  init() {
262
254
  return new Promise((resolve, reject) => {
263
255
  this.initAndroidDevice();
264
- ESDeviceModule$1.getAndroidDevice().then(
256
+ ESDeviceModule$1.getDevice().then(
265
257
  (device) => {
266
258
  this._device = device;
267
259
 
268
260
  try {
269
261
  if (device) {
270
- this._buildSDKVersion = device.buildSDKVersion;
271
262
 
272
263
  this._deviceId = device.deviceId;
273
- this._deviceType = device._deviceType;
264
+ this._deviceType = device.deviceType;
274
265
 
275
266
  this._deviceEthMac = device.ethMac;
276
267
  this._deviceWifiMac = device.wifiMac;
@@ -286,20 +277,35 @@ class ESDeviceManager {
286
277
  this._densityDpi = device.densityDpi;
287
278
  this._scaledDensity = device.scaledDensity;
288
279
 
289
- this._buildVersionRelease = device.buildVersionRelease;
280
+ this._ipAddress = device.ipAddress;
281
+
290
282
  this._buildModel = device.buildModel;
291
283
  this._buildBrand = device.buildBrand;
284
+ this._buildBoard = device.buildBoard;
292
285
  this._buildDevice = device.buildDevice;
293
286
  this._buildProduct = device.buildProduct;
294
287
  this._buildHardware = device.buildHardware;
295
288
  this._buildManufacturer = device.buildManufacturer;
296
289
  this._buildSerial = device.buildSerial;
297
290
 
298
- this._ipAddress = device.ipAddress;
291
+ this._buildTags = device.buildTags;
292
+ this._buildId = device.buildId;
293
+ this._buildTime = device.buildTime;
294
+ this._buildType = device.buildType;
295
+ this._buildUser = device.buildUser;
296
+ this._buildBootloader = device.buildBootloader;
297
+ this._buildDisplay = device.buildDisplay;
298
+ this._buildFingerPrint = device.buildFingerPrint;
299
+ this._buildVersionIncremental = device.buildVersionIncremental;
300
+ this._buildVersionBaseOS = device.buildVersionBaseOS;
301
+ this._buildVersionCodeName = device.buildVersionCodeName;
302
+ this._buildVersionSecurityPatch = device.buildVersionSecurityPatch;
303
+ this._buildVersionPreviewSDKInt = device.buildVersionPreviewSDKInt;
304
+ this._buildVersionSDKInt = device.buildVersionSDKInt;
305
+ this._buildVersionRelease = device.buildVersionRelease;
299
306
  }
300
307
  } catch (e) {
301
308
  }
302
-
303
309
  resolve(device);
304
310
  },
305
311
  //
@@ -323,24 +329,17 @@ class ESDeviceManager {
323
329
  return this._androidAPILevel;
324
330
  }
325
331
 
326
- getDeviceTotalMemory() {
327
- return this._totalMemory;
328
- }
329
-
330
- getDeviceAvailMemory() {
331
- return this._availMemory;
332
- }
333
-
334
332
  getDevice() {
335
333
  return this._device;
336
334
  }
337
335
 
338
- getBuildVersionRelease() {
339
- return this._buildVersionRelease;
336
+
337
+ getDeviceId() {
338
+ return this._deviceId;
340
339
  }
341
340
 
342
- getBuildManufacturer() {
343
- return this._buildManufacturer;
341
+ getDeviceType() {
342
+ return this._deviceType;
344
343
  }
345
344
 
346
345
  getDeviceEthMac() {
@@ -351,32 +350,53 @@ class ESDeviceManager {
351
350
  return this._deviceWifiMac;
352
351
  }
353
352
 
354
- getDeviceId() {
355
- return this._deviceId;
353
+ getDeviceTotalMemory() {
354
+ return this._totalMemory;
356
355
  }
357
356
 
358
- getDeviceType() {
359
- return this._deviceType;
357
+ getDeviceAvailMemory() {
358
+ return this._availMemory;
359
+ }
360
+
361
+
362
+ getScreenWidth() {
363
+ return this._screenWidth;
364
+ }
365
+
366
+ getScreenHeight() {
367
+ return this._screenHeight
360
368
  }
361
369
 
362
370
  getResolution() {
363
371
  return this._resolution;
364
372
  }
365
373
 
366
- getIpAddress() {
374
+ getDensity() {
375
+ return this._density;
376
+ }
377
+
378
+ getDensityDpi() {
379
+ return this._densityDpi;
380
+ }
381
+
382
+ getScaledDensity() {
383
+ return this._scaledDensity;
384
+ }
385
+
386
+ getIPAddress() {
367
387
  return this._ipAddress;
368
388
  }
369
389
 
370
- getBuildSerial() {
371
- return this._buildSerial;
390
+ getBuildModel() {
391
+ return this._buildModel;
372
392
  }
373
393
 
374
394
  getBuildBrand() {
375
395
  return this._buildBrand;
376
396
  }
377
397
 
378
- getBuildModel() {
379
- return this._buildModel;
398
+ getBuildBoard() {
399
+ return this._buildBoard;
380
400
  }
381
401
 
382
402
  getBuildDevice() {
@@ -391,28 +411,73 @@ class ESDeviceManager {
391
411
  return this._buildHardware;
392
412
  }
393
413
 
394
- getBuildSDKVersion() {
395
- return this._buildSDKVersion;
414
+ getBuildManufacturer() {
415
+ return this._buildManufacturer;
416
+ }
417
+
418
+ getBuildSerial() {
419
+ return this._buildSerial;
396
420
  }
397
421
 
398
- getScreenWidth() {
399
- return this._screenWidth;
422
+ getBuildTags() {
423
+ return this._buildTags;
400
424
  }
401
425
 
402
- getScreenHeight() {
403
- return this._screenHeight
426
+ getBuildId() {
427
+ return this._buildId;
404
428
  }
405
429
 
406
- getDensity() {
407
- return this._density;
430
+ getBuildTime() {
431
+ return this._buildTime;
408
432
  }
409
433
 
410
- getDensityDpi() {
411
- return this._densityDpi;
434
+ getBuildType() {
435
+ return this._buildType;
412
436
  }
413
437
 
414
- getScaledDensity() {
415
- return this._scaledDensity;
438
+ getBuildUser() {
439
+ return this._buildUser;
440
+ }
441
+
442
+ getBuildBootloader() {
443
+ return this._buildBootloader;
444
+ }
445
+
446
+ getBuildDisplay() {
447
+ return this._buildDisplay;
448
+ }
449
+
450
+
451
+ getBuildFingerPrint() {
452
+ return this._buildFingerPrint;
453
+ }
454
+
455
+ getBuildVersionIncremental() {
456
+ return this._buildVersionIncremental;
457
+ }
458
+
459
+ getBuildVersionBaseOS() {
460
+ return this._buildVersionBaseOS;
461
+ }
462
+
463
+ getBuildVersionCodeName() {
464
+ return this._buildVersionCodeName;
465
+ }
466
+
467
+ getBuildVersionSecurityPatch() {
468
+ return this._buildVersionSecurityPatch;
469
+ }
470
+
471
+ getBuildVersionPreviewSDKInt() {
472
+ return this._buildVersionPreviewSDKInt;
473
+ }
474
+
475
+ getBuildVersionSDKInt() {
476
+ return this._buildVersionSDKInt;
477
+ }
478
+
479
+ getBuildVersionRelease() {
480
+ return this._buildVersionRelease;
416
481
  }
417
482
  }
418
483
 
@@ -2318,6 +2383,8 @@ class ESLaunchManager {
2318
2383
  _ESPageRouterViewSupported = false;
2319
2384
  _launchLimit = 10;
2320
2385
 
2386
+ _routeListener = null;
2387
+
2321
2388
  init(router) {
2322
2389
  try {
2323
2390
  this._ESRouter = router;
@@ -2374,6 +2441,22 @@ class ESLaunchManager {
2374
2441
  }
2375
2442
  }
2376
2443
 
2444
+ //-----------------------------------------------------------
2445
+ setRouteListener(routeListener) {
2446
+ this._routeListener = routeListener;
2447
+ }
2448
+
2449
+ _notifyListeners(url, params) {
2450
+ if (this._routeListener && this.isFunction(this._routeListener)) {
2451
+ this._routeListener(url, params);
2452
+ }
2453
+ }
2454
+
2455
+ isFunction(func) {
2456
+ return Object.prototype.toString.call(func) === '[object Function]';
2457
+ }
2458
+
2459
+ //-----------------------------------------------------------
2377
2460
  launchNativeApp(paramsArray) {
2378
2461
  return ESModule$1.launchNativeApp(paramsArray);
2379
2462
  }
@@ -2385,25 +2468,46 @@ class ESLaunchManager {
2385
2468
  }
2386
2469
 
2387
2470
  launchESPage(intent) {
2471
+ if (!intent || !intent.url) {
2472
+ return;
2473
+ }
2474
+ let url = intent.url;
2475
+ let params = intent.params;
2476
+
2388
2477
  if (this.isESRouterEnabled()
2389
2478
  && this.isESRouterSupported()
2390
2479
  && this._ESRouter) {
2480
+ //
2481
+ this._notifyListeners(url, params);
2482
+ //
2391
2483
  this._ESRouter.push({
2392
- name: intent.url,
2393
- params: intent.params,
2484
+ name: url,
2485
+ params: params,
2394
2486
  });
2395
2487
  }
2396
2488
  //
2397
2489
  else {
2490
+ //
2491
+ this._notifyListeners(url, params);
2492
+ //
2398
2493
  this.launchNativePage(intent);
2399
2494
  }
2400
2495
  }
2401
2496
 
2402
2497
  launchAfterFinishESPage(intent) {
2498
+ if (!intent || !intent.url) {
2499
+ return;
2500
+ }
2501
+ let url = intent.url;
2502
+ let params = intent.params;
2503
+
2403
2504
  if (this.isESRouterEnabled()
2404
2505
  && this.isESRouterSupported()
2405
2506
  && this._ESRouter) {
2406
2507
  this._ESRouter.back();
2508
+ //
2509
+ this._notifyListeners(url, params);
2510
+
2407
2511
  this._ESRouter.push({
2408
2512
  name: intent.url,
2409
2513
  params: intent.params,
@@ -2419,6 +2523,9 @@ class ESLaunchManager {
2419
2523
  }
2420
2524
  //1.finish
2421
2525
  ESModule$1.finish();
2526
+ //
2527
+ this._notifyListeners(url, params);
2528
+
2422
2529
  //2.launch
2423
2530
  this.launchNativePage(intent);
2424
2531
  }
@@ -4228,13 +4335,20 @@ var ESApplication = {
4228
4335
  })
4229
4336
  )
4230
4337
  .then((result) => {
4231
- this._initESAppParams();
4338
+ this._initESApplication();
4232
4339
  },
4233
4340
  error => {
4234
- this._initESAppParams();
4341
+ this._initESApplication();
4235
4342
  }
4236
4343
  );
4237
4344
  },
4345
+ _initESApplication() {
4346
+ ESLaunchManager$1.setRouteListener(this._routeListener);
4347
+ this._initESAppParams();
4348
+ },
4349
+ _routeListener(url, params) {
4350
+ this.onLaunchESPage(url, params);
4351
+ },
4238
4352
  _initESAppParams() {
4239
4353
  //
4240
4354
  this.appInitProps = ESApp.$options.$superProps;
@@ -4282,13 +4396,17 @@ var ESApplication = {
4282
4396
  this._initPage();
4283
4397
  }
4284
4398
  );
4285
- } else {
4399
+ }
4400
+ //
4401
+ else {
4286
4402
  if (ESLog.isLoggable(ESLog.DEBUG)) {
4287
4403
  ESLog.d(TAG, '---------onESCreate--return-Not Promise----->>>>');
4288
4404
  }
4289
4405
  this._initPage();
4290
4406
  }
4291
- } else {
4407
+ }
4408
+ //
4409
+ else {
4292
4410
  if (ESLog.isLoggable(ESLog.DEBUG)) {
4293
4411
  ESLog.d(TAG, '---------onESCreate---Not Function----->>>>');
4294
4412
  }
@@ -4326,6 +4444,10 @@ var ESApplication = {
4326
4444
  }
4327
4445
  return false;
4328
4446
  },
4447
+ //---------------------------下面的方法给使用者覆写-----------------------------
4448
+ onLaunchESPage(url, params) {
4449
+
4450
+ }
4329
4451
  },
4330
4452
  };
4331
4453
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extscreen/es-core",
3
- "version": "2.2.29",
3
+ "version": "2.2.30",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {