@shijiu/jsview-vue-samples 1.9.888 → 1.9.915

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 (185) hide show
  1. package/AnimPicture/App.vue +10 -10
  2. package/Basic/App.vue +1 -1
  3. package/Basic/components/FontStyle.css +4 -4
  4. package/Basic/components/anim/AnimKeyframeBasic.vue +1 -1
  5. package/Basic/components/anim/AnimKeyframeComposite.vue +2 -2
  6. package/Basic/components/anim/AnimTransition.vue +4 -4
  7. package/Basic/components/div/DivClip.vue +0 -39
  8. package/Basic/components/div/DivCssScoped.vue +1 -1
  9. package/Basic/components/div/DivLayout.vue +1 -1
  10. package/Basic/components/div/DivRadius.vue +4 -4
  11. package/Basic/components/img/ImageGroup.vue +2 -2
  12. package/Basic/components/img/ImgLayout.vue +78 -14
  13. package/Basic/components/text/TextDirection.vue +9 -9
  14. package/Basic/components/text/TextEmoji.vue +7 -2
  15. package/Basic/components/text/TextFontStyle.vue +4 -4
  16. package/Basic/components/text/TextGroup1.vue +1 -1
  17. package/Basic/components/text/TextGroup2.vue +2 -2
  18. package/BasicFocusControl/App.vue +2 -2
  19. package/BasicFocusControl/components/BaseBlock.vue +2 -2
  20. package/BasicFocusControl/components/MainArea.vue +2 -2
  21. package/BasicFocusControl/components/SideBar.vue +2 -2
  22. package/Collision/App.vue +16 -16
  23. package/ColorSpace/App.vue +11 -11
  24. package/CssPreprocessor/App.vue +70 -0
  25. package/CssPreprocessor/Less/App.vue +32 -0
  26. package/CssPreprocessor/Less/PanelData.js +51 -0
  27. package/CssPreprocessor/Less/components/less-group1/LessComments.vue +34 -0
  28. package/CssPreprocessor/Less/components/less-group1/LessConditionals.vue +32 -0
  29. package/CssPreprocessor/Less/components/less-group1/LessOperations.vue +24 -0
  30. package/CssPreprocessor/Less/components/less-group1/LessVariables.vue +48 -0
  31. package/CssPreprocessor/Less/components/less-group2/LessIteration.vue +32 -0
  32. package/CssPreprocessor/Less/components/less-group2/LessMethods.vue +27 -0
  33. package/CssPreprocessor/Less/components/less-group3/LessExtends.vue +32 -0
  34. package/CssPreprocessor/Less/components/less-group3/LessNesting.vue +63 -0
  35. package/CssPreprocessor/Less/components/less-group4/LessKeyframes.vue +40 -0
  36. package/CssPreprocessor/Less/components/less-group4/LessMaps.vue +33 -0
  37. package/CssPreprocessor/Less/components/less-group4/LessMixins.vue +33 -0
  38. package/CssPreprocessor/Less/components/less-group5/LessImporting.vue +34 -0
  39. package/CssPreprocessor/Less/components/less-group5/TextSettings.less +4 -0
  40. package/CssPreprocessor/Scss/App.vue +32 -0
  41. package/CssPreprocessor/Scss/PanelData.js +51 -0
  42. package/CssPreprocessor/Scss/components/scss-group1/ScssComments.vue +34 -0
  43. package/CssPreprocessor/Scss/components/scss-group1/ScssConditionals.vue +36 -0
  44. package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +30 -0
  45. package/CssPreprocessor/Scss/components/scss-group1/ScssVariables.vue +48 -0
  46. package/CssPreprocessor/Scss/components/scss-group2/ScssIteration.vue +36 -0
  47. package/CssPreprocessor/Scss/components/scss-group2/ScssMethods.vue +84 -0
  48. package/CssPreprocessor/Scss/components/scss-group3/ScssExtends.vue +34 -0
  49. package/CssPreprocessor/Scss/components/scss-group3/ScssNesting.vue +75 -0
  50. package/CssPreprocessor/Scss/components/scss-group4/ScssKeyframes.vue +40 -0
  51. package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +35 -0
  52. package/CssPreprocessor/Scss/components/scss-group4/ScssMixins.vue +33 -0
  53. package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +34 -0
  54. package/CssPreprocessor/Scss/components/scss-group5/TextSettings.scss +4 -0
  55. package/CssPreprocessor/Stylus/App.vue +32 -0
  56. package/CssPreprocessor/Stylus/PanelData.js +51 -0
  57. package/CssPreprocessor/Stylus/components/stylus-group1/StylusComments.vue +34 -0
  58. package/CssPreprocessor/Stylus/components/stylus-group1/StylusConditionals.vue +36 -0
  59. package/CssPreprocessor/Stylus/components/stylus-group1/StylusOperations.vue +30 -0
  60. package/CssPreprocessor/Stylus/components/stylus-group1/StylusVariables.vue +47 -0
  61. package/CssPreprocessor/Stylus/components/stylus-group2/StylusIteration.vue +34 -0
  62. package/CssPreprocessor/Stylus/components/stylus-group2/StylusMethods.vue +78 -0
  63. package/CssPreprocessor/Stylus/components/stylus-group3/StylusExtends.vue +34 -0
  64. package/CssPreprocessor/Stylus/components/stylus-group3/StylusNesting.vue +63 -0
  65. package/CssPreprocessor/Stylus/components/stylus-group4/StylusKeyframes.vue +40 -0
  66. package/CssPreprocessor/Stylus/components/stylus-group4/StylusMaps.vue +33 -0
  67. package/CssPreprocessor/Stylus/components/stylus-group4/StylusMixins.vue +33 -0
  68. package/CssPreprocessor/Stylus/components/stylus-group5/StylusImporting.vue +34 -0
  69. package/CssPreprocessor/Stylus/components/stylus-group5/TextSettings.styl +4 -0
  70. package/CssPreprocessor/utils/ContentBlock.vue +43 -0
  71. package/CssPreprocessor/utils/ContentList.vue +34 -0
  72. package/CssPreprocessor/utils/FontStyle.css +19 -0
  73. package/CssPreprocessor/utils/Panel.vue +49 -0
  74. package/CssPreprocessor/utils/TitleBar.vue +29 -0
  75. package/DemoHomepage/App.vue +46 -11
  76. package/DemoHomepage/components/Dialog.vue +15 -15
  77. package/DemoHomepage/router.js +20 -12
  78. package/DemoHomepage/views/Homepage.vue +90 -102
  79. package/DivMetroPerformance/App.vue +150 -0
  80. package/DivMetroPerformance/Item.vue +58 -0
  81. package/DivMetroPerformance/assets/bg.jpg +0 -0
  82. package/DivMetroPerformance/assets/coupon_content.png +0 -0
  83. package/DivMetroPerformance/assets/coupon_left.png +0 -0
  84. package/DivMetroPerformance/assets/coupon_mid.png +0 -0
  85. package/DivMetroPerformance/assets/coupon_right.png +0 -0
  86. package/DivMetroPerformance/assets/focus_border.png +0 -0
  87. package/DivMetroPerformance/assets/holder_logo.png +0 -0
  88. package/DivMetroPerformance/assets/jrbm.png +0 -0
  89. package/DivMetroPerformance/assets/line_left.png +0 -0
  90. package/DivMetroPerformance/assets/line_mid.png +0 -0
  91. package/DivMetroPerformance/assets/line_right.png +0 -0
  92. package/DivMetroPerformance/assets/loading.png +0 -0
  93. package/DivMetroPerformance/assets/logo.png +0 -0
  94. package/DivMetroPerformance/assets/mcjx.png +0 -0
  95. package/DivMetroPerformance/assets/tao.png +0 -0
  96. package/DivMetroPerformance/assets/tmall.png +0 -0
  97. package/DivMetroPerformance/border.png +0 -0
  98. package/DivMetroPerformance/components/ContentItem.vue +385 -0
  99. package/DivMetroPerformance/components/MyTab.vue +129 -0
  100. package/DivMetroPerformance/data.js +124 -0
  101. package/DivMetroPerformance/utils/GridItem.vue +28 -0
  102. package/DivMetroPerformance/utils/GridPlate.vue +85 -0
  103. package/FilterDemo/AnimatePic.vue +3 -3
  104. package/FilterDemo/App.vue +3 -3
  105. package/FlipCard/App.vue +2 -2
  106. package/FlipCard/FlipCard.vue +2 -2
  107. package/GridDemo/Item.vue +13 -13
  108. package/HashHistory/App.vue +0 -1
  109. package/HashHistory/components/Item.vue +2 -2
  110. package/HashHistory/views/MainPage.vue +1 -1
  111. package/HashHistory/views/SubPage.vue +2 -2
  112. package/ImpactStop/App.vue +9 -11
  113. package/Input/InputPanel.vue +2 -4
  114. package/LongImage/App.vue +2 -2
  115. package/LongImage/Button.vue +1 -1
  116. package/LongImage/ButtonItem.vue +1 -1
  117. package/LongText/App.vue +3 -3
  118. package/LongText/Button.vue +1 -1
  119. package/LongText/ButtonItem.vue +1 -1
  120. package/LongText/LongTextScroll.vue +4 -4
  121. package/Marquee/longText.js +0 -2
  122. package/MaskClip/App.vue +4 -4
  123. package/MediaDemo/App.vue +127 -0
  124. package/MediaDemo/assets/audio-poster.png +0 -0
  125. package/MediaDemo/components/Button.vue +69 -0
  126. package/MediaDemo/components/Controllor.vue +279 -0
  127. package/MediaDemo/components/StatusBar.vue +100 -0
  128. package/MediaDemo/components/frames/AudioFrame.vue +39 -0
  129. package/MediaDemo/components/frames/AudioPoster.vue +48 -0
  130. package/MediaDemo/components/frames/MediaFrame.vue +153 -0
  131. package/MediaDemo/components/frames/VideoFrame.vue +39 -0
  132. package/MetroWidgetDemos/Advanced/ButtonItem.vue +4 -4
  133. package/MetroWidgetDemos/Advanced/widgets/Item.vue +5 -5
  134. package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +2 -2
  135. package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +57 -56
  136. package/MetroWidgetDemos/Item.vue +4 -5
  137. package/MetroWidgetDemos/PerformanceTest/App.vue +3 -3
  138. package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +26 -26
  139. package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +15 -15
  140. package/MetroWidgetDemos/PingPong/AppPage.vue +2 -2
  141. package/MetroWidgetDemos/PingPong/TabItem.vue +2 -2
  142. package/MetroWidgetDemos/PingPong/ViewSwiper.vue +9 -9
  143. package/MetroWidgetDemos/Simple/RelativeTemplate.vue +2 -2
  144. package/MetroWidgetDemos/WidgetItem.vue +2 -2
  145. package/NinePatchDemo/App.vue +3 -3
  146. package/NinePatchDemo/Item.vue +5 -5
  147. package/Preload/App.vue +5 -5
  148. package/Preload/Item.vue +1 -1
  149. package/QrcodeDemo/App.vue +3 -3
  150. package/ScaleDownNeon/App.vue +9 -9
  151. package/SoundPool/App.vue +6 -9
  152. package/SprayView/App.vue +22 -22
  153. package/SpriteImage/App.vue +4 -4
  154. package/Swiper/App.vue +2 -8
  155. package/TextBox/App.vue +1 -2
  156. package/TextBox/RenderCenter.vue +16 -16
  157. package/TextBox/RenderLeft.vue +16 -16
  158. package/TextBox/RenderOneLine.vue +12 -12
  159. package/TextBox/RenderRight.vue +16 -16
  160. package/TextShadowDemo/App.vue +4 -4
  161. package/TextureAnimation/App.vue +1 -17
  162. package/TextureAnimation/App2.vue +3 -3
  163. package/TextureSize/App.vue +8 -8
  164. package/ThrowMoveDemo/AccelerateDemo.vue +4 -4
  165. package/ThrowMoveDemo/LRParabolicDemo.vue +4 -4
  166. package/ThrowMoveDemo/TargetDemo.vue +4 -4
  167. package/ThrowMoveDemo/UDParabolicDemo.vue +4 -4
  168. package/TouchSample/App.vue +2 -2
  169. package/TouchSample/Item.vue +2 -2
  170. package/TouchSample/MetroWidgetHorizontal.vue +3 -3
  171. package/TouchSample/MetroWidgetVertical.vue +3 -3
  172. package/TouchSample/TouchContainerHorizontal.vue +2 -2
  173. package/TouchSample/TouchContainerVertical.vue +2 -2
  174. package/TransitPage/App.vue +1 -1
  175. package/VideoDemo/App.vue +4 -4
  176. package/VideoDemo/components/Button.vue +1 -1
  177. package/VideoDemo/components/Controllor.vue +2 -2
  178. package/VideoDemo/components/VideoFrame.vue +1 -1
  179. package/VisibleSensorDemo/App.vue +7 -7
  180. package/assets/bmpDemo.bmp +0 -0
  181. package/assets/jpegDemo.jpeg +0 -0
  182. package/assets/pngDemo.png +0 -0
  183. package/assets/pngNoAlphaDemo.png +0 -0
  184. package/assets/webpDemo.webp +0 -0
  185. package/package.json +6 -1
@@ -0,0 +1,153 @@
1
+ <script>
2
+ import { inject, watch } from 'vue'
3
+ import { Options, Vue } from "vue-class-component";
4
+
5
+ @Options({
6
+ props: {
7
+ tagName: String,
8
+ src: String,
9
+ style: { type:Object, default: {}},
10
+ },
11
+ })
12
+ class MediaFrame extends Vue {
13
+ constructor(props) {
14
+ super(props);
15
+
16
+ this.mediaRef = null;
17
+
18
+ this.mediaCtrl = inject('mediaCtrl');
19
+ this.mediaTime = inject('mediaTime');
20
+ this.mediaStatus = inject('mediaStatus');
21
+
22
+ watch(() => this.mediaCtrl.seek, this.seekMediaStep.bind(this));
23
+ watch(() => this.mediaCtrl.volume, this.volumeMediaStep.bind(this));
24
+ watch(() => this.mediaCtrl.playTrigger, this.setPlayPause.bind(this));
25
+ watch(() => this.mediaCtrl.loadTrigger, this.reload.bind(this));
26
+ }
27
+
28
+ mounted() {
29
+ this.mediaRef = this.$refs.mediaRef;
30
+ this.mediaStatus.volume = this.mediaRef.volume;
31
+ }
32
+
33
+ seekMediaStep(timeStep) {
34
+ if(!this.mediaRef) {
35
+ return;
36
+ }
37
+
38
+ let playEnd = false;
39
+ let seekTime = this.mediaRef.currentTime + Math.ceil(timeStep);
40
+ if(seekTime < 0) {
41
+ seekTime = 0;
42
+ } else if(seekTime > this.mediaTime.duration) {
43
+ seekTime = this.mediaTime.duration;
44
+ if(this.mediaRef.currentTime != this.mediaTime.duration) { // 触发一次播放,收到ended事件
45
+ playEnd = true;
46
+ }
47
+ }
48
+ this.mediaRef.currentTime = seekTime;
49
+ if(playEnd) {
50
+ this.setPlayPause(true);
51
+ }
52
+ }
53
+
54
+ setPlayPause() {
55
+ if(!this.mediaStatus.playing) {
56
+ this.mediaRef.play();
57
+ } else {
58
+ this.mediaRef.pause();
59
+ }
60
+ }
61
+
62
+ reload() {
63
+ this.mediaRef.load();
64
+ }
65
+
66
+ volumeMediaStep(volumeStep) {
67
+ if(!this.mediaRef) {
68
+ return;
69
+ }
70
+
71
+ let volume = this.mediaRef.volume + volumeStep;
72
+ if(volume < 0) {
73
+ volume += 1;
74
+ }else if(volume > 1) {
75
+ volume -= 1;
76
+ }
77
+ volume = Math.round(volume * 10) / 10; // 保留一位小数
78
+ this.mediaRef.volume = volume;
79
+ this.mediaStatus.volume = volume;
80
+ }
81
+
82
+ onErrorEvent(event) {
83
+ const state = event.type + ": code=" + this.mediaRef.error.code + ", message=" + this.mediaRef.error.message;
84
+ console.log("MediaFrame.onErrorEvent()", event, state);
85
+ this.mediaStatus.playState = state;
86
+ }
87
+
88
+ onTimeUpdate(event) {
89
+ if(!this.mediaRef) { // unmounted
90
+ return;
91
+ }
92
+ // console.log("MediaFrame.onTimeUpdate()", event, this.mediaRef.currentTime);
93
+ this.mediaTime.currentTime = this.mediaRef.currentTime;
94
+ }
95
+
96
+ onDurationChange(event) {
97
+ console.log("MediaFrame.onDurationChange()", event.type);
98
+ this.mediaTime.duration = this.mediaRef.duration;
99
+ }
100
+
101
+ onOtherEvent(event) {
102
+ console.log("MediaFrame.onOtherEvent()", event.type);
103
+ this.mediaStatus.playState = event.type;
104
+ if(event.type == 'playing') {
105
+ this.mediaStatus.playing = true;
106
+ } else if(event.type == 'loadstart'
107
+ || event.type == 'pause'
108
+ || event.type == 'error') {
109
+ this.mediaStatus.playing = false;
110
+ }
111
+ }
112
+ }
113
+
114
+ export default MediaFrame;
115
+ </script>
116
+
117
+ <template>
118
+ <div>
119
+ <!-- <component :is="tagName"> 可以直接换成<video>/<audio>, -->
120
+ <!-- 这里是为了统一onEvent处理才这样写 -->
121
+ <component :is="tagName"
122
+ ref="mediaRef"
123
+
124
+ :style="style"
125
+
126
+ :autoplay="mediaCtrl.autoplay"
127
+ :loop="mediaCtrl.loop"
128
+ :muted="mediaCtrl.mute"
129
+ :playbackRate="mediaCtrl.playbackRate"
130
+ :src="src"
131
+
132
+ :onabort="onOtherEvent"
133
+ :oncanplay="onOtherEvent"
134
+ :oncanplaythrough="onOtherEvent"
135
+ :ondurationchange="onDurationChange"
136
+ :onended="onOtherEvent"
137
+ :onerror="onErrorEvent"
138
+ :onload="onOtherEvent"
139
+ :onloadedmetadata="onOtherEvent"
140
+ :onloadstart="onOtherEvent"
141
+ :onpause="onOtherEvent"
142
+ :onplay="onOtherEvent"
143
+ :onplaying="onOtherEvent"
144
+ :onseeking="onOtherEvent"
145
+ :onseeked="onOtherEvent"
146
+ :onstalled="onOtherEvent"
147
+ :ontimeupdate="onTimeUpdate"
148
+ />
149
+ </div>
150
+ </template>
151
+
152
+ <style scoped>
153
+ </style>
@@ -0,0 +1,39 @@
1
+ <script>
2
+ import { inject } from 'vue'
3
+ import { Options, Vue } from "vue-class-component";
4
+ import MediaFrame from "./MediaFrame";
5
+
6
+ @Options({
7
+ components: {
8
+ MediaFrame,
9
+ },
10
+ })
11
+ class VideoFrame extends Vue {
12
+ constructor(props) {
13
+ super(props);
14
+
15
+ this.videoCtrl = inject('videoCtrl');
16
+
17
+ this.videoUrl = "http://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/VideoTestSample/neza.mp4";
18
+ }
19
+ }
20
+
21
+ export default VideoFrame;
22
+ </script>
23
+
24
+ <template>
25
+ <MediaFrame
26
+ tagName="video"
27
+ :src="videoUrl"
28
+
29
+ :style="{
30
+ ...videoCtrl.layout,
31
+ visibility: videoCtrl.visibility,
32
+ objectFit: videoCtrl.objectFit,
33
+ borderRadius: '80 80 160 240',
34
+ }"
35
+ />
36
+ </template>
37
+
38
+ <style scoped>
39
+ </style>
@@ -1,12 +1,12 @@
1
1
  <!--
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-07-11 13:26:24
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-12-02 16:10:16
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2023-02-16 10:07:30
6
6
  * @Description: file content
7
7
  -->
8
8
  <script setup>
9
- import { ref, shallowRef } from "vue";
9
+ import { ref } from "vue";
10
10
  import { useFocusHub } from "jsview";
11
11
 
12
12
  const props = defineProps({
@@ -19,7 +19,7 @@ const focusHub = useFocusHub();
19
19
 
20
20
  let focusIndex = ref(0);
21
21
  let focused = ref(false);
22
- let focusBlock = shallowRef(null);
22
+ let focusBlock = ref(null);
23
23
 
24
24
  const onFocus = () => {
25
25
  //onFocus时, 获得焦点, 以处理自己内部的焦点逻辑
@@ -2,7 +2,7 @@
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-11-01 15:30:14
4
4
  * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-12-02 16:11:54
5
+ * @LastEditTime: 2022-11-02 15:39:17
6
6
  * @Description: file content
7
7
  -->
8
8
  <!--
@@ -13,7 +13,7 @@
13
13
  * @Description: file content
14
14
  -->
15
15
  <script setup>
16
- import { ref, shallowRef, inject } from "vue";
16
+ import { ref, inject } from "vue";
17
17
 
18
18
  const props = defineProps({
19
19
  data: Object,
@@ -21,7 +21,7 @@ const props = defineProps({
21
21
  onAction: Object,
22
22
  });
23
23
 
24
- const divRef = shallowRef(null);
24
+ const divRef = ref(null);
25
25
  const focused = ref(false);
26
26
 
27
27
  const focusSize = inject("focusSize");
@@ -70,10 +70,10 @@ props.onAction.register("onClick", onClick);
70
70
  :style="{
71
71
  width: data.width,
72
72
  height: data.height,
73
- fontSize: '30px',
73
+ fontSize: 30,
74
74
  color: '#FFFFFF',
75
75
  backgroundColor: data.color,
76
- borderRadius: '10px',
76
+ borderRadius: 10,
77
77
  }"
78
78
  >
79
79
  {{ data.content }}
@@ -1,7 +1,7 @@
1
1
 
2
2
  <script setup>
3
3
  import { HORIZONTAL, MetroWidget, useFocusHub } from "jsview";
4
- import { ref, shallowRef } from "vue";
4
+ import { ref } from "vue";
5
5
  import Item from "./Item.vue";
6
6
 
7
7
  const props = defineProps({
@@ -11,7 +11,7 @@ const props = defineProps({
11
11
  onAction: Object,
12
12
  });
13
13
  const focusHub = useFocusHub();
14
- const mwRef = shallowRef(null);
14
+ const mwRef = ref(null);
15
15
 
16
16
  const measures = (item) => {
17
17
  return item;
@@ -1,8 +1,8 @@
1
1
  <!--
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-07-11 13:31:36
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-11-02 15:35:12
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2023-02-16 17:40:23
6
6
  * @Description: file content
7
7
  -->
8
8
  <script setup>
@@ -16,7 +16,7 @@ import {
16
16
  import { advanceMetroWidget } from "../../data";
17
17
  import WidgetItem from "../widgets/WidgetItem.vue";
18
18
  import focusImg from "./focus1.png";
19
- import { ref, shallowRef, reactive, provide } from "vue";
19
+ import { ref, reactive, provide } from "vue";
20
20
 
21
21
  const focusHub = useFocusHub();
22
22
  const showFocus = ref(false);
@@ -26,7 +26,6 @@ const provideData = () => {
26
26
  };
27
27
 
28
28
  const onFocus = () => {
29
- console.log("testtest", " widget onfocus");
30
29
  showFocus.value = true;
31
30
  };
32
31
 
@@ -60,57 +59,59 @@ const onEdge = (edgeInfo) => {
60
59
  </script>
61
60
 
62
61
  <template>
63
- <div
64
- :style="{
65
- left: 500,
66
- top: 20,
67
- width: 500,
68
- height: 400,
69
- fontSize: 30,
70
- color: '#FFFFFF',
71
- }"
72
- >
73
- {{ `进一步, MetroWidget的item\n可以是包含MetroWidget的组件` }}
62
+ <div>
63
+ <div
64
+ :style="{
65
+ left: 500,
66
+ top: 20,
67
+ width: 500,
68
+ height: 400,
69
+ fontSize: 30,
70
+ color: '#FFFFFF',
71
+ }"
72
+ >
73
+ {{ `进一步, MetroWidget的item\n可以是包含MetroWidget的组件` }}
74
+ </div>
75
+ <!-- 为了保证边缘的item缩放后依旧完整显示, 需要设置padding, 注意width/height是包含padding的 -->
76
+ <metro-widget
77
+ name="mwWidget"
78
+ :top="100"
79
+ :left="400"
80
+ :provideData="provideData"
81
+ :width="660"
82
+ :height="600"
83
+ :padding="{ left: 30, right: 30 }"
84
+ :direction="VERTICAL"
85
+ :measures="measures"
86
+ :onEdge="onEdge"
87
+ :onFocus="onFocus"
88
+ :onBlur="onBlur"
89
+ >
90
+ <!-- data为每个item的数据, query提供获取MetroWidget内部状态的一些接口, onAction提供item注册自身回调的接口, onItemEdge则是item内部焦点处理到达边缘后, 需要通知MetroWidget时的回调 -->
91
+ <template #renderItem="{ data, query, onAction, onItemEdge }">
92
+ <widget-item
93
+ :data="data"
94
+ :query="query"
95
+ :onAction="onAction"
96
+ :onItemEdge="onItemEdge"
97
+ />
98
+ </template>
99
+ </metro-widget>
100
+ <jsv-nine-patch
101
+ v-show="showFocus"
102
+ :style="{
103
+ width: focusSize.width,
104
+ height: focusSize.height,
105
+ top: focusSize.top,
106
+ left: focusSize.left,
107
+ }"
108
+ :imageUrl="focusImg"
109
+ :imageWidth="55"
110
+ :centerWidth="1"
111
+ :borderOutset="13"
112
+ :imageDspWidth="55"
113
+ :animTime="0.2"
114
+ :waitForInit="true"
115
+ ></jsv-nine-patch>
74
116
  </div>
75
- <!-- 为了保证边缘的item缩放后依旧完整显示, 需要设置padding, 注意width/height是包含padding的 -->
76
- <metro-widget
77
- name="mwWidget"
78
- :top="100"
79
- :left="400"
80
- :provideData="provideData"
81
- :width="660"
82
- :height="600"
83
- :padding="{ left: 30, right: 30 }"
84
- :direction="VERTICAL"
85
- :measures="measures"
86
- :onEdge="onEdge"
87
- :onFocus="onFocus"
88
- :onBlur="onBlur"
89
- >
90
- <!-- data为每个item的数据, query提供获取MetroWidget内部状态的一些接口, onAction提供item注册自身回调的接口, onItemEdge则是item内部焦点处理到达边缘后, 需要通知MetroWidget时的回调 -->
91
- <template #renderItem="{ data, query, onAction, onItemEdge }">
92
- <widget-item
93
- :data="data"
94
- :query="query"
95
- :onAction="onAction"
96
- :onItemEdge="onItemEdge"
97
- />
98
- </template>
99
- </metro-widget>
100
- <jsv-nine-patch
101
- v-show="showFocus"
102
- :style="{
103
- width: focusSize.width,
104
- height: focusSize.height,
105
- top: focusSize.top,
106
- left: focusSize.left,
107
- }"
108
- :imageUrl="focusImg"
109
- :imageWidth="55"
110
- :centerWidth="1"
111
- :borderOutset="13"
112
- :imageDspWidth="55"
113
- :animTime="0.2"
114
- :waitForInit="true"
115
- ></jsv-nine-patch>
116
117
  </template>
@@ -1,12 +1,11 @@
1
1
  <!--
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2022-05-10 15:21:24
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-12-02 16:12:43
4
+ * @LastEditTime: 2023-02-10 11:08:44
6
5
  * @Description: file content
7
6
  -->
8
7
  <script setup>
9
- import { ref, shallowRef, inject } from "vue";
8
+ import { ref, inject } from "vue";
10
9
 
11
10
  const props = defineProps({
12
11
  data: Object,
@@ -14,7 +13,7 @@ const props = defineProps({
14
13
  onAction: Object,
15
14
  });
16
15
 
17
- const divRef = shallowRef(null);
16
+ const divRef = ref(null);
18
17
  const focused = ref(false);
19
18
 
20
19
  // 自身的焦点状态自己记录, 通过回调来改变
@@ -58,7 +57,7 @@ props.onAction.register("onClick", onClick);
58
57
  :style="{
59
58
  width: data.width,
60
59
  height: data.height,
61
- fontSize: '30px',
60
+ fontSize: 30,
62
61
  color: '#FFFFFF',
63
62
  backgroundColor: data.color,
64
63
  }"
@@ -76,7 +76,7 @@ import { data1, data2, data3 } from "./data";
76
76
  import borderImgPath from "./border.png";
77
77
  import Item from "./components/ContentItem.vue";
78
78
  import MyTab from "./components/MyTab.vue";
79
- import { ref, shallowRef, onMounted, onBeforeUnmount } from "vue";
79
+ import { ref, onMounted, onBeforeUnmount } from "vue";
80
80
  import { useRouter } from "vue-router";
81
81
  import {
82
82
  VERTICAL,
@@ -90,7 +90,7 @@ const router = useRouter();
90
90
  const focusHub = useFocusHub();
91
91
  let contentData = data1;
92
92
  let requestDataTime = 0;
93
- const mwRef = shallowRef(null);
93
+ const mwRef = ref(null);
94
94
 
95
95
  const onKeyDown = (ev) => {
96
96
  // 8:Backspace, 27:Escape, 10000:盒子返回键
@@ -195,7 +195,7 @@ onMounted(() => {
195
195
 
196
196
  <style scoped>
197
197
  .rootSize {
198
- top: 0px;
198
+ top: 0;
199
199
  }
200
200
 
201
201
  .widgetPos {
@@ -13,7 +13,7 @@ import couponMid from "../assets/coupon_mid.png";
13
13
  import borderLeft from "../assets/line_left.png";
14
14
  import borderMid from "../assets/line_mid.png";
15
15
  import borderRight from "../assets/line_right.png";
16
- import { ref, shallowRef, computed } from "vue";
16
+ import { ref, computed } from "vue";
17
17
 
18
18
  const props = defineProps({
19
19
  data: Object,
@@ -314,29 +314,29 @@ const soldTotalText = computed(() => {
314
314
 
315
315
  <style scoped>
316
316
  .frame-background {
317
- width: 213px;
318
- height: 337px;
319
- border-radius: 10px 10px 10px 10px;
317
+ width: 213;
318
+ height: 337;
319
+ border-radius: 10 10 10 10;
320
320
  background-color: #f7f7f4;
321
321
  transition: transform 0.2s linear;
322
322
  }
323
323
 
324
324
  .poster-holder {
325
- width: 213px;
326
- height: 213px;
327
- border-radius: 10px 10px 0px 0px;
325
+ width: 213;
326
+ height: 213;
327
+ border-radius: 10 10 0 0;
328
328
  background-color: #cfcac6;
329
329
  }
330
330
  .poster {
331
- width: 213px;
332
- height: 213px;
333
- border-radius: 7px 7px 0px 0px;
331
+ width: 213;
332
+ height: 213;
333
+ border-radius: 7 7 0 0;
334
334
  }
335
335
 
336
336
  .title-font {
337
- font-size: 21px;
337
+ font-size: 21;
338
338
  color: #73665c;
339
- line-height: 29px;
339
+ line-height: 29;
340
340
  overflow: hidden;
341
341
  white-space: nowrap;
342
342
  text-overflow: ellipsis;
@@ -345,42 +345,42 @@ const soldTotalText = computed(() => {
345
345
  .title-layout {
346
346
  top: 221;
347
347
  left: 13;
348
- width: 193px;
349
- height: 29px;
348
+ width: 193;
349
+ height: 29;
350
350
  }
351
351
  .ticket-text {
352
352
  height: 24;
353
353
  color: #ffffff;
354
- font-size: 16px;
354
+ font-size: 16;
355
355
  text-align: center;
356
- line-height: 24px;
356
+ line-height: 24;
357
357
  }
358
358
  .sold-text {
359
- height: 25px;
359
+ height: 25;
360
360
  color: #ff7a00;
361
- font-size: 20px;
361
+ font-size: 20;
362
362
  text-align: center;
363
- line-height: 25px;
363
+ line-height: 25;
364
364
  }
365
365
  .prize-title-layout {
366
- width: 35px;
367
- height: 24px;
366
+ width: 35;
367
+ height: 24;
368
368
  top: 296;
369
369
  left: 13;
370
370
  }
371
371
  .prize-title-font {
372
372
  color: #de2825;
373
373
  text-align: center;
374
- font-size: 17px;
375
- line-height: 24px;
374
+ font-size: 17;
375
+ line-height: 24;
376
376
  }
377
377
  .prize-font {
378
378
  top: 289;
379
379
  left: 53;
380
380
  width: 158; /*213 - 55*/
381
- height: 37px;
382
- line-height: 37px;
383
- font-size: 28px;
381
+ height: 37;
382
+ line-height: 37;
383
+ font-size: 28;
384
384
  color: #de2825;
385
385
  }
386
386
  </style>
@@ -1,12 +1,12 @@
1
1
  <!--
2
2
  * @Author: ChenChanghua
3
3
  * @Date: 2021-09-29 16:13:35
4
- * @LastEditors: ChenChanghua
5
- * @LastEditTime: 2022-12-02 16:14:11
4
+ * @LastEditors: Please set LastEditors
5
+ * @LastEditTime: 2023-02-10 11:09:38
6
6
  * @Description: file content
7
7
  -->
8
8
  <script>
9
- import { ref, shallowRef } from "vue";
9
+ import { ref } from "vue";
10
10
 
11
11
  export default {
12
12
  props: {
@@ -99,31 +99,31 @@ export default {
99
99
 
100
100
  <style scoped>
101
101
  .text-normal {
102
- width: 200px;
103
- height: 50px;
104
- line-height: 50px;
102
+ width: 200;
103
+ height: 50;
104
+ line-height: 50;
105
105
  color: #444444;
106
- font-size: 25px;
106
+ font-size: 25;
107
107
  text-align: center;
108
108
  }
109
109
 
110
110
  .text-active {
111
- width: 200px;
112
- height: 50px;
113
- line-height: 50px;
111
+ width: 200;
112
+ height: 50;
113
+ line-height: 50;
114
114
  color: #ffffff;
115
- font-size: 25px;
115
+ font-size: 25;
116
116
  text-align: center;
117
117
  }
118
118
 
119
119
  .item-focused {
120
- width: 200px;
121
- height: 50px;
120
+ width: 200;
121
+ height: 50;
122
122
  background-color: #008080;
123
123
  }
124
124
  .item-normal {
125
- width: 200px;
126
- height: 50px;
125
+ width: 200;
126
+ height: 50;
127
127
  background-color: #87CECB;
128
128
  }
129
129
  </style>
@@ -8,7 +8,7 @@
8
8
  <script setup>
9
9
  import { VERTICAL, MetroWidget } from "jsview";
10
10
  import WidgetItem from "../WidgetItem.vue";
11
- import { ref, shallowRef, watch, onBeforeUnmount } from "vue";
11
+ import { ref, watch, onBeforeUnmount } from "vue";
12
12
 
13
13
  const props = defineProps({
14
14
  data: {
@@ -24,7 +24,7 @@ const props = defineProps({
24
24
  },
25
25
  });
26
26
 
27
- const widgetRef = shallowRef(null);
27
+ const widgetRef = ref(null);
28
28
 
29
29
  const provideData = () => {
30
30
  return props.data.data;
@@ -6,7 +6,7 @@
6
6
  * @Description: file content
7
7
  -->
8
8
  <script setup>
9
- import { ref, shallowRef, inject } from "vue";
9
+ import { ref, inject } from "vue";
10
10
 
11
11
  const props = defineProps({
12
12
  data: Object,
@@ -73,7 +73,7 @@ props.onAction.register("onClick", onClick);
73
73
  :style="{
74
74
  width: data.width,
75
75
  height: data.height,
76
- fontSize: '30px',
76
+ fontSize: 30,
77
77
  color: '#FFFFFF',
78
78
  backgroundColor: data.color,
79
79
  }"