|
|
|
@ -12,9 +12,9 @@ |
|
|
|
<FormItem label="关键词"> |
|
|
|
<Input v-model="goodsQuery.keyword" clearable placeholder="标题/发布人" style="width: 180px" /> |
|
|
|
</FormItem> |
|
|
|
<FormItem label="学校"> |
|
|
|
<!-- <FormItem label="学校"> |
|
|
|
<Input v-model="goodsQuery.regionId" clearable placeholder="校区ID" style="width: 160px" /> |
|
|
|
</FormItem> |
|
|
|
</FormItem> --> |
|
|
|
<FormItem label="审核"> |
|
|
|
<Select v-model="goodsQuery.auditStatus" clearable style="width: 120px"> |
|
|
|
<Option :value="0">待审核</Option> |
|
|
|
@ -51,7 +51,7 @@ |
|
|
|
<Table border :loading="loading" :columns="categoryColumns" :data="categoryList"></Table> |
|
|
|
</TabPane> |
|
|
|
|
|
|
|
<TabPane label="用户管理" name="user"> |
|
|
|
<!-- <TabPane label="用户管理" name="user"> |
|
|
|
<Row @keydown.enter.native="loadUserLimits"> |
|
|
|
<Form :model="userQuery" inline :label-width="80"> |
|
|
|
<FormItem label="用户ID"> |
|
|
|
@ -69,7 +69,7 @@ |
|
|
|
@on-change="p => changePage('user', p)" @on-page-size-change="s => changePageSize('user', s)" |
|
|
|
:page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer /> |
|
|
|
</Row> |
|
|
|
</TabPane> |
|
|
|
</TabPane> --> |
|
|
|
|
|
|
|
<TabPane label="举报管理" name="complaint"> |
|
|
|
<Row @keydown.enter.native="loadComplaints"> |
|
|
|
@ -100,6 +100,26 @@ |
|
|
|
:page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer /> |
|
|
|
</Row> |
|
|
|
</TabPane> |
|
|
|
|
|
|
|
<TabPane label="违规内容" name="auditLog"> |
|
|
|
<!-- <Row @keydown.enter.native="loadAuditLogs"> |
|
|
|
<Form :model="auditLogQuery" inline :label-width="80"> |
|
|
|
<FormItem label="校区ID"> |
|
|
|
<Input v-model="auditLogQuery.regionId" disabled placeholder="自动传当前校区" style="width: 180px" /> |
|
|
|
</FormItem> |
|
|
|
<FormItem> |
|
|
|
<Button type="primary" icon="ios-search" @click="searchAuditLogs">搜索</Button> |
|
|
|
<Button @click="resetAuditLogs">重置</Button> |
|
|
|
</FormItem> |
|
|
|
</Form> |
|
|
|
</Row> --> |
|
|
|
<Table border :loading="loading" :columns="auditLogColumns" :data="auditLogList"></Table> |
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
<Page :current="auditLogQuery.pageNumber" :total="auditLogTotal" :page-size="auditLogQuery.pageSize" |
|
|
|
@on-change="p => changeAuditLogPage(p)" @on-page-size-change="s => changeAuditLogPageSize(s)" |
|
|
|
:page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer /> |
|
|
|
</Row> |
|
|
|
</TabPane> |
|
|
|
</Tabs> |
|
|
|
</Card> |
|
|
|
|
|
|
|
@ -107,8 +127,8 @@ |
|
|
|
<Form :model="categoryForm" :label-width="90"> |
|
|
|
<FormItem label="名称"><Input v-model="categoryForm.name" /></FormItem> |
|
|
|
<FormItem label="排序"><InputNumber v-model="categoryForm.sortOrder" :min="0" /></FormItem> |
|
|
|
<FormItem label="图标"><Input v-model="categoryForm.icon" /></FormItem> |
|
|
|
<FormItem label="颜色"><Input v-model="categoryForm.color" /></FormItem> |
|
|
|
<!-- <FormItem label="图标"><Input v-model="categoryForm.icon" /></FormItem> |
|
|
|
<FormItem label="颜色"><Input v-model="categoryForm.color" /></FormItem> --> |
|
|
|
<FormItem label="状态"> |
|
|
|
<i-switch v-model="categoryForm.statusBool" size="large"> |
|
|
|
<span slot="open">启用</span> |
|
|
|
@ -127,20 +147,72 @@ |
|
|
|
<FormItem label="封禁原因"><Input v-model="userLimitForm.reason" type="textarea" /></FormItem> |
|
|
|
</Form> |
|
|
|
</Modal> |
|
|
|
|
|
|
|
<Modal v-model="goodsDetailModal" title="商品详情" width="860" footer-hide> |
|
|
|
<div v-if="goodsDetail && goodsDetail.id"> |
|
|
|
<Row :gutter="16"> |
|
|
|
<Col span="8"> |
|
|
|
<img v-if="goodsDetail.coverImage" :src="goodsDetail.coverImage" style="width: 100%; border-radius: 4px;" /> |
|
|
|
<div v-else style="height: 160px; line-height: 160px; text-align: center; background: #f7f7f7; color: #999;">暂无封面</div> |
|
|
|
</Col> |
|
|
|
<Col span="16"> |
|
|
|
<p><b>商品名称:</b>{{ goodsDetail.title || "-" }}</p> |
|
|
|
<p><b>卖家账号:</b>{{ goodsDetail.sellerAccount || goodsDetail.userName || "-" }}</p> |
|
|
|
<p><b>价格:</b>{{ goodsDetail.price || "-" }}</p> |
|
|
|
<p><b>分类:</b>{{ goodsDetail.categoryName || "-" }}</p> |
|
|
|
<p><b>状态:</b>{{ goodsDetail.status == 1 ? "正常" : goodsDetail.status == 2 ? "下架" : "删除" }}</p> |
|
|
|
<p><b>发布时间:</b>{{ goodsDetail.createTime || "-" }}</p> |
|
|
|
</Col> |
|
|
|
</Row> |
|
|
|
<div style="margin-top: 16px;"> |
|
|
|
<p><b>商品内容:</b></p> |
|
|
|
<p style="white-space: pre-wrap;">{{ goodsDetail.content || "-" }}</p> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 16px;"> |
|
|
|
<p><b>评论:</b></p> |
|
|
|
<div v-if="detailCommentList.length"> |
|
|
|
<div v-for="comment in detailCommentList" :key="comment.id" style="padding: 10px 0; border-bottom: 1px solid #eee;"> |
|
|
|
<div style="display: flex; justify-content: space-between;"> |
|
|
|
<span><b>{{ comment.userName || "-" }}</b>:{{ comment.content || "-" }}</span> |
|
|
|
<Button type="error" size="small" @click="deleteGoodsComment(comment.id)">删除</Button> |
|
|
|
</div> |
|
|
|
<div style="color: #999; margin-top: 4px;">{{ comment.createTime || "" }}</div> |
|
|
|
<div v-if="comment.replies && comment.replies.length" style="margin: 8px 0 0 20px; background: #f8f8f8; padding: 8px;"> |
|
|
|
<div v-for="reply in comment.replies" :key="reply.id" style="display: flex; justify-content: space-between; margin-bottom: 6px;"> |
|
|
|
<span><b>{{ reply.userName || "-" }}</b><span v-if="reply.replyToUserName"> 回复 {{ reply.replyToUserName }}</span>:{{ reply.content || "-" }}</span> |
|
|
|
<Button type="error" size="small" @click="deleteGoodsComment(reply.id)">删除</Button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<Row type="flex" justify="end" class="page"> |
|
|
|
<Page :current="detailCommentQuery.pageNum" :total="detailCommentTotal" :page-size="detailCommentQuery.pageSize" |
|
|
|
@on-change="changeDetailCommentPage" @on-page-size-change="changeDetailCommentPageSize" |
|
|
|
:page-size-opts="[10,20,50]" size="small" show-total show-elevator show-sizer /> |
|
|
|
</Row> |
|
|
|
</div> |
|
|
|
<div v-else style="text-align: center; color: #999; padding: 12px 0;">暂无评论</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else style="text-align: center; color: #999;">暂无商品详情</div> |
|
|
|
</Modal> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
fishGoodsPage, |
|
|
|
fishGoodsDetail, |
|
|
|
fishGoodsComments, |
|
|
|
fishGoodsStatus, |
|
|
|
fishCategoryList, |
|
|
|
fishCategorySave, |
|
|
|
fishCategoryDelete, |
|
|
|
fishCategoryStatus, |
|
|
|
fishComplaintPage, |
|
|
|
fishComplaintHandle, |
|
|
|
fishCommentDelete, |
|
|
|
fishUserLimitPage, |
|
|
|
fishUserLimitSave, |
|
|
|
fishAuditLogPage, |
|
|
|
} from "@/api/fishMarket"; |
|
|
|
|
|
|
|
export default { |
|
|
|
@ -156,40 +228,51 @@ export default { |
|
|
|
userTotal: 0, |
|
|
|
complaintList: [], |
|
|
|
complaintTotal: 0, |
|
|
|
auditLogList: [], |
|
|
|
auditLogTotal: 0, |
|
|
|
categoryModal: false, |
|
|
|
userLimitModal: false, |
|
|
|
goodsDetailModal: false, |
|
|
|
categoryForm: {}, |
|
|
|
userLimitForm: {}, |
|
|
|
goodsDetail: {}, |
|
|
|
detailGoodsId: "", |
|
|
|
detailCommentList: [], |
|
|
|
detailCommentTotal: 0, |
|
|
|
detailCommentQuery: { pageNum: 1, pageSize: 10 }, |
|
|
|
goodsQuery: { pageNum: 1, pageSize: 10 }, |
|
|
|
userQuery: { pageNum: 1, pageSize: 10 }, |
|
|
|
complaintQuery: { pageNum: 1, pageSize: 10, status: 0 }, |
|
|
|
auditLogQuery: { pageNumber: 1, pageSize: 10, regionId: "" }, |
|
|
|
goodsColumns: [ |
|
|
|
{ title: "标题", key: "title", minWidth: 180 }, |
|
|
|
{ title: "学校", key: "regionName", width: 130 }, |
|
|
|
{ title: "发布人", key: "userName", width: 120 }, |
|
|
|
{ title: "发布人", key: "userName", width: 130 }, |
|
|
|
{ title: "分类", key: "categoryName", width: 100 }, |
|
|
|
{ title: "价格", key: "price", width: 90 }, |
|
|
|
{ title: "审核", key: "auditStatus", width: 90, render: (h, p) => h("Tag", { props: { color: this.auditColor(p.row.auditStatus) } }, this.auditText(p.row.auditStatus)) }, |
|
|
|
{ title: "状态", key: "status", width: 90, render: (h, p) => h("Tag", { props: { color: p.row.status == 1 ? "green" : "red" } }, p.row.status == 1 ? "正常" : "下架") }, |
|
|
|
{ title: "状态", key: "status", width: 100, render: (h, p) => h("Tag", { props: { color: this.goodsStatusColor(p.row.status) } }, this.goodsStatusText(p.row.status)) }, |
|
|
|
{ title: "举报", key: "complaintCount", width: 80 }, |
|
|
|
{ title: "浏览", key: "browseCount", width: 80 }, |
|
|
|
{ title: "发布时间", key: "createTime", minWidth: 150 }, |
|
|
|
{ title: "操作", width: 250, fixed: "right", render: (h, p) => h("div", [ |
|
|
|
h("Button", { props: { type: "success", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "审核通过") } }, "通过"), |
|
|
|
{ title: "操作", width: 250, fixed: "right", render: (h, p) => { |
|
|
|
if (p.row.status == 3) return h("span", ""); |
|
|
|
return h("div", [ |
|
|
|
/* h("Button", { props: { type: "success", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "审核通过") } }, "通过"), */ |
|
|
|
h("Button", { props: { type: "info", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.viewGoodsDetail(p.row) } }, "详情"), |
|
|
|
h("Button", { props: { type: "warning", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 2, "强制下架") } }, "下架"), |
|
|
|
h("Button", { props: { type: "primary", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "恢复上架") } }, "恢复"), |
|
|
|
h("Button", { props: { type: "error", size: "small" }, on: { click: () => this.handleGoods(p.row, 3, "删除") } }, "删除") |
|
|
|
]) } |
|
|
|
h("Button", { props: { type: "primary", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleGoods(p.row, 1, "恢复上架") } }, "恢复") |
|
|
|
]); |
|
|
|
} } |
|
|
|
], |
|
|
|
categoryColumns: [ |
|
|
|
{ title: "名称", key: "name" }, |
|
|
|
{ title: "排序", key: "sortOrder", width: 100 }, |
|
|
|
{ title: "图标", key: "icon", minWidth: 180 }, |
|
|
|
{ title: "颜色", key: "color", width: 100 }, |
|
|
|
/* { title: "图标", key: "icon", minWidth: 180 }, |
|
|
|
{ title: "颜色", key: "color", width: 100 }, */ |
|
|
|
{ title: "状态", key: "status", width: 90, render: (h, p) => h("Tag", { props: { color: p.row.status == 1 ? "green" : "default" } }, p.row.status == 1 ? "启用" : "禁用") }, |
|
|
|
{ title: "操作", width: 160, render: (h, p) => h("div", [ |
|
|
|
h("Button", { props: { type: "primary", size: "small" }, style: { marginRight: "8px" }, on: { click: () => this.openCategory(p.row) } }, "编辑"), |
|
|
|
h("Button", { props: { type: "error", size: "small" }, on: { click: () => this.deleteCategory(p.row) } }, "删除") |
|
|
|
h("Button", { props: { type: p.row.status == 1 ? "warning" : "success", size: "small" }, on: { click: () => this.handleCategoryStatus(p.row) } }, p.row.status == 1 ? "下架" : "上架") |
|
|
|
]) } |
|
|
|
], |
|
|
|
userColumns: [ |
|
|
|
@ -202,18 +285,28 @@ export default { |
|
|
|
{ title: "操作", width: 100, render: (h, p) => h("Button", { props: { type: "primary", size: "small" }, on: { click: () => this.openUserLimit(p.row) } }, "编辑") } |
|
|
|
], |
|
|
|
complaintColumns: [ |
|
|
|
{ title: "类型", key: "complaintType", width: 100 }, |
|
|
|
{ title: "商品ID", key: "goodsId", minWidth: 170 }, |
|
|
|
{ title: "举报人", key: "reporterName", width: 120 }, |
|
|
|
{ title: "卖家ID", key: "sellerId", minWidth: 170 }, |
|
|
|
{ title: "类型", key: "complaintType", width: 100, render: (h, p) => h("span", this.complaintTypeText(p.row.complaintType)) }, |
|
|
|
{ title: "商品名称", key: "displayTitle", minWidth: 180, render: (h, p) => { |
|
|
|
const title = p.row.displayTitle || "-"; |
|
|
|
if (!p.row.goodsId) return h("span", title); |
|
|
|
return h("a", { on: { click: () => this.viewGoodsDetail(p.row) } }, title); |
|
|
|
} }, |
|
|
|
{ title: "举报人", key: "reporterName", width: 130 }, |
|
|
|
{ title: "卖家账号", key: "sellerAccount", minWidth: 150 }, |
|
|
|
{ title: "原因", key: "reason", minWidth: 220 }, |
|
|
|
{ title: "状态", key: "status", width: 90, render: (h, p) => h("Tag", { props: { color: p.row.status == 0 ? "orange" : (p.row.status == 1 ? "green" : "default") } }, this.complaintStatusText(p.row.status)) }, |
|
|
|
{ title: "状态", key: "status", width: 100, render: (h, p) => h("Tag", { props: { color: p.row.status == 0 ? "orange" : (p.row.status == 1 ? "green" : "default") } }, this.complaintStatusText(p.row.status)) }, |
|
|
|
{ title: "时间", key: "createTime", minWidth: 150 }, |
|
|
|
{ title: "操作", width: 230, fixed: "right", render: (h, p) => h("div", [ |
|
|
|
h("Button", { props: { type: "success", size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleComplaint(p.row, 1) } }, "通过"), |
|
|
|
h("Button", { props: { size: "small" }, style: { marginRight: "6px" }, on: { click: () => this.handleComplaint(p.row, 2) } }, "驳回"), |
|
|
|
h("Button", { props: { type: "error", size: "small" }, on: { click: () => this.handleComplaint(p.row, 1, true) } }, "下架封号") |
|
|
|
]) } |
|
|
|
{ title: "操作", width: 100, fixed: "right", render: (h, p) => h("Button", { props: { type: "primary", size: "small" }, on: { click: () => this.handleComplaint(p.row) } }, "处理") } |
|
|
|
], |
|
|
|
auditLogColumns: [ |
|
|
|
{ title: "ID", key: "id", width: 80 }, |
|
|
|
{ title: "用户手机号", key: "userMobile", minWidth: 130 }, |
|
|
|
{ title: "来源", key: "bizType", minWidth: 150, render: (h, p) => h("span", this.auditBizTypeText(p.row.bizType)) }, |
|
|
|
{ title: "原始内容", key: "rawContent", minWidth: 260 }, |
|
|
|
{ title: "风险等级", key: "riskLevel", width: 100, render: (h, p) => h("Tag", { props: { color: this.riskLevelColor(p.row.riskLevel) } }, this.riskLevelText(p.row.riskLevel)) }, |
|
|
|
{ title: "命中信息", key: "hitWords", minWidth: 180 }, |
|
|
|
{ title: "分类/详情", key: "hitCategories", minWidth: 220 }, |
|
|
|
{ title: "时间", key: "createTime", minWidth: 150 } |
|
|
|
] |
|
|
|
}; |
|
|
|
}, |
|
|
|
@ -226,6 +319,15 @@ export default { |
|
|
|
if (this.activeTab == "category") this.loadCategories(); |
|
|
|
if (this.activeTab == "user") this.loadUserLimits(); |
|
|
|
if (this.activeTab == "complaint") this.loadComplaints(); |
|
|
|
if (this.activeTab == "auditLog") this.loadAuditLogs(); |
|
|
|
}, |
|
|
|
resolveRegionId() { |
|
|
|
try { |
|
|
|
const user = this.getStore("user"); |
|
|
|
return user ? (JSON.parse(user).departmentId || "") : ""; |
|
|
|
} catch (e) { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
}, |
|
|
|
loadGoods() { |
|
|
|
this.loading = true; |
|
|
|
@ -240,7 +342,7 @@ export default { |
|
|
|
}, |
|
|
|
loadCategories() { |
|
|
|
this.loading = true; |
|
|
|
fishCategoryList({}).then(res => { |
|
|
|
fishCategoryList({ regionId: this.resolveRegionId() }).then(res => { |
|
|
|
this.categoryList = res.result || res || []; |
|
|
|
}).finally(() => this.loading = false); |
|
|
|
}, |
|
|
|
@ -258,6 +360,22 @@ export default { |
|
|
|
this.complaintTotal = this.total(res); |
|
|
|
}).finally(() => this.loading = false); |
|
|
|
}, |
|
|
|
loadAuditLogs() { |
|
|
|
this.loading = true; |
|
|
|
this.auditLogQuery.regionId = this.resolveRegionId(); |
|
|
|
fishAuditLogPage(this.auditLogQuery).then(res => { |
|
|
|
this.auditLogList = this.records(res); |
|
|
|
this.auditLogTotal = this.total(res); |
|
|
|
}).finally(() => this.loading = false); |
|
|
|
}, |
|
|
|
searchAuditLogs() { |
|
|
|
this.auditLogQuery.pageNumber = 1; |
|
|
|
this.loadAuditLogs(); |
|
|
|
}, |
|
|
|
resetAuditLogs() { |
|
|
|
this.auditLogQuery = { pageNumber: 1, pageSize: 10, regionId: this.resolveRegionId() }; |
|
|
|
this.loadAuditLogs(); |
|
|
|
}, |
|
|
|
changePage(type, page) { |
|
|
|
this[`${type}Query`].pageNum = page; |
|
|
|
this.handleTabChange(); |
|
|
|
@ -267,6 +385,15 @@ export default { |
|
|
|
this[`${type}Query`].pageNum = 1; |
|
|
|
this.handleTabChange(); |
|
|
|
}, |
|
|
|
changeAuditLogPage(page) { |
|
|
|
this.auditLogQuery.pageNumber = page; |
|
|
|
this.loadAuditLogs(); |
|
|
|
}, |
|
|
|
changeAuditLogPageSize(size) { |
|
|
|
this.auditLogQuery.pageSize = size; |
|
|
|
this.auditLogQuery.pageNumber = 1; |
|
|
|
this.loadAuditLogs(); |
|
|
|
}, |
|
|
|
records(res) { |
|
|
|
const data = res.result || res || {}; |
|
|
|
return data.records || data.content || []; |
|
|
|
@ -281,9 +408,54 @@ export default { |
|
|
|
auditColor(status) { |
|
|
|
return status == 1 ? "green" : (status == 2 ? "red" : "orange"); |
|
|
|
}, |
|
|
|
goodsStatusText(status) { |
|
|
|
if (status == 3) return "已删除"; |
|
|
|
if (status == 2) return "下架"; |
|
|
|
return "正常"; |
|
|
|
}, |
|
|
|
goodsStatusColor(status) { |
|
|
|
if (status == 3) return "default"; |
|
|
|
if (status == 2) return "red"; |
|
|
|
return "green"; |
|
|
|
}, |
|
|
|
complaintStatusText(status) { |
|
|
|
return status == 1 ? "通过" : (status == 2 ? "驳回" : "待处理"); |
|
|
|
}, |
|
|
|
complaintTypeText(type) { |
|
|
|
const map = { |
|
|
|
goods: "商品", |
|
|
|
comment: "评论", |
|
|
|
chat: "聊天" |
|
|
|
}; |
|
|
|
return map[type] || type || "未知"; |
|
|
|
}, |
|
|
|
auditBizTypeText(type) { |
|
|
|
const map = { |
|
|
|
fish_goods_title: "商品标题", |
|
|
|
fish_goods_content: "商品内容", |
|
|
|
fish_want_title: "求购标题", |
|
|
|
fish_want_content: "求购内容", |
|
|
|
fish_release_image: "发布图片", |
|
|
|
fish_comment: "留言评论", |
|
|
|
fish_chat_message: "聊天文字", |
|
|
|
fish_chat_message_image: "聊天图片", |
|
|
|
fish_complaint: "举报内容", |
|
|
|
fish_complaint_image: "举报图片" |
|
|
|
}; |
|
|
|
return map[type] || type || "未知"; |
|
|
|
}, |
|
|
|
riskLevelText(level) { |
|
|
|
if (level === 3) return "高"; |
|
|
|
if (level === 2) return "中"; |
|
|
|
if (level === 1) return "低"; |
|
|
|
return "无"; |
|
|
|
}, |
|
|
|
riskLevelColor(level) { |
|
|
|
if (level === 3) return "red"; |
|
|
|
if (level === 2) return "orange"; |
|
|
|
if (level === 1) return "yellow"; |
|
|
|
return "green"; |
|
|
|
}, |
|
|
|
handleGoods(row, status, title) { |
|
|
|
this.$Modal.confirm({ |
|
|
|
title, |
|
|
|
@ -297,21 +469,26 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
openCategory(row = {}) { |
|
|
|
this.categoryForm = { ...row, statusBool: row.status !== 0 }; |
|
|
|
this.categoryForm = { regionId: this.resolveRegionId(), ...row, statusBool: row.status !== 0 }; |
|
|
|
this.categoryModal = true; |
|
|
|
}, |
|
|
|
saveCategory() { |
|
|
|
const data = { ...this.categoryForm, status: this.categoryForm.statusBool ? 1 : 0 }; |
|
|
|
const data = { ...this.categoryForm, regionId: this.categoryForm.regionId || this.resolveRegionId(), status: this.categoryForm.statusBool ? 1 : 0 }; |
|
|
|
fishCategorySave(data).then(() => { |
|
|
|
this.$Message.success("保存成功"); |
|
|
|
this.loadCategories(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
deleteCategory(row) { |
|
|
|
handleCategoryStatus(row) { |
|
|
|
const nextStatus = row.status == 1 ? 0 : 1; |
|
|
|
const actionText = nextStatus == 1 ? "上架" : "下架"; |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "删除分类", |
|
|
|
content: "确认删除该分类吗?", |
|
|
|
onOk: () => fishCategoryDelete(row.id).then(() => this.loadCategories()) |
|
|
|
title: `${actionText}分类`, |
|
|
|
content: `确认${actionText}分类“${row.name}”吗?`, |
|
|
|
onOk: () => fishCategoryStatus({ id: row.id, status: nextStatus, reason: `${actionText}分类` }).then(() => { |
|
|
|
this.$Message.success(`${actionText}成功`); |
|
|
|
this.loadCategories(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
openUserLimit(row = {}) { |
|
|
|
@ -336,18 +513,73 @@ export default { |
|
|
|
this.loadUserLimits(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleComplaint(row, status, blockUser) { |
|
|
|
viewGoodsDetail(row) { |
|
|
|
const goodsId = row.goodsId || row.id; |
|
|
|
if (!goodsId) { |
|
|
|
this.$Message.warning("该举报没有关联商品"); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.detailGoodsId = goodsId; |
|
|
|
this.detailCommentQuery = { pageNum: 1, pageSize: 10 }; |
|
|
|
fishGoodsDetail(goodsId).then(res => { |
|
|
|
const detail = res.result || res || {}; |
|
|
|
this.goodsDetail = { ...detail, sellerAccount: row.sellerAccount || row.userName }; |
|
|
|
this.goodsDetailModal = true; |
|
|
|
this.loadGoodsComments(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
loadGoodsComments() { |
|
|
|
if (!this.detailGoodsId) return; |
|
|
|
fishGoodsComments(this.detailGoodsId, this.detailCommentQuery).then(res => { |
|
|
|
this.detailCommentList = this.records(res); |
|
|
|
this.detailCommentTotal = this.total(res); |
|
|
|
}); |
|
|
|
}, |
|
|
|
changeDetailCommentPage(page) { |
|
|
|
this.detailCommentQuery.pageNum = page; |
|
|
|
this.loadGoodsComments(); |
|
|
|
}, |
|
|
|
changeDetailCommentPageSize(size) { |
|
|
|
this.detailCommentQuery.pageSize = size; |
|
|
|
this.detailCommentQuery.pageNum = 1; |
|
|
|
this.loadGoodsComments(); |
|
|
|
}, |
|
|
|
deleteGoodsComment(id) { |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "删除评论", |
|
|
|
content: "确认删除该评论吗?", |
|
|
|
onOk: () => fishCommentDelete(id).then(() => { |
|
|
|
this.$Message.success("删除成功"); |
|
|
|
this.loadGoodsComments(); |
|
|
|
}) |
|
|
|
}); |
|
|
|
}, |
|
|
|
handleComplaint(row) { |
|
|
|
this.actionReason = ""; |
|
|
|
this.$Modal.confirm({ |
|
|
|
title: "处理举报", |
|
|
|
render: (h) => h("Input", { |
|
|
|
props: { type: "textarea", autofocus: true, rows: 4, placeholder: "请输入处理意见,确认后将封禁卖家账号" }, |
|
|
|
on: { input: val => this.actionReason = val } |
|
|
|
}), |
|
|
|
onOk: () => { |
|
|
|
const reason = this.actionReason || "举报成立,封禁卖家账号"; |
|
|
|
fishComplaintHandle({ |
|
|
|
complaintId: row.id, |
|
|
|
status, |
|
|
|
blockUser: !!blockUser, |
|
|
|
reason: blockUser ? "举报成立,执行风控" : "", |
|
|
|
handleResult: status == 1 ? "举报通过" : "举报驳回" |
|
|
|
status: 1, |
|
|
|
blockUser: true, |
|
|
|
muted: 1, |
|
|
|
publishBanned: 1, |
|
|
|
permanentBanned: 1, |
|
|
|
reason, |
|
|
|
handleResult: reason |
|
|
|
}).then(() => { |
|
|
|
this.$Message.success("处理成功"); |
|
|
|
this.loadComplaints(); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
</script> |