|
@@ -35,10 +35,11 @@ function initSDK (url) {
|
35
|
35
|
export function share (opt = {}) {
|
36
|
36
|
const { origin, pathname } = window.location
|
37
|
37
|
// const defaultLink = origin + pathname
|
38
|
|
- const defaultImg = `${origin}${pathname}img/share.jpg`
|
|
38
|
+ const url=origin+pathname
|
|
39
|
+ const defaultImg = `${url}img/share.jpg`
|
39
|
40
|
|
40
|
41
|
const link = origin + pathname // window.location.href
|
41
|
|
- const imgUrl = opt.imgUrl || defaultImg
|
|
42
|
+ const imgUrl = defaultImg
|
42
|
43
|
|
43
|
44
|
initSDK(link)
|
44
|
45
|
|
|
@@ -47,10 +48,10 @@ export function share (opt = {}) {
|
47
|
48
|
const fn = window.wx[apiName]
|
48
|
49
|
if (typeof fn === 'function') {
|
49
|
50
|
fn({
|
50
|
|
- title: opt.title || '为岸线圆梦,摩天轮圆满大作战!', // 分享标题
|
|
51
|
+ title:'为岸线圆梦,摩天轮圆满大作战!', // 分享标题
|
51
|
52
|
link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
|
52
|
53
|
imgUrl, // 分享图标
|
53
|
|
- desc: opt.desc || '快来助力华侨城欢乐滨江摩天轮挂轿厢'
|
|
54
|
+ desc: '快来助力华侨城欢乐滨江摩天轮挂轿厢'
|
54
|
55
|
})
|
55
|
56
|
}
|
56
|
57
|
})
|