Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
dj-scrm-wx-work-attachment-psd
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 54f92596
authored
Jul 12, 2022
by
张权
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
完成营销素材,&第一轮自测
1 parent
7d98609e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
40 deletions
src/mixins/shareMixin.js
src/mixins/shareMixin.js
View file @
54f9259
...
@@ -68,8 +68,20 @@ export default {
...
@@ -68,8 +68,20 @@ export default {
imgUrl
:
titleUrl
||
imgUrl
imgUrl
:
titleUrl
||
imgUrl
}
}
if
(
entry
!=
'normal'
)
this
.
getParam
(
i
,
{
id
,
merchantId
,
uuid
})
if
(
entry
!=
'normal'
){
else
this
.
shareAppMessage
(
params
,
{
id
,
merchantId
,
uuid
})
let
pdfParam
=
{
msgtype
:
'news'
,
news
:
params
,
enterChat
:
false
}
if
(
i
.
materialType
==
1
){
this
.
sendChatMessage
(
pdfParam
,
{
id
,
merchantId
,
uuid
})
}
else
{
this
.
getParam
(
i
,
{
id
,
merchantId
,
uuid
})
}
}
else
{
this
.
shareAppMessage
(
params
,
{
id
,
merchantId
,
uuid
})
}
}
}
})
})
},
},
...
@@ -87,8 +99,7 @@ export default {
...
@@ -87,8 +99,7 @@ export default {
let
arr
=
str
.
match
(
reg
)
let
arr
=
str
.
match
(
reg
)
arr
=
arr
.
filter
(
item
=>
item
)
arr
=
arr
.
filter
(
item
=>
item
)
let
newArr
=
[]
let
newArr
=
[]
console
.
log
(
arr
,
123
)
arr
.
forEach
(
(
ele
,
id
)
=>
{
arr
.
forEach
(
async
(
ele
,
id
)
=>
{
let
mediaType
=
5
let
mediaType
=
5
let
myParam
=
{}
let
myParam
=
{}
let
fileReg
=
/https
?
:
\/\/
/
let
fileReg
=
/https
?
:
\/\/
/
...
@@ -101,34 +112,39 @@ export default {
...
@@ -101,34 +112,39 @@ export default {
}
else
{
}
else
{
mediaType
=
4
mediaType
=
4
}
}
myParam
=
await
this
.
uploadMaterial
({
materialName
:
item
.
materialName
,
data
:
ele
,
mediaType
},
mediaType
)
myParam
=
this
.
uploadMaterial
({
materialName
:
item
.
materialName
,
data
:
ele
,
mediaType
},
mediaType
)
console
.
log
(
myParam
,
id
)
this
.
sendChatMessage
(
myParam
,
sendParams
)
}
else
{
}
else
{
myParam
=
{
myParam
=
this
.
getTextPromise
(
ele
)
msgtype
:
'text'
,
text
:
{
content
:
ele
},
enterChat
:
false
}
this
.
sendChatMessage
(
myParam
,
sendParams
)
}
}
newArr
.
push
(
myParam
)
newArr
.
push
(
myParam
)
console
.
log
(
myParam
,
id
)
});
});
// return newArr
Promise
.
allSettled
(
newArr
).
then
(
async
res
=>
{
for
(
let
i
=
0
;
i
<
res
.
length
;
i
++
){
await
this
.
sendChatMessage
(
res
[
i
].
value
,
sendParams
)
}
})
},
},
forEachSend
(
params
,
sendParams
){
getTextPromise
(
ele
){
let
materialArr
=
this
.
getParam
(
params
)
return
new
Promise
((
resolve
,
reject
)
=>
{
materialArr
.
forEach
(
item
=>
{
resolve
({
this
.
sendChatMessage
(
item
,
sendParams
)
msgtype
:
'text'
,
text
:
{
content
:
ele
},
enterChat
:
false
})
})
})
},
},
uploadMaterial
(
param
,
type
){
uploadMaterial
(
param
,
type
){
return
new
Promise
((
resolve
,
reject
)
=>
{
return
new
Promise
((
resolve
,
reject
)
=>
{
marketingApi
.
uploadMaterial
(
param
).
then
(
res
=>
{
marketingApi
.
uploadMaterial
(
param
).
then
(
res
=>
{
console
.
log
(
res
,
456
)
if
(
res
?.
mediaId
){
if
(
res
?.
mediaId
){
if
(
type
==
3
){
if
(
type
==
1
){
resolve
({
msgtype
:
'file'
,
file
:
{
mediaid
:
res
.
mediaId
},
enterChat
:
false
})
}
else
if
(
type
==
3
){
resolve
({
resolve
({
msgtype
:
'image'
,
msgtype
:
'image'
,
image
:
{
mediaid
:
res
.
mediaId
},
image
:
{
mediaid
:
res
.
mediaId
},
...
@@ -146,34 +162,19 @@ export default {
...
@@ -146,34 +162,19 @@ export default {
})
})
},
},
sendChatMessage
(
params
,
sendParams
)
{
sendChatMessage
(
params
,
sendParams
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
wxConfig
wxConfig
.
sendChatMessage
(
params
)
.
sendChatMessage
(
params
)
.
then
(
res
=>
{
.
then
(
res
=>
{
this
.
hideLoading
()
this
.
hideLoading
()
this
.
sendReadBuriedPoint
(
sendParams
)
this
.
sendReadBuriedPoint
(
sendParams
)
callback
()
resolve
()
})
}).
catch
(
err
=>
{
.
catch
(
err
=>
{
console
.
log
(
err
)
console
.
log
(
err
)
this
.
hideLoading
()
this
.
hideLoading
()
})
})
})
},
},
// sendChatMessage (params, sendParams) {
// wxConfig
// .sendChatMessage({
// msgtype: 'text',
// text: {content:123},
// enterChat: false
// })
// .then(res => {
// this.hideLoading()
// this.sendReadBuriedPoint(sendParams)
// })
// .catch(err => {
// console.log(err)
// this.hideLoading()
// })
// },
shareAppMessage
(
params
,
sendParams
)
{
shareAppMessage
(
params
,
sendParams
)
{
wxConfig
wxConfig
.
shareAppMessage
(
params
)
.
shareAppMessage
(
params
)
...
...
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