fix: task 6 review round 1
This commit is contained in:
@@ -36,7 +36,7 @@ export default function CheckoutPage() {
|
||||
}
|
||||
Taro.showModal({
|
||||
title: '确认下单',
|
||||
content: `确认后将从设计清单生成订单,并寄送至:\n${address.region ? address.region.join(' ') : ''} ${address.detail}`,
|
||||
content: `确认后将从设计清单生成订单,并寄送至:\n${formatAddress(address.region, address.detail)}`,
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
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 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) {
|
||||
return (
|
||||
@@ -158,7 +162,7 @@ export default function CheckoutPage() {
|
||||
<Text className='addr-phone'>{address.phone}</Text>
|
||||
</View>
|
||||
<Text className='addr-detail'>
|
||||
{address.region ? address.region.join(' ') : ''} {address.detail}
|
||||
{formatAddress(address.region, address.detail)}
|
||||
</Text>
|
||||
</View>
|
||||
) : (
|
||||
@@ -201,7 +205,7 @@ export default function CheckoutPage() {
|
||||
{addr.isDefault && <Text className='addr-picker-default'>默认</Text>}
|
||||
</View>
|
||||
<Text className='addr-picker-detail'>
|
||||
{addr.region ? addr.region.join(' ') : ''} {addr.detail}
|
||||
{formatAddress(addr.region, addr.detail)}
|
||||
</Text>
|
||||
</View>
|
||||
))}
|
||||
|
||||
@@ -289,59 +289,25 @@
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* --- Bottom CTA Bar --- */
|
||||
.shop-cta-bar {
|
||||
position: fixed;
|
||||
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;
|
||||
/* --- Bottom Action Bar — 样式由全局 .action-bar 提供,本地只补充价格摘要 --- */
|
||||
.action-bar .price-summary {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.shop-cta-price-col {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 12rpx;
|
||||
.summary-label {
|
||||
font-size: 22rpx;
|
||||
color: var(--text-secondary);
|
||||
display: block;
|
||||
}
|
||||
|
||||
.shop-cta-price {
|
||||
.summary-price {
|
||||
font-size: 40rpx;
|
||||
font-weight: 700;
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
.shop-cta-original {
|
||||
.summary-original {
|
||||
font-size: 24rpx;
|
||||
color: #8a7e72;
|
||||
color: var(--text-muted);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ export default function ShopDetailPage() {
|
||||
|
||||
if (!product) {
|
||||
return (
|
||||
<View className="shop-detail-page">
|
||||
<View className="shop-detail-page theme-dark">
|
||||
<ThemedPageMeta darkTop />
|
||||
<Text style={{ color: '#fff', padding: '40rpx' }}>商品不存在</Text>
|
||||
</View>
|
||||
@@ -116,7 +116,7 @@ export default function ShopDetailPage() {
|
||||
}
|
||||
|
||||
return (
|
||||
<View className="shop-detail-page">
|
||||
<View className="shop-detail-page theme-dark">
|
||||
<ThemedPageMeta darkTop />
|
||||
{/* Fixed Hero */}
|
||||
<View className="shop-hero-fixed">
|
||||
@@ -268,24 +268,23 @@ export default function ShopDetailPage() {
|
||||
<Text className="shop-back-arrow">←</Text>
|
||||
</View>
|
||||
|
||||
{/* Bottom CTA — fixed, glass, links to existing product page */}
|
||||
<View
|
||||
className="shop-cta-bar"
|
||||
style={{ backgroundColor: `rgba(${tone[0]}, ${tone[1]}, ${tone[2]}, 0.92)` }}
|
||||
>
|
||||
<View className="shop-cta-price-col">
|
||||
<Text className="shop-cta-price">¥{product.price}</Text>
|
||||
{/* Bottom CTA — 全局毛玻璃 action-bar,沿用 product/checkout 模式 */}
|
||||
<View className="action-bar">
|
||||
<View className="price-summary">
|
||||
<Text className="summary-label">起价</Text>
|
||||
<Text className="summary-price">¥{product.price}</Text>
|
||||
{product.originalPrice && product.originalPrice > product.price && (
|
||||
<Text className="shop-cta-original">¥{product.originalPrice}</Text>
|
||||
<Text className="summary-original">¥{product.originalPrice}</Text>
|
||||
)}
|
||||
</View>
|
||||
<View
|
||||
className="shop-cta-btn"
|
||||
onTap={() => Taro.navigateTo({ url: `/pages/product/index?id=${product.id}` })}
|
||||
>
|
||||
<Text className="shop-cta-btn-text">立即定制</Text>
|
||||
<View className="btn-secondary" onTap={() => Taro.navigateBack()}>
|
||||
<Text>返回</Text>
|
||||
</View>
|
||||
<View className="btn-primary" onTap={() => Taro.navigateTo({ url: `/pages/product/index?id=${product.id}` })}>
|
||||
<Text>立即定制</Text>
|
||||
</View>
|
||||
</View>
|
||||
<View className="safe-bottom-placeholder" />
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user