用vue开发的微信小应用如何添加微信的分享功能,另外我自己摸索出来的一直报config;fail

2016/12 01 09:12
此文章不得转载,如有需要请联系网站管理员。

一度的温暖,一百度的爱情,来自于www.bwin2299.com的点点滴滴

技艺:vue1x,vuex1x

已处理,前台这么写没有题目。

图片描绘

<template>
  <h3 style="display:none"></h3>
</template>
<script type="text/javascript">
  import store from ./../../vuex/store
  import {getShare,getHotelId}  from ./../../vuex/getter
  import wx from weixin-js-sdk
export default {
  data  {
    return {
    }
  },
  store,
  ready{
    this.wxinitthis.getShare
  },

  methods:{
       wxinitshareobj {
      wx.config{
        debug: true,
        appId: shareobj.appId,
        timestamp: shareobj.timestamp,
        nonceStr: shareobj.nonceStr,
        signature: shareobj.signature,
        jsApiList: [
          onMenuShareTimeline, //
          onMenuShareAppMessage, //
          onMenuShareQQ,
          onMenuShareWeibo,
          onMenuShareQZone
        ]
      };
      wx.readyfunction {
        var shareObj = { // 
          title: shareobj.share_title,
          desc: shareobj.share_content,
          link: shareobj.url,
          imgUrl: shareobj.share_img,
        };

        wx.onMenuShareTimeline{
          title: shareObj.title, // 
            desc: shareObj.desc, // 描绘
          link: shareObj.link, // 
          imgUrl: shareObj.imgUrl, // 
          success: functionres {},
          cancel: functionres {}
        };
      //分享到挚友
        wx.onMenuShareAppMessage{
            title: shareObj.title, // 标题
            desc: shareObj.desc, // 描绘
            link: shareObj.link, // 链接
            imgUrl: shareObj.imgUrl, // 图片
            success: functionres {},
            cancel: functionres {},
        };        //
        wx.onMenuShareQQ{
          title: shareObj.title,
          desc: shareObj.desc,
          link: shareObj.link,
          imgUrl: shareObj.imgUrl,
          success: functionres {},
          cancel: functionres {}
        };

        //
        wx.onMenuShareWeibo{
          title: shareObj.title,
          desc: shareObj.desc,
          link: shareObj.link,
          imgUrl: shareObj.imgUrl,
          success: functionres {},
          cancel: functionres {}
        };

        //
        wx.onMenuShareQZone{
          title: shareObj.title,
          desc: shareObj.desc,
          link: shareObj.link,
          imgUrl: shareObj.imgUrl,
          success: functionres {},
          cancel: functionres {}
        };
      };
      wx.errorfunctionres {
        // 
        console.logres
      };
    }
  },
  vuex:{
    getters:{getShare},
  }
}
</script>

config fail这个便是配置的错误,先反省一下配置能否设置精确 timestamp nonceStr signature

(看完/读完)这篇文章有何感想! 来看看www.bwin2299.com是怎么评论的吧!

--转载请注明: bwin2299必赢亚洲_www.bwin2299.com_bwin2299必赢亚洲世界顶级公司 » 用vue开发的微信小应用如何添加微信的分享功能,另外我自己摸索出来的一直报config;fail

发表评论

(必填)