f527b6cd by 张猛

支付

1 parent 7caf72e2
......@@ -250,7 +250,8 @@ export function insertSinglePay(data) {
return request({
url: '/person/paymentNew/insertSinglePay',
method: 'post',
params: data
params: data,
showLoading: false
})
}
......@@ -1541,6 +1542,7 @@ export function certifiedNew(renewYear) {
return request({
url: `/system/certifiedNew/commit?renewYear=${renewYear}`,
method: 'post',
showLoading: false
})
}
......@@ -1629,7 +1631,8 @@ export function getMyStatus() {
export function goPay(id, payType) {
return request({
url: `/person/paymentRangeNew/pay/${id}/${payType}`,
method: 'post'
method: 'post',
showLoading: false
})
}
......@@ -1839,7 +1842,8 @@ export function commitJiExam(params) {
return request({
url: `/exam/info/commitJi/${params.id}/${params.addresId}/${params.payType}`,
method: 'post',
params
params,
showLoading: false
})
}
......
......@@ -31,6 +31,7 @@ async function minShengPay(orderId, encryptedData) {
title: '生成支付...',
mask: true
})
console.log(1111)
// 参数校验
if (!orderId) {
......@@ -219,7 +220,6 @@ function invokeWechatPayment(payParams, orderId) {
})
},
fail: async (err) => {
debugger
// 用户取消支付
if (err.errMsg?.includes('cancel')) {
await handleUserCancel(orderId)
......
// dev
// const baseUrl_api = 'http://192.168.1.137:8787'
const baseUrl_api = 'http://tk001.wxjylt.com/stage-api'
const baseUrl_api = 'http://192.168.1.137:8787'
// const baseUrl_api = 'http://tk001.wxjylt.com/stage-api'
const loginImage_api = 'http://tk001.wxjylt.com/stage-api'
const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
......
......@@ -213,13 +213,16 @@ const handleSubmit = async () => {
content: `确定提交订单吗?`,
success: async (res) => {
if (res.confirm) {
uni.showLoading({title: '提交中...'});
uni.showLoading({
title: '支付中...',
mask: true
})
try {
const commitRes = await api.commitJiExam({
addresId: selectedAddress.value.id,
id: examId.value,
payType: '2'
});
})
if (commitRes.data && commitRes.data.payResult.encryptedData) {
const res = await minShengPay(commitRes.data.orderId, commitRes.data.payResult.encryptedData)
if (res == 'OK') {
......@@ -233,44 +236,6 @@ const handleSubmit = async () => {
}
}
// if (commitRes.data && commitRes.data.orderId) {
// // 有支付流程,调用支付
// const payRes = await api.payJiExam(commitRes.data.orderId);
// uni.hideLoading();
//
// if (payRes.data && payRes.data.payResult && payRes.data.payResult.encryptedData) {
// // 调用支付
// uni.requestPayment({
// provider: 'wxpay',
// timeStamp: payRes.data.payResult.timeStamp,
// nonceStr: payRes.data.payResult.nonceStr,
// package: payRes.data.payResult.package,
// signType: payRes.data.payResult.signType,
// paySign: payRes.data.payResult.paySign,
// success: () => {
// uni.showToast({title: '支付成功', icon: 'success'});
// setTimeout(() => {
// uni.navigateBack();
// }, 1500);
// },
// fail: () => {
// uni.showToast({title: '支付失败', icon: 'none'});
// }
// });
// } else {
// // 无需支付,直接成功
// uni.showToast({title: '提交成功', icon: 'success'});
// setTimeout(() => {
// uni.navigateBack();
// }, 1500);
// }
// } else {
// uni.hideLoading();
// uni.showToast({title: '提交成功', icon: 'success'});
// setTimeout(() => {
// uni.navigateBack();
// }, 1500);
// }
} catch (e) {
uni.hideLoading();
console.error('提交失败', e);
......
......@@ -108,7 +108,7 @@ async function handlePay() {
try {
payLoading.value = true
uni.showToast({
uni.showLoading({
title: '支付中...',
mask: true
})
......@@ -134,6 +134,7 @@ async function handlePay() {
// 跳转到支付成功页
} catch (err) {
console.log(err)
const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试'
uni.showToast({
title: errMsg,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!