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

CodePudding user response:

https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#5

Your interface implementation in your ready

CodePudding user response:

reference 1st floor also night reply:

https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#5
Your interface implementation in your ready?

No, click share called after a method, on the other call WeChat interface in this method, the page config initialization time

CodePudding user response:

refer to the second floor fat to no friend's reply:
Quote: refer to 1st floor also night reply:

https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#5
Your interface implementation in your ready?

Is not, click share called after a method, this method call in another WeChat interface, initialize the page config when


I mean what do you want to implement this interface in the ready, and there will be some problems on the new interface in the android, don't know if now have the repair

CodePudding user response:

reference 3 floor also night reply:
Quote: refer to the second floor for no friend replies:
Quote: refer to 1st floor also night reply:

https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#5
Your interface implementation in your ready?

Is not, click share called after a method, this method call in another WeChat interface, initialize the page config when


I mean what do you want to implement this interface in the ready, and there will be some problems on the new interface in the android, don't know if now have to repair

Yes, yes, can I change an API, should be implemented in ready
  • Related