抖音小程序可以跳转到你后台小程序绑定的品牌号、员工号、合作号,添加完成后就可以使用。
有三个方式实现:
1、通过按钮<button open-type="privateMessage" />实现条跳转:
<button
open-type="privateMessage"
data-aweme-id="{{ awemeId }}"
bindpm="pmCallback"
binderror="pmError"
>
跳转私聊页
</button>
Page({
data: {
awemeId: "私聊对象的抖音号",
},
pmCallback(e) {
console.log("跳转私聊页成功", e.detail);
},
pmError(e) {
console.log("拉起私聊页失败", e.detail);
},
});
参考:https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/component/open-capacity/button-private-message2、通过<button open-type="openAwemeUserProfile" />按钮在小程序中跳转到抖音个人主页,然后通过私信来聊天。

<button
open-type="openAwemeUserProfile"
bindopenawemeuserprofile="eventHandler"
data-aweme-id="{{awemeId}}"
>
跳转抖音号个人页
</button>
Page({
data: {
awemeId: "需要跳转的抖音号",
},
eventHandler(e) {
if (e.detail.errNo) {
console.log("跳转抖音号个人页失败", e.detail);
} else {
console.log("跳转抖音号个人页成功");
}
},
});
参考:https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/component/open-capacity/button-open-aweme-user-profile
3、抖音im客服
<button
open-type="im"
data-im-id="{{ imId }}"
bindim="imCallback"
binderror="onimError"
>
跳转 IM
</button>
Page({
data: {
imId: "客服的抖音号",
},
imCallback(e) {
console.log("跳转IM客服成功", e.detail);
},
onimError(e) {
console.log("拉起IM客服失败", e.detail);
},
});参考:https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/component/open-capacity/button-im-customer-service
网友回复
如果让演唱会歌迷的上万手机屏幕和闪光灯一起被现场中控控制闪烁?
Midjourney为啥进军医疗领域了?
python如何跟踪足球比赛指定球员全场运动标注打聚光灯合成
如何将linux服务器的文件目录映射到windows电脑磁盘?
Docling 与 MarkItDown 两个库有啥不同?
豆包收费后国产其他ai软件也会跟进收费吗?
JPEG 与 HEIF图片格式区别?
centos7版本太旧无法安装python3.11,如何在docker中运行python3.11?
python如何做个RPA按键精灵的程序?
写一个windows的cmd的python代码如何在命令行中捕获获取复制粘贴的图片?


