This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<swiper-item v-for="item in items" :key="item.id">
|
||||
<view class="notification-content">
|
||||
<view class="notification-title">{{ item.title || '业务通知' }}</view>
|
||||
<view class="notification-severity">{{ getNotificationMeta(item) }}</view>
|
||||
<view class="notification-time">{{ formatDate(item.created_at) }}</view>
|
||||
<scroll-view scroll-y class="notification-body">
|
||||
<text>{{ item.body || '暂无通知内容' }}</text>
|
||||
@@ -47,6 +48,20 @@
|
||||
if (!value) return '-';
|
||||
return value.replace('T', ' ').slice(0, 16);
|
||||
};
|
||||
|
||||
const getNotificationMeta = (item) => {
|
||||
const category = {
|
||||
expiry: '套餐临期',
|
||||
exchange: '换货'
|
||||
}[item?.category] || '业务通知';
|
||||
const severity = {
|
||||
info: '提示',
|
||||
warning: '警告',
|
||||
error: '错误',
|
||||
critical: '严重'
|
||||
}[item?.severity];
|
||||
return severity ? `${category} · ${severity}` : category;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -108,6 +123,12 @@
|
||||
line-height: 1.45;
|
||||
}
|
||||
|
||||
.notification-severity {
|
||||
margin-top: 10rpx;
|
||||
color: var(--primary);
|
||||
font-size: 22rpx;
|
||||
}
|
||||
|
||||
.notification-time {
|
||||
margin-top: 12rpx;
|
||||
color: var(--text-tertiary);
|
||||
|
||||
Reference in New Issue
Block a user