<template>
    <!-- 首页 - 印美达 Inkreach 按需定制平台 -->
    <view class="home">
        <!-- 自定义导航栏 -->
        <view class="nav-bar" :style="'padding-top: ' + statusBarHeight + 'px;'">
            <view class="nav-content">
                <view class="nav-logo" @tap="goHome">
                    <text class="logo-text">inkreach</text>
                    <text class="logo-cn">印美达</text>
                </view>
                <view class="nav-actions">
                    <text class="nav-btn" @tap="goProducts">产品中心</text>
                    <view class="nav-login" @tap="goProducts">立即开始</view>
                </view>
            </view>
        </view>

        <!-- 占位 -->
        <view :style="'height: ' + (statusBarHeight + 44) + 'px;'"></view>

        <!-- Hero 首屏 -->
        <view class="hero">
            <view class="hero-bg"></view>
            <view class="hero-content">
                <view class="hero-title">
                    <text class="hero-title-main">一站定制</text>
                    <text class="hero-title-main">链通全球</text>
                </view>
                <text class="hero-subtitle">从定制设计到生产发货如此简单</text>
                <view class="hero-tags">
                    <view class="hero-tag">0库存</view>
                    <view class="hero-tag">1件起订</view>
                    <view class="hero-tag">全球配送</view>
                </view>
                <view class="hero-cta" @tap="goProducts">
                    <text>免费开始</text>
                </view>
            </view>
            <!-- 3D插画区域 -->
            <view class="hero-illustration">
                <view class="hero-illust-item hero-illist-tshirt">
                    <view class="illust-placeholder tshirt"></view>
                </view>
                <view class="hero-illust-item hero-illist-bag">
                    <view class="illust-placeholder bag"></view>
                </view>
                <view class="hero-illust-item hero-illist-box">
                    <view class="illust-placeholder box"></view>
                </view>
            </view>
        </view>

        <!-- 信任指标 -->
        <view class="trust-section">
            <text class="section-title-small">全球5000+卖家信赖我们的平台</text>
            <view class="trust-grid">
                <view class="trust-card">
                    <text class="trust-number">1000万+</text>
                    <text class="trust-label">订单履约</text>
                </view>
                <view class="trust-card">
                    <text class="trust-number">20+</text>
                    <text class="trust-label">国家覆盖</text>
                </view>
                <view class="trust-card">
                    <text class="trust-number">500+</text>
                    <text class="trust-label">合作工厂</text>
                </view>
                <view class="trust-card">
                    <text class="trust-number">24H</text>
                    <text class="trust-label">极速发货</text>
                </view>
            </view>
        </view>

        <!-- 4步流程 -->
        <view class="steps-section">
            <text class="section-title">4步开始你的按需定制生意</text>
            <view class="steps-list">
                <view :class="'step-item ' + (currentStep === 1 ? 'active' : '')" @tap="selectStep" data-step="1">
                    <view class="step-number">01</view>
                    <view class="step-info">
                        <text class="step-title">选择产品</text>
                        <text class="step-desc">从全球POD货盘中选择热销产品</text>
                    </view>
                </view>
                <view :class="'step-item ' + (currentStep === 2 ? 'active' : '')" @tap="selectStep" data-step="2">
                    <view class="step-number">02</view>
                    <view class="step-info">
                        <text class="step-title">上传设计</text>
                        <text class="step-desc">使用在线设计工具创建专属图案</text>
                    </view>
                </view>
                <view :class="'step-item ' + (currentStep === 3 ? 'active' : '')" @tap="selectStep" data-step="3">
                    <view class="step-number">03</view>
                    <view class="step-info">
                        <text class="step-title">在线销售</text>
                        <text class="step-desc">一键上架到Shopify等电商平台</text>
                    </view>
                </view>
                <view :class="'step-item ' + (currentStep === 4 ? 'active' : '')" @tap="selectStep" data-step="4">
                    <view class="step-number">04</view>
                    <view class="step-info">
                        <text class="step-title">生产配送</text>
                        <text class="step-desc">自动生产全球发货履约无忧</text>
                    </view>
                </view>
            </view>
            <view class="step-visual">
                <view class="step-visual-card">
                    <view :class="'step-visual-icon step-icon-' + currentStep">
                        <text class="step-visual-emoji">{{ stepEmoji }}</text>
                    </view>
                    <text class="step-visual-text">{{ stepDesc }}</text>
                </view>
            </view>
        </view>

        <!-- 全球POD货盘 -->
        <view class="catalog-section">
            <text class="section-title">全球POD货盘</text>
            <text class="section-subtitle">多元化产品选择，满足场景化需求</text>
            <scroll-view class="category-tabs" :scroll-x="true" :enhanced="true" :show-scrollbar="false">
                <view :class="'cat-tab ' + (activeCategory === item.id ? 'active' : '')" @tap="selectCategory" :data-id="item.id" v-for="(item, index) in categories" :key="index">
                    {{ item.name }}
                </view>
            </scroll-view>
            <view class="product-preview-grid">
                <view class="product-preview-card" @tap="goProductDetail" :data-id="item.id" v-for="(item, index) in previewProducts" :key="index">
                    <view class="product-preview-img" :style="'background: ' + item.color + ';'">
                        <text class="product-preview-emoji">{{ item.emoji }}</text>
                    </view>

                    <view class="product-preview-info">
                        <text class="product-preview-name">{{ item.name }}</text>
                        <text class="product-preview-price">¥{{ item.price }}起</text>
                    </view>
                </view>
            </view>
            <view class="see-more" @tap="goProducts">
                <text>查看更多产品</text>
                <text class="arrow">></text>
            </view>
        </view>

        <!-- 平台功能 -->
        <view class="features-section">
            <text class="section-title">用强大功能，开启盈利快车道</text>
            <view class="features-grid">
                <view class="feature-card" v-for="(item, index) in features" :key="index">
                    <view class="feature-icon" :style="'background: ' + item.bgColor + ';'">
                        <text class="feature-emoji">{{ item.emoji }}</text>
                    </view>

                    <text class="feature-title">{{ item.title }}</text>

                    <text class="feature-desc">{{ item.desc }}</text>
                </view>
            </view>
        </view>

        <!-- 为什么选择 -->
        <view class="why-section">
            <text class="section-title">为什么选择Inkreach?</text>
            <view class="why-grid">
                <view class="why-card" v-for="(item, index) in reasons" :key="index">
                    <view class="why-icon">
                        <text class="why-emoji">{{ item.emoji }}</text>
                    </view>

                    <text class="why-title">{{ item.title }}</text>

                    <text class="why-desc">{{ item.desc }}</text>
                </view>
            </view>
        </view>

        <!-- 公司简介 -->
        <view class="company-section">
            <text class="section-title">公司简介</text>
            <view class="company-card">
                <view class="company-headline">
                    <text>用科技重新定义服装供应链</text>
                    <text>让每一个创意，都能高效抵达全球</text>
                </view>
                <view class="company-content">
                    <view class="company-block">
                        <text class="company-block-title">服务对象与场景</text>
                        <text class="company-block-text">
                            服务于数千家跨境独立站、TikTok、TEMU、SHEIN等平台商家，提供从海外生产到末端物流的一站式供应链服务，让电商创业者专注增长，无惧后端履约。
                        </text>
                    </view>
                    <view class="company-block">
                        <text class="company-block-title">愿景</text>
                        <text class="company-block-text">
                            我们坚信，每一个创意都值得被完美呈现。INKREACH将持续深耕智能供应链生态，用科技消除制造壁垒，让全球创业者专注发挥创造力。
                        </text>
                    </view>
                </view>
                <view class="company-stats">
                    <view class="company-stat" v-for="(item, index) in companyStats" :key="index">
                        <text class="company-stat-number">{{ item.value }}</text>

                        <text class="company-stat-label">{{ item.label }}</text>
                    </view>
                </view>
            </view>
        </view>

        <!-- 用户案例 -->
        <view class="cases-section">
            <text class="section-title">用户案例</text>
            <scroll-view class="cases-scroll" :scroll-x="true" :enhanced="true" :show-scrollbar="false">
                <view class="case-card" v-for="(item, index) in cases" :key="index">
                    <view class="case-image" :style="'background: ' + item.bgColor + ';'">
                        <text class="case-emoji">{{ item.emoji }}</text>
                    </view>

                    <view class="case-info">
                        <text class="case-title">{{ item.title }}</text>
                        <view class="case-tags">
                            <view class="case-tag" v-for="(tag, index1) in item.tags" :key="index1">{{ tag }}</view>
                        </view>
                        <view class="case-metrics">
                            <view class="case-metric">
                                <text class="case-metric-value">{{ item.roi }}</text>
                                <text class="case-metric-label">ROI</text>
                            </view>
                            <view class="case-metric">
                                <text class="case-metric-value">{{ item.revenue }}</text>
                                <text class="case-metric-label">月收入</text>
                            </view>
                        </view>
                    </view>
                </view>
            </scroll-view>
        </view>

        <!-- 最终CTA -->
        <view class="cta-section">
            <view class="cta-bg"></view>
            <view class="cta-content">
                <view class="cta-title">
                    <text>开始你的POD生意</text>
                    <text>现在就行动</text>
                </view>
                <text class="cta-desc">加入成千上万的成功卖家，开始你的定制商品生意</text>
                <view class="cta-input-wrap">
                    <input class="cta-input" placeholder="输入邮箱开始免费试用" placeholder-class="cta-placeholder" />
                    <view class="cta-btn" @tap="goProducts">立即注册</view>
                </view>
            </view>
        </view>

        <!-- 底部 -->
        <view class="footer">
            <view class="footer-top">
                <view class="footer-logo">
                    <text class="footer-logo-en">inkreach</text>
                    <text class="footer-logo-cn">印美达</text>
                </view>
                <text class="footer-slogan">全球POD定制平台，服务中国卖家出海</text>
            </view>
            <view class="footer-links">
                <view class="footer-col">
                    <text class="footer-col-title">产品</text>
                    <text class="footer-link">定制卫衣</text>
                    <text class="footer-link">定制T恤</text>
                    <text class="footer-link">定制包包</text>
                </view>
                <view class="footer-col">
                    <text class="footer-col-title">支持</text>
                    <text class="footer-link">物流说明</text>
                    <text class="footer-link">客服帮助</text>
                    <text class="footer-link">售后客服</text>
                </view>
                <view class="footer-col">
                    <text class="footer-col-title">联系</text>
                    <text class="footer-link">联系我们</text>
                    <text class="footer-link">官方公众号</text>
                </view>
            </view>
            <view class="footer-bottom">
                <text class="footer-copyright">© 2026 INKREACH 印美达全球 All Rights Reserved</text>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            statusBarHeight: 20,
            currentStep: 2,
            stepEmoji: '🎨',
            stepDesc: '使用在线设计工具创建你的专属图案，支持上传图片、添加文字、智能排版',
            activeCategory: 'all',

            categories: [
                {
                    id: 'all',
                    name: '全部'
                },
                {
                    id: 'tshirt',
                    name: 'T恤'
                },
                {
                    id: 'hoodie',
                    name: '卫衣'
                },
                {
                    id: 'bag',
                    name: '包包'
                },
                {
                    id: 'kids',
                    name: '童装'
                },
                {
                    id: 'home',
                    name: '家居'
                }
            ],

            previewProducts: [
                {
                    id: 1,
                    name: '180G牛奶丝T恤 DG120',
                    price: '28.00',
                    color: '#F5F5F5',
                    emoji: '👕'
                },
                {
                    id: 2,
                    name: '纯棉连帽卫衣 HD200',
                    price: '59.00',
                    color: '#E8E8E8',
                    emoji: '🧥'
                },
                {
                    id: 3,
                    name: '帆布托特包 BG150',
                    price: '15.00',
                    color: '#F0F0F0',
                    emoji: '👜'
                },
                {
                    id: 4,
                    name: '儿童纯棉T恤 KD100',
                    price: '22.00',
                    color: '#F8F8F8',
                    emoji: '👶'
                }
            ],

            features: [
                {
                    id: 1,
                    title: '设计工具',
                    desc: '在线设计器，海量模板自由创作',
                    emoji: '🎨',
                    bgColor: '#FFF0E5'
                },
                {
                    id: 2,
                    title: '自动化履约',
                    desc: '订单自动分配工厂生产发货',
                    emoji: '⚙️',
                    bgColor: '#E5F5FF'
                },
                {
                    id: 3,
                    title: '全球配送',
                    desc: '覆盖200+国家地区快速达',
                    emoji: '🌍',
                    bgColor: '#F0FFE5'
                },
                {
                    id: 4,
                    title: '店铺集成',
                    desc: '对接Shopify等主流平台',
                    emoji: '🔗',
                    bgColor: '#FFF5E5'
                }
            ],

            reasons: [
                {
                    id: 1,
                    title: '零库存',
                    desc: '无需囤货按需生产',
                    emoji: '📦'
                },
                {
                    id: 2,
                    title: '快速生产',
                    desc: '48小时极速出货',
                    emoji: '⚡'
                },
                {
                    id: 3,
                    title: '优质产品',
                    desc: '严格品质管控',
                    emoji: '✨'
                },
                {
                    id: 4,
                    title: '全球配送',
                    desc: '覆盖200+国家',
                    emoji: '🚀'
                }
            ],

            companyStats: [
                {
                    value: '5000+',
                    label: '合作卖家'
                },
                {
                    value: '500+',
                    label: '合作工厂'
                },
                {
                    value: '20+',
                    label: '覆盖国家'
                },
                {
                    value: '1000万+',
                    label: '订单履约'
                }
            ],

            cases: [
                {
                    id: 1,
                    title: '潮牌T恤定制',
                    tags: ['T恤', '烫画'],
                    roi: '260%',
                    revenue: '$12K',
                    bgColor: '#F5F5F5',
                    emoji: '👕'
                },
                {
                    id: 2,
                    title: '连帽卫衣品牌',
                    tags: ['卫衣', '刺绣'],
                    roi: '300%',
                    revenue: '$25K',
                    bgColor: '#E8E8E8',
                    emoji: '🧥'
                },
                {
                    id: 3,
                    title: '环保帆布包',
                    tags: ['包包', '丝印'],
                    roi: '180%',
                    revenue: '$8K',
                    bgColor: '#F0F0F0',
                    emoji: '👜'
                }
            ],

            tag: ''
        };
    },
    onLoad() {
        const app = getApp();
        this.setData({
            statusBarHeight: app.globalData.statusBarHeight || 20
        });
    },
    methods: {
        selectStep(e) {
            const step = e.currentTarget.dataset.step;
            const stepData = {
                1: {
                    emoji: '📦',
                    desc: '从全球POD货盘中选择热销产品，涵盖服装、配饰、家居等多品类'
                },
                2: {
                    emoji: '🎨',
                    desc: '使用在线设计工具创建你的专属图案，支持上传图片、添加文字、智能排版'
                },
                3: {
                    emoji: '🛒',
                    desc: '一键发布到Shopify、TikTok Shop等主流电商平台，自动同步商品信息'
                },
                4: {
                    emoji: '🚚',
                    desc: '订单自动分配至最近工厂生产，全球物流配送直达消费者手中'
                }
            };
            this.setData({
                currentStep: step,
                stepEmoji: stepData[step].emoji,
                stepDesc: stepData[step].desc
            });
        },

        selectCategory(e) {
            this.setData({
                activeCategory: e.currentTarget.dataset.id
            });
        },

        goProducts() {
            uni.switchTab({
                url: '/pages/products/products'
            });
        },

        goHome() {
            uni.pageScrollTo({
                scrollTop: 0,
                duration: 300
            });
        },

        goProductDetail(e) {
            const id = e.currentTarget.dataset.id;
            uni.navigateTo({
                url: `/pages/product-detail/product-detail?id=${id}`
            });
        }
    }
};
</script>
<style>
@import './index.css';
</style>
