修改举报内容

master
于肖磊 2026-02-12 14:03:03 +08:00
parent 3103eca5b6
commit bb963a6efa
1 changed files with 72 additions and 21 deletions

View File

@ -276,8 +276,9 @@
header_padding_left: '',
report_type_list: [], //
popup_report_status: false, //
current_main_index: 0, //
current_sub_index: 0, //
current_main_index: 0, //
current_sub_index: 0, //
report_comment_id: '', // id
};
},
computed: {
@ -1243,11 +1244,9 @@
try {
//
this.pause_all_videos_except(-1);
//
this.create_video_contexts = [];
this.video_contexts = [];
console.log('视频资源清理完成');
} catch (error) {
console.error('清理视频资源时出错:', error);
@ -1268,7 +1267,6 @@
if (this.active_dropdown_id == comment_id) {
this.active_dropdown_id = null;
}
this.popup_report_status = true;
//
if (data.action == 'delete') {
//
@ -1284,6 +1282,8 @@
});
} else if (data.action == 'report') {
//
this.popup_report_status = true;
this.report_comment_id = comment_id;
}
},
//
@ -1298,7 +1298,10 @@
success: res => {
const data = res.data;
if (data.code == 0) {
//
delete_comment_handle(comment_id);
//
app.globalData.showToast(this.$t('common.delete_success'));
} else {
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
@ -1309,6 +1312,45 @@
}
});
},
delete_comment_handle(comment_id) {
// active_comments
if (this.active_comments && Array.isArray(this.active_comments)) {
//
const filteredComments = [];
//
for (let i = 0; i < this.active_comments.length; i++) {
const comment = this.active_comments[i];
// id
if (comment.id == comment_id) {
continue;
}
//
if (comment.sub_comments && Array.isArray(comment.sub_comments)) {
//
const filteredSubComments = comment.sub_comments.filter(
subComment => subComment.id != comment_id
);
//
if (filteredSubComments.length > 0 || comment.content) {
//
comment.sub_comments = filteredSubComments;
filteredComments.push(comment);
}
//
} else {
//
filteredComments.push(comment);
}
}
// active_comments
this.active_comments = filteredComments;
}
},
//
handle_global_click(e) {
//
@ -1388,22 +1430,31 @@
//
const main_reason = this.report_type_list[this.current_main_index];
const sub_reason = main_reason.data[this.current_sub_index];
//
console.log('举报提交:', {
main_reason: main_reason.name,
sub_reason: sub_reason
uni.request({
url: app.globalData.get_request_url("report", "index", "video"),
method: 'POST',
data: {
id: comment_id,
reason: main_reason.name,
type: sub_reason
},
dataType: 'json',
success: res => {
const data = res.data;
if (data.code == 0) {
//
app.globalData.showToast('举报成功');
//
this.close_report_popup();
} else {
if (app.globalData.is_login_check(res.data)) {
app.globalData.showToast(res.data.msg);
} else {
app.globalData.showToast(this.$t('common.sub_error_retry_tips'));
}
}
}
});
//
uni.showToast({
title: '举报提交成功',
icon: 'success'
});
//
this.close_report_popup();
// API
// this.submitReportToServer({
// main_reason: main_reason.name,