Showing
1 changed file
with
14 additions
and
14 deletions
@@ -20,7 +20,7 @@ function loadScript(url, success) { | @@ -20,7 +20,7 @@ function loadScript(url, success) { | ||
20 | 20 | ||
21 | script.type = 'text/javascript'; | 21 | script.type = 'text/javascript'; |
22 | script.onload = script.onreadystatechange = function() { | 22 | script.onload = script.onreadystatechange = function() { |
23 | - if (!this.readyState || this.readyState === "loaded" || this.readyState === "complete" ) { | 23 | + if (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete' ) { |
24 | success && success(); | 24 | success && success(); |
25 | script.onload = script.onreadystatechange = null; | 25 | script.onload = script.onreadystatechange = null; |
26 | } | 26 | } |
@@ -31,7 +31,7 @@ function loadScript(url, success) { | @@ -31,7 +31,7 @@ function loadScript(url, success) { | ||
31 | 31 | ||
32 | function jsonp(url, data = {}) { | 32 | function jsonp(url, data = {}) { |
33 | return new Promise((resolve, reject) => { | 33 | return new Promise((resolve, reject) => { |
34 | - let JSONP = document.createElement("script"); | 34 | + let JSONP = document.createElement('script'); |
35 | let query = []; | 35 | let query = []; |
36 | 36 | ||
37 | data.callback = 'jsonCallBack'; | 37 | data.callback = 'jsonCallBack'; |
@@ -43,9 +43,9 @@ function jsonp(url, data = {}) { | @@ -43,9 +43,9 @@ function jsonp(url, data = {}) { | ||
43 | resolve(result); | 43 | resolve(result); |
44 | }; | 44 | }; |
45 | 45 | ||
46 | - JSONP.type = "text/javascript"; | 46 | + JSONP.type = 'text/javascript'; |
47 | JSONP.src = `${url}?${query.join('&')}`; | 47 | JSONP.src = `${url}?${query.join('&')}`; |
48 | - const head = document.getElementsByTagName("head")[0]; | 48 | + const head = document.getElementsByTagName('head')[0]; |
49 | head.appendChild(JSONP); | 49 | head.appendChild(JSONP); |
50 | 50 | ||
51 | setTimeout(() => { | 51 | setTimeout(() => { |
@@ -58,10 +58,10 @@ function init(qs) { | @@ -58,10 +58,10 @@ function init(qs) { | ||
58 | if (/QQ/i.test(navigator.userAgent)) { | 58 | if (/QQ/i.test(navigator.userAgent)) { |
59 | loadScript('//qzonestyle.gtimg.cn/qzone/qzact/common/share/share.js', function() { | 59 | loadScript('//qzonestyle.gtimg.cn/qzone/qzact/common/share/share.js', function() { |
60 | window.setShareInfo && window.setShareInfo({ | 60 | window.setShareInfo && window.setShareInfo({ |
61 | - title: shareData.title, | ||
62 | - summary: shareData.desc, | ||
63 | - pic: shareData.imgUrl, | ||
64 | - url: shareData.link | 61 | + title: shareData.title, |
62 | + summary: shareData.desc, | ||
63 | + pic: shareData.imgUrl, | ||
64 | + url: shareData.link || location.href | ||
65 | }); | 65 | }); |
66 | }); | 66 | }); |
67 | } | 67 | } |
@@ -73,12 +73,12 @@ function init(qs) { | @@ -73,12 +73,12 @@ function init(qs) { | ||
73 | }).then(res => { | 73 | }).then(res => { |
74 | if (window.wx) { | 74 | if (window.wx) { |
75 | window.wx.config({ | 75 | window.wx.config({ |
76 | - debug: false, | ||
77 | - appId: res.appId, | ||
78 | - timestamp: res.timestamp, | ||
79 | - nonceStr: res.nonceStr, | ||
80 | - signature: res.signature, | ||
81 | - jsApiList: jsApiList | 76 | + debug: false, |
77 | + appId: res.appId, | ||
78 | + timestamp: res.timestamp, | ||
79 | + nonceStr: res.nonceStr, | ||
80 | + signature: res.signature, | ||
81 | + jsApiList: jsApiList | ||
82 | }); | 82 | }); |
83 | } | 83 | } |
84 | }) | 84 | }) |
-
Please register or login to post a comment