Files
device-voice-h5/components/SilenceReminderPopup.vue
邹进 0136615502
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Failing after 14m26s
feat: 首页弹出套餐沉默期提醒
- 资产有沉默期已过期且可延期的套餐时弹窗,带去延期入口;待实名 7 天内到截止日时提醒尽快实名
- 排在临期提醒之后、站内通知之前,同一资产同一笔套餐每天最多弹一次
- 套餐历史在后台加载,不阻塞首页其他弹窗
2026-11-07 18:51:54 +09:00

114 lines
3.0 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<view class="silence-overlay" @tap.stop>
<view class="silence-dialog" :class="`silence-${reminder.kind}`" role="dialog" aria-modal="true" aria-label="套餐沉默期提醒">
<button class="silence-close" aria-label="关闭沉默期提醒" @tap="$emit('close')">×</button>
<view class="silence-title">{{ reminder.kind === 'expired' ? '套餐沉默期已过期' : '请尽快完成实名' }}</view>
<view v-if="reminder.packageName" class="silence-package">{{ reminder.packageName }}</view>
<view class="silence-body">
<template v-if="reminder.kind === 'expired'">
套餐需在 <text class="silence-strong">{{ deadline }}</text> 前完成实名,现已过期。办理延期后可继续实名激活使用。
</template>
<template v-else>
套餐需在 <text class="silence-strong">{{ deadline }}</text> 前完成实名激活,还剩
<text class="silence-strong">{{ reminder.remainingDays }}</text> 天,过期后需办理延期。
</template>
</view>
<button class="silence-confirm" @tap="$emit('action')">{{ reminder.kind === 'expired' ? '去延期' : '查看套餐' }}</button>
<button class="silence-later" @tap="$emit('close')">我知道了</button>
</view>
</view>
</template>
<script setup>
import { computed } from 'vue';
import { formatSilenceDate } from '@/utils/silence.js';
const props = defineProps({ reminder: { type: Object, required: true } });
defineEmits(['close', 'action']);
const deadline = computed(() => formatSilenceDate(props.reminder.silence?.silence_deadline_at));
</script>
<style scoped lang="scss">
.silence-overlay {
position: fixed;
inset: 0;
z-index: 1200;
display: flex;
align-items: center;
justify-content: center;
padding: 40rpx;
box-sizing: border-box;
background: rgba(20, 26, 36, 0.48);
}
.silence-dialog {
position: relative;
width: 100%;
max-width: 640rpx;
padding: 48rpx 36rpx 32rpx;
box-sizing: border-box;
border-radius: 32rpx;
text-align: center;
background: var(--bg-primary);
box-shadow: 0 24rpx 80rpx rgba(0, 0, 0, 0.18);
}
.silence-close {
position: absolute;
top: 16rpx;
right: 20rpx;
padding: 0;
font-size: 44rpx;
line-height: 1;
color: var(--text-tertiary);
background: transparent;
&::after { border: none; }
}
.silence-title {
font-size: 36rpx;
font-weight: 700;
color: var(--text-primary);
}
.silence-expired .silence-title {
color: var(--danger);
}
.silence-package {
margin-top: 12rpx;
font-size: 26rpx;
color: var(--text-secondary);
}
.silence-body {
margin: 28rpx 0 36rpx;
font-size: 28rpx;
line-height: 1.7;
color: var(--text-secondary);
text-align: left;
}
.silence-strong {
font-weight: 600;
color: var(--text-primary);
}
.silence-confirm {
width: 100%;
border-radius: 999rpx;
font-size: 30rpx;
color: #fff;
background: var(--primary);
}
.silence-later {
width: 100%;
margin-top: 16rpx;
font-size: 28rpx;
color: var(--text-tertiary);
background: transparent;
&::after { border: none; }
}
</style>