DESKTOP-SYIYI\Dell 7 년 전
부모
커밋
05e4b13a91

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
dist/index.html


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 0
dist/mshop/js/app.22fa56348ab037da05c0.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 0
dist/mshop/js/app.22fa56348ab037da05c0.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 2
dist/mshop/js/app.55cd34fb88c9cd259bc6.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 1
dist/mshop/js/app.55cd34fb88c9cd259bc6.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2 - 0
dist/mshop/js/manifest.1648c42e1cef25855557.js


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
dist/mshop/js/manifest.854683ec23c15732db25.js.map


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 2
dist/mshop/js/manifest.854683ec23c15732db25.js


+ 14 - 21
src/wechat/WechatShare.js

@@ -5,19 +5,17 @@ import Vue from 'vue'
 import {WechatPlugin} from 'vux'
 Vue.use(WechatPlugin);
 
-class WechatShare
-{
-    constructor(data,surl)
-    {
+class WechatShare {
+    constructor(data, surl) {
         let sign_url = encodeURIComponent(surl.split('#')[0]);
         let host = window.location.protocol + '//' + window.location.host;
-        let url = host+"/mobile/index.php?act=mshop&op=signurl&client_type=ajax&sign_url="+sign_url+"&callback=";
+        alert(sign_url);
+        let url = host + "/mobile/index.php?act=mshop&op=signurl&client_type=ajax&sign_url=" + sign_url + "&callback=";
 
         let pThis = this;
-        this.getJSONP(url, function (res)
-        {
-            if(res.code !== 200) {
-                alert(res.message);
+        this.getJSONP(url, function (res) {
+            if (res.code !== 200) {
+                // alert(res.message);
                 return;
             }
             let sign = res.datas;
@@ -25,9 +23,8 @@ class WechatShare
                 nonceStr = sign.noncestr,
                 signature = sign.signature,
                 appid = sign.appid;
-
             Vue.wechat.config({
-                debug: false,
+                debug: true,
                 appId: appid,
                 timestamp: timestamp,
                 nonceStr: nonceStr,
@@ -49,8 +46,7 @@ class WechatShare
         });
     }
 
-    getJSONP(url, callback)
-    {
+    getJSONP(url, callback) {
         let cn = "callback" + (+new Date()),
             s = document.createElement("script");
         s.type = "text/javascript";
@@ -59,8 +55,7 @@ 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 () {
@@ -81,10 +76,8 @@ class WechatShare
         }, 0);
     }
 
-    register(data)
-    {
-        Vue.wechat.ready(function ()
-        {
+    register(data) {
+        Vue.wechat.ready(function () {
             //分享朋友圈  / 2.2 监听“分享到朋友圈”按钮点击、自定义分享内容及分享结果接口
             Vue.wechat.onMenuShareTimeline({
                 title: data.title, // 分享标
@@ -118,8 +111,8 @@ class WechatShare
             });
         })
     }
-    unregister()
-    {
+
+    unregister() {
     }
 }