背景

1、钉钉提供了一套完整的跳转链接规则,借此规则,我们可以实现链接跳转后,通过不同的方式打开,区分PC端和移动端。
譬如:PC浏览器、PC侧边栏、PC工作台、PC独立窗口、移动端全屏、移动端半屏(暂不推出)。
今天的主角
https://xmtrf1.aliwork.com/o/_test_test

实现方式

PC浏览器&移动端全屏

无需转化,原链接即可。
https://xmtrf1.aliwork.com/o/_test_test

PC侧边栏

dingtalk://dingtalkclient/page/link?url=https%3A%2F%2Fxmtrf1.aliwork.com%2Fo%2F_test_test&pc_slide=true

  1. `dingtalk://dingtalkclient/page/link?url=${encodeURIComponent(your url)}&pc_slide=true`

image.png

PC工作台

dingtalk://dingtalkclient/page/link?url=https%3A%2F%2Fxmtrf1.aliwork.com%2Fo%2F_test_test%3Fddtab%3Dtrue

  1. `dingtalk://dingtalkclient/page/link?url=${encodeURIComponent(your url + "?ddtab=true")}`

image.png

PC独立窗口

height、width可修改,单位为px,独立窗口的宽高。
dingtalk://dingtalkclient/page/link?url=https%3A%2F%2Fxmtrf1.aliwork.com%2Fo%2F_test_test&popup_wnd=true&height=500&width=900

  1. `dingtalk://dingtalkclient/page/link?url=${encodeURIComponent(your url)}&popup_wnd=true&height=500&width=900`

image.png

移动端半屏(暂不推出)