Commit bf62990f by xinla

H5客户画像

1 parent 9f0674c4
...@@ -138,7 +138,7 @@ export function handleWait(params) { ...@@ -138,7 +138,7 @@ export function handleWait(params) {
*/ */
export function addOrUpdatePersonTags(data) { export function addOrUpdatePersonTags(data) {
return request({ return request({
url: service + '/addOrUpdatePersonTags/', url: service + '/addOrUpdatePersonTags',
method: 'post', method: 'post',
data data
}) })
......
...@@ -144,7 +144,13 @@ ...@@ -144,7 +144,13 @@
<!-- 点击客户标签里的编辑触发弹出框开始 --> <!-- 点击客户标签里的编辑触发弹出框开始 -->
<van-action-sheet v-model="show"> <van-action-sheet v-model="show">
<van-nav-bar title="客户标签管理" right-text="取消" @click-right="show = false" /> <van-nav-bar title="客户标签管理" right-text="取消" @click-right="show = false">
<template v-if="editLabelType === 'person'" slot="left">
<van-button type="primary" size="mini" @click="showAddTag = true">
添加标签
</van-button>
</template>
</van-nav-bar>
<div class="content"> <div class="content">
<div v-for="(item, index) in alllabel" :key="index"> <div v-for="(item, index) in alllabel" :key="index">
<div class="mb10 mt5">{{ item.gourpName }}:</div> <div class="mb10 mt5">{{ item.gourpName }}:</div>
...@@ -161,10 +167,11 @@ ...@@ -161,10 +167,11 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="editLabelType === 'person'" class="ac" @click="showAddTag = true"> <div class="saveinfo">
添加标签 <van-button type="info" class="mt10 mb15" size="small" block round @click="saveCustomerTag">
保存
</van-button>
</div> </div>
<van-button type="info" class="saveinfo" round @click="saveCustomerTag">保存</van-button>
</van-action-sheet> </van-action-sheet>
<van-dialog <van-dialog
...@@ -283,7 +290,8 @@ import { ...@@ -283,7 +290,8 @@ import {
findAddaddEmployes, findAddaddEmployes,
findAddGroupNum, findAddGroupNum,
findTrajectory, findTrajectory,
addOrEditWaitHandle addOrEditWaitHandle,
addOrUpdatePersonTags
} from '@/api/portrait' } from '@/api/portrait'
// import { getUserInfo } from "@/api/common"; // import { getUserInfo } from "@/api/common";
import StepList from '@/components/StepList.vue' import StepList from '@/components/StepList.vue'
...@@ -320,7 +328,8 @@ export default { ...@@ -320,7 +328,8 @@ export default {
// 待办动态 // 待办动态
todonewsshow: false, todonewsshow: false,
// 接口开始 // 接口开始
externalUserid: '', externalUserid:
process.env.NODE_ENV === 'production' ? '' : 'wmiGuBCgAA617zOzAIg-0sZG3Vok7BUA',
// externalUserid: 'wmiGuBCgAAoCBD1frD3hRplbsXoBLx6g', // 客户IdwmiGuBCgAAoCBD1frD3hRplbsXoBLx6g // externalUserid: 'wmiGuBCgAAoCBD1frD3hRplbsXoBLx6g', // 客户IdwmiGuBCgAAoCBD1frD3hRplbsXoBLx6g
// externalUserid: 'wmiGuBCgAA617zOzAIg-0sZG3Vok7BUA', // externalUserid: 'wmiGuBCgAA617zOzAIg-0sZG3Vok7BUA',
form: { form: {
...@@ -382,21 +391,21 @@ export default { ...@@ -382,21 +391,21 @@ export default {
}, },
computed: { computed: {
userId() { userId() {
return this.$store.state.userId return process.env.NODE_ENV === 'production' ? this.$store.state.userId : 'FengJuZhuDeJieDao'
// || 'FengJuZhuDeJieDao' }
},
// activeLabel : () => { // activeLabel : () => {
// this.addTag.forEach((value) => { // this.addTag.forEach((value) => {
// value.name == this.name // value.name == this.name
// }) // })
// return this.activelabel // return this.activelabel
// } // }
minHour() { // minHour() {
let date = new Date() // let date = new Date()
return this.dateagency == this.getTime() ? date.getHours() : 0 // return this.dateagency == this.getTime() ? date.getHours() : 0
} // }
}, },
created() { created() {
if (process.env.NODE_ENV === 'production') {
this.$toast.loading({ this.$toast.loading({
message: 'loading...', message: 'loading...',
duration: 0, duration: 0,
...@@ -407,24 +416,16 @@ export default { ...@@ -407,24 +416,16 @@ export default {
let hash = param2Obj(window.location.hash) let hash = param2Obj(window.location.hash)
query = Object.assign(query, hash) query = Object.assign(query, hash)
this.agentId = query.agentId this.agentId = query.agentId
} else {
// this.findAddaddEmployes() this.findAddaddEmployes()
// this.findAddGroupNum() this.findAddGroupNum()
// this.getCustomerInfo() this.getCustomerInfo()
// this.findTrajectory() this.findTrajectory()
// this.getAllTags() this.getAllTags()
}
}, },
methods: { methods: {
// 时间处理器
getTime(data) {
const date = new Date()
// console.log(timer.getFullYear());
var Y = date.getFullYear() + '-'
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + ''
return Y + M + D
},
init() { init() {
let _this = this let _this = this
wx.invoke('getContext', {}, function(res) { wx.invoke('getContext', {}, function(res) {
...@@ -456,6 +457,37 @@ export default { ...@@ -456,6 +457,37 @@ export default {
} }
}) })
}, },
getCustomerInfo() {
// this.$toast('userId:' + this.userId)
getCustomerInfo({
externalUserid: this.externalUserid,
userId: this.userId
})
.then(({ data }) => {
if (data.tagIds && data.tagNames) {
data.tagIds = data.tagIds.split(',')
data.tagNames = data.tagNames.split(',')
data.tags = data.tagIds.map((unit, index) => ({
tagId: unit,
name: data.tagNames[index]
}))
}
if (data.personTagIds && data.personTagNames) {
data.personTagIds = data.personTagIds.split(',')
data.personTagNames = data.personTagNames.split(',')
data.personTags = data.personTagIds.map((unit, index) => ({
tagId: unit,
name: data.personTagNames[index]
}))
}
this.form = data
// console.log(this.form);
})
.catch((err) => {
console.log(err)
})
},
getAllTags(type) { getAllTags(type) {
let params = { let params = {
groupTagType: 1 groupTagType: 1
...@@ -639,6 +671,7 @@ export default { ...@@ -639,6 +671,7 @@ export default {
let tags = this.form[type === 'person' ? 'personTags' : 'tags'] let tags = this.form[type === 'person' ? 'personTags' : 'tags']
let hasErrorTag = [] // 异常活已经删除的标签 let hasErrorTag = [] // 异常活已经删除的标签
let repeat = [] // 重复的标签 let repeat = [] // 重复的标签
tags &&
tags.forEach((unit) => { tags.forEach((unit) => {
// 判断是否有重复标签 // 判断是否有重复标签
let isRepeat = this.listTagOneArray.some((d) => { let isRepeat = this.listTagOneArray.some((d) => {
...@@ -695,42 +728,16 @@ export default { ...@@ -695,42 +728,16 @@ export default {
console.log(err) console.log(err)
}) })
}, },
// 添加个人标签
getCustomerInfo() { submitNewPersonTag() {
// this.$toast('userId:' + this.userId) addOrUpdatePersonTags(this.submitNewPersonTag)
getCustomerInfo({ .then((res) => {
externalUserid: this.externalUserid, this.getAllTags('person')
userId: this.userId
})
.then(({ data }) => {
// console.log(data);
if (data.tagIds && data.tagNames) {
data.tagIds = data.tagIds.split(',')
data.tagNames = data.tagNames.split(',')
data.tags = data.tagIds.forEach((unit, index) => ({
tagId: unit,
name: data.tagNames[index]
}))
}
if (data.personTagIds && data.personTagNames) {
data.personTagIds = data.personTagIds.split(',')
data.personTagNames = data.personTagNames.split(',')
data.personTags = data.personTagIds.map((unit, index) => ({
tagId: unit,
name: data.personTagNames[index]
}))
}
this.form = data
// console.log(this.form);
}) })
.catch((err) => { .catch((err) => {
console.log(err) console.log(err)
}) })
}, }
// 添加个人标签
submitNewPersonTag() {}
} }
} }
</script> </script>
...@@ -825,10 +832,9 @@ export default { ...@@ -825,10 +832,9 @@ export default {
.saveinfo { .saveinfo {
position: absolute; position: absolute;
width: 90%; width: 90%;
height: 30px;
left: 50%; left: 50%;
bottom: 0; bottom: 0;
transform: translate(-50%, -50%); transform: translate(-50%, 0%);
} }
// 社交关系 // 社交关系
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!