uni.request({
url:"http://api.yiyougugame.com/order/wanbang/create_order",
data:{
"user_name": '',
"address": "",
"phone": "",
"price": "0.01",
"over_time": "",
"order_info": "",
"pic": "",
"order_remarks": "",
"order_type": "99",
"order_fu_wu_type": "",
"sound": "",
"token": "",
"x": "",
"y": "",
"fu_wu_dis": "",
"avatar": ""
},
method:'POST',
header: {
'content-type': 'application/x-www-form-urlencoded',
'Authorization':
},
success(res) {
console.log(res);
let payment = res.data.data;
var orderInfo = {
'appid':payment.wxscp.Appid,
'timeStamp': payment.time_stamp,
'nonceStr': payment.wxscp.NonceStr,
'package': 'Sign=WXPay',
'partnerid': 1516510351,
'prepayid': payment.wxscp.PrepayId,
'signType': 'MD5',
'sign': payment.pay_sign
}
uni.requestPayment({
'provider': 'wxpay',
'timeStamp': JSON.stringify(payment.time_stamp),
'nonceStr': payment.wxscp.NonceStr,
'package': 'Sign=WXPay', //
'signType': 'MD5',
'paySign': payment.pay_sign,
'orderInfo': orderInfo,
success: function(res) {
console.log('success:' + JSON.stringify(res));
uni.showToast({
title:"充值成功"
})
},
fail: function(err) {
console.log('fail:' + JSON.stringify(err));
var fail = JSON.stringify(err)
uni.showToast({
title:"充值失败,请重新充值",
icon:"none"
})
}
});
}
})
1***@163.com
- 发布:2019-09-19 10:37
- 更新:2019-09-19 10:38
- 阅读:1828
微信支付详细完整案例
分类:uni-app
1 个回复
1***@163.com (作者)
现在一直报-1