fix: 我的页去重复充值入口+未登录引导卡;充值页去Pro会员残留+未登录弹窗引导登录
This commit is contained in:
@@ -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