f
This commit is contained in:
@@ -87,6 +87,14 @@ const useApiFetch = createFetch({
|
||||
},
|
||||
async afterFetch({ data, response }) {
|
||||
closeToast();
|
||||
|
||||
// 检测会员过期响应头,自动刷新代理信息
|
||||
const membershipExpired = response?.headers?.get?.('X-Membership-Expired');
|
||||
if (membershipExpired === 'true') {
|
||||
const agentStore = useAgentStore();
|
||||
agentStore.fetchAgentStatus();
|
||||
}
|
||||
|
||||
// 全局处理响应
|
||||
if (response.status === 401) {
|
||||
// 清除本地存储的 token
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
累计收益:¥ {{ (data?.total_earnings || 0).toFixed(2) }}
|
||||
</div>
|
||||
<div class="text-sm mb-6 flex items-center" style="color: var(--van-text-color-2);">
|
||||
待结账金额:¥ {{ (data?.frozen_balance || 0).toFixed(2) }}
|
||||
冻结余额:¥ {{ (data?.frozen_balance || 0).toFixed(2) }}
|
||||
<van-popover v-model:show="showTooltip" placement="bottom-start" :offset="10">
|
||||
<template #reference>
|
||||
<van-icon name="question-o" class="ml-2 cursor-help" @mouseenter="showTooltip = true"
|
||||
@mouseleave="showTooltip = false" />
|
||||
</template>
|
||||
<div class="p-2 text-sm" style="max-width: 200px;">
|
||||
待结账金额将在订单创建24小时后自动结账。
|
||||
冻结余额将在订单创建24小时后自动结账。
|
||||
</div>
|
||||
</van-popover>
|
||||
</div>
|
||||
|
||||
@@ -96,7 +96,7 @@ function onConfirmTap() {
|
||||
if (showBalanceWarning.value) {
|
||||
showConfirmDialog({
|
||||
title: '确认注销',
|
||||
message: '您的代理账户仍有余额或待结账金额,注销后将无法通过本账号提现,确定继续注销?',
|
||||
message: '您的代理账户仍有余额或冻结余额,注销后将无法通过本账号提现,确定继续注销?',
|
||||
confirmButtonText: '继续',
|
||||
cancelButtonText: '取消',
|
||||
})
|
||||
@@ -164,10 +164,8 @@ async function submitCancelAccount() {
|
||||
|
||||
<template>
|
||||
<!-- 减导航栏占位高度,避免整页超出视口(与 PageLayout 的 van-nav-bar placeholder 配合) -->
|
||||
<div
|
||||
class="box-border flex flex-col bg-gray-50"
|
||||
style="min-height: calc(100vh - var(--van-nav-bar-height, 46px)); height: calc(100vh - var(--van-nav-bar-height, 46px));"
|
||||
>
|
||||
<div class="box-border flex flex-col bg-gray-50"
|
||||
style="min-height: calc(100vh - var(--van-nav-bar-height, 46px)); height: calc(100vh - var(--van-nav-bar-height, 46px));">
|
||||
<div v-if="loading" class="flex flex-1 items-center justify-center py-20 text-gray-500">
|
||||
加载中...
|
||||
</div>
|
||||
@@ -177,25 +175,19 @@ async function submitCancelAccount() {
|
||||
<AccountCancelAgreement />
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="showAnyReminder"
|
||||
class="flex-shrink-0 space-y-2 border-t border-gray-100 bg-gray-50 px-4 py-3"
|
||||
>
|
||||
<div
|
||||
v-if="showBalanceWarning"
|
||||
class="rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-900"
|
||||
>
|
||||
<div v-if="showAnyReminder" class="flex-shrink-0 space-y-2 border-t border-gray-100 bg-gray-50 px-4 py-3">
|
||||
<div v-if="showBalanceWarning"
|
||||
class="rounded-lg border border-amber-200 bg-amber-50 p-3 text-sm text-amber-900">
|
||||
<p class="font-medium">
|
||||
钱包提示
|
||||
</p>
|
||||
<p class="mt-1 leading-relaxed">
|
||||
检测到您为代理且账户仍有余额(¥{{ (revenueData?.balance ?? 0).toFixed(2) }})或待结账金额(¥{{ (revenueData?.frozen_balance ?? 0).toFixed(2) }})。注销后将无法通过本账号提现,请确认已了解风险。
|
||||
检测到您为代理且账户仍有余额(¥{{ (revenueData?.balance ?? 0).toFixed(2) }})或冻结余额(¥{{ (revenueData?.frozen_balance ??
|
||||
0).toFixed(2) }})。注销后将无法通过本账号提现,请确认已了解风险。
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
v-if="showVipLevelReminder"
|
||||
class="rounded-lg border border-violet-200 bg-violet-50 p-3 text-sm text-violet-900"
|
||||
>
|
||||
<div v-if="showVipLevelReminder"
|
||||
class="rounded-lg border border-violet-200 bg-violet-50 p-3 text-sm text-violet-900">
|
||||
<p class="font-medium">
|
||||
会员提示
|
||||
</p>
|
||||
@@ -206,31 +198,22 @@ async function submitCancelAccount() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-shrink-0 border-t border-gray-200 bg-gray-50 px-4 pb-[max(1rem,env(safe-area-inset-bottom))] pt-3">
|
||||
<div
|
||||
class="flex-shrink-0 border-t border-gray-200 bg-gray-50 px-4 pb-[max(1rem,env(safe-area-inset-bottom))] pt-3">
|
||||
<div class="flex gap-3">
|
||||
<button
|
||||
type="button"
|
||||
class="flex-1 rounded-lg border border-gray-300 bg-white py-3 text-gray-800"
|
||||
@click="onExit"
|
||||
>
|
||||
<button type="button" class="flex-1 rounded-lg border border-gray-300 bg-white py-3 text-gray-800"
|
||||
@click="onExit">
|
||||
退出
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="flex-1 rounded-lg bg-red-500 py-3 text-white"
|
||||
@click="onConfirmTap"
|
||||
>
|
||||
<button type="button" class="flex-1 rounded-lg bg-red-500 py-3 text-white" @click="onConfirmTap">
|
||||
确认
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<div
|
||||
v-if="showSmsModal"
|
||||
class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4"
|
||||
@click.self="closeSmsModal"
|
||||
>
|
||||
<div v-if="showSmsModal" class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4"
|
||||
@click.self="closeSmsModal">
|
||||
<div class="w-full max-w-sm rounded-xl bg-white p-5 shadow-lg" @click.stop>
|
||||
<p class="mb-2 text-base font-medium text-gray-800">
|
||||
验证手机号
|
||||
@@ -238,37 +221,19 @@ async function submitCancelAccount() {
|
||||
<p class="mb-4 text-sm text-gray-500">
|
||||
将向 {{ maskName(mobile) }} 发送验证码。
|
||||
</p>
|
||||
<input
|
||||
v-model="cancelAccountCode"
|
||||
type="text"
|
||||
maxlength="6"
|
||||
inputmode="numeric"
|
||||
placeholder="请输入6位验证码"
|
||||
class="mb-4 w-full rounded-lg border border-gray-200 px-3 py-2 text-base"
|
||||
>
|
||||
<input v-model="cancelAccountCode" type="text" maxlength="6" inputmode="numeric" placeholder="请输入6位验证码"
|
||||
class="mb-4 w-full rounded-lg border border-gray-200 px-3 py-2 text-base">
|
||||
<div class="mb-4">
|
||||
<button
|
||||
type="button"
|
||||
class="w-full rounded-lg bg-gray-100 py-2 text-sm text-gray-700 disabled:opacity-50"
|
||||
:disabled="cancelSmsCountdown > 0"
|
||||
@click="sendCancelAccountSms"
|
||||
>
|
||||
<button type="button" class="w-full rounded-lg bg-gray-100 py-2 text-sm text-gray-700 disabled:opacity-50"
|
||||
:disabled="cancelSmsCountdown > 0" @click="sendCancelAccountSms">
|
||||
{{ cancelSmsCountdown > 0 ? `${cancelSmsCountdown}s` : '获取验证码' }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button
|
||||
type="button"
|
||||
class="flex-1 rounded-lg bg-gray-200 py-2 text-gray-800"
|
||||
@click="closeSmsModal"
|
||||
>
|
||||
<button type="button" class="flex-1 rounded-lg bg-gray-200 py-2 text-gray-800" @click="closeSmsModal">
|
||||
取消
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="flex-1 rounded-lg bg-red-500 py-2 text-white"
|
||||
@click="submitCancelAccount"
|
||||
>
|
||||
<button type="button" class="flex-1 rounded-lg bg-red-500 py-2 text-white" @click="submitCancelAccount">
|
||||
确认注销
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -49,8 +49,8 @@ export default defineConfig({
|
||||
strictPort: true, // 如果端口被占用则抛出错误而不是使用下一个可用端口
|
||||
proxy: {
|
||||
"/api/v1": {
|
||||
// target: "http://127.0.0.1:8888", // 本地接口地址
|
||||
target: "https://chimei.ronsafe.cn/", // 本地接口地址
|
||||
target: "http://127.0.0.1:8888", // 本地接口地址
|
||||
// target: "https://chimei.ronsafe.cn/", // 本地接口地址
|
||||
changeOrigin: true,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user