Files
yshopb2c-uniapp/libs/wechat.js

22 lines
566 B
JavaScript
Raw Normal View History

2020-03-15 13:59:43 +08:00
// 支付模块
export const weappPay = (option) => {
return new Promise((resolve, reject) => {
2020-04-06 17:18:09 +08:00
// 吊起微信支付
console.log(option,9999)
2020-03-18 19:01:12 +08:00
uni.requestPayment({
2020-03-15 13:59:43 +08:00
...option,
timeStamp: option.timeStamp + '',
success: (success) => {
2020-03-16 01:40:52 +08:00
uni.showToast({
2020-03-15 13:59:43 +08:00
title: '支付成功', icon: 'success', duration: 2000
});
resolve(success)
},
fail: (error) => {
2020-03-16 01:40:52 +08:00
uni.showToast({ title: '支付失败', icon: 'none', duration: 2000 });
2020-03-15 13:59:43 +08:00
reject(error)
}
})
})
}