通讯录管理
1. 选择通讯录成员
前端: 陈小欢
企业微信JS-SDK原生写法
javascript
ww.selectEnterpriseContact({
fromDepartmentId: -1,
mode: 'multi',
type: ['department', 'user'],
selectedDepartmentIds: ['2', '3'],
selectedUserIds: ['lisi', 'lisi2']
})
鸿溟 SDK写法
typescript
//! 注意,TS版本4^
import type { SelectEnterpriseContactReq } from '@homing/web'
homingClient.wxqy.selectEnterpriseContact({
fromDepartmentId: -1,
mode: 'multi',
type: ['department', 'user'],
selectedDepartmentIds: ['2', '3'],
selectedUserIds: ['lisi', 'lisi2']
})
参数说明
参数名 | 类型 | 必填 | 说明 | 备注/枚举值 |
---|---|---|---|---|
fromDepartmentId | number | 是 | 起始部门ID | -1表示从根部门开始 |
mode | string | 是 | 选择模式 | 'multi'多选,'single'单选 |
type | string[] | 是 | 选择类型 | ['department', 'user'] |
selectedDepartmentIds | string[] | 否 | 已选择的部门ID列表 | |
selectedUserIds | string[] | 否 | 已选择的用户ID列表 |
2. 获取当前页面打开场景
前端: 陈小欢
调用该接口可以判断用户是从哪个入口打开页面,从而决定是否可以调用客户联系相关的接口。
typescript
//! 注意,TS版本4^
import type { GetContextReq } from '@homing/web'
homingClient.wxqy.getContext({
success: (res)=> {},
fail: (res)=> {},
cancel: (res)=> {},
complete: (res)=>{}
})
参数说明
参数名 | 类型 | 必填 | 说明 | 备注/枚举值 |
---|---|---|---|---|
success | Function | 否 | 成功回调 | |
fail | Function | 否 | 失败回调 | |
cancel | Function | 否 | 取消回调 | |
complete | Function | 否 | 完成回调 |