赞
踩
相关文档:uni.requestPayment(OBJECT) | uni-app官网
示例代码:
- import qs from 'qs'
-
- async aliPay(){
- const { provider } = await uni.getProvider({ service:'payment' })
- if(provider.includes('alipay')){
- uni.request({
- url:'后端接口地址',
- data:{ //传参 },
- success(res){
- let data = res.data.data
- uni.requestPayment({
- provider: 'alipay',
- orderInfo: qs.stringify(data), //支付宝
- //orderInfo: data, //支付宝
- success: function (res) {
- console.log('success:' + JSON.stringify(res));
- },
- fail: function (err) {
- console.log('fail:' + JSON.stringify(err));
- }
- });
- }
- })
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。