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 8d6bbfc3
authored
Mar 07, 2022
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
--no commit message
1 parent
e0701f78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
80 deletions
src/config/env.development.js
src/views/customerGroup/index.vue
src/config/env.development.js
View file @
8d6bbfc
...
...
@@ -11,7 +11,7 @@ module.exports = {
envVersion
:
"develop"
,
title
:
'嘀加企微管家'
,
request
:
{
baseURL
:
'http://scrm.
dev
.glsx.com.cn'
,
// 本地测试项目地址,
baseURL
:
'http://scrm.
test
.glsx.com.cn'
,
// 本地测试项目地址,
// 设置超时时间
timeout
:
180000
,
// 携带凭证
...
...
src/views/customerGroup/index.vue
View file @
8d6bbfc
...
...
@@ -122,16 +122,16 @@ export default {
this
.
initWx
()
},
methods
:
{
//初始化微信接口
//初始化微信接口
initWx
()
{
wxConfig
.
init
([
'openEnterpriseChat'
,
'openExistedChatWithMsg'
]).
then
(()
=>
{})
wxConfig
.
init
([
'openEnterpriseChat'
,
'openExistedChatWithMsg'
]).
then
(()
=>
{})
},
// 创建群聊or进入群聊
addGroup
()
{
console
.
log
(
this
.
addGroupParams
,
'-----'
)
if
(
this
.
addGroupParams
.
chatId
==
''
)
{
wxConfig
.
openEnterpriseChat
(
this
.
addGroupParams
).
then
(
res
=>
{
console
.
log
(
res
,
'res'
)
console
.
log
(
res
,
'res'
)
this
.
insertParams
.
chatId
=
res
.
chatId
this
.
insertParams
.
externalUserId
=
this
.
userId
this
.
insertParams
.
templateId
=
this
.
templateId
...
...
@@ -201,7 +201,11 @@ export default {
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
.
remark
)
{
this
.
groupList
[
a
].
groupName
=
this
.
remark
+
this
.
groupList
[
a
].
groupName
}
else
{
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
...
...
@@ -244,8 +248,7 @@ export default {
let
externalUserId
=
id
this
.
addGroupParams
.
externalUserIds
.
push
(
id
)
this
.
getCustomerInfo
(
externalUserId
)
}
else
{
}
else
{
wxConfig
.
init
([
'getCurExternalContact'
,
'openEnterpriseChat'
,
'openExistedChatWithMsg'
]).
then
(()
=>
{
//获取userId
wxConfig
...
...
@@ -273,79 +276,79 @@ export default {
},
//初始化微信接口
//初始化微信接口
initWx
()
{
this
.
showLoading
()
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
)
//获取客户信息
groupChat
.
getDetail
({
userId
:
externalUserId
}).
then
(
res
=>
{
console
.
log
(
res
,
'data'
)
this
.
hideLoading
()
this
.
flag
=
true
this
.
businessCard
=
res
.
info
this
.
vehicleInfoList
=
res
.
vehicleInfoList
groupChat
.
getList
({
externalUserId
:
externalUserId
}).
then
(
res
=>
{
console
.
log
(
res
,
'444'
)
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
}
}
}
}
})
})
})
.
catch
(
e
=>
{
this
.
hideLoading
()
Dialog
.
alert
({
title
:
'提示'
,
message
:
'该功能暂不支持在群侧边栏打开'
,
confirmButtonText
:
'知道了'
,
confirmButtonColor
:
'#3975c6'
}).
then
(()
=>
{
wx
.
closeWindow
()
})
})
})
}
//
initWx() {
//
this.showLoading()
//
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)
//
//获取客户信息
//
groupChat.getDetail({ userId: externalUserId }).then(res => {
//
console.log(res, 'data')
//
this.hideLoading()
//
this.flag = true
//
this.businessCard = res.info
//
this.vehicleInfoList = res.vehicleInfoList
//
groupChat.getList({ externalUserId: externalUserId }).then(res => {
//
console.log(res, '444')
//
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
//
}
//
}
//
}
//
}
//
})
//
})
//
})
//
.catch(e => {
//
this.hideLoading()
//
Dialog.alert({
//
title: '提示',
//
message: '该功能暂不支持在群侧边栏打开',
//
confirmButtonText: '知道了',
//
confirmButtonColor: '#3975c6'
//
}).then(() => {
//
wx.closeWindow()
//
})
//
})
//
})
//
}
}
}
</
script
>
...
...
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