feat(j提现转账的返回功能): 将相关页面的返回功能都设置成可携带参数返回
This commit is contained in:
parent
d1347f8bcc
commit
b781f2810e
@ -88,42 +88,61 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { isInApp, closePage } from '@/utils/appBridge.js'
|
import { isInApp, closePage } from '@/utils/appBridge.js'
|
||||||
import { useRouter, useRoute } from 'vue-router'
|
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 { useLangStore } from '@/stores/lang'
|
||||||
import { setLocale } from '@/locales/i18n'
|
import { setLocale } from '@/locales/i18n'
|
||||||
|
|
||||||
// 定义props
|
// 定义props
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
// 标题
|
||||||
title: {
|
title: {
|
||||||
type: String,
|
type: String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 是否显示返回按钮
|
||||||
showBack: {
|
showBack: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true,
|
default: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 是否显示帮助按钮
|
||||||
showHelp: {
|
showHelp: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 是否为首页
|
||||||
isHomePage: {
|
isHomePage: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 是否显示语言列表
|
||||||
showLanguageList: {
|
showLanguageList: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 标题颜色
|
||||||
color: {
|
color: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '#fff',
|
default: '#fff',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 返回图标
|
||||||
backImg: {
|
backImg: {
|
||||||
type: String,
|
type: String,
|
||||||
default: () => {
|
default: () => {
|
||||||
return new URL('../assets/icon/arrowBack.png', import.meta.url).href
|
return new URL('../assets/icon/arrowBack.png', import.meta.url).href
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 携带参数返回
|
||||||
|
backQuery: {
|
||||||
|
type: Object,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
// 定义emits
|
// 定义emits
|
||||||
@ -180,10 +199,24 @@ const handleBack = () => {
|
|||||||
if (isCurrentlyHomePage.value && isInApp()) {
|
if (isCurrentlyHomePage.value && isInApp()) {
|
||||||
// 首页且在APP中:关闭页面
|
// 首页且在APP中:关闭页面
|
||||||
console.log('home back')
|
console.log('home back')
|
||||||
closePage() // 这个函数似乎未定义,需要确认
|
closePage()
|
||||||
} else {
|
} else {
|
||||||
// 非首页或浏览器环境:正常返回
|
// 非首页或浏览器环境:正常返回
|
||||||
router.go(-1)
|
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,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1074,7 +1074,7 @@ const clearPayee = () => {
|
|||||||
|
|
||||||
// 前往搜索代理页
|
// 前往搜索代理页
|
||||||
const searchPayee = () => {
|
const searchPayee = () => {
|
||||||
router.push({ path: '/search-payee', query: { from: 'lottery' } })
|
router.push('/search-payee')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 前往提现页
|
// 前往提现页
|
||||||
|
|||||||
@ -896,12 +896,15 @@ const fetchBankBalance = async () => {
|
|||||||
|
|
||||||
// 前往提交个人资料
|
// 前往提交个人资料
|
||||||
const gotoKYC = () => {
|
const gotoKYC = () => {
|
||||||
router.push('/KYC')
|
router.push({ path: '/KYC', query: { from: '/available-income', activeAction: 'Cash out' } })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 前往选择提交方式
|
// 前往选择提交方式
|
||||||
const gotoselectBank = () => {
|
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 = () => {
|
const searchPayee = () => {
|
||||||
router.push({ path: '/search-payee', query: { searchType: 'TRANSFER' } })
|
router.push({
|
||||||
|
path: '/search-payee',
|
||||||
|
query: { from: '/available-income', activeAction: 'Transfer' },
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理操作按钮点击
|
// 处理操作按钮点击
|
||||||
|
|||||||
@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="fullPage">
|
<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="padding: 16px; display: flex; flex-direction: column; gap: 8px">
|
||||||
<!-- 当前使用的银行卡 -->
|
<!-- 当前使用的银行卡 -->
|
||||||
<div style="font-weight: 600">Currently In Use</div>
|
<div style="font-weight: 600">Currently In Use</div>
|
||||||
@ -312,6 +318,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import { ref, onMounted, computed } from 'vue'
|
import { ref, onMounted, computed } from 'vue'
|
||||||
|
import GeneralHeader from '@/components/GeneralHeader.vue'
|
||||||
import { showError, showWarning, showInfo, showSuccess } from '@/utils/toast.js'
|
import { showError, showWarning, showInfo, showSuccess } from '@/utils/toast.js'
|
||||||
import { getUserId } from '@/utils/userStore'
|
import { getUserId } from '@/utils/userStore'
|
||||||
import {
|
import {
|
||||||
@ -322,6 +329,10 @@ import {
|
|||||||
useBankCard,
|
useBankCard,
|
||||||
} from '@/api/wallet'
|
} from '@/api/wallet'
|
||||||
import maskLayer from '@/components/MaskLayer.vue'
|
import maskLayer from '@/components/MaskLayer.vue'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
|
const route = useRoute()
|
||||||
|
const backQuery = ref(route.query || null)
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="fullPage">
|
<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">
|
<div style="padding: 16px; display: flex; flex-direction: column; gap: 8px">
|
||||||
<!-- 银行卡号 -->
|
<!-- 银行卡号 -->
|
||||||
@ -191,9 +197,9 @@
|
|||||||
import { isInApp } from '@/utils/appBridge.js'
|
import { isInApp } from '@/utils/appBridge.js'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
import GeneralHeader from '@/components/GeneralHeader.vue'
|
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 { 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 { uploadImg } from '@/api/upload.js'
|
||||||
import { setDocumentDirection } from '@/locales/i18n'
|
import { setDocumentDirection } from '@/locales/i18n'
|
||||||
import { getWithdrawInfoList, addWithdrawInfo, updateWithdrawInfo } from '@/api/wallet'
|
import { getWithdrawInfoList, addWithdrawInfo, updateWithdrawInfo } from '@/api/wallet'
|
||||||
@ -203,6 +209,8 @@ import { storeToRefs } from 'pinia'
|
|||||||
|
|
||||||
const { t, locale } = useI18n()
|
const { t, locale } = useI18n()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const route = useRoute()
|
||||||
|
const backQuery = ref(route.query || null)
|
||||||
const lastImgStore = useLastImgStore()
|
const lastImgStore = useLastImgStore()
|
||||||
// 初始化时从 localStorage 恢复数据
|
// 初始化时从 localStorage 恢复数据
|
||||||
lastImgStore.initFromStorage()
|
lastImgStore.initFromStorage()
|
||||||
@ -359,7 +367,24 @@ const Submit = () => {
|
|||||||
console.log('添加信息:', applyInfo.value)
|
console.log('添加信息:', applyInfo.value)
|
||||||
addWithdrawInfoData()
|
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)
|
const resAddWithdrawInfo = await addWithdrawInfo(applyInfo.value)
|
||||||
if (resAddWithdrawInfo.status) {
|
if (resAddWithdrawInfo.status) {
|
||||||
showSuccess(t('application_submitted'))
|
showSuccess(t('application_submitted'))
|
||||||
getWithdrawInfoListData() // 重新获取提现信息列表
|
// getWithdrawInfoListData() // 重新获取提现信息列表
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showError(error.response?.errorMsg)
|
showError(error.response?.errorMsg)
|
||||||
@ -400,7 +425,7 @@ const updateWithdrawInfoData = async () => {
|
|||||||
const resUpdateWithdrawInfo = await updateWithdrawInfo(applyInfo.value)
|
const resUpdateWithdrawInfo = await updateWithdrawInfo(applyInfo.value)
|
||||||
if (resUpdateWithdrawInfo.status) {
|
if (resUpdateWithdrawInfo.status) {
|
||||||
showSuccess(t('application_submitted'))
|
showSuccess(t('application_submitted'))
|
||||||
getWithdrawInfoListData() // 重新获取提现信息列表
|
// getWithdrawInfoListData() // 重新获取提现信息列表
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showError(error.response?.errorMsg)
|
showError(error.response?.errorMsg)
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
:showLanguageList="true"
|
:showLanguageList="true"
|
||||||
color="black"
|
color="black"
|
||||||
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
|
style="box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); z-index: 999"
|
||||||
|
:backQuery="backQuery"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@ -233,6 +234,7 @@ import { setDocumentDirection } from '@/locales/i18n'
|
|||||||
const { t, locale } = useI18n()
|
const { t, locale } = useI18n()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
const backQuery = ref(route.query || null)
|
||||||
|
|
||||||
// 监听语言变化并设置文档方向
|
// 监听语言变化并设置文档方向
|
||||||
locale.value && setDocumentDirection(locale.value)
|
locale.value && setDocumentDirection(locale.value)
|
||||||
@ -291,10 +293,7 @@ const performSearch = async () => {
|
|||||||
hasSearched.value = false
|
hasSearched.value = false
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await userBankSearchUserProfile(
|
const response = await userBankSearchUserProfile(searchQuery.value.trim(), 'TRANSFER')
|
||||||
searchQuery.value.trim(),
|
|
||||||
route.query?.searchType || ''
|
|
||||||
)
|
|
||||||
|
|
||||||
if (response.status && response.body) {
|
if (response.status && response.body) {
|
||||||
// 根据新的API返回数据结构进行映射
|
// 根据新的API返回数据结构进行映射
|
||||||
|
|||||||
@ -297,7 +297,7 @@ const showDetails = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const searchPayee = () => {
|
const searchPayee = () => {
|
||||||
router.push({ path: '/search-payee', query: { searchType: 'TRANSFER' } })
|
router.push('/search-payee')
|
||||||
}
|
}
|
||||||
|
|
||||||
// 清除当前选中的收款人
|
// 清除当前选中的收款人
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user