总部后端,开发计划-任务列表-来源工单支持链接 总部端-开发计划-任务列表-编辑任务-增加“开发中”状态 账单日期修正
This commit is contained in:
@@ -83,7 +83,7 @@ function formatBenefitCorner(p: Product): string {
|
||||
}
|
||||
|
||||
export default function HomePage() {
|
||||
const [showSplash, setShowSplash] = useState(() => !hasHomeSplashPlayed());
|
||||
const [showSplash, setShowSplash] = useState(() => false); // !hasHomeSplashPlayed()
|
||||
const [activeAroma, setActiveAroma] = useState<AromaKey>('QINGXIANG');
|
||||
const [products, setProducts] = useState<Product[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
@@ -35,8 +35,15 @@ import {
|
||||
toWeappShareTimeline,
|
||||
} from '../../lib/wechat-share';
|
||||
import iconHome from '../../assets/tabbar/home.png';
|
||||
import iconStoreBenefit from '../../assets/icons/store-benefit-y.png';
|
||||
import { usePageView } from '../../lib/usePageView';
|
||||
|
||||
/** 封面斜角权益额:SKU benefitAmount ?? 商品 benefitDisplay ?? 售价 */
|
||||
function formatBenefitCorner(amount: number): string {
|
||||
if (!Number.isFinite(amount) || amount <= 0) return '';
|
||||
return String(Math.round(amount));
|
||||
}
|
||||
|
||||
type Product = ProductImageSource & {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -157,6 +164,14 @@ export default function ProductDetailPage() {
|
||||
}, [product, specEnabled, skus, selected, attrs]);
|
||||
|
||||
const displayPrice = activeSku ? Number(activeSku.price) : Number(product?.price ?? 0);
|
||||
const benefitCorner = formatBenefitCorner(
|
||||
Number(
|
||||
activeSku?.benefitAmount ??
|
||||
product?.benefitDisplay ??
|
||||
product?.benefitAmount ??
|
||||
displayPrice,
|
||||
),
|
||||
);
|
||||
const fulfillment = activeSku
|
||||
? {
|
||||
allowOnlinePurchase: activeSku.allowOnlinePurchase,
|
||||
@@ -271,6 +286,20 @@ export default function ProductDetailPage() {
|
||||
<View className="product-detail-main">
|
||||
<View className="product-detail-hero full-bleed">
|
||||
<ProductCarousel images={carouselImages} alt={product.name} variant="detail" previewable />
|
||||
{benefitCorner ? (
|
||||
<View className="product-detail-benefit-ribbon-clip">
|
||||
<View className="product-detail-benefit-ribbon">
|
||||
<View className="product-detail-benefit-ribbon-dk">
|
||||
<Image
|
||||
className="product-detail-benefit-ribbon-dk-icon"
|
||||
src={iconStoreBenefit}
|
||||
mode="aspectFit"
|
||||
/>
|
||||
</View>
|
||||
<Text className="product-detail-benefit-ribbon-num">{benefitCorner}</Text>
|
||||
</View>
|
||||
</View>
|
||||
) : null}
|
||||
</View>
|
||||
|
||||
<View className="product-detail-info">
|
||||
@@ -288,6 +317,21 @@ export default function ProductDetailPage() {
|
||||
<Text className="product-detail-subtitle">{activeSku.specText}</Text>
|
||||
) : null}
|
||||
|
||||
{allowOnline || allowOnSite ? (
|
||||
<View className="product-detail-fulfill-tags">
|
||||
{allowOnline ? (
|
||||
<Text className="product-detail-fulfill-tag product-detail-fulfill-tag--local">
|
||||
同城订单24小时内送达
|
||||
</Text>
|
||||
) : null}
|
||||
{allowOnSite ? (
|
||||
<Text className="product-detail-fulfill-tag product-detail-fulfill-tag--pickup">
|
||||
支持现场取货
|
||||
</Text>
|
||||
) : null}
|
||||
</View>
|
||||
) : null}
|
||||
|
||||
{specEnabled ? (
|
||||
<View className="product-detail-specs">
|
||||
{attrs.map((attr) => (
|
||||
|
||||
Reference in New Issue
Block a user