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