fix: 我的页去重复充值入口+未登录引导卡;充值页去Pro会员残留+未登录弹窗引导登录
This commit is contained in:
@@ -55,8 +55,16 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 星尘余额 + 今日免费(简化模型:每天5次免费,用完充值星尘) -->
|
||||
<view class="balance-card">
|
||||
<!-- 星尘余额 + 今日免费(已登录) -->
|
||||
<view class="balance-card" v-if="userStore.isLoggedIn">
|
||||
<!-- 未登录:引导登录(简洁明确) -->
|
||||
<view class="balance-card login-guide" v-if="!userStore.isLoggedIn" @click="goLogin">
|
||||
<view class="balance-left">
|
||||
<text class="login-guide-title">登录后开始探索</text>
|
||||
<text class="login-guide-sub">每天 5 次免费 AI 问答 · 点亮知识星球</text>
|
||||
</view>
|
||||
<view class="recharge-go"><text>去登录</text></view>
|
||||
</view>
|
||||
<view class="balance-left">
|
||||
<view class="coin-row">
|
||||
<text class="coin-icon">✨</text>
|
||||
@@ -69,16 +77,6 @@
|
||||
<text>充值</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 星尘充值入口 -->
|
||||
<view class="vpay-entry" @click="goRecharge">
|
||||
<view class="ve-icon">✨</view>
|
||||
<view class="ve-info">
|
||||
<text class="ve-title">充值星尘</text>
|
||||
<text class="ve-desc">AI问答 · 会员订阅</text>
|
||||
</view>
|
||||
<text class="ve-arrow">→</text>
|
||||
</view>
|
||||
|
||||
<!-- 菜单列表 -->
|
||||
<view class="menu-section">
|
||||
<view class="menu-item" @click="goFavorites">
|
||||
@@ -113,19 +111,7 @@
|
||||
<AppIcon name="arrow-gray" :size="12" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 登录入口:统一走上方订阅卡(登录后升级);H5 保留登录/注册快捷按钮 -->
|
||||
<view class="action-row" v-if="!userStore.isLoggedIn">
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="action-btn primary" @click="goLogin">
|
||||
<text>登录 / 注册</text>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="action-btn ghost" @click="goLogin">
|
||||
<text>去登录,同步点亮进度</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="action-btn logout" v-else @click="handleLogout">
|
||||
<view v-if="userStore.isLoggedIn" class="action-btn logout" @click="handleLogout">
|
||||
<text>退出登录</text>
|
||||
</view>
|
||||
|
||||
@@ -144,7 +130,7 @@ import { APP_VERSION } from '@/utils/version'
|
||||
|
||||
const SUB_GUEST = '游客 · 点亮进度保存在本机,登录后同步'
|
||||
const SUB_USER = '已点亮 {n} 颗星球 · 连续 {d} 天'
|
||||
const PLAN_FREE = '✦ 免费版'
|
||||
|
||||
const PLAN_DESC_FREE = '每日 5 次 AI 问答 · 答对检测题点亮星球'
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -165,9 +151,7 @@ const profileSubText = computed(() => {
|
||||
return `已点亮 ${stats.value.totalLit} 颗星球 · 连续 ${stats.value.streak} 天`
|
||||
})
|
||||
|
||||
const planTitle = computed(() =>
|
||||
userStore.isSubscribed ? `✦ ${userStore.subscriptionLevel?.toUpperCase() || 'PRO'} 会员` : PLAN_FREE
|
||||
)
|
||||
|
||||
const planDesc = computed(() =>
|
||||
userStore.isSubscribed ? '全量知识解锁 · AI 问答无限次' : PLAN_DESC_FREE
|
||||
)
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<view class="use-cases">
|
||||
<text class="uc-title">{{ info.coinName || '星尘' }}用途</text>
|
||||
<view class="uc-item"><text class="uc-tag">问答</text><text>AI 问答一次 10 {{ info.coinName || '星尘' }}</text></view>
|
||||
<view class="uc-item"><text class="uc-tag">会员</text><text>Pro 月卡 3000 {{ info.coinName || '星尘' }}</text></view>
|
||||
<view class="uc-item"><text class="uc-tag">连续</text><text>更多星尘用途陆续开放</text></view>
|
||||
</view>
|
||||
|
||||
<view class="pay-agreement-row">
|
||||
@@ -60,15 +60,30 @@ function openAgreement() {
|
||||
|
||||
onMounted(async () => {
|
||||
if (!userStore.isLoggedIn) {
|
||||
uni.showToast({ title: '请先登录', icon: 'none' })
|
||||
setTimeout(() => uni.navigateBack(), 1500)
|
||||
uni.showModal({
|
||||
title: '请先登录',
|
||||
content: '登录后即可充值星尘,每天还有 5 次免费问答',
|
||||
confirmText: '去登录',
|
||||
showCancel: false,
|
||||
success: () => uni.redirectTo({ url: '/pages/login/login' }),
|
||||
})
|
||||
return
|
||||
}
|
||||
try {
|
||||
info.value = await request('GET', '/api/vpay/info', null, userStore.token)
|
||||
if ((info.value.packages || []).length) picked.value = info.value.packages[0].id
|
||||
} catch (e) {
|
||||
uni.showToast({ title: e.message || '获取充值信息失败', icon: 'none' })
|
||||
if (String(e.message || '').includes('登录')) {
|
||||
uni.showModal({
|
||||
title: '登录已过期',
|
||||
content: '请重新登录后再充值',
|
||||
confirmText: '去登录',
|
||||
showCancel: false,
|
||||
success: () => uni.redirectTo({ url: '/pages/login/login' }),
|
||||
})
|
||||
} else {
|
||||
uni.showToast({ title: e.message || '获取充值信息失败', icon: 'none' })
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user