Link平台功能接口,使用该模块必须先引入Cordova.js 和 bingotouch.js
包含用户信息获取、通讯录、聊天、签到、应用、服务号等操作接口
Methods
-
static addServiceAcccount()
-
打开添加服务号页面
Example
app.link.addServiceAcccount(); -
static browseMultiMedia(params)
-
浏览多媒体资源,包括图片、视频(android)
Parameters:
Name Type Description paramsobject 参数
Properties
Name Type Description dataarray 媒体数据对象数组,数据对象{url:"",thumbUrl:"",fileSize:100,fileType:1} fileType: 1图片2视频
positioninteger 初始化位置,默认是0
isVideoMuteOnFirstPlaybool 是否静音播放点击进来的视频,默认 false
isOptionEnablebool 是否允许进行保存网盘,分享聊天等操作,默认 true
-
static captureVideo(successCallback, failCallback, params)
-
录屏方法,具有倒计时能力(4.5.6)
Parameters:
Name Type Description successCallbackfunction 成功回调函数 返回文件信息 fullPath:文件保存路径 name:文件名称 size: 文件大小
failCallbackfunction 失败回调函数
paramsobject 传参参数
Properties
Name Type Description durationnumber 录制时长
-
static checkVersion(successCallback, failCallback)
-
检测link是否有新版本(安卓端 4.5.5)
Parameters:
Name Type Description successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
-
static chooseFile(callback)
-
选择文件
Parameters:
Name Type Description callbackfunction 回调函数,返回文件物理地址字符串
Example
app.link.chooseFile(function(result){ app.alert(result); }); -
static compressedVideo(successCallback, failCallback, params)
-
视频压缩能力(安卓4.5.6)
Parameters:
Name Type Description successCallbackfunction 成功回调函数 返回文件信息 fullPath:文件保存路径 name:文件名称 size: 文件大小
failCallbackfunction 失败回调函数
paramsObject 参数对象
Properties
Name Type Description inputFilestring 设备上视频的路径
outputFilestring 输出文件路径
-
static compressImage(quality, pathArr, success, fail)
-
压缩图片
Parameters:
Name Type Description qualitynumber 图片压缩后的质量1~100,100为不压缩
pathArrarray 图片路径,里面每个元素都是对象 {path:"...",width:200,height:300}
successfunction 成功回调函数
failfunction 失败回调函数
-
static createGroup(successCallback, failCallback, userIds)
-
创建群组
Parameters:
Name Type Description successCallbackfunction 成功回调函数,返回json对象
failCallbackfunction 失败回调函数,返回错误字符串
userIdsArray 默认添加的用户id
Example
app.link.createGroup( function(result){ app.alert(result); //todo }, function(error){ //app.alert(error); }, [] //默认选择的用户id ); -
static deleteFile(successCallback, failCallback, path)
-
删除指定文件
Parameters:
Name Type Description successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数,返回错误字符串
pathstring 文件路径
-
static execSyncService(type)
-
执行Link同步服务
Parameters:
Name Type Description typeint 同步类型。 0:用户信息同步,1:群组信息同步,2:部门信息同步,3:服务号信息同步,4:好友企业同步,5:应用同步
-
static getAllServices(callback)
-
获取全部收藏数据
Parameters:
Name Type Description callbackfunction 回调函数,返回json对象
-
static getChildListByOrgId(callback, orgId)
-
根据部门orgId获取用户信息以及子部门信息
Parameters:
Name Type Description callbackfunction 回调函数,返回某部门下的用户以及子部门
orgIdString 部门orgId
-
static getDeptInfoByOrgId(callback, orgId)
-
根据部门orgId获取该部门的信息
Parameters:
Name Type Description callbackfunction 回调函数,返回部门信息
orgIdString 部门orgId
-
static getFavoriteService(callback)
-
获取本地收藏的服务数据
Parameters:
Name Type Description callbackfunction 回调函数,返回json对象
-
static getFileMetadata(successCallback, failCallback, path)
-
根据文件路径获取文件信息
Parameters:
Name Type Description successCallbackfunction 成功回调函数 [{"size":100000,"fullPath":"/storage/emulated/0/xxxx", type: "image/jpeg", "name": "XXX", "lastModifiedDate": "更新时间"}]
failCallbackfunction 失败回调函数
pathstring 文件路径
-
static getFlieSize(successCallback, failCallback, path)
-
获取指定文件大小
Parameters:
Name Type Description successCallbackfunction 成功回调函数,返回文件大小
failCallbackfunction 失败回调函数,返回错误字符串
pathstring 文件路径
-
static getHPicture(sourceId, successCallback, failCallback)
-
根据单个sourceId获取头像
Parameters:
Name Type Description sourceIdstring sourceId
successCallbackfunction 成功回调函数,返回图片地址
failCallbackfunction 失败回调函数,返回错误字符串
-
static getHPictures(className)
-
根据sourceId批量获取头像并设置到dom元素方法
Parameters:
Name Type Description classNamestring dom元素类名
-
static getLanguage(callback)
-
获取语言
Parameters:
Name Type Description callbackfunction 回调函数,返回 en, zh-cn
-
static getLoginInfo(callback)
-
获取登陆后的用户信息
Parameters:
Name Type Description callbackfunction 回调函数,返回登录用户信息
Example
app.link.getLoginInfo(function(result){ app.alert(result); }); -
static getSdcardAppDir(successCallback, failCallback)
-
获取app安装信息
Parameters:
Name Type Description successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
-
static getServerConfigs(success, fail)
-
获取配置的服务器地址
Parameters:
Name Type Description successfunction 成功回调函数,返回json对象,所有的配置地址
failfunction 失败回调函数,返回失败错误信息
-
static getTextSizeSetting(successCallback, failCallback)
-
获取终端设置的字体大小 小、中、大的值分别对应的是13,16,20(安卓端 4.5.5)
Parameters:
Name Type Description successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
-
static getThemeColor(successCallback)
-
获取当前Link的主题颜色值
Parameters:
Name Type Description successCallbackfunction 成功回调,返回颜色值
Example
app.link.getThemeColor(function(res){ app.alert(res); }); -
static getToken(callback)
-
获取登录用户的AccessToken
Parameters:
Name Type Description callbackfunction 回调函数,返回json对象[{'accessToken': 'xxx'}]
Example
app.link.getToken(function (result) { app.alert(result); }); -
static getUnreadMessageCount(success, fail)
-
获取未读消息总数
Parameters:
Name Type Description successfunction 成功回调,返回数字
failfunction 失败回调,返回失败信息
Example
app.link.getUnreadMessageCount(function(result){ app.alert(result); },function(error){ app.alert(error); }); -
static getUnreadMessageCountById(success, talkWithId)
-
获取指定帐号id的未读消息数
Parameters:
Name Type Description successfunction 成功回调函数,返回未读消息数
talkWithIdString 这里的帐号包括:用户的id,服务号的id,部门的id,群组的id
Example
app.link.getUnreadMessageCountById(function(result){ alert(result); }, 'ebdfe3b1-ed9c-425b-aac3-aa6c61d05d0e'); -
static getUserIdWithLoginId(success, fail, loginId)
-
根据loginId获取userId
Parameters:
Name Type Description successfunction 成功回调,返回userId
failfunction 失败回调函数,返回错误字符串
loginIdString 用户loginId
Example
app.link.getUserIdWithLoginId(function(res){ app.alert(res); },function(error){ app.alert(error); }, 'yulsh'); -
static getUserInfo(success, fail, userId)
-
获取Link指定的用户(userId)信息
Parameters:
Name Type Description successfunction 成功回调函数,返回json对象
failfunction 失败回调函数,返回错误字符串
userIdstring 指定用户userId
Example
app.link.getUserInfo(function(result){ app.alert(result); }, function(error){ app.alert(error); }, 'ebdfe3b1-ed9c-425b-aac3-aa6c61d05d0e' ); -
static getUserInfoByCellphoneOrEmail(key, callback)
-
根据手机或者邮箱获取用户信息
Parameters:
Name Type Description keystring 手机号码或者邮箱
callbackfunction 回调函数,返回用户信息
Example
app.link.getUserInfoByCellphoneOrEmail("1380013800",function(result){ app.alert(result); }) -
static getVersionInfo(successCallback, failCallback)
-
获取link版本(安卓 4.5.5)
Parameters:
Name Type Description successCallbackfunction 成功回调函数,返回版本信息
failCallbackfunction 失败回调函数
-
static imagePicker(success, fail)
-
发起选择图片
Parameters:
Name Type Description params.oldFileListarray 已选择的图片路径 ,只需要 resourceLocal对应的路径即可
params.maxSelectCountnumber 允许选择图片最大数量
successfunction [成功回调] [{"resourceSize":100kb,"resourceLocal":"/storage/emulated/0/xxxx", "fullSize": 100000, resourceType: 0}]
failfunction [失败回调]
-
static initYXTLiveSdk(environment, accessType, enableLog, successCallback, failCallback)
-
云学堂直播-SDK初始化
Parameters:
Name Type Description environmentstring 运行环境,值有Develop、Ucstable、Production、Feature
accessTypestring 接入模式,值有Inner、ForeignMiniCourse、ForeignLive。(该参数iOS无效)
enableLogboolean 日志是否打开。(该参数iOS无效)
successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
Example
app.link.initYXTLiveSdk(example_environment, example_accessType, example_enableLog, result => { bui.alert('sdk init success') }, error => { bui.alert(error); }) -
static joinMeeting(params, successCallback, failCallback)
-
zoom加入视频会议(4.5.1)
Parameters:
Name Type Description paramsobject 参数
Properties
Name Type Description meetingNostring 视频会议ID
meetingPwdstring 视频会议密码
nickNamestring 视频会议名称
successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
-
static launchLinkService(serviceParam)
-
启动link里面的服务(待补充)
Parameters:
Name Type Description serviceParamObject 组合参数(需要用到请联系产品组)
-
static logout()
-
注销Link
Example
app.link.logout(); -
static openAbout()
-
打开关于页面
Example
app.link.openAbout(); -
static openAppCard(appCode)
-
打开应用详情页面
Parameters:
Name Type Description appCodeString 应用编码
- Deprecated:
-
- Yes
Example
app.link.openAppCard("com.bingo.touch"); -
static openAppDesktop()
-
打开应用桌面
Parameters:
Type Description - Deprecated:
-
- Yes
Example
app.link.openAppDesktop(); -
static openAppMarket()
-
打开应用市场
- Deprecated:
-
- Yes
Example
app.link.openAppMarket(); -
static openBlogSquare()
-
打开动态广场
- Deprecated:
-
- Yes
Example
app.link.openBlogSquare(); -
static openBtBroswer(url)
-
使用BT容器加载页面
Parameters:
Name Type Description urlstring 页面地址
-
static openCheckGestureLock(successCallback, failCallback)
-
打开手势锁屏页面,如果没有设置,会先弹出设置界面,如果有设置,则直接弹出解锁页面
Parameters:
Name Type Description successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
Example
app.link.openCheckGestureLock(); -
static openCheckInDetail(checkinId)
-
打开签到详情页面
Parameters:
Name Type Description checkinIdString 签到id
Example
app.link.openCheckInDetail('04f612d2-0931-48ea-ade8-6de5a382f8fc'); -
static openCheckInList()
-
调用Link的“签到列表”界面
Example
app.link.openCheckInList(); -
static openContactPage()
-
打开通讯录页面
Example
app.link.openContactPage(); -
static openDiscoveryService()
-
打开应用中心(旧版叫发现服务)
-
static openDisk()
-
打开云盘
-
static openGroupCheckInList(groupId)
-
打开群组签到列表
Parameters:
Name Type Description groupIdString 群组id
Example
app.link.openGroupCheckInList('1456fa37-ebc9-4123-88c0-8b494bab7377'); -
static openGroupList(eCode)
-
打开群组列表
Parameters:
Name Type Description eCodeString 企业编码eCode,默认不传,企业互联才需要传
Example
app.link.openGroupList(); -
static openGroupMicroblog(groupId)
-
打开某群组动态主页
Parameters:
Name Type Description groupIdString 群组id
Example
app.link.openGroupMicroblog('1456fa37-ebc9-4123-88c0-8b494bab7377'); -
static openGroupNoticeList(groupId)
-
打开群组公告列表
Parameters:
Name Type Description groupIdString 群组id
Example
app.link.openGroupNoticeList('1456fa37-ebc9-4123-88c0-8b494bab7377'); -
static openLinkBroswer()
-
打开Link内置浏览器
-
static openMicroblogDetail(blogId)
-
打开动态详情
Parameters:
Name Type Description blogIdString 动态Id
Example
app.link.openMicroblogDetail('0683ecc7-560f-4b7e-92a3-6ce9d690e5be');//这里填写你的动态id -
static openMicroblogPage(displayType)
-
打开动态主页
Parameters:
Name Type Description displayTypeInt 显示类型
0 全部
1 官方
2 群组
3 个人
4 我的动态
5 相互关注
6 项目
7 随便逛逛Example
app.link.openMicroblogPage(0); -
static openMsgCenter(isShowService)
-
打开消息中心页面
Parameters:
Name Type Description isShowServiceBoolean 废弃不用
Example
app.link.openMsgCenter(); -
static openMyMicroblog()
-
打开我的动态
Example
app.link.openMyMicroblog(); -
static openOnlineServicer()
-
打开在线客服
-
static openOrgCard(orgId)
-
查看部门名片页
Parameters:
Name Type Description orgIdString 部门id
Example
app.link.openOrgCard('02af68fb-dc53-4411-b6c8-d6480cce2234'); -
static openOrgList(orgId)
-
打开部门列表
Parameters:
Name Type Description orgIdString 部门id(可不传)
Example
app.link.openOrgList(); -
static openPdfBroswer(title, url)
-
打开pdf文件:url支持本地以及远程的地址
Parameters:
Name Type Description titleSting 标题
urlSting url支持本地以及远程的地址
-
static openPersonEdit()
-
打开个人信息修改页面
Example
app.link.openPersonEdit(); -
static openProcessMywork()
-
打开我的工作页面
Example
app.link.openProcessMywork(); -
static openServiceAccountCard(accountId)
-
查看服务号名片页
Parameters:
Name Type Description accountIdString 服务号id
Example
app.link.openServiceAccountCard("43b80351-2c0a-4e84-a3d0-43eb7d35bc00"); -
static openServiceAccountList()
-
查看已关注服务号列表
Example
app.link.openServiceAccountList(); -
static openServiceAccountMicroblog(serviceId, accountName)
-
打开某服务号动态主页
Parameters:
Name Type Description serviceIdString 服务号Id
accountNameString 服务号名称,可省略
Example
app.link.openServiceAccountMicroblog('Id'); -
static openSetting()
-
打开个人设置页面
Example
app.link.openSetting(); -
static openSpeechAssistant()
-
打开语音助手
-
static openStCleanCache()
-
打开清除缓存页面
Example
app.link.openStCleanCache(); -
static openStDevice()
-
打开设备管理页面
Example
app.link.openStDevice(); -
static openStFont()
-
打开设置字体大小页面
Example
app.link.openStFont(); -
static openStGestureLock()
-
打开设置手势锁屏页面
Example
app.link.openStGestureLock(); -
static openStInvite()
-
打开邀请好友页面
Example
app.link.openStInvite(); -
static openStModifyPassword()
-
打开修改密码页面
Example
app.link.openStModifyPassword(); -
static openStNotification()
-
打开设置消息通知页面
Example
app.link.openStNotification(); -
static openStQrcode()
-
打开Link二维码页面
Example
app.link.openStQrcode(); -
static openStSync()
-
打开手工同步页面
Example
app.link.openStSync(); -
static openTodo(options)
-
打开待办待阅
Parameters:
Name Type Description optionsobject Properties
Name Type Description defaultIndexint 0(待办)/1(待阅)/2(已办)
-
static openTopicMicroblog(topic)
-
打开某话题动态主页
Parameters:
Name Type Description topicString 话题名称
Example
app.link.openTopicMicroblog('Link发布会'); -
static openUserMicroblog(accountId)
-
打开某人动态主页
Parameters:
Name Type Description accountIdString 用户Id
Example
app.link.openUserMicroblog('张武韬'); -
static openVideoRecord()
-
打开小视频
-
static openYXTLiveScene(scene, roomId, token, title, successCallback, failCallback)
-
云学堂直播-打开直播
Parameters:
Name Type Description scenestring 直播场景,值有 liveRoom(直播间)、liveReplay(直播回放)、miniCourse(微课)
roomIdstring 直播间 id
tokenstring 鉴权 token
titlestring 直播或微课的标题。直播回放、微课需要传,直播间不需要传
successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
Example
app.link.openYXTLiveScene(example_scene, example_roomId, example_token, example_title, result => { bui.alert('openYXTLiveScene success') }, error => { bui.alert(error); }) -
static pathToBase64(successCallback, failCallback)
-
根据文件路径转base64
Parameters:
Name Type Description successCallbackfunction 成功回调函数 返回base64
failCallbackfunction 失败回调函数
-
static publishMicroblog(successCallback, failCallback, options)
-
发表动态
Parameters:
Name Type Description successCallbackfunction 成功回调
failCallbackfunction 失败回调,返回失败信息
optionsObject JSON格式,动态参数,具体如下:
authorID {String} 发表动态的对象id , 可以是用户或用户运营的服务号 (不写默认是当前用户)
content {String} 动态内容
privateType {Int} 私密类型 , 0 群组,1 部门, 2 个人 , 3 项目 , 4公开 (默认类型)
privateInstanceID {String} 私密对象id
privateName {String} 私密对象名称
images {Array} 动态图片 (相册图片地址, 建议到动态发表界面再选择图片,这样更加方便)Example
app.link.publishMicroblog(function(res){ app.alert(res); },function (error) { app.alert(error); },{ content : '这是发布到link的一条动态!!' }); -
static recordStart(params, successCallback, failCallback)
-
开始录音(安卓4.5.6)
Parameters:
Name Type Description paramsObject 参数对象
Properties
Name Type Description savePathstring 录音的保存路径
successCallbackfunction 成功回调
failCallbackfunction 失败回调
-
static recordStop(successCallback, failCallback)
-
结束录音(安卓4.5.6)
Parameters:
Name Type Description successCallbackfunction 成功回调,返回录音信息
failCallbackfunction 失败回调
-
static registerReceiver(key)
-
注册系统消息监听
注册完成后在页面声明 function nativeCallback(key, param) 就能够监听到消息了。param里面返回 accountType和 accountInstanceIdParameters:
Name Type Description keyString link内部的key,例如 link_unreadMessageChanged 表示未读消息
-
static runApp(params)
-
启动应用市场App
Parameters:
Name Type Description paramsObject 启动应用的参数,key-value格式为
{ appCode:"应用市场中填写的编码", appUrl:"启动页面相对地址", data:{name:"张三",sex:"male":age:25} }
其中data参数也是json对象,启动目标应用后,能够在app.getPageParams里面获取到。Example
var params={ appCode:"com.bingo.touch", data:{ name:"张三", sex:"male", gender:23 } } app.link.runApp(params); -
static saveToGallery(sourcePath, success, fail)
-
把本地图片保存到相册
Parameters:
Name Type Description sourcePathstring 本地文件的路径
successfunction 成功回调函数。 {path: '相册路径'}
failfunction 失败回调函数
-
static scanCode()
-
打开扫一扫
-
static selectFiles(type, successCallback, failCallback)
-
发起选择文件资源
Parameters:
Name Type Description typenumber 范围0~5,0:拍照 1:选择图片 2 本地文件单选 3:云盘文件 4: 界与聊天里的文件跳转后界面相同,选择最近聊天文件和本地文件(仅支持安卓) 5: 本地文件多选
successCallbackfunction 成功回调函数 [{"resourceSize":100kb,"resourceLocal":"/storage/emulated/0/xxxx"}]
failCallbackfunction 失败回调函数
-
static sendGroupNotice(groupId)
-
打开群组发公告页面
Parameters:
Name Type Description groupIdString 群组id
Example
app.link.sendGroupNotice('1456fa37-ebc9-4123-88c0-8b494bab7377'); -
static sendInviteMessage(params)
-
发送邀约消息(主要用在消息窗口,待补充)
Parameters:
Name Type Description paramsObject json对象,包含:
toId:发送邀约消息对象id,要看toType是什么类型
toType:0系统1私聊2群组4部门5服务号
title:邀约标题
desc:邀约内容
action_params:操作指令,具体请咨询产品组Example
var params={toId:'ebdfe3b1-ed9c-425b-aac3-aa6c61d05d0e',toType:1,title:'发送邀约',desc:'邀约描述',action_params:''}; app.link.sendInviteMessage(params); -
static sendServiceAccountNotice(accountId, bulletinType)
-
发送服务号公告
Parameters:
Name Type Description accountIdString 服务号id
bulletinTypeInt 公告类型(1文字,2图片,3语音) | 不传此参数时先进入公告类型选择页面
Example
app.link.sendServiceAccountNotice("43b80351-2c0a-4e84-a3d0-43eb7d35bc00"); -
static setFullScreen(successCallback, failCallback, params)
-
设置全屏(安卓)
Parameters:
Name Type Description successCallbackfunction 成功回调函数,返回json对象
failCallbackfunction 失败回调函数,返回错误字符串
paramsobject 参数
Properties
Name Type Description isEnableBoolean true 全屏 false 取消全屏
-
static setScreenOrientation(params, successCallback, failCallback)
-
固定横竖屏(安卓4.4.2)
Parameters:
Name Type Description paramsobject 参数
Properties
Name Type Description typestring 参数值 portrait:竖屏/landscape:横屏/auto:自动
successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
-
static share(params)
-
外部内容分享到Link里面(待补充)
Parameters:
Name Type Description paramsObject
title: {string} 标题
content: {string} 分享内容摘要
icon: {string} 分享的图标地址,支持远程地址,或本地图片
type: {string} WEBSITE,PICTURE -
static shareToBlog(params)
-
分享到动态
Parameters:
Name Type Description paramsObject
title: {string} 标题
content: {string} 分享内容摘要
icon: {string} 分享的图标地址,支持远程地址,或本地图片
type: {string} WEBSITE,PICTURE。(4.6.8版本才支持PICTURE类型) -
static shareToMessage(params)
-
分享到聊天界面(个人/群组)
Parameters:
Name Type Description paramsObject
title: {string} 标题
content: {string} 分享内容摘要
icon: {string} 分享的图标地址,支持远程地址,或本地图片
type: {string} WEBSITE,PICTURE。(4.6.8版本才支持PICTURE类型) -
static shareToSystem(params)
-
分享到系统(Link 4.6.3 以上)
Parameters:
Name Type Description paramsObject
title: {string} 标题
content: {string} 分享内容摘要
icon: {string} 分享的图标地址,支持远程地址,或本地图片
type: {string} WEBSITE,PICTURE。(4.6.8版本才支持PICTURE类型) -
static sourceIdToUserId(sourceId, successCallback, failCallback, option)
-
sourceId转userId
Parameters:
Name Type Description sourceIdstring sourceId
successCallbackfunction 成功回调函数,返回用户信息/服务地址
failCallbackfunction 失败回调函数,返回错误字符串
optionObject 参数
Properties
Name Type Description isGetParamsstring 是否传回服务地址
-
static startApp(params)
-
启动应用市场App
Parameters:
Name Type Description paramsObject 启动应用的参数,key-value格式为
{ appCode:"应用市场中填写的编码", appUrl:"启动页面相对地址", data:{name:"张三",sex:"male":age:25} }
其中data参数也是json对象,启动目标应用后,能够在app.getPageParams里面获取到。Example
var params={ appCode:"com.bingo.touch", data:{ name:"张三", sex:"male", gender:23 } } app.link.startApp(params); -
static startChat()
-
发起聊天
-
static startCheckIn()
-
调用Link的“我要签到”界面
Example
app.link.startCheckIn(); -
static startContactMulitSelector(successCallback, failCallback, title, dataType, extraParams)
-
调用Link选人界面(多选)
Parameters:
Name Type Description successCallbackfunction 成功回调函数,返回json对象
failCallbackfunction 失败回调函数,返回错误字符串
titleString 选人窗口文字说明
dataTypeString 选择范围:1为用户,2为群组,3为用户+群组 4为部门(组织),5为用户+组织
extraParamsObject json对象,具体可以传入哪些请参看代码
isGetSourceId 获取用户的sourceIdExample
app.link.startContactMulitSelector( function(result){ app.alert(result); }, function(error){ app.alert(error); }, '请选择用户/群组(多选)', '1', { userSelected: [], //默认选中的用户 id groupSelected: [], //默认选中的群组id organizationSelected: [], //默认选中的部门id userIgnore: [], //禁止选择的用户id groupIgnore: [], //禁止选择的群组id organizationIgnore: [], //禁止选择的部门id isIncludeDisableUser:false //是否包含被禁用的人员, 默认是false } ); -
static startContactSingleSelector(successCallback, failCallback, title, dataType, extraParams)
-
调用Link选人页面(单选)
Parameters:
Name Type Description successCallbackfunction 成功回调函数,返回json对象
failCallbackfunction 失败回调函数,返回错误字符串
titleString 选人窗口文字说明
dataTypeString 选择范围:1为用户,2为群组,3为用户+群组 4为部门(组织),5为用户+组织,8为服务号
extraParamsjson对象,方便后面扩展,目前有isIncludeDisableUser(是否包含禁用的用户,默认false)
hasLatelyChatConversation 是否展示默认联系人
isGetSourceId 获取用户的sourceIdExample
app.link.startContactSingleSelector(function(result){ app.alert(result); },function(){} ,'请选择用户','1'); -
static startDevMain(successCallback, failCallback)
-
打开轻应用调试模式(安卓端 4.5.5)
Parameters:
Name Type Description successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
-
static startEmail()
-
打开邮箱
-
static startGestureLockValidation(successCallback, failCallback)
-
调用手势
Parameters:
Name Type Description successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
-
static startGroupCard(groupId)
-
调用Link里面群组的名片页面
Parameters:
Name Type Description groupIdString 群组id
Example
app.link.startGroupCard('1456fa37-ebc9-4123-88c0-8b494bab7377'); -
static startGroupChat(groupId, groupName)
-
调用Link的群组聊天页面
Parameters:
Name Type Description groupIdString 群组id
groupNameString 群组名称(可选)
Example
app.link.startGroupChat('1456fa37-ebc9-4123-88c0-8b494bab7377'); -
static startOrganUserMultiSelector(params, successCallback, failCallback)
-
部门选择控件-多选
Parameters:
Name Type Description paramsobject 参数
Properties
Name Type Description titlestring 提示
orgIdstring 部门id
userIgnoreListArray 忽略某些用户
userFixSelectedListArray 固定选中用户
successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
-
static startOrganUserSingleSelector(params, successCallback, failCallback)
-
部门选择用户控件-单选(4.4.2)
Parameters:
Name Type Description paramsobject 参数
Properties
Name Type Description titlestring 提示
orgIdstring 部门id
userIgnoreListArray 忽略某些用户
userFixSelectedListArray 固定选中用户
successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
-
static startProcess(processId, serviceName)
-
打开自由流程页面
Parameters:
Name Type Description processIdString 流程id
serviceNameString 流程名称
Example
app.link.startProcess('4b4db781-bdc2-4cfa-a6c0-03cc93bbef3f', '用户反馈'); -
static startProjectDetail()
-
打开某项目动态主页
- Deprecated:
-
- Yes
Example
app.link.startProjectDetail('projectId'); -
static startServiceAccountChat(accountId)
-
打开服务号聊天界面
Parameters:
Name Type Description accountIdString 服务号id
Example
app.link.startServiceAccountChat("43b80351-2c0a-4e84-a3d0-43eb7d35bc00"); -
static startUserCard(userId)
-
调用Link里面用户的名片页面
Parameters:
Name Type Description userIdString 用户id
Example
app.link.startUserCard('ebdfe3b1-ed9c-425b-aac3-aa6c61d05d0e'); -
static startUserChat(userId, userName)
-
调用Link的用户聊天页面
Parameters:
Name Type Description userIdString 用户id
userNameString 用户名称(可选)
Example
app.link.startUserChat('ebdfe3b1-ed9c-425b-aac3-aa6c61d05d0e'); -
static transcodeVideo(successCallback, failCallback, params)
-
压缩方法(在部分的安卓手机上不兼容)
Parameters:
Name Type Description successCallbackfunction 成功回调函数
failCallbackfunction 失败回调函数
paramsObject Properties
Name Type Description fileUristring 设备上视频的路径
outputFileNamestring 输出文件名称
-
static updateTabBadge(badgeValue)
-
更新Link底部tab角标的数字
Parameters:
Name Type Description badgeValueString 角标的内容,这个内容直接更新到tab里面(当不传此值时去除角标)
Example
app.link.updateTabBadge('12');