基本ライブラリ バージョン 2.7.20 以降では、my.ap.openURL
次のような場合にジャンプするために使用することをお勧めします。
my.ap.openURL({
url: 'https://render.alipay.com/p/404',
success: (res) => {
my.showToast({
type: 'success',
content: '跳转成功',
duration: 3000,
});
},
fail: (err) => {
my.showToast({
type: 'exception',
content: '跳转失败',
duration: 3000,
});
}
});
1.25.4 などの基本ライブラリの下位バージョンの場合、openURL はジャンプできません。ジャンプするために使用することをお勧めしますmy.ap.navigateToAlipayPage
。ケースは次のとおりです。
my.ap.navigateToAlipayPage({
path: 'https://render.alipay.com/p/404',
success: (res) => {
my.showToast({
type: 'success',
content: '跳转成功',
duration: 3000,
});
},
fail: (err) => {
my.showToast({
type: 'exception',
content: '跳转失败',
duration: 3000,
});
}
});