uni.request({
url: this.global.url + "/api/user/recharge",
method: "POST",
header: {
'content-type': 'application/x-www-form-urlencoded'
},
data: {
token: uni.getStorageSync("token").token,
paytype: that.activeRadio,
// #ifdef H5
method: "wap",
// #endif
// #ifdef APP-PLUS
method: "app",
// #endif
money: that.moy,
},
success: (res) => {
if (res.data.code == 1) {
// #ifdef H5
let divForm = document.getElementsByTagName('divform')
if (divForm.length) {
document.body.removeChild(divForm[0])
}
const div = document.createElement('divform')
div.innerHTML = res.data.data // res.data就是sb支付宝返回给你的form
document.body.appendChild(div)
// document.forms[0].setAttribute('target', '_blank') // 加了_blank可能出问题所以我注释了
document.getElementById('alipay_submit').submit()
// #endif
// #ifdef APP-PLUS
uni.requestPayment({
provider: that.activeRadio,
orderInfo: res.data.data,
success: function(res) {}
});
// #endif
}
}
})
vue h5支付宝支付 假设接口
最新推荐文章于 2025-06-05 07:23:59 发布