@extscreen/es-core 2.2.29 → 2.2.31
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.
- package/dist/index.js +192 -76
- 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
|
-
|
119
|
+
getDevice() {
|
120
120
|
return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getAndroidDevice');
|
121
121
|
}
|
122
122
|
|
123
|
-
|
124
|
-
return Vue.Native.callNativeWithPromise('AndroidDeviceModule', '
|
123
|
+
getDeviceEthMac() {
|
124
|
+
return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getEthMac');
|
125
125
|
}
|
126
126
|
|
127
|
-
|
128
|
-
return Vue.Native.callNativeWithPromise('AndroidDeviceModule', '
|
127
|
+
getDeviceWifiMac() {
|
128
|
+
return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getWifiMac');
|
129
129
|
}
|
130
130
|
|
131
|
-
|
131
|
+
getDeviceTotalMemory() {
|
132
132
|
return Vue.Native.callNativeWithPromise('AndroidDeviceModule', 'getTotalMemory');
|
133
133
|
}
|
134
134
|
|
135
|
-
|
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
|
-
|
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.
|
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.
|
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.
|
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.
|
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
|
-
|
339
|
-
|
336
|
+
|
337
|
+
getDeviceId() {
|
338
|
+
return this._deviceId;
|
340
339
|
}
|
341
340
|
|
342
|
-
|
343
|
-
return this.
|
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
|
-
|
355
|
-
return this.
|
353
|
+
getDeviceTotalMemory() {
|
354
|
+
return this._totalMemory;
|
356
355
|
}
|
357
356
|
|
358
|
-
|
359
|
-
return this.
|
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
|
-
|
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
|
-
|
371
|
-
return this.
|
390
|
+
getBuildModel() {
|
391
|
+
return this._buildModel;
|
372
392
|
}
|
373
393
|
|
374
394
|
getBuildBrand() {
|
375
395
|
return this._buildBrand;
|
376
396
|
}
|
377
397
|
|
378
|
-
|
379
|
-
return this.
|
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
|
-
|
395
|
-
return this.
|
414
|
+
getBuildManufacturer() {
|
415
|
+
return this._buildManufacturer;
|
416
|
+
}
|
417
|
+
|
418
|
+
getBuildSerial() {
|
419
|
+
return this._buildSerial;
|
396
420
|
}
|
397
421
|
|
398
|
-
|
399
|
-
return this.
|
422
|
+
getBuildTags() {
|
423
|
+
return this._buildTags;
|
400
424
|
}
|
401
425
|
|
402
|
-
|
403
|
-
return this.
|
426
|
+
getBuildId() {
|
427
|
+
return this._buildId;
|
404
428
|
}
|
405
429
|
|
406
|
-
|
407
|
-
return this.
|
430
|
+
getBuildTime() {
|
431
|
+
return this._buildTime;
|
408
432
|
}
|
409
433
|
|
410
|
-
|
411
|
-
return this.
|
434
|
+
getBuildType() {
|
435
|
+
return this._buildType;
|
412
436
|
}
|
413
437
|
|
414
|
-
|
415
|
-
return this.
|
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,40 @@ class ESLaunchManager {
|
|
2385
2468
|
}
|
2386
2469
|
|
2387
2470
|
launchESPage(intent) {
|
2471
|
+
let url = intent.url;
|
2472
|
+
let params = intent.params;
|
2473
|
+
|
2388
2474
|
if (this.isESRouterEnabled()
|
2389
2475
|
&& this.isESRouterSupported()
|
2390
2476
|
&& this._ESRouter) {
|
2477
|
+
//
|
2478
|
+
this._notifyListeners(url, params);
|
2479
|
+
//
|
2391
2480
|
this._ESRouter.push({
|
2392
|
-
name:
|
2393
|
-
params:
|
2481
|
+
name: url,
|
2482
|
+
params: params,
|
2394
2483
|
});
|
2395
2484
|
}
|
2396
2485
|
//
|
2397
2486
|
else {
|
2487
|
+
//
|
2488
|
+
this._notifyListeners(url, params);
|
2489
|
+
//
|
2398
2490
|
this.launchNativePage(intent);
|
2399
2491
|
}
|
2400
2492
|
}
|
2401
2493
|
|
2402
2494
|
launchAfterFinishESPage(intent) {
|
2495
|
+
let url = intent.url;
|
2496
|
+
let params = intent.params;
|
2497
|
+
|
2403
2498
|
if (this.isESRouterEnabled()
|
2404
2499
|
&& this.isESRouterSupported()
|
2405
2500
|
&& this._ESRouter) {
|
2406
2501
|
this._ESRouter.back();
|
2502
|
+
//
|
2503
|
+
this._notifyListeners(url, params);
|
2504
|
+
|
2407
2505
|
this._ESRouter.push({
|
2408
2506
|
name: intent.url,
|
2409
2507
|
params: intent.params,
|
@@ -2419,6 +2517,9 @@ class ESLaunchManager {
|
|
2419
2517
|
}
|
2420
2518
|
//1.finish
|
2421
2519
|
ESModule$1.finish();
|
2520
|
+
//
|
2521
|
+
this._notifyListeners(url, params);
|
2522
|
+
|
2422
2523
|
//2.launch
|
2423
2524
|
this.launchNativePage(intent);
|
2424
2525
|
}
|
@@ -4228,13 +4329,20 @@ var ESApplication = {
|
|
4228
4329
|
})
|
4229
4330
|
)
|
4230
4331
|
.then((result) => {
|
4231
|
-
this.
|
4332
|
+
this._initESApplication();
|
4232
4333
|
},
|
4233
4334
|
error => {
|
4234
|
-
this.
|
4335
|
+
this._initESApplication();
|
4235
4336
|
}
|
4236
4337
|
);
|
4237
4338
|
},
|
4339
|
+
_initESApplication() {
|
4340
|
+
ESLaunchManager$1.setRouteListener(this._routeListener);
|
4341
|
+
this._initESAppParams();
|
4342
|
+
},
|
4343
|
+
_routeListener(url, params) {
|
4344
|
+
this.onLaunchESPage(url, params);
|
4345
|
+
},
|
4238
4346
|
_initESAppParams() {
|
4239
4347
|
//
|
4240
4348
|
this.appInitProps = ESApp.$options.$superProps;
|
@@ -4282,13 +4390,17 @@ var ESApplication = {
|
|
4282
4390
|
this._initPage();
|
4283
4391
|
}
|
4284
4392
|
);
|
4285
|
-
}
|
4393
|
+
}
|
4394
|
+
//
|
4395
|
+
else {
|
4286
4396
|
if (ESLog.isLoggable(ESLog.DEBUG)) {
|
4287
4397
|
ESLog.d(TAG, '---------onESCreate--return-Not Promise----->>>>');
|
4288
4398
|
}
|
4289
4399
|
this._initPage();
|
4290
4400
|
}
|
4291
|
-
}
|
4401
|
+
}
|
4402
|
+
//
|
4403
|
+
else {
|
4292
4404
|
if (ESLog.isLoggable(ESLog.DEBUG)) {
|
4293
4405
|
ESLog.d(TAG, '---------onESCreate---Not Function----->>>>');
|
4294
4406
|
}
|
@@ -4326,6 +4438,10 @@ var ESApplication = {
|
|
4326
4438
|
}
|
4327
4439
|
return false;
|
4328
4440
|
},
|
4441
|
+
//---------------------------下面的方法给使用者覆写-----------------------------
|
4442
|
+
onLaunchESPage(url, params) {
|
4443
|
+
|
4444
|
+
}
|
4329
4445
|
},
|
4330
4446
|
};
|
4331
4447
|
|