Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bf62990f
authored
Dec 20, 2021
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
H5客户画像
1 parent
9f0674c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
93 deletions
linkwe-mobile/src/api/portrait.js
linkwe-mobile/src/views/portrait/index.vue
linkwe-mobile/src/api/portrait.js
View file @
bf62990
...
@@ -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
})
})
...
...
linkwe-mobile/src/views/portrait/index.vue
View file @
bf62990
...
@@ -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,49 +391,41 @@ export default {
...
@@ -382,49 +391,41 @@ 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
()
{
this
.
$toast
.
loading
({
if
(
process
.
env
.
NODE_ENV
===
'production'
)
{
message
:
'loading...'
,
this
.
$toast
.
loading
({
duration
:
0
,
message
:
'loading...'
,
forbidClick
:
true
duration
:
0
,
})
forbidClick
:
true
// 获取agentId
})
let
query
=
param2Obj
(
window
.
location
.
search
)
// 获取agentId
let
hash
=
param2Obj
(
window
.
location
.
hash
)
let
query
=
param2Obj
(
window
.
location
.
search
)
query
=
Object
.
assign
(
query
,
hash
)
let
hash
=
param2Obj
(
window
.
location
.
hash
)
this
.
agentId
=
query
.
agentId
query
=
Object
.
assign
(
query
,
hash
)
this
.
agentId
=
query
.
agentId
// this.findAddaddEmployes()
}
else
{
// this.findAddGroupNum()
this
.
findAddaddEmployes
()
// this.getCustomerInfo()
this
.
findAddGroupNum
()
// this.findTrajectory()
this
.
getCustomerInfo
()
// this.getAllTags()
this
.
findTrajectory
()
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,27 +671,28 @@ export default {
...
@@ -639,27 +671,28 @@ 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
.
forEach
((
unit
)
=>
{
tags
&&
// 判断是否有重复标签
tags
.
forEach
((
unit
)
=>
{
let
isRepeat
=
this
.
listTagOneArray
.
some
((
d
)
=>
{
// 判断是否有重复标签
return
d
.
tagId
===
unit
.
tagId
let
isRepeat
=
this
.
listTagOneArray
.
some
((
d
)
=>
{
})
return
d
.
tagId
===
unit
.
tagId
// 去重
})
if
(
isRepeat
)
{
// 去重
repeat
.
push
(
unit
.
name
)
if
(
isRepeat
)
{
return
repeat
.
push
(
unit
.
name
)
}
return
let
filter
=
this
.
listTagOneArray
.
find
((
d
)
=>
{
}
return
d
.
tagId
===
unit
.
tagId
let
filter
=
this
.
listTagOneArray
.
find
((
d
)
=>
{
})
return
d
.
tagId
===
unit
.
tagId
// 如果没有匹配到,则说明该便签处于异常状态,可能已被删除或破坏
})
if
(
!
filter
)
{
// 如果没有匹配到,则说明该便签处于异常状态,可能已被删除或破坏
hasErrorTag
.
push
(
unit
.
name
)
if
(
!
filter
)
{
return
hasErrorTag
.
push
(
unit
.
name
)
}
return
}
this
.
addTag
.
push
(
filter
)
this
.
addTag
.
push
(
filter
)
})
})
this
.
show
=
true
this
.
show
=
true
// 获取用户当前的lable,将当前用户的lable与所有lable进行对比,相同的弹框内蓝色展示
// 获取用户当前的lable,将当前用户的lable与所有lable进行对比,相同的弹框内蓝色展示
// 弹框内的标签组选中时蓝色展示
// 弹框内的标签组选中时蓝色展示
...
@@ -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%
,
-5
0%
);
transform
:
translate
(
-50%
,
0%
);
}
}
//
社交关系
//
社交关系
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment