代码如下:
function wxpay(opt) {
return new Promise(function (resolve, reject) {
var params = {
timeStamp: opt.timeStamp,
// 支付签名时间戳,注意微信jssdk中的所有使用timestamp字段均为小写。但最新版的支付后台生成签名使用的timeStamp字段名需大写其中的S字符
nonceStr: opt.nonceStr,
// 支付签名随机串,不长于 32 位
package: opt.package,
// 统一支付接口返回的prepay_id参数值,提交格式如:prepay_id=***)
signType: opt.signType,
// 签名方式,默认为'SHA1',使用新版支付需传入'MD5'
paySign: opt.paySign };
console.log(params);
uni.requestPayment(_objectSpread(_objectSpread({
provider: 'wxpay' },
params), {}, {
success: function success(res) {
resolve();
},
cancel: function cancel(res) {
reject();
},
fail: function fail(res) {
reject();
} }));
});
}
{timeStamp: undefined, nonceStr: undefined, package: undefined, signType: undefined, paySign: undefined}
nonceStr: undefined
package: undefined
paySign: undefined
signType: undefined
timeStamp: undefined
__proto__: Object