fix(DetailsArea): 修复举报功能并更新相关样式

修复举报功能,区分评论和主题举报类型。更新讨论图标和投币文本样式。移除不必要的背景色和注释代码。

refactor(api): 重构举报相关API接口
将评论举报和主题举报分离为独立接口,提高代码可维护性。

style: 清理多余空格和注释
统一代码格式,删除无用注释和空白行。
This commit is contained in:
DESKTOP-RQ919RC\Pc
2025-11-12 19:10:49 +08:00
parent ac9a2debf2
commit a584a2771b
11 changed files with 148 additions and 265 deletions

View File

@@ -3,7 +3,7 @@
<div class="alert-form">
<div class="comments reports">
<div class="head">
<span style="display: flex; align-items: center;"> <img style="width: 25px; margin-right: 7px;" src="//app.gter.net/image/gter/offer/img/exclamationpoint.png" />举报投诉 </span>
<span style="display: flex; align-items: center"> <img style="width: 25px; margin-right: 7px" src="//app.gter.net/image/gter/offer/img/exclamationpoint.png" />举报投诉 </span>
<div class="close icon-close iconfont" @click="alertShow = false"></div>
</div>
<div class="form">
@@ -26,42 +26,42 @@
</div>
</template>
<script setup>
import { ElMessage } from "element-plus"
import { ElMessage } from "element-plus";
const props = defineProps(["reportToken", "reportType"]);
const reasonList = ["广告", "辱骂", "重复发送", "不良信息", "其他"];
let reportAlertShow = inject("reportAlertShow");
const props = defineProps(["reportToken"])
const reasonList = ["广告", "辱骂", "重复发送", "不良信息", "其他"]
let reportAlertShow = inject("reportAlertShow")
let checkList = ref([]);
let alertShow = ref(false);
let alertText = ref("");
let checkList = ref([])
let alertShow = ref(false)
let alertText = ref("")
const selectRadio = value => {
const index = checkList.value.indexOf(value)
if (index === -1) checkList.value.push(value)
else checkList.value.splice(index, 1)
}
const selectRadio = (value) => {
const index = checkList.value.indexOf(value);
if (index === -1) checkList.value.push(value);
else checkList.value.splice(index, 1);
};
// 举报提交
const alertSubmit = () => {
if (checkList.value.length == 0) {
ElMessage.error("请选择举报类型")
return
ElMessage.error("请选择举报类型");
return;
}
checkList.value.push(alertText.value)
reportAlertShow.value = false
commentReportHttp({
checkList.value.push(alertText.value);
reportAlertShow.value = false;
(props.reportType === "comment" ? commentReportHttp : reportHttp)({
message: checkList.value,
token: props.reportToken,
}).then(res => {
checkList.value = []
reportAlertShow.value = false
ElMessage.success(res.message || "举报成功")
})
}
}).then((res) => {
checkList.value = [];
reportAlertShow.value = false;
ElMessage.success(res.message || "举报成功");
});
};
// 取消
const cancel = () => (reportAlertShow.value = false)
const cancel = () => (reportAlertShow.value = false);
</script>
<style lang="less" scoped>