Files
a_long/miniprogram/components/global-notification/global-notification.wxml
2026-06-27 01:26:11 +08:00

49 lines
1.8 KiB
Plaintext
Raw Permalink 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.
<view
class="global-notification {{show ? 'show' : ''}} {{positionClass}} {{swipingClass}}"
bindtap="onTap"
bindtouchstart="onTouchStart"
bindtouchmove="onTouchMove"
bindtouchend="onTouchEnd"
style="{{swipeStyle}}"
data-notification-id="{{notificationData && notificationData.id ? notificationData.id : ''}}">
<!-- 滑动关闭指示器 -->
<view class="notification-swipe-indicator {{isSwiping ? 'active' : ''}}">
<view class="swipe-line"></view>
</view>
<!-- 通知内容 -->
<view class="notification-content">
<!-- 左侧头像 -->
<image class="notification-avatar" src="{{avatar}}" mode="aspectFill"></image>
<!-- 中间内容区域 -->
<view class="notification-body">
<view class="notification-title">{{title}}</view>
<view class="notification-message">{{message}}</view>
<view class="notification-time" wx:if="{{showTime}}">
{{formatTime(notificationData ? notificationData.timestamp : '')}}
</view>
</view>
<!-- 右侧操作区域 -->
<view class="notification-actions">
<!-- 关闭按钮 -->
<view class="notification-close" catchtap="onClose">
<text class="close-icon">×</text>
</view>
<!-- 免打扰按钮 -->
<view class="notification-mute {{isMuted ? 'muted' : ''}}" catchtap="onMute" wx:if="{{showMuteButton}}">
<text class="mute-icon">
{{isMuted ? '🔕' : '🔔'}}
</text>
</view>
</view>
</view>
<!-- 进度条 -->
<view class="notification-progress" wx:if="{{showProgress}}">
<view class="progress-bar {{progress < 30 ? 'warning' : ''}}"></view>
</view>
</view>