获取更多内容

master
于肖磊 2026-02-11 17:23:21 +08:00
parent 2e884f1ec7
commit 657783908f
1 changed files with 62 additions and 18 deletions

View File

@ -123,6 +123,13 @@
</template>
</view>
</view>
<template v-if="comment_item_loading">
<loading-component></loading-component>
</template>
<template v-else>
<!-- 结尾 -->
<component-bottom-line :propStatus="goods_bottom_line_status"></component-bottom-line>
</template>
</view>
</scroll-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">
@ -158,6 +165,7 @@
import searchComponent from '@/pages/plugins/video/components/search.vue';
import componentSharePopup from '@/components/share-popup/share-popup';
import componentNoData from '@/components/no-data/no-data';
import componentBottomLine from '@/components/bottom-line/bottom-line';
//
var bar_height = parseInt(app.globalData.get_system_info('statusBarHeight', 0));
// #ifdef MP-TOUTIAO || H5
@ -170,7 +178,8 @@
commentMoreComponent,
searchComponent,
componentSharePopup,
componentNoData
componentNoData,
componentBottomLine
},
data() {
return {
@ -197,6 +206,10 @@
is_seeking: false,
show_comment_modal: false,
active_comments: {},
comments_page: 1, //
comments_page_total: 5, //
goods_bottom_line_status: false, //线
comment_item_loading: false,
comment_start_y: 0, //
comment_current_y: 0, //
move_distance: 0,
@ -799,8 +812,12 @@
page: 0,
sub_comments: [],
}));
this.setData({
active_comments: new_data,
comments_page: 1,
comments_page_total: 5,
comment_item_loading: false,
show_comment_modal: true,
move_distance: 0,
})
@ -818,8 +835,50 @@
},
//
handle_comment_to_lower_scroll() {
//
if (this.goods_bottom_line_status) {
return;
}
this.comment_item_loading = true;
//
uni.request({
url: app.globalData.get_request_url("commentsreplylist", "index", "video"),
method: 'POST',
data: {
video_id: this.current_video_id,
page: this.comments_page + 1,
video_comments_id: 0
},
dataType: 'json',
success: res => {
const data = res.data;
if (data.code == 0) {
const new_data = data.data;
if (new_data.data.length > 0) {
//
const comment_data = new_data.data.map(item1 => ({
...item1,
show_sub_comment: false,
show_sub_comment_loading: false,
page: 0,
sub_comments: [],
}));
this.active_comments.push(...comment_data);
}
//
if (new_data.page >= new_data.page_total) {
//
this.setData({
goods_bottom_line_status: true,
})
}
this.comments_page = new_data.page;
this.comments_page_total = new_data.page_total
}
},
complete: () => {
this.comment_item_loading = false;
}
});
},
//
handle_comment_touch_start(e) {
@ -938,21 +997,6 @@
}
});
}
// if (comment) {
// comment.show_sub_comment = true;
// comment.show_sub_comment_loading = true;
// setTimeout(() => {
// comment.sub_comments.push({
// id: `c${Date.now()}`,
// userHead: 'http://8.146.211.120:8080/upload/avatar/d5537aa243ef6a74a50bf4ffd4ca6876.jpg', // Placeholder avatar
// userNick: '',
// content: '',
// time: new Date().toLocaleString()
// });
// comment.show_sub_comment_loading = false;
// }, 500);
// }
},
//
close_sub_comment(id) {