在h5页面打开支付宝小程序页面
const appId = '123456' // 小程序appid
const page = 'pages/index/index' // 跳转页面(注意:pages前面不用/)
const query = 'id=1&name=图图我呀' // 查询参数
// 支付宝小程序内地址
const platformUrl = `alipays://platformapi/startapp?appId=${appId}&page=${page}&query=${query}`;
// 跳转地址需要 encodeURIComponent
const encodePlatformUrl = encodeURIComponent(platformUrl)
// 完整地址(浏览器中打开)
const href = `https://ds.alipay.com/?scheme=${encodePlatformUrl}`
location.href = href
文档 https://opendocs.alipay.com/support/01rb6e