微信开放标签

  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>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容