jsconfig.php 1.1 KB

12345678910111213141516
  1. <script>
  2. var apiList = new Array();
  3. apiList = ['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone','startRecord','stopRecord','onVoiceRecordEnd','playVoice','pauseVoice','stopVoice','onVoicePlayEnd','uploadVoice','downloadVoice','chooseImage','previewImage','uploadImage','downloadImage','translateVoice','getNetworkType','openLocation','getLocation','hideOptionMenu','showOptionMenu','hideMenuItems','showMenuItems','hideAllNonBaseMenuItem','showAllNonBaseMenuItem','closeWindow','scanQRCode','chooseWXPay','openProductSpecificView','addCard','chooseCard','openCard'];
  4. //配置
  5. wx.config({
  6. appId: '<?php echo $apiInfo['appid'];?>', // 必填,公众号的唯一标识
  7. timestamp:<?php echo $apiInfo['timestamp'];?>, // 必填,生成签名的时间戳
  8. nonceStr: '<?php echo $apiInfo['noncestr'];?>', // 必填,生成签名的随机串
  9. signature: '<?php echo $apiInfo['signature'];?>',// 必填,签名,见附录1
  10. jsApiList: apiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
  11. });
  12. //错误
  13. wx.error(function(res){
  14. //console.log(res);
  15. });
  16. </script>