miniprogramme/components/interactive-feedback/interactive-feedback.wxml
2025-09-12 16:08:17 +08:00

44 lines
1.3 KiB
Text

<!-- 🎯 交互反馈组件 -->
<view class="interactive-feedback-container {{feedbackClass}}"
style="{{feedbackStyle}}"
animation="{{animationData}}"
bindtouchstart="onTouchStart"
bindtouchend="onTouchEnd"
bindtouchcancel="onTouchCancel"
bindtap="onTap"
bindlongpress="onLongPress">
<!-- 内容插槽 -->
<slot></slot>
<!-- 波纹效果 -->
<view wx:if="{{showRipple}}" class="ripple-container">
<view wx:for="{{ripples}}"
wx:key="id"
class="ripple {{item.class}}"
style="{{item.style}}"
animation="{{item.animation}}">
</view>
</view>
<!-- 触摸反馈 -->
<view wx:if="{{showTouchFeedback}}"
class="touch-feedback {{touchFeedbackClass}}"
style="{{touchFeedbackStyle}}">
</view>
<!-- 加载状态 -->
<view wx:if="{{loading}}" class="loading-overlay">
<view class="loading-spinner" animation="{{loadingAnimation}}"></view>
</view>
<!-- 成功反馈 -->
<view wx:if="{{showSuccess}}" class="success-feedback" animation="{{successAnimation}}">
<text class="success-icon">✓</text>
</view>
<!-- 错误反馈 -->
<view wx:if="{{showError}}" class="error-feedback" animation="{{errorAnimation}}">
<text class="error-icon">✕</text>
</view>
</view>