feat(j提现转账的返回功能): 将相关页面的返回功能都设置成可携带参数返回

This commit is contained in:
hzj 2025-11-14 16:07:36 +08:00
parent d1347f8bcc
commit b781f2810e
7 changed files with 92 additions and 18 deletions

View File

@ -88,42 +88,61 @@
<script setup>
import { isInApp, closePage } from '@/utils/appBridge.js'
import { useRouter, useRoute } from 'vue-router'
import { computed, ref, onMounted, watch } from 'vue'
import { computed, ref, onMounted, watch, nextTick } from 'vue'
import { useLangStore } from '@/stores/lang'
import { setLocale } from '@/locales/i18n'
// props
const props = defineProps({
//
title: {
type: String,
required: true,
},
//
showBack: {
type: Boolean,
default: true,
},
//
showHelp: {
type: Boolean,
default: false,
},
//
isHomePage: {
type: Boolean,
default: false,
},
//
showLanguageList: {
type: Boolean,
default: false,
},
//
color: {
type: String,
default: '#fff',
},
//
backImg: {
type: String,
default: () => {
return new URL('../assets/icon/arrowBack.png', import.meta.url).href
},
},
//
backQuery: {
type: Object,
default: null,
},
})
// emits
@ -180,10 +199,24 @@ const handleBack = () => {
if (isCurrentlyHomePage.value && isInApp()) {
// APP
console.log('home back')
closePage() //
closePage()
} else {
//
router.go(-1)
if (props.backQuery != null) {
console.log('props.backQuery', props.backQuery)
// 使 nextTick
nextTick(() => {
// 使 replace
router.replace({
path: props.backQuery.from,
query: {
activeAction: props.backQuery.activeAction,
},
})
})
}
}
}

View File

@ -1074,7 +1074,7 @@ const clearPayee = () => {
//
const searchPayee = () => {
router.push({ path: '/search-payee', query: { from: 'lottery' } })
router.push('/search-payee')
}
//

View File

@ -896,12 +896,15 @@ const fetchBankBalance = async () => {
//
const gotoKYC = () => {
router.push('/KYC')
router.push({ path: '/KYC', query: { from: '/available-income', activeAction: 'Cash out' } })
}
//
const gotoselectBank = () => {
router.push('/bank-card')
router.push({
path: '/bank-card',
query: { from: '/available-income', activeAction: 'Cash out' },
})
}
//
@ -911,7 +914,10 @@ const showDetails = () => {
//
const searchPayee = () => {
router.push({ path: '/search-payee', query: { searchType: 'TRANSFER' } })
router.push({
path: '/search-payee',
query: { from: '/available-income', activeAction: 'Transfer' },
})
}
//

View File

@ -1,6 +1,12 @@
<template>
<div class="fullPage">
<GeneralHeader style="width: 100%" title="Bank Card" :showLanguageList="true" color="black" />
<GeneralHeader
style="width: 100%"
title="Bank Card"
:showLanguageList="true"
color="black"
:backQuery="backQuery"
/>
<div style="padding: 16px; display: flex; flex-direction: column; gap: 8px">
<!-- 当前使用的银行卡 -->
<div style="font-weight: 600">Currently In Use</div>
@ -312,6 +318,7 @@
<script setup>
import { useI18n } from 'vue-i18n'
import { ref, onMounted, computed } from 'vue'
import GeneralHeader from '@/components/GeneralHeader.vue'
import { showError, showWarning, showInfo, showSuccess } from '@/utils/toast.js'
import { getUserId } from '@/utils/userStore'
import {
@ -322,6 +329,10 @@ import {
useBankCard,
} from '@/api/wallet'
import maskLayer from '@/components/MaskLayer.vue'
import { useRoute } from 'vue-router'
const route = useRoute()
const backQuery = ref(route.query || null)
const { t } = useI18n()

View File

@ -1,6 +1,12 @@
<template>
<div class="fullPage">
<GeneralHeader style="width: 100%" :title="t('kyc')" :showLanguageList="true" color="black" />
<GeneralHeader
style="width: 100%"
:title="t('kyc')"
:showLanguageList="true"
color="black"
:backQuery="backQuery"
/>
<div style="padding: 16px; display: flex; flex-direction: column; gap: 8px">
<!-- 银行卡号 -->
@ -191,9 +197,9 @@
import { isInApp } from '@/utils/appBridge.js'
import { useI18n } from 'vue-i18n'
import GeneralHeader from '@/components/GeneralHeader.vue'
import { ref, onMounted, computed } from 'vue'
import { ref, onMounted, computed, nextTick } from 'vue'
import { showError, showWarning, showInfo, showSuccess } from '@/utils/toast.js'
import { useRouter } from 'vue-router'
import { useRoute, useRouter } from 'vue-router'
import { uploadImg } from '@/api/upload.js'
import { setDocumentDirection } from '@/locales/i18n'
import { getWithdrawInfoList, addWithdrawInfo, updateWithdrawInfo } from '@/api/wallet'
@ -203,6 +209,8 @@ import { storeToRefs } from 'pinia'
const { t, locale } = useI18n()
const router = useRouter()
const route = useRoute()
const backQuery = ref(route.query || null)
const lastImgStore = useLastImgStore()
// localStorage
lastImgStore.initFromStorage()
@ -359,7 +367,24 @@ const Submit = () => {
console.log('添加信息:', applyInfo.value)
addWithdrawInfoData()
}
// router.go(-1)
// availableIncome ()
router.go(-1)
// availableIncome
if (route.query) {
console.log('route.query:', route.query)
// 使 nextTick
nextTick(() => {
// 使 replace
router.replace({
path: route.query.from,
query: {
activeAction: route.query.activeAction,
},
})
})
}
}
}
@ -386,7 +411,7 @@ const addWithdrawInfoData = async () => {
const resAddWithdrawInfo = await addWithdrawInfo(applyInfo.value)
if (resAddWithdrawInfo.status) {
showSuccess(t('application_submitted'))
getWithdrawInfoListData() //
// getWithdrawInfoListData() //
}
} catch (error) {
showError(error.response?.errorMsg)
@ -400,7 +425,7 @@ const updateWithdrawInfoData = async () => {
const resUpdateWithdrawInfo = await updateWithdrawInfo(applyInfo.value)
if (resUpdateWithdrawInfo.status) {
showSuccess(t('application_submitted'))
getWithdrawInfoListData() //
// getWithdrawInfoListData() //
}
} catch (error) {
showError(error.response?.errorMsg)

View File

@ -7,6 +7,7 @@
:showLanguageList="true"
color="black"
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
:backQuery="backQuery"
/>
<div class="content">
@ -233,6 +234,7 @@ import { setDocumentDirection } from '@/locales/i18n'
const { t, locale } = useI18n()
const router = useRouter()
const route = useRoute()
const backQuery = ref(route.query || null)
//
locale.value && setDocumentDirection(locale.value)
@ -291,10 +293,7 @@ const performSearch = async () => {
hasSearched.value = false
try {
const response = await userBankSearchUserProfile(
searchQuery.value.trim(),
route.query?.searchType || ''
)
const response = await userBankSearchUserProfile(searchQuery.value.trim(), 'TRANSFER')
if (response.status && response.body) {
// API

View File

@ -297,7 +297,7 @@ const showDetails = () => {
}
const searchPayee = () => {
router.push({ path: '/search-payee', query: { searchType: 'TRANSFER' } })
router.push('/search-payee')
}
//