@shijiu/jsview-vue-samples 2.3.0 → 2.3.728-alpha.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/ABImageAlt/App.vue +114 -0
- package/ABImageAlt/Item.vue +133 -0
- package/{MetroWidgetDemos/SkeletonDiagram/assets/imageList.json → ABImageAlt/assets/imageList.js} +9 -1
- package/ABImageAlt/data.js +17 -0
- package/AI_Check_Rules.txt +5 -0
- package/AnimPicture/App.vue +20 -10
- package/ApicSwitch/App.vue +90 -0
- package/ApicSwitch/TabItem.vue +65 -0
- package/ApicSwitch/WebpShow.vue +24 -0
- package/ApicSwitch/data.js +50 -0
- package/Basic/AI_skills_update.md +1 -0
- package/Basic/components/div/ColorFormatTest.vue +93 -0
- package/Basic/components/div/DivRadius.vue +97 -15
- package/Basic/components/div/DivTag3Group.vue +30 -0
- package/Basic/components/img/ImageType.vue +65 -0
- package/Basic/components/panel/Panel2.vue +13 -1
- package/Basic/components/text/TextAlign.vue +7 -1
- package/BlobLoadTest/App.vue +201 -0
- package/BreakLinesApi/App.vue +82 -0
- package/CanvasDrawChart/App.vue +11 -0
- package/CanvasDrawChart/Graph1.vue +104 -0
- package/CanvasDrawChart/Graph2.vue +115 -0
- package/DashPath/App.vue +17 -16
- package/DashPath/AppForOperator.vue +2 -4
- package/DemoForOperator/AnimPic/AnimPic.vue +24 -2
- package/DemoForOperator/Banger/Banger/Banger.vue +73 -9
- package/DemoForOperator/Blur/Blur.vue +146 -0
- package/DemoForOperator/Blur/BlurInOut/BlurInOut.vue +184 -0
- package/DemoForOperator/Blur/BlurInOut/StaticBgSlide.vue +162 -0
- package/DemoForOperator/Blur/BlurPopup/BlurPopup.vue +249 -0
- package/DemoForOperator/BookFlip/App.vue +115 -0
- package/DemoForOperator/BookFlip/BookPage.vue +82 -0
- package/DemoForOperator/Bounce/Bounce.vue +33 -1
- package/DemoForOperator/Bounce/FreeMoveBuilder.js +1 -1
- package/DemoForOperator/ChunLian/Couplets.vue +44 -1
- package/DemoForOperator/ClickSpriteAnim/App.vue +130 -0
- package/DemoForOperator/ClickSpriteAnim/Item.vue +74 -0
- package/DemoForOperator/DominantColor/App.vue +187 -0
- package/DemoForOperator/EpisodeList/EpisodeList/Controller.vue +0 -3
- package/DemoForOperator/EpisodeList/EpisodeList/EpisodeList.vue +76 -2
- package/DemoForOperator/Firework1/App.vue +13 -2
- package/DemoForOperator/Firework1/Fireworks.vue +68 -11
- package/DemoForOperator/FlipPage/FlipPage/FlipPage.vue +30 -1
- package/DemoForOperator/Focus/Alpha/AlphaFocusBox.vue +27 -2
- package/DemoForOperator/Focus/Alpha/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/Item.vue +1 -0
- package/DemoForOperator/Focus/Light/LightFocusBox.vue +42 -1
- package/DemoForOperator/Focus/Normal/Item.vue +1 -0
- package/DemoForOperator/Focus/Normal/NormalFocusBox.vue +12 -0
- package/DemoForOperator/FrameShadow/App.vue +193 -0
- package/DemoForOperator/FrameShadow/FrameShadow.vue +61 -0
- package/DemoForOperator/FullscreenIn/App.vue +1 -1
- package/DemoForOperator/FullscreenIn/FullscreenPoster.vue +18 -3
- package/DemoForOperator/Genie/App.vue +20 -6
- package/DemoForOperator/Genie/App2.vue +61 -0
- package/DemoForOperator/Genie/geniePakcer/GenieImage.vue +298 -0
- package/DemoForOperator/Genie/geniePakcer/GenieSlot.vue +292 -0
- package/DemoForOperator/Genie/geniePakcer/GenieTools.ts +463 -0
- package/DemoForOperator/GrayFilter/GrayFilter.vue +21 -0
- package/DemoForOperator/Jigsaw/JigsawFull.vue +58 -11
- package/DemoForOperator/Jigsaw/JigsawSingle.vue +47 -9
- package/DemoForOperator/LongChatBox/App.vue +36 -0
- package/DemoForOperator/LongChatBox/Bubble.vue +116 -0
- package/DemoForOperator/LongChatBox/LongChat.vue +204 -0
- package/DemoForOperator/LongChatBox/testData.js +14 -0
- package/DemoForOperator/Particle/Drop/DropParticle.vue +33 -1
- package/DemoForOperator/Particle/Explode/ExplodeParticle.vue +23 -2
- package/DemoForOperator/PosterAnim/PosterAnim.js +21 -0
- package/DemoForOperator/PosterOverflow/PosterOverflow.vue +16 -0
- package/DemoForOperator/Resize/App.vue +157 -0
- package/DemoForOperator/Resize/Resize/Item.vue +234 -0
- package/DemoForOperator/Resize/Resize/Resize.vue +96 -0
- package/DemoForOperator/Ripple/Ripple.vue +16 -1
- package/DemoForOperator/ScreenShootScale/App.vue +96 -0
- package/DemoForOperator/ScreenShootScale/Back.vue +86 -0
- package/DemoForOperator/ScreenShootScale/Front.vue +133 -0
- package/DemoForOperator/ScreenShootScale/Item.vue +62 -0
- package/DemoForOperator/ScreenShootScale/ScreenShootScale.vue +109 -0
- package/DemoForOperator/SmoothSwiper/App.vue +50 -0
- package/DemoForOperator/Sound/Bounce/App.vue +56 -0
- package/DemoForOperator/Sound/Bounce/Bounce.vue +87 -0
- package/DemoForOperator/Sound/Bounce/FreeMoveBuilder.js +146 -0
- package/DemoForOperator/Sound/Bounce/bgmusic.mp3 +0 -0
- package/DemoForOperator/Sound/Bounce/coin.mp3 +0 -0
- package/DemoForOperator/Sound/FocusMove/App.vue +134 -0
- package/DemoForOperator/Sound/FocusMove/Item.vue +43 -0
- package/DemoForOperator/Sound/FocusMove/move.mp3 +0 -0
- package/DemoForOperator/Sound/Rain/App.vue +11 -0
- package/DemoForOperator/Sound/Rain/Raining/Rain.vue +69 -0
- package/DemoForOperator/Sound/Rain/Raining/RainScene.vue +118 -0
- package/DemoForOperator/Sound/Sound/Sound.vue +24 -0
- package/DemoForOperator/Sound/Sound/index.js +4 -0
- package/DemoForOperator/Sound/Sound/useSound.js +112 -0
- package/DemoForOperator/Sprite/Sprite.vue +62 -5
- package/DemoForOperator/Stretch/Stretch/Stretch.vue +52 -2
- package/DemoForOperator/Swiper/App.vue +101 -0
- package/DemoForOperator/Swiper/Item.vue +56 -0
- package/DemoForOperator/Swiper/ParallaxSlide.vue +164 -0
- package/DemoForOperator/TabContent/TabContent/TabContent.vue +39 -1
- package/DemoForOperator/TabContentVertical/App.vue +104 -0
- package/DemoForOperator/TabContentVertical/ContentPage.vue +67 -0
- package/DemoForOperator/TabContentVertical/Item.vue +94 -0
- package/DemoForOperator/TabContentVertical/PageItem.vue +40 -0
- package/DemoForOperator/TabContentVertical/TabContent/CreepFocus.vue +160 -0
- package/DemoForOperator/TabContentVertical/TabContent/Item.vue +63 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabContent.vue +184 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabItem.vue +368 -0
- package/DemoForOperator/TabContentVertical/TabContent/TabWidget.vue +259 -0
- package/DemoForOperator/TabContentVertical/TabContent/Util.js +3 -0
- package/DemoForOperator/TabContentVertical/TabContent/ViewSwiper.vue +110 -0
- package/DemoForOperator/TabContentVertical/assets/children_science.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/documentary.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/free.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/game.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/home_selected.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/movie_ticket.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/my_account.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/opera.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/sports.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/tv_drama.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/variety_show.png +0 -0
- package/DemoForOperator/TabContentVertical/assets/vip.png +0 -0
- package/DemoForOperator/TabContentVertical/testData.js +76 -0
- package/DemoForOperator/Vortex/Vortex/Vortex.vue +26 -0
- package/DemoForOperator/routeList.js +125 -2
- package/DemoHomepage/App.vue +74 -1
- package/DemoHomepage/components/BodyFrame.vue +5 -0
- package/DemoHomepage/components/Item.vue +11 -0
- package/DemoHomepage/components/TabFrame.vue +1 -1
- package/DemoHomepage/router.js +798 -140
- package/DemoHomepage/views/Homepage.vue +60 -2
- package/DemoHomepage/watchTest.vue +50 -0
- package/DomRenderer/App.vue +133 -0
- package/FilterDemo/AnimatePic.vue +63 -17
- package/FilterDemo/App.vue +3 -3
- package/FlexCellDemo/AI_skills_update.md +4 -0
- package/FlexCellDemo/TestFrame1.vue +12 -2
- package/FlexCellDemo/TestFrame2.vue +10 -1
- package/FlexCellDemo/TestFrame3.vue +114 -59
- package/FpsLimit/App.vue +102 -0
- package/FreeMove/App.vue +24 -279
- package/FreeMove/TestScene1.vue +260 -0
- package/FreeMove/TestScene3.vue +431 -0
- package/FreeMoveChildAttract/App.vue +18 -8
- package/FreeMoveLink/App.vue +51 -22
- package/GiftRain/components/SpriteTranslate.vue +68 -48
- package/HashHistory/App.vue +2 -2
- package/HashHistory/router.js +1 -1
- package/Hover/App.vue +144 -0
- package/HttpRequestSSE/SSEReader.js +200 -0
- package/ImpactStop/App.vue +2 -2
- package/Input/FullKeyboard.vue +3 -3
- package/Input/InputPanel.vue +63 -3
- package/JsvLine/App.vue +53 -38
- package/LatexDemo/App.vue +3 -1
- package/LatexFormula/App.vue +196 -0
- package/LongImage/App.vue +1 -1
- package/LongImage/LongImageScroll.vue +111 -46
- package/LongImage/Scroll.vue +28 -9
- package/LongText/LongTextScroll.vue +14 -1
- package/Markdown/App.vue +36 -0
- package/Markdown/Bubble.vue +109 -0
- package/Markdown/LongChat.vue +216 -0
- package/Markdown/data.js +633 -0
- package/MetroWidgetDemos/AI_skills_update.md +2 -0
- package/MetroWidgetDemos/EpgFlowListType/App.vue +206 -0
- package/MetroWidgetDemos/EpgFlowListType/components/ContentCard.vue +105 -0
- package/MetroWidgetDemos/EpgFlowListType/components/FloorSection.vue +131 -0
- package/MetroWidgetDemos/EpgFlowListType/components/LeftTabItem.vue +41 -0
- package/MetroWidgetDemos/EpgFlowListType/data.js +78 -0
- package/MetroWidgetDemos/ListExpand/ChildItem.vue +130 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem.vue +375 -0
- package/MetroWidgetDemos/ListExpand/ExpandItem1.vue +403 -0
- package/MetroWidgetDemos/ListExpand/assets/arrow-down.png +0 -0
- package/MetroWidgetDemos/ListExpand/assets/up-arrow.png +0 -0
- package/MetroWidgetDemos/ListExpand/components/WidgetListHandler.vue +150 -0
- package/MetroWidgetDemos/ListExpand/index.vue +88 -0
- package/MetroWidgetDemos/ListExpand/list.js +2421 -0
- package/MetroWidgetDemos/RefreshDemo/App.vue +14 -1
- package/MetroWidgetDemos/RenderAccelerate/App.vue +142 -0
- package/MetroWidgetDemos/RenderAccelerate/AppPage.vue +78 -0
- package/MetroWidgetDemos/RenderAccelerate/AppTab.vue +62 -0
- package/MetroWidgetDemos/RenderAccelerate/ContentItem.vue +409 -0
- package/MetroWidgetDemos/{TripleWidget → RenderAccelerate}/Item.vue +6 -3
- package/MetroWidgetDemos/RenderAccelerate/TabItem.vue +100 -0
- package/MetroWidgetDemos/RenderAccelerate/ViewSwiper.vue +215 -0
- package/MetroWidgetDemos/RenderAccelerate/WidgetItem.vue +107 -0
- package/MetroWidgetDemos/SkeletonDiagram/App.vue +35 -8
- package/MetroWidgetDemos/SkeletonDiagram/Item.vue +11 -2
- package/MetroWidgetDemos/SkeletonDiagram/assets/imageList.js +245 -0
- package/MetroWidgetDemos/SkeletonDiagram/data.js +3 -3
- package/MetroWidgetDemos/SpatialNav/App.vue +177 -0
- package/MetroWidgetDemos/SpatialNav/Buttons.vue +83 -0
- package/MetroWidgetDemos/SpatialNav/CustomFocus.vue +57 -0
- package/MetroWidgetDemos/SpatialNav/Item.vue +71 -0
- package/MetroWidgetDemos/SpatialNav/SimpleFloor.vue +86 -0
- package/MetroWidgetDemos/SpatialNav/StepMw.vue +113 -0
- package/MetroWidgetDemos/SpatialNav/TabContent/TabContent.vue +185 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/TripleSection.vue +69 -0
- package/MetroWidgetDemos/SpatialNav/TripleSection/WidgetItem.vue +100 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/List.vue +75 -0
- package/MetroWidgetDemos/SpatialNav/TvSection/TvSection.vue +91 -0
- package/MetroWidgetDemos/basic2/App.vue +407 -0
- package/MetroWidgetDemos/basic2/Item.vue +68 -0
- package/MetroWidgetDemos/direction/App.vue +22 -0
- package/MetroWidgetDemos/gazeFocusDiff/App.vue +126 -0
- package/MetroWidgetDemos/gazeFocusDiff/Item.vue +87 -0
- package/MetroWidgetDemos/minimalUsage/App.vue +66 -0
- package/MetroWidgetDemos/minimalUsage/Item.vue +54 -0
- package/MetroWidgetDemos/ninePatchFocusPage/App.vue +23 -7
- package/MetroWidgetDemos/ninePatchFocusPage/Item.vue +7 -5
- package/MetroWidgetDemos/ninePatchFocusPage/focusConstants.js +2 -0
- package/MetroWidgetDemos/routeList.js +229 -8
- package/MetroWidgetDemos/slideSetting/App.vue +288 -99
- package/MetroWidgetDemos/zIndex/App.vue +117 -0
- package/MetroWidgetDemos/zIndex/Item.vue +61 -0
- package/NinePatchTester/App.vue +24 -31
- package/PosterPacker/App.vue +2 -2
- package/PreDecode/App.vue +140 -0
- package/ReactiveTest/App.vue +115 -0
- package/ReactiveTest/Item.vue +92 -0
- package/ReactiveTest/assets/imageList.js +245 -0
- package/ReactiveTest/component/TestSmartDiv.vue +50 -0
- package/ReactiveTest/component/TestSmartDivSrcList.vue +74 -0
- package/ReactiveTest/component/TestSmartImage.vue +46 -0
- package/ReactiveTest/component/TestSmartImageSrcList.vue +90 -0
- package/ReactiveTest/component/TestSmartImageStyle.vue +41 -0
- package/ReactiveTest/data.js +49 -0
- package/ScreenToBlob/App.vue +250 -0
- package/ScrollBoxTest/App.vue +52 -28
- package/ScrollBoxTest/ClipBar.vue +64 -2
- package/ScrollBoxTest/NinePatchBar.vue +64 -2
- package/ScrollBoxTest/SizeDivBar.vue +64 -2
- package/SecTorTest/App.vue +9 -3
- package/SpringFestival/SpringFestivalScene/FreeMoveBuilder.js +3 -3
- package/SyncDecode/App.vue +137 -0
- package/TextSizeLimit/App.vue +211 -0
- package/TextureAnimation/App3.vue +11 -1
- package/TouchWidget/App.vue +90 -5
- package/TouchWidget/WidgetItem.vue +1 -0
- package/TransitPage/App.vue +2 -0
- package/ViewOpacity/App.vue +19 -0
- package/assets/logo.png +0 -0
- package/package.json +1 -1
- package/DashPath/DashPath.vue +0 -118
- package/DemoForOperator/Genie/geniePakcer/Genie.vue +0 -699
- package/DemoForOperator/ScalePoster/App.vue +0 -4
- package/DemoForOperator/ScalePoster/ScalePoster.vue +0 -0
- package/DivMetroPerformance/App.vue +0 -157
- package/DivMetroPerformance/Item.vue +0 -58
- 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 +0 -384
- package/DivMetroPerformance/components/MyTab.vue +0 -129
- package/DivMetroPerformance/data.js +0 -124
- package/DivMetroPerformance/utils/GridItem.vue +0 -28
- package/DivMetroPerformance/utils/GridPlate.vue +0 -85
- package/MediaDemo/App.vue +0 -127
- package/MediaDemo/assets/audio-poster.png +0 -0
- package/MediaDemo/components/Button.vue +0 -69
- package/MediaDemo/components/Controllor.vue +0 -286
- package/MediaDemo/components/StatusBar.vue +0 -100
- package/MediaDemo/components/frames/AudioFrame.vue +0 -39
- package/MediaDemo/components/frames/AudioPoster.vue +0 -48
- package/MediaDemo/components/frames/MediaFrame.vue +0 -153
- package/MediaDemo/components/frames/VideoFrame.vue +0 -39
- package/MetroWidgetDemos/TripleWidget/App.vue +0 -81
- package/MetroWidgetDemos/TripleWidget/SWidgetItem.vue +0 -93
- package/MetroWidgetDemos/TripleWidget/WidgetItem.vue +0 -111
- package/Parkour/App.vue +0 -13
- package/Parkour/Common/Context.js +0 -21
- package/Parkour/Common/MatchmanInfo.js +0 -62
- package/Parkour/Common/Random.js +0 -61
- package/Parkour/Common/Sound.js +0 -50
- package/Parkour/appConfig/HOW_TO_CONFIG.md +0 -20
- package/Parkour/appConfig/app.config.mjs +0 -5
- package/Parkour/appConfig/app_sign_private_key_sample.crt +0 -28
- package/Parkour/appConfig/app_sign_public_key_sample.pem +0 -9
- package/Parkour/appConfig/jsview.config.mjs +0 -39
- package/Parkour/assets/Bgimages/bg1.png +0 -0
- package/Parkour/assets/Bgimages/bg2.png +0 -0
- package/Parkour/assets/Bgimages/bg3.png +0 -0
- package/Parkour/assets/Bgimages/bg4.png +0 -0
- package/Parkour/assets/Bgimages/bg5.png +0 -0
- package/Parkour/assets/audio/jump.mp3 +0 -0
- package/Parkour/assets/audio/lose.mp3 +0 -0
- package/Parkour/assets/role_skin1/fail.json +0 -44
- package/Parkour/assets/role_skin1/fail.png +0 -0
- package/Parkour/assets/role_skin1/jump_down.json +0 -20
- package/Parkour/assets/role_skin1/jump_down.png +0 -0
- package/Parkour/assets/role_skin1/jump_up.json +0 -44
- package/Parkour/assets/role_skin1/jump_up.png +0 -0
- package/Parkour/assets/role_skin1/roll.json +0 -44
- package/Parkour/assets/role_skin1/roll.png +0 -0
- package/Parkour/assets/role_skin1/run.json +0 -52
- package/Parkour/assets/role_skin1/run.png +0 -0
- package/Parkour/components/Backdrop.vue +0 -61
- package/Parkour/components/GameSence.vue +0 -602
- package/Parkour/components/Matchman.vue +0 -85
- package/TextureAnimation/utils/FrameCanvasStore.ts +0 -68
- package/TextureAnimation/utils/RotateFrame.vue +0 -146
- package/TextureAnimation/utils/circleHaloMask.png +0 -0
- package/ThrowMoveDemo/AccelerateDemo.vue +0 -85
- package/ThrowMoveDemo/App.vue +0 -104
- package/ThrowMoveDemo/LRParabolicDemo.vue +0 -101
- package/ThrowMoveDemo/TargetDemo.vue +0 -87
- package/ThrowMoveDemo/UDParabolicDemo.vue +0 -92
- /package/{AnimPicture/assets → assets}/animated_webp.webp +0 -0
- /package/{AnimPicture/assets → assets}/ball_3.webp +0 -0
- /package/{AnimPicture/assets → assets}/girl_run.gif +0 -0
- /package/{AnimPicture/assets → assets}/quan.webp +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<jsv-preload
|
|
3
|
+
v-if="needPreload"
|
|
4
|
+
key="preload"
|
|
5
|
+
:preloadList="[preloadInfo]"
|
|
6
|
+
:onPreloadDone="handlePreloadDone"
|
|
7
|
+
></jsv-preload>
|
|
8
|
+
<div
|
|
9
|
+
:style="{
|
|
10
|
+
width: props.width,
|
|
11
|
+
height: props.height,
|
|
12
|
+
left: curPosition.left,
|
|
13
|
+
top: curPosition.top,
|
|
14
|
+
transition: `left ${props.duration}ms, top ${props.duration}ms`,
|
|
15
|
+
}"
|
|
16
|
+
>
|
|
17
|
+
<jsv-texture-anim
|
|
18
|
+
v-if="isPreloadDone"
|
|
19
|
+
ref="pandaAnim"
|
|
20
|
+
:src="props.imgUrl"
|
|
21
|
+
:width="props.width"
|
|
22
|
+
:height="props.height"
|
|
23
|
+
:animation="appliedAnim"
|
|
24
|
+
:duration="props.duration"
|
|
25
|
+
:transform="appliedTrans"
|
|
26
|
+
:borderRadius="props.borderRadius"
|
|
27
|
+
:autoStart="false"
|
|
28
|
+
:onAnimationEnd="onAnimEnd"
|
|
29
|
+
></jsv-texture-anim>
|
|
30
|
+
<slot></slot>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
33
|
+
|
|
34
|
+
<script setup>
|
|
35
|
+
import { ref, shallowRef, computed, reactive } from "vue";
|
|
36
|
+
import { JsvPreload, buildPreloadInfo } from "jsview";
|
|
37
|
+
import { JsvTextureAnim } from "jsview";
|
|
38
|
+
|
|
39
|
+
const props = defineProps({
|
|
40
|
+
imgUrl: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true,
|
|
43
|
+
},
|
|
44
|
+
width: {
|
|
45
|
+
type: Number,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
height: {
|
|
49
|
+
type: Number,
|
|
50
|
+
required: true,
|
|
51
|
+
},
|
|
52
|
+
bgWidth: {
|
|
53
|
+
type: Number,
|
|
54
|
+
required: true,
|
|
55
|
+
},
|
|
56
|
+
bgHeight: {
|
|
57
|
+
type: Number,
|
|
58
|
+
required: true,
|
|
59
|
+
},
|
|
60
|
+
duration: {
|
|
61
|
+
type: Number,
|
|
62
|
+
default: 200,
|
|
63
|
+
},
|
|
64
|
+
easing: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "linear",
|
|
67
|
+
},
|
|
68
|
+
borderRadius: {
|
|
69
|
+
type: [Number, String],
|
|
70
|
+
default: 0,
|
|
71
|
+
},
|
|
72
|
+
initPosition: {
|
|
73
|
+
type: Object,
|
|
74
|
+
default: () => ({
|
|
75
|
+
left: 0,
|
|
76
|
+
top: 0,
|
|
77
|
+
}),
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const needPreload = ref(false);
|
|
82
|
+
const isPreloadDone = ref(false);
|
|
83
|
+
let preloadInfo = [];
|
|
84
|
+
if (props.imgUrl.includes("jsvtexturestore://")) {
|
|
85
|
+
needPreload.value = false;
|
|
86
|
+
isPreloadDone.value = true;
|
|
87
|
+
} else {
|
|
88
|
+
needPreload.value = true;
|
|
89
|
+
isPreloadDone.value = false;
|
|
90
|
+
preloadInfo = buildPreloadInfo(props.imgUrl);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const pandaAnim = shallowRef(null);
|
|
94
|
+
//view相对于bg的偏移量
|
|
95
|
+
const curPosition = reactive(props.initPosition);
|
|
96
|
+
|
|
97
|
+
const baseScale = computed(
|
|
98
|
+
() =>
|
|
99
|
+
`scale3d(${props.bgWidth / props.width}, ${
|
|
100
|
+
props.bgHeight / props.height
|
|
101
|
+
}, 1)`
|
|
102
|
+
);
|
|
103
|
+
|
|
104
|
+
const scaleOffset = {
|
|
105
|
+
left: (props.width - props.bgWidth) / 2,
|
|
106
|
+
top: (props.height - props.bgHeight) / 2,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const getTargetTransform = (target) => {
|
|
110
|
+
return `translate3d(${
|
|
111
|
+
((-target.left - scaleOffset.left) / props.width) * 100
|
|
112
|
+
}%, ${((-target.top - scaleOffset.top) / props.height) * 100}%, 0) ${
|
|
113
|
+
baseScale.value
|
|
114
|
+
}`;
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const appliedTrans = ref(getTargetTransform(curPosition));
|
|
118
|
+
const appliedAnim = ref(null);
|
|
119
|
+
|
|
120
|
+
//TODO JsvPreload 的回调会执行多次,所以需要一个标志来判断是否已经执行过
|
|
121
|
+
let loadDone = false;
|
|
122
|
+
|
|
123
|
+
const handlePreloadDone = (resultMap) => {
|
|
124
|
+
if (loadDone) return;
|
|
125
|
+
loadDone = true;
|
|
126
|
+
appliedTrans.value = getTargetTransform(curPosition);
|
|
127
|
+
isPreloadDone.value = true;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
let onAnimEnd = (normalEnd) => {
|
|
131
|
+
if (normalEnd) {
|
|
132
|
+
appliedTrans.value = getTargetTransform(curPosition);
|
|
133
|
+
}
|
|
134
|
+
appliedAnim.value = null;
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
function slide(to) {
|
|
138
|
+
const prePosition = {
|
|
139
|
+
left: curPosition.left,
|
|
140
|
+
top: curPosition.top,
|
|
141
|
+
};
|
|
142
|
+
curPosition.left = to.left ?? prePosition.left;
|
|
143
|
+
curPosition.top = to.top ?? prePosition.top;
|
|
144
|
+
|
|
145
|
+
if (
|
|
146
|
+
prePosition.left === curPosition.left &&
|
|
147
|
+
prePosition.top === curPosition.top
|
|
148
|
+
) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
appliedTrans.value = null;
|
|
153
|
+
appliedAnim.value = `{from {transform: ${getTargetTransform(
|
|
154
|
+
prePosition
|
|
155
|
+
)};} to {transform: ${getTargetTransform(curPosition)};}}`;
|
|
156
|
+
pandaAnim.value.start(appliedAnim.value);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
defineExpose({
|
|
160
|
+
slide,
|
|
161
|
+
});
|
|
162
|
+
</script>
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { shallowRef, onBeforeUnmount } from "vue";
|
|
3
|
+
import Blur, { captureBlurTexture } from "../Blur.vue";
|
|
4
|
+
|
|
5
|
+
const rToCapture = shallowRef(null);
|
|
6
|
+
const rTextureInfo = shallowRef(null);
|
|
7
|
+
const rTriggerLoadKey = shallowRef(0);
|
|
8
|
+
const rBlurTextureKeeps = shallowRef(null);
|
|
9
|
+
|
|
10
|
+
var vEnableBlur = false;
|
|
11
|
+
|
|
12
|
+
// 要确认图片完成显示时在进行捕获并处理成模糊纹理
|
|
13
|
+
function handleLoadDone() {
|
|
14
|
+
if (vEnableBlur) {
|
|
15
|
+
console.log("start captureBlurTexture");
|
|
16
|
+
|
|
17
|
+
// 捕获模糊纹理, 此纹理可以多个blur组件共享, 共享时最好用1x1的div把持, 避免自动释放
|
|
18
|
+
captureBlurTexture(rToCapture.value, 12/* blurRadius */).then((textureInfo) => {
|
|
19
|
+
rTextureInfo.value = textureInfo;
|
|
20
|
+
|
|
21
|
+
// 用1x1的div把持模糊纹理, 避免自动释放, 适合多区域模糊内容共享的场景
|
|
22
|
+
rBlurTextureKeeps.value = `jsvtexturestore://${textureInfo.textureId}`;
|
|
23
|
+
|
|
24
|
+
console.log("done captureBlurTexture");
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function enableBlur() {
|
|
30
|
+
// 触发图片加载,然后捕获模糊纹理
|
|
31
|
+
rTriggerLoadKey.value++;
|
|
32
|
+
vEnableBlur = true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const MOVE_STEP = 30;
|
|
36
|
+
|
|
37
|
+
function movePopups(dx, dy) {
|
|
38
|
+
rPopupLeft.value += dx;
|
|
39
|
+
rPopupTop.value += dy;
|
|
40
|
+
rPopup2Left.value += dx;
|
|
41
|
+
rPopup2Top.value += dy;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const _onKeyDown = (ev) => {
|
|
46
|
+
if (ev.keyCode == 13) {
|
|
47
|
+
enableBlur();
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
switch (ev.keyCode) {
|
|
51
|
+
case 37: // 左
|
|
52
|
+
return movePopups(-MOVE_STEP, 0);
|
|
53
|
+
case 38: // 上
|
|
54
|
+
return movePopups(0, -MOVE_STEP);
|
|
55
|
+
case 39: // 右
|
|
56
|
+
return movePopups(MOVE_STEP, 0);
|
|
57
|
+
case 40: // 下
|
|
58
|
+
return movePopups(0, MOVE_STEP);
|
|
59
|
+
default:
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const cVisibleCallback = (info) => {
|
|
65
|
+
console.log("onVisibilityChange", info);
|
|
66
|
+
if (info.status == "show") {
|
|
67
|
+
rTriggerLoadKey.value++; // 刷新img标签, 触发onload后的重新捕获模糊纹理
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// 为了应对 window.JsvCoreApi.delayRemoveGLView/ window.JsvCoreApi.restoreGLView 对应的GL重建处理后,
|
|
72
|
+
// 需要重新捕获模糊纹理的场景
|
|
73
|
+
window.JsvCoreApi.onVisibilityChange(cVisibleCallback);
|
|
74
|
+
|
|
75
|
+
const POPUP_WIDTH = 400;
|
|
76
|
+
const POPUP_HEIGHT = 400;
|
|
77
|
+
const POPUP_MARGIN = 200;
|
|
78
|
+
const POPUP_TOP = (720 - POPUP_HEIGHT) / 2;
|
|
79
|
+
|
|
80
|
+
const popupViewLayout = {
|
|
81
|
+
width: POPUP_WIDTH,
|
|
82
|
+
height: POPUP_HEIGHT,
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const popupViewLayout2 = {
|
|
86
|
+
width: POPUP_WIDTH,
|
|
87
|
+
height: POPUP_HEIGHT,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const rPopupLeft = shallowRef(POPUP_MARGIN);
|
|
91
|
+
const rPopupTop = shallowRef(POPUP_TOP);
|
|
92
|
+
const rPopup2Left = shallowRef(1280 - POPUP_WIDTH - POPUP_MARGIN);
|
|
93
|
+
const rPopup2Top = shallowRef(POPUP_TOP);
|
|
94
|
+
|
|
95
|
+
onBeforeUnmount(() => {
|
|
96
|
+
// 取消注册一定不要漏
|
|
97
|
+
window.JsvCoreApi.removeEventCallback(cVisibleCallback);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
</script>
|
|
101
|
+
|
|
102
|
+
<template>
|
|
103
|
+
<jsv-focus-block
|
|
104
|
+
autoFocus
|
|
105
|
+
:onAction="{
|
|
106
|
+
onKeyDown: _onKeyDown,
|
|
107
|
+
}"
|
|
108
|
+
>
|
|
109
|
+
|
|
110
|
+
<!-- 设置屏幕内1x1的div, 用来让captureBlurTexture有div把持, 避免自动释放, 适合多区域模糊内容共享的场景 -->
|
|
111
|
+
<div :style="{
|
|
112
|
+
width: 1,
|
|
113
|
+
height: 1,
|
|
114
|
+
backgroundImage: `url(${rBlurTextureKeeps})`,
|
|
115
|
+
}"/>
|
|
116
|
+
|
|
117
|
+
<div
|
|
118
|
+
ref="rToCapture"
|
|
119
|
+
:style="{
|
|
120
|
+
width: 1280, // 截屏区域的宽
|
|
121
|
+
height: 720, // 截屏区域的高
|
|
122
|
+
}"
|
|
123
|
+
>
|
|
124
|
+
<img
|
|
125
|
+
:key="rTriggerLoadKey"
|
|
126
|
+
src="https://cdn.release.qcast.cn/JsViewFrameworkTester/JsViewVueSampleResources/DemoHomepage/App/BackgroundLongmao.jpg"
|
|
127
|
+
:style="{
|
|
128
|
+
width: 1280,
|
|
129
|
+
height: 720,
|
|
130
|
+
}"
|
|
131
|
+
:onLoad="handleLoadDone"
|
|
132
|
+
/>
|
|
133
|
+
<div
|
|
134
|
+
:style="{
|
|
135
|
+
top: 300,
|
|
136
|
+
width: 1280,
|
|
137
|
+
height: 100,
|
|
138
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
139
|
+
color: '#ffffff',
|
|
140
|
+
fontSize: 40,
|
|
141
|
+
textAlign: 'center',
|
|
142
|
+
}"
|
|
143
|
+
>
|
|
144
|
+
按OK键弹出带模糊背景的框
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
148
|
+
<div
|
|
149
|
+
v-if="rTextureInfo"
|
|
150
|
+
:style="{
|
|
151
|
+
left: rPopupLeft,
|
|
152
|
+
top: rPopupTop,
|
|
153
|
+
}"
|
|
154
|
+
>
|
|
155
|
+
<blur
|
|
156
|
+
:textureInfo="rTextureInfo"
|
|
157
|
+
:layout="{
|
|
158
|
+
left: 0,
|
|
159
|
+
top: 0,
|
|
160
|
+
width: popupViewLayout.width,
|
|
161
|
+
height: popupViewLayout.height,
|
|
162
|
+
}"
|
|
163
|
+
:showRectPos="{
|
|
164
|
+
left: rPopupLeft,
|
|
165
|
+
top: rPopupTop,
|
|
166
|
+
}"
|
|
167
|
+
:borderRadius="30"
|
|
168
|
+
/>
|
|
169
|
+
<div
|
|
170
|
+
:style="{
|
|
171
|
+
width: popupViewLayout.width,
|
|
172
|
+
height: popupViewLayout.height,
|
|
173
|
+
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
174
|
+
borderRadius: 30,
|
|
175
|
+
lineHeight: popupViewLayout.height,
|
|
176
|
+
textAlign: 'center',
|
|
177
|
+
color: '#ffffff',
|
|
178
|
+
fontSize: 40,
|
|
179
|
+
}"
|
|
180
|
+
>
|
|
181
|
+
{{ '弹窗内容' }}
|
|
182
|
+
</div>
|
|
183
|
+
</div>
|
|
184
|
+
|
|
185
|
+
<div
|
|
186
|
+
v-if="rTextureInfo"
|
|
187
|
+
:style="{
|
|
188
|
+
left: rPopup2Left,
|
|
189
|
+
top: rPopup2Top,
|
|
190
|
+
}"
|
|
191
|
+
>
|
|
192
|
+
<blur
|
|
193
|
+
:textureInfo="rTextureInfo"
|
|
194
|
+
:layout="{
|
|
195
|
+
left: 0,
|
|
196
|
+
top: 0,
|
|
197
|
+
width: popupViewLayout2.width,
|
|
198
|
+
height: popupViewLayout2.height,
|
|
199
|
+
}"
|
|
200
|
+
:showRectPos="{
|
|
201
|
+
left: rPopup2Left,
|
|
202
|
+
top: rPopup2Top,
|
|
203
|
+
}"
|
|
204
|
+
:borderRadius="30"
|
|
205
|
+
/>
|
|
206
|
+
<div
|
|
207
|
+
:style="{
|
|
208
|
+
width: popupViewLayout2.width,
|
|
209
|
+
height: popupViewLayout2.height,
|
|
210
|
+
backgroundColor: 'rgba(0, 0, 0, 0.3)',
|
|
211
|
+
borderRadius: 30,
|
|
212
|
+
lineHeight: popupViewLayout2.height,
|
|
213
|
+
textAlign: 'center',
|
|
214
|
+
color: '#ffffff',
|
|
215
|
+
fontSize: 40,
|
|
216
|
+
}"
|
|
217
|
+
>
|
|
218
|
+
弹窗内容 2
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
|
|
222
|
+
<div
|
|
223
|
+
v-if="rTextureInfo"
|
|
224
|
+
:style="{
|
|
225
|
+
top: 620,
|
|
226
|
+
width: 1280,
|
|
227
|
+
height: 100,
|
|
228
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
229
|
+
color: '#ffffff',
|
|
230
|
+
fontSize: 40,
|
|
231
|
+
textAlign: 'center',
|
|
232
|
+
lineHeight: 100,
|
|
233
|
+
}"
|
|
234
|
+
>
|
|
235
|
+
按上下左右可以调整弹窗位置
|
|
236
|
+
</div>
|
|
237
|
+
</jsv-focus-block>
|
|
238
|
+
</template>
|
|
239
|
+
|
|
240
|
+
<style>
|
|
241
|
+
@keyframes rotate {
|
|
242
|
+
0% {
|
|
243
|
+
transform: rotate3d(0, 0, 1, 0deg);
|
|
244
|
+
}
|
|
245
|
+
100% {
|
|
246
|
+
transform: rotate3d(0, 0, 1, 360deg);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
</style>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<FlippingBook
|
|
4
|
+
:page-count="totalPages"
|
|
5
|
+
:position="position"
|
|
6
|
+
:page-size="pageSize"
|
|
7
|
+
ref="bookFlipRef"
|
|
8
|
+
>
|
|
9
|
+
<template #default="{ pageIndex, triggerFlush }">
|
|
10
|
+
<BookPage
|
|
11
|
+
:width="pageSize.width"
|
|
12
|
+
:height="pageSize.height"
|
|
13
|
+
:index="pageIndex"
|
|
14
|
+
:flushTrigger="triggerFlush"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
</FlippingBook>
|
|
18
|
+
|
|
19
|
+
<div :style="{ top: 650 }">
|
|
20
|
+
<JsvFocusBlock :autoFocus="true" :onKeyDown="handleKeyDown">
|
|
21
|
+
<div
|
|
22
|
+
class="page-info"
|
|
23
|
+
:style="{
|
|
24
|
+
top: -40,
|
|
25
|
+
left: 400,
|
|
26
|
+
height: 50,
|
|
27
|
+
width: 480,
|
|
28
|
+
lineHeight: 50,
|
|
29
|
+
textAlign: 'center',
|
|
30
|
+
color: '#FFFFFF',
|
|
31
|
+
}"
|
|
32
|
+
>
|
|
33
|
+
左右键进行翻页
|
|
34
|
+
</div>
|
|
35
|
+
<div
|
|
36
|
+
class="page-info"
|
|
37
|
+
:style="{
|
|
38
|
+
left: 400,
|
|
39
|
+
height: 50,
|
|
40
|
+
width: 480,
|
|
41
|
+
lineHeight: 50,
|
|
42
|
+
textAlign: 'center',
|
|
43
|
+
color: '#FF0000',
|
|
44
|
+
}"
|
|
45
|
+
>
|
|
46
|
+
当前页: {{ currentPage + 1 }} / {{ totalPages }}
|
|
47
|
+
</div>
|
|
48
|
+
</JsvFocusBlock>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<script setup>
|
|
54
|
+
import { ref } from "vue";
|
|
55
|
+
import { FlippingBook } from "@shijiu/jsview-vue-plus";
|
|
56
|
+
import BookPage from "./BookPage.vue";
|
|
57
|
+
import { JsvFocusBlock } from "jsview";
|
|
58
|
+
|
|
59
|
+
// 配置参数
|
|
60
|
+
const totalPages = 8;
|
|
61
|
+
const pageSize = {
|
|
62
|
+
width: 980,
|
|
63
|
+
height: 500,
|
|
64
|
+
};
|
|
65
|
+
const position = {
|
|
66
|
+
x: 150,
|
|
67
|
+
y: 100,
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
// 组件引用和状态
|
|
71
|
+
const bookFlipRef = ref(null);
|
|
72
|
+
const currentPage = ref(0);
|
|
73
|
+
|
|
74
|
+
// 翻页方法
|
|
75
|
+
const nextPage = () => {
|
|
76
|
+
if (currentPage.value < totalPages - 1) {
|
|
77
|
+
currentPage.value++;
|
|
78
|
+
bookFlipRef.value.setCurrentPage(currentPage.value);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const prevPage = () => {
|
|
83
|
+
if (currentPage.value > 0) {
|
|
84
|
+
currentPage.value--;
|
|
85
|
+
bookFlipRef.value.setCurrentPage(currentPage.value);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// 按键处理
|
|
90
|
+
const handleKeyDown = (event) => {
|
|
91
|
+
switch (event.keyCode) {
|
|
92
|
+
case 37: // 左键的keyCode
|
|
93
|
+
prevPage();
|
|
94
|
+
return true;
|
|
95
|
+
case 39: // 右键的keyCode
|
|
96
|
+
nextPage();
|
|
97
|
+
return true;
|
|
98
|
+
default:
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<style scoped>
|
|
105
|
+
.control-btn {
|
|
106
|
+
font-size: 30;
|
|
107
|
+
background-color: rgba(76, 175, 80, 1);
|
|
108
|
+
color: rgba(128, 255, 255, 1);
|
|
109
|
+
border-radius: 4;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.page-info {
|
|
113
|
+
font-size: 30;
|
|
114
|
+
}
|
|
115
|
+
</style>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="pageStyle">
|
|
3
|
+
<div class="page-number">{{ index }}</div>
|
|
4
|
+
<div
|
|
5
|
+
class="page-detail"
|
|
6
|
+
:style="{
|
|
7
|
+
left: 30,
|
|
8
|
+
top: 30,
|
|
9
|
+
width: pageStyle.width - 60,
|
|
10
|
+
height: pageStyle.height - 60,
|
|
11
|
+
textOverflow: 'ellipsis',
|
|
12
|
+
backgroundColor: 'rgba(0,0,128,0.5)',
|
|
13
|
+
}"
|
|
14
|
+
>
|
|
15
|
+
{{ TextList[index % 3] }}
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { computed, onUnmounted, onMounted } from "vue";
|
|
22
|
+
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
width: {
|
|
25
|
+
type: Number,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
height: {
|
|
29
|
+
type: Number,
|
|
30
|
+
required: true,
|
|
31
|
+
},
|
|
32
|
+
index: {
|
|
33
|
+
type: Number,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
flushTrigger: {
|
|
37
|
+
type: Function,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const TextList = [
|
|
43
|
+
"以下是长句子:\n" +
|
|
44
|
+
"1.石室诗士施氏,嗜狮,誓食十狮。2.施氏时时适市视狮。3.十时,适十狮适市。4.是时,适施氏适市。5.施氏视是十狮,恃矢势,使是十狮逝世。6.氏拾是十狮尸,适石室。7.石室湿,氏使侍拭石室。8.石室拭,施氏始试食是十狮尸。9.食时,始识是十狮尸,实十石狮尸。10.试释是事。\n",
|
|
45
|
+
"以下是长句子:\n" + "君不见,黄河之水天上来,奔流到海不复回。\n",
|
|
46
|
+
"以下是长句子:\n" +
|
|
47
|
+
'ABC انجليزي "abc" سعر الملابس 180 ABC انجليزي "abc" سعر الملابس 180 \n',
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
console.log("页面构建(测试BookFlip用key来保持prevPage)" + props.index);
|
|
51
|
+
|
|
52
|
+
const pageStyle = computed(() => {
|
|
53
|
+
const randomColor = `#${Math.floor(Math.random() * 16777215)
|
|
54
|
+
.toString(16)
|
|
55
|
+
.padStart(6, "0")}`;
|
|
56
|
+
return {
|
|
57
|
+
width: `${props.width}`,
|
|
58
|
+
height: `${props.height}`,
|
|
59
|
+
backgroundColor: randomColor,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
onMounted(() => {
|
|
64
|
+
console.log("页面挂载(测试BookFlip用key来保持prevPage)" + props.index);
|
|
65
|
+
props.flushTrigger(props.index); // 若有图片,要用jsvPreload进行图片预加载,并在预加载完成后调用flushTrigger
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
onUnmounted(() => {
|
|
69
|
+
console.log("页面销毁(测试BookFlip用key来保持prevPage)" + props.index);
|
|
70
|
+
});
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<style scoped>
|
|
74
|
+
.page-number {
|
|
75
|
+
font-size: 24px;
|
|
76
|
+
color: rgba(255, 255, 255, 1);
|
|
77
|
+
}
|
|
78
|
+
.page-detail {
|
|
79
|
+
font-size: 30px;
|
|
80
|
+
color: rgb(207, 52, 168);
|
|
81
|
+
}
|
|
82
|
+
</style>
|
|
@@ -22,10 +22,32 @@ import { shallowRef } from "vue";
|
|
|
22
22
|
import { buildBounce } from "./FreeMoveBuilder";
|
|
23
23
|
|
|
24
24
|
const props = defineProps({
|
|
25
|
+
/**
|
|
26
|
+
* 图片资源路径
|
|
27
|
+
* @type {String}
|
|
28
|
+
* @required
|
|
29
|
+
* @example
|
|
30
|
+
* // 正确用法
|
|
31
|
+
* src: "/images/ball.png"
|
|
32
|
+
*/
|
|
25
33
|
src: {
|
|
26
34
|
type: String,
|
|
27
35
|
required: true,
|
|
28
36
|
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 布局配置对象
|
|
40
|
+
* @type {Object}
|
|
41
|
+
* @required
|
|
42
|
+
* @typedef {Object} LayoutConfig
|
|
43
|
+
* @property {number} top - 组件顶部位置(单位:px)
|
|
44
|
+
* @property {number} left - 组件左侧位置(单位:px)
|
|
45
|
+
* @property {number} width - 组件宽度(单位:px)
|
|
46
|
+
* @property {number} height - 组件高度(单位:px)
|
|
47
|
+
* @example
|
|
48
|
+
* // 正确配置示例
|
|
49
|
+
* { top: 100, left: 200, width: 50, height: 50 }
|
|
50
|
+
*/
|
|
29
51
|
layout: {
|
|
30
52
|
type: Object,
|
|
31
53
|
required: true,
|
|
@@ -35,14 +57,24 @@ const props = defineProps({
|
|
|
35
57
|
let actorRef = shallowRef(null);
|
|
36
58
|
let vLeftSnakeControl = null;
|
|
37
59
|
|
|
60
|
+
/**
|
|
61
|
+
* 启动弹跳动画
|
|
62
|
+
* @param {number} left - 目标位置X坐标(单位:px)
|
|
63
|
+
* @param {number} top - 目标位置Y坐标(单位:px)
|
|
64
|
+
* @param {number} bounceTimes - 弹跳次数(建议1-5次)
|
|
65
|
+
* @description 调用此方法后组件会从当前位置向目标位置执行弹跳动画
|
|
66
|
+
* @example
|
|
67
|
+
* // 在(200,300)位置弹跳3次
|
|
68
|
+
* start(200, 300, 3)
|
|
69
|
+
*/
|
|
38
70
|
function startSnakeAnim(left, top, bounceTimes) {
|
|
39
|
-
// showSnake.value = true;
|
|
40
71
|
vLeftSnakeControl = actorRef.value.control;
|
|
41
72
|
vLeftSnakeControl.run((cmds) => [
|
|
42
73
|
...buildBounce(cmds, 1, left, top, bounceTimes, 2.0, (state) => {}),
|
|
43
74
|
]);
|
|
44
75
|
}
|
|
45
76
|
|
|
77
|
+
// 暴露给父组件的方法
|
|
46
78
|
defineExpose({
|
|
47
79
|
start: startSnakeAnim,
|
|
48
80
|
});
|
|
@@ -119,7 +119,7 @@ export function buildBounce(
|
|
|
119
119
|
cmds.state().removeConditionByGroup(condGroupId),
|
|
120
120
|
|
|
121
121
|
// wallPosition用于规避运动路程计算超出(times越大超出越多)时,解决动画结尾的回弹问题
|
|
122
|
-
cmds.condition(condGroupId, true, sWallConditionName).wallPosition(wallname, 0
|
|
122
|
+
cmds.condition(condGroupId, true, sWallConditionName).wallPosition(wallname, 0).then([
|
|
123
123
|
cmds.action().teleportTo(0, undefined),
|
|
124
124
|
cmds.action().setSpdAndAccel(0, undefined, undefined, undefined),
|
|
125
125
|
]),
|