function wxPay(that,orderId, amount,description) {
let url = '';
that.$api.wxPay({
description: description,
//amount*100
amount: amount*100,
orderId: orderId,
notifyUrl: "",
createBy: uni.getStorageSync("login_user_info").id,
wxRecoder: true,
payerClientType: uni.getSystemInfoSync().platform=='ios' || uni.getSystemInfoSync().platform=='IOS' ? 'iOS' :'Android'
})
.then((res) => {
console.info(res.result, "res.result");
url = res.result;
that.$Router.push({
name: '',
params: {
src: url
}
})
}).catch((err) => {
that.$tip.toast(err.message)
})
}
export default wxPay
uniapp微信支付
最新推荐文章于 2025-05-12 14:47:14 发布
这段代码展示了如何在Vue应用中调用微信支付接口。它首先设置了支付的相关参数,如金额、订单号和商品描述,然后调用$api.wxPay方法发起支付请求。成功后,获取支付链接并跳转到支付页面。
1万+

被折叠的 条评论
为什么被折叠?



