发送DING消息JSAPI完整示例如下:
dd.biz.ding.create({
users: param.users,
corpId: store.getters.corpId,
type: 2,
alertType: 2,
attachment: {
title: param.attachment.title,//附件的标题
text : param.attachment.text,//附件显示时的消息体 【可选】
image : param.attachment.image, //附件显示时的图片 【可选】
url : `dingtalk://dingtalkclient/action/openapp?corpid=${store.getters.corpId}&container_type=work_platform&app_id=${store.getters.appInfo.appId}&redirect_type=jump&redirect_url=${encodeURIComponent(param.attachment.url)}`,//附件点击后跳转url
showInApp: true,// 跳转url在PC客户端上的打开方式,true:从PC容器内打开,false:跳转到浏览器打开 【可选】
},
text: param.text,
bizType: 0,
taskInfo: {},
confInfo: {},
onSuccess : (result) => {
sucCb && sucCb(result);
},
onFail : (err) => {
failCb && failCb(err);
}
});