Basic library version 2.7.20 or later, it is recommended to use my.ap.openURL
to jump, the case is as follows:
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,
});
}
});
For a lower version of the basic library, such as 1.25.4, openURL cannot jump, it is recommended to use my.ap.navigateToAlipayPage
to jump, the case is as follows:
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,
});
}
});