전단 설정 위 챗 JSSDK 권한 부여 h5 페이지 공유!

1438 단어 대웅 아.
var _this=this; //중점 var url = location. href. split ('\ #') [0] / / 중점
//      
this.$axios
  .post("http://web-nfish.cn/wechat/info", {"url":url'})
  .then(function(response) {
    wx.config({
        debug: false, 
        appId: response.data.data.appId, 
        timestamp: response.data.data.timestamp,
        nonceStr: response.data.data.nonceStr,
        signature:response.data.data.signature,
        jsApiList: [response.data.data.jsApiList[0],response.data.data.jsApiList[1],response.data.data.jsApiList[2],response.data.data.jsApiList[3],response.data.data.jsApiList[4]]
    });
    wx.ready(function() {
      
      wx.onMenuShareAppMessage({
        title: '!',
        desc: ',!',
        link: url,
        imgUrl: 'http://web-nfish.cn/message/message.png',
        trigger: function(res) {
        },
        success: function(res) {
        },
        cancel: function(res) {
        },
        fail: function(res) {
        }
      });
      
      wx.onMenuShareTimeline({
        title:'!',
        desc: '   !',
        link: url,
        imgUrl: 'http://web-nfish.cn/message/message.png',
        trigger: function(res) {
        },
        success: function(res) {
        },
        cancel: function(res) {
        },
        fail: function(res) {
        }
      });
    });
  })
  .catch(function(error) {});

좋은 웹페이지 즐겨찾기