fix: 修复界面组件布局和显示问题

- 修复LoadingOverlay组件文本布局,确保两行显示
- 为ImageResultViewer头部添加精致分割线
- 修复DownloadSection按钮显示问题,调整布局层级
- 优化组件间距和视觉效果
This commit is contained in:
imeepos
2025-09-01 18:23:12 +08:00
parent c318db5baa
commit 52b4786459
6 changed files with 35 additions and 431 deletions

View File

@@ -1,11 +1,14 @@
.download-section {
width: 100%;
padding: 40rpx;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-left: 0;
padding-right: 0;
padding-bottom: 40rpx;
padding-top: 20rpx;
}
.download-btn {

View File

@@ -15,7 +15,14 @@
justify-content: space-between;
align-items: center;
padding: 40rpx;
background: transparent;
color: white;
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 10;
border-bottom: 2rpx solid rgba(255, 255, 255, 0.1);
}
.fullscreen-title {
@@ -40,13 +47,14 @@
width: 100%;
position: relative;
overflow: hidden;
display: flex;
}
.backdrop-blur {
width: 100%;
height: 100%;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
background: rgba(0, 0, 0, 0.3);
display: flex;
justify-content: center;

View File

@@ -12,7 +12,7 @@ interface ImageResultViewerProps {
const ImageResultViewer: React.FC<ImageResultViewerProps> = memo(({ images, onClose }) => {
// 广告激励下载功能
const { showAd, loading: adLoading } = useAd({
const { loading: adLoading } = useAd({
onReward: () => {
// 观看完整广告后下载图片
handleDownloadImages()
@@ -53,13 +53,13 @@ const ImageResultViewer: React.FC<ImageResultViewerProps> = memo(({ images, onCl
}
// 触发看广告下载
const handleWatchAdToDownload = () => {
if (adLoading) {
showToast({ title: '广告加载中...', icon: 'loading' })
return
}
showAd()
}
// const handleWatchAdToDownload = () => {
// if (adLoading) {
// showToast({ title: '广告加载中...', icon: 'loading' })
// return
// }
// showAd()
// }
return (
<View className="fullscreen-container">
@@ -81,8 +81,8 @@ const ImageResultViewer: React.FC<ImageResultViewerProps> = memo(({ images, onCl
<View className="backdrop-blur">
<Image className="fullscreen-image" src={images[0]} mode="aspectFit" />
</View>
<DownloadSection onDownload={handleWatchAdToDownload} loading={adLoading} />
</View>
<DownloadSection onDownload={handleDownloadImages} loading={adLoading} />
</View>
)
})

View File

@@ -16,6 +16,12 @@
color: white;
}
.loading-text {
display: flex;
flex-direction: column;
gap: 20rpx;
}
.loading-spinner {
width: 100rpx;
height: 100rpx;
@@ -34,10 +40,11 @@
.loading-title {
font-size: 36rpx;
font-weight: bold;
margin-bottom: 20rpx;
display: block;
}
.loading-desc {
font-size: 28rpx;
opacity: 0.8;
display: block;
}

View File

@@ -7,8 +7,10 @@ const LoadingOverlay: React.FC = memo(() => {
<View className="loading-overlay">
<View className="loading-container">
<View className="loading-spinner" />
<Text className="loading-title">AI正在生成中...</Text>
<Text className="loading-desc"></Text>
<View className="loading-text">
<Text className="loading-title">AI正在生成中...</Text>
<Text className="loading-desc"></Text>
</View>
</View>
</View>
)

View File

@@ -13,420 +13,4 @@
background-position: center;
background-repeat: no-repeat;
position: relative;
}
.button-container {
position: absolute;
bottom: 20vh;
left: 50%;
transform: translateX(-50%);
z-index: 10;
}
/* Loading 遮罩层 */
.loading-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
/* Loading 容器样式 */
.loading-container {
text-align: center;
}
.loading-title {
font-size: 48px;
font-weight: bold;
color: #fff;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
margin: 30px 0 15px 0;
display: block;
}
.loading-desc {
font-size: 28px;
color: rgba(255, 255, 255, 0.9);
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
margin: 0;
display: block;
}
/* Error 遮罩层 */
.error-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
/* Error 容器样式 */
.error-container {
text-align: center;
}
.error-icon {
font-size: 80px;
margin-bottom: 30px;
display: block;
animation: pulse 2s infinite;
}
.error-title {
font-size: 48px;
font-weight: bold;
color: #fff;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
margin: 30px 0 15px 0;
display: block;
}
.error-desc {
font-size: 32px;
color: #fff;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
margin: 0 0 30px 0;
display: block;
line-height: 1.5;
}
.error-hint {
font-size: 24px;
color: rgba(255, 255, 255, 0.6);
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
margin: 0;
display: block;
animation: blink 2s infinite;
}
@keyframes blink {
0%, 50% {
opacity: 0.6;
}
100% {
opacity: 1;
}
}
@keyframes pulse {
0%, 100% {
transform: scale(1);
opacity: 0.8;
}
50% {
transform: scale(1.1);
opacity: 1;
}
}
/* 通用步骤容器 */
.step-container {
background: white;
border-radius: 24rpx;
box-shadow: 0 8rpx 32rpx rgba(0, 0, 0, 0.1);
padding: 80rpx 60rpx;
text-align: center;
width: 100%;
max-width: 600rpx;
}
/* 标题样式 */
.step-title {
font-size: 48rpx;
font-weight: bold;
color: #333;
margin-bottom: 30rpx;
display: block;
}
/* 描述文字 */
.step-desc {
font-size: 28rpx;
color: #666;
margin-bottom: 60rpx;
line-height: 1.6;
display: block;
}
/* 上传按钮 */
.upload-btn {
background: linear-gradient(45deg, #667eea, #764ba2);
color: white;
border: none;
border-radius: 50rpx;
padding: 30rpx 80rpx;
font-size: 32rpx;
font-weight: bold;
box-shadow: 0 6rpx 20rpx rgba(102, 126, 234, 0.4);
min-width: 300rpx;
}
.upload-btn:active {
transform: translateY(2rpx);
box-shadow: 0 4rpx 16rpx rgba(102, 126, 234, 0.3);
}
/* 加载动画 */
.loading-spinner {
width: 80px;
height: 80px;
border: 6px solid rgba(255, 255, 255, 0.2);
border-top: 6px solid #ff6b9d;
border-right: 6px solid #ff9a56;
border-radius: 50%;
animation: spin 1s linear infinite;
margin: 0 auto 30px;
box-shadow: 0 0 30px rgba(255, 107, 157, 0.3);
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* 全屏预览容器 */
.fullscreen-container {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: linear-gradient(135deg, #2c3e50, #34495e);
background-image:
radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
display: flex;
flex-direction: column;
z-index: 1000;
}
/* 全屏头部 */
.fullscreen-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx 40rpx;
background: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10rpx);
color: white;
position: absolute;
top: 0;
left: 0;
right: 0;
z-index: 1001;
width: 100%;
box-sizing: border-box;
}
.fullscreen-title {
font-size: 32rpx;
font-weight: 500;
color: rgba(255, 255, 255, 0.9);
flex: 1;
text-align: left;
text-shadow: 0 2px 8rpx rgba(0, 0, 0, 0.5);
}
.close-btn {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.2);
color: white;
border: none;
font-size: 40rpx;
font-weight: bold;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
line-height: 1;
flex-shrink: 0;
margin-left: auto;
}
.close-btn:active {
background: rgba(255, 255, 255, 0.3);
}
/* 全屏滑动器 */
.fullscreen-swiper {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.swiper-item {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
padding: 0;
box-sizing: border-box;
position: relative;
background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.8) 100%);
}
.fullscreen-image {
width: calc(100% - 40rpx);
height: calc(100% - 180rpx);
border-radius: 0rpx;
position: relative;
z-index: 2;
margin-top: 0rpx;
object-fit: cover;
box-shadow: 0 15rpx 50rpx rgba(0, 0, 0, 0.4);
}
/* 全屏底部 */
.fullscreen-footer {
padding: 40rpx;
background: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
position: relative;
z-index: 1001;
}
/* 重新生成按钮 */
.restart-btn {
background: linear-gradient(45deg, #52c41a, #73d13d);
color: white;
border: none;
border-radius: 50rpx;
padding: 24rpx 60rpx;
font-size: 30rpx;
font-weight: bold;
box-shadow: 0 4rpx 16rpx rgba(82, 196, 26, 0.3);
}
.restart-btn:active {
transform: translateY(2rpx);
}
/* 错误描述 */
.error-desc {
font-size: 26rpx;
color: #ff4d4f;
margin-bottom: 50rpx;
background: #fff2f0;
border: 1rpx solid #ffccc7;
border-radius: 12rpx;
padding: 30rpx;
line-height: 1.5;
display: block;
}
/* 重试按钮 */
.retry-btn {
background: linear-gradient(45deg, #ff4d4f, #ff7875);
color: white;
border: none;
border-radius: 50rpx;
padding: 24rpx 60rpx;
font-size: 30rpx;
font-weight: bold;
box-shadow: 0 4rpx 16rpx rgba(255, 77, 79, 0.3);
}
.retry-btn:active {
transform: translateY(2rpx);
}
/* 添加闪烁动画 */
@keyframes sparkle {
0%,
100% {
opacity: 0;
}
50% {
opacity: 1;
}
}
/* 下载区域样式 */
.download-section {
position: absolute;
bottom: 60rpx;
left: 50%;
transform: translateX(-50%);
width: 100%;
padding: 0 40rpx;
box-sizing: border-box;
z-index: 1001;
text-align: center;
}
/* 下载按钮样式 */
.download-btn {
background: linear-gradient(135deg, #ff6b9d, #ff9a56);
border: none;
border-radius: 50rpx;
padding: 20rpx 40rpx;
font-size: 28rpx;
font-weight: bold;
color: #fff;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
box-shadow: 0 8rpx 25rpx rgba(255, 107, 157, 0.4);
min-width: 320rpx;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.download-btn::before {
content: "";
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(
90deg,
transparent,
rgba(255, 255, 255, 0.3),
transparent
);
transition: left 0.5s;
}
.download-btn:hover::before {
left: 100%;
}
.download-btn:active {
transform: translateY(2rpx);
box-shadow: 0 4rpx 15rpx rgba(255, 107, 157, 0.3);
}
.download-btn:disabled {
opacity: 0.6;
cursor: not-allowed;
}
/* 下载提示文字 */
.download-tip {
font-size: 24rpx;
color: rgba(255, 255, 255, 0.8);
margin-top: 20rpx;
text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
line-height: 1.4;
display: block;
}