fix: task 6 review round 1

This commit is contained in:
2026-08-07 17:05:23 +08:00
parent 6dd9e15ea5
commit 97b9568823
3 changed files with 31 additions and 62 deletions
+7 -3
View File
@@ -36,7 +36,7 @@ export default function CheckoutPage() {
} }
Taro.showModal({ Taro.showModal({
title: '确认下单', title: '确认下单',
content: `确认后将从设计清单生成订单,并寄送至:\n${address.region ? address.region.join(' ') : ''} ${address.detail}`, content: `确认后将从设计清单生成订单,并寄送至:\n${formatAddress(address.region, address.detail)}`,
success: (res) => { success: (res) => {
if (res.confirm) { if (res.confirm) {
designToOrder(design.id) designToOrder(design.id)
@@ -57,6 +57,10 @@ export default function CheckoutPage() {
const hasStickers = design && design.designData && design.designData.stickers && design.designData.stickers.length > 0 const hasStickers = design && design.designData && design.designData.stickers && design.designData.stickers.length > 0
const hasLegacyImage = design && design.designData ? design.designData.imageSrc : undefined const hasLegacyImage = design && design.designData ? design.designData.imageSrc : undefined
const formatAddress = (region: string[] | undefined, detail: string) => {
const regionText = region ? region.join(' ') : ''
return regionText ? `${regionText} ${detail}` : detail
}
if (!design) { if (!design) {
return ( return (
@@ -158,7 +162,7 @@ export default function CheckoutPage() {
<Text className='addr-phone'>{address.phone}</Text> <Text className='addr-phone'>{address.phone}</Text>
</View> </View>
<Text className='addr-detail'> <Text className='addr-detail'>
{address.region ? address.region.join(' ') : ''} {address.detail} {formatAddress(address.region, address.detail)}
</Text> </Text>
</View> </View>
) : ( ) : (
@@ -201,7 +205,7 @@ export default function CheckoutPage() {
{addr.isDefault && <Text className='addr-picker-default'></Text>} {addr.isDefault && <Text className='addr-picker-default'></Text>}
</View> </View>
<Text className='addr-picker-detail'> <Text className='addr-picker-detail'>
{addr.region ? addr.region.join(' ') : ''} {addr.detail} {formatAddress(addr.region, addr.detail)}
</Text> </Text>
</View> </View>
))} ))}
+10 -44
View File
@@ -289,59 +289,25 @@
line-height: 1; line-height: 1;
} }
/* --- Bottom CTA Bar --- */ /* --- Bottom Action Bar — 样式由全局 .action-bar 提供,本地只补充价格摘要 --- */
.shop-cta-bar { .action-bar .price-summary {
position: fixed; flex-shrink: 0;
bottom: 0;
left: 0;
right: 0;
z-index: 60;
padding: 20rpx 32rpx calc(20rpx + env(safe-area-inset-bottom, 0px));
display: flex;
align-items: center;
justify-content: space-between;
gap: 24rpx;
backdrop-filter: blur(16rpx) saturate(1.2);
-webkit-backdrop-filter: blur(16rpx) saturate(1.2);
box-shadow: var(--shadow-card);
transition: background-color 0.4s ease;
} }
.shop-cta-price-col { .summary-label {
display: flex; font-size: 22rpx;
align-items: baseline; color: var(--text-secondary);
gap: 12rpx; display: block;
} }
.shop-cta-price { .summary-price {
font-size: 40rpx; font-size: 40rpx;
font-weight: 700; font-weight: 700;
color: var(--accent-primary); color: var(--accent-primary);
} }
.shop-cta-original { .summary-original {
font-size: 24rpx; font-size: 24rpx;
color: #8a7e72; color: var(--text-muted);
text-decoration: line-through; text-decoration: line-through;
} }
.shop-cta-btn {
flex: 1;
max-width: 260rpx;
background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-primary-strong) 99%);
color: #fff;
border-radius: 50rpx;
padding: 24rpx 48rpx;
font-size: 30rpx;
font-weight: 600;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-card);
}
.shop-cta-btn-text {
color: inherit;
font-weight: 600;
}
+14 -15
View File
@@ -108,7 +108,7 @@ export default function ShopDetailPage() {
if (!product) { if (!product) {
return ( return (
<View className="shop-detail-page"> <View className="shop-detail-page theme-dark">
<ThemedPageMeta darkTop /> <ThemedPageMeta darkTop />
<Text style={{ color: '#fff', padding: '40rpx' }}></Text> <Text style={{ color: '#fff', padding: '40rpx' }}></Text>
</View> </View>
@@ -116,7 +116,7 @@ export default function ShopDetailPage() {
} }
return ( return (
<View className="shop-detail-page"> <View className="shop-detail-page theme-dark">
<ThemedPageMeta darkTop /> <ThemedPageMeta darkTop />
{/* Fixed Hero */} {/* Fixed Hero */}
<View className="shop-hero-fixed"> <View className="shop-hero-fixed">
@@ -268,24 +268,23 @@ export default function ShopDetailPage() {
<Text className="shop-back-arrow"></Text> <Text className="shop-back-arrow"></Text>
</View> </View>
{/* Bottom CTA — fixed, glass, links to existing product page */} {/* Bottom CTA — 全局毛玻璃 action-bar,沿用 product/checkout 模式 */}
<View <View className="action-bar">
className="shop-cta-bar" <View className="price-summary">
style={{ backgroundColor: `rgba(${tone[0]}, ${tone[1]}, ${tone[2]}, 0.92)` }} <Text className="summary-label"></Text>
> <Text className="summary-price">¥{product.price}</Text>
<View className="shop-cta-price-col">
<Text className="shop-cta-price">¥{product.price}</Text>
{product.originalPrice && product.originalPrice > product.price && ( {product.originalPrice && product.originalPrice > product.price && (
<Text className="shop-cta-original">¥{product.originalPrice}</Text> <Text className="summary-original">¥{product.originalPrice}</Text>
)} )}
</View> </View>
<View <View className="btn-secondary" onTap={() => Taro.navigateBack()}>
className="shop-cta-btn" <Text></Text>
onTap={() => Taro.navigateTo({ url: `/pages/product/index?id=${product.id}` })} </View>
> <View className="btn-primary" onTap={() => Taro.navigateTo({ url: `/pages/product/index?id=${product.id}` })}>
<Text className="shop-cta-btn-text"></Text> <Text></Text>
</View> </View>
</View> </View>
<View className="safe-bottom-placeholder" />
</View> </View>
) )
} }