Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-assistant
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 ed837e63
authored
Oct 20, 2022
by
zhangxw
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
分享参数
1 parent
49a80735
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
29 deletions
packageActivity/pages/shareTaskDetail/shareTaskDetail.js
packageActivity/pages/taskDetail/taskDetail.js
utils/share.js
packageActivity/pages/shareTaskDetail/shareTaskDetail.js
View file @
ed837e6
...
...
@@ -20,29 +20,31 @@ Page({
},
onRoute
()
{
let
missionId
=
this
.
options
.
missionId
// 获取分享内容
ActivityApi
.
getTaskShareDetail
({
missionId
:
missionId
}).
then
(
res
=>
{
res
.
imgUrlList
=
[]
let
typeArr
=
[]
res
.
platformMerchantMissionMaterialResponseList
&&
res
.
platformMerchantMissionMaterialResponseList
.
forEach
(
val
=>
{
typeArr
.
push
(
val
.
materialType
)
if
(
val
.
materialType
==
1
)
{
// 文案
res
.
textContent
=
val
.
materialContent
}
if
(
val
.
materialType
==
2
||
val
.
materialType
==
3
)
{
// 图片视频
res
.
imgUrlList
.
push
({
url
:
val
.
materialContent
,
type
:
val
.
materialType
==
2
?
'image'
:
'video'
})
}
if
(
val
.
materialType
==
4
)
{
// 链接
res
.
linkUrl
=
val
.
materialContent
}
})
this
.
setData
({
detailInfo
:
res
,
materialTypeArr
:
typeArr
wx
.
nextTick
(()
=>
{
let
missionId
=
this
.
options
.
missionId
// 获取分享内容
ActivityApi
.
getTaskShareDetail
({
missionId
:
missionId
}).
then
(
res
=>
{
res
.
imgUrlList
=
[]
let
typeArr
=
[]
res
.
platformMerchantMissionMaterialResponseList
&&
res
.
platformMerchantMissionMaterialResponseList
.
forEach
(
val
=>
{
typeArr
.
push
(
val
.
materialType
)
if
(
val
.
materialType
==
1
)
{
// 文案
res
.
textContent
=
val
.
materialContent
}
if
(
val
.
materialType
==
2
||
val
.
materialType
==
3
)
{
// 图片视频
res
.
imgUrlList
.
push
({
url
:
val
.
materialContent
,
type
:
val
.
materialType
==
2
?
'image'
:
'video'
})
}
if
(
val
.
materialType
==
4
)
{
// 链接
res
.
linkUrl
=
val
.
materialContent
}
})
this
.
setData
({
detailInfo
:
res
,
materialTypeArr
:
typeArr
})
})
})
},
...
...
packageActivity/pages/taskDetail/taskDetail.js
View file @
ed837e6
...
...
@@ -16,6 +16,7 @@ Page({
shareTitle
:
''
,
shareImage
:
''
,
sharePath
:
''
,
noPageAuth
:
true
,
/**
* 生命周期函数--监听页面加载
*/
...
...
@@ -24,12 +25,14 @@ Page({
onRoute
(
options
)
{
const
userStorage
=
wx
.
$storage
.
get
(
'userInfo'
)
this
.
setData
({
userStorage
wx
.
nextTick
(()
=>
{
this
.
setData
({
userStorage
})
let
id
=
this
.
options
.
missionId
this
.
getActiveTaskDetail
(
id
)
this
.
sharePath
=
`packageActivity/pages/shareTaskDetail/shareTaskDetail?missionId=
${
id
}
`
})
let
id
=
this
.
options
.
missionId
this
.
getActiveTaskDetail
(
id
)
this
.
sharePath
=
`packageActivity/pages/shareTaskDetail/shareTaskDetail?missionId=
${
id
}
`
},
// 获取任务详情
...
...
utils/share.js
View file @
ed837e6
...
...
@@ -52,10 +52,11 @@ class Share {
if
(
sharePath
)
path
=
`/
${
sharePath
}
`
// path += that.setCommonShareQuery()
if
(
shareQuery
)
path
+=
`?
${
shareQuery
}
`
console
.
log
(
'::'
,
path
)
if
(
!
noPageAuth
)
path
=
`/login/loading/loading?url=
${
encodeURIComponent
(
path
)}
`
if
(
shareFun
)
shareFun
()
// if (shareTrackData) that.reportShareData(shareTrackData)
console
.
log
(
'::'
,
path
)
return
{
path
,
title
:
shareTitle
,
...
...
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