收藏
回答

订阅号wx-open-subscribe?

公众号ID
wx5739621d0ad5d60f
<!doctype html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>订阅按钮</title>
</head>

<body>
  <wx-open-subscribe template="NUgc19OuB9jDTnAloWUR-jOtmmkW1Hor5KZT3tWGaQs" id="subscribe-btn">
    <script type="text/wxtag-template" slot="style">
        <style>
          .subscribe-btn {
            color: #fff;
            background-color: #07c160;
            font-size: 16px;
            padding: 10px 20px;
            border-radius: 5px;
          }
        </style>
      </script>
    <script type="text/wxtag-template">
        <button class="subscribe-btn">
          继续订阅
        </button>
      </script>
  </wx-open-subscribe>

  <script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript">
    wx.config({
      debug: true,
      appId: 'wx5739621d0ad5d60f',
      timestamp: '1781165916',
      nonceStr: 'cw6XZTHxahFmYglI9izE7VubLeo4jRAs',
      signature: '2a9ce89236f55e1e1004f850839c03e387718d14',
      jsApiList: ["checkJsApi"],
      openTagList: ["wx-open-subscribe"],
    });

    wx.ready(function () {
      var btn = document.getElementById("subscribe-btn");
      btn.addEventListener("success", function (e) {
        console.log("success", e.detail);
      });
      btn.addEventListener("error", function (e) {
        console.log("fail", e.detail);
      });
    });
  </script>
</body>

</html>



回答关注问题邀请回答
收藏

2 个回答

  • 社区技术运营专员--许涛
    社区技术运营专员--许涛
    06-16

    你好,开发者工具打印下config入参,appid等参数然后debug时提供下开发者工具打印参数截图

    06-16
    有用
    回复
  • 姜楠
    姜楠
    06-11
    {errMsg: "config:ok", jsApiList: Array(1), openTagList: Array(0)}
    

    信息中没有wx-open-subscribe标签

    06-11
    有用
    回复
登录 后发表内容
问题标签