李志伟 3 年之前
父節點
當前提交
e6f0e6bfa7
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5
    4
      src/utils/initial.js

+ 5
- 4
src/utils/initial.js 查看文件

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