1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- const wx = require("weixin-js-sdk");
- const wxShare = {
-
- wxRegister(data, option, successCb) {
-
- wx.config({
- debug: false,
- appId: data.appId,
- timestamp: data.timestamp,
- nonceStr: data.nonceStr,
- signature: data.signature,
- jsApiList: [
- "updateAppMessageShareData",
- "updateTimelineShareData",
- "onMenuShareAppMessage",
- "onMenuShareTimeline",
- ],
- openTagList: ["wx-open-launch-weapp"],
- });
-
- wx.ready(function () {
- wx.updateAppMessageShareData({
- title: option.title,
- desc: option.desc,
- link: option.link,
- imgUrl: option.imgUrl,
- success() {
- successCb && typeof successCb == "function" && successCb();
- },
- cancel() {
-
-
- console.log("cancel");
- },
- });
- });
- wx.error(function (res) {
-
-
- });
- },
- };
- export default wxShare;
|