var tmpl=`
    <div></div>
`
module.exports=
`{
   template:'${tmpl}',
   props:['authurl'],
   data:function(){
     return {
        authurl2:this.authurl?this.authurl:"http://boss.gongsibao.com",
     };
   },
   mounted:function(){
      this.$nextTick(()=>{
        this.initWxJsApi();
      });
   },
   methods:{
     initWxJsApi(){
        this.$root.postReq("/web/wxCtl/getJsApiConfig",{url:this.authurl2}).then(function(d){
           if(d && d.status==0){
             console.log(d.data);
             var config={};
             config.debug=false;
             config.appId=d.data.appid;
             config.timestamp=d.data.timestamp;
             config.nonceStr=d.data.nonceStr;
             config.signature=d.data.signature;
             config.jsApiList=['checkJsApi','uploadImage','chooseImage','onMenuShareAppMessage','startRecord','stopRecord','onVoiceRecordEnd','playVoice','pauseVoice'
                               ,'stopVoice'
                               ,'onVoicePlayEnd'
                               ,'uploadVoice','chooseWXPay'
                               ,'downloadVoice','hideMenuItems'];
             wx.config(config);
             wx.ready(function(){
                console.log("微信jsapi已经就续.........");
             });
             wx.error(function(e){
                alert(JSON.stringify(e));
             });

           }
        });
     },
   },
   vname:"gsb-jsapi"
}`
