Browse Source

advertise

tusx 6 years ago
parent
commit
90a6be1a54
1 changed files with 16 additions and 2 deletions
  1. 16 2
      resources/views/wap/share.blade.php

+ 16 - 2
resources/views/wap/share.blade.php

@@ -98,8 +98,22 @@
 <script src="http://res2.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
 <script>
   console.log('222222')
-    var js_config = "{{json_encode($js_config)}}";
-    var config = "{{json_encode($share_config)}}";
+    var js_config = {
+        debug: {{$js_config['debug']}}, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
+        appId: {{$js_config['appId']}}, // 必填,公众号的唯一标识
+        timestamp: {{$js_config['timestamp']}}, // 必填,生成签名的时间戳
+        nonceStr: {{$js_config['nonceStr']}}, // 必填,生成签名的随机串
+        signature: {{$js_config['signature']}},// 必填,签名
+        jsApiList: {{json_encode($js_config['signature'])}} // 必填,需要使用的JS接口列表
+    };
+    var config = {
+      //json_encode($share_config)
+        title:{{$share_config['title']}},
+        desc: {{$share_config['desc']}}, // 分享描述
+        link: {{$share_config['link']}},// 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
+        imgUrl: {{$share_config['imgUrl']}}, // 分享图标
+
+    };
     wx.config(
         js_config
     );