1.外鏈為淘寶店鋪:
my.tb.
此API可以跳轉多個:有一個參數為
跳轉官方業務頁面定義的。
目前支持:shop(打開店鋪頁):需在中填入
(打開紅包卡券頁,9.17.0及以上版本);
(打開訂單詳情頁小程序跳轉到淘客,9.18.0及以上版):需在中填入
(打開訂單列表頁,9.18.0及以上版本);
(打開直播間,9.24.0及以上版本)
注:打開直播間有一個必須條件:店鋪賬號和小程序掛名賬號必須是同一個賬號下小程序跳轉到淘客,才能直接跳轉到直播間
my.tb.navigateToTaobaoPage({
appCode:'shop',
appParams:{
shopId:"180175726",
weexShopTab:"shopindexbar",
weexShopSubTab:"shopindex"
},
success: (res) => {
my.alert({ content: "success - " + res.success })
},
fail: (res) => {
my.alert({ content: "fail - " + res.error })
}
});
2.外鏈為淘寶商品詳情:
my.tb.
my.tb.openDetail ({
itemId: "576308890723",
success: (res) => {
my.alert({ content: "success" });
},
fail: (res) => {
my.alert({ content: "fail - " + res.error });
},
});
3.外鏈為小程序:
my.m
my.navigateToMiniProgram({
appId: 'xxxx',
extraData:{
"data1":"test"
},
success: (res) => {
console.log(JSON.stringify(res))
},
fail: (res) => {
console.log(JSON.stringify(res))
}
});
4.外鏈為h5:
只能使用web-view將h5頁面嵌入小程序
<web-view src="https://render.alipay.com/p/s/web-view/index" onMessage="onmessage"></web-view>
注:嵌入鏈接是否成功,需要在手機端調試,模擬器一般不會報錯,鏈接有問題的話在手機上才會顯示