两个回调都没有进入,除了之前加的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>