feat:支付

This commit is contained in:
dzc committed 2025-12-11 11:19:48 +08:00
1 parent 056594e809
commit 184ba62d6f
6 files changed
+621 -186

No files matched your search

+7 -11
View File
@@ -150,9 +150,8 @@ export default class SheepPay {
async wechatWapPay() {
const { error, data } = await this.prepay();
if (error === 0) {
const redirect_url = `${getRootUrl()}pages/pay/result?id=${this.id}&payment=${
this.payment
}&orderType=${this.orderType}`;
const redirect_url = `${getRootUrl()}pages/pay/result?id=${this.id}&payment=${this.payment
}&orderType=${this.orderType}`;
location.href = `${data.pay_data.h5_url}&redirect_url=${encodeURIComponent(redirect_url)}`;
}
}
@@ -265,13 +264,13 @@ export default class SheepPay {
// 解析支付参数
let payConfig = JSON.parse(data.displayContent);
if(typeof payConfig.appId === 'undefined'){
if (typeof payConfig.appId === 'undefined') {
payConfig.appId = payConfig.appid;
}
if(typeof payConfig.nonceStr === 'undefined'){
if (typeof payConfig.nonceStr === 'undefined') {
payConfig.nonceStr = payConfig.noncestr;
}
if(typeof payConfig.timeStamp === 'undefined'){
if (typeof payConfig.timeStamp === 'undefined') {
payConfig.timeStamp = payConfig.timestamp;
}
// 调用微信支付
@@ -378,11 +377,8 @@ export function getPayMethods(channels) {
// 支付结果跳转,success:成功,fail:失败
export function goPayResult(id, orderType, resultType) {
sheep.$router.redirect('/pages/pay/result', {
id,
orderType,
payState: resultType,
});
const url = `/pages/pay/result?id=${id}&orderType=${orderType}&payState=${resultType}`;
uni.redirectTo({ url: url })
}
export function goBindWeixin() {