mirror of
https://gitee.com/bootx/dax-pay-h5
synced 2026-08-09 06:26:00 +08:00
fix 一些接口调用错误和跳转错误问题
This commit is contained in:
@@ -90,6 +90,14 @@ export const DaxPayH5Route: RouteRecordRaw = {
|
||||
title: '成功提示',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/success',
|
||||
name: 'SuccessResult',
|
||||
component: () => import('@/views/daxpay/h5/result/SuccessResult.vue'),
|
||||
meta: {
|
||||
title: '操作成功',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/payFail',
|
||||
name: 'payFail',
|
||||
|
||||
@@ -287,7 +287,7 @@ function jsapiPay(data: WxJsapiSignResult) {
|
||||
if (res.err_msg === 'get_brand_wcpay_request:ok') {
|
||||
// 跳转到成功页面
|
||||
router.replace({
|
||||
path: '/paySuccess',
|
||||
name: 'PaySuccess',
|
||||
query: { title: '支付成功', orderNo },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ function jsapiPay(data: WxJsapiSignResult) {
|
||||
if (res.err_msg === 'get_brand_wcpay_request:ok') {
|
||||
// 跳转到成功页面
|
||||
router.replace({
|
||||
path: '/paySuccess',
|
||||
name: 'PaySuccess',
|
||||
query: { title: '支付成功' },
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ export function findAllProvinceAndCityAndArea() {
|
||||
*/
|
||||
export function submit(id, sign, headers) {
|
||||
return http.request({
|
||||
url: '/onb/mch/apply/submit',
|
||||
url: '/onb/mch/apply/h5/submit',
|
||||
method: 'post',
|
||||
params: { id, sign },
|
||||
headers,
|
||||
|
||||
@@ -40,7 +40,7 @@ export function save(param: MerchantApply, sign, headers) {
|
||||
export function mccTree() {
|
||||
return http.request<Result<MccConst[]>>({
|
||||
method: 'get',
|
||||
url: '/leshua/mcc/tree',
|
||||
url: '/hkrt/mcc/tree',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -719,8 +719,15 @@ function saveTemp() {
|
||||
function submitClick() {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
loading.value = true
|
||||
// 执行下一步操作
|
||||
await save(form.value, sign, headers).then(({ code, msg }) => {
|
||||
if (code !== 0) {
|
||||
showNotify({ type: 'danger', message: msg })
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
submit(form.value.applyId, sign, headers).then(({ code, data }) => {
|
||||
if (code !== 0) {
|
||||
showNotify({ type: 'danger', message: data })
|
||||
@@ -728,7 +735,7 @@ function submitClick() {
|
||||
loading.value = false
|
||||
// 跳转到成功页面
|
||||
router.replace({
|
||||
path: '/paySuccess',
|
||||
name: 'SuccessResult',
|
||||
query: { title: '提交申请成功' },
|
||||
})
|
||||
})
|
||||
|
||||
@@ -686,7 +686,15 @@ function saveTemp() {
|
||||
function submitClick() {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
loading.value = true
|
||||
// 执行下一步操作
|
||||
await save(form.value, sign, headers).then(({ code, msg }) => {
|
||||
if (code !== 0) {
|
||||
showNotify({ type: 'danger', message: msg })
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
// 执行下一步操作
|
||||
submit(form.value.applyId, sign, headers).then(({ code, data }) => {
|
||||
if (code !== 0) {
|
||||
@@ -695,7 +703,7 @@ function submitClick() {
|
||||
loading.value = false
|
||||
// 跳转到成功页面
|
||||
router.replace({
|
||||
path: '/paySuccess',
|
||||
name: 'SuccessResult',
|
||||
query: { title: '提交申请成功' },
|
||||
})
|
||||
})
|
||||
|
||||
@@ -808,7 +808,15 @@ function saveTemp() {
|
||||
function submitClick() {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
.then(async () => {
|
||||
loading.value = true
|
||||
// 执行下一步操作
|
||||
await save(form.value, sign, headers).then(({ code, msg }) => {
|
||||
if (code !== 0) {
|
||||
showNotify({ type: 'danger', message: msg })
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
// 执行下一步操作
|
||||
submit(form.value.applyId, sign, headers).then(({ code, data }) => {
|
||||
if (code !== 0) {
|
||||
@@ -817,7 +825,7 @@ function submitClick() {
|
||||
loading.value = false
|
||||
// 跳转到成功页面
|
||||
router.replace({
|
||||
path: '/paySuccess',
|
||||
name: 'SuccessResult',
|
||||
query: { title: '提交申请成功' },
|
||||
})
|
||||
})
|
||||
|
||||
101
src/views/daxpay/h5/result/SuccessResult.vue
Normal file
101
src/views/daxpay/h5/result/SuccessResult.vue
Normal file
@@ -0,0 +1,101 @@
|
||||
<template>
|
||||
<div class="payFail">
|
||||
<div class="payLogo">
|
||||
<img v-if="isWeiPay === 'wei'" src="@/assets/images/weiSuccess.png" alt="">
|
||||
<img v-else src="@/assets/images/success1.png" alt="">
|
||||
<p>{{ title ? title : "操作成功" }}</p>
|
||||
<span>{{ msg ? msg : "" }}</span>
|
||||
</div>
|
||||
<div class="payBtnBox" @click="closeClick">
|
||||
关闭
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from 'vue-router'
|
||||
import { getBrowserUA } from '@/utils/uaUtil'
|
||||
// 获取路由参数
|
||||
const route = useRoute()
|
||||
const { msg, title } = route.query
|
||||
const isWeiPay = ref<string>()
|
||||
|
||||
// 点击关闭
|
||||
function closeClick() {
|
||||
try {
|
||||
WeixinJSBridge.call('closeWindow')
|
||||
}
|
||||
catch {
|
||||
|
||||
}
|
||||
try {
|
||||
AlipayJSBridge.call('closeWebview')
|
||||
}
|
||||
catch {}
|
||||
try {
|
||||
window.close()
|
||||
}
|
||||
catch {
|
||||
}
|
||||
}
|
||||
const ua = getBrowserUA()
|
||||
if (ua === 'wechat') {
|
||||
isWeiPay.value = 'wei'
|
||||
}
|
||||
else {
|
||||
isWeiPay.value = 'zhi'
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.payFail {
|
||||
padding: 3.5rem 0rem;
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
background-color: light-dark(#fff, --van-gray-8);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 3rem;
|
||||
position: relative;
|
||||
|
||||
.payLogo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.25rem;
|
||||
align-items: center;
|
||||
transform: translateY(-50%);
|
||||
|
||||
img {
|
||||
width: 3.125rem;
|
||||
height: 3.125rem;
|
||||
}
|
||||
|
||||
p {
|
||||
font-size: 1.5rem;
|
||||
color: #0d6eff;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
span {
|
||||
letter-spacing: 2px;
|
||||
font-size: 0.875rem;
|
||||
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
|
||||
}
|
||||
}
|
||||
|
||||
.payBtnBox {
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
background-color: #0d6eff;
|
||||
color: #fff;
|
||||
height: 3.25rem;
|
||||
position: absolute;
|
||||
bottom: 3.75rem;
|
||||
text-align: center;
|
||||
line-height: 3.25rem;
|
||||
border-radius: 0.625rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user