| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <template>
- <view class="error-box">
- <text class="error-icon">⚠️</text>
- <text class="error-title">{{ message }}</text>
- <text class="error-sub">请检查网络后重试</text>
- <button class="error-btn" @click="handleRetry">重新加载</button>
- </view>
- </template>
- <script>
- /**
- * 错误态 + 重试(分子组件)
- */
- export default {
- name: 'ErrorState',
- props: {
- message: { type: String, default: '加载失败' }
- },
- methods: {
- handleRetry() {
- this.$emit('retry')
- }
- }
- }
- </script>
- <style scoped>
- .error-box {
- background: #FFFFFF;
- border: 1px solid #E3ECF4;
- border-radius: 20rpx;
- padding: 60rpx 40rpx;
- margin-top: 60rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- }
- .error-icon { font-size: 64rpx; margin-bottom: 20rpx; }
- .error-title { font-size: 30rpx; font-weight: 600; color: #1F4E79; margin-bottom: 10rpx; }
- .error-sub { font-size: 24rpx; color: #3B5A78; margin-bottom: 32rpx; }
- .error-btn {
- width: 60%;
- height: 80rpx;
- line-height: 80rpx;
- background: #2E6FA8;
- color: #FFFFFF;
- font-size: 28rpx;
- font-weight: 600;
- border-radius: 40rpx;
- border: none;
- padding: 0;
- }
- .error-btn:active { opacity: 0.9; }
- </style>
|