美文网首页
微信开放标签

微信开放标签

作者: 李霖弢 | 来源:发表于2021-01-29 16:33 被阅读0次
    1. 微信开放标签使用步骤与微信JS-SDK类似,也需要绑定安全域名
    2. 引入JSSDK (http://res.wx.qq.com/open/js/jweixin-1.6.0.js)
    3. 通过config接口注入权限验证配置并在openTagList中申请所需开放标签
    wx.config({
      debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
      appId: '', // 必填,公众号的唯一标识
      timestamp: , // 必填,生成签名的时间戳
      nonceStr: '', // 必填,生成签名的随机串
      signature: '',// 必填,签名
      jsApiList: [], // 必填,需要使用的JS接口列表
      openTagList: [] // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
    });
    
    1. 可实现功能
    • <wx-open-launch-weapp> 微信web跳转到小程序按钮
    • <wx-open-launch-app> 微信web跳转到APP按钮
    • <wx-open-subscribe> 服务号订阅通知按钮
        <wx-open-launch-weapp id="launch-btn" username="gh_1edb0005f503" :path="prizePath"
          style="position:fixed;bottom:3vh;left:50%;width:45vh;max-width:80%;transform: translateX(-50%);">
    
          <script type="text/wxtag-template">
            <style>
              .btn {
                width:100%;
              }
            </style>
            <div style="position:relative;">
              <img class="btn" src="https://m.sensingstore.com/other/yayi/img/photo/button.png">
              <div style="position:absolute;color:#fff;left:0;top:45%;width:80%;font-size:6vw;transform:translateY(-50%);text-align:center">
                {{prizeTip}}
              </div>
            </div>
      
            </script>
        </wx-open-launch-weapp>
    

    相关文章

      网友评论

          本文标题:微信开放标签

          本文链接:https://www.haomeiwen.com/subject/bjaqtltx.html