feat: 沉默期已过期强制弹窗,只能去延期,不能关闭
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 5m37s

This commit is contained in:
邹进
2026-11-08 16:29:12 +09:00
parent b6e55d315c
commit 535f92b818
5 changed files with 38 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
<template>
<view class="silence-overlay" @tap.stop>
<view class="silence-overlay" :class="{ 'silence-overlay-blocking': blocking }" @tap.stop @touchmove.stop.prevent>
<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>
<button v-if="!blocking" class="silence-close" aria-label="关闭沉默期提醒" @tap="$emit('close')">×</button>
<view class="silence-title">{{ title }}</view>
<view v-if="reminder.packageName" class="silence-package">{{ reminder.packageName }}</view>
<view class="silence-body">
@@ -9,7 +9,7 @@
套餐沉默期已于 <text class="silence-strong">{{ deadline }}</text> 过期,您有一笔未支付的延期订单({{ reminder.pendingOrderNo }}),请继续支付;不需要了可以作废后重新办理。
</template>
<template v-else-if="reminder.kind === 'expired'">
套餐需在 <text class="silence-strong">{{ deadline }}</text> 前完成实名,现已过期。办理延期后可继续实名激活使用。
套餐需在 <text class="silence-strong">{{ deadline }}</text> 前完成实名,现已过期。请先办理延期,延期后才能继续使用其他功能。
</template>
<template v-else>
套餐需在 <text class="silence-strong">{{ deadline }}</text> 前完成实名激活,还剩
@@ -17,17 +17,18 @@
</template>
</view>
<button class="silence-confirm" @tap="$emit('action')">{{ actionText }}</button>
<button class="silence-later" @tap="$emit('close')">我知道了</button>
<button v-if="!blocking" class="silence-later" @tap="$emit('close')">我知道了</button>
</view>
</view>
</template>
<script setup>
import { computed } from 'vue';
import { formatSilenceDate } from '@/utils/silence.js';
import { formatSilenceDate, isSilenceReminderBlocking } from '@/utils/silence.js';
const props = defineProps({ reminder: { type: Object, required: true } });
defineEmits(['close', 'action']);
const blocking = computed(() => isSilenceReminderBlocking(props.reminder));
const deadline = computed(() => formatSilenceDate(props.reminder.silence?.silence_deadline_at));
const title = computed(() => {
if (props.reminder.pendingOrderNo) return '延期订单未支付';
@@ -52,6 +53,12 @@
background: rgba(20, 26, 36, 0.48);
}
/* 强制延期弹窗盖在首页所有弹层(含 up-popup)之上 */
.silence-overlay-blocking {
z-index: 10200;
background: rgba(20, 26, 36, 0.64);
}
.silence-dialog {
position: relative;
width: 100%;