@shijiu/jsview-vue 0.9.783 → 0.9.804

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 (36) hide show
  1. package/dom/bin/jsview-browser-debug-dom.min.js +1 -1
  2. package/dom/bin/jsview-dom.min.js +1 -1
  3. package/dom/bin/jsview-engine-js-browser.min.js +1 -1
  4. package/dom/target_core_revision.js +4 -4
  5. package/package.json +1 -1
  6. package/samples/Basic/components/anim/AnimTransition.vue +4 -4
  7. package/samples/DemoHomepage/router.js +5 -0
  8. package/samples/FilterDemo/VideoLayer.vue +2 -2
  9. package/samples/FocusBlockDemos/AutoFocus/App.vue +7 -2
  10. package/samples/FocusBlockDemos/AutoFocus/DialogContorls.js +5 -0
  11. package/samples/FocusBlockDemos/AutoFocus/PlaneBlock.vue +1 -1
  12. package/samples/FocusBlockDemos/ProgressiveFocusControl/App.vue +8 -2
  13. package/samples/GiftRain/App.vue +248 -0
  14. package/samples/GiftRain/audio/boom.mp3 +0 -0
  15. package/samples/GiftRain/audio/get.mp3 +0 -0
  16. package/samples/GiftRain/common/Sound.js +48 -0
  17. package/samples/GiftRain/components/RedPacket.vue +161 -0
  18. package/samples/GiftRain/components/Score.vue +55 -0
  19. package/samples/GiftRain/components/SpriteTranslate.vue +72 -0
  20. package/samples/GridDemo/Item.vue +1 -0
  21. package/samples/ImpactStop/App.vue +2 -2
  22. package/samples/Swiper/App.vue +1 -1
  23. package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +17 -1
  24. package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +15 -38
  25. package/utils/JsViewPlugin/JsvAudio/version.js +10 -10
  26. package/utils/JsViewPlugin/JsvPlayer/version.js +5 -5
  27. package/utils/JsViewVueTools/JsvTextTools.js +2 -0
  28. package/utils/JsViewVueWidget/JsvActorMove/JsvActorMove.vue +1 -1
  29. package/utils/JsViewVueWidget/JsvFilterView.vue +1 -1
  30. package/utils/JsViewVueWidget/JsvMarquee.vue +1 -1
  31. package/utils/JsViewVueWidget/JsvNinePatch.vue +1 -1
  32. package/utils/JsViewVueWidget/JsvPosterDiv.vue +1 -1
  33. package/utils/JsViewVueWidget/JsvPosterImage.vue +1 -1
  34. package/utils/JsViewVueWidget/JsvSpray/JsvSpray.vue +43 -9
  35. package/utils/JsViewVueWidget/JsvTextBox.vue +1 -1
  36. package/utils/JsViewVueWidget/JsvVisibleSensor/JsvVisibleSensor.vue +1 -1
@@ -0,0 +1,72 @@
1
+ <template>
2
+ <JsvActorMove :key="`translate${item.key}`" ref="translateF"
3
+ :style="{ left: item.left, top: item.top, width: item.width, height: item.height }" :control="_Control">
4
+ <div :key="`bg${item.key}`" ref="translate"
5
+ :style="{ backgroundImage: `url(${item.src})`, left: 0, top: 0, width: item.width, height: item.height }" />
6
+ </JsvActorMove>
7
+ </template>
8
+
9
+ <script setup>
10
+ import { shallowRef, defineProps, onMounted, onBeforeMount } from 'vue';
11
+ import { JsvActorMove, JsvActorMoveControl, createImpactTracer, createImpactCallback, createImpactAutoFroze } from 'jsview'
12
+ //定义子ref
13
+ let translate = shallowRef(null)
14
+ //定义父ref
15
+ let translateF=shallowRef(null)
16
+ //定义props
17
+ const props = defineProps({
18
+ onDestory: Function,
19
+ item: Object,
20
+ onImpactTracer: Function,
21
+ MoneyBag: Object
22
+ })
23
+ const control = new JsvActorMoveControl();
24
+ const _Control = control;
25
+ const item = props.item;
26
+ //销毁方法
27
+ const _onDestroy = () => {
28
+ if (props.onDestory) {
29
+ props.onDestory(props.item.key);
30
+ }
31
+ }
32
+
33
+ let sensor = null;
34
+
35
+ const _InitItemEle = (item, ele) => {
36
+ if (ele && !item.ele) {
37
+ item.ele = ele;
38
+ if (props.MoneyBag) {
39
+ const giftrain_sensor = createImpactTracer(props.MoneyBag, ele, createImpactCallback(
40
+ () => {
41
+ props.onImpactTracer(item);
42
+ _onDestroy();
43
+ },
44
+ ), //碰撞即停
45
+ createImpactAutoFroze(
46
+ [props.MoneyBag,translateF.value.mainDiv],
47
+ null
48
+ )
49
+ );
50
+ sensor = giftrain_sensor;
51
+ }
52
+ }
53
+ }
54
+
55
+
56
+ //挂载时初始化
57
+ onMounted(() => {
58
+ _InitItemEle(item, translate.value)
59
+ _Control.moveToY(720 * 1.5 + 30, 720 * 1.5 / item.duration, () => {
60
+ _onDestroy();
61
+ });
62
+ })
63
+ //卸载之前释放碰撞监听者
64
+ onBeforeMount(()=>{
65
+ if(sensor!=null){
66
+ sensor.Recycle()
67
+ sensor=null
68
+ }
69
+ })
70
+ </script>
71
+
72
+ <style lang="scss" scoped></style>
@@ -69,6 +69,7 @@ onMounted(() => {
69
69
  height: 50,
70
70
  fontSize: '30px',
71
71
  color: '#FFFFFF',
72
+ whiteSpace: 'nowrap',
72
73
  }"
73
74
  >
74
75
  {{ userData.content }}
@@ -362,7 +362,7 @@ onBeforeUnmount(() => {
362
362
  class="text"
363
363
  :style="{ top: 528, left: 40, width: 405, height: 40 }"
364
364
  >
365
- JSV下,立刻起跳会精确到边缘
365
+ {{ "JSV下,立刻起跳会精确到边缘" }}
366
366
  </div>
367
367
 
368
368
  <div
@@ -370,7 +370,7 @@ onBeforeUnmount(() => {
370
370
  class="text"
371
371
  :style="{ top: 625, left: 370, width: 540, height: 40 }"
372
372
  >
373
- 左右键调整跳跃起点,按OK键进行跳跃
373
+ {{ "左右键调整跳跃起点,按OK键进行跳跃" }}
374
374
  </div>
375
375
  <div
376
376
  key="DirectText"
@@ -139,7 +139,7 @@ onMounted(() => {
139
139
  dataIndex == currentIndex
140
140
  ? 'rgba(100, 100, 100, 0.7)'
141
141
  : '#ff0000',
142
- borderRadius: '15px',
142
+ borderRadius: 10,
143
143
  }"
144
144
  ></div>
145
145
  </template>
@@ -247,8 +247,24 @@ class AudioProxy {
247
247
  get currentTime() { return this.getProperty("currentTime"); }
248
248
 
249
249
  setSrc(url, head) {
250
+ if (!url) {
251
+ console.error("JsvAudio: src is null");
252
+ return;
253
+ }
254
+ let realUrl = url.trim();
255
+ if (window.JsView) {
256
+ // jsview上
257
+ if (realUrl.startsWith("/") || realUrl.startsWith("file://")) {
258
+ //本地文件
259
+ realUrl = url;
260
+ } else {
261
+ realUrl = new window.JsView.Dom.UrlRef(url).href;
262
+ }
263
+ } else {
264
+ realUrl = url;
265
+ }
250
266
  const param = {
251
- url: url,
267
+ url: realUrl,
252
268
  head: JSON.stringify(head),
253
269
  };
254
270
  this.setProperty("src", param);
@@ -92,22 +92,6 @@ export default {
92
92
  return {};
93
93
  },
94
94
  },
95
- /**
96
- * 属性,Boolean类型,活跃状态
97
- */
98
- active: { type: Boolean, default: true },
99
- },
100
-
101
- watch: {
102
- active(newValue) {
103
- console.log("active newValue: " + newValue);
104
- if (this.audio) {
105
- if (newValue) {
106
- //同key的player切换时需要切换回调
107
- this.registerEvent();
108
- }
109
- }
110
- },
111
95
  },
112
96
  setup() {
113
97
  return {
@@ -122,26 +106,22 @@ export default {
122
106
  console.log("player key:" + key);
123
107
 
124
108
  this.audio = sAudioManager.createAudio(key);
109
+ this.registerEvent();
110
+ if (this.src && this.src !== "") {
111
+ this.audio.src = this.src;
112
+ }
125
113
 
126
- if (this.active) {
127
- this.registerEvent();
128
- if (this.src && this.src !== "") this.audio.src = this.src;
129
-
130
- if (this.currentTime !== 0) this.audio.currentTime = this.currentTime;
131
-
132
- if (this.autoplay) {
133
- this.audio.autoplay = this.autoplay;
134
- }
135
-
136
- if (this.muted) {
137
- this.audio.muted = this.muted;
138
- }
114
+ if (this.autoplay) {
115
+ this.audio.autoplay = this.autoplay;
116
+ }
139
117
 
140
- if (this.loop) {
141
- this.audio.loop = this.loop;
142
- }
118
+ if (this.muted) {
119
+ this.audio.muted = this.muted;
143
120
  }
144
121
 
122
+ if (this.loop) {
123
+ this.audio.loop = this.loop;
124
+ }
145
125
  this.onRef?.(this.audio);
146
126
  },
147
127
 
@@ -154,13 +134,10 @@ export default {
154
134
 
155
135
  methods: {
156
136
  registerEvent() {
157
- if (this.audio && this.active) {
137
+ if (this.audio) {
158
138
  this.audio.addEventListener("end", this.onEnded);
159
139
  this.audio.addEventListener("error", this.onError);
160
- this.audio.addEventListener("loadstart", () => {
161
- console.log("JsAudio received loadstart event.");
162
- this.onLoadStart();
163
- });
140
+ this.audio.addEventListener("loadstart", this.onLoadStart);
164
141
  this.audio.addEventListener("loadedmetadata", this.onLoadedMetaData);
165
142
  this.audio.addEventListener("load", this.onLoad);
166
143
  this.audio.addEventListener("audiofocusloss", this.onAudioFocusLoss);
@@ -172,5 +149,5 @@ export default {
172
149
  </script>
173
150
 
174
151
  <template>
175
- <div :style="{width: 1, height: 1}" backgroundColor="rgba(0,0,0,1)"></div>
152
+ <div :style="{ width: 1, height: 1 }" backgroundColor="rgba(0,0,0,1)"></div>
176
153
  </template>
@@ -3,17 +3,17 @@
3
3
  * @Date: 2023-02-22 18:22:26
4
4
  * @Description: file content
5
5
  */
6
- let PluginInfo={
6
+ let PluginInfo = {
7
7
  // downloadUrl:"http://192.168.0.63:8080/plugin/JsvAudio-164.zip", //插件下载地址
8
- packageName:"com.qcode.jsvaudio",
9
- name:"音频插件",
10
- version:"1.0.1", //插件需要的版本号
11
- versionCodeMin:1,
12
- versionCodeMax:1,
13
- bridgeName:"jsvAudioBridge", //插件bridge注册到jsview的名称
14
- className:"com.qcode.jsvaudio.JsvAudio", //插件初始化类名称
15
- initMethod:"createInstance", //插件初始化方法
16
- listener:"top.JsvAudioPluginLoadResult", //插件加载结果回调
8
+ packageName: "com.qcode.jsvaudio",
9
+ name: "音频插件",
10
+ version: "1.0.19", //插件需要的版本号
11
+ versionCodeMin: 19,
12
+ versionCodeMax: 19,
13
+ bridgeName: "jsvAudioBridge", //插件bridge注册到jsview的名称
14
+ className: "com.qcode.jsvaudio.JsvAudio", //插件初始化类名称
15
+ initMethod: "createInstance", //插件初始化方法
16
+ listener: "top.JsvAudioPluginLoadResult", //插件加载结果回调
17
17
  listener2: "top.JsvAudioPluginStatus",
18
18
  // debug:true,
19
19
  // md5:"baafc8ea737adcad5443f44cc0112498"
@@ -1,17 +1,17 @@
1
1
  let PluginInfo={
2
- // downloadUrl:"http://10.61.2.170:8080/plugin/JsvPlayer-194.zip", //插件下载地址
2
+ // downloadUrl:"http://192.168.0.85:8080/plugin/JsvPlayer-199.zip", //插件下载地址
3
3
  packageName:"com.qcode.jsvplayer",
4
4
  name:"播放器插件",
5
- version:"1.9.8", //插件需要的版本号
6
- versionCodeMin:198,
7
- versionCodeMax:198,
5
+ version:"2.0.2", //插件需要的版本号
6
+ versionCodeMin:202,
7
+ versionCodeMax:202,
8
8
  bridgeName:"jsvPlayerBridge", //插件bridge注册到jsview的名称
9
9
  className:"com.qcode.jsvplayer.JsvPlayer", //插件初始化类名称
10
10
  initMethod:"createInstance", //插件初始化方法
11
11
  listener:"top.JsvPlayerPluginLoadResult", //插件加载结果回调
12
12
  listener2: "top.JsvPlayerPluginStatus",
13
13
  // debug:true,
14
- md5:"2e7ee4fa5776346ecf2d4cecf002d74c"
14
+ md5:"6de8d620492bf0143bbccc62636a6271"
15
15
  };
16
16
 
17
17
  // 不要用export default,update-env脚本不能解析
@@ -5,6 +5,8 @@
5
5
  * @LastEditTime: 2023-03-09 13:34:59
6
6
  * @Description: file content
7
7
  */
8
+ import { Forge } from "../../dom/jsv-forge-define";
9
+
8
10
  const getTextWidth = (text, style) => {
9
11
  const textParams = {
10
12
  str: text ? text : "",
@@ -35,7 +35,7 @@
35
35
  -->
36
36
  <script setup>
37
37
  import JsvActorMoveControl from "./JsvActorMoveControl";
38
- import { shallowRef, onMounted } from "vue";
38
+ import { shallowRef, onMounted, defineProps, defineExpose } from "vue";
39
39
 
40
40
  const props = defineProps({
41
41
  control: {
@@ -12,7 +12,7 @@
12
12
  -->
13
13
  <script setup>
14
14
  import { Forge, ForgeExtension } from "../../dom/jsv-forge-define";
15
- import { onBeforeUnmount, watchEffect } from "vue";
15
+ import { onBeforeUnmount, watchEffect, defineProps } from "vue";
16
16
 
17
17
  const props = defineProps({
18
18
  width: {
@@ -14,7 +14,7 @@
14
14
  <script setup>
15
15
  import { Forge } from "../../dom/jsv-forge-define";
16
16
  import { TextTools } from "../JsViewVueTools/JsvTextTools";
17
- import { shallowRef, computed, toRaw, onMounted, onBeforeUnmount } from "vue";
17
+ import { shallowRef, computed, toRaw, onMounted, onBeforeUnmount, defineProps } from "vue";
18
18
 
19
19
  const defaultFontStyle = () => {
20
20
  return {
@@ -17,7 +17,7 @@
17
17
  -->
18
18
 
19
19
  <script setup>
20
- import { ref, watchEffect, computed } from "vue";
20
+ import { ref, watchEffect, computed, defineProps } from "vue";
21
21
 
22
22
  const props = defineProps({
23
23
  style: {
@@ -10,7 +10,7 @@
10
10
  -->
11
11
  <script setup>
12
12
 
13
- import { reactive, watchEffect } from "vue";
13
+ import { reactive, watchEffect, defineProps } from "vue";
14
14
 
15
15
  const props = defineProps({
16
16
  style: Object,
@@ -8,7 +8,7 @@
8
8
 
9
9
  <script setup>
10
10
 
11
- import { reactive, watchEffect } from "vue";
11
+ import { reactive, watchEffect, defineProps } from "vue";
12
12
 
13
13
  const props = defineProps({
14
14
  colorSpace: {
@@ -57,7 +57,7 @@ let buildForgeView = (pointRes, sprayStyle, sizeRef, ignoreClip) => {
57
57
  texture_manager.GetImage2(image_url, false, null, "RGB_8888", null)
58
58
  );
59
59
  }
60
- const spray_view = new Forge.SprayView(texture_setting, ignoreClip);
60
+ const spray_view = new Forge.SprayView(texture_setting);
61
61
  const add_num_per_frame = sprayStyle.addNumSpeed
62
62
  ? sprayStyle.addNumSpeed
63
63
  : 0.001;
@@ -67,6 +67,24 @@ let buildForgeView = (pointRes, sprayStyle, sizeRef, ignoreClip) => {
67
67
  typeof sprayStyle.accelerateY !== "undefined"
68
68
  ? sprayStyle.accelerateY
69
69
  : -100;
70
+ let angularVelocityMin = 0,
71
+ angularVelocityMax = 0;
72
+ if (
73
+ typeof sprayStyle.angularVelocityMin === "number" &&
74
+ typeof sprayStyle.angularVelocityMax === "number"
75
+ ) {
76
+ angularVelocityMin = sprayStyle.angularVelocityMin;
77
+ angularVelocityMax = sprayStyle.angularVelocityMax;
78
+ }
79
+ let alphaMin = 1,
80
+ alphaMax = 1;
81
+ if (
82
+ typeof sprayStyle.alphaMin === "number" &&
83
+ typeof sprayStyle.alphaMax === "number"
84
+ ) {
85
+ alphaMin = sprayStyle.alphaMin;
86
+ alphaMax = sprayStyle.alphaMax;
87
+ }
70
88
  spray_view.SetSprayInfo(
71
89
  sprayStyle.type,
72
90
  sprayStyle.particleNum,
@@ -83,7 +101,12 @@ let buildForgeView = (pointRes, sprayStyle, sizeRef, ignoreClip) => {
83
101
  accelerate_x,
84
102
  accelerate_y,
85
103
  sprayStyle.enableFade,
86
- sprayStyle.enableShrink
104
+ sprayStyle.enableShrink,
105
+ ignoreClip,
106
+ angularVelocityMin,
107
+ angularVelocityMax,
108
+ alphaMin,
109
+ alphaMax
87
110
  );
88
111
  const view_width =
89
112
  sprayStyle.deltaWidth === 0 ? 1 : 2 * sprayStyle.deltaWidth;
@@ -109,13 +132,13 @@ export default {
109
132
  ignoreClip: {
110
133
  type: Boolean,
111
134
  default: false,
112
- }
135
+ },
113
136
  },
114
137
  data() {
115
138
  return {
116
139
  size: {
117
140
  width: 0,
118
- height: 0
141
+ height: 0,
119
142
  },
120
143
  viewId: -1,
121
144
  };
@@ -129,11 +152,21 @@ export default {
129
152
  },
130
153
  },
131
154
  created() {
132
- this.viewId = buildForgeView(this.pointRes, this.sprayStyle, this.size, this.ignoreClip);
155
+ this.viewId = buildForgeView(
156
+ this.pointRes,
157
+ this.sprayStyle,
158
+ this.size,
159
+ this.ignoreClip
160
+ );
133
161
  },
134
162
  updated() {
135
163
  this.unloadView();
136
- this.viewId = buildForgeView(this.pointRes, this.sprayStyle, this.size, this.ignoreClip);
164
+ this.viewId = buildForgeView(
165
+ this.pointRes,
166
+ this.sprayStyle,
167
+ this.size,
168
+ this.ignoreClip
169
+ );
137
170
  },
138
171
  beforeUnmount() {
139
172
  this.unloadView();
@@ -142,7 +175,8 @@ export default {
142
175
  </script>
143
176
 
144
177
  <template>
145
- <div
146
- :style="{width: size.width, height: size.height}"
147
- :jsv_innerview="viewId"></div>
178
+ <div
179
+ :style="{ width: size.width, height: size.height }"
180
+ :jsv_innerview="viewId"
181
+ ></div>
148
182
  </template>
@@ -12,7 +12,7 @@
12
12
  -->
13
13
 
14
14
  <script setup>
15
- import { ref, shallowRef, computed } from "vue";
15
+ import { ref, shallowRef, computed, defineProps } from "vue";
16
16
 
17
17
  const props = defineProps({
18
18
  style: Object,
@@ -29,7 +29,7 @@
29
29
  </template>
30
30
 
31
31
  <script setup>
32
- import { reactive, ref, shallowRef, toRaw, watchEffect, onMounted, defineExpose } from 'vue'
32
+ import { reactive, ref, shallowRef, toRaw, watchEffect, onMounted, defineProps, defineExpose } from 'vue'
33
33
  import { Forge } from "jsview/dom/jsv-forge-define";
34
34
 
35
35
  const props = defineProps({