This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
<view class="expiry-dialog" :class="`expiry-${reminder.level}`" role="dialog"
|
||||
aria-modal="true" aria-label="套餐临期提醒" @keydown.esc="$emit('close')">
|
||||
<view class="reminder-header">
|
||||
<view class="reminder-level">{{ reminder.level_name || '套餐临期提醒' }}</view>
|
||||
<button class="reminder-close" aria-label="关闭临期提醒" @tap="$emit('close')">×</button>
|
||||
<view class="clock-halo" aria-hidden="true"><view class="clock-face"></view></view>
|
||||
<view class="reminder-title">套餐即将到期</view>
|
||||
@@ -56,15 +55,6 @@
|
||||
text-align: center;
|
||||
background: linear-gradient(180deg, var(--reminder-tint), var(--bg-primary));
|
||||
}
|
||||
.reminder-level {
|
||||
display: inline-block;
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 999rpx;
|
||||
font-size: 22rpx;
|
||||
font-weight: 600;
|
||||
color: var(--reminder-color);
|
||||
background: var(--reminder-tint);
|
||||
}
|
||||
.reminder-close {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive, computed, onMounted } from 'vue';
|
||||
import { ref, reactive, computed, onMounted, onUnmounted } from 'vue';
|
||||
import { popupApi, notificationApi } from '@/api/index.js';
|
||||
import { handledPopupNotificationIds } from '@/utils/popup.js';
|
||||
import {
|
||||
@@ -333,6 +333,8 @@
|
||||
emit('close', 'done');
|
||||
};
|
||||
|
||||
let mounted = true;
|
||||
onUnmounted(() => { mounted = false; });
|
||||
onMounted(async () => {
|
||||
if (!props.identifier) {
|
||||
emit('close', 'empty');
|
||||
@@ -341,6 +343,7 @@
|
||||
|
||||
try {
|
||||
const data = await popupApi.getCandidate(props.page, props.identifier);
|
||||
if (!mounted) return;
|
||||
const item = (data && data.candidate) || null;
|
||||
if (!item || !item.notification_id || handledPopupNotificationIds.has(item.notification_id)) {
|
||||
emit('close', 'empty');
|
||||
@@ -353,6 +356,7 @@
|
||||
resetForm();
|
||||
visible.value = true;
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
// 资源不可见(400/code=1180)与接口异常统一静默关闭,不做 UI 分支
|
||||
console.error('查询弹窗候选失败', e);
|
||||
emit('close', 'invisible');
|
||||
|
||||
Reference in New Issue
Block a user