Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mayi-mp-shop
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
程默
mayi-mp-shop
Commits
1ec343aa
Commit
1ec343aa
authored
May 12, 2021
by
张卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序原生支持多主题自定义分享图片和标题
parent
fd9dc36e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
src/pages/home/index.vue
+12
-2
No files found.
src/pages/home/index.vue
View file @
1ec343aa
...
...
@@ -304,7 +304,7 @@ export default {
this
.
pageInfo
=
pageList
.
filter
((
item
)
=>
item
.
pageCode
==
1
)[
0
];
this
.
pageData
=
JSON
.
parse
(
this
.
pageInfo
.
pageData
);
console
.
log
(
"36"
,
this
.
pageData
);
console
.
log
(
"36"
,
this
.
pageData
,
this
.
pageInfo
.
pageSettingData
);
console
.
log
(
app
.
globalData
.
shopInfo
,
'app'
)
wx
.
setNavigationBarTitle
({
title
:
app
.
globalData
.
shopInfo
.
shopName
})
...
...
@@ -471,6 +471,7 @@ export default {
let
newHref
=
'/pages/home/main'
;
let
title
=
app
.
globalData
.
shopInfo
.
shopName
;
let
hasInvitationStatus
=
0
;
if
(
wx
.
getStorageSync
(
"sessionid"
))
{
await
app
.
fenxiaoModel
.
getSpokesmanidByShare
().
then
(
data
=>
{
hasInvitationStatus
=
data
.
hasInvitationStatus
;
})
...
...
@@ -490,11 +491,20 @@ export default {
}
newHref
=
concatUrl
(
newHref
,
newData
)
})
}
let
imageUrl
=
''
;
//多主题自定义分享标题和图片
if
(
this
.
pageInfo
.
pageSettingData
&&
JSON
.
parse
(
this
.
pageInfo
.
pageSettingData
).
shareTitle
)
{
title
=
JSON
.
parse
(
this
.
pageInfo
.
pageSettingData
).
shareTitle
}
if
(
this
.
pageInfo
.
pageSettingData
&&
JSON
.
parse
(
this
.
pageInfo
.
pageSettingData
).
shareImg
)
{
imageUrl
=
JSON
.
parse
(
this
.
pageInfo
.
pageSettingData
).
shareImg
}
console
.
log
(
newHref
,
3333555666
,
title
,
res
)
return
{
title
:
title
,
// 默认是小程序的名称
path
:
newHref
,
// 默认是当前页面
// imageUrl: this.shareLogo
Url,
imageUrl
:
image
Url
,
success
:
function
(
res
)
{
// 转发成功之后的回调
if
(
res
.
errMsg
==
"shareAppMessage:ok"
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment