Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-customer
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 4087b6e4
authored
Mar 03, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
1.2.1版本修改
1 parent
374f7ff0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
126 additions
and
14 deletions
src/api/groupChat.js
src/views/customerGroup/index.vue
src/api/groupChat.js
View file @
4087b6e
// const url = 'http://192.168.
2.42
:8064/rop-scrm-entmicro/router'
// const url = 'http://192.168.
1.64
:8064/rop-scrm-entmicro/router'
const
url
=
'/rop-scrm-entmicro/router'
const
url
=
'/rop-scrm-entmicro/router'
export
default
{
export
default
{
/**获取群聊列表 */
/**获取群聊列表 */
getList
(
data
)
{
// getList(data) {
data
.
method
=
'entmicro.api.one.template.list'
// data.method = 'entmicro.api.one.template.list'
// data.pageSize = 9999
// data.pageNum = 1
// return window.$HTTP({
// url,
// data
// })
// },
// /** 根据userid获取客户详情 */
// getDetail(data) {
// data.method = 'entmicro.api.customer.detail'
// return window.$HTTP({
// url,
// data
// })
// },
/**获取群聊列表 */
getList
(
data
)
{
data
.
method
=
'entmicro.api.one.template.list.qyclient'
data
.
pageSize
=
9999
data
.
pageSize
=
9999
data
.
pageNum
=
1
data
.
pageNum
=
1
return
window
.
$HTTP
({
return
window
.
$HTTP
({
...
@@ -11,14 +30,14 @@ export default {
...
@@ -11,14 +30,14 @@ export default {
data
data
})
})
},
},
/** 根据userid获取客户详情 */
/** 根据userid获取客户详情 */
getDetail
(
data
)
{
getDetail
(
data
)
{
data
.
method
=
'entmicro.api.customer.detail
'
data
.
method
=
'entmicro.api.customer.externalUserId
'
return
window
.
$HTTP
({
return
window
.
$HTTP
({
url
,
url
,
data
data
})
})
},
},
/** 保存新的群聊 */
/** 保存新的群聊 */
addChat
(
data
)
{
addChat
(
data
)
{
data
.
method
=
'entmicro.api.group.one.insert'
data
.
method
=
'entmicro.api.group.one.insert'
...
...
src/views/customerGroup/index.vue
View file @
4087b6e
...
@@ -9,7 +9,10 @@
...
@@ -9,7 +9,10 @@
<img
class=
"img"
:src=
"businessCard.avatar"
alt=
""
/>
<img
class=
"img"
:src=
"businessCard.avatar"
alt=
""
/>
</div>
</div>
<div
class=
"customerTextBox"
>
<div
class=
"customerTextBox"
>
<div
class=
"title text-hide"
>
{{
businessCard
.
customerName
}}
</div>
<div
class=
"title text-hide"
>
{{
businessCard
.
customerName
}}
<span
v-if=
"remark"
>
(
{{
remark
}}
)
</span>
</div>
<div
class=
"icons"
v-if=
"businessCard.customerSex == 0 ? false : true"
>
<div
class=
"icons"
v-if=
"businessCard.customerSex == 0 ? false : true"
>
<!--
<img
:src=
'businessCard.customerSex == 1 ? "@/assets/images/icon/manIcon.png" : "@/assets/images/icon/womanIcon.png"'
alt=
""
/>
-->
<!--
<img
:src=
'businessCard.customerSex == 1 ? "@/assets/images/icon/manIcon.png" : "@/assets/images/icon/womanIcon.png"'
alt=
""
/>
-->
<img
class=
"customerIcon"
v-if=
"businessCard.customerSex == 1 ? false : true"
src=
"@/assets/images/icon/womanIcon.png"
alt=
""
/>
<img
class=
"customerIcon"
v-if=
"businessCard.customerSex == 1 ? false : true"
src=
"@/assets/images/icon/womanIcon.png"
alt=
""
/>
...
@@ -106,6 +109,7 @@ export default {
...
@@ -106,6 +109,7 @@ export default {
customerSex
:
''
,
customerSex
:
''
,
avatar
:
''
avatar
:
''
},
},
remark
:
''
,
vehicleInfoList
:
[],
vehicleInfoList
:
[],
groupList
:
[],
groupList
:
[],
flag
:
false
flag
:
false
...
@@ -114,7 +118,7 @@ export default {
...
@@ -114,7 +118,7 @@ export default {
activated
()
{},
activated
()
{},
deactivated
()
{},
deactivated
()
{},
mounted
()
{
mounted
()
{
this
.
init
Wx
()
this
.
init
Data
()
},
},
methods
:
{
methods
:
{
// 创建群聊or进入群聊
// 创建群聊or进入群聊
...
@@ -168,10 +172,99 @@ export default {
...
@@ -168,10 +172,99 @@ export default {
this
.
show
=
true
this
.
show
=
true
}
else
{
}
else
{
this
.
addGroupParams
.
chatId
=
item
.
chatId
this
.
addGroupParams
.
chatId
=
item
.
chatId
console
.
log
(
this
.
addGroupParams
.
chatId
,
' this.addGroupParams.chatId'
)
wxConfig
.
openExistedChatWithMsg
({
chatId
:
this
.
addGroupParams
.
chatId
}).
then
(
res
=>
{})
wxConfig
.
openExistedChatWithMsg
({
chatId
:
this
.
addGroupParams
.
chatId
}).
then
(
res
=>
{})
}
}
// console.log(this.addGroupParams)
// console.log(this.addGroupParams)
},
},
getCustomerInfo
(
externalUserId
)
{
//获取客户信息
groupChat
.
getDetail
({
userId
:
externalUserId
}).
then
(
res
=>
{
console
.
log
(
res
,
'data'
)
this
.
hideLoading
()
this
.
flag
=
true
this
.
businessCard
=
res
.
info
this
.
vehicleInfoList
=
res
.
vehicleInfoList
if
(
res
.
staffFollows
&&
res
.
staffFollows
.
length
>
0
&&
res
.
staffFollows
[
0
].
remark
)
{
this
.
remark
=
res
.
staffFollows
[
0
].
remark
}
groupChat
.
getList
({
externalUserId
:
externalUserId
}).
then
(
res
=>
{
this
.
groupList
=
res
||
[]
this
.
showRemark
=
res
&&
res
.
length
?
false
:
true
if
(
res
)
{
for
(
var
a
=
0
;
a
<
this
.
groupList
.
length
;
a
++
)
{
if
(
!
this
.
vehicleInfoList
)
{
if
(
this
.
groupList
[
a
].
groupNameRule
==
1
)
{
this
.
groupList
[
a
].
groupName
=
this
.
businessCard
.
customerName
+
this
.
groupList
[
a
].
groupName
}
if
(
this
.
groupList
[
a
].
groupNameRule
==
0
)
{
this
.
groupList
[
a
].
groupName
=
this
.
groupList
[
a
].
groupName
}
if
(
this
.
groupList
[
a
].
groupNameRule
==
2
)
{
this
.
groupList
[
a
].
groupName
=
this
.
groupList
[
a
].
groupName
}
}
else
{
if
(
this
.
groupList
[
a
].
groupNameRule
==
0
)
{
this
.
groupList
[
a
].
groupName
=
this
.
groupList
[
a
].
groupName
}
if
(
this
.
groupList
[
a
].
groupNameRule
==
1
)
{
if
(
!
this
.
vehicleInfoList
[
0
].
vehicleTrain
)
{
this
.
vehicleInfoList
[
0
].
vehicleTrain
=
''
}
// this.groupList[a].groupName = `${this.businessCard.customerName}${this.groupList[a].groupName}`
this
.
groupList
[
a
].
groupName
=
this
.
vehicleInfoList
[
0
].
vehicleTrain
+
this
.
businessCard
.
customerName
+
this
.
groupList
[
a
].
groupName
}
if
(
this
.
groupList
[
a
].
groupNameRule
==
2
)
{
if
(
!
this
.
vehicleInfoList
[
0
].
vehicleTrain
)
{
this
.
vehicleInfoList
[
0
].
vehicleTrain
=
''
}
if
(
!
this
.
vehicleInfoList
[
0
].
vehicleNo
)
{
this
.
vehicleInfoList
[
0
].
vehicleNo
=
''
}
this
.
groupList
[
a
].
groupName
=
this
.
vehicleInfoList
[
0
].
vehicleTrain
+
this
.
vehicleInfoList
[
0
].
vehicleNo
+
this
.
groupList
[
a
].
groupName
}
}
}
}
})
})
},
initData
()
{
let
{
id
}
=
this
.
getQuery
()
console
.
log
(
id
)
this
.
showLoading
()
if
(
id
)
{
this
.
userId
=
id
let
externalUserId
=
id
this
.
addGroupParams
.
externalUserIds
.
push
(
id
)
this
.
getCustomerInfo
(
externalUserId
)
}
else
{
wxConfig
.
init
([
'getCurExternalContact'
,
'openEnterpriseChat'
,
'openExistedChatWithMsg'
]).
then
(()
=>
{
//获取userId
wxConfig
.
getCurExternalContact
()
.
then
(
userId
=>
{
console
.
log
(
userId
,
'11111'
)
this
.
userId
=
userId
let
externalUserId
=
userId
this
.
addGroupParams
.
externalUserIds
.
push
(
userId
)
this
.
getCustomerInfo
(
externalUserId
)
})
.
catch
(
e
=>
{
this
.
hideLoading
()
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该功能暂不支持在群侧边栏打开'
,
confirmButtonText
:
'知道了'
,
confirmButtonColor
:
'#3975c6'
}).
then
(()
=>
{
wx
.
closeWindow
()
})
})
})
}
},
//初始化微信接口
//初始化微信接口
//初始化微信接口
initWx
()
{
initWx
()
{
this
.
showLoading
()
this
.
showLoading
()
...
@@ -204,7 +297,7 @@ export default {
...
@@ -204,7 +297,7 @@ export default {
if
(
this
.
groupList
[
a
].
groupNameRule
==
0
)
{
if
(
this
.
groupList
[
a
].
groupNameRule
==
0
)
{
this
.
groupList
[
a
].
groupName
=
this
.
groupList
[
a
].
groupName
this
.
groupList
[
a
].
groupName
=
this
.
groupList
[
a
].
groupName
}
}
if
(
this
.
groupList
[
a
].
groupNameRule
==
2
)
{
if
(
this
.
groupList
[
a
].
groupNameRule
==
2
)
{
this
.
groupList
[
a
].
groupName
=
this
.
groupList
[
a
].
groupName
this
.
groupList
[
a
].
groupName
=
this
.
groupList
[
a
].
groupName
}
}
}
else
{
}
else
{
...
...
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