@extscreen/es-core 10000.0.9 → 10000.0.12

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 +44 -37
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2548,11 +2548,9 @@ function ESPageRootViewComponent() {
2548
2548
  Vue.component('page', {
2549
2549
  methods: {
2550
2550
  onLifecycleChanged(evt) {
2551
- console.log('ESRouter', "--------onLifecycleChanged------>>>>>" + JSON.stringify(evt));
2552
2551
  this.$emit("onLifecycleChanged", evt);
2553
2552
  },
2554
2553
  onDispatchKeyEvent(evt) {
2555
- console.log('ESRouter', "--------onDispatchKeyEvent------>>>>>" + JSON.stringify(evt));
2556
2554
  this.$emit("onDispatchKeyEvent", evt);
2557
2555
  },
2558
2556
  },
@@ -2708,26 +2706,8 @@ const AUDIO_USAGE_ASSISTANT = 16;
2708
2706
  */
2709
2707
 
2710
2708
  var ESBackPressMixin = {
2711
-
2712
2709
  mounted() {
2713
2710
  Vue.Native.callNative('DeviceEventModule', 'setListenBackPress', true);
2714
- if (!ESLaunchManager$1.isESRouterEnabled()) {
2715
- ESApp.$on('hardwareBackPress', this.onESBackPressed);
2716
- }
2717
- },
2718
- beforeDestroy() {
2719
- if (!ESLaunchManager$1.isESRouterEnabled()) {
2720
- ESApp.$off('hardwareBackPress', this.onESBackPressed);
2721
- }
2722
- },
2723
-
2724
- methods: {
2725
- onESBackPressed() {
2726
- this.onBackPressed();
2727
- },
2728
- onBackPressed() {
2729
-
2730
- },
2731
2711
  },
2732
2712
  };
2733
2713
 
@@ -2735,12 +2715,22 @@ var ESBackPressMixin = {
2735
2715
  const KEY_ACTION_DOWN = 0;
2736
2716
  const KEY_ACTION_UP = 1;
2737
2717
 
2718
+ const KEYCODE_ENTER = 66;
2719
+ const KEYCODE_DPAD_CENTER = 23;
2720
+ const KEYCODE_DPAD_UP = 19;
2721
+ const KEYCODE_DPAD_DOWN = 20;
2722
+ const KEYCODE_DPAD_LEFT = 21;
2723
+ const KEYCODE_DPAD_RIGHT = 22;
2724
+ const KEYCODE_BACK = 4;
2725
+ const KEYCODE_ESCAPE = 111;
2726
+ const KEYCODE_MENU = 82;
2727
+ const KEYCODE_SEARCH = 84;
2728
+
2738
2729
  /**
2739
2730
  * 处理key事件
2740
2731
  */
2741
2732
 
2742
2733
  var ESKeyEventMixin = {
2743
-
2744
2734
  mounted() {
2745
2735
  if (!ESLaunchManager$1.isESRouterEnabled()) {
2746
2736
  ESApp.$on('DispatchKeyEvent', this.onDispatchKeyEvent);
@@ -2755,20 +2745,27 @@ var ESKeyEventMixin = {
2755
2745
  methods: {
2756
2746
  onDispatchKeyEvent(keyEvent) {
2757
2747
  if (keyEvent.action === KEY_ACTION_DOWN) {
2758
- this.onKeyDown(keyEvent);
2748
+ if (keyEvent.keyCode === KEYCODE_BACK || keyEvent.keyCode === KEYCODE_ESCAPE) {
2749
+ this.onBackPressed();
2750
+ } else {
2751
+ this.onKeyDown(keyEvent);
2752
+ }
2759
2753
  }
2760
2754
  //
2761
2755
  else if (keyEvent.action === KEY_ACTION_UP) {
2762
- this.onKeyUp(keyEvent);
2756
+ if (keyEvent.keyCode === KEYCODE_BACK || keyEvent.keyCode === KEYCODE_ESCAPE) ; else {
2757
+ this.onKeyUp(keyEvent);
2758
+ }
2763
2759
  }
2764
2760
  },
2765
- //页面复写即可
2766
2761
  onKeyDown(keyEvent) {
2767
2762
 
2768
2763
  },
2769
- //页面复写即可
2770
2764
  onKeyUp(keyEvent) {
2771
2765
 
2766
+ },
2767
+ onBackPressed() {
2768
+
2772
2769
  },
2773
2770
  },
2774
2771
  };
@@ -2792,10 +2789,22 @@ var ESLifecycleMixin = {
2792
2789
 
2793
2790
  methods: {
2794
2791
  onESLifecycleChanged(event) {
2795
- if (event === 'onResume') {
2792
+ if (event === 'onCreate') {
2793
+ this.onESCreate();
2794
+ }
2795
+ //
2796
+ else if (event === 'onStart') {
2797
+ this.onESStart();
2798
+ }
2799
+ //
2800
+ else if (event === 'onResume') {
2796
2801
  this.onESResume();
2797
2802
  }
2798
2803
  //
2804
+ else if (event === 'invisibleToUser') {
2805
+ this.onESInvisibleToUser();
2806
+ }
2807
+ //
2799
2808
  else if (event === 'onPause') {
2800
2809
  this.onESPause();
2801
2810
  }
@@ -2813,8 +2822,17 @@ var ESLifecycleMixin = {
2813
2822
  },
2814
2823
 
2815
2824
  //------------------------------------
2825
+ onESCreate() {
2826
+
2827
+ },
2828
+ onESStart() {
2829
+
2830
+ },
2816
2831
  onESResume() {
2817
2832
 
2833
+ },
2834
+ onESInvisibleToUser() {
2835
+
2818
2836
  },
2819
2837
  onESPause() {
2820
2838
 
@@ -2831,17 +2849,6 @@ var ESLifecycleMixin = {
2831
2849
  },
2832
2850
  };
2833
2851
 
2834
- const KEYCODE_ENTER = 66;
2835
- const KEYCODE_DPAD_CENTER = 23;
2836
- const KEYCODE_DPAD_UP = 19;
2837
- const KEYCODE_DPAD_DOWN = 20;
2838
- const KEYCODE_DPAD_LEFT = 21;
2839
- const KEYCODE_DPAD_RIGHT = 22;
2840
- const KEYCODE_BACK = 4;
2841
- const KEYCODE_ESCAPE = 111;
2842
- const KEYCODE_MENU = 82;
2843
- const KEYCODE_SEARCH = 84;
2844
-
2845
2852
  //
2846
2853
  const ES_ACCELERATE_DECELERATE_INTERPOLATOR = 1;
2847
2854
  const ES_ACCELERATE_INTERPOLATOR = 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extscreen/es-core",
3
- "version": "10000.0.9",
3
+ "version": "10000.0.12",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {