f527b6cd by 张猛

支付

1 parent 7caf72e2
...@@ -250,7 +250,8 @@ export function insertSinglePay(data) { ...@@ -250,7 +250,8 @@ export function insertSinglePay(data) {
250 return request({ 250 return request({
251 url: '/person/paymentNew/insertSinglePay', 251 url: '/person/paymentNew/insertSinglePay',
252 method: 'post', 252 method: 'post',
253 params: data 253 params: data,
254 showLoading: false
254 }) 255 })
255 } 256 }
256 257
...@@ -1541,6 +1542,7 @@ export function certifiedNew(renewYear) { ...@@ -1541,6 +1542,7 @@ export function certifiedNew(renewYear) {
1541 return request({ 1542 return request({
1542 url: `/system/certifiedNew/commit?renewYear=${renewYear}`, 1543 url: `/system/certifiedNew/commit?renewYear=${renewYear}`,
1543 method: 'post', 1544 method: 'post',
1545 showLoading: false
1544 }) 1546 })
1545 } 1547 }
1546 1548
...@@ -1629,7 +1631,8 @@ export function getMyStatus() { ...@@ -1629,7 +1631,8 @@ export function getMyStatus() {
1629 export function goPay(id, payType) { 1631 export function goPay(id, payType) {
1630 return request({ 1632 return request({
1631 url: `/person/paymentRangeNew/pay/${id}/${payType}`, 1633 url: `/person/paymentRangeNew/pay/${id}/${payType}`,
1632 method: 'post' 1634 method: 'post',
1635 showLoading: false
1633 }) 1636 })
1634 } 1637 }
1635 1638
...@@ -1839,7 +1842,8 @@ export function commitJiExam(params) { ...@@ -1839,7 +1842,8 @@ export function commitJiExam(params) {
1839 return request({ 1842 return request({
1840 url: `/exam/info/commitJi/${params.id}/${params.addresId}/${params.payType}`, 1843 url: `/exam/info/commitJi/${params.id}/${params.addresId}/${params.payType}`,
1841 method: 'post', 1844 method: 'post',
1842 params 1845 params,
1846 showLoading: false
1843 }) 1847 })
1844 } 1848 }
1845 1849
......
...@@ -31,6 +31,7 @@ async function minShengPay(orderId, encryptedData) { ...@@ -31,6 +31,7 @@ async function minShengPay(orderId, encryptedData) {
31 title: '生成支付...', 31 title: '生成支付...',
32 mask: true 32 mask: true
33 }) 33 })
34 console.log(1111)
34 35
35 // 参数校验 36 // 参数校验
36 if (!orderId) { 37 if (!orderId) {
...@@ -219,7 +220,6 @@ function invokeWechatPayment(payParams, orderId) { ...@@ -219,7 +220,6 @@ function invokeWechatPayment(payParams, orderId) {
219 }) 220 })
220 }, 221 },
221 fail: async (err) => { 222 fail: async (err) => {
222 debugger
223 // 用户取消支付 223 // 用户取消支付
224 if (err.errMsg?.includes('cancel')) { 224 if (err.errMsg?.includes('cancel')) {
225 await handleUserCancel(orderId) 225 await handleUserCancel(orderId)
......
1 // dev 1 // dev
2 // const baseUrl_api = 'http://192.168.1.137:8787' 2 const baseUrl_api = 'http://192.168.1.137:8787'
3 const baseUrl_api = 'http://tk001.wxjylt.com/stage-api' 3 // const baseUrl_api = 'http://tk001.wxjylt.com/stage-api'
4 const loginImage_api = 'http://tk001.wxjylt.com/stage-api' 4 const loginImage_api = 'http://tk001.wxjylt.com/stage-api'
5 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' 5 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
6 6
......
...@@ -213,13 +213,16 @@ const handleSubmit = async () => { ...@@ -213,13 +213,16 @@ const handleSubmit = async () => {
213 content: `确定提交订单吗?`, 213 content: `确定提交订单吗?`,
214 success: async (res) => { 214 success: async (res) => {
215 if (res.confirm) { 215 if (res.confirm) {
216 uni.showLoading({title: '提交中...'}); 216 uni.showLoading({
217 title: '支付中...',
218 mask: true
219 })
217 try { 220 try {
218 const commitRes = await api.commitJiExam({ 221 const commitRes = await api.commitJiExam({
219 addresId: selectedAddress.value.id, 222 addresId: selectedAddress.value.id,
220 id: examId.value, 223 id: examId.value,
221 payType: '2' 224 payType: '2'
222 }); 225 })
223 if (commitRes.data && commitRes.data.payResult.encryptedData) { 226 if (commitRes.data && commitRes.data.payResult.encryptedData) {
224 const res = await minShengPay(commitRes.data.orderId, commitRes.data.payResult.encryptedData) 227 const res = await minShengPay(commitRes.data.orderId, commitRes.data.payResult.encryptedData)
225 if (res == 'OK') { 228 if (res == 'OK') {
...@@ -233,44 +236,6 @@ const handleSubmit = async () => { ...@@ -233,44 +236,6 @@ const handleSubmit = async () => {
233 } 236 }
234 } 237 }
235 238
236 // if (commitRes.data && commitRes.data.orderId) {
237 // // 有支付流程,调用支付
238 // const payRes = await api.payJiExam(commitRes.data.orderId);
239 // uni.hideLoading();
240 //
241 // if (payRes.data && payRes.data.payResult && payRes.data.payResult.encryptedData) {
242 // // 调用支付
243 // uni.requestPayment({
244 // provider: 'wxpay',
245 // timeStamp: payRes.data.payResult.timeStamp,
246 // nonceStr: payRes.data.payResult.nonceStr,
247 // package: payRes.data.payResult.package,
248 // signType: payRes.data.payResult.signType,
249 // paySign: payRes.data.payResult.paySign,
250 // success: () => {
251 // uni.showToast({title: '支付成功', icon: 'success'});
252 // setTimeout(() => {
253 // uni.navigateBack();
254 // }, 1500);
255 // },
256 // fail: () => {
257 // uni.showToast({title: '支付失败', icon: 'none'});
258 // }
259 // });
260 // } else {
261 // // 无需支付,直接成功
262 // uni.showToast({title: '提交成功', icon: 'success'});
263 // setTimeout(() => {
264 // uni.navigateBack();
265 // }, 1500);
266 // }
267 // } else {
268 // uni.hideLoading();
269 // uni.showToast({title: '提交成功', icon: 'success'});
270 // setTimeout(() => {
271 // uni.navigateBack();
272 // }, 1500);
273 // }
274 } catch (e) { 239 } catch (e) {
275 uni.hideLoading(); 240 uni.hideLoading();
276 console.error('提交失败', e); 241 console.error('提交失败', e);
......
...@@ -108,7 +108,7 @@ async function handlePay() { ...@@ -108,7 +108,7 @@ async function handlePay() {
108 108
109 try { 109 try {
110 payLoading.value = true 110 payLoading.value = true
111 uni.showToast({ 111 uni.showLoading({
112 title: '支付中...', 112 title: '支付中...',
113 mask: true 113 mask: true
114 }) 114 })
...@@ -134,6 +134,7 @@ async function handlePay() { ...@@ -134,6 +134,7 @@ async function handlePay() {
134 // 跳转到支付成功页 134 // 跳转到支付成功页
135 135
136 } catch (err) { 136 } catch (err) {
137 console.log(err)
137 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试' 138 const errMsg = err?.data?.msg || err?.message || '支付失败,请稍后重试'
138 uni.showToast({ 139 uni.showToast({
139 title: errMsg, 140 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!