wx.requestSubscribeMessage

requestMsg() {
    return new Promise((resolve, reject) => {
      wx.requestSubscribeMessage({
        tmplIds: ["Va0CPAd-X8wdo8hBmQGWaBFcOVlu9t7jnhntWGw5gqE"],
        success: (res) => {
          if (res['Va0CPAd-X8wdo8hBmQGWaBFcOVlu9t7jnhntWGw5gqE'] === 'accept') {
            wx.showToast({
              title: '订阅OK!',
              duration: 1000,
              success(data) {
                //成功
                resolve()
              }
            })
          }
        },
        fail(err) {
          //失败
          console.error(err);
          reject()
        }
      })
    })
  }
原文地址:https://www.cnblogs.com/niyl/p/12145349.html