Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

小程序支持 #67

Closed
pslxx opened this issue Apr 29, 2024 · 9 comments
Closed

小程序支持 #67

pslxx opened this issue Apr 29, 2024 · 9 comments

Comments

@pslxx
Copy link

pslxx commented Apr 29, 2024

测试了一下,滑动挺流畅的,各种动画效果也非常好

最近在写一个抖音小程序的短剧,,我目前直接用官方(uniapp) 的swiper,但是感觉不够丝滑, 不知道这个滑动的效果能不能移植到小程序(uniapp).

@zyronon
Copy link
Owner

zyronon commented Apr 29, 2024

不知道,没试过。理论上是不行的

因为你做无限滑动,只有两种方法:1、动态删除和增加dom,2、移动dom

我采用的是第一种,具体可以看我写的这篇文章“:实现抖音 “视频无限滑动“效果

小程序没有dom,控制元素显示或隐藏只能通过v-if。

不做无限滑动,那video多了肯定会卡

@zyronon
Copy link
Owner

zyronon commented Apr 29, 2024

滑动是自己写的,对事件冲突、判定、和拦截做了处理的

可以看看我这篇文章:200行代码实现类似Swiper.js的轮播组件

@pslxx
Copy link
Author

pslxx commented Apr 29, 2024

我估计也是不好弄
我现在的实现方式,是一次性加载全部几十条swiper-item 但是每个里面做放了个封面图,
每个swiper-item 都监听父组件正在播放的索引对象,如果判断和自己的相同,就加载视频,否则销毁所有的数据,只保留一个封面

@zyronon
Copy link
Owner

zyronon commented Apr 29, 2024

那还好吧,图片几十近百个应该没啥问题的,不会卡。快百个的时候强制刷新呗😅

@zyronon
Copy link
Owner

zyronon commented Apr 29, 2024

另外,小程序本来就不流畅,用原生那套写也不流畅。和uniapp没啥关系,就是卡卡的,特别是滑动这种

@pslxx
Copy link
Author

pslxx commented Apr 29, 2024

对,就是感觉swiper滑动的时候不跟手,不知道是帧率不够,还是动画不对,尝试了所有可设置的动画类型,都不好用

@zyronon
Copy link
Owner

zyronon commented Apr 29, 2024

小程序就这样,不是你的错

@zyronon
Copy link
Owner

zyronon commented Apr 29, 2024

或者可以试试skyline

@Mandeep0001
Copy link

If you require any help?

@zyronon zyronon closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants