@shijiu/jsview-vue-samples 1.9.887 → 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.
- package/AnimPicture/App.vue +10 -10
- package/Basic/App.vue +1 -1
- package/Basic/components/FontStyle.css +4 -4
- package/Basic/components/anim/AnimKeyframeBasic.vue +1 -1
- package/Basic/components/anim/AnimKeyframeComposite.vue +2 -2
- package/Basic/components/anim/AnimTransition.vue +4 -4
- package/Basic/components/div/DivClip.vue +0 -39
- package/Basic/components/div/DivCssScoped.vue +1 -1
- package/Basic/components/div/DivLayout.vue +1 -1
- package/Basic/components/div/DivRadius.vue +4 -4
- package/Basic/components/img/ImageGroup.vue +2 -2
- package/Basic/components/img/ImgLayout.vue +78 -14
- package/Basic/components/text/TextDirection.vue +9 -9
- package/Basic/components/text/TextEmoji.vue +7 -2
- package/Basic/components/text/TextFontStyle.vue +4 -4
- package/Basic/components/text/TextGroup1.vue +1 -1
- package/Basic/components/text/TextGroup2.vue +2 -2
- package/BasicFocusControl/App.vue +2 -2
- package/BasicFocusControl/components/BaseBlock.vue +2 -2
- package/BasicFocusControl/components/MainArea.vue +2 -2
- package/BasicFocusControl/components/SideBar.vue +2 -2
- package/Collision/App.vue +16 -16
- package/ColorSpace/App.vue +11 -11
- package/CssPreprocessor/App.vue +70 -0
- package/CssPreprocessor/Less/App.vue +32 -0
- package/CssPreprocessor/Less/PanelData.js +51 -0
- package/CssPreprocessor/Less/components/less-group1/LessComments.vue +34 -0
- package/CssPreprocessor/Less/components/less-group1/LessConditionals.vue +32 -0
- package/CssPreprocessor/Less/components/less-group1/LessOperations.vue +24 -0
- package/CssPreprocessor/Less/components/less-group1/LessVariables.vue +48 -0
- package/CssPreprocessor/Less/components/less-group2/LessIteration.vue +32 -0
- package/CssPreprocessor/Less/components/less-group2/LessMethods.vue +27 -0
- package/CssPreprocessor/Less/components/less-group3/LessExtends.vue +32 -0
- package/CssPreprocessor/Less/components/less-group3/LessNesting.vue +63 -0
- package/CssPreprocessor/Less/components/less-group4/LessKeyframes.vue +40 -0
- package/CssPreprocessor/Less/components/less-group4/LessMaps.vue +33 -0
- package/CssPreprocessor/Less/components/less-group4/LessMixins.vue +33 -0
- package/CssPreprocessor/Less/components/less-group5/LessImporting.vue +34 -0
- package/CssPreprocessor/Less/components/less-group5/TextSettings.less +4 -0
- package/CssPreprocessor/Scss/App.vue +32 -0
- package/CssPreprocessor/Scss/PanelData.js +51 -0
- package/CssPreprocessor/Scss/components/scss-group1/ScssComments.vue +34 -0
- package/CssPreprocessor/Scss/components/scss-group1/ScssConditionals.vue +36 -0
- package/CssPreprocessor/Scss/components/scss-group1/ScssOperations.vue +30 -0
- package/CssPreprocessor/Scss/components/scss-group1/ScssVariables.vue +48 -0
- package/CssPreprocessor/Scss/components/scss-group2/ScssIteration.vue +36 -0
- package/CssPreprocessor/Scss/components/scss-group2/ScssMethods.vue +84 -0
- package/CssPreprocessor/Scss/components/scss-group3/ScssExtends.vue +34 -0
- package/CssPreprocessor/Scss/components/scss-group3/ScssNesting.vue +75 -0
- package/CssPreprocessor/Scss/components/scss-group4/ScssKeyframes.vue +40 -0
- package/CssPreprocessor/Scss/components/scss-group4/ScssMaps.vue +35 -0
- package/CssPreprocessor/Scss/components/scss-group4/ScssMixins.vue +33 -0
- package/CssPreprocessor/Scss/components/scss-group5/ScssImporting.vue +34 -0
- package/CssPreprocessor/Scss/components/scss-group5/TextSettings.scss +4 -0
- package/CssPreprocessor/Stylus/App.vue +32 -0
- package/CssPreprocessor/Stylus/PanelData.js +51 -0
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusComments.vue +34 -0
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusConditionals.vue +36 -0
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusOperations.vue +30 -0
- package/CssPreprocessor/Stylus/components/stylus-group1/StylusVariables.vue +47 -0
- package/CssPreprocessor/Stylus/components/stylus-group2/StylusIteration.vue +34 -0
- package/CssPreprocessor/Stylus/components/stylus-group2/StylusMethods.vue +78 -0
- package/CssPreprocessor/Stylus/components/stylus-group3/StylusExtends.vue +34 -0
- package/CssPreprocessor/Stylus/components/stylus-group3/StylusNesting.vue +63 -0
- package/CssPreprocessor/Stylus/components/stylus-group4/StylusKeyframes.vue +40 -0
- package/CssPreprocessor/Stylus/components/stylus-group4/StylusMaps.vue +33 -0
- package/CssPreprocessor/Stylus/components/stylus-group4/StylusMixins.vue +33 -0
- package/CssPreprocessor/Stylus/components/stylus-group5/StylusImporting.vue +34 -0
- package/CssPreprocessor/Stylus/components/stylus-group5/TextSettings.styl +4 -0
- package/CssPreprocessor/utils/ContentBlock.vue +43 -0
- package/CssPreprocessor/utils/ContentList.vue +34 -0
- package/CssPreprocessor/utils/FontStyle.css +19 -0
- package/CssPreprocessor/utils/Panel.vue +49 -0
- package/CssPreprocessor/utils/TitleBar.vue +29 -0
- package/DemoHomepage/App.vue +46 -11
- package/DemoHomepage/components/Dialog.vue +15 -15
- package/DemoHomepage/router.js +20 -12
- package/DemoHomepage/views/Homepage.vue +90 -102
- package/DivMetroPerformance/App.vue +150 -0
- package/DivMetroPerformance/Item.vue +58 -0
- package/DivMetroPerformance/assets/bg.jpg +0 -0
- package/DivMetroPerformance/assets/coupon_content.png +0 -0
- package/DivMetroPerformance/assets/coupon_left.png +0 -0
- package/DivMetroPerformance/assets/coupon_mid.png +0 -0
- package/DivMetroPerformance/assets/coupon_right.png +0 -0
- package/DivMetroPerformance/assets/focus_border.png +0 -0
- package/DivMetroPerformance/assets/holder_logo.png +0 -0
- package/DivMetroPerformance/assets/jrbm.png +0 -0
- package/DivMetroPerformance/assets/line_left.png +0 -0
- package/DivMetroPerformance/assets/line_mid.png +0 -0
- package/DivMetroPerformance/assets/line_right.png +0 -0
- package/DivMetroPerformance/assets/loading.png +0 -0
- package/DivMetroPerformance/assets/logo.png +0 -0
- package/DivMetroPerformance/assets/mcjx.png +0 -0
- package/DivMetroPerformance/assets/tao.png +0 -0
- package/DivMetroPerformance/assets/tmall.png +0 -0
- package/DivMetroPerformance/border.png +0 -0
- package/DivMetroPerformance/components/ContentItem.vue +385 -0
- package/DivMetroPerformance/components/MyTab.vue +129 -0
- package/DivMetroPerformance/data.js +124 -0
- package/DivMetroPerformance/utils/GridItem.vue +28 -0
- package/DivMetroPerformance/utils/GridPlate.vue +85 -0
- package/FilterDemo/AnimatePic.vue +3 -3
- package/FilterDemo/App.vue +3 -3
- package/FlipCard/App.vue +2 -2
- package/FlipCard/FlipCard.vue +2 -2
- package/GridDemo/Item.vue +13 -13
- package/HashHistory/App.vue +0 -1
- package/HashHistory/components/Item.vue +2 -2
- package/HashHistory/views/MainPage.vue +1 -1
- package/HashHistory/views/SubPage.vue +2 -2
- package/ImpactStop/App.vue +9 -11
- package/Input/InputPanel.vue +2 -4
- package/LongImage/App.vue +2 -2
- package/LongImage/Button.vue +1 -1
- package/LongImage/ButtonItem.vue +1 -1
- package/LongText/App.vue +3 -3
- package/LongText/Button.vue +1 -1
- package/LongText/ButtonItem.vue +1 -1
- package/LongText/LongTextScroll.vue +4 -4
- package/Marquee/longText.js +0 -2
- package/MaskClip/App.vue +4 -4
- package/MediaDemo/App.vue +127 -0
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +69 -0
- package/MediaDemo/components/Controllor.vue +279 -0
- package/MediaDemo/components/StatusBar.vue +100 -0
- package/MediaDemo/components/frames/AudioFrame.vue +39 -0
- package/MediaDemo/components/frames/AudioPoster.vue +48 -0
- package/MediaDemo/components/frames/MediaFrame.vue +153 -0
- package/MediaDemo/components/frames/VideoFrame.vue +39 -0
- package/MetroWidgetDemos/Advanced/ButtonItem.vue +4 -4
- package/MetroWidgetDemos/Advanced/widgets/Item.vue +5 -5
- package/MetroWidgetDemos/Advanced/widgets/WidgetItem.vue +2 -2
- package/MetroWidgetDemos/Advanced/widgets/Widgets.vue +57 -56
- package/MetroWidgetDemos/Item.vue +4 -5
- package/MetroWidgetDemos/PerformanceTest/App.vue +3 -3
- package/MetroWidgetDemos/PerformanceTest/components/ContentItem.vue +26 -26
- package/MetroWidgetDemos/PerformanceTest/components/MyTab.vue +15 -15
- package/MetroWidgetDemos/PingPong/AppPage.vue +2 -2
- package/MetroWidgetDemos/PingPong/TabItem.vue +2 -2
- package/MetroWidgetDemos/PingPong/ViewSwiper.vue +9 -9
- package/MetroWidgetDemos/Simple/RelativeTemplate.vue +2 -2
- package/MetroWidgetDemos/WidgetItem.vue +2 -2
- package/NinePatchDemo/App.vue +3 -3
- package/NinePatchDemo/Item.vue +5 -5
- package/Preload/App.vue +5 -5
- package/Preload/Item.vue +1 -1
- package/QrcodeDemo/App.vue +3 -3
- package/ScaleDownNeon/App.vue +9 -9
- package/SoundPool/App.vue +6 -9
- package/SprayView/App.vue +22 -22
- package/SpriteImage/App.vue +4 -4
- package/Swiper/App.vue +2 -8
- package/TextBox/App.vue +1 -2
- package/TextBox/RenderCenter.vue +16 -16
- package/TextBox/RenderLeft.vue +16 -16
- package/TextBox/RenderOneLine.vue +12 -12
- package/TextBox/RenderRight.vue +16 -16
- package/TextShadowDemo/App.vue +4 -4
- package/TextureAnimation/App.vue +1 -17
- package/TextureAnimation/App2.vue +3 -3
- package/TextureSize/App.vue +8 -8
- package/ThrowMoveDemo/AccelerateDemo.vue +4 -4
- package/ThrowMoveDemo/LRParabolicDemo.vue +4 -4
- package/ThrowMoveDemo/TargetDemo.vue +4 -4
- package/ThrowMoveDemo/UDParabolicDemo.vue +4 -4
- package/TouchSample/App.vue +2 -2
- package/TouchSample/Item.vue +2 -2
- package/TouchSample/MetroWidgetHorizontal.vue +3 -3
- package/TouchSample/MetroWidgetVertical.vue +3 -3
- package/TouchSample/TouchContainerHorizontal.vue +2 -2
- package/TouchSample/TouchContainerVertical.vue +2 -2
- package/TransitPage/App.vue +1 -1
- package/VideoDemo/App.vue +4 -4
- package/VideoDemo/components/Button.vue +1 -1
- package/VideoDemo/components/Controllor.vue +2 -2
- package/VideoDemo/components/VideoFrame.vue +1 -1
- package/VisibleSensorDemo/App.vue +7 -7
- package/assets/bmpDemo.bmp +0 -0
- package/assets/jpegDemo.jpeg +0 -0
- package/assets/pngDemo.png +0 -0
- package/assets/pngNoAlphaDemo.png +0 -0
- package/assets/webpDemo.webp +0 -0
- 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:
|
|
5
|
-
* @LastEditTime:
|
|
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
|
|
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 =
|
|
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-
|
|
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,
|
|
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 =
|
|
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:
|
|
73
|
+
fontSize: 30,
|
|
74
74
|
color: '#FFFFFF',
|
|
75
75
|
backgroundColor: data.color,
|
|
76
|
-
borderRadius:
|
|
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
|
|
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 =
|
|
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:
|
|
5
|
-
* @LastEditTime:
|
|
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,
|
|
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
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
* @
|
|
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,
|
|
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 =
|
|
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:
|
|
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,
|
|
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 =
|
|
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:
|
|
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,
|
|
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:
|
|
318
|
-
height:
|
|
319
|
-
border-radius:
|
|
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:
|
|
326
|
-
height:
|
|
327
|
-
border-radius:
|
|
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:
|
|
332
|
-
height:
|
|
333
|
-
border-radius:
|
|
331
|
+
width: 213;
|
|
332
|
+
height: 213;
|
|
333
|
+
border-radius: 7 7 0 0;
|
|
334
334
|
}
|
|
335
335
|
|
|
336
336
|
.title-font {
|
|
337
|
-
font-size:
|
|
337
|
+
font-size: 21;
|
|
338
338
|
color: #73665c;
|
|
339
|
-
line-height:
|
|
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:
|
|
349
|
-
height:
|
|
348
|
+
width: 193;
|
|
349
|
+
height: 29;
|
|
350
350
|
}
|
|
351
351
|
.ticket-text {
|
|
352
352
|
height: 24;
|
|
353
353
|
color: #ffffff;
|
|
354
|
-
font-size:
|
|
354
|
+
font-size: 16;
|
|
355
355
|
text-align: center;
|
|
356
|
-
line-height:
|
|
356
|
+
line-height: 24;
|
|
357
357
|
}
|
|
358
358
|
.sold-text {
|
|
359
|
-
height:
|
|
359
|
+
height: 25;
|
|
360
360
|
color: #ff7a00;
|
|
361
|
-
font-size:
|
|
361
|
+
font-size: 20;
|
|
362
362
|
text-align: center;
|
|
363
|
-
line-height:
|
|
363
|
+
line-height: 25;
|
|
364
364
|
}
|
|
365
365
|
.prize-title-layout {
|
|
366
|
-
width:
|
|
367
|
-
height:
|
|
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:
|
|
375
|
-
line-height:
|
|
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:
|
|
382
|
-
line-height:
|
|
383
|
-
font-size:
|
|
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:
|
|
5
|
-
* @LastEditTime:
|
|
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
|
|
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:
|
|
103
|
-
height:
|
|
104
|
-
line-height:
|
|
102
|
+
width: 200;
|
|
103
|
+
height: 50;
|
|
104
|
+
line-height: 50;
|
|
105
105
|
color: #444444;
|
|
106
|
-
font-size:
|
|
106
|
+
font-size: 25;
|
|
107
107
|
text-align: center;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
.text-active {
|
|
111
|
-
width:
|
|
112
|
-
height:
|
|
113
|
-
line-height:
|
|
111
|
+
width: 200;
|
|
112
|
+
height: 50;
|
|
113
|
+
line-height: 50;
|
|
114
114
|
color: #ffffff;
|
|
115
|
-
font-size:
|
|
115
|
+
font-size: 25;
|
|
116
116
|
text-align: center;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
.item-focused {
|
|
120
|
-
width:
|
|
121
|
-
height:
|
|
120
|
+
width: 200;
|
|
121
|
+
height: 50;
|
|
122
122
|
background-color: #008080;
|
|
123
123
|
}
|
|
124
124
|
.item-normal {
|
|
125
|
-
width:
|
|
126
|
-
height:
|
|
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,
|
|
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 =
|
|
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,
|
|
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:
|
|
76
|
+
fontSize: 30,
|
|
77
77
|
color: '#FFFFFF',
|
|
78
78
|
backgroundColor: data.color,
|
|
79
79
|
}"
|