|
@@ -33,14 +33,17 @@ export function share (opt) {
|
33
|
33
|
const defaultLink = origin + pathname
|
34
|
34
|
const defaultImg = `${origin}${pathname}images/share.jpg`
|
35
|
35
|
|
36
|
|
- initSDK(opt.link)
|
|
36
|
+ const link = opt.link || defaultLink
|
|
37
|
+ const imgUrl = opt.imgUrl || defaultImg
|
|
38
|
+
|
|
39
|
+ initSDK(link)
|
37
|
40
|
window.wx.ready(function () {
|
38
|
41
|
jsApiList.map((apiName) => {
|
39
|
42
|
const api = window.wx[apiName]
|
40
|
43
|
api({
|
41
|
44
|
title: opt.title || '',
|
42
|
|
- link: opt.link || defaultLink,
|
43
|
|
- imgUrl: opt.imgUrl || defaultImg,
|
|
45
|
+ link,
|
|
46
|
+ imgUrl,
|
44
|
47
|
desc: opt.desc || ''
|
45
|
48
|
})
|
46
|
49
|
})
|