优化wxSDK方法;
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,4 +3,5 @@ node_modules
|
||||
_notes/
|
||||
src/_notes
|
||||
.vscode/
|
||||
dist
|
||||
dist
|
||||
*.min.js
|
@@ -2961,12 +2961,12 @@
|
||||
|
||||
const timeLine = {
|
||||
title: isObj(title) ? title[0] : title,
|
||||
link: isObj(shareLinks) ? shareLinks[0] : shareLinks,
|
||||
link: isObj(shareLinks) ? shareLinks[0] : w.location.href.split(`#`)[0],
|
||||
imgUrl: isObj(shareIcon) ? shareIcon[0] : shareIcon,
|
||||
},
|
||||
friend = {
|
||||
title: isObj(title) ? title[1] : title,
|
||||
link: isObj(shareLinks) ? shareLinks[1] : shareLinks,
|
||||
link: isObj(shareLinks) ? shareLinks[1] : w.location.href.split(`#`)[0],
|
||||
imgUrl: isObj(shareIcon) ? shareIcon[1] : shareIcon,
|
||||
desc,
|
||||
}
|
||||
@@ -2978,13 +2978,11 @@
|
||||
new Promise(next => {
|
||||
if (wx.updateTimelineShareData) {
|
||||
const { title, link, imgUrl } = timeLine
|
||||
console.log('timeLine', timeLine)
|
||||
const { success, error } = callback
|
||||
wx.updateTimelineShareData({ title, link, imgUrl, success, error })
|
||||
}
|
||||
if (wx.updateAppMessageShareData) {
|
||||
const { title, link, imgUrl, desc } = friend
|
||||
console.log('friend', friend)
|
||||
const { success, error } = callback
|
||||
wx.updateAppMessageShareData({ title, desc, link, imgUrl, success, error })
|
||||
}
|
||||
@@ -2998,7 +2996,7 @@
|
||||
}
|
||||
|
||||
scriptTag.onload = () => {
|
||||
this.ajax({ url: `${apiUrl}${encodeURIComponent(w.location.href.split(`#`)[0])}` }).then(success)
|
||||
this.ajax({ url: `${apiUrl}${w.location.href.split(`#`)[0]}` }).then(success)
|
||||
}
|
||||
|
||||
return this
|
||||
|
59
Pandora.min.js
vendored
59
Pandora.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user