taro小程序接入im客服按钮,点击无反应。后台已开通im客服功能
88 浏览2026年07月01日作者:Haonan-Technology
两个回调都没有进入,除了之前加的handleClick点击回调有输出,im功能貌似没有生效。

 const DOUYIN_CUSTOMER_SERVICE_IM_ID = "48925500497";

  const handleIm = (event) => {
    console.info("[customer-service] open douyin im success", event?.detail);
  };

  const handleError = (event) => {
    const detail = event?.detail || {};
    console.warn("[customer-service] open douyin im failed", detail);
    Taro.showToast({
      title: detail?.errMsg || detail?.errorMessage || "打开客服失败",
      icon: "none",
    });
  };

 <button
        className={className}
        open-type="im"
        data-im-id={DOUYIN_CUSTOMER_SERVICE_IM_ID}
        // bindtap={handleClick}
        bindim={handleIm}
        binderror={handleError}
        // hover-class="none"
      >
        联系客服
      </button>
最后一次编辑于 2026 年 07 月 01 日
共 3 条评论

相关问答

专题推荐

热门文章

热门问答