抖音小程序可以跳转到你后台小程序绑定的品牌号、员工号、合作号,添加完成后就可以使用。
有三个方式实现:
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
网友回复
chrome网页突然报错:错误代码:RESULT_CODE_KILLED_BAD_MESSAGE
openai的codex如何全程无需手动确认自动修改文件?
阿里云oss前端上传文件直传如何限制文件类型?
阿里云oss前端获取policy签名直传oss上传文件回调如何传?
如何将根据三维物体通过提示词变成可交互的4d场景动画?
浏览器中实时摄像头离线视觉ai模型有吗?
如何让ai基于Chromium内核开发自己的windows浏览器?
如何将自己从小生活的农村村庄做成3d可漫游的高斯泼溅?
同一个iframe多次write包含three的html为啥报错不显示Failed to execute 'write' on 'Document': Identifier 'scene' has a
软件工程师的工作内容将由敲代码转变成使用ai来解决现实世界的问题?


