视频二级调整
This commit is contained in:
parent
7345f8ee41
commit
3f4d42674e
@ -447,6 +447,7 @@ import { vlogList, vlogLike, vlogUnLike, vlogComment, vlogFollow, vlogTotalLiked
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
prevOffsetY: 0, // 新增:记录上一次滑动的垂直偏移量
|
||||
noData: '',
|
||||
//下面打🌟号的是必须要的基础字段
|
||||
//下面打💗号的是拥有滑动条的必须字段
|
||||
@ -1034,6 +1035,18 @@ export default {
|
||||
},
|
||||
scrolls(event) {
|
||||
this.isDragging = event.isDragging;
|
||||
const currentOffsetY = event.contentOffset.y; // 当前垂直偏移量
|
||||
|
||||
// 判断滑动方向(仅在滑动过程中判断)
|
||||
if (this.isDragging) {
|
||||
if (currentOffsetY > this.prevOffsetY) {
|
||||
console.log('用户向下滑动');
|
||||
this.$emit('isno',1);
|
||||
} else if (currentOffsetY < this.prevOffsetY) {
|
||||
console.log('用户向上滑动');
|
||||
this.$emit('isno', 0);
|
||||
}
|
||||
}
|
||||
if (!event.isDragging) {
|
||||
//isDragging:判断用户是不是在滑动,滑动:true,停止滑动:false。我们要用户停止滑动时才给 k 赋值,这样就可以避免很多麻烦
|
||||
var i = Math.round(Math.abs(event.contentOffset.y) / (this.wHeight - this.deleteHeight + 1)); //先用绝对值取出滑动的距离,然后除以屏幕高度,取一个整,就知道你现在滑动到哪一个视频了
|
||||
@ -1048,6 +1061,7 @@ export default {
|
||||
}, num);
|
||||
}
|
||||
}
|
||||
this.prevOffsetY = currentOffsetY; // 更新上一次偏移量
|
||||
},
|
||||
init() {
|
||||
this.page = 1;
|
||||
|
@ -16,7 +16,7 @@
|
||||
@onAnimationEnd="animationfinish"
|
||||
>
|
||||
<swiper-item>
|
||||
<video-local ref="videoLocal"></video-local>
|
||||
<video-local ref="videoLocal" @isno="isno"></video-local>
|
||||
</swiper-item>
|
||||
<swiper-item>
|
||||
<!-- <view
|
||||
@ -74,7 +74,7 @@
|
||||
</view>
|
||||
</view>
|
||||
<!-- 二级 tab -->
|
||||
<view v-if="tabList[tabIndex] && tabList[tabIndex].child" style="flex-direction: row; flex: 1; justify-content: space-around">
|
||||
<view v-if="handleIsnoEvent && tabList[tabIndex] && tabList[tabIndex].child" style="flex-direction: row; flex: 1; justify-content: space-around">
|
||||
<view
|
||||
class="uni-tab-item"
|
||||
v-for="(childTab, childIndex) in tabList[tabIndex].child"
|
||||
@ -155,6 +155,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
handleIsnoEvent:1,
|
||||
childTabIndex:0,
|
||||
channel: null,
|
||||
canSwipe: true,
|
||||
@ -307,6 +308,10 @@ export default {
|
||||
|
||||
// },
|
||||
methods: {
|
||||
isno(e){
|
||||
console.log(e,'---')
|
||||
this.handleIsnoEvent=e
|
||||
},
|
||||
onChildTabTap(i,o,item){
|
||||
this.childTabIndex=o
|
||||
uni.navigateTo({url:`/pages/tabbar/vlog/vlindex?name=${item.name}`});
|
||||
|
Loading…
x
Reference in New Issue
Block a user