支付宝支付

This commit is contained in:
唐明明
2021-10-28 14:15:47 +08:00
parent 89cb4bea28
commit bd50ffcf4d
41 changed files with 872 additions and 765 deletions

57
public/cashierPay.js Normal file
View File

@@ -0,0 +1,57 @@
/**
* Web唐明明
* 匆匆数载恍如梦,岁月迢迢华发增。
* 碌碌无为枉半生,一朝惊醒万事空。
* moduleName: 收银
*/
class cashierPay{
constructor() {
}
pay(platform, orderInfo){
if(!platform){
uni.showToast({
title: '缺少必要参数:支付平台类型',
icon : 'none'
})
return
}
if(!orderInfo){
uni.showToast({
title: '缺少必要参数:支付参数不能为空',
icon : 'none'
})
return
}
return new Promise((resolve, reject) => {
console.log(platform)
console.log(orderInfo)
uni.requestPayment({
provider : platform,
orderInfo : orderInfo,
success : payRes => {
uni.showModal({
title : "开通提示",
content : "支付成功,已成功开通/升级节点身份",
showCancel : false,
success : ()=> {
resolve(payRes)
}
})
},
fail : payErr => {
reject(payErr)
uni.showToast({
title: '支付被取消',
icon : 'none'
})
}
})
})
}
}
export default new cashierPay();