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({
...
@@ -20,29 +20,31 @@ Page({
},
},
onRoute
()
{
onRoute
()
{
let
missionId
=
this
.
options
.
missionId
wx
.
nextTick
(()
=>
{
// 获取分享内容
let
missionId
=
this
.
options
.
missionId
ActivityApi
.
getTaskShareDetail
({
missionId
:
missionId
}).
then
(
res
=>
{
// 获取分享内容
res
.
imgUrlList
=
[]
ActivityApi
.
getTaskShareDetail
({
missionId
:
missionId
}).
then
(
res
=>
{
let
typeArr
=
[]
res
.
imgUrlList
=
[]
res
.
platformMerchantMissionMaterialResponseList
&&
res
.
platformMerchantMissionMaterialResponseList
.
forEach
(
val
=>
{
let
typeArr
=
[]
typeArr
.
push
(
val
.
materialType
)
res
.
platformMerchantMissionMaterialResponseList
&&
res
.
platformMerchantMissionMaterialResponseList
.
forEach
(
val
=>
{
if
(
val
.
materialType
==
1
)
{
// 文案
typeArr
.
push
(
val
.
materialType
)
res
.
textContent
=
val
.
materialContent
if
(
val
.
materialType
==
1
)
{
// 文案
}
res
.
textContent
=
val
.
materialContent
if
(
val
.
materialType
==
2
||
val
.
materialType
==
3
)
{
// 图片视频
}
res
.
imgUrlList
.
push
({
if
(
val
.
materialType
==
2
||
val
.
materialType
==
3
)
{
// 图片视频
url
:
val
.
materialContent
,
res
.
imgUrlList
.
push
({
type
:
val
.
materialType
==
2
?
'image'
:
'video'
url
:
val
.
materialContent
,
})
type
:
val
.
materialType
==
2
?
'image'
:
'video'
}
})
if
(
val
.
materialType
==
4
)
{
// 链接
}
res
.
linkUrl
=
val
.
materialContent
if
(
val
.
materialType
==
4
)
{
// 链接
}
res
.
linkUrl
=
val
.
materialContent
})
}
this
.
setData
({
})
detailInfo
:
res
,
this
.
setData
({
materialTypeArr
:
typeArr
detailInfo
:
res
,
materialTypeArr
:
typeArr
})
})
})
})
})
},
},
...
...
packageActivity/pages/taskDetail/taskDetail.js
View file @
ed837e6
...
@@ -16,6 +16,7 @@ Page({
...
@@ -16,6 +16,7 @@ Page({
shareTitle
:
''
,
shareTitle
:
''
,
shareImage
:
''
,
shareImage
:
''
,
sharePath
:
''
,
sharePath
:
''
,
noPageAuth
:
true
,
/**
/**
* 生命周期函数--监听页面加载
* 生命周期函数--监听页面加载
*/
*/
...
@@ -24,12 +25,14 @@ Page({
...
@@ -24,12 +25,14 @@ Page({
onRoute
(
options
)
{
onRoute
(
options
)
{
const
userStorage
=
wx
.
$storage
.
get
(
'userInfo'
)
const
userStorage
=
wx
.
$storage
.
get
(
'userInfo'
)
this
.
setData
({
wx
.
nextTick
(()
=>
{
userStorage
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 {
...
@@ -52,10 +52,11 @@ class Share {
if
(
sharePath
)
path
=
`/
${
sharePath
}
`
if
(
sharePath
)
path
=
`/
${
sharePath
}
`
// path += that.setCommonShareQuery()
// path += that.setCommonShareQuery()
if
(
shareQuery
)
path
+=
`?
${
shareQuery
}
`
if
(
shareQuery
)
path
+=
`?
${
shareQuery
}
`
console
.
log
(
'::'
,
path
)
if
(
!
noPageAuth
)
path
=
`/login/loading/loading?url=
${
encodeURIComponent
(
path
)}
`
if
(
!
noPageAuth
)
path
=
`/login/loading/loading?url=
${
encodeURIComponent
(
path
)}
`
if
(
shareFun
)
shareFun
()
if
(
shareFun
)
shareFun
()
// if (shareTrackData) that.reportShareData(shareTrackData)
// if (shareTrackData) that.reportShareData(shareTrackData)
console
.
log
(
'::'
,
path
)
return
{
return
{
path
,
path
,
title
:
shareTitle
,
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