41 changed files with 3915 additions and 231 deletions
@ -0,0 +1,116 @@ |
|||||||
|
import axiosApi from './AxiosApi.js' |
||||||
|
|
||||||
|
const apiList = { |
||||||
|
getList: `/authority/comment/findCommentList`, |
||||||
|
handleComment: `/authority/comment/handleComment`, |
||||||
|
getSensitiveKeywordList: `/authority/comment/findSensitiveKeywordList`, |
||||||
|
setSensitiveKeyword: `/authority/comment/updateSensitiveKeywordSetting`, |
||||||
|
addSensitiveKeyword: `/authority/comment/addSensitiveKeyword`, |
||||||
|
editSensitiveKeyword: `/authority/comment/updateSensitiveKeyword`, |
||||||
|
deleteSensitiveKeyword: `/authority/comment/deleteSensitiveKeyword`, |
||||||
|
getCommentKeywordList: `/authority/comment/findCommentKeywordList`, |
||||||
|
setCommentKeywordList: `/authority/comment/updateCommentKeywordSetting`, |
||||||
|
addCommentKeyword: `/authority/comment/addCommentKeyword`, |
||||||
|
editCommentKeyword: `/authority/comment/updateCommentKeyword`, |
||||||
|
deleteCommentKeyword: `/authority/comment/deleteCommentKeyword` |
||||||
|
} |
||||||
|
export default { |
||||||
|
// 敏感词列表
|
||||||
|
getList(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.getList, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 操作评论
|
||||||
|
handleComment(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.handleComment, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 查询敏感词列表
|
||||||
|
getSensitiveKeywordList(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.getSensitiveKeywordList, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 敏感词配置
|
||||||
|
setSensitiveKeyword(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.setSensitiveKeyword, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 新增敏感词
|
||||||
|
addSensitiveKeyword(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.addSensitiveKeyword, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 修改敏感词
|
||||||
|
editSensitiveKeyword(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.editSensitiveKeyword, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 删除敏感词
|
||||||
|
deleteSensitiveKeyword(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.deleteSensitiveKeyword, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
|
||||||
|
// 查询关键词列表
|
||||||
|
getCommentKeywordList(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.getCommentKeywordList, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 关键词配置
|
||||||
|
setCommentKeywordList(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.setCommentKeywordList, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 新增关键词
|
||||||
|
addCommentKeyword(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.addCommentKeyword, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 修改关键词
|
||||||
|
editCommentKeyword(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.editCommentKeyword, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 删除关键词
|
||||||
|
deleteCommentKeyword(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.deleteCommentKeyword, |
||||||
|
data |
||||||
|
}) |
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -0,0 +1,67 @@ |
|||||||
|
import axiosApi from './AxiosApi.js' |
||||||
|
|
||||||
|
const apiList = { |
||||||
|
getLabelList: `/authority/memberTag/page`, |
||||||
|
addLabel: `/authority/memberTag`, |
||||||
|
queryTag: `/authority/memberTag/queryTag/`, |
||||||
|
deleteTag: `/authority/memberTag`, |
||||||
|
editTag: `/authority/memberTag`, |
||||||
|
exportTag: `/authority/memberTag/export`, |
||||||
|
getTagInfo: `/authority/memberTag/` |
||||||
|
} |
||||||
|
export default { |
||||||
|
// 标签列表
|
||||||
|
getLabelList(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.getLabelList, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 新建标签
|
||||||
|
addLabel(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.addLabel, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 查询客户标签
|
||||||
|
queryTag(id) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'GET', |
||||||
|
url: `${apiList.queryTag}${id}` |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 删除标签
|
||||||
|
deleteTag(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'DELETE', |
||||||
|
url: apiList.deleteTag, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 修改标签
|
||||||
|
editTag(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'PUT', |
||||||
|
url: apiList.editTag, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 导出标签
|
||||||
|
exportTag(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.exportTag, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 查询标签详情
|
||||||
|
getTagInfo(id) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'GET', |
||||||
|
url: `${apiList.getTagInfo}${id}` |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,76 @@ |
|||||||
|
import axiosApi from './AxiosApi.js' |
||||||
|
|
||||||
|
const apiList = { |
||||||
|
getMemberList: `/authority/member/page`, |
||||||
|
addTag: `/authority/member/addTag`, |
||||||
|
forbiddenMember: `/authority/member/forbidden`, |
||||||
|
getMemberInfo: `/authority/member/query/`, |
||||||
|
getMemberAddress: `/authority/memberAddress/page`, |
||||||
|
getOrderList: `/authority/order/findAdminOrderList`, |
||||||
|
getCustomData: `/authority/order/getOrderStatisticsByMid/`, |
||||||
|
getCommentList: `/authority/comment/findCommentList` |
||||||
|
} |
||||||
|
export default { |
||||||
|
// 客户管理列表
|
||||||
|
getMemberList(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.getMemberList, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 打标签
|
||||||
|
addTag(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.addTag, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 加黑名单
|
||||||
|
forbiddenMember(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.forbiddenMember, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 客户详情
|
||||||
|
getMemberInfo(id) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'GET', |
||||||
|
url: `${apiList.getMemberInfo}${id}` |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 客户消费数据
|
||||||
|
getCustomData(id) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'GET', |
||||||
|
url: `${apiList.getCustomData}${id}` |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 会员订单
|
||||||
|
getOrderList(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.getOrderList, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 客户评价列表
|
||||||
|
getCommentList(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.getCommentList, |
||||||
|
data |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 会员收货地址
|
||||||
|
getMemberAddress(data) { |
||||||
|
return axiosApi({ |
||||||
|
method: 'POST', |
||||||
|
url: apiList.getMemberAddress, |
||||||
|
data |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,8 @@ |
|||||||
|
export function getIntervalTime(start, end, flag) { |
||||||
|
const temp = new Date(end).getTime() - new Date(start).getTime() |
||||||
|
const min = temp / 60000 |
||||||
|
const hour = min / 60 |
||||||
|
if (min < 60 && !flag) return `${min}分钟` |
||||||
|
if (hour < 24 && !flag) return `${hour}小时` |
||||||
|
return `${parseInt(hour / 24)}天` |
||||||
|
} |
@ -0,0 +1,41 @@ |
|||||||
|
<template> |
||||||
|
<el-dialog |
||||||
|
:title="dialogVisible.title" |
||||||
|
:visible.sync="dialogVisible.visible" |
||||||
|
width="30%" |
||||||
|
> |
||||||
|
<span>删除后将无法恢复评论</span> |
||||||
|
<span slot="footer" class="dialog-footer"> |
||||||
|
<el-button @click="close">取 消</el-button> |
||||||
|
<el-button type="primary" @click="confirm">确 定</el-button> |
||||||
|
</span> |
||||||
|
</el-dialog> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
export default { |
||||||
|
props: { |
||||||
|
dialogVisible: { |
||||||
|
type: Object, |
||||||
|
default: () => {} |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return {} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
confirm() { |
||||||
|
|
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.$emit('closed') |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
/deep/.el-dialog__body { |
||||||
|
font-size: 16px; |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,178 @@ |
|||||||
|
<template> |
||||||
|
<div class="detail_page"> |
||||||
|
<ul> |
||||||
|
<li v-if="info.sensitiveFlag"> |
||||||
|
<p>敏感词</p> |
||||||
|
<p>{{ info.sensitiveKeywordList.join() }}</p> |
||||||
|
</li> |
||||||
|
<li |
||||||
|
v-for="(item,index) in list" :key="index" :class="[{'active_li': info.additionalComment && index === 2}]" |
||||||
|
:time="time" |
||||||
|
> |
||||||
|
<p v-if="item.show">{{ item.name }}</p> |
||||||
|
<p v-if="item.show"> |
||||||
|
<span v-if="item.type===1">{{ item.value }}</span> |
||||||
|
<span v-else> |
||||||
|
<img v-for="(ob, i) in item.imgList" :key="i" :src="ob" alt="" /> |
||||||
|
</span> |
||||||
|
</p> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
<div class="btn_list"> |
||||||
|
<el-button type="primary" @click="confirm">{{ info.hideFlag ? '显示' : '隐藏' }}</el-button> |
||||||
|
<el-button class="delete" @click="deletes">删除</el-button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import { getIntervalTime } from '@/utils/date' |
||||||
|
export default { |
||||||
|
props: { |
||||||
|
info: { |
||||||
|
type: Object, |
||||||
|
default: () => {} |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
list: [ |
||||||
|
{ |
||||||
|
name: '评论', |
||||||
|
value: '商品好看有实用,强烈推荐购买。这台电脑买来不是玩游戏的,没那爱好。主要用来给孩子上网课,大人偶尔会看看电影视频这些,所以配的4K显示器。京东快递很麻利,从山东调货,隔天就到了,非常感谢。', |
||||||
|
type: 1, |
||||||
|
fields: 'commentText' |
||||||
|
}, |
||||||
|
{ |
||||||
|
name: '图片', |
||||||
|
value: '商品好看有实用,强烈推荐购买。这台电脑买来不是玩游戏的,没那爱好。主要用来给孩子上网课,大人偶尔会看看电影视频这些,所以配的4K显示器。京东快递很麻利,从山东调货,隔天就到了,非常感谢。', |
||||||
|
type: 2, |
||||||
|
imgList: [ |
||||||
|
'http://cereshop.oss-cn-shenzhen.aliyuncs.com/admin/2020/07/6b0d6d7a-8ec8-4fdd-b75d-8b6590683543.jpg', |
||||||
|
'http://cereshop.oss-cn-shenzhen.aliyuncs.com/admin/2020/07/6b0d6d7a-8ec8-4fdd-b75d-8b6590683543.jpg', |
||||||
|
'http://cereshop.oss-cn-shenzhen.aliyuncs.com/admin/2020/07/6b0d6d7a-8ec8-4fdd-b75d-8b6590683543.jpg', |
||||||
|
'http://cereshop.oss-cn-shenzhen.aliyuncs.com/admin/2020/07/6b0d6d7a-8ec8-4fdd-b75d-8b6590683543.jpg', |
||||||
|
'http://cereshop.oss-cn-shenzhen.aliyuncs.com/admin/2020/07/6b0d6d7a-8ec8-4fdd-b75d-8b6590683543.jpg', |
||||||
|
'http://cereshop.oss-cn-shenzhen.aliyuncs.com/admin/2020/07/6b0d6d7a-8ec8-4fdd-b75d-8b6590683543.jpg' |
||||||
|
], |
||||||
|
fields: 'commentImgs' |
||||||
|
}, |
||||||
|
{ |
||||||
|
name: '追评', |
||||||
|
value: '机器外观精致小巧,性能也足够家用。', |
||||||
|
type: 1, |
||||||
|
fields: 'additionalComment', |
||||||
|
fieldsItem: 'commentText' |
||||||
|
}, |
||||||
|
{ |
||||||
|
name: '图片', |
||||||
|
value: '机器外观精致小巧,性能也足够家用。', |
||||||
|
type: 2, |
||||||
|
imgList: [ |
||||||
|
'http://cereshop.oss-cn-shenzhen.aliyuncs.com/admin/2020/07/6b0d6d7a-8ec8-4fdd-b75d-8b6590683543.jpg', |
||||||
|
'http://cereshop.oss-cn-shenzhen.aliyuncs.com/admin/2020/07/6b0d6d7a-8ec8-4fdd-b75d-8b6590683543.jpg', |
||||||
|
'http://cereshop.oss-cn-shenzhen.aliyuncs.com/admin/2020/07/6b0d6d7a-8ec8-4fdd-b75d-8b6590683543.jpg' |
||||||
|
], |
||||||
|
fields: 'additionalComment', |
||||||
|
fieldsItem: 'commentImgs' |
||||||
|
} |
||||||
|
], |
||||||
|
time: '' |
||||||
|
} |
||||||
|
}, |
||||||
|
watch: { |
||||||
|
info: { |
||||||
|
handler() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
deep: true |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
getList() { |
||||||
|
const _ = this |
||||||
|
_.list.map(item => { |
||||||
|
if (_.info[item.fields]) { |
||||||
|
item.value = _.info[item.fields] |
||||||
|
item.show = true |
||||||
|
if (item.fields === 'additionalComment') { |
||||||
|
item.value = _.info.additionalComment[item.fieldsItem] |
||||||
|
if (item.fieldsItem === 'commentImgs') { |
||||||
|
item.imgList = _.info.additionalComment.commentImgsFlag ? _.info.additionalComment.commentImgs.split(',') : [] |
||||||
|
item.show = _.info.additionalComment.commentImgsFlag |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if (item.fields === 'commentImgs') { |
||||||
|
item.imgList = _.info.commentImgsFlag ? _.info.commentImgs.split(',') : [] |
||||||
|
item.show = _.info.commentImgsFlag |
||||||
|
} |
||||||
|
} |
||||||
|
}) |
||||||
|
if (_.info.additionalComment) { |
||||||
|
_.time = `${getIntervalTime(_.info.createTime, _.info.additionalComment.createTime)}后追加评论` |
||||||
|
} |
||||||
|
}, |
||||||
|
deletes() { |
||||||
|
this.$emit('deletes') |
||||||
|
}, |
||||||
|
confirm() { |
||||||
|
this.$emit('handle') |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
.detail_page { |
||||||
|
ul { |
||||||
|
overflow: hidden; |
||||||
|
li { |
||||||
|
overflow: hidden; |
||||||
|
p { |
||||||
|
overflow: hidden; |
||||||
|
font-size: 16px; |
||||||
|
float: left; |
||||||
|
&:nth-child(1) { |
||||||
|
font-weight: 600; |
||||||
|
width: 70px; |
||||||
|
} |
||||||
|
&:nth-child(2) { |
||||||
|
width: calc(100% - 75px); |
||||||
|
img { |
||||||
|
float: left; |
||||||
|
width: calc(25% - 8px); |
||||||
|
height: 135px; |
||||||
|
border-radius: 4px; |
||||||
|
margin-right: 8px; |
||||||
|
margin-bottom: 10px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
.active_li { |
||||||
|
border-top: 1px solid #E0E5EB; |
||||||
|
padding-top: 50px; |
||||||
|
position: relative; |
||||||
|
&:after { |
||||||
|
content: attr(time); |
||||||
|
position: absolute; |
||||||
|
top: 10px; |
||||||
|
left: 0; |
||||||
|
display: block; |
||||||
|
color: #F18B48; |
||||||
|
font-size: 16px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
.btn_list { |
||||||
|
text-align: center; |
||||||
|
.delete { |
||||||
|
margin-left: 20px !important; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,293 @@ |
|||||||
|
<template> |
||||||
|
<div class="comment_manage_page"> |
||||||
|
<div class="content"> |
||||||
|
<el-tabs |
||||||
|
v-model="formParams.type" |
||||||
|
@tab-click="selectItem" |
||||||
|
> |
||||||
|
<el-tab-pane |
||||||
|
v-for="(item, index) in tabList" |
||||||
|
:key="index" |
||||||
|
:label="item.name" |
||||||
|
:name="item.id" |
||||||
|
/> |
||||||
|
</el-tabs> |
||||||
|
<div class="toolbar"> |
||||||
|
<el-form |
||||||
|
:inline="true" |
||||||
|
:model="formParams" |
||||||
|
> |
||||||
|
<el-form-item label="商家名称"> |
||||||
|
<el-input v-model="formParams.storeName" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
|
||||||
|
<el-form-item label="商家编码"> |
||||||
|
<el-input v-model="formParams.tenantCode" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
|
||||||
|
<el-form-item label="商品ID"> |
||||||
|
<el-input v-model="formParams.productId" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
|
||||||
|
<el-form-item label="关键词"> |
||||||
|
<el-input v-model="formParams.keyword" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
|
||||||
|
<el-form-item> |
||||||
|
<el-button |
||||||
|
type="primary" |
||||||
|
size="mini" |
||||||
|
@click="query" |
||||||
|
> |
||||||
|
查询 |
||||||
|
</el-button> |
||||||
|
<el-button |
||||||
|
plain |
||||||
|
size="mini" |
||||||
|
@click="reset" |
||||||
|
> |
||||||
|
重置 |
||||||
|
</el-button> |
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="content_table"> |
||||||
|
<div class="table"> |
||||||
|
<el-table |
||||||
|
:data="tableData.commentDTOList" |
||||||
|
border |
||||||
|
style="width: 100%" |
||||||
|
> |
||||||
|
<el-table-column |
||||||
|
prop="storeName" |
||||||
|
label="商家名称" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="tenantCode" |
||||||
|
label="商家编码" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="productId" |
||||||
|
label="商品ID" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="memberAccount" |
||||||
|
label="评论人" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="createTime" |
||||||
|
label="评论日期" |
||||||
|
/> |
||||||
|
<el-table-column label="操作"> |
||||||
|
<template |
||||||
|
slot-scope="scope" |
||||||
|
> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="details(scope.row)" |
||||||
|
> |
||||||
|
查看 |
||||||
|
</el-button> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="handle(scope.row)" |
||||||
|
> |
||||||
|
{{ scope.row.hideFlag? '显示' : '隐藏' }} |
||||||
|
</el-button> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="deletes(scope.row.id)" |
||||||
|
> |
||||||
|
删除 |
||||||
|
</el-button> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
</el-table> |
||||||
|
</div> |
||||||
|
<pagination |
||||||
|
v-show="tableData.total > 0" |
||||||
|
:limit.sync="formParams.pageSize" |
||||||
|
:page.sync="formParams.pageIndex" |
||||||
|
:total="Number(tableData.total)" |
||||||
|
@pagination="fetch" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<Dialog |
||||||
|
:title="dialog.title" |
||||||
|
:visible.sync="dialog.visible" |
||||||
|
:fullscreen="!true" |
||||||
|
:before-close="close" |
||||||
|
width="55%" |
||||||
|
> |
||||||
|
<detail v-if="dialog.visible" :info="dialog.info" @deletes="deletes" @handle="handle" /> |
||||||
|
</Dialog> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Pagination from '@/components/Pagination' |
||||||
|
import detail from './details' |
||||||
|
import { Dialog } from 'element-ui' |
||||||
|
import Comment from '@/api/Comment' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
Pagination, |
||||||
|
Dialog, |
||||||
|
detail |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
formParams: { |
||||||
|
keyword: '', |
||||||
|
storeName: '', |
||||||
|
tenantCode: '', |
||||||
|
productId: '', |
||||||
|
pageSize: 10, |
||||||
|
pageIndex: 1, |
||||||
|
type: '1' |
||||||
|
}, |
||||||
|
date: [], |
||||||
|
tableData: {}, |
||||||
|
tabList: [ |
||||||
|
{ name: '全部评论', id: '1' }, |
||||||
|
{ name: '敏感评论', id: '2' } |
||||||
|
], |
||||||
|
dialog: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getList() { |
||||||
|
const res = await Comment.getList(this.formParams) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
this.tableData = resData.data |
||||||
|
} |
||||||
|
}, |
||||||
|
query() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
details(info) { |
||||||
|
this.dialog = { |
||||||
|
title: '评论详情', |
||||||
|
visible: true, |
||||||
|
info |
||||||
|
} |
||||||
|
}, |
||||||
|
handle(item) { |
||||||
|
const _ = this |
||||||
|
const ob = item || _.dialog.info |
||||||
|
const params = { |
||||||
|
id: ob.id, |
||||||
|
action: ob.hideFlag ? 1 : 2 |
||||||
|
} |
||||||
|
const t = ob.hideFlag ? '显示' : '隐藏' |
||||||
|
_.$confirm(`确定要${t}该评论`, `${t}评论`, { |
||||||
|
confirmButtonText: '确定', |
||||||
|
cancelButtonText: '取消', |
||||||
|
type: 'warning' |
||||||
|
}).then(() => { |
||||||
|
Comment.handleComment(params).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.getList() |
||||||
|
_.$message.success(`${t}成功`) |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
}, |
||||||
|
deletes(id) { |
||||||
|
const _ = this |
||||||
|
const params = { |
||||||
|
id: id || _.dialog.info.id, |
||||||
|
action: 3 |
||||||
|
} |
||||||
|
_.$confirm('删除后将无法恢复评论', '删除', { |
||||||
|
confirmButtonText: '确定', |
||||||
|
cancelButtonText: '取消', |
||||||
|
type: 'warning' |
||||||
|
}).then(() => { |
||||||
|
Comment.handleComment(params).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.dialog = {} |
||||||
|
_.getList() |
||||||
|
_.$message.success('删除成功') |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
}, |
||||||
|
reset() { |
||||||
|
this.formParams = { |
||||||
|
keyword: '', |
||||||
|
storeName: '', |
||||||
|
tenantCode: '', |
||||||
|
productId: '', |
||||||
|
pageSize: 10, |
||||||
|
pageIndex: 1 |
||||||
|
} |
||||||
|
}, |
||||||
|
fetch() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
selectItem() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.dialog = {} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
|
||||||
|
.comment_manage_page{ |
||||||
|
padding: 10px 20px; |
||||||
|
box-sizing: border-box; |
||||||
|
.content { |
||||||
|
background-color: #fff; |
||||||
|
padding: 20px; |
||||||
|
.toolbar { |
||||||
|
padding: 10px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-table { |
||||||
|
th { |
||||||
|
background: #EEF3FF; |
||||||
|
color:#333333; |
||||||
|
font-size:16px; |
||||||
|
font-weight: 400; |
||||||
|
border-color: #E0E5EB; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
td { |
||||||
|
font-size: 14px; |
||||||
|
text-align: center; |
||||||
|
color: #666666; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-dialog__wrapper { |
||||||
|
.el-dialog__header { |
||||||
|
height: 70px; |
||||||
|
background-color: #3A68F2; |
||||||
|
.el-dialog__title { |
||||||
|
font-size:24px; |
||||||
|
color: #fff; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-message-box__btns .el-button { |
||||||
|
margin-right: 10px !important; |
||||||
|
} |
||||||
|
</style> |
||||||
|
|
@ -0,0 +1,66 @@ |
|||||||
|
<template> |
||||||
|
<div class="add_page"> |
||||||
|
<el-form |
||||||
|
ref="form" :model="form" :rules="rules" |
||||||
|
required |
||||||
|
label-width="100px" |
||||||
|
> |
||||||
|
<el-form-item prop="keyword" label="关键词"> |
||||||
|
<el-input v-model="form.keyword" /> |
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
<div class="btn_list"> |
||||||
|
<el-button type="primary" @click="confirm">确定</el-button> |
||||||
|
<el-button class="delete" @click="cancel">取消</el-button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
export default { |
||||||
|
props: { |
||||||
|
dialog: { |
||||||
|
type: Object, |
||||||
|
default: () => {} |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
keyword: this.dialog.info.keyword || '' |
||||||
|
}, |
||||||
|
rules: { |
||||||
|
keyword: [ |
||||||
|
{ required: true, message: '请输入关键词', trigger: 'blur' } |
||||||
|
] |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
confirm() { |
||||||
|
const vm = this |
||||||
|
vm.$refs.form.validate((valid) => { |
||||||
|
if (valid) { |
||||||
|
vm.$emit('add', vm.form) |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
cancel() { |
||||||
|
this.$emit('close') |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
.add_page { |
||||||
|
padding: 0 50px; |
||||||
|
.btn_list { |
||||||
|
padding-top: 20px; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
} |
||||||
|
/deep/.el-button { |
||||||
|
// margin-right: 30px; |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,245 @@ |
|||||||
|
<template> |
||||||
|
<div class="keyword_page"> |
||||||
|
<div class="head"> |
||||||
|
<el-form ref="formPage" action="" :model="formPage" inline> |
||||||
|
<el-form-item label="关键词"> |
||||||
|
<el-input v-model="formPage.keyword" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item> |
||||||
|
<el-button type="primary" size="mini" @click="fetch">查询</el-button> |
||||||
|
<el-button size="mini" @click="reset">重置</el-button> |
||||||
|
|
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
<div class="setting"> |
||||||
|
<el-form ref="form" :model="form" inline> |
||||||
|
<el-form-item label="状态"> |
||||||
|
<!-- <el-radio-group v-model="form.enabled" @change="changeItem"> |
||||||
|
<el-radio :label="1">开启</el-radio> |
||||||
|
<el-radio :label="0">关闭</el-radio> |
||||||
|
</el-radio-group> --> |
||||||
|
<el-switch |
||||||
|
v-model="form.enabled" |
||||||
|
:active-value="1" |
||||||
|
:inactive-value="0" |
||||||
|
@change="changeItem" |
||||||
|
/> |
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="content"> |
||||||
|
<el-button type="primary" size="mini" style="margin-bottom: 20px" @click="addCommentKeyword">新增</el-button> |
||||||
|
<el-table |
||||||
|
:data="tableData.commentKeywordList" |
||||||
|
border |
||||||
|
style="width: 100%" |
||||||
|
> |
||||||
|
<el-table-column |
||||||
|
type="index" |
||||||
|
width="100" |
||||||
|
label="序号" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="keyword" |
||||||
|
label="关键词" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="createTime" |
||||||
|
label="创建时间" |
||||||
|
/> |
||||||
|
<el-table-column label="操作"> |
||||||
|
<template |
||||||
|
slot-scope="scope" |
||||||
|
> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="edit(scope.row)" |
||||||
|
> |
||||||
|
修改 |
||||||
|
</el-button> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="deletes(scope.row.id)" |
||||||
|
> |
||||||
|
删除 |
||||||
|
</el-button> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
</el-table> |
||||||
|
<pagination |
||||||
|
v-show="tableData.total > 0" |
||||||
|
:limit.sync="formPage.pageSize" |
||||||
|
:page.sync="formPage.pageIndex" |
||||||
|
:total="Number(tableData.total)" |
||||||
|
@pagination="fetch" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
<Dialog |
||||||
|
:title="dialog.title" |
||||||
|
:visible.sync="dialog.visible" |
||||||
|
:fullscreen="!true" |
||||||
|
:before-close="close" |
||||||
|
width="30%" |
||||||
|
> |
||||||
|
<add v-if="dialog.visible" :dialog="dialog" @add="add" @close="close" /> |
||||||
|
</Dialog> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Comment from '@/api/Comment' |
||||||
|
import Pagination from '@/components/Pagination' |
||||||
|
import { Dialog } from 'element-ui' |
||||||
|
import add from './add' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
Pagination, |
||||||
|
Dialog, |
||||||
|
add |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
enabled: 0 |
||||||
|
}, |
||||||
|
formPage: { |
||||||
|
keyword: '', |
||||||
|
pagesize: 10, |
||||||
|
pageSize: 10, |
||||||
|
pageIndex: 1 |
||||||
|
}, |
||||||
|
tableData: {}, |
||||||
|
dialog: { |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getCommentKeywordList() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getCommentKeywordList() { |
||||||
|
const res = await Comment.getCommentKeywordList(this.formPage) |
||||||
|
const ob = res.data |
||||||
|
if (ob.code === 0) { |
||||||
|
this.tableData = ob.data |
||||||
|
Object.keys(this.form).forEach(item => { |
||||||
|
if ( ob.data.commentKeywordList[0] && ob.data.commentKeywordList[0][item] !== undefined) { |
||||||
|
this.form[item] = ob.data.commentKeywordList[0][item] |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
}, |
||||||
|
changeItem() { |
||||||
|
Comment.setCommentKeywordList(this.form).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
this.getCommentKeywordList() |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
addCommentKeyword() { |
||||||
|
this.dialog = { |
||||||
|
title: '新增', |
||||||
|
visible: true, |
||||||
|
info: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
add(keyword) { |
||||||
|
const _ = this |
||||||
|
const key = _.dialog.edit ? 'editCommentKeyword' : 'addCommentKeyword' |
||||||
|
if (_.dialog.edit) { |
||||||
|
keyword.id = _.dialog.info.id |
||||||
|
} |
||||||
|
Comment[key](Object.assign({}, _.form, keyword )).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.getCommentKeywordList() |
||||||
|
_.$message.success(`${_.dialog.edit ? '修改' : '新增'}成功`) |
||||||
|
_.close() |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.dialog = {} |
||||||
|
}, |
||||||
|
fetch() { |
||||||
|
this.getCommentKeywordList() |
||||||
|
}, |
||||||
|
reset() { |
||||||
|
this.formPage.keyword = '' |
||||||
|
}, |
||||||
|
edit(item) { |
||||||
|
this.dialog = { |
||||||
|
title: '修改', |
||||||
|
visible: true, |
||||||
|
edit: true, |
||||||
|
info: item |
||||||
|
} |
||||||
|
}, |
||||||
|
deletes(id) { |
||||||
|
const _ = this |
||||||
|
_.$confirm('确定要删除该条关键词', `删除`, { |
||||||
|
confirmButtonText: '确定', |
||||||
|
cancelButtonText: '取消', |
||||||
|
type: 'warning' |
||||||
|
}).then(() => { |
||||||
|
Comment.deleteCommentKeyword({ id }).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.$message.success('删除成功') |
||||||
|
_.getCommentKeywordList() |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
.keyword_page { |
||||||
|
margin-top: 10px; |
||||||
|
background-color: #fff; |
||||||
|
height: calc(100% - 10px); |
||||||
|
padding: 20px 30px; |
||||||
|
.setting { |
||||||
|
height: 80px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-form-item__label { |
||||||
|
text-align: left !important; |
||||||
|
font-weight: 400; |
||||||
|
} |
||||||
|
/deep/.el-form-item { |
||||||
|
margin-right: 50px; |
||||||
|
} |
||||||
|
/deep/ .el-table { |
||||||
|
th { |
||||||
|
background: #EEF3FF; |
||||||
|
color:#333333; |
||||||
|
font-size:16px; |
||||||
|
font-weight: 400; |
||||||
|
border-color: #E0E5EB; |
||||||
|
// text-align: center; |
||||||
|
} |
||||||
|
td { |
||||||
|
font-size: 14px; |
||||||
|
// text-align: center; |
||||||
|
color: #666666; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-dialog__wrapper { |
||||||
|
.el-dialog__header { |
||||||
|
height: 70px; |
||||||
|
background-color: #3A68F2; |
||||||
|
.el-dialog__title { |
||||||
|
font-size:24px; |
||||||
|
color: #fff; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,66 @@ |
|||||||
|
<template> |
||||||
|
<div class="add_page"> |
||||||
|
<el-form |
||||||
|
ref="form" :model="form" :rules="rules" |
||||||
|
required |
||||||
|
label-width="100px" |
||||||
|
> |
||||||
|
<el-form-item prop="sensitiveKeyword" label="敏感词"> |
||||||
|
<el-input v-model="form.sensitiveKeyword" /> |
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
<div class="btn_list"> |
||||||
|
<el-button type="primary" @click="confirm">确定</el-button> |
||||||
|
<el-button class="delete" @click="cancel">取消</el-button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
export default { |
||||||
|
props: { |
||||||
|
dialog: { |
||||||
|
type: Object, |
||||||
|
default: () => {} |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
sensitiveKeyword: this.dialog.info.sensitiveKeyword || '' |
||||||
|
}, |
||||||
|
rules: { |
||||||
|
sensitiveKeyword: [ |
||||||
|
{ required: true, message: '请输入敏感词', trigger: 'blur' } |
||||||
|
] |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
confirm() { |
||||||
|
const vm = this |
||||||
|
vm.$refs.form.validate((valid) => { |
||||||
|
if (valid) { |
||||||
|
vm.$emit('add', vm.form) |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
cancel() { |
||||||
|
this.$emit('close') |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
.add_page { |
||||||
|
padding: 0 50px; |
||||||
|
.btn_list { |
||||||
|
padding-top: 20px; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
} |
||||||
|
/deep/.el-button { |
||||||
|
// margin-right: 30px; |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,253 @@ |
|||||||
|
<template> |
||||||
|
<div class="sensitive_word_page"> |
||||||
|
<div class="head"> |
||||||
|
<el-form ref="formPage" action="" :model="formPage" inline> |
||||||
|
<el-form-item label="关键词"> |
||||||
|
<el-input v-model="formPage.keyword" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item> |
||||||
|
<el-button type="primary" size="mini" @click="fetch">查询</el-button> |
||||||
|
<el-button size="mini" @click="reset">重置</el-button> |
||||||
|
|
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
<div class="setting"> |
||||||
|
<el-form ref="form" :model="form" inline> |
||||||
|
<el-form-item label="状态"> |
||||||
|
<!-- <el-radio-group v-model="form.enabled" @change="changeItem"> |
||||||
|
<el-radio :label="1">开启</el-radio> |
||||||
|
<el-radio :label="0">关闭</el-radio> |
||||||
|
</el-radio-group> --> |
||||||
|
<el-switch |
||||||
|
v-model="form.enabled" |
||||||
|
:active-value="1" |
||||||
|
:inactive-value="0" |
||||||
|
@change="changeItem" |
||||||
|
/> |
||||||
|
</el-form-item> |
||||||
|
|
||||||
|
<el-form-item label="处理措施"> |
||||||
|
<el-radio-group v-model="form.action" @change="changeItem"> |
||||||
|
<el-radio :label="1">禁止发布</el-radio> |
||||||
|
<el-radio :label="2">需审核</el-radio> |
||||||
|
</el-radio-group> |
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="content"> |
||||||
|
<el-button type="primary" size="mini" style="margin-bottom: 20px" @click="addSensitiveKeyword">新增</el-button> |
||||||
|
<el-table |
||||||
|
:data="tableData.sensitiveKeywordList" |
||||||
|
border |
||||||
|
style="width: 100%" |
||||||
|
> |
||||||
|
<el-table-column |
||||||
|
type="index" |
||||||
|
width="100" |
||||||
|
label="序号" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="sensitiveKeyword" |
||||||
|
label="敏感词" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="createTime" |
||||||
|
label="创建时间" |
||||||
|
/> |
||||||
|
<el-table-column label="操作"> |
||||||
|
<template |
||||||
|
slot-scope="scope" |
||||||
|
> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="edit(scope.row)" |
||||||
|
> |
||||||
|
修改 |
||||||
|
</el-button> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="deletes(scope.row.id)" |
||||||
|
> |
||||||
|
删除 |
||||||
|
</el-button> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
</el-table> |
||||||
|
<pagination |
||||||
|
v-show="tableData.total > 0" |
||||||
|
:limit.sync="formPage.pageSize" |
||||||
|
:page.sync="formPage.pageIndex" |
||||||
|
:total="Number(tableData.total)" |
||||||
|
@pagination="fetch" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
<Dialog |
||||||
|
:title="dialog.title" |
||||||
|
:visible.sync="dialog.visible" |
||||||
|
:fullscreen="!true" |
||||||
|
:before-close="close" |
||||||
|
width="30%" |
||||||
|
> |
||||||
|
<add v-if="dialog.visible" :dialog="dialog" @add="add" @close="close" /> |
||||||
|
</Dialog> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Comment from '@/api/Comment' |
||||||
|
import Pagination from '@/components/Pagination' |
||||||
|
import { Dialog } from 'element-ui' |
||||||
|
import add from './add' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
Pagination, |
||||||
|
Dialog, |
||||||
|
add |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
enabled: 0, |
||||||
|
action: 1 |
||||||
|
}, |
||||||
|
formPage: { |
||||||
|
keyword: '', |
||||||
|
pagesize: 10, |
||||||
|
pageSize: 10, |
||||||
|
pageIndex: 1 |
||||||
|
}, |
||||||
|
tableData: {}, |
||||||
|
dialog: { |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getSensitiveKeywordList() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getSensitiveKeywordList() { |
||||||
|
const res = await Comment.getSensitiveKeywordList(this.formPage) |
||||||
|
const ob = res.data |
||||||
|
if (ob.code === 0) { |
||||||
|
this.tableData = ob.data |
||||||
|
Object.keys(this.form).forEach(item => { |
||||||
|
if ( ob.data.sensitiveKeywordList[0] && ob.data.sensitiveKeywordList[0][item] !== undefined) { |
||||||
|
this.form[item] = ob.data.sensitiveKeywordList[0][item] |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
}, |
||||||
|
changeItem() { |
||||||
|
Comment.setSensitiveKeyword(this.form).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
this.getSensitiveKeywordList() |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
addSensitiveKeyword() { |
||||||
|
this.dialog = { |
||||||
|
title: '新增', |
||||||
|
visible: true, |
||||||
|
info: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
add(keyword) { |
||||||
|
const _ = this |
||||||
|
const key = _.dialog.edit ? 'editSensitiveKeyword' : 'addSensitiveKeyword' |
||||||
|
if (_.dialog.edit) { |
||||||
|
keyword.id = _.dialog.info.id |
||||||
|
} |
||||||
|
Comment[key](Object.assign({}, _.form, keyword )).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.getSensitiveKeywordList() |
||||||
|
_.$message.success(`${_.dialog.edit ? '修改' : '新增'}成功`) |
||||||
|
_.close() |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.dialog = {} |
||||||
|
}, |
||||||
|
fetch() { |
||||||
|
this.getSensitiveKeywordList() |
||||||
|
}, |
||||||
|
reset() { |
||||||
|
this.formPage.keyword = '' |
||||||
|
}, |
||||||
|
edit(item) { |
||||||
|
this.dialog = { |
||||||
|
title: '修改', |
||||||
|
visible: true, |
||||||
|
edit: true, |
||||||
|
info: item |
||||||
|
} |
||||||
|
}, |
||||||
|
deletes(id) { |
||||||
|
const _ = this |
||||||
|
_.$confirm('确定要删除该条敏感词', `删除`, { |
||||||
|
confirmButtonText: '确定', |
||||||
|
cancelButtonText: '取消', |
||||||
|
type: 'warning' |
||||||
|
}).then(() => { |
||||||
|
Comment.deleteSensitiveKeyword({ id }).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.$message.success('删除成功') |
||||||
|
_.getSensitiveKeywordList() |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
.sensitive_word_page { |
||||||
|
margin-top: 10px; |
||||||
|
background-color: #fff; |
||||||
|
height: calc(100% - 10px); |
||||||
|
padding: 20px 30px; |
||||||
|
.setting { |
||||||
|
height: 80px; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-form-item__label { |
||||||
|
text-align: left !important; |
||||||
|
font-weight: 400; |
||||||
|
} |
||||||
|
/deep/.el-form-item { |
||||||
|
margin-right: 50px; |
||||||
|
} |
||||||
|
/deep/ .el-table { |
||||||
|
th { |
||||||
|
background: #EEF3FF; |
||||||
|
color:#333333; |
||||||
|
font-size:16px; |
||||||
|
font-weight: 400; |
||||||
|
border-color: #E0E5EB; |
||||||
|
// text-align: center; |
||||||
|
} |
||||||
|
td { |
||||||
|
font-size: 14px; |
||||||
|
// text-align: center; |
||||||
|
color: #666666; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-dialog__wrapper { |
||||||
|
.el-dialog__header { |
||||||
|
height: 70px; |
||||||
|
background-color: #3A68F2; |
||||||
|
.el-dialog__title { |
||||||
|
font-size:24px; |
||||||
|
color: #fff; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,97 @@ |
|||||||
|
<template> |
||||||
|
<div class="order_page"> |
||||||
|
<el-table |
||||||
|
:data="tableData.records" |
||||||
|
border |
||||||
|
style="width: 80%" |
||||||
|
> |
||||||
|
<el-table-column |
||||||
|
prop="username" |
||||||
|
label="收货人" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="phone" |
||||||
|
label="联系电话" |
||||||
|
/><el-table-column |
||||||
|
prop="address" |
||||||
|
label="地址" |
||||||
|
/> |
||||||
|
</el-table> |
||||||
|
<pagination |
||||||
|
v-show="tableData.total > 0" |
||||||
|
:limit.sync="form.size" |
||||||
|
:page.sync="form.current" |
||||||
|
:total="Number(tableData.total)" |
||||||
|
@pagination="fetch" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Pagination from '@/components/Pagination' |
||||||
|
import Member from '@/api/Member' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
Pagination |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
"current": 1, |
||||||
|
"map": {}, |
||||||
|
"model": { |
||||||
|
"address": "", |
||||||
|
"area": "", |
||||||
|
"city": "", |
||||||
|
"cityInfo": "", |
||||||
|
"id": 0, |
||||||
|
"isDefault": true, |
||||||
|
"mid": 0, |
||||||
|
"phone": "", |
||||||
|
"province": "", |
||||||
|
"tag": "", |
||||||
|
"username": "" |
||||||
|
}, |
||||||
|
"order": "descending", |
||||||
|
"size": 10, |
||||||
|
"sort": "id" |
||||||
|
}, |
||||||
|
tableData: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getMemberAddress() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getMemberAddress() { |
||||||
|
this.form.model.mid = this.$route.query.id |
||||||
|
const res = await Member.getMemberAddress(this.form) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
this.tableData = resData.data |
||||||
|
} |
||||||
|
}, |
||||||
|
fetch() { |
||||||
|
this.getMemberAddress() |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
/deep/ .el-table { |
||||||
|
th { |
||||||
|
background: #EEF3FF; |
||||||
|
color:#333333; |
||||||
|
font-size:16px; |
||||||
|
font-weight: 400; |
||||||
|
border-color: #E0E5EB; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
td { |
||||||
|
font-size: 14px; |
||||||
|
text-align: center; |
||||||
|
color: #666666; |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,157 @@ |
|||||||
|
<template> |
||||||
|
<div class="order_page"> |
||||||
|
<el-table |
||||||
|
:data="tableData.commentDTOList" |
||||||
|
border |
||||||
|
style="width: 80%" |
||||||
|
> |
||||||
|
<el-table-column |
||||||
|
prop="storeName" |
||||||
|
label="店铺名称" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="productName" |
||||||
|
label="商品名称" |
||||||
|
/> |
||||||
|
<el-table-column label="操作"> |
||||||
|
<template |
||||||
|
slot-scope="scope" |
||||||
|
> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="details(scope.row)" |
||||||
|
> |
||||||
|
查看 |
||||||
|
</el-button> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
</el-table> |
||||||
|
<pagination |
||||||
|
v-show="tableData.total > 0" |
||||||
|
:limit.sync="form.pageSize" |
||||||
|
:page.sync="form.pageIndex" |
||||||
|
:total="Number(tableData.total)" |
||||||
|
@pagination="fetch" |
||||||
|
/> |
||||||
|
<Dialog |
||||||
|
:title="dialog.title" |
||||||
|
:visible.sync="dialog.visible" |
||||||
|
:fullscreen="!true" |
||||||
|
:before-close="close" |
||||||
|
width="55%" |
||||||
|
> |
||||||
|
<detail v-if="dialog.visible" :info="dialog.info" @deletes="deletes" @handle="handle" /> |
||||||
|
</Dialog> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Pagination from '@/components/Pagination' |
||||||
|
import { Dialog } from 'element-ui' |
||||||
|
import detail from '@/views/comment/comment-manage/details' |
||||||
|
import Member from '@/api/Member' |
||||||
|
import Comment from '@/api/Comment' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
Pagination, |
||||||
|
Dialog, |
||||||
|
detail |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
pageIndex: 1, |
||||||
|
pageSize: 10 |
||||||
|
}, |
||||||
|
tableData: {}, |
||||||
|
dialog: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getCommentList() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getCommentList() { |
||||||
|
this.form.mid = this.$route.query.id |
||||||
|
const res = await Member.getCommentList(this.form) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
this.tableData = resData.data |
||||||
|
} |
||||||
|
}, |
||||||
|
details(info) { |
||||||
|
this.dialog = { |
||||||
|
title: '评论详情', |
||||||
|
visible: true, |
||||||
|
info |
||||||
|
} |
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.dialog = {} |
||||||
|
}, |
||||||
|
deletes(id) { |
||||||
|
const _ = this |
||||||
|
const params = { |
||||||
|
id: id || _.dialog.info.id, |
||||||
|
action: 3 |
||||||
|
} |
||||||
|
_.$confirm('删除后将无法恢复评论', '删除', { |
||||||
|
confirmButtonText: '确定', |
||||||
|
cancelButtonText: '取消', |
||||||
|
type: 'warning' |
||||||
|
}).then(() => { |
||||||
|
Comment.handleComment(params).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.dialog = {} |
||||||
|
_.getList() |
||||||
|
_.$message.success('删除成功') |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
}, |
||||||
|
handle(item) { |
||||||
|
const _ = this |
||||||
|
const ob = item || _.dialog.info |
||||||
|
const params = { |
||||||
|
id: ob.id, |
||||||
|
action: ob.hideFlag ? 1 : 2 |
||||||
|
} |
||||||
|
const t = ob.hideFlag ? '显示' : '隐藏' |
||||||
|
_.$confirm(`确定要${t}该评论`, `${t}评论`, { |
||||||
|
confirmButtonText: '确定', |
||||||
|
cancelButtonText: '取消', |
||||||
|
type: 'warning' |
||||||
|
}).then(() => { |
||||||
|
Comment.handleComment(params).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.getList() |
||||||
|
_.$message.success(`${t}成功`) |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
}, |
||||||
|
fetch() { |
||||||
|
this.getCommentList() |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
/deep/ .el-table { |
||||||
|
th { |
||||||
|
background: #EEF3FF; |
||||||
|
color:#333333; |
||||||
|
font-size:16px; |
||||||
|
font-weight: 400; |
||||||
|
border-color: #E0E5EB; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
td { |
||||||
|
font-size: 14px; |
||||||
|
text-align: center; |
||||||
|
color: #666666; |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,143 @@ |
|||||||
|
<template> |
||||||
|
<div class="label_page"> |
||||||
|
<el-dialog |
||||||
|
:title="dialog.title" |
||||||
|
:visible.sync="dialog.visible" |
||||||
|
width="40%" |
||||||
|
:before-close="close" |
||||||
|
> |
||||||
|
<el-form label-width="100px"> |
||||||
|
<el-form-item label="标签名称"> |
||||||
|
<el-col :span="12"> |
||||||
|
<el-input v-model="form.model.name" /> |
||||||
|
</el-col> |
||||||
|
<el-col :span="6" class="el_col_text"> |
||||||
|
<el-button @click="fetch">查询</el-button> |
||||||
|
</el-col> |
||||||
|
<el-col :span="6" class="el_col_text"> |
||||||
|
<span @click="manageTag">管理标签</span> |
||||||
|
</el-col> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item> |
||||||
|
<el-row> |
||||||
|
<el-checkbox-group v-model="checkList"> |
||||||
|
<el-row v-for="(item, index) in tableData.records" :key="index"> |
||||||
|
<el-checkbox :label="item.id">{{ item.name }}</el-checkbox> |
||||||
|
</el-row> |
||||||
|
</el-checkbox-group> |
||||||
|
</el-row> |
||||||
|
<el-row> |
||||||
|
<pagination |
||||||
|
v-show="tableData.total > 0" |
||||||
|
:limit.sync="form.size" |
||||||
|
:page.sync="form.current" |
||||||
|
:total="Number(tableData.total)" |
||||||
|
@pagination="fetch" |
||||||
|
/> |
||||||
|
</el-row> |
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
|
||||||
|
<div style="text-align:center;"> |
||||||
|
<el-button @click="close">取 消</el-button> |
||||||
|
<el-button type="primary" @click="confirm">确 定</el-button> |
||||||
|
</div> |
||||||
|
</el-dialog> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Label from '@/api/Label' |
||||||
|
import Pagination from '@/components/Pagination' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
Pagination |
||||||
|
}, |
||||||
|
props: { |
||||||
|
dialog: { |
||||||
|
type: Object, |
||||||
|
default() { |
||||||
|
return {} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
"current": 1, |
||||||
|
"map": {}, |
||||||
|
"model": { |
||||||
|
"name": "", |
||||||
|
"type": '' |
||||||
|
}, |
||||||
|
"order": "descending", |
||||||
|
"size": 10, |
||||||
|
"sort": "id" |
||||||
|
}, |
||||||
|
checkList: [], |
||||||
|
list: [ |
||||||
|
{ name: '潜在客户', id: '1' }, |
||||||
|
{ name: '土豪', id: '2' }, |
||||||
|
{ name: '小气', id: '3' } |
||||||
|
], |
||||||
|
tableData: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getLabelList() |
||||||
|
this.queryTag() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getLabelList() { |
||||||
|
const res = await Label.getLabelList(this.form) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
this.tableData = resData.data |
||||||
|
} |
||||||
|
}, |
||||||
|
async queryTag () { |
||||||
|
const res = await Label.queryTag(this.dialog.id) |
||||||
|
const resData = res.data |
||||||
|
const t = [] |
||||||
|
if (resData.code === 0) { |
||||||
|
if (resData.data.length) { |
||||||
|
resData.data.forEach(item => { |
||||||
|
t.push(item.tagId) |
||||||
|
}) |
||||||
|
} |
||||||
|
this.checkList = t |
||||||
|
} |
||||||
|
}, |
||||||
|
fetch() { |
||||||
|
this.getLabelList() |
||||||
|
}, |
||||||
|
manageTag() { |
||||||
|
this.$router.push({ path: '/customer-manage/label' }) |
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.$emit('close') |
||||||
|
}, |
||||||
|
confirm() { |
||||||
|
this.$emit('confirm', this.checkList) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
.label_page { |
||||||
|
.el_col_text { |
||||||
|
text-align:center; |
||||||
|
font-size: 14px; |
||||||
|
color: #3A68F2; |
||||||
|
&:hover { |
||||||
|
cursor:pointer; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-dialog__body { |
||||||
|
width: 80%; |
||||||
|
margin: 0 auto; |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,124 @@ |
|||||||
|
<template> |
||||||
|
<div class="order_page"> |
||||||
|
<el-form inline> |
||||||
|
<el-form-item label="订单ID"> |
||||||
|
<el-input v-model="form.Keyword" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item> |
||||||
|
<el-button type="primary" size="mini">查询</el-button> |
||||||
|
<el-button size="mini" @click="query">查询</el-button> |
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
<el-table |
||||||
|
:data="tableData.adminOrderDTOList" |
||||||
|
border |
||||||
|
style="width: 80%" |
||||||
|
> |
||||||
|
<el-table-column |
||||||
|
prop="id" |
||||||
|
label="订单ID" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="storeName" |
||||||
|
label="店铺名称" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="productCount" |
||||||
|
label="商品数量" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="paySum" |
||||||
|
:formatter="getPrice" |
||||||
|
label="订单金额(元)" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="orderStatus" |
||||||
|
:formatter="getStatus" |
||||||
|
label="状态" |
||||||
|
/> |
||||||
|
</el-table> |
||||||
|
<pagination |
||||||
|
v-show="tableData.total > 0" |
||||||
|
:limit.sync="form.pageSize" |
||||||
|
:page.sync="form.pageIndex" |
||||||
|
:total="Number(tableData.total)" |
||||||
|
@pagination="query" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Pagination from '@/components/Pagination' |
||||||
|
import Member from '@/api/Member' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
Pagination |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
Keyword: '', |
||||||
|
pageIndex: 1, |
||||||
|
pageSize: 10, |
||||||
|
keywordType: 1 |
||||||
|
}, |
||||||
|
tableData: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getOrderList() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getOrderList() { |
||||||
|
this.form.mid = this.$route.query.id |
||||||
|
const res = await Member.getOrderList(this.form) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
this.tableData = resData.data |
||||||
|
} |
||||||
|
}, |
||||||
|
getStatus(row, item, value) { |
||||||
|
const ob = { |
||||||
|
1: '待付款', |
||||||
|
2: '待发货', |
||||||
|
3: '待收货', |
||||||
|
4: '已完成', |
||||||
|
5: '已取消' |
||||||
|
} |
||||||
|
return ob[value] |
||||||
|
}, |
||||||
|
getPrice(row, item, value) { |
||||||
|
return value / 100 |
||||||
|
}, |
||||||
|
query() { |
||||||
|
this.getOrderList() |
||||||
|
}, |
||||||
|
reset() { |
||||||
|
this.form = { |
||||||
|
Keyword: '', |
||||||
|
pageIndex: 1, |
||||||
|
pageSize: 10, |
||||||
|
keywordType: 1 |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
/deep/ .el-table { |
||||||
|
th { |
||||||
|
background: #EEF3FF; |
||||||
|
color:#333333; |
||||||
|
font-size:16px; |
||||||
|
font-weight: 400; |
||||||
|
border-color: #E0E5EB; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
td { |
||||||
|
font-size: 14px; |
||||||
|
text-align: center; |
||||||
|
color: #666666; |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,272 @@ |
|||||||
|
<template> |
||||||
|
<div class="custom_info_page"> |
||||||
|
<h2>客户信息</h2> |
||||||
|
|
||||||
|
<div class="custom_info"> |
||||||
|
<div class="info_item"> |
||||||
|
<img :src="memberBaseInfo.headimg" alt="" /> |
||||||
|
</div> |
||||||
|
<div class="info_item"> |
||||||
|
<ul> |
||||||
|
<li v-for="(item, index) in infoList" :key="index"> |
||||||
|
<p> |
||||||
|
<span>{{ item.name }} : </span> |
||||||
|
<span>{{ item.value }}</span> |
||||||
|
</p> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="custom_tag"> |
||||||
|
<h2>客户标签</h2> |
||||||
|
<p v-for="(item,index) in tagList" :key="index">{{ item.tagName }}</p> |
||||||
|
<p @click="addTag">贴标签</p> |
||||||
|
</div> |
||||||
|
<div class="custom_data"> |
||||||
|
<h2>消费数据</h2> |
||||||
|
<div class="data_list"> |
||||||
|
<p><span>下 单 数: <font>{{ customData.orderCount }}</font></span> 支付成功数: <font>{{ customData.payOrderCount }}</font></p> |
||||||
|
<p><span>售后次数: <font>{{ customData.returnCount }}</font></span> 售后单数: <font>{{ customData.returnOrderCount }}</font></p> |
||||||
|
</div> |
||||||
|
<div class="tab_list"> |
||||||
|
<p v-for="(item,index) in tabList" :key="index" :class="[{'active': componentName === item.componentName}]" @click="changeTab(item)"> |
||||||
|
{{ item.tabName }} |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
<div class="component_content"> |
||||||
|
<component :is="componentName" /> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<labels v-if="dialog.visible" :dialog="dialog" @close="close" @confirm="confirm" /> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import order from './component/order/index' |
||||||
|
import comment from './component/comment/index' |
||||||
|
import addressInfo from './component/address/index' |
||||||
|
import Member from '@/api/Member' |
||||||
|
import labels from './component/label/index' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
order, |
||||||
|
comment, |
||||||
|
addressInfo, |
||||||
|
labels |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
infoList: [ |
||||||
|
{ name: '用户昵称', value: '', fields: 'nickname' }, |
||||||
|
{ name: '手 机 号', value: '', fields: 'phone' }, |
||||||
|
{ name: '性 别', value: '', fields: 'sex' }, |
||||||
|
{ name: '注册时间', value: '', fields: 'createTime' }, |
||||||
|
{ name: '生 日', value: '', fields: 'birth' } |
||||||
|
], |
||||||
|
tagList: [], |
||||||
|
tabList: [ |
||||||
|
{ tabName: 'TA的订单', componentName: 'order' }, |
||||||
|
{ tabName: 'TA的评论', componentName: 'comment' }, |
||||||
|
{ tabName: 'TA的收货地址', componentName: 'addressInfo' } |
||||||
|
], |
||||||
|
componentName: 'order', |
||||||
|
customData: {}, |
||||||
|
memberBaseInfo: {}, |
||||||
|
dialog: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getMemberInfo() |
||||||
|
this.getCustomData() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getMemberInfo() { |
||||||
|
const res = await Member.getMemberInfo(this.$route.query.id) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
const t = resData.data |
||||||
|
this.tagList = t.memberTagList |
||||||
|
this.memberBaseInfo = t.memberBaseInfo |
||||||
|
this.getInfoList(t.memberBaseInfo || {}) |
||||||
|
} |
||||||
|
}, |
||||||
|
async getCustomData() { |
||||||
|
const res = await Member.getCustomData(this.$route.query.id) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
this.customData = resData.data |
||||||
|
} |
||||||
|
}, |
||||||
|
// 获取客户信息 |
||||||
|
getInfoList(ob) { |
||||||
|
const _ = this |
||||||
|
_.infoList.map(item => { |
||||||
|
item.value = ob[item.fields] || '' |
||||||
|
if (item.fields === 'sex') { |
||||||
|
item.value = item.value === '1' ? '男' : '女' |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
// 贴标签 |
||||||
|
addTag() { |
||||||
|
this.dialog = { |
||||||
|
title: '选择标签', |
||||||
|
visible: true, |
||||||
|
id: this.$route.query.id |
||||||
|
} |
||||||
|
}, |
||||||
|
confirm(ids) { |
||||||
|
const params = { |
||||||
|
mid: this.$route.query.id, |
||||||
|
tagIds: ids |
||||||
|
} |
||||||
|
const _ = this |
||||||
|
Member.addTag(params).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.$message.success('操作成功') |
||||||
|
_.getMemberInfo() |
||||||
|
_.close() |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.dialog = {} |
||||||
|
}, |
||||||
|
changeTab(item) { |
||||||
|
this.componentName = item.componentName |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
h2 { |
||||||
|
font-size: 24px; |
||||||
|
font-weight: 500; |
||||||
|
position: relative; |
||||||
|
&::before { |
||||||
|
content: ''; |
||||||
|
height: 24px; |
||||||
|
width: 4px; |
||||||
|
background-color: #3A68F2; |
||||||
|
position: absolute; |
||||||
|
left: -10px; |
||||||
|
top: 2px; |
||||||
|
display: block; |
||||||
|
} |
||||||
|
} |
||||||
|
.custom_info_page { |
||||||
|
margin-top: 20px; |
||||||
|
padding: 20px 100px; |
||||||
|
background-color: #fff; |
||||||
|
min-height: 500px; |
||||||
|
|
||||||
|
.custom_info { |
||||||
|
overflow: hidden; |
||||||
|
margin-bottom: 30px; |
||||||
|
.info_item { |
||||||
|
float: left; |
||||||
|
&:nth-child(1) { |
||||||
|
height: 180px; |
||||||
|
width: 100px; |
||||||
|
img { |
||||||
|
width: 100px; |
||||||
|
height: 100px; |
||||||
|
border-radius: 50px; |
||||||
|
text-align: center; |
||||||
|
margin-top: 40px; |
||||||
|
} |
||||||
|
} |
||||||
|
&:nth-child(2) { |
||||||
|
width: 50%; |
||||||
|
ul { |
||||||
|
overflow: hidden; |
||||||
|
list-style: none; |
||||||
|
li { |
||||||
|
float: left; |
||||||
|
p { |
||||||
|
font-size: 16px; |
||||||
|
color: #333; |
||||||
|
span:nth-child(2) { |
||||||
|
color: #666; |
||||||
|
} |
||||||
|
} |
||||||
|
&:nth-child(odd) { |
||||||
|
width: 30%; |
||||||
|
} |
||||||
|
&:nth-child(even) { |
||||||
|
width: 70%; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.custom_tag { |
||||||
|
margin-bottom: 30px; |
||||||
|
p { |
||||||
|
display: inline-block; |
||||||
|
background-color: #D8E1FC; |
||||||
|
font-size: 16px; |
||||||
|
color: #333; |
||||||
|
text-align: center; |
||||||
|
margin-right: 20px; |
||||||
|
border-radius: 4px; |
||||||
|
padding: 8px 15px; |
||||||
|
&:last-child { |
||||||
|
background-color: #fff; |
||||||
|
color: #3A68F2; |
||||||
|
&:hover { |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.custom_data { |
||||||
|
.data_list { |
||||||
|
p { |
||||||
|
font-size: 16px; |
||||||
|
font{ |
||||||
|
color:#666; |
||||||
|
} |
||||||
|
span { |
||||||
|
display: inline-block; |
||||||
|
width: 200px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
.tab_list { |
||||||
|
overflow: hidden; |
||||||
|
p { |
||||||
|
float: left; |
||||||
|
padding: 0 50px; |
||||||
|
font-size: 16px; |
||||||
|
border: 1px #E0E5EB solid; |
||||||
|
box-sizing: border-box; |
||||||
|
color: #999999; |
||||||
|
height: 48px; |
||||||
|
line-height: 48px; |
||||||
|
&:nth-child(-n + 2) { |
||||||
|
border-right: 0; |
||||||
|
} |
||||||
|
&:nth-child(1) { |
||||||
|
border-radius: 4px 0 0 4px; |
||||||
|
} |
||||||
|
&:nth-child(3) { |
||||||
|
border-radius: 0 4px 4px 0; |
||||||
|
} |
||||||
|
&:hover { |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
} |
||||||
|
.active { |
||||||
|
background-color: #3A68F2; |
||||||
|
color: #fff; |
||||||
|
border: 0; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,340 @@ |
|||||||
|
<template> |
||||||
|
<div class="custom_page"> |
||||||
|
<div class="content"> |
||||||
|
<div class="toolbar"> |
||||||
|
<el-form |
||||||
|
:model="formParams" |
||||||
|
label-width="120px" |
||||||
|
> |
||||||
|
<el-row> |
||||||
|
<el-col :span="20"> |
||||||
|
<el-row> |
||||||
|
<el-col :span="5"> |
||||||
|
<el-form-item label="客户昵称"> |
||||||
|
<el-input v-model="formParams.model.nickname" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
|
||||||
|
<el-col :span="5"> |
||||||
|
<el-form-item label="手机号"> |
||||||
|
<el-input v-model="formParams.tel" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
<el-col :span="5"> |
||||||
|
<el-form-item label="标签"> |
||||||
|
<el-input v-model="formParams.model.tagId" size="mini" /> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
<el-col :span="8"> |
||||||
|
<el-form-item label="最近消费时间"> |
||||||
|
<el-date-picker |
||||||
|
v-model="date" |
||||||
|
size="mini" |
||||||
|
type="daterange" |
||||||
|
range-separator="至" |
||||||
|
start-placeholder="开始时间" |
||||||
|
end-placeholder="结束时间" |
||||||
|
value-format="yyyy-MM-dd" |
||||||
|
@change="handleChange" |
||||||
|
/> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
</el-row> |
||||||
|
<el-row v-show="showMore"> |
||||||
|
<el-col :span="5"> |
||||||
|
<el-form-item label="累计金额"> |
||||||
|
<el-col :span="11"> |
||||||
|
<el-input v-model="formParams.model.totalConsumAmountStart" size="mini" /> |
||||||
|
</el-col> |
||||||
|
<el-col :span="2" style="text-align: center;color: #DCDFE6;"> |
||||||
|
- |
||||||
|
</el-col> |
||||||
|
<el-col :span="11"> |
||||||
|
<el-input v-model="formParams.model.totalConsumAmountEnd" size="mini" /> |
||||||
|
</el-col> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
|
||||||
|
<el-col :span="5"> |
||||||
|
<el-form-item label="购买次数"> |
||||||
|
<el-col :span="11"> |
||||||
|
<el-input v-model="formParams.model.buyTimesStart" size="mini" /> |
||||||
|
</el-col> |
||||||
|
<el-col :span="2" style="text-align: center;color: #DCDFE6;"> |
||||||
|
- |
||||||
|
</el-col> |
||||||
|
<el-col :span="11"> |
||||||
|
<el-input v-model="formParams.model.buyTimesEnd" size="mini" /> |
||||||
|
</el-col> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
</el-row> |
||||||
|
</el-col> |
||||||
|
<el-col :span="4"> |
||||||
|
<el-form-item label-width="0"> |
||||||
|
<el-button |
||||||
|
type="primary" |
||||||
|
size="mini" |
||||||
|
@click="query" |
||||||
|
> |
||||||
|
查询 |
||||||
|
</el-button> |
||||||
|
<el-button |
||||||
|
plain |
||||||
|
size="mini" |
||||||
|
@click="reset" |
||||||
|
> |
||||||
|
重置 |
||||||
|
</el-button> |
||||||
|
<span style="margin-left: 10px;dispaly:inline-block;font-size: 16px;" @click="dispalyMore"> |
||||||
|
<i :class="[showMore?'el-icon-arrow-up':'el-icon-arrow-down']"></i> |
||||||
|
</span> |
||||||
|
</el-form-item> |
||||||
|
</el-col> |
||||||
|
</el-row> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
|
||||||
|
<div class="content_table"> |
||||||
|
<div class="table"> |
||||||
|
<el-table |
||||||
|
:data="tableData.records" |
||||||
|
border |
||||||
|
style="width: 100%" |
||||||
|
> |
||||||
|
<el-table-column |
||||||
|
prop="nickname" |
||||||
|
label="客户昵称" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="phone" |
||||||
|
label="手机号" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="expendAmount" |
||||||
|
label="消费总额" |
||||||
|
:formatter="getPrice" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="buyTimes" |
||||||
|
label="购买次数" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="lastBuyTime" |
||||||
|
label="最近消费时间" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="registerTime" |
||||||
|
label="注册时间" |
||||||
|
/> |
||||||
|
<el-table-column label="操作"> |
||||||
|
<template |
||||||
|
slot-scope="scope" |
||||||
|
> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="details(scope.row.id)" |
||||||
|
> |
||||||
|
详情 |
||||||
|
</el-button> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="makeTag(scope.row.id)" |
||||||
|
> |
||||||
|
打标签 |
||||||
|
</el-button> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="addBlackList(scope.row)" |
||||||
|
> |
||||||
|
{{ scope.row.status ? '取消黑名单' : '加入黑名单' }} |
||||||
|
</el-button> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
</el-table> |
||||||
|
</div> |
||||||
|
<pagination |
||||||
|
v-show="tableData.total > 0" |
||||||
|
:limit.sync="formParams.size" |
||||||
|
:page.sync="formParams.current" |
||||||
|
:total="Number(tableData.total)" |
||||||
|
@pagination="fetch" |
||||||
|
/> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<labels v-if="dialog.visible" :dialog="dialog" @close="close" @confirm="confirm" /> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Member from '@/api/Member' |
||||||
|
import Pagination from '@/components/Pagination' |
||||||
|
import labels from './custom-info/component/label/index' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
Pagination, |
||||||
|
labels |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
showMore: false, |
||||||
|
formParams: { |
||||||
|
size: 10, |
||||||
|
current: 1, |
||||||
|
model: { |
||||||
|
buyTimesStart: '', |
||||||
|
buyTimesEnd: '', |
||||||
|
totalConsumAmountStart: '', |
||||||
|
totalConsumAmountEnd: '', |
||||||
|
nickname: '', |
||||||
|
tagId: '', |
||||||
|
lastConsumTimeStart: '', |
||||||
|
lastConsumTimeEnd: '' |
||||||
|
} |
||||||
|
}, |
||||||
|
date: [], |
||||||
|
tableData: {}, |
||||||
|
dialog: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getList() { |
||||||
|
const res = await Member.getMemberList(this.formParams) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
this.tableData = resData.data |
||||||
|
} |
||||||
|
}, |
||||||
|
getPrice(row, item, value) { |
||||||
|
return value / 100 |
||||||
|
}, |
||||||
|
query() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
details(id) { |
||||||
|
this.$router.push({ path: '/customer-manage/custom-info', query: { id }}) |
||||||
|
}, |
||||||
|
makeTag(id) { |
||||||
|
this.dialog = { |
||||||
|
title: '选择标签', |
||||||
|
visible: true, |
||||||
|
id |
||||||
|
} |
||||||
|
}, |
||||||
|
confirm(ids) { |
||||||
|
const params = { |
||||||
|
mid: this.dialog.id, |
||||||
|
tagIds: ids |
||||||
|
} |
||||||
|
const _ = this |
||||||
|
Member.addTag(params).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.$message.success('操作成功') |
||||||
|
_.getList() |
||||||
|
_.close() |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
addBlackList(item) { |
||||||
|
const _ = this |
||||||
|
_.$confirm(`${item.status ? '确认是否取消黑名单' : '加入黑名单后,对方将无法登录商城'}`, `${item.status ? '取消黑名单' : '加入黑名单'}`, { |
||||||
|
confirmButtonText: '确定', |
||||||
|
cancelButtonText: '取消', |
||||||
|
type: 'warning' |
||||||
|
}).then(() => { |
||||||
|
Member.forbiddenMember({ mid: item.id, status: !item.status }).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.getList() |
||||||
|
_.$message.success(`成功${item.status ? '取消' : '加入'}黑名单`) |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.dialog = {} |
||||||
|
}, |
||||||
|
reset() { |
||||||
|
this.formParams = { |
||||||
|
size: 10, |
||||||
|
current: 1, |
||||||
|
model: { |
||||||
|
buyTimesStart: '', |
||||||
|
buyTimesEnd: '', |
||||||
|
totalConsumAmountStart: '', |
||||||
|
totalConsumAmountEnd: '', |
||||||
|
nickname: '', |
||||||
|
tagId: '', |
||||||
|
lastConsumTimeStart: '', |
||||||
|
lastConsumTimeEnd: '' |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
fetch() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
selectItem() { |
||||||
|
this.getList() |
||||||
|
}, |
||||||
|
handleChange(value) { |
||||||
|
this.formParams.model.lastConsumTimeStart = (value && value[0]) || '' |
||||||
|
this.formParams.model.lastConsumTimeEnd = (value && value[1]) || '' |
||||||
|
}, |
||||||
|
dispalyMore() { |
||||||
|
this.showMore = !this.showMore |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
|
||||||
|
.custom_page{ |
||||||
|
padding: 10px 20px; |
||||||
|
box-sizing: border-box; |
||||||
|
.content { |
||||||
|
background-color: #fff; |
||||||
|
padding: 20px; |
||||||
|
.toolbar { |
||||||
|
padding: 10px; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-table { |
||||||
|
th { |
||||||
|
background: #EEF3FF; |
||||||
|
color:#333333; |
||||||
|
font-size:16px; |
||||||
|
font-weight: 400; |
||||||
|
border-color: #E0E5EB; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
td { |
||||||
|
font-size: 14px; |
||||||
|
text-align: center; |
||||||
|
color: #666666; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-dialog__wrapper { |
||||||
|
.el-dialog__header { |
||||||
|
height: 70px; |
||||||
|
background-color: #3A68F2; |
||||||
|
.el-dialog__title { |
||||||
|
font-size:24px; |
||||||
|
color: #fff; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-message-box__btns .el-button { |
||||||
|
margin-right: 10px !important; |
||||||
|
} |
||||||
|
</style> |
||||||
|
|
@ -0,0 +1,290 @@ |
|||||||
|
<template> |
||||||
|
<div class="add_page"> |
||||||
|
<div class="header"> |
||||||
|
{{ title }} |
||||||
|
<div class="btn_list"> |
||||||
|
<el-button @click="cancel">取消</el-button> |
||||||
|
<el-button type="primary" @click="save">保存</el-button> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="add_content"> |
||||||
|
<el-form label-width="80px"> |
||||||
|
<el-form-item label="标签名称"> |
||||||
|
<el-input v-model="form.name" placeholder="最多输入32个字符" /> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item label="标签类型"> |
||||||
|
<el-radio-group v-model="form.type"> |
||||||
|
<el-radio :label="1">手动标签</el-radio> |
||||||
|
<el-radio :label="2">自动标签</el-radio> |
||||||
|
</el-radio-group> |
||||||
|
</el-form-item> |
||||||
|
<div v-if="form.type===2" class="auto_label"> |
||||||
|
<el-form-item label="满足条件"> |
||||||
|
<el-radio-group v-model="form.meetCondition"> |
||||||
|
<el-radio :label="1">满足任意选中的条件即可</el-radio> |
||||||
|
<el-radio :label="2">必须满足所有选被中的条件</el-radio> |
||||||
|
</el-radio-group> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item label="交易条件"> |
||||||
|
<el-checkbox-group v-model="checkBox"> |
||||||
|
<el-row> |
||||||
|
<el-checkbox :label="1" name="config">最后消费时间</el-checkbox> |
||||||
|
<el-row> |
||||||
|
<el-radio-group v-model="form.config.lastConsumTime.type"> |
||||||
|
<el-row class="indent"> |
||||||
|
<el-radio :label="1">最近</el-radio> |
||||||
|
<el-select |
||||||
|
v-model="form.config.lastConsumTime.value" |
||||||
|
style="width:70px" |
||||||
|
:disabled="form.config.lastConsumTime.type === 2 || !checkBox.includes(1)" |
||||||
|
> |
||||||
|
<el-option |
||||||
|
v-for="(item, index) in dayList" |
||||||
|
:key="index" |
||||||
|
:label="item.label" |
||||||
|
:value="item.label" |
||||||
|
/> |
||||||
|
</el-select> |
||||||
|
<span style="font-size: 16px;margin-left: 10px;">天</span> |
||||||
|
</el-row> |
||||||
|
<el-row class="indent"> |
||||||
|
<el-radio :label="2">自定义</el-radio> |
||||||
|
<el-date-picker |
||||||
|
v-model="date" |
||||||
|
:disabled="form.config.lastConsumTime.type === 1 || !checkBox.includes(1)" |
||||||
|
type="daterange" |
||||||
|
range-separator="至" |
||||||
|
start-placeholder="开始时间" |
||||||
|
end-placeholder="结束时间" |
||||||
|
value-format="yyyy-MM-dd" |
||||||
|
@change="handleChange" |
||||||
|
/> |
||||||
|
</el-row> |
||||||
|
</el-radio-group> |
||||||
|
</el-row> |
||||||
|
</el-row> |
||||||
|
<el-row> |
||||||
|
<el-checkbox :label="2" name="config">累计消费次数</el-checkbox> |
||||||
|
<el-row class="indent"> |
||||||
|
<el-col :span="3" class="unit"> |
||||||
|
<el-input v-model="totalConsumTimes.start" :disabled="!checkBox.includes(2)" /> |
||||||
|
<span>次</span> |
||||||
|
</el-col> |
||||||
|
<el-col :span="1" style="font-size: 16px;text-align: center;"> |
||||||
|
ㅡ |
||||||
|
</el-col> |
||||||
|
<el-col :span="3" class="unit"> |
||||||
|
<el-input v-model="totalConsumTimes.end" :disabled="!checkBox.includes(2)" /> |
||||||
|
<span>次</span> |
||||||
|
</el-col> |
||||||
|
</el-row> |
||||||
|
</el-row> |
||||||
|
<el-row> |
||||||
|
<el-checkbox :label="3" name="config">累计消费金额</el-checkbox> |
||||||
|
<el-row class="indent"> |
||||||
|
<el-col :span="3" class="unit"> |
||||||
|
<el-input v-model="totalConsumAmount.start" :disabled="!checkBox.includes(3)" /> |
||||||
|
<span>元</span> |
||||||
|
</el-col> |
||||||
|
<el-col :span="1" style="font-size: 16px;text-align: center;"> |
||||||
|
ㅡ |
||||||
|
</el-col> |
||||||
|
<el-col :span="3" class="unit"> |
||||||
|
<el-input v-model="totalConsumAmount.end" :disabled="!checkBox.includes(3)" /> |
||||||
|
<span>元</span> |
||||||
|
</el-col> |
||||||
|
</el-row> |
||||||
|
|
||||||
|
</el-row> |
||||||
|
</el-checkbox-group> |
||||||
|
</el-form-item> |
||||||
|
</div> |
||||||
|
</el-form> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Label from '@/api/Label' |
||||||
|
export default { |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
name: '', |
||||||
|
meetCondition: 1, |
||||||
|
type: 1, |
||||||
|
config: { |
||||||
|
totalConsumTimes: '', |
||||||
|
lastConsumTime: { |
||||||
|
type: 1, |
||||||
|
value: 3 |
||||||
|
}, |
||||||
|
totalConsumAmount: '' |
||||||
|
|
||||||
|
} |
||||||
|
}, |
||||||
|
checkBox: [], |
||||||
|
totalConsumTimes: { |
||||||
|
start: '', |
||||||
|
end: '' |
||||||
|
}, |
||||||
|
totalConsumAmount: { |
||||||
|
start: '', |
||||||
|
end: '' |
||||||
|
}, |
||||||
|
num: '', |
||||||
|
date: [], |
||||||
|
dayList: [ |
||||||
|
{ label: 3 }, |
||||||
|
{ label: 7 }, |
||||||
|
{ label: 15 }, |
||||||
|
{ label: 30 }, |
||||||
|
{ label: 45 }, |
||||||
|
{ label: 60 } |
||||||
|
] |
||||||
|
} |
||||||
|
}, |
||||||
|
computed: { |
||||||
|
title() { |
||||||
|
const ob = { |
||||||
|
edit: '修改标签', |
||||||
|
add: '创建标签' |
||||||
|
} |
||||||
|
return ob[this.$route.query.type] |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.$route.meta.title = this.title |
||||||
|
this.getTagInfo() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getTagInfo() { |
||||||
|
const info = this.$route.query |
||||||
|
if (info.type === 'add') return |
||||||
|
const res = await Label.getTagInfo(info.id) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
const ob = resData.data |
||||||
|
Object.keys(this.form).forEach(item => { |
||||||
|
this.form[item] = ob[item] |
||||||
|
if (item === 'config') { |
||||||
|
this.totalConsumAmount = this.changeFields(ob.config.totalConsumAmount, true) |
||||||
|
this.totalConsumTimes = this.changeFields(ob.config.totalConsumTimes, false) |
||||||
|
this.form.config.lastConsumTime.value = this.changeTime(ob.config.lastConsumTime) |
||||||
|
} |
||||||
|
}) |
||||||
|
} |
||||||
|
}, |
||||||
|
handleChange(value) { |
||||||
|
// this.form.config.lastConsumTime.value = `${(value && value[0]) || ''}${value && value[0] ? '至' : ''}${(value && value[1]) || ''}` |
||||||
|
}, |
||||||
|
getDate(obj) { |
||||||
|
const value = this.date |
||||||
|
if (obj.type === 2) { |
||||||
|
obj.value = `${(value && value[0]) || ''}${value && value[0] ? '至' : ''}${(value && value[1]) || ''}` |
||||||
|
} |
||||||
|
}, |
||||||
|
save() { |
||||||
|
const _ = this |
||||||
|
const query = _.$route.query |
||||||
|
const ob = { |
||||||
|
edit: 'editTag', |
||||||
|
add: 'addLabel' |
||||||
|
} |
||||||
|
if (query.type === 'edit') { |
||||||
|
_.form.id = query.id |
||||||
|
} |
||||||
|
_.form.config.totalConsumTimes = this.assemblyFields(_.totalConsumTimes.start, _.totalConsumTimes.end, false) |
||||||
|
_.form.config.totalConsumAmount = this.assemblyFields(_.totalConsumAmount.start, _.totalConsumAmount.end, true) |
||||||
|
_.getDate(_.form.config.lastConsumTime) |
||||||
|
Label[ob[query.type]](this.form).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.$message.success('新增成功') |
||||||
|
_.cancel() |
||||||
|
} |
||||||
|
}) |
||||||
|
}, |
||||||
|
cancel() { |
||||||
|
this.$router.push({ path: '/customer-manage/label' }) |
||||||
|
}, |
||||||
|
assemblyFields(val1, val2, boo) { |
||||||
|
let t = '' |
||||||
|
if (val1 || val2) { |
||||||
|
t = boo ? `${val1 * 100}-${val2 * 100}` : `${val1}-${val2}` |
||||||
|
} |
||||||
|
return t |
||||||
|
}, |
||||||
|
changeFields(obj, flag) { |
||||||
|
const ob = { |
||||||
|
start: '', |
||||||
|
end: '' |
||||||
|
} |
||||||
|
if (obj) { |
||||||
|
const t = obj.split('-') |
||||||
|
ob.start = flag ? t[0] / 100 : t[0] |
||||||
|
ob.end = flag ? t[1] / 100 : t[1] |
||||||
|
flag ? this.checkBox.push(3) : this.checkBox.push(2) |
||||||
|
} |
||||||
|
return ob |
||||||
|
}, |
||||||
|
changeTime(obj) { |
||||||
|
let value = 3 |
||||||
|
if (obj) { |
||||||
|
this.checkBox.push(1) |
||||||
|
if (obj.type === 2) { |
||||||
|
this.date = obj.value.split('至') |
||||||
|
} else { |
||||||
|
value = obj.value |
||||||
|
} |
||||||
|
} |
||||||
|
return value |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
.add_page { |
||||||
|
margin-top: 20px; |
||||||
|
padding: 20px; |
||||||
|
background-color: #fff; |
||||||
|
.header { |
||||||
|
height: 80px; |
||||||
|
line-height: 80px; |
||||||
|
font-size: 24px; |
||||||
|
border-bottom: 1px solid #E0E5EB; |
||||||
|
.btn_list { |
||||||
|
float: right; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
.add_content { |
||||||
|
width: 60%; |
||||||
|
margin: 20px auto; |
||||||
|
.indent { |
||||||
|
padding-left: 20px; |
||||||
|
margin-bottom: 15px; |
||||||
|
box-sizing: border-box; |
||||||
|
} |
||||||
|
.auto_label { |
||||||
|
background-color: #F7F7F7; |
||||||
|
border-radius: 4px; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .unit { |
||||||
|
position: relative; |
||||||
|
span { |
||||||
|
position: absolute; |
||||||
|
right: 0; |
||||||
|
font-size: 16px; |
||||||
|
border-left: 1px solid #DCDFE6; |
||||||
|
padding: 0 8px; |
||||||
|
} |
||||||
|
.el-input__inner { |
||||||
|
padding: 0 40px 0 5px ; |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,299 @@ |
|||||||
|
<template> |
||||||
|
<div class="label_page"> |
||||||
|
<el-form inline> |
||||||
|
<el-form-item style="margin-right:0;"> |
||||||
|
<el-select |
||||||
|
v-model="form.model.type" |
||||||
|
size="mini" |
||||||
|
style="width: 130px;" |
||||||
|
> |
||||||
|
<el-option |
||||||
|
v-for="(item, index) in typeList" |
||||||
|
:key="index" |
||||||
|
:label="item.label" |
||||||
|
:value="item.value" |
||||||
|
/> |
||||||
|
</el-select> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item> |
||||||
|
<el-input |
||||||
|
v-model="form.model.name" |
||||||
|
size="mini" |
||||||
|
/> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item> |
||||||
|
<el-button type="primary" size="mini" @click="fetch">查询</el-button> |
||||||
|
<el-button size="mini" @click="reset">重置</el-button> |
||||||
|
</el-form-item> |
||||||
|
<el-form-item style="float:right;"> |
||||||
|
<el-button type="primary" size="mini" @click="add">新建标签</el-button> |
||||||
|
<el-button size="mini" @click="exportTag">导出标签</el-button> |
||||||
|
</el-form-item> |
||||||
|
</el-form> |
||||||
|
|
||||||
|
<el-table |
||||||
|
ref="multipleTable" |
||||||
|
:data="tableData.records" |
||||||
|
border |
||||||
|
tooltip-effect="dark" |
||||||
|
style="width: 100%" |
||||||
|
@selection-change="handleSelectionChange" |
||||||
|
> |
||||||
|
<el-table-column |
||||||
|
type="selection" |
||||||
|
width="55" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="name" |
||||||
|
label="标签名" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="tagCount" |
||||||
|
label="客户" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="type" |
||||||
|
label="标签类型" |
||||||
|
:formatter="getType" |
||||||
|
/> |
||||||
|
<el-table-column |
||||||
|
prop="tradeCondition" |
||||||
|
label="打标条件" |
||||||
|
> |
||||||
|
<template slot-scope="scope"> |
||||||
|
<span v-if="scope.row.type===1">未设置</span> |
||||||
|
<p v-else class="condition"> |
||||||
|
<span>{{ getCondition(scope.row.config) }}</span> |
||||||
|
<span @click="moreCondition(scope.row)">查看更多</span> |
||||||
|
</p> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
<el-table-column label="操作"> |
||||||
|
<template |
||||||
|
slot-scope="scope" |
||||||
|
> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="edit(scope.row.id)" |
||||||
|
> |
||||||
|
编辑 |
||||||
|
</el-button> |
||||||
|
<el-button |
||||||
|
type="text" |
||||||
|
size="small" |
||||||
|
@click.native.prevent="deletes(scope.row.id)" |
||||||
|
> |
||||||
|
删除 |
||||||
|
</el-button> |
||||||
|
</template> |
||||||
|
</el-table-column> |
||||||
|
</el-table> |
||||||
|
<div class="batch_btn"> |
||||||
|
<el-button :disabled="!multipleSelection.length" @click="deletes(false)">批量删除</el-button> |
||||||
|
</div> |
||||||
|
<pagination |
||||||
|
v-show="tableData.total > 0" |
||||||
|
:limit.sync="form.size" |
||||||
|
:page.sync="form.current" |
||||||
|
:total="Number(tableData.total)" |
||||||
|
@pagination="fetch" |
||||||
|
/> |
||||||
|
<Dialog |
||||||
|
:title="dialog.title" |
||||||
|
:visible.sync="dialog.visible" |
||||||
|
:fullscreen="!true" |
||||||
|
:before-close="close" |
||||||
|
width="35%" |
||||||
|
> |
||||||
|
<more v-if="dialog.visible" :info="dialog.info" @close="close" /> |
||||||
|
</Dialog> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
import Pagination from '@/components/Pagination' |
||||||
|
import Label from '@/api/Label' |
||||||
|
import { Dialog } from 'element-ui' |
||||||
|
import more from './more' |
||||||
|
import { downloadFile } from '@/utils/commons' |
||||||
|
// import {getIntervalTime} from '@/utils/date' |
||||||
|
export default { |
||||||
|
components: { |
||||||
|
Pagination, |
||||||
|
Dialog, |
||||||
|
more |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
form: { |
||||||
|
"current": 1, |
||||||
|
"map": {}, |
||||||
|
"model": { |
||||||
|
"name": "", |
||||||
|
"type": '' |
||||||
|
}, |
||||||
|
"order": "descending", |
||||||
|
"size": 10, |
||||||
|
"sort": "id" |
||||||
|
}, |
||||||
|
typeList: [ |
||||||
|
{ label: '全部标签类型', value: '' }, |
||||||
|
{ label: '手动标签', value: 1 }, |
||||||
|
{ label: '自动标签', value: 2 } |
||||||
|
], |
||||||
|
tableData: {}, |
||||||
|
multipleSelection: [], |
||||||
|
dialog: {} |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getLabelList() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
async getLabelList() { |
||||||
|
const res = await Label.getLabelList(this.form) |
||||||
|
const resData = res.data |
||||||
|
if (resData.code === 0) { |
||||||
|
this.tableData = resData.data |
||||||
|
} |
||||||
|
}, |
||||||
|
getType(row, item, value) { |
||||||
|
return Number(value) === 1 ? '手动标签' : '自动标签' |
||||||
|
}, |
||||||
|
add() { |
||||||
|
this.$router.push({ path: '/customer-manage/label/add', query: { type: 'add' }}) |
||||||
|
}, |
||||||
|
handleSelectionChange(val) { |
||||||
|
this.multipleSelection = val |
||||||
|
}, |
||||||
|
fetch() { |
||||||
|
this.getLabelList() |
||||||
|
}, |
||||||
|
reset() { |
||||||
|
this.form = { |
||||||
|
"current": 1, |
||||||
|
"map": {}, |
||||||
|
"model": { |
||||||
|
"name": "", |
||||||
|
"type": '' |
||||||
|
}, |
||||||
|
"order": "descending", |
||||||
|
"size": 10, |
||||||
|
"sort": "id" |
||||||
|
} |
||||||
|
}, |
||||||
|
edit(id) { |
||||||
|
this.$router.push({ path: '/customer-manage/label/add', query: { type: 'edit', id }}) |
||||||
|
}, |
||||||
|
exportTag() { |
||||||
|
Label.exportTag(this.form).then(res => { |
||||||
|
downloadFile(res) |
||||||
|
}) |
||||||
|
}, |
||||||
|
deletes(id) { |
||||||
|
const _ = this |
||||||
|
let ids = [] |
||||||
|
if (id) { |
||||||
|
ids = [id] |
||||||
|
} else { |
||||||
|
this.multipleSelection.forEach(item => { |
||||||
|
ids.push(item.id) |
||||||
|
}) |
||||||
|
} |
||||||
|
_.$confirm( `确认要${id ? '删除本' : '批量删除所选'}标签吗`, `${id ? '删除' : '批量删除'}标签`, { |
||||||
|
confirmButtonText: '确定', |
||||||
|
cancelButtonText: '取消', |
||||||
|
type: 'warning' |
||||||
|
}).then(() => { |
||||||
|
Label.deleteTag({ ids }).then(res => { |
||||||
|
if (res.data.code === 0) { |
||||||
|
_.getLabelList() |
||||||
|
_.$message.success('操作成功') |
||||||
|
} |
||||||
|
}) |
||||||
|
}) |
||||||
|
}, |
||||||
|
getCondition (obj) { |
||||||
|
let t = '' |
||||||
|
t += `最后消费时间在${obj.lastConsumTime.value}${obj.lastConsumTime.type === 1 ? '天' : ''}内;` |
||||||
|
if (obj.totalConsumTimes) { |
||||||
|
const times = obj.totalConsumTimes.split('-') |
||||||
|
t += `累计成功交易在${times[0]}-${times[1]}次` |
||||||
|
} |
||||||
|
if (obj.totalConsumAmount) { |
||||||
|
const amount = obj.totalConsumAmount.split('-') |
||||||
|
t += `累计消费金额在${amount[0] / 100}-${amount[1] / 100}元` |
||||||
|
} |
||||||
|
return t |
||||||
|
}, |
||||||
|
moreCondition(item) { |
||||||
|
this.dialog = { |
||||||
|
title: '打标详情', |
||||||
|
info: item, |
||||||
|
visible: true |
||||||
|
} |
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.dialog = {} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style lang='less' scoped> |
||||||
|
.label_page { |
||||||
|
margin-top: 20px; |
||||||
|
background-color:#fff; |
||||||
|
padding:20px; |
||||||
|
.batch_btn { |
||||||
|
padding: 5px 10px; |
||||||
|
border: 1px solid #dfe6ec; |
||||||
|
border-top: 0; |
||||||
|
} |
||||||
|
.condition { |
||||||
|
span{ |
||||||
|
display: block; |
||||||
|
&:nth-child(1) { |
||||||
|
text-overflow: ellipsis; |
||||||
|
white-space: nowrap; |
||||||
|
overflow: hidden; |
||||||
|
} |
||||||
|
&:nth-child(2) { |
||||||
|
color: #1682e6; |
||||||
|
text-align: left; |
||||||
|
&:hover { |
||||||
|
cursor: pointer; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-table { |
||||||
|
th { |
||||||
|
background: #EEF3FF; |
||||||
|
color:#333333; |
||||||
|
font-size:16px; |
||||||
|
font-weight: 400; |
||||||
|
border-color: #E0E5EB; |
||||||
|
text-align: center; |
||||||
|
} |
||||||
|
td { |
||||||
|
font-size: 14px; |
||||||
|
text-align: center; |
||||||
|
color: #666666; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/deep/ .el-dialog__wrapper { |
||||||
|
.el-dialog__header { |
||||||
|
height: 70px; |
||||||
|
background-color: #3A68F2; |
||||||
|
.el-dialog__title { |
||||||
|
font-size:24px; |
||||||
|
color: #fff; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
@ -0,0 +1,91 @@ |
|||||||
|
<template> |
||||||
|
<div class="more_page"> |
||||||
|
<h2>{{ getTitle(info.meetCondition) }}</h2> |
||||||
|
<div class="condition"> |
||||||
|
<p>交易条件:</p> |
||||||
|
<p> |
||||||
|
<span v-for="(item, index) in list" :key="index">{{ item }}</span> |
||||||
|
</p> |
||||||
|
</div> |
||||||
|
|
||||||
|
<el-button type="primary" @click="close">我知道了</el-button> |
||||||
|
</div> |
||||||
|
</template> |
||||||
|
|
||||||
|
<script> |
||||||
|
export default { |
||||||
|
props: { |
||||||
|
info: { |
||||||
|
type: Object, |
||||||
|
default() { |
||||||
|
return {} |
||||||
|
} |
||||||
|
} |
||||||
|
}, |
||||||
|
data() { |
||||||
|
return { |
||||||
|
list: ['最后消费时间在30天内', '累计成功交易在3-4次', '累计消费金额在100-200元'] |
||||||
|
} |
||||||
|
}, |
||||||
|
created() { |
||||||
|
this.getData() |
||||||
|
}, |
||||||
|
methods: { |
||||||
|
getData() { |
||||||
|
const arr = [] |
||||||
|
const obj = this.info.config |
||||||
|
arr.push(`最后消费时间在${obj.lastConsumTime.value}${obj.lastConsumTime.type === 1 ? '天' : ''}内`) |
||||||
|
|
||||||
|
if (obj.totalConsumTimes) { |
||||||
|
const times = obj.totalConsumTimes.split('-') |
||||||
|
arr.push(`累计成功交易在${times[0]}-${times[1]}次`) |
||||||
|
} |
||||||
|
|
||||||
|
if (obj.totalConsumAmount) { |
||||||
|
const amount = obj.totalConsumAmount.split('-') |
||||||
|
arr.push(`累计消费金额在${amount[0] / 100}-${amount[1] / 100}元`) |
||||||
|
} |
||||||
|
this.list = arr |
||||||
|
}, |
||||||
|
getTitle(v) { |
||||||
|
return v === 1 ? '满足以下任意条件即可' : '必须满足以下所有条件' |
||||||
|
}, |
||||||
|
close() { |
||||||
|
this.$emit('close') |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</script> |
||||||
|
|
||||||
|
<style scoped lang='less'> |
||||||
|
.more_page { |
||||||
|
width: 80%; |
||||||
|
margin: 0 auto; |
||||||
|
color: #333; |
||||||
|
text-align: center; |
||||||
|
h2 { |
||||||
|
font-size: 24px; |
||||||
|
font-weight: 400; |
||||||
|
} |
||||||
|
.condition { |
||||||
|
overflow: hidden; |
||||||
|
p { |
||||||
|
font-size: 16px; |
||||||
|
float: left; |
||||||
|
&:nth-child(1) { |
||||||
|
width: 30%; |
||||||
|
text-align: right; |
||||||
|
padding-right:10px; |
||||||
|
box-sizing: border-box; |
||||||
|
} |
||||||
|
&:nth-child(2) { |
||||||
|
text-align: left; |
||||||
|
width: 70%; |
||||||
|
span { |
||||||
|
display: block; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
</style> |
Loading…
Reference in new issue