/* pages/goods/detail.wxss */ .container { min-height: 100vh; background: #f7f8fa; padding-bottom: 120rpx; } /* 加载状态 */ .loading { position: fixed; left: 0; right: 0; top: 0; bottom: 0; background: #fff; display: flex; align-items: center; justify-content: center; z-index: 999; } .loading-icon { width: 120rpx; height: 120rpx; animation: rotate 1s linear infinite; } @keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } /* 轮播图 */ .swiper-box { width: 100%; height: 750rpx; position: relative; background: #fff; } .slide-image { width: 100%; height: 100%; transition: transform 0.3s ease; } .slide-image:active { transform: scale(0.98); } /* 商品信息 */ .goods-info { margin-top: -20rpx; background: #fff; border-radius: 24rpx 24rpx 0 0; overflow: hidden; position: relative; z-index: 1; box-shadow: 0 -4rpx 16rpx rgba(0, 0, 0, 0.05); } .price-section { padding: 24rpx 30rpx; background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%); color: #fff; display: flex; justify-content: space-between; align-items: center; } .price-wrapper { display: flex; align-items: baseline; } .current-price { font-size: 48rpx; font-weight: 600; margin-right: 16rpx; } .original-price { font-size: 28rpx; text-decoration: line-through; opacity: 0.8; } .commission-wrapper { display: flex; align-items: center; background: linear-gradient(135deg, #ff9a9e 0%, #ff4d4f 100%); border-radius: 28rpx; padding: 8rpx 20rpx; box-shadow: 0 4rpx 12rpx rgba(255, 77, 79, 0.2); animation: pulse 2s infinite; } @keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } } .commission-icon { width: 32rpx; height: 32rpx; margin-right: 8rpx; } .commission-text { color: #fff; font-size: 26rpx; font-weight: 600; } .title-section { padding: 24rpx 30rpx; background: #fff; } .title-wrap { display: flex; align-items: flex-start; margin-bottom: 16rpx; } .goods-title { flex: 1; font-size: 32rpx; font-weight: 600; color: #333; line-height: 1.5; margin-right: 16rpx; } .sales-badge { flex-shrink: 0; font-size: 22rpx; color: #ff4d4f; background: #fff5f5; padding: 4rpx 12rpx; border-radius: 20rpx; line-height: 1.4; margin-top: 4rpx; } .goods-tags { display: flex; flex-wrap: wrap; margin-top: 16rpx; gap: 12rpx; } .tag-item { display: inline-flex; align-items: center; padding: 6rpx 16rpx; background: linear-gradient(135deg, rgba(255, 77, 79, 0.08), rgba(255, 107, 107, 0.08)); border-radius: 20rpx; border: 1rpx solid rgba(255, 77, 79, 0.15); } .tag-item text { font-size: 22rpx; color: #ff4d4f; line-height: 1.4; } .action-buttons { display: flex; flex-direction: column; align-items: center; } .collect-btn, .share-btn { display: flex; flex-direction: column; align-items: center; padding: 0 20rpx; transition: transform 0.2s ease; } .collect-btn:active, .share-btn:active { transform: scale(0.9); } .collect-btn image, .share-btn image { width: 44rpx; height: 44rpx; margin-bottom: 8rpx; } .collect-btn text, .share-btn text { font-size: 22rpx; color: #fff; } .collected text { color: #ff4d4f; } /* 商品详情 */ .goods-detail { margin-top: 20rpx; background: #fff; padding: 30rpx; } .detail-title { display: flex; align-items: center; margin-bottom: 30rpx; position: relative; padding-left: 20rpx; } .detail-title::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 6rpx; height: 32rpx; background: #ff4d4f; border-radius: 3rpx; } .title-text { font-size: 32rpx; font-weight: bold; color: #333; } .detail-image { width: 100%; border-radius: 12rpx; margin-bottom: 20rpx; box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); } /* 热门推荐样式优化 */ .hot-recommendations { margin: 20rpx 0; background: #fff; padding: 30rpx 0; } .section-title { padding: 0 30rpx; margin-bottom: 30rpx; display: flex; align-items: center; } .section-title .title-text { font-size: 34rpx; font-weight: 600; color: #333; position: relative; padding-left: 24rpx; } .section-title .title-text::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 8rpx; height: 32rpx; background: linear-gradient(to bottom, #ff4d4f, #ff7875); border-radius: 4rpx; } .recommendations-swiper { height: 520rpx; width: 100%; } .recommendation-item { padding: 10rpx; box-sizing: border-box; transition: all 0.3s ease; } .recommendation-card { background: #fff; border-radius: 16rpx; overflow: hidden; box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.06); height: 100%; transform: scale(0.95); transition: all 0.3s ease; } .recommendation-card.active { transform: scale(1); } .recommendation-image-wrap { position: relative; width: 100%; height: 320rpx; overflow: hidden; } .recommendation-image { width: 100%; height: 100%; transition: transform 0.3s ease; } .recommendation-card:active .recommendation-image { transform: scale(1.05); } .recommendation-tag { position: absolute; left: 16rpx; top: 16rpx; background: linear-gradient(135deg, #ff4d4f, #ff7875); color: #fff; font-size: 22rpx; padding: 6rpx 16rpx; border-radius: 20rpx; box-shadow: 0 4rpx 8rpx rgba(255, 77, 79, 0.2); } .recommendation-info { padding: 20rpx; } .recommendation-title-wrap { margin-bottom: 16rpx; } .recommendation-title { font-size: 26rpx; color: #333; line-height: 1.4; height: 72rpx; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } .recommendation-price-row { display: flex; align-items: center; justify-content: space-between; } .price-wrap { display: flex; align-items: baseline; } .currency { font-size: 24rpx; color: #ff4d4f; margin-right: 2rpx; font-weight: 500; } .price { font-size: 32rpx; color: #ff4d4f; font-weight: 600; } .sales-wrap { background: #fff5f5; padding: 4rpx 12rpx; border-radius: 20rpx; } .sales { font-size: 20rpx; color: #ff4d4f; } @keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } } .recommendation-item { animation: slideIn 0.3s ease-out; } /* 推荐商品 */ .recommend-section { margin-top: 20rpx; background: #fff; padding: 30rpx; } .recommend-title { font-size: 32rpx; font-weight: bold; color: #333; margin-bottom: 30rpx; } .recommend-list { display: flex; flex-wrap: wrap; margin: 0 -10rpx; } .recommend-item { width: calc(50% - 20rpx); margin: 10rpx; background: #fff; border-radius: 12rpx; overflow: hidden; box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05); transition: transform 0.2s ease; } .recommend-item:active { transform: translateY(2rpx); } .recommend-image { width: 100%; height: 320rpx; background: #f5f5f5; } .recommend-info { padding: 20rpx; } .recommend-name { font-size: 28rpx; color: #333; line-height: 1.4; margin-bottom: 12rpx; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } .recommend-price-wrapper { display: flex; align-items: baseline; justify-content: space-between; } .recommend-price { font-size: 32rpx; color: #ff4d4f; font-weight: bold; } .recommend-commission { font-size: 24rpx; color: #ff7875; } /* 底部按钮样式优化 */ .bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: center; padding: 16rpx 24rpx calc(16rpx + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -1rpx 6rpx rgba(0, 0, 0, 0.02); z-index: 100; } .share-poster-btn, .share-btn { flex: 1; height: 80rpx; margin: 0 12rpx; border-radius: 40rpx; border: none; padding: 0; font-weight: normal; position: relative; overflow: hidden; } .share-poster-btn { background: rgba(255, 77, 79, 0.08); } .btn-content, .share-content { height: 100%; display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; } .btn-content { padding: 0 32rpx; } .btn-icon { width: 32rpx; height: 32rpx; margin-right: 8rpx; opacity: 0.9; filter: brightness(0) saturate(100%) invert(45%) sepia(80%) saturate(2368%) hue-rotate(338deg) brightness(98%) contrast(98%); } .btn-text { font-size: 26rpx; color: #ff4d4f; font-weight: 500; } .share-btn { background: rgba(255, 77, 79, 0.9); } .share-content { display: flex; flex-direction: column; align-items: center; justify-content: center; } .share-text { font-size: 28rpx; color: #fff; line-height: 1; margin-bottom: 4rpx; font-weight: 500; } .commission-text { font-size: 20rpx; color: #fff; line-height: 1; background: rgba(255, 255, 255, 0.2); padding: 4rpx 12rpx; border-radius: 10rpx; } /* 按钮点击态 */ .share-poster-btn:active { background: rgba(255, 77, 79, 0.12); transition: all 0.15s ease; } .share-btn:active { background: rgba(255, 77, 79, 1); transition: all 0.15s ease; } /* 收藏按钮样式 */ .collect-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 24rpx; } .collect-btn image { width: 44rpx; height: 44rpx; margin-bottom: 4rpx; } .collect-btn text { font-size: 20rpx; color: #666; } /* 返回顶部按钮 */ .back-to-top { position: fixed; right: 30rpx; bottom: calc(140rpx + env(safe-area-inset-bottom)); width: 80rpx; height: 80rpx; background: #fff; border-radius: 50%; box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1); display: flex; align-items: center; justify-content: center; z-index: 99; transition: all 0.3s ease; } .back-to-top:active { transform: scale(0.95); } .top-icon { width: 40rpx; height: 40rpx; } @keyframes fadeInUp { from { opacity: 0; transform: translateY(20rpx); } to { opacity: 1; transform: translateY(0); } } .back-to-top { animation: fadeInUp 0.3s ease-out; } /* 分享弹窗 */ .share-popup { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 100; animation: fadeIn 0.3s ease; } .share-mask { position: absolute; left: 0; right: 0; top: 0; bottom: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4rpx); } .share-panel { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 24rpx 24rpx 0 0; transform: translateY(0); animation: slideUp 0.3s ease; } .share-options { display: flex; justify-content: space-around; padding: 40rpx 60rpx; } .share-option { display: flex; flex-direction: column; align-items: center; background: none; border: none; padding: 0; margin: 0; line-height: 1.5; } .share-option::after { display: none; } .share-option image { width: 100rpx; height: 100rpx; margin-bottom: 16rpx; } .share-option text { font-size: 26rpx; color: #666; } .cancel-btn { height: 100rpx; line-height: 100rpx; text-align: center; font-size: 30rpx; color: #999; border-top: 1rpx solid #f5f5f5; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } } /* 海报模态框 */ .poster-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1000; } .modal-mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); } .modal-content { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 680rpx; background: #fff; border-radius: 24rpx; overflow: hidden; animation: modalPopIn 0.3s ease-out; } @keyframes modalPopIn { from { opacity: 0; transform: translate(-50%, -45%); } to { opacity: 1; transform: translate(-50%, -50%); } } .modal-header { position: relative; padding: 40rpx 30rpx; text-align: center; border-bottom: 1rpx solid #f5f5f5; } .modal-title { font-size: 34rpx; font-weight: 600; color: #333; } .close-btn { position: absolute; right: 20rpx; top: 50%; transform: translateY(-50%); padding: 20rpx; } .close-icon { width: 32rpx; height: 32rpx; } .template-scroll { max-height: 70vh; } .template-list { padding: 30rpx; } .template-item { margin-bottom: 30rpx; border-radius: 16rpx; background: #fff; overflow: hidden; transition: all 0.3s ease; } .template-item:last-child { margin-bottom: 0; } .template-preview-wrap { position: relative; width: 100%; height: 800rpx; background: #f8f9fa; } .template-preview { width: 100%; height: 100%; object-fit: cover; } .template-selected { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255, 77, 79, 0.1); display: flex; align-items: center; justify-content: center; } .selected-icon { width: 80rpx; height: 80rpx; } .template-info { padding: 20rpx; background: #fff; } .template-name { font-size: 28rpx; font-weight: 500; color: #333; margin-bottom: 8rpx; } .template-desc { font-size: 24rpx; color: #999; } .modal-footer { padding: 30rpx; border-top: 1rpx solid #f5f5f5; } .confirm-btn { width: 100%; height: 88rpx; line-height: 88rpx; text-align: center; background: linear-gradient(135deg, #ff6b6b 0%, #ff4d4f 100%); color: #fff; font-size: 32rpx; font-weight: 500; border-radius: 44rpx; box-shadow: 0 4rpx 12rpx rgba(255, 77, 79, 0.2); } /* 分享按钮样式优化 */ .share-btn { position: relative; display: flex; align-items: center; justify-content: center; } .commission-tag { position: absolute; right: -6rpx; bottom: -6rpx; background: linear-gradient(135deg, #ff6b6b 0%, #ff4d4f 100%); color: #fff; font-size: 20rpx; padding: 4rpx 12rpx; border-radius: 12rpx; transform: scale(0.9); box-shadow: 0 2rpx 8rpx rgba(255, 77, 79, 0.2); } /* 海报预览 */ .poster-preview { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; } .preview-mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.8); } .preview-content { position: relative; z-index: 1; width: 600rpx; background: #fff; border-radius: 24rpx; overflow: hidden; padding: 30rpx; } .poster-image { width: 100%; border-radius: 12rpx; } .preview-footer { margin-top: 30rpx; } .save-btn { background: #ff4d4f; color: #fff; border-radius: 44rpx; font-size: 30rpx; height: 88rpx; line-height: 88rpx; } .save-btn:active { opacity: 0.9; }