Browse Source

debug share

stanley-king 7 years ago
parent
commit
8940e86243

File diff suppressed because it is too large
+ 1 - 1
dist/index.html


File diff suppressed because it is too large
+ 0 - 2
dist/mshop/js/app.bf6e175550c0ad4cace3.js


File diff suppressed because it is too large
+ 0 - 1
dist/mshop/js/app.bf6e175550c0ad4cace3.js.map


File diff suppressed because it is too large
+ 2 - 0
dist/mshop/js/app.dbb5bf3ac207043608d8.js


File diff suppressed because it is too large
+ 1 - 0
dist/mshop/js/app.dbb5bf3ac207043608d8.js.map


File diff suppressed because it is too large
+ 2 - 2
dist/mshop/js/manifest.2c23c1dbb29384b8da2b.js


File diff suppressed because it is too large
+ 1 - 1
dist/mshop/js/manifest.2c23c1dbb29384b8da2b.js.map


+ 16 - 13
src/wechat/WechatShare.js

@@ -5,15 +5,16 @@ import Vue from 'vue'
 import {WechatPlugin} from 'vux'
 Vue.use(WechatPlugin);
 
-class WechatShare {
-
-    constructor(data) {
-
+class WechatShare
+{
+    constructor(data)
+    {
         let sign_url = window.location.href + "#";
         sign_url = encodeURIComponent(sign_url.substring(0, sign_url.indexOf('#')));
         let url = "http://p.lrlz.com/mobile/index.php?act=mshop&op=signurl&client_type=ajax&sign_url="+sign_url+"&callback=";
-        let _self = this;
-        this.getJSONP(url, function (res) {
+        let pThis = this;
+        this.getJSONP(url, function (res)
+        {
             let sign = res.datas;
             let timestamp = sign.timestamp,
                 nonceStr = sign.noncestr,
@@ -38,11 +39,12 @@ class WechatShare {
                     'chooseWXPay'
                 ]
             });
-            _self.ready(data);
+            pThis.ready(data);
         });
     }
 
-    getJSONP(url, callback) {
+    getJSONP(url, callback)
+    {
         let cn = "callback" + (+new Date()),
             s = document.createElement("script");
         s.type = "text/javascript";
@@ -51,7 +53,8 @@ class WechatShare {
         let heads = document.head || document.getElementsByTagName('head')[0];
         let sp = heads.appendChild(s);
 
-        setTimeout(function () { //利用计时器 变成异步
+        setTimeout(function ()
+        { //利用计时器 变成异步
             window[cn] = function (data) {
                 try {
                     s.onload = s.onreadystatechange = function () {
@@ -72,8 +75,10 @@ class WechatShare {
         }, 0);
     }
 
-    ready(data) {
-        Vue.wechat.ready(function () {
+    ready(data)
+    {
+        Vue.wechat.ready(function ()
+        {
             //分享朋友圈  / 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
             Vue.wechat.onMenuShareTimeline({
                 title: data.title, // 分享标
@@ -110,8 +115,6 @@ class WechatShare {
             });
         })
     }
-
 }
 
-
 export default WechatShare;