# url
你可以使用url对象实现多端差异跳转链接。本文介绍如何使用url对象。你可以将url对象内嵌到以下卡片组件中。
- 用于button的
multiUrl
字段,支持按键点击的多端跳转。
# 字段属性说明
参数 | 是否必须 | 类型 | 示例值 | 描述 |
---|---|---|---|---|
url | 是 | String | http/https开头的网页地址: https://hi.zhipin.com 或者 applink类型地址 | 默认跳转链接。 |
androidUrl | 否 | String | http/https开头的网页地址: https://developer.android.com/ 或者 applink类型地址 | 安卓端跳转链接。 |
iosUrl | 否 | String | http/https开头的网页地址: https://developer.apple.com/ 或者 applink类型地址 | ios端跳转链接。 |
pcUrl | 否 | String | http/https开头的网页地址: https://www.windows.com 或者 applink类型地址 | pc端跳转链接。 |
# 卡片结构示例
- 结构样例
{
"url": "https://hi.zhipin.com",
"androidUrl": "https://developer.android.com/",
"iosUrl": "https://developer.apple.com/",
"pcUrl": "https://www.windows.com"
}
1
2
3
4
5
6
2
3
4
5
6
- 配置button元素multi字段样例
{
"tag": "button",
"text": {
"tag": "hi_md",
"content": "multi url"
},
"multiUrl": {
"url": "https://hi.zhipin.com",
"androidUrl": "https://developer.android.com/",
"iosUrl": "https://developer.apple.com/",
"pcUrl": "https://www.windows.com"
},
"type": "primary"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# 注意事项
url和各端url的关系如下
- url为兜底链接,如果各端地址一样只需配置此链接。
- 各端url的优先级高于url,当二者同时存在时,优先跳转各端url。