前端 请求 是这样写的 但是有问题 不知道哪里不对
wx.request({
url: 'http://localhost/index.php',
method: "POST",
data: {
total_fee: total_fee,
code: code,
},
header: {
'content-type': 'application/x-www-form-urlencoded' // 默认值
},
success: function (res) { //后端返回的数据
var data = res.data;
console.log(data);
console.log(data["timeStamp"]);
wx.requestPayment({
timeStamp: data['timeStamp'],
nonceStr: data['nonceStr'],
package: data['package'],
signType: data['signType'],
paySign: data['paySign'],
success: function (res) {
wx.showModal({
title: '支付成功',
content: '',
})
},
fail: function (res) {
console.log(res);
}
})
}
});