create-jsview 2.1.25 → 2.1.200-next-vue.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-jsview",
3
- "version": "2.1.25",
3
+ "version": "2.1.200-next-vue.0",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "create-jsview": "index.mjs",
@@ -29,7 +29,7 @@
29
29
  "prompts": "^2.4.2"
30
30
  },
31
31
  "template": {
32
- "vue": "2.1.25",
33
- "react": "2.1.25"
32
+ "vue": "2.1.200-next-vue.0",
33
+ "react": "2.0.1197-next-vue.0"
34
34
  }
35
35
  }
@@ -9,8 +9,8 @@
9
9
  "version": "0.0.0",
10
10
  "hasInstallScript": true,
11
11
  "dependencies": {
12
- "@shijiu/jsview": "2.1.25",
13
- "@shijiu/jsview-react": "2.1.25",
12
+ "@shijiu/jsview": "2.0.1197-next-vue.0",
13
+ "@shijiu/jsview-react": "2.0.1197-next-vue.0",
14
14
  "gifuct-js": "^2.1.2",
15
15
  "postcss-import-sync": "^7.1.4",
16
16
  "postcss-js": "^4.0.0",
@@ -3034,7 +3034,7 @@
3034
3034
  "integrity": "sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg=="
3035
3035
  },
3036
3036
  "node_modules/@shijiu/jsview": {
3037
- "version": "2.1.25",
3037
+ "version": "2.0.1197-next-vue.0",
3038
3038
  "license": "MIT",
3039
3039
  "dependencies": {
3040
3040
  "gifuct-js": "2.1.2",
@@ -3053,7 +3053,7 @@
3053
3053
  "integrity": ""
3054
3054
  },
3055
3055
  "node_modules/@shijiu/jsview-react": {
3056
- "version": "2.1.25",
3056
+ "version": "2.0.1197-next-vue.0",
3057
3057
  "license": "MIT",
3058
3058
  "dependencies": {
3059
3059
  "qr.js": "0.0.0"
@@ -17814,7 +17814,7 @@
17814
17814
  "integrity": "sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg=="
17815
17815
  },
17816
17816
  "@shijiu/jsview": {
17817
- "version": "2.1.25",
17817
+ "version": "2.0.1197-next-vue.0",
17818
17818
  "requires": {
17819
17819
  "gifuct-js": "2.1.2",
17820
17820
  "postcss-import-sync": "7.1.4",
@@ -17824,7 +17824,7 @@
17824
17824
  "integrity": ""
17825
17825
  },
17826
17826
  "@shijiu/jsview-react": {
17827
- "version": "2.1.25",
17827
+ "version": "2.0.1197-next-vue.0",
17828
17828
  "requires": {
17829
17829
  "qr.js": "0.0.0"
17830
17830
  },
@@ -10,8 +10,8 @@
10
10
  "start": "react-scripts start"
11
11
  },
12
12
  "dependencies": {
13
- "@shijiu/jsview": "2.1.25",
14
- "@shijiu/jsview-react": "2.1.25",
13
+ "@shijiu/jsview": "2.0.1197-next-vue.0",
14
+ "@shijiu/jsview-react": "2.0.1197-next-vue.0",
15
15
  "react": "18.2.0",
16
16
  "react-dom": "18.2.0",
17
17
  "react-router": "5.3.4",
Binary file
@@ -9,8 +9,8 @@
9
9
  "version": "0.0.0",
10
10
  "hasInstallScript": true,
11
11
  "dependencies": {
12
- "@shijiu/jsview": "2.1.25",
13
- "@shijiu/jsview-vue": "2.1.25",
12
+ "@shijiu/jsview": "2.1.200-next-vue.0",
13
+ "@shijiu/jsview-vue": "2.1.200-next-vue.0",
14
14
  "gifuct-js": "^2.1.2",
15
15
  "postcss-js": "^4.0.0",
16
16
  "qr.js": "^0.0.0",
@@ -399,7 +399,7 @@
399
399
  }
400
400
  },
401
401
  "node_modules/@shijiu/jsview": {
402
- "version": "2.1.25",
402
+ "version": "2.1.200-next-vue.0",
403
403
  "license": "MIT",
404
404
  "dependencies": {
405
405
  "gifuct-js": "2.1.2",
@@ -417,7 +417,7 @@
417
417
  "integrity": ""
418
418
  },
419
419
  "node_modules/@shijiu/jsview-vue": {
420
- "version": "2.1.25",
420
+ "version": "2.1.200-next-vue.0",
421
421
  "license": "MIT",
422
422
  "dependencies": {
423
423
  "qr.js": "0.0.0"
@@ -1161,7 +1161,7 @@
1161
1161
  "optional": true
1162
1162
  },
1163
1163
  "@shijiu/jsview": {
1164
- "version": "2.1.25",
1164
+ "version": "2.1.200-next-vue.0",
1165
1165
  "requires": {
1166
1166
  "gifuct-js": "2.1.2",
1167
1167
  "postcss-js": "4.0.0"
@@ -1170,7 +1170,7 @@
1170
1170
  "integrity": ""
1171
1171
  },
1172
1172
  "@shijiu/jsview-vue": {
1173
- "version": "2.1.25",
1173
+ "version": "2.1.200-next-vue.0",
1174
1174
  "requires": {
1175
1175
  "qr.js": "0.0.0"
1176
1176
  },
@@ -4,17 +4,16 @@
4
4
  "version": "0.0.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
- "android": "node node_modules/@shijiu/jsview/tools/jsview-run-android.mjs --framework=vue",
8
7
  "build": "vue-tsc && vite build",
9
8
  "dev": "vite",
10
9
  "postbuild": "node node_modules/@shijiu/jsview/tools/jsview-post-build.mjs --framework=vue",
11
10
  "postinstall": "node node_modules/@shijiu/jsview/tools/jsview-post-install.mjs --framework=vue",
12
- "preview": "vite preview",
13
- "start": "vite"
11
+ "start": "vite",
12
+ "tool": "node node_modules/@shijiu/jsview/tools/jsview-run-tool.mjs --framework=vue"
14
13
  },
15
14
  "dependencies": {
16
- "@shijiu/jsview": "2.1.25",
17
- "@shijiu/jsview-vue": "2.1.25",
15
+ "@shijiu/jsview": "2.1.200-next-vue.0",
16
+ "@shijiu/jsview-vue": "2.1.200-next-vue.0",
18
17
  "vue": "3.2.45",
19
18
  "vue-router": "4.1.6"
20
19
  },
@@ -1,20 +1,41 @@
1
1
  <template>
2
- <div>
3
- <img src="./assets/logo.png" class="logo-size">
4
- <HelloWorld msg="Hello JsView-Vue + Vite App" :style="{top: 50, width:220}"/>
5
- </div>
2
+ <jsv-focus-block autoFocus :onKeyDown="processKeyDown">
3
+ <div>
4
+ <img src="./assets/logo.png" class="logo-size" />
5
+ <HelloWorld
6
+ msg="Hello JsView-Vue + Vite App"
7
+ :style="{ top: 50, width: 220 }"
8
+ />
9
+ </div>
10
+ </jsv-focus-block>
6
11
  </template>
7
12
 
8
13
  <script setup>
9
- import { onMounted } from "vue"
14
+ import { onMounted } from "vue";
10
15
  import { jJsvRuntimeBridge } from "jsview";
11
- import HelloWorld from './components/HelloWorld.vue';
16
+ import HelloWorld from "./components/HelloWorld.vue";
12
17
 
13
- onMounted(()=>{
18
+ const processKeyDown = (ev) => {
19
+ if (
20
+ ev.keyCode == 10000 /* 盒子runtime的返回键值 */ ||
21
+ ev.keyCode == 8 /* PC浏览器的返回键 */
22
+ ) {
23
+ // JsView体系下,和runtime端约定,如果js的根节点处理好返回键并返回true
24
+ // 则视作js出现了异常,此时runtime将自我退出,
25
+ // 以规避用户无法通过返回键退出异常小程序的问题
26
+
27
+ // 如有需要进行主动退出时, 处理如下:
28
+ // jJsvRuntimeBridge.closePage();
29
+
30
+ console.log("consume back key...");
31
+ return true; // consume the key
32
+ }
33
+ };
34
+
35
+ onMounted(() => {
14
36
  /* apk到收到此调用后才会结束启动过程,去掉启动图(否则会显示加载超时的界面) */
15
37
  jJsvRuntimeBridge.notifyPageLoaded();
16
38
  });
17
-
18
39
  </script>
19
40
 
20
41
  <style scoped>
@@ -40,7 +40,7 @@ export default {
40
40
  // PS:注意'164'的引号
41
41
  bindKeys: {
42
42
  keys: {
43
- '164': 20001
43
+ // '164': 20001
44
44
  },
45
45
  syncKeys: {
46
46
  }
@@ -1,6 +1,10 @@
1
1
  import { createApp } from 'vue'
2
2
  import { jsvCreateFocusManager } from 'jsview'
3
3
  import App from './App.vue'
4
+ import { listenerToPermissionResult } from './permissionResult'
5
+
6
+ // js授权状态的监听, app的编译版本上线前请联系商务对产品进行在线授权
7
+ listenerToPermissionResult();
4
8
 
5
9
  const app = createApp(App)
6
10
 
@@ -0,0 +1,44 @@
1
+ export function listenerToPermissionResult() {
2
+ // 注册监听后,api方式的授权校验,会在延迟的1分钟后收到校验结果
3
+ (window as any).JsView?.addEventListener("onAuthResult", (info: any) => {
4
+ // info接口:
5
+ // success(bool): 当次授权校验是否通过
6
+ // showAlert(bool): APP界面右下角展示未授权提示,满足下面条件之一时会展示
7
+ // 1. app运行的main.js是未进行签名(签名参考src/appConfig/中的描述)的,提示"npm start 调试模式"
8
+ // 2. 仅在在线授权未通过, 并且达到允许次数时生效(每日累计1次, 最多累计30天), 提示"抢先版内核"
9
+ // errorCount(int): 在线授权失败累计的次数, 授权成功后清0
10
+ // checkType(string): 授权的校验方式, 例如: 调试模式 devMode, 在线校验方式: api
11
+ // customDescribe: 授权的描述, 许可范围等描述
12
+ // errorCode: 授权失败的错误码
13
+ // -1: apk签名不匹配(仅离线校验时)
14
+ // -2: js的app name未登记
15
+ // -3: js的app签名和app name登记信息不匹配
16
+ // -4: permission.js文件过期
17
+ // -5: core版本不匹配
18
+ // -6: 分支名不匹配
19
+ // -7: 在线鉴权时未通过的统一错误码(后台详细错误码搭建中...)
20
+ // -8: 页面为npm start的调试模式(开发人员调试时才会出现此状态)
21
+ // -101: 本地permission.js文件格式错误
22
+ // -102: permission.js文件授权信息中core版本无法正确解析为数字错误
23
+ // -103: permission.js文件授权信息中的日期格式错误
24
+ // -105: 在线鉴权api请求失败错误
25
+ if (!info.success) {
26
+ if (info.errorCode != -8/* -8为"调试模式" */) {
27
+ console.error("警告: 当次授权未通过, error code=" + info.errorCode);
28
+ }
29
+ } else {
30
+ console.info("授权通过:" + info.customDescribe);
31
+ }
32
+
33
+ if (info.errorCount > 0) {
34
+ console.warn(`在线授权校验失败累计了${info.errorCount}天, 请在达到30天前检查授权网络环境`);
35
+ }
36
+
37
+ if (info.showAlert
38
+ && info.errorCode != -8/* -8为"调试模式" */) {
39
+ console.warn("注意: 右下角未授权提示已展示");
40
+ }
41
+
42
+ console.log("onAuthResult info=" + JSON.stringify(info));
43
+ });
44
+ }