有货 App跳转规则
说明
该跳转规则的目的是:一个链接在我们的系统里(H5和App)都能够跳转到想要的地方。整个跳转路径分为3段
1. URL
2. 打开方式
3. 打开参数
新增URL SCHME方式
URL
用于网页的跳转
打开方式
openby:
用于表示当前的跳转路径用哪个App打开
参数 | 说明 |
---|---|
yohobuy | 用yohobuy内置规则打开 |
show | 用show内置规则打开 |
boy | 用yoho!boy内置规则打开 |
girl | 用yoho!girl内置规则打开 |
browser | 用当前系统的浏览器打开 |
打开参数
Yohobuy
action | 跳转目的 | 跳转参数 | 说明 |
---|---|---|---|
go.brand | 品牌列表页 | yohobuy={"action":"go.brand","params":{"shop_id":"356","jumptoshop":"Y","brand_id":"4","promotion":"4",tags_filter: "1"}} | promotion专区id(童装), tags_filter(默认不填,1:全球购羊头品牌标签过滤),如果要跳转到店铺设置jumptoshop=Y,否则跳转到品牌 |
go.productDetail | 商品详情页 | yohobuy={"action":"go.productDetail","params":{"product_skn":"126131",tags_filter: "1"}} | tags_filter(默认不填,1:全球购羊头品牌标签过滤) |
go.coupon | 优惠券页 | yohobuy={"action":"go.coupon"} | |
go.fav | 收藏列表页 | yohobuy={"action":"go.fav","params":{"favType":"0"}} | favType标示收藏类型:0:商品收藏和 1:品牌收藏 |
go.mine | 我的页面 | yohobuy={"action":"go.mine"} | |
go.list | 商品列表页 | yohobuy={"action":"go.list","params":{"msort":"1","misort":"11","title":"上衣", "actiontype":"1" ,"shop_id":"356", "query":"关键字搜索", "gender":"1,3", "brand":"1", "color":"1", "size":"12", "price":"10", "page":"1", "isrecommd":"Y", "ishot":"Y", "p_d":"0.1, 0.9", "promotion":"23","outlets":"1"}} | actiontype=0 其他,支持promotion搜索;actiontype=1 普通分类;outlets=1表示是奥莱的商品 |
go.attention | 分类页 | yohobuy={"action":"go.attention","params":{"actiontype":"0"}} | "actiontype=0 品类 1品牌 2关注" |
go.plus | plus页 | yohobuy={"action":"go.plus"} | |
go.star | star页 | yohobuy={"action":"go.star"} | |
go.new | 新品到着页 | yohobuy={"action":"go.new","params":{"msort":"10","channel":"2"}} | msort在家居频道时配置 cid频道标识 |
go.sale | 折扣页 | yohobuy={"action":"go.sale","params":{"msort":"10","channel":"2"}} | msort在家居频道时配置 cid频道标识 |
go.share | 分享 | yohobuy={"action":"go.share","params":{"title":"分享的标题","content":"分享的文字内容","url":"分享的URL","pic":"图片链接"}} | |
go.h5 | h5网页(目前用在逛) | yohobuy={"action":"go.h5","params":{"id":"74","share":"/guang/api/v1/share/guang?id=74","shareparam":{"id":"74"},"islogin":"Y","type":1,"updateflag":"2adfw4e243abdefwqg1234dfarq","url":"http://guang.m.yohobuy.com/info/index","param":{"id":"74"}}} | "type:0 普通 type:1 顶部有喜欢,评论(逛 ),params里的param字段用于url请求时附带的参数,由web任意组合" updateflag标识用于缓存 islogin建议一般设置为N |
go.weblogin | h5网页调用本地登录 | yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"http://guang.m.yohobuy.com/info/index,//用于本地登录成功后webView需要跳转的页面url,可以是当前页也可以是其他页","param":{"id":"74"}},"requesturl":{"param":{"id":"56","query":"aaaaaa"},"url":"http://guang.m.yohobuy.com/info/index,//用于本地登录成功后本地发出的httpRequest,可以是对任意接口调用,param字段传请求时的参数"},"priority":"Y或者N, Y则请求接口结束后再刷新网页。N可并行请求接口和刷新网页"}} | |
go.activity | h5活动页 | yohobuy={"action":"go.activity","params":{"act_id":"4","act_title":"春装五折起", "islogin":"Y", "link":"http://m.yohobuy.com/get-red-envelope-1111.html"}} | 兼容老版本跳转 |
go.guangchannel | 跳转到逛频道/ShOw晒单页 | yohobuy= {"action":"go.guangchannel","params":{"id":"分类的id","name":"类别名","index":"0"}} | index缺省或者值为0时跳转到逛,index=1跳转到ShOw |
go.home | 侧滑跳转到首页 | yohobuy={"action":"go.home","params":{"gender":"1","channel":"2"}} | 除侧滑二级页面,其它禁用 channel频道标识 |
go.yohood | banner跳转到yohood页 | yohobuy={"action":"go.yohood"} | |
go.top100 | 热卖排行榜 | yohobuy={"action":"go.top100","params":{"page":"0"}} | page表示显示的tab页索引,0 第一个 |
go.activitytemplate | 活动模板 | yohobuy={"action":"go.activitytemplate","params":{"template_id":"0","title":"标题","type":"0"}} | template_id表示活动ID ,title表示活动标题 ,type区分不同类型(0通用、1新人专享)(同类型活动模板根据type区分) |
go.subchannel | 二级频道 | yohobuy={"action":"go.subchannel","params":{"template_id":"28","title":"标题","content_code":"891b7811db16feba557fd8eff7f07dcf"}} | template_id表示你可能喜欢数据的ID ,title表示二级频道标题 ,content_code表示二级频道资源位 |
go.showgoods | 去晒单 | yohobuy={"action":"go.showgoods"} | |
go.globalpurchase | 全球购首页 | yohobuy={"action":"go.globalpurchase"} | 不带任何参数 |
go.globalpurchase | 全球购品牌列表 | yohobuy={"action":"go.globalpurchase","params":{"brand":"all"}} | 不带其他参数 |
go.globalpurchase | 全球购分类列表 | yohobuy={"action":"go.globalpurchase","params":{"sort":"all"}} | 不带其他参数 |
go.globalpurchase | 全球购商品列表 | yohobuy={"action":"go.globalpurchase","params":{"brand":"1","sort":"97","title":"T恤","yh_channel":"1","order":"s_t_desc"}} | title表示商品列表的标题,brand表示品牌(可选),sort表示分类物理类目(可选),yh_channel表示频道(可选),order表示排序规则(可选,默认最新) |
go.globalpurchase | 全球购商品详情 | yohobuy={"action":"go.globalpurchase","params":{"skn":"1231400"}} | skn表示商品SKN |
go.limitpurchase | 尖货频道 | yohobuy={"action":"go.limitpurchase"} | |
go.limitpurchase | 尖货详情 | yohobuy={"action":"go.limitpurchase","params":{"lp":"1231400"}} | lp表示限购商品的唯一标识符 |
go.vippro | 会员商品 | yohobuy={"action":"go.vippro","channel":"1"} | channel(选填)表示指定频道(男1、女2、童3,家4),不配默认当前频道 |
go.shortsize | 断码页 | yohobuy={"action":"go.shortsize","channel":"1"} | channel(选填)表示指定频道(男1、女2、童3,家4),不配默认当前频道 |
go.discountmarket | 折扣专区 | yohobuy={"action":"go.discountmarket"} | |
go.discountmarketpro | 折扣专区详情页 | yohobuy={"action":"go.discountmarketpro","params":{"id":"1","cover_url":"封面图","title":"T恤","start_date":"2016-03-10 14:32:25"}} | start_date指开始活动时间,格式要保持固定 |
go.signin | 签到页 | yohobuy={"action":"go.signin"} | |
go.shop | 店铺标准模版页 | {"type": "push","url":{"action":"go.shop","params":{"shop_id":"356","shop_template_type":"1","shop_name":"DGK"}}} | shop_template_type = 1是基础模板,2是标准模板 |
go.newoutlet | 奥莱频道页 | yohobuy={"action":"go.newoutlet","params":{"category_id":"6","yh_channel":"1","content_code":"abcd123456"}} | category_id(必填)为奥莱频道的分类管理中的id, yh_channel(选填)表示二级频道(男1、女2、童3,家4), content_code(选填)表示二级频道的资源位码。只填category_id时,进入奥莱频道页,三个字段都填写时,可进入奥莱的二级频道页 |
go.outletactivity | 奥莱活动详情页 | yohobuy={"action":"go.outletactivity","params":{"activity_id":"123"}} | activity_id为奥莱活动的活动id |
go.comm.postdetail | 社区帖子详情页 | yohobuy={"action":"go.comm.postdetail","params":{"postid":"123"}} | postid为社区帖子id |
go.comm.forum | 社区版块首页 | yohobuy={"action":"go.comm.forum","params":{"forumid":"123"}} | forumid为社区版块id |
go.comm.h5 | 社区H5 | yohobuy={"action":"go.comm.h5","params":{"title":"test","url":"testurl"}} | title为H5页标题,url为H5要加载的url |
go.comm.productDetail | 社区商品详情页 | yohobuy={"action":"go.comm.productDetail","params":{"product_skn":"123"}} | product_skn为商品的skn |
新增推送(push)方式,兼容现有新跳转规则(统一有货 App跳转规则)
跳转参数
action | 跳转目的 | 推送跳转参数 | 说明 |
---|---|---|---|
go.brand | 品牌列表页 | {"type":"push","url":{"action":"go.brand","params":{"brand_id":"4","promotion":"4"}}} | *promotion专区id(童装) |
go.productDetail | 商品详情页 | {"type""push","url":{"action":"go.productDetail","params":{"product_skn":"126131"}}} | |
go.coupon | 优惠券页 | {"type": "push","url":{"action":"go.coupon"}} | |
go.fav | 收藏列表页 | {"type": "push","url":{"action":"go.fav","params":{"favType":"0"}}} | favType标示收藏类型:0:商品收藏和 1:品牌收藏 |
go.mine | 我的页面 | {"type": "push","url":{"action":"go.mine"}} | |
go.list | 商品列表页 | {"type": "push","url":{"action":"go.list","params":{"msort":"1","misort":"11","title":"上衣", "actiontype":"1" ,"shop_id":"356", "query":"关键字搜索", "gender":"1,3", "brand":"1", "color":"1", "size":"12", "price":"10", "page":"1", "isrecommd":"Y", "ishot":"Y", "p_d":"0.1, 0.9", "promotion":"23"}}} | actiontype=0 其他,支持promotion搜索;actiontype=1 普通分类;actiontype=2 奥莱分类 |
go.attention | 分类页 | {"type": "push","url":{"action":"go.attention","params":{"actiontype":"0"}}} | "actiontype=0 品类 1品牌 2关注" |
go.plus | plus页 | {"type": "push","url":{"action":"go.plus"}} | |
go.star | star页 | {"type": "push","url":{"action":"go.star"}} | |
go.new | 新品到着页 | {"type": "push","url":{"action":"go.new","params":{"msort":"10","channel":"2"}}} | msort在家居频道时配置 cid频道标识 |
go.sale | 折扣页 | {"type": "push","url":{"action":"go.sale","params":{"msort":"10","channel":"2"}}} | msort在家居频道时配置 cid频道标识 |
go.share | 分享 | {"type": "push","url":{"action":"go.share","params":{"title":"分享的标题","content":"分享的文字内容","url":"分享的URL","pic":"图片链接"}}} | |
go.h5 | h5网页(目前用在逛) | {"type": "push","url":{"action":"go.h5","params":{"id":"74","share":"/guang/api/v1/share/guang?id=74","shareparam":{"id":"74"},"islogin":"Y","type":1,"updateflag":"2adfw4e243abdefwqg1234dfarq","url":"http://guang.m.yohobuy.com/info/index","param":{"id":"74"}}}} | "type:0 普通 type:1 顶部有喜欢,评论(逛 ),params里的param字段用于url请求时附带的参数,由web任意组合" updateflag标识用于缓存 islogin建议一般设置为N |
go.weblogin | h5网页调用本地登录 | {"type": "push","url":{"action":"go.weblogin","params":{"jumpurl":{"url":"http://guang.m.yohobuy.com/info/index,//用于本地登录成功后webView需要跳转的页面url,可以是当前页也可以是其他页","param":{"id":"74"}},"requesturl":{"param":{"id":"56","query":"aaaaaa"},"url":"http://guang.m.yohobuy.com/info/index,//用于本地登录成功后本地发出的httpRequest,可以是对任意接口调用,param字段传请求时的参数"},"priority":"Y或者N, Y则请求接口结束后再刷新网页。N可并行请求接口和刷新网页"}}} | |
go.activity | h5活动页 | {"type": "push","url":{"action":"go.activity","params":{"act_id":"4","act_title":"春装五折起", "islogin":"Y", "link":"http://m.yohobuy.com/get-red-envelope-1111.html"}}} | 兼容老版本跳转 |
go.guangchannel | 跳转到逛频道/ShOw晒单页 | {"type": "push","url":{"action":"go.guangchannel","params":{"id":"分类的id","name":"类别名","index":"0"}}} | index缺省或者值为0时跳转到逛,index=1跳转到ShOw |
go.home | 侧滑跳转到首页 | {"type": "push","url":{"action":"go.home","params":{"gender":"1","channel":"2"}}} | 除侧滑二级页面,其它禁用 channel频道标识 |
go.yohood | banner跳转到yohood页 | {"type": "push","url":{"action":"go.yohood"}} | |
go.top100 | 热卖排行榜 | {"type": "push","url":{"action":"go.top100","params":{"page":"0"}}} | page表示显示的tab页索引,0 第一个 |
go.activitytemplate | 活动模板 | {"type": "push","url":{"action":"go.activitytemplate","params":{"template_id":"0","title":"标题","type":"0"}}} | template_id表示活动ID ,title表示活动标题 ,type区分不同类型(0通用、1新人专享)(同类型活动模板根据type区分) |
go.subchannel | 二级频道 | {"type": "push","url":{"action":"go.subchannel","params":{"template_id":"28","title":"标题","content_code":"891b7811db16feba557fd8eff7f07dcf"}}} | template_id表示你可能喜欢数据的ID ,title表示二级频道标题 ,content_code表示二级频道资源位 |
go.showgoods | 去晒单 | {"type": "push","url":{"action":"go.showgoods"}} | |
go.globalpurchase | 全球购首页 | {"type": "push","url":{"action":"go.globalpurchase"}} | 不带任何参数 |
go.globalpurchase | 全球购品牌列表 | {"type": "push","url":{"action":"go.globalpurchase","params":{"brand":"all"}}} | 不带其他参数 |
go.globalpurchase | 全球购分类列表 | {"type": "push","url":{"action":"go.globalpurchase","params":{"sort":"all"}}} | 不带其他参数 |
go.globalpurchase | 全球购商品列表 | {"type": "push","url":{"action":"go.globalpurchase","params":{"brand":"1","sort":"97","title":"T恤","yh_channel":"1","order":"s_t_desc"}}} | title表示商品列表的标题,brand表示品牌(可选),sort表示分类物理类目(可选),yh_channel表示频道(可选),order表示排序规则(可选,默认最新) |
go.globalpurchase | 全球购商品详情 | {"type": "push","url":{"action":"go.globalpurchase","params":{"skn":"1231400"}}} | skn表示商品SKN |
go.limitpurchase | 尖货频道 | {"type": "push","url":{"action":"go.limitpurchase"}} | |
go.limitpurchase | 尖货详情 | {"type": "push","url":{"action":"go.limitpurchase","params":{"lp":"1231400"}}} | lp表示限购商品的唯一标识符 |
go.vippro | 会员商品 | {"type": "push","url":{"action":"go.vippro"}} | |
go.shortsize | 断码页 | {"type": "push","url":{"action":"go.shortsize"}} | |
go.discountmarket | 折扣专区 | {"type": "push","url":{"action":"go.discountmarket"}} | |
go.discountmarketpro | 折扣专区详情页 | {"type": "push","url":{"action":"go.discountmarketpro","params":{"id":"1","cover_url":"封面图","title":"T恤","start_date":"2016-03-10 14:32:25"}}} | start_date指开始活动时间,格式要保持固定 |
go.signin | 签到页 | {"type": "push","url":{"action":"go.signin"}} | |
go.shop | 店铺标准模版页 | {"type": "push","url":{"action":"go.shop","params":{"shop_id":"356","shop_template_type":"1","shop_name":"DGK"}}} | shop_template_type = 1是基础模板,2是标准模板 |
go.newoutlet | 奥莱频道页 | {"type": "push","url":{"action":"go.newoutlet","params":{"category_id":"6","yh_channel":"1","content_code":"abcd123456"}}} | category_id(必填)为奥莱频道的分类管理中的id, yh_channel(选填)表示二级频道(男1、女2、童3,家4), content_code(选填)表示二级频道的资源位码。只填category_id时,进入奥莱频道页,三个字段都填写时,可进入奥莱的二级频道页 |
go.outletactivity | 奥莱活动详情页 | {"type": "push","url":{"action":"go.outletactivity","params":{"activity_id":"123"}}} | activity_id为奥莱活动的活动id |
新增推送(push)更新App新版本
更新App新版本推送参数
客户端 | 推送跳转参数 | 说明 |
---|---|---|
IOS | {"type":"event","ad_action":"go.url","ad_option":"link=http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho"} | 更新IOS App新版本 |
Android | {"type":"app","link":"http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho"} | 更新Android App新版本 |
在跳转中使用本地能力(YHExplorer组件)
说明
目前YHExplorer组件计划支撑的本地能力如下:
1. 摄像头
,2. LBS
,3. Device
,4. Media
,5. 传感器
,6. FileSystem
.
<!-- 组装参数,下面是基本参数结构 -->
var params = { "ability":"action", "options":{"optionKey":"optionValue"} };
<!-- 触发机能 -->
yohoInterface.triggerEvent(onSuccess, onFail, params);
onSuccess
回调里面会传递结果。
定义
1. 摄像头
-
拍照/访问相册
<!-- pictureSourceType: -- 访问相册 SAVEDPHOTOALBUM -- 摄像头 CAMERA --> var params = { "Native_Camera":"takePicture", "options":{ "quality":75, "pictureSourceType":"CAMERA" } };
-
展示获取的照片Example
function onSuccess(imageData) { var image = document.getElementById('myImage'); image.src = "data:image/jpeg;base64," + imageData; }
2. LBS
- 获取Location
var params = { "Native_LBS":"getLocation" };
<!-- 回调Example: -->
function onSuccess(coordinate) {
alert('Coordinate Latitude: ' + coordinate.latitude + '\n' +
'Coordinate Longitude: ' + coordinate.longitude);
};
3. Device
- 获取设备信息
var params = { "Native_Device":"getDeviceInfo" };
<!-- 回调Example: -->
function onSuccess(device) {
alert('Model: ' + device.model + '\n' +
'Platform: ' + device.platform + '\n' +
'OSVersion: ' + device.version);
};
4. Media
- 调用iOS媒体播放器
javascript var params = { "Native_Media":"playMedia", "options":{ "url":"http://xxxxxxx.mp4" } };
5. 传感器
- 震动
<!-- duration为震动时长 -->
var params = { "Native_Motion":"vibrate", "options":{ "duration":1.2 } };
- 获取加速计状态
<!-- period为观察间隔,单位是毫秒 -->
var params = { "Native_Motion":"watchAcceleration", "options":{ "period":1000 } };
<!-- 回调Example: -->
function onSuccess(acceleration) {
alert('Acceleration X: ' + acceleration.x + '\n' +
'Acceleration Y: ' + acceleration.y + '\n' +
'Acceleration Z: ' + acceleration.z + '\n' +
'Timestamp: ' + acceleration.timestamp + '\n');
};
- 停止获取加速计状态(不需要加速计状态时,务必调用来停止加速计刷新)
var params = { "Native_Motion":"clearWatchAcceleration" };
6. FileSystem
- 获取目录
<!-- Documents目录 -->
var params = { "Native_FS":"getDocumentsPath" };
<!-- tmp目录 -->
var params = { "Native_FS":"getTemporaryPath" };
<!-- cache目录 -->
var params = { "Native_FS":"getCachePath" };
<!-- 回调Example: -->
function onSuccess(path) {
alert('path: ' + path);
};
- 删除文件
var params = { "Native_FS":"deleteItemAtPath", "options":{ "path":"itemPath" }};
- 拷贝文件
var params = { "Native_FS":"copyItem", "options":{ "srcPath":"xxx", "dstPath":"xxx" } };