Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-main
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 1d71e4eb
authored
Apr 01, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改发送素材
1 parent
550d2fc1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
44 deletions
src/mixins/shareMixin.js
src/mixins/shareMixin.js
View file @
1d71e4e
...
@@ -30,72 +30,75 @@ export default {
...
@@ -30,72 +30,75 @@ export default {
const
imgUrl
=
'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/test/test.jpg'
const
imgUrl
=
'https://img01.glsx.com.cn/weapp/resource/scrm-mobile/test/test.jpg'
let
query
=
`merchantId=
${
merchantId
}
&id=
${
id
}
&staffUuid=
${
uuid
}
`
let
query
=
`merchantId=
${
merchantId
}
&id=
${
id
}
&staffUuid=
${
uuid
}
`
if
(
sapCode
)
query
=
`
${
query
}
&storeCode=
${
sapCode
}
`
if
(
sapCode
)
query
=
`
${
query
}
&storeCode=
${
sapCode
}
`
wxConfig
.
createMiniprogramUrlLink
({
path
,
query
,
appId
:
shopmall_appid
,
envVersion
})
.
then
(
link
=>
{
this
.
showLoading
()
if
(
isPyq
)
{
console
.
log
(
'朋友圈'
)
wxConfig
.
shareToExternalMoments
({
attachments
:
[
{
msgtype
:
'link'
,
// 消息类型,必填
link
:
{
title
:
materialTitle
||
materialName
,
// H5消息标题
imgUrl
:
titleUrl
||
imgUrl
,
// H5消息封面图片URL
url
:
link
// H5消息页面url 必填
},
}
]
}).
then
(()
=>
{
this
.
sendReadBuriedPoint
({
id
,
merchantId
,
uuid
})
this
.
hideLoading
()
})
.
catch
(
err
=>
{
this
.
hideLoading
()
})
}
else
{
let
params
=
{
link
,
title
:
materialTitle
||
materialName
,
desc
:
description
||
''
,
imgUrl
:
titleUrl
||
imgUrl
}
if
(
entry
!=
'normal'
)
this
.
sendChatMessage
(
params
,
{
id
,
merchantId
,
uuid
})
else
this
.
shareAppMessage
(
params
,
{
id
,
merchantId
,
uuid
})
}
})
},
sendReadBuriedPoint
({
id
,
merchantId
,
uuid
})
{
marketingApi
.
sendReadBuriedPoint
({
marketingApi
.
sendReadBuriedPoint
({
materialId
:
id
,
materialId
:
id
,
type
:
1
,
type
:
1
,
merchantId
,
merchantId
,
staffUuid
:
uuid
staffUuid
:
uuid
}).
then
(()
=>
{
wxConfig
.
createMiniprogramUrlLink
({
path
,
query
,
appId
:
shopmall_appid
,
envVersion
})
.
then
(
link
=>
{
this
.
showLoading
()
if
(
isPyq
)
{
console
.
log
(
'朋友圈'
)
wxConfig
.
shareToExternalMoments
({
attachments
:
[
{
msgtype
:
'link'
,
// 消息类型,必填
link
:
{
title
:
materialTitle
||
materialName
,
// H5消息标题
imgUrl
:
titleUrl
||
imgUrl
,
// H5消息封面图片URL
url
:
link
// H5消息页面url 必填
},
}
]
}).
then
(()
=>
{
this
.
hideLoading
()
})
.
catch
(
err
=>
{
this
.
hideLoading
()
})
}
else
{
let
params
=
{
link
,
title
:
materialTitle
||
materialName
,
desc
:
description
||
''
,
imgUrl
:
titleUrl
||
imgUrl
}
if
(
entry
!=
'normal'
)
this
.
sendChatMessage
(
params
,
'news'
)
else
this
.
shareAppMessage
(
params
)
}
})
})
})
},
},
sendChatMessage
(
params
,
msgtype
)
{
sendChatMessage
(
params
,
sendParams
)
{
wxConfig
wxConfig
.
sendChatMessage
({
.
sendChatMessage
({
msgtype
,
msgtype
,
[
msgtype
]
:
params
,
news
:
params
,
enterChat
:
false
enterChat
:
false
})
})
.
then
(
()
=>
{
.
then
(
res
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
this
.
sendReadBuriedPoint
(
sendParams
)
})
})
.
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
this
.
hideLoading
()
this
.
hideLoading
()
})
})
},
},
shareAppMessage
(
params
)
{
shareAppMessage
(
params
,
sendParams
)
{
wxConfig
wxConfig
.
shareAppMessage
(
params
)
.
shareAppMessage
(
params
)
.
then
(()
=>
{
.
then
(()
=>
{
this
.
sendReadBuriedPoint
(
sendParams
)
this
.
hideLoading
()
this
.
hideLoading
()
})
})
.
catch
(()
=>
{
.
catch
(()
=>
{
...
...
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