let authUrl = `alipays://platformapi/startapp?appId=20000067&url=${encodeURIComponent( res.data )}`; console.log(authUrl); if (uni.getSystemInfoSync().platform == "ios") { authUrl = `alipay://platformapi/startapp?appId=20000067&url=${encodeURIComponent( res.data )}`; } plus.runtime.openURL(authUrl, function (res) { uni.showToast({ icon: "none", title: "请安装支付宝之后再进行支付!", }); });
注意:ios上支付宝的自定义协议是alipay Android上支付宝的自定义协议是alipays