修改拖拽逻辑

master
于肖磊 2026-02-28 14:05:09 +08:00
parent 7c4403aefb
commit 1925a599da
1 changed files with 52 additions and 46 deletions

View File

@ -88,11 +88,12 @@
<!-- 评论弹窗 -->
<view v-if="show_comment_modal" class="comment-modal" @tap="close_comment_modal">
<view class="comment-content bottom-line-exclude-bottom" :style="commentContentStyle" @tap.stop @touchstart="handle_comment_touch_start" @touchmove="handle_comment_touch_move" @touchend="handle_comment_touch_end">
<view class="comment-header">
<view class="comment-content bottom-line-exclude-bottom" :style="commentContentStyle">
<view class="comment-header" data-type="header" @tap.stop @touchstart="handle_comment_touch_start" @touchmove="handle_comment_touch_move" @touchend="handle_comment_touch_end">
<text class="comment-count">{{$t('common.comment')}}</text>
<view class="close-btn" @tap="close_comment_modal"></view>
</view>
<view class="flex-1 flex-row" data-type="scroll" @tap.stop @touchstart="handle_comment_touch_start" @touchmove="handle_comment_touch_move" @touchend="handle_comment_touch_end">
<!-- 评论内容区域 -->
<scroll-view class="comment-list" scroll-y :scroll-top="comment_scroll_top" show-scrollbar="false" scroll-with-animation @scrolltolower="handle_comment_to_lower_scroll" @scroll="handle_comment_scroll">
<view class="comment-scroll">
@ -137,6 +138,8 @@
</template>
</view>
</scroll-view>
</view>
<view v-if="base_config_data && base_config_data.is_video_comments_add && base_config_data.is_video_comments_add == 1" class="comment-input-container">
<view class="comment-input-content flex-col jc-c">
<view v-if="!isEmpty(comments_reply_data)" class="comment-reply-content flex-row align-c jc-sb gap-10">
@ -1019,8 +1022,9 @@
},
//
handle_comment_touch_start(e) {
//
if (this.comment_scroll_top <= 5) {
const type = e?.target?.dataset?.type || 'header';
//
if ((this.comment_scroll_top <= 5 && type == 'scroll') || type == 'header') {
this.comment_start_y = e.touches[0].pageY;
this.comment_current_y = this.comment_start_y;
this.move_distance = 0;
@ -1028,8 +1032,9 @@
},
//
handle_comment_touch_move(e) {
//
if (this.comment_scroll_top <= 5) {
const type = e?.target?.dataset?.type || 'header';
//
if ((this.comment_scroll_top <= 5 && type == 'scroll') || type == 'header') {
this.comment_current_y = e.touches[0].pageY;
this.move_distance = this.comment_current_y - this.comment_start_y;
}
@ -1037,8 +1042,9 @@
//
handle_comment_touch_end(e) {
//
if (this.comment_scroll_top <= 5) {
const type = e?.target?.dataset?.type || 'header';
//
if ((this.comment_scroll_top <= 5 && type == 'scroll') || type == 'header') {
const move_distance = this.comment_current_y - this.comment_start_y;
//
if (move_distance > 150) {