**
充值
**
// 充值
data: {
amount:" "
},
pay() {
let t = this;
let amount = t.data.money;
let openid = wx.getStorageSync("openId");
let url = "接口地址";
A.post(url, { // 自己在app.js封装的一个方法
amount: amount,
openid: openid
}, "post").then(r => {
console.log(r, 'r');
// 发起微信支付
wx.requestPayment({
timeStamp: r.timeStamp,
nonceStr: r.nonceStr,
package: r.package,
signType: r.signType,
paySign: r.paySign,
success(res) {
wx.showToast({
title: '充值成功',
icon: "success",
duration: 2000, //持续的时间
})
setTimeout(function() {
wx.navigateTo({
url: '/pa