提交 fb578b67 编写于 作者: 杜庆泉's avatar 杜庆泉

优化标准基座运行 lottie动画示例提示

上级 17572f73
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
<button @tap="changeAction(1)">测试action play</button> <button @tap="changeAction(1)">测试action play</button>
<button @tap="changeAction(2)">测试action pause</button> <button @tap="changeAction(2)">测试action pause</button>
<button @tap="changeAction(3)">测试action stop</button> <button @tap="changeAction(3)">测试action stop</button>
<animation-view ref="animView" :path="animUrl" :autoplay="autoplay" :loop="loop" :action="action" <animation-view ref="animView" v-if="!androidStandardLauncher" :path="animUrl"
:autoplay="autoplay"
:loop="loop"
:action="action"
:hidden="hidden" @bindended="testAnimEnd" :hidden="hidden" @bindended="testAnimEnd"
:style="{width:widthNum+'rpx',height:heightNum+'px',background:yanse}"> :style="{width:widthNum+'rpx',height:heightNum+'px',background:yanse}">
</animation-view> </animation-view>
...@@ -28,10 +31,28 @@ ...@@ -28,10 +31,28 @@
widthNum: 750, widthNum: 750,
heightNum: 200, heightNum: 200,
comShow: true, comShow: true,
animUrl: "/static/anim_a.json" animUrl: "/static/anim_a.json",
androidStandardLauncher:false,
} }
}, },
onLoad() {
// #ifdef APP-ANDROID
try{
Class.forName("com.airbnb.lottie.LottieAnimationView")
androidStandardLauncher = false
}catch(e:Exception){
androidStandardLauncher = true
}
if(androidStandardLauncher){
uni.showModal({
title:'当前示例需要自定义基座运行',
showCancel:false
})
}
// #endif
},
methods: { methods: {
changeAutoPlay: function() { changeAutoPlay: function() {
......
...@@ -209,15 +209,6 @@ ...@@ -209,15 +209,6 @@
pages: [] as Page[], pages: [] as Page[],
}, },
// #endif // #endif
// #ifdef APP-ANDROID
{
id: 'lottie-anim',
url: 'lottie-anim',
name: 'lottie动画-需要自定义基座',
open: false,
pages: [] as Page[],
},
// #endif
// #ifdef WEB // #ifdef WEB
{ {
id: 'browser-element', id: 'browser-element',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册