Home > front end > Vue WeChat share friends function call development projects
Vue WeChat share friends function call development projects
Time:11-27
I am now doing a WeChat sharing function, page is one of the vue, security domain has been configured, but still call you don't succeed, I want to ask, now call WeChat interfaces, must be in the public, or small program? Because I this is a simple page, the page now I first visit, wx. Config popup window is ok, click share calls to the error , the following is the calling code:
InitWXConfig () { Var vm=this; This $ajax request (" initWXConfig ", null, the function (res) { If (res) resultstate==200) { The debugger Vm. WxInitData=https://bbs.csdn.net/topics/res.result; Wx. Config ({ The debug: true,//open the debug mode, all the API calls return values will alert on the client, if you want to check the incoming parameters, can open the PC, parameter information through the log to type, only when the PC will print, AppId: res. Result. App_id,//required, the public, the unique identification of the Timestamp: res. Result. Timestamp,//required, the signature of timestamp NonceStr: res. Result. NonceStr,//required, the signature of a random string Signature: res. Result. Sign,//required, signed JsApiList: [" updateAppMessageShareData "]//required, need to use JS interface list }); Alert (" 111 "); The console. The log (" 111 "); Wx. Ready (function () {}) } }) },
Then click share button calls the function is the following:
OnShareCheck () { Var vm=this; The debugger //wx. Ready (function () { Wx. UpdateAppMessageShareData ({ Title: the vm. DcsInfo. Title, Desc: "your friends invite you to participate in community activities ~ ~ ~", Link: "http://zhyq.szns.gov.cn/MSWSS/LEAP/dist/index.html", ImgUrl: 'http://jojojojo.duapp.com/homepage/images/qr.png', Type: "' DataUrl: "' Success: the function () { The console. The log (" share success "); } }) //})
},
Is my writing is there a problem? Seek help from bosses