Commit f094925f by 前端

Merge branch 'wangzh_dev_2.0' into 'master'

客户跟进2.0开发

See merge request !2
2 parents 426920fa ef483281
...@@ -44,31 +44,48 @@ ...@@ -44,31 +44,48 @@
</div> </div>
</div> </div>
</div> </div>
<div class="detail-bg detail-third"> <template v-for="(label, ids) in labelArray">
<div class="title">客户标签</div>
<template v-if="(merchantModel == 2 && label.labelGroupType != '自店标签') || merchantModel == 1">
<div class="detail-bg detail-third" :key="ids">
<div class="title">
{{ label.labelGroupType }}
<span v-if="label.labelGroupType == '系统标签'" class="prompt-text">系统标签不支持手动修改</span>
</div>
<div class="detail-label"> <div class="detail-label">
<div v-if="userInfo.labelInfos && !userInfo.labelInfos.length" class="no-label"> <div v-if="label.labelGroupType !== '系统标签' && customerId == 0" class="no-label">
<div class="btn text-center" @click="handleTag"> <div class="btn text-center" @click="handleTag(label.labelGroupType)">
<van-icon name="plus" class="plus" /> <van-icon name="plus" class="plus" />
<span>标签</span> <span>标签</span>
</div> </div>
</div> </div>
<div class="has-label" v-else> <div class="has-label" v-if="label.isShow && label.children.length > 0">
<template v-for="(i, index) in userInfo.labelInfos"> <template v-for="(i, index) in label.children">
<div class="label-box" :key="index"> <div class="label-box" :key="index">
<div class="label-title">{{ i.labelGroupInfo.labelGroupName }}</div> <div class="label-title">{{ i.labelGroupInfo.labelGroupName }}</div>
<div v-for="item in i.labelInfoList" :key="item.id" class="label-text text-center">{{ item.labelName }}</div> <div v-for="item in i.labelInfoList" :key="item.id" class="label-text text-center">{{ item.labelName }}</div>
</div> </div>
</template> </template>
<div class="btn-box" v-if="customerId == 0"> <!-- <div class="btn-box">
<div class="btn text-center" @click="handleTag"> <div class="btn text-center" @click="handleTag">
<van-icon name="plus" class="plus" /> <van-icon name="plus" class="plus" />
<span>标签</span> <span>标签8888</span>
</div> </div>
</div> -->
</div> </div>
</div> </div>
<template v-if="label.children.length > 0">
<div class="detail-more text-center" @click="moreInfoLabel(ids)">
<div class="btn text-center">
{{ label.isShow ? '收起' : '展开全部' }}
<div :class="['sprite-icon', 'icon-open-arrow', { more: label.isShow }]"></div>
</div>
</div> </div>
</template>
</div> </div>
</template>
</template>
<div class="detail-bg detail-fourth"> <div class="detail-bg detail-fourth">
<div class="title">所属群聊</div> <div class="title">所属群聊</div>
<div class="detail-group"> <div class="detail-group">
...@@ -102,8 +119,10 @@ export default { ...@@ -102,8 +119,10 @@ export default {
components: { make }, components: { make },
data() { data() {
return { return {
labelType: '',
flag: false, flag: false,
isMore: false, isMore: false,
labels: [],
userInfo: { userInfo: {
labels: [], labels: [],
vehicleInfo: {}, vehicleInfo: {},
...@@ -116,6 +135,8 @@ export default { ...@@ -116,6 +135,8 @@ export default {
1: '男', 1: '男',
2: '女' 2: '女'
}, },
merchantModel: '',
labelArray: [],
detailObj: [ detailObj: [
{ {
title: '添加时间', title: '添加时间',
...@@ -235,7 +256,7 @@ export default { ...@@ -235,7 +256,7 @@ export default {
target: '', target: '',
customerId: 0, //默认是客户显示打标签按钮 customerId: 0, //默认是客户显示打标签按钮
userAgent: false, userAgent: false,
isTrue: true isTrue: false
} }
}, },
activated() { activated() {
...@@ -248,6 +269,7 @@ export default { ...@@ -248,6 +269,7 @@ export default {
}) })
}, },
mounted() { mounted() {
this.merchantModel = this.getLocalStorage('dj_scrm_userInfo').merchantModel
this.userAgent = this.isMobile() this.userAgent = this.isMobile()
this.showLoading() this.showLoading()
let { id, customerId, isTrue } = this.getQuery() let { id, customerId, isTrue } = this.getQuery()
...@@ -300,6 +322,9 @@ export default { ...@@ -300,6 +322,9 @@ export default {
} }
this.isMore = !this.isMore this.isMore = !this.isMore
}, },
moreInfoLabel(index) {
this.labelArray[index].isShow = !this.labelArray[index].isShow
},
getCustomerDetail(userId) { getCustomerDetail(userId) {
this.hideLoading() this.hideLoading()
detailApi.getCustomerDetail({ userId }).then(res => { detailApi.getCustomerDetail({ userId }).then(res => {
...@@ -316,8 +341,39 @@ export default { ...@@ -316,8 +341,39 @@ export default {
Object.keys(res).map(key => { Object.keys(res).map(key => {
if (res[key]) this.userInfo[key] = res[key] if (res[key]) this.userInfo[key] = res[key]
}) })
this.initLabel()
}
})
},
//标签分组
initLabel() {
console.log('this.userInfo.labelInfos', this.userInfo.labelInfos)
let labelArray = [
{
labelGroupType: '企业标签',
children: [],
isShow: false
},
{
labelGroupType: '自店标签',
children: [],
isShow: false
},
{
labelGroupType: '系统标签',
children: [],
isShow: false
}
]
this.userInfo.labelInfos.forEach(ele => {
labelArray.forEach(label => {
if (ele.labelGroupInfo.labelGroupType == label.labelGroupType) {
label.children.push(ele)
} }
}) })
})
console.log(labelArray)
this.labelArray = labelArray
}, },
setDetail({ type, title, save_key, maxlength }) { setDetail({ type, title, save_key, maxlength }) {
let { let {
...@@ -414,7 +470,8 @@ export default { ...@@ -414,7 +470,8 @@ export default {
}) })
}) })
}, },
handleTag() { handleTag(labelType) {
this.$refs.popRefs.labelType = labelType
this.$refs.popRefs.clearData() this.$refs.popRefs.clearData()
this.$refs.popRefs.toggle() this.$refs.popRefs.toggle()
}, },
...@@ -555,20 +612,30 @@ export default { ...@@ -555,20 +612,30 @@ export default {
} }
.detail-third { .detail-third {
margin: 10px 16px; margin: 10px 16px;
padding: 16px; padding: 10px 16px 16px 16px;
position: relative;
.title { .title {
font-size: 16px; font-size: 16px;
color: #333; color: #333;
font-weight: 600; font-weight: 600;
line-height: 22px;
.prompt-text {
font-size: 12px;
font-weight: 400;
color: #666666;
line-height: 17px;
margin-left: 6px;
}
} }
.detail-label { .detail-label {
position: relative;
min-height: 65px;
.no-label { .no-label {
position: absolute; position: absolute;
top: 50%; top: 10px;
left: 50%; right: 16px;
transform: translate(-50%, -50%); z-index: 99;
// top: 50%;
// left: 50%;
// transform: translate(-50%, -50%);
} }
.btn { .btn {
width: 60px; width: 60px;
...@@ -609,6 +676,33 @@ export default { ...@@ -609,6 +676,33 @@ export default {
box-sizing: border-box; box-sizing: border-box;
} }
} }
.detail-more {
border-radius: 0 0 4px 4px;
color: #999;
font-size: 12px;
text-align: center;
line-height: 18px;
padding: 20px 0 0 0;
position: relative;
z-index: 2;
background-color: #fff;
top: -1px;
.btn {
width: 108px;
height: 21px;
border-radius: 12px;
border: 1px solid #3975c6;
color: #3975c6;
font-size: 12px;
.sprite-icon {
margin-left: 4px;
transition: all 0.5s;
}
.more {
transform: rotate(-180deg);
}
}
}
} }
.detail-fourth { .detail-fourth {
margin: 10px 16px 36px 10px; margin: 10px 16px 36px 10px;
......
...@@ -61,7 +61,8 @@ export default { ...@@ -61,7 +61,8 @@ export default {
tagList: [], tagList: [],
checkAll: [], checkAll: [],
tagShow: false, tagShow: false,
tagFlag: false tagFlag: false,
labelType:''
} }
}, },
props: { props: {
...@@ -134,16 +135,22 @@ export default { ...@@ -134,16 +135,22 @@ export default {
this.tagFlag = false this.tagFlag = false
}, },
init() { init() {
let { chooseItems, keyWord, isCustomer } = this
console.log(chooseItems, 'chooseItems') let { chooseItems, keyWord, isCustomer, labelType } = this
let obj = { let obj = {
keyWord keyWord
} }
groupTag.gettagList(obj).then(res => { groupTag.gettagList(obj).then(res => {
this.tagFlag = true this.tagFlag = true
if (res && res.length > 0) { if (res && res.length > 0) {
if (!isCustomer) {
this.tagList= res.filter(label => {
return label.labelType == labelType
})
} else {
this.tagList = res this.tagList = res
console.log('this.tagList', this.tagList) }
if (this.tagList.length > 0) { if (this.tagList.length > 0) {
for (let i = 0; i < this.tagList.length; i++) { for (let i = 0; i < this.tagList.length; i++) {
this.tagList[i].checked = false this.tagList[i].checked = false
...@@ -212,7 +219,6 @@ export default { ...@@ -212,7 +219,6 @@ export default {
}, },
//打标签 //打标签
handleTag() { handleTag() {
console.log('this.tagList', this.tagList)
let tagIds = [] let tagIds = []
let deletetagIds = [] let deletetagIds = []
for (let i = 0; i < this.tagList.length; i++) { for (let i = 0; i < this.tagList.length; i++) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!