Commit 6b6aa482 by zhouzy
2 parents 3b82640e c0d4ea46
...@@ -2,11 +2,10 @@ const url = '/rop-scrm-entmicro/router' ...@@ -2,11 +2,10 @@ const url = '/rop-scrm-entmicro/router'
export default { export default {
/** 侧边栏-客户跟进 */ /** 侧边栏-客户跟进 */
getCustomerDetail(data) { getCustomerDetail(data) {
data.method = 'entmicro.api.customer.detail.single' data.method = 'entmicro.api.customer.detail'
return window.$HTTP({ return window.$HTTP({
url, url,
data, data,
returnAll: true
}) })
} }
} }
...@@ -39,7 +39,7 @@ Vue.prototype.to = function (name, params) { ...@@ -39,7 +39,7 @@ Vue.prototype.to = function (name, params) {
Vue.config.productionTip = false Vue.config.productionTip = false
import VConsole from 'vconsole' import VConsole from 'vconsole'
// const vConsole = new VConsole() const vConsole = new VConsole()
const isMock = true const isMock = true
fetchConfig(!isMock).then(res => { fetchConfig(!isMock).then(res => {
......
<template> <template>
<div style="padding-bottom: 30px"> <div v-if="flag">
<div class="detail-bg detail-first"> <div class="detail-bg detail-first">
<div class="detail-customer"> <div class="detail-customer">
<template v-if="userInfo.info.avatar">
<img
:src="userInfo.info.avatar"
class="avatar"
>
</template>
<template v-else>
<div class="sprite-icon icon-avatar"></div> <div class="sprite-icon icon-avatar"></div>
</template>
<div class="detail-customer-name"> <div class="detail-customer-name">
<span class="name">小晶</span> <span class="name">{{userInfo.info.customerName}}</span>
<span class="wechat">@微信</span> <span class="wechat">@{{userInfo.info.type == 1?'微信':'企微'}}</span>
<div>女</div> <div>
{{customerSex[userInfo.info.customerSex]}}
</div>
</div> </div>
</div> </div>
<div class="detail-member"> <div class="detail-member">
<span class="name">所属成员</span> <span class="name">所属成员</span>
<span>陈晓凯、熬浓</span> <span>
{{staffNameList}}
</span>
</div> </div>
</div> </div>
<div class="detail-second"> <div class="detail-second">
<van-cell-group :class="[isMore ? '' : 'more-hidden']" inset> <van-cell-group
<van-cell title="添加时间" value="内容" /> :class="[isMore ? '' : 'more-hidden']"
<van-cell title="添加渠道" value="内容" /> inset
<van-cell title="联系电话" value="2324" is-link @click="toEdit('设置联系电话')" /> >
<van-cell title="身份证号码" value="123412412" is-link @click="toEdit('设置身份证号码')" /> <van-cell
<van-cell title="购车日期" :value="date" @click="show = true" is-link /> title="添加时间"
<van-cell title="近期保养日期" :value="date" @click="show = true" is-link /> :value="userInfo.info.addTime"
<van-cell title="近期到店日期" :value="date" @click="show = true" is-link /> />
<van-cell title="商业险到期日期" :value="date" @click="show = true" is-link /> <van-cell
<van-cell title="车系" value="123412412" is-link @click="toEdit('设置车系')" /> title="添加渠道"
<van-cell title="车型" value="123412412" is-link @click="toEdit('设置车型')" /> :value="userInfo.info.addWayName"
<van-calendar v-model="show" color="#6760ff" @confirm="onConfirm" /> />
<van-cell
title="联系电话"
:value="userInfo.info.customerPhone"
/>
<van-cell
title="身份证号码"
value="身份证没有"
/>
<van-cell
title="购车日期"
:value="userInfo.vehicleInfo.buyTime"
/>
<van-cell
title="近期保养日期"
:value="userInfo.vehicleInfo.maintRecTime"
/>
<van-cell
title="近期到店日期"
value="到店日期没有"
/>
<van-cell
title="商业险到期日期"
:value="userInfo.vehicleInfo.insEndTime"
/>
<van-cell
title="车系"
:value="userInfo.vehicleInfo.vehicleTrain"
/>
<van-cell
title="车型"
:value="userInfo.vehicleInfo.vehicleType"
/>
</van-cell-group> </van-cell-group>
<div class="detail-more" @click="moreInfo">{{ isMore ? '收起' : '更多信息' }}</div> <div
class="detail-more"
@click="moreInfo"
>{{ isMore ? '收起' : '更多信息' }}</div>
</div> </div>
<div class="detail-bg detail-third"> <div class="detail-bg detail-third">
<div class="title">客户标签</div> <div class="title">客户标签</div>
<div class="detail-label"> <div class="detail-label">
<div v-if="labelist.length == 0" class="no-label"> <div
v-if="userInfo.labels.length == 0"
class="no-label"
>
<div class="btn"> <div class="btn">
<van-icon name="plus" /> <van-icon name="plus" />
<span>标签</span> <span>标签</span>
</div> </div>
</div> </div>
<div class="has-label" v-else> <div
class="has-label"
v-else
>
<div> <div>
<div v-for="item in labelist" :key="item.id" class="label-text">{{ item.name }}</div> <div
v-for="item in userInfo.labels"
:key="item.id"
class="label-text"
>{{ item.labelValue }}</div>
</div> </div>
<div class="btn-box"> <!-- <div class="btn-box">
<div class="btn"> <div class="btn">
<van-icon name="plus" /> <van-icon name="plus" />
<span>标签</span> <span>标签</span>
</div> </div>
</div> </div> -->
</div> </div>
</div> </div>
</div> </div>
<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">
<div v-if="groupList.length == 0" class="no-data">暂无数据</div> <div
v-if="userInfo.customerBases.length == 0"
class="no-data"
>暂无数据</div>
<div v-else> <div v-else>
<div v-for="itm in groupList" :key="itm.id" class="group-item"> <div
v-for="itm in userInfo.customerBases"
:key="itm.id"
class="group-item"
>
<div class="group-avatar"></div> <div class="group-avatar"></div>
<div class="name">{{ itm.groupName }}({{ itm.num }})</div> <div class="name">{{ itm.groupName }}({{ itm.membersNumber }})</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -68,82 +132,52 @@ ...@@ -68,82 +132,52 @@
</template> </template>
<script> <script>
import { detailApi } from '@/api' import { detailApi, wxConfig } from '@/api'
export default { export default {
data() { data() {
return { return {
show: false, flag: false,
date: '',
value: '',
isMore: false, isMore: false,
labelist: [ userInfo: {
{ labels: [],
id: 1, vehicleInfo: {},
name: '即将离开' customerBases: [],
}, info: {}
{
id: 2,
name: '大四'
},
{
id: 3,
name: '大四'
},
{
id: 4,
name: '大四'
}, },
{ staffNameList: '',
id: 5, customerSex: {
name: '大四' 0: '未知',
}, 1: '男',
{ 2: '女'
id: 6,
name: '大四'
} }
],
groupList: [
{
id: 1,
groupName: '发发呆',
num: 2
},
{
id: 2,
groupName: '烦的还是挺好的发挥地方',
num: 4
},
{
id: 3,
groupName: '和任何人聚',
num: 6
}
]
} }
}, },
created() { mounted() {
this.getCustomerDetail() this.showLoading()
wxConfig.init(['getCurExternalContact']).then(() => {
wxConfig.getCurExternalContact().then(userId => {
this.getCustomerDetail(userId)
})
})
}, },
methods: { methods: {
onConfirm(date) {
console.log(date)
// const [start, end] = date
this.show = false
this.date = date
// this.date = `${this.formatDate(start)} - ${this.formatDate(end)}`
},
moreInfo() { moreInfo() {
this.isMore = !this.isMore this.isMore = !this.isMore
}, },
toEdit(title, value) { getCustomerDetail(userId) {
this.$router.push({ this.hideLoading()
name: 'customer.editDetail', detailApi.getCustomerDetail({ userId }).then(res => {
params: { title } this.flag = true
let staffNameList = []
if (res.staffFollows) {
res.staffFollows.map(e => {
staffNameList.push(e.staffName)
})
}
this.staffNameList = staffNameList.join('、')
Object.keys(res).map(key => {
if (res[key]) this.userInfo[key] = res[key]
}) })
},
getCustomerDetail() {
detailApi.getCustomerDetail({ externalUserId: 'wm-ZewEAAAc61j2kgvuKnY011oPgBj3w' }).then(res => {
console.log(res)
}) })
} }
} }
...@@ -163,6 +197,11 @@ export default { ...@@ -163,6 +197,11 @@ export default {
display: flex; display: flex;
border-bottom: 1px solid rgba(0, 0, 0, 0.1); border-bottom: 1px solid rgba(0, 0, 0, 0.1);
padding: 0 10px 21px; padding: 0 10px 21px;
.avatar {
width: 44px;
height: 44px;
flex-shrink: 0;
}
&-name { &-name {
font-size: 16px; font-size: 16px;
margin-left: 16px; margin-left: 16px;
...@@ -208,10 +247,12 @@ export default { ...@@ -208,10 +247,12 @@ export default {
.detail-second { .detail-second {
.van-cell-group { .van-cell-group {
box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5); box-shadow: 0px 4px 8px 0px rgba(224, 224, 224, 0.5);
transition: all 0.25s;
height: 440px;
overflow: hidden;
} }
.more-hidden { .more-hidden {
max-height: 132px; height: 132px;
overflow: hidden;
} }
.detail-more { .detail-more {
background-color: #ededed; background-color: #ededed;
...@@ -262,7 +303,6 @@ export default { ...@@ -262,7 +303,6 @@ export default {
.label-text { .label-text {
display: inline-block; display: inline-block;
margin: 0 4px 4px 0; margin: 0 4px 4px 0;
max-width: 66px;
overflow: hidden; overflow: hidden;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis; text-overflow: ellipsis;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!