修改页面显示数据
parent
b5a1b17881
commit
4746681087
|
|
@ -74,11 +74,7 @@
|
|||
propCallData: {
|
||||
type: [Number, String, Array, Object],
|
||||
default: '',
|
||||
},
|
||||
propChooseFocus: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -125,6 +121,7 @@
|
|||
//#endif
|
||||
//#ifdef APP-NVUE
|
||||
self.$emit('callBack', data.data, self.propCallData);
|
||||
uni.$emit('callBack', data.data, self.propCallData);
|
||||
//#endif
|
||||
} else {
|
||||
self.$emit('call-back', data.data.url, self.propCallData);
|
||||
|
|
@ -185,14 +182,10 @@
|
|||
},
|
||||
complete(res) {
|
||||
//#ifndef APP-NVUE
|
||||
if (self.propChooseFocus) {
|
||||
self.$emit('chooseFocus');
|
||||
}
|
||||
//#endif
|
||||
//#ifdef APP-NVUE
|
||||
if (self.propChooseFocus) {
|
||||
uni.$emit('chooseFocus');
|
||||
}
|
||||
//#endif
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<!-- 视频列表 -->
|
||||
<view class="swiper" ref="swiper">
|
||||
<block v-for="(video_item, index) in video_data_list" :key="video_item.id">
|
||||
<view class="pr" @tap.stop="toggle_play_pause" :style="width_height_style + swiperStyle" @touchstart.prevent="ListTouchStart" @touchmove.prevent="ListTouchMove">
|
||||
<view class="pr" @tap.stop="toggle_play_pause" :style="width_height_style" @touchstart.prevent="ListTouchStart" @touchmove.prevent="ListTouchMove">
|
||||
<view class="video-bg" :style="width_height_style">
|
||||
<template v-if="!isEmpty(video_item.cover)">
|
||||
<image class="video-bg-image" :style="width_height_style" :src="video_item.cover" mode="scaleToFill"></image>
|
||||
|
|
@ -434,6 +434,10 @@
|
|||
uni.$on('chooseFocus', (data) => {
|
||||
this.upload_event();
|
||||
})
|
||||
|
||||
uni.$on('callBack', (res) => {
|
||||
this.upload_images_event(res);
|
||||
})
|
||||
// 初始化
|
||||
this.init();
|
||||
|
||||
|
|
@ -456,6 +460,7 @@
|
|||
this.cleanup_all_videos();
|
||||
this.unbind_keyboard_listener();
|
||||
uni.$off('chooseFocus');
|
||||
uni.$off('callBack');
|
||||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
|
|
@ -924,7 +929,10 @@
|
|||
if (this.$refs.commentRef) {
|
||||
this.$refs.commentRef.blur();
|
||||
}
|
||||
|
||||
if (e) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('close_comment_modal error:', error);
|
||||
}
|
||||
|
|
@ -1021,10 +1029,15 @@
|
|||
}
|
||||
|
||||
const current_y = e?.touches[0]?.pageY || 0;
|
||||
const move_y = current_y - this.comment_current_y;
|
||||
// 小于3的时候不认为是有效滑动,避免因为手指抖动影响
|
||||
if (move_y < 3) {
|
||||
return;
|
||||
}
|
||||
const distance = current_y - this.comment_start_y;
|
||||
|
||||
// 只有向下移动且距离超过阈值(30px)才开始拖拽,避免误触和抖动
|
||||
if (distance > 10) {
|
||||
// 只有向下移动且距离超过阈值(15px)才开始拖拽,避免误触和抖动
|
||||
if (distance > 15) {
|
||||
this.is_dragging = true;
|
||||
this.comment_current_y = current_y;
|
||||
|
||||
|
|
@ -1038,7 +1051,7 @@
|
|||
// 设置节流定时器,16ms 约等于 60fps,保证流畅度同时避免过度更新
|
||||
this.comment_move_throttle_timer = setTimeout(() => {
|
||||
this.comment_move_throttle_timer = null;
|
||||
}, 80);
|
||||
}, 60);
|
||||
}
|
||||
}
|
||||
} catch(error) {
|
||||
|
|
|
|||
|
|
@ -119,7 +119,6 @@ export default {
|
|||
|
||||
// 记录当前坐标
|
||||
const distance = this.distance + e.deltaY
|
||||
|
||||
if(distance>0 || this.distance + e.deltaY-this.windowHeight<-this.windowHeight*this.video_data_list.length) {
|
||||
if (this.index == 0) {
|
||||
this.showToast('当前已经是第一条了');
|
||||
|
|
@ -163,9 +162,10 @@ export default {
|
|||
} else{
|
||||
// 往上下拖动超过一半时
|
||||
final_Y = this.distance + (Y>0?1:-1) *this.windowHeight
|
||||
changed_Y= final_Y - distance// 计算出需要位置的值
|
||||
changed_Y= final_Y - distance + (Y>0? 23 : -23)// 计算出需要位置的值
|
||||
translate_Y_origin = `easeOutExpo(t,${distance},${changed_Y},600)` // 运动曲线为easeOutExpo
|
||||
}
|
||||
|
||||
let result = BindingX.bind({
|
||||
eventType:'timing', // 结束的时候是没有任何监听的 用 timing 来做定时的动画
|
||||
exitExpression:"t>300", // 当时间超过 300ms 结束动画
|
||||
|
|
@ -207,6 +207,7 @@ export default {
|
|||
changed_X= final_X - distance// 计算出需要位置的值
|
||||
origin = `easeOutExpo(t,${distance},${changed_X},300)` // 运动曲线为easeOutExpo
|
||||
}
|
||||
console.log(changed_X);
|
||||
let result = BindingX.bind({
|
||||
eventType:'timing', // 结束的时候是没有任何监听的 用 timing 来做定时的动画
|
||||
exitExpression:"t>300", // 当时间超过 300ms 结束动画
|
||||
|
|
|
|||
Loading…
Reference in New Issue