调用探马SDK的说明
背景:
企微方法:发送消息能力,打开会话能力,拉群能力
获取探马数据:获取销售信息,获取客户信息
window方法:打开一个window窗口,关闭窗口的能力(mac无法js触发关闭)
使用方法:
1.
开发联调地址:https://dev.tanmarket.cn/tanma-sdk-child/sdk-1.0.2.js
测试地址:https://dev.tanmarket.cn/tanma-sdk-child/sdk.js
生产地址:https://account.tanmarket.cn/webPlugin/tanma-sdk-sidebar/sdk.js
私有化生产地址:私有化探马后台的域名+/webPlugin/tanma-sdk-sidebar/sdk.js
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
// 引入js,会挂载在window对象上
<script src="https://account.tanmarket.cn/webPlugin/tanma-sdk-sidebar/sdk.js"></script>
<title>Document</title>
</head>
2.
<button onclick="sendChat()">发送内容</button>
function sendChat(){
const params = {};
$TanmaAPI.sendMsgToQWChat(params).then(res=>{
console.log('来自父页面的消息',res);
}).catch(err=>{
console.log('来自父页面的错误',err);
})
}
API参数与返回值(所有API的返回格式统一如下,res.data为有效信息)
{
type:eventMsg,//api方法名称
code:0,
data:res,//获取信息类,res是Object;
message:'success',
}
{
type:eventMsg, //api方法名称
code:-1,
data:null,
message:'可信域名或调用方法不存在',
}
修改于 2022-07-11 11:18:56