中科集团HTML托管
返回管理
编辑页面
页面标题
有效期
7天
30天
90天
修改后将从当前时间重新计算过期时间
CSS文件(可选)
/* 基础变量 */ :root { --primary: #ff4757; --primary-light: #ff6b81; --primary-dark: #e8414a; --bg-color: #f5f5f5; --text-primary: #333; --text-secondary: #666; --text-light: #999; --border-color: #eee; --white: #fff; --shadow: 0 2px 8px rgba(0,0,0,0.08); --safe-bottom: env(safe-area-inset-bottom, 0px); } /* 重置样式 */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: var(--bg-color); color: var(--text-primary); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; } #app { max-width: 430px; margin: 0 auto; background: var(--bg-color); min-height: 100vh; position: relative; } /* 页面通用 */ .page { display: none; padding-bottom: calc(60px + var(--safe-bottom)); min-height: 100vh; } .page-active { display: block; } /* 顶部搜索 */ .home-header { padding: 12px 16px; background: var(--primary); position: sticky; top: 0; z-index: 100; } .search-bar { display: flex; align-items: center; background: var(--white); border-radius: 20px; padding: 8px 16px; } .search-icon { width: 18px; height: 18px; color: var(--text-light); margin-right: 8px; } .search-bar input { flex: 1; border: none; outline: none; font-size: 14px; background: transparent; } .search-bar input::placeholder { color: var(--text-light); } /* Banner轮播 */ .banner-section { position: relative; margin: 12px; border-radius: 12px; overflow: hidden; } .banner-swiper { position: relative; } .banner-slide { height: 150px; display: none; position: relative; } .banner-slide.active { display: block; } .banner-content { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); color: var(--white); } .banner-content h2 { font-size: 20px; margin-bottom: 6px; } .banner-content p { font-size: 14px; opacity: 0.9; } .banner-dots { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; } .dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); } .dot.active { background: var(--white); width: 16px; border-radius: 3px; } /* 商品分类 */ .category-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 12px; background: var(--white); border-radius: 12px; margin: 0 12px; } .category-item { display: flex; flex-direction: column; align-items: center; margin-bottom: 16px; cursor: pointer; } .category-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; } .category-icon svg { width: 28px; height: 28px; } .category-item span { font-size: 12px; color: var(--text-secondary); } /* 营销活动 */ .activity-section { padding: 16px 12px; background: var(--white); margin: 12px; border-radius: 12px; } .section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; } .section-header h3 { font-size: 16px; font-weight: 600; } .more-btn { font-size: 12px; color: var(--text-light); cursor: pointer; } .countdown { display: flex; align-items: center; gap: 4px; } .countdown-text { font-size: 12px; color: var(--text-light); margin-right: 4px; } .time-block { background: var(--primary); color: var(--white); padding: 2px 6px; border-radius: 4px; font-size: 12px; font-weight: 600; } .flash-sale-scroll { display: flex; gap: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; } .flash-sale-scroll::-webkit-scrollbar { display: none; } .flash-item { flex-shrink: 0; width: 100px; cursor: pointer; } .flash-img { position: relative; width: 100px; height: 100px; border-radius: 8px; overflow: hidden; background: #f9f9f9; } .flash-img img { width: 100%; height: 100%; object-fit: cover; } .sale-tag { position: absolute; top: 0; left: 0; background: var(--primary); color: var(--white); font-size: 10px; padding: 2px 6px; border-radius: 0 0 6px 0; } .flash-info { margin-top: 8px; } .flash-info .price { font-size: 14px; color: var(--primary); font-weight: 600; } .flash-info .original { font-size: 11px; color: var(--text-light); text-decoration: line-through; margin-left: 4px; } /* 活动卡片 */ .activity-banners { display: flex; gap: 12px; padding: 0 12px; margin-bottom: 16px; } .activity-card { flex: 1; height: 80px; border-radius: 12px; overflow: hidden; position: relative; cursor: pointer; } .activity-bg { position: absolute; inset: 0; } .activity-content { position: relative; padding: 12px; color: var(--white); height: 100%; display: flex; flex-direction: column; justify-content: center; } .activity-content h4 { font-size: 14px; margin-bottom: 4px; } .activity-content p { font-size: 11px; opacity: 0.9; } .activity-btn { display: inline-block; background: rgba(255,255,255,0.2); padding: 4px 8px; border-radius: 10px; font-size: 10px; margin-top: 6px; width: fit-content; } /* 商品列表 */ .product-section { padding: 16px 12px; background: var(--white); margin: 0 12px 12px; border-radius: 12px; } .product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; } .product-card { background: #fafafa; border-radius: 8px; overflow: hidden; cursor: pointer; } .product-img { width: 100%; height: 150px; background: #f0f0f0; overflow: hidden; } .product-img img { width: 100%; height: 100%; object-fit: cover; } .product-info { padding: 10px; } .product-info h4 { font-size: 14px; font-weight: 500; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } .product-desc { font-size: 11px; color: var(--text-light); margin-bottom: 8px; } .product-bottom { display: flex; justify-content: space-between; align-items: center; } .product-bottom .price { color: var(--primary); font-size: 16px; font-weight: 600; } .add-cart-btn { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; } .add-cart-btn svg { width: 16px; height: 16px; color: var(--white); } /* 页面通用头部 */ .page-header { display: flex; align-items: center; justify-content: center; padding: 12px 16px; background: var(--white); position: sticky; top: 0; z-index: 100; } .back-btn, .share-btn { width: 32px; height: 32px; border: none; background: none; cursor: pointer; display: flex; align-items: center; justify-content: center; } .back-btn svg, .share-btn svg { width: 22px; height: 22px; color: var(--text-primary); } .page-header h1 { flex: 1; text-align: center; font-size: 17px; font-weight: 600; } .edit-btn, .add-btn { font-size: 14px; color: var(--primary); background: none; border: none; cursor: pointer; } /* 分类页 */ .category-layout { display: flex; min-height: calc(100vh - 60px); } .category-sidebar { width: 80px; background: #f5f5f5; overflow-y: auto; } .sidebar-item { padding: 14px 8px; text-align: center; font-size: 13px; color: var(--text-secondary); cursor: pointer; position: relative; } .sidebar-item.active { background: var(--white); color: var(--primary); } .sidebar-item.active::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; background: var(--primary); border-radius: 0 2px 2px 0; } .category-content { flex: 1; padding: 12px; background: var(--white); } .content-banner { width: 100%; height: 100px; border-radius: 8px; overflow: hidden; margin-bottom: 16px; } .content-banner img { width: 100%; height: 100%; object-fit: cover; } .subcategory h4 { font-size: 14px; margin-bottom: 12px; color: var(--text-primary); } .sub-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; } .sub-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; } .sub-item img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; margin-bottom: 6px; } .sub-item span { font-size: 12px; color: var(--text-secondary); } /* 商品详情页 */ .detail-content { padding-bottom: 80px; } .detail-image { width: 100%; height: 350px; background: #f5f5f5; } .detail-image img { width: 100%; height: 100%; object-fit: cover; } .detail-info { padding: 16px; background: var(--white); } .detail-price { display: flex; align-items: baseline; margin-bottom: 12px; } .current-price { font-size: 24px; color: var(--primary); font-weight: 700; } .original-price { font-size: 14px; color: var(--text-light); text-decoration: line-through; margin-left: 8px; } .discount-tag { background: #fff0f0; color: var(--primary); font-size: 11px; padding: 2px 6px; border-radius: 4px; margin-left: 8px; } .detail-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; } .detail-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; } .detail-tags { display: flex; gap: 8px; } .detail-tags span { font-size: 11px; color: var(--primary); background: #fff0f0; padding: 3px 8px; border-radius: 4px; } .detail-specs { margin-top: 10px; padding: 12px 16px; background: var(--white); } .spec-item { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f0f0f0; } .spec-item:last-child { border-bottom: none; } .spec-label { color: var(--text-light); font-size: 13px; } .spec-value { color: var(--text-primary); font-size: 13px; display: flex; align-items: center; gap: 4px; } .spec-value svg { width: 14px; height: 14px; } .detail-section { padding: 16px; background: var(--white); margin-top: 10px; } .detail-section h3 { font-size: 15px; margin-bottom: 12px; } .review-item { padding: 12px 0; } .review-header { display: flex; align-items: center; margin-bottom: 8px; } .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light); color: var(--white); display: flex; align-items: center; justify-content: center; font-size: 14px; margin-right: 10px; } .review-meta { flex: 1; } .username { display: block; font-size: 13px; color: var(--text-primary); } .date { font-size: 11px; color: var(--text-light); } .rating svg { width: 14px; height: 14px; } .review-content { font-size: 13px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 8px; } .review-images { display: flex; gap: 8px; } .review-images img { width: 60px; height: 60px; border-radius: 4px; object-fit: cover; } /* 详情页底部 */ .detail-footer { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; display: flex; background: var(--white); padding: 8px 12px; padding-bottom: calc(8px + var(--safe-bottom)); box-shadow: 0 -2px 10px rgba(0,0,0,0.05); z-index: 100; } .footer-icons { display: flex; gap: 8px; margin-right: 12px; } .icon-item { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 10px; cursor: pointer; } .icon-item svg { width: 22px; height: 22px; color: var(--text-secondary); } .icon-item span { font-size: 10px; color: var(--text-secondary); margin-top: 2px; } .cart-badge { position: absolute; top: -4px; right: 2px; background: var(--primary); color: var(--white); font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; } .footer-actions { flex: 1; display: flex; gap: 8px; } .footer-actions button { flex: 1; padding: 10px 0; border: none; border-radius: 20px; font-size: 14px; font-weight: 500; cursor: pointer; } .btn-add-cart { background: linear-gradient(135deg, #ffa502 0%, #ff9500 100%); color: var(--white); } .btn-buy-now { background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%); color: var(--white); } /* 购物车 */ .cart-content { padding: 12px; } .cart-store { background: var(--white); border-radius: 12px; overflow: hidden; } .store-header { display: flex; align-items: center; padding: 12px; border-bottom: 1px solid #f0f0f0; } .store-name { font-size: 14px; font-weight: 500; margin-left: 8px; } .cart-item { display: flex; align-items: center; padding: 12px; border-bottom: 1px solid #f0f0f0; } .cart-item:last-child { border-bottom: none; } .item-image { width: 70px; height: 70px; border-radius: 8px; overflow: hidden; margin: 0 10px; flex-shrink: 0; } .item-image img { width: 100%; height: 100%; object-fit: cover; } .item-info { flex: 1; min-width: 0; } .item-info h4 { font-size: 14px; font-weight: 500; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .item-spec { font-size: 12px; color: var(--text-light); } .item-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; } .item-price { font-size: 15px; color: var(--primary); font-weight: 600; } .quantity-control { display: flex; align-items: center; background: #f5f5f5; border-radius: 4px; } .qty-btn { width: 28px; height: 28px; border: none; background: none; font-size: 16px; cursor: pointer; color: var(--text-secondary); } .qty-num { width: 30px; text-align: center; font-size: 14px; } .cart-tip { display: flex; align-items: center; gap: 6px; padding: 12px; background: #fff9e6; border-radius: 8px; margin-top: 12px; font-size: 12px; color: #fa8c16; } .cart-tip svg { width: 16px; height: 16px; } .cart-footer { position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--white); box-shadow: 0 -2px 10px rgba(0,0,0,0.05); z-index: 99; } .all-select { display: flex; align-items: center; gap: 8px; } .all-select span { font-size: 14px; color: var(--text-primary); } .footer-right { display: flex; align-items: center; gap: 12px; } .total-info { display: flex; flex-direction: column; align-items: flex-end; } .total-info span:first-child { font-size: 12px; color: var(--text-light); } .total-price { font-size: 18px; color: var(--primary); font-weight: 700; } .checkout-btn { background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%); color: var(--white); border: none; padding: 10px 20px; border-radius: 20px; font-size: 14px; cursor: pointer; } /* Checkbox样式 */ .checkbox-wrap { position: relative; display: inline-flex; align-items: center; cursor: pointer; } .checkbox-wrap input { opacity: 0; width: 0; height: 0; } .checkmark { width: 20px; height: 20px; border: 2px solid #ddd; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s; } .checkbox-wrap input:checked + .checkmark { background: var(--primary); border-color: var(--primary); } .checkbox-wrap input:checked + .checkmark::after { content: ''; width: 5px; height: 9px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-bottom: 2px; } /* 个人中心 */ .profile-header-bg { background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%); padding: 20px 16px 30px; } .profile-header { display: flex; align-items: center; position: relative; } .avatar-large { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; border: 3px solid rgba(255,255,255,0.3); } .avatar-large img { width: 100%; height: 100%; object-fit: cover; } .profile-info { margin-left: 14px; color: var(--white); } .profile-info h2 { font-size: 18px; margin-bottom: 4px; } .profile-info p { font-size: 12px; opacity: 0.8; } .member-tag { display: inline-block; background: rgba(255,255,255,0.2); padding: 2px 8px; border-radius: 10px; font-size: 11px; margin-top: 6px; } .profile-edit { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.2); border: none; color: var(--white); padding: 6px 12px; border-radius: 15px; font-size: 12px; cursor: pointer; } .profile-edit svg { width: 14px; height: 14px; } /* 订单区域 */ .order-section { background: var(--white); margin: -20px 12px 12px; border-radius: 12px; padding: 16px; position: relative; z-index: 1; } .section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; } .section-title h3 { font-size: 15px; } .view-all { font-size: 12px; color: var(--text-light); display: flex; align-items: center; cursor: pointer; } .view-all svg { width: 14px; height: 14px; } .order-tabs { display: flex; justify-content: space-around; } .tab-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; } .tab-icon { position: relative; width: 40px; height: 40px; margin-bottom: 6px; } .tab-icon svg { width: 28px; height: 28px; color: var(--text-primary); } .tab-badge { position: absolute; top: -2px; right: -2px; background: var(--primary); color: var(--white); font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; } .tab-item span:last-child { font-size: 12px; color: var(--text-secondary); } /* 菜单列表 */ .menu-section { background: var(--white); margin: 0 12px; border-radius: 12px; overflow: hidden; } .menu-item { display: flex; align-items: center; padding: 14px 16px; cursor: pointer; } .menu-item:not(:last-child) { border-bottom: 1px solid #f0f0f0; } .menu-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-right: 12px; } .menu-icon svg { width: 18px; height: 18px; } .menu-item span { flex: 1; font-size: 14px; color: var(--text-primary); } .menu-item .arrow { width: 16px; height: 16px; color: var(--text-light); } /* 订单列表页 */ .order-tabs-nav { display: flex; background: var(--white); padding: 0 16px; border-bottom: 1px solid #f0f0f0; } .tab-nav-item { flex: 1; text-align: center; padding: 14px 0; font-size: 14px; color: var(--text-secondary); cursor: pointer; position: relative; } .tab-nav-item.active { color: var(--primary); } .tab-nav-item.active::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 40px; height: 2px; background: var(--primary); } .order-list { padding: 12px; } .order-card { background: var(--white); border-radius: 12px; padding: 14px; margin-bottom: 12px; } .order-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f0f0f0; } .order-store { font-size: 13px; font-weight: 500; } .order-status { font-size: 13px; color: var(--primary); } .order-status.received { color: #fa8c16; } .order-item { display: flex; align-items: center; margin-bottom: 10px; } .order-item img { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; } .order-item-info { flex: 1; margin-left: 10px; } .order-item-info h4 { font-size: 13px; font-weight: 500; margin-bottom: 4px; } .order-spec { font-size: 11px; color: var(--text-light); } .order-item-price { text-align: right; } .order-item-price span:first-child { display: block; font-size: 13px; color: var(--text-primary); } .order-qty { font-size: 11px; color: var(--text-light); } .order-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; } .order-total span:first-child { font-size: 12px; color: var(--text-light); } .order-total .total-price { font-size: 15px; font-weight: 600; color: var(--text-primary); } .order-actions { display: flex; gap: 8px; } .order-actions button { padding: 6px 14px; border-radius: 15px; font-size: 12px; cursor: pointer; border: 1px solid #ddd; background: var(--white); } .btn-cancel { color: var(--text-secondary); } .btn-pay { background: var(--primary) !important; color: var(--white) !important; border: none !important; } .btn-default { color: var(--text-primary); } .btn-confirm { background: var(--primary) !important; color: var(--white) !important; border: none !important; } /* 联系骑手按钮 */ .btn-rider { display: flex; align-items: center; gap: 4px; padding: 6px 12px !important; color: #27ae60 !important; border: 1px solid #27ae60 !important; background: var(--white) !important; } .btn-rider svg { width: 14px; height: 14px; } /* 地址列表 */ .address-list { padding: 12px; } .address-card { background: var(--white); border-radius: 12px; padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; cursor: pointer; } .address-card.default { border: 1px solid var(--primary); } .address-main { flex: 1; } .address-user { display: flex; align-items: center; margin-bottom: 8px; } .address-user .name { font-size: 15px; font-weight: 500; margin-right: 10px; } .address-user .phone { font-size: 14px; color: var(--text-secondary); } .default-tag { background: var(--primary); color: var(--white); font-size: 10px; padding: 2px 6px; border-radius: 4px; margin-left: 10px; } .address-detail { font-size: 13px; color: var(--text-secondary); line-height: 1.5; } .address-action svg { width: 20px; height: 20px; color: var(--text-light); } /* 底部导航 */ .tab-bar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; display: flex; background: var(--white); padding: 6px 0; padding-bottom: calc(6px + var(--safe-bottom)); box-shadow: 0 -2px 10px rgba(0,0,0,0.05); z-index: 1000; } .tab-item { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 4px 0; cursor: pointer; position: relative; } .tab-item svg { width: 24px; height: 24px; color: var(--text-light); } .tab-item span { font-size: 10px; color: var(--text-light); margin-top: 2px; } .tab-item.active svg { color: var(--primary); } .tab-item.active span { color: var(--primary); } .tab-badge { position: absolute; top: -2px; right: 50%; transform: translateX(12px); background: var(--primary); color: var(--white); font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; } /* Toast提示 */ .toast { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(0,0,0,0.75); color: var(--white); padding: 12px 24px; border-radius: 8px; font-size: 14px; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.3s; } .toast.show { opacity: 1; } /* 动画 */ @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .page-active { animation: fadeIn 0.3s ease; } /* 商品详情页底部操作栏 */ .detail-footer { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 430px; background: var(--white); display: flex; align-items: center; padding: 8px 12px; padding-bottom: calc(8px + var(--safe-bottom)); box-shadow: 0 -2px 10px rgba(0,0,0,0.08); z-index: 100; } .footer-icons { display: flex; gap: 16px; } .icon-item { display: flex; flex-direction: column; align-items: center; position: relative; cursor: pointer; } .icon-item svg { width: 22px; height: 22px; color: var(--text-primary); } .icon-item span { font-size: 10px; color: var(--text-secondary); margin-top: 2px; } .cart-badge { position: absolute; top: -4px; right: -8px; background: var(--primary); color: var(--white); font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; } .footer-actions { flex: 1; display: flex; margin-left: 16px; gap: 8px; } .footer-actions button { flex: 1; padding: 10px 0; border-radius: 20px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; } .btn-add-cart { background: linear-gradient(135deg, #ff9f43 0%, #ffc107 100%); color: var(--white); } .btn-buy-now { background: linear-gradient(135deg, #ff4757 0%, #ff6b81 100%); color: var(--white); } .footer-actions button:active { transform: scale(0.96); opacity: 0.9; }
JS文件(可选)
// 页面导航历史 let pageHistory = ['home']; // 当前页面 let currentPage = 'home'; // 显示页面 function showPage(pageId) { // 记录历史 if (currentPage !== pageId) { pageHistory.push(pageId); } currentPage = pageId; // 隐藏所有页面 document.querySelectorAll('.page').forEach(page => { page.classList.remove('page-active'); }); // 显示目标页面 const targetPage = document.getElementById('page-' + pageId); if (targetPage) { targetPage.classList.add('page-active'); } // 更新TabBar状态 updateTabBar(pageId); } // 返回上一页 function goBack() { if (pageHistory.length > 1) { pageHistory.pop(); const prevPage = pageHistory[pageHistory.length - 1]; currentPage = prevPage; document.querySelectorAll('.page').forEach(page => { page.classList.remove('page-active'); }); const targetPage = document.getElementById('page-' + prevPage); if (targetPage) { targetPage.classList.add('page-active'); } updateTabBar(prevPage); } } // 更新TabBar function updateTabBar(pageId) { document.querySelectorAll('.tab-item').forEach(item => { item.classList.remove('active'); }); const tabMap = { 'home': 0, 'category': 1, 'cart': 2, 'profile': 3 }; if (tabMap[pageId] !== undefined) { const tabs = document.querySelectorAll('.tab-bar .tab-item'); if (tabs[tabMap[pageId]]) { tabs[tabMap[pageId]].classList.add('active'); } } } // Banner轮播 let currentBanner = 0; const banners = document.querySelectorAll('.banner-slide'); const dots = document.querySelectorAll('.dot'); function nextBanner() { banners[currentBanner].classList.remove('active'); dots[currentBanner].classList.remove('active'); currentBanner = (currentBanner + 1) % banners.length; banners[currentBanner].classList.add('active'); dots[currentBanner].classList.add('active'); } // 自动轮播 setInterval(nextBanner, 3000); // 点击dot切换 dots.forEach((dot, index) => { dot.addEventListener('click', () => { banners[currentBanner].classList.remove('active'); dots[currentBanner].classList.remove('active'); currentBanner = index; banners[currentBanner].classList.add('active'); dots[currentBanner].classList.add('active'); }); }); // 分类侧边栏切换 document.querySelectorAll('.sidebar-item').forEach(item => { item.addEventListener('click', function() { document.querySelectorAll('.sidebar-item').forEach(i => { i.classList.remove('active'); }); this.classList.add('active'); }); }); // 数量加减 function changeQty(btn, delta) { const qtySpan = btn.parentElement.querySelector('.qty-num'); let qty = parseInt(qtySpan.textContent); qty += delta; if (qty < 1) qty = 1; qtySpan.textContent = qty; // 更新总价(模拟) updateCartTotal(); } // 更新购物车总价 function updateCartTotal() { const items = document.querySelectorAll('.cart-item'); let total = 0; let count = 0; items.forEach(item => { const checkbox = item.querySelector('input[type="checkbox"]'); if (checkbox && checkbox.checked) { const price = parseFloat(item.querySelector('.item-price').textContent.replace('¥', '')); const qty = parseInt(item.querySelector('.qty-num').textContent); total += price * qty; count += qty; } }); const totalPrice = document.querySelector('.total-price'); if (totalPrice) { totalPrice.textContent = '¥' + total.toFixed(1); } const checkoutBtn = document.querySelector('.checkout-btn'); if (checkoutBtn) { checkoutBtn.textContent = '去结算 (' + count + '件)'; } } // 购物车编辑模式 let isEditing = false; function toggleCartEdit() { isEditing = !isEditing; const editBtn = document.querySelector('.edit-btn'); if (isEditing) { editBtn.textContent = '完成'; // 显示删除按钮等编辑功能 } else { editBtn.textContent = '编辑'; } } // Toast提示 function showToast(message) { const toast = document.getElementById('toast'); toast.textContent = message; toast.classList.add('show'); setTimeout(() => { toast.classList.remove('show'); }, 2000); } // 加入购物车 function addToCart() { showToast('已加入购物车'); // 更新购物车数量 const badges = document.querySelectorAll('.tab-badge, .cart-badge'); badges.forEach(badge => { const current = parseInt(badge.textContent); badge.textContent = current + 1; }); } // 立即购买 function buyNow() { showToast('正在跳转支付...'); setTimeout(() => { showPage('cart'); }, 1000); } // 收藏 document.querySelectorAll('.icon-item').forEach(item => { item.addEventListener('click', function() { const svg = this.querySelector('svg'); if (svg && svg.innerHTML.includes('heart')) { showToast('已收藏'); } }); }); // 规格选择 function toggleSpec(element) { showToast('选择规格'); } // 订单标签切换 document.querySelectorAll('.tab-nav-item').forEach(item => { item.addEventListener('click', function() { document.querySelectorAll('.tab-nav-item').forEach(i => { i.classList.remove('active'); }); this.classList.add('active'); }); }); // 全选功能 document.querySelectorAll('.all-select input').forEach(checkbox => { checkbox.addEventListener('change', function() { const items = document.querySelectorAll('.cart-item input[type="checkbox"]'); items.forEach(item => { item.checked = this.checked; }); updateCartTotal(); }); }); // 店铺内商品全选 document.querySelectorAll('.store-header input').forEach(checkbox => { checkbox.addEventListener('change', function() { const store = this.closest('.cart-store'); const items = store.querySelectorAll('.cart-item input[type="checkbox"]'); items.forEach(item => { item.checked = this.checked; }); updateCartTotal(); }); }); // 商品项选择 document.querySelectorAll('.cart-item input[type="checkbox"]').forEach(checkbox => { checkbox.addEventListener('change', function() { updateCartTotal(); // 检查是否全选 const store = this.closest('.cart-store'); const allItems = store.querySelectorAll('.cart-item input[type="checkbox"]'); const checkedItems = store.querySelectorAll('.cart-item input[type="checkbox"]:checked'); const storeCheckbox = store.querySelector('.store-header input[type="checkbox"]'); storeCheckbox.checked = allItems.length === checkedItems.length; }); }); // 阻止详情页底部按钮点击穿透 document.querySelector('.detail-footer').addEventListener('click', function(e) { e.stopPropagation(); }); // 联系骑手 function contactRider() { showToast('正在拨打骑手电话...'); // 实际项目中这里会调用拨打电话功能 // window.location.href = 'tel:13800138000'; } // 初始化页面显示 document.addEventListener('DOMContentLoaded', function() { showPage('home'); });
HTML内容
酒水外卖后台管理系统
📱
酒水外卖小程序
▼
🔔
💬
张
张经理
超级管理员
📦
¥28,560
今日销售额
↑ 12.5% 较昨日
🧾
486
今日订单
↑ 8.3% 较昨日
👥
1,256
新增用户
↑ 15.2% 较昨日
⭐
4.8
店铺评分
↑ 0.1 较昨日
销售趋势
今日
本周
本月
订单来源
小程序 35%
APP 25%
外卖平台 15%
线下 15%
最新订单
查看全部 →
🍺
青岛啤酒 x 6 + 花生米
订单号:DD20240512001 · 12:30
已完成
¥128.00
🍷
长城干红葡萄酒 x 2
订单号:DD20240512002 · 12:45
配送中
¥336.00
🥃
威士忌套餐
订单号:DD20240512003 · 13:15
待发货
¥568.00
🍶
泸州老窖 x 1 + 小菜
订单号:DD20240512004 · 13:30
已完成
¥189.00
🔍
全部分类
啤酒
白酒
红酒
洋酒
全部状态
上架
下架
+ 新增商品
商品信息
分类
价格
库存
销量
状态
操作
🍺
青岛啤酒
编码:P001
啤酒
¥8.00
500
1,280
上架
编辑
下架
🍷
长城干红
编码:P002
红酒
¥168.00
120
456
上架
编辑
下架
🥃
芝华士威士忌
编码:P003
洋酒
¥288.00
80
234
上架
编辑
下架
🍶
泸州老窖
编码:P004
白酒
¥188.00
200
890
上架
编辑
下架
共 4 条记录,第 1/1 页
1
全部订单
待支付
待发货
配送中
已完成
已取消
订单信息
用户
订单金额
支付方式
订单状态
下单时间
操作
DD20240512004
泸州老窖 x 1
李
李先生
¥189.00
微信支付
已完成
2024-05-12 13:30
查看详情
DD20240512003
威士忌套餐
王
王女士
¥568.00
支付宝
待发货
2024-05-12 13:15
立即发货
DD20240512002
长城干红 x 2
张
张先生
¥336.00
微信支付
配送中
2024-05-12 12:45
查看详情
DD20240512001
青岛啤酒 x 6 + 花生米
赵
赵先生
¥128.00
微信支付
已完成
2024-05-12 12:30
查看详情
共 4 条记录,第 1/1 页
1
基本信息
店铺名称
店铺Logo
🍺
点击上传Logo
建议尺寸 200x200,支持 JPG、PNG 格式
营业设置
营业开始时间
营业结束时间
24小时营业
其他设置
店铺公告
🎉 新品上市!青岛纯生买一送一!
服务承诺
客服电话
重置
保存设置
🔍
导出用户
用户信息
手机号
会员等级
累计消费
注册时间
状态
操作
李
李先生
138****8888
⭐ 金卡会员
¥5,680
2024-01-15
正常
详情
禁用
王
王女士
139****6666
普通用户
¥1,280
2024-03-20
正常
详情
禁用
张
张先生
137****5555
普通用户
¥680
2024-04-10
正常
详情
禁用
共 3 条记录,第 1/1 页
1
💵
¥156,800
本月收入
↑ 18.5%
📤
¥12,500
本月支出
↓ 5.2%
💰
¥144,300
本月利润
↑ 22.1%
🏧
¥98,000
可提现
申请提现
财务记录
记录编号
类型
金额
账户
状态
时间
F20240512001
订单收入
+¥189.00
微信支付
已到账
2024-05-12 13:30
F20240512002
订单收入
+¥568.00
支付宝
处理中
2024-05-12 13:15
F20240511001
提现
-¥5,000.00
中国银行
已到账
2024-05-11 10:00
基础设置
系统名称
系统Logo
🍺
点击上传Logo
建议尺寸 200x200
通知设置
新订单提醒
库存预警
用户反馈提醒
配送设置
配送范围(公里)
起送价(元)
配送费(元)
重置
保存设置
套餐管理
+ 新增套餐
🎁
啤酒狂欢套餐
¥99
已售 256
🎉
派对必备套餐
¥199
已售 128
🥂
红酒品鉴套餐
¥399
已售 86
🍻
兄弟聚会套餐
¥168
已售 198
限时抢购活动
+ 创建活动
⚡
青岛啤酒 1元抢
¥1
限量 100
🔥
红酒5折抢
¥84
限量 50
💥
白酒秒杀价
¥99
限量 30
配送员管理
+ 添加配送员
配送员
电话
状态
今日配送
评分
操作
刘
刘师傅
138****1234
在线
12 单
4.9
详情
陈
陈师傅
139****5678
在线
8 单
4.8
详情
会员等级设置
🌱
普通会员
无门槛
⭐
银卡会员
累计500元
⭐⭐
金卡会员
累计2000元
👑
黑金会员
累计5000元
营销活动
+ 创建活动
🎫
新人专享券
满100减20
领取中
💝
节日特惠
8折起
进行中
📱
分享得券
邀请返利
进行中
角色权限
+ 新增角色
角色名称
角色描述
人数
创建时间
操作
超级管理员
拥有所有权限
2人
2024-01-01
编辑
运营管理员
负责日常运营管理
3人
2024-01-15
编辑
财务管理员
负责财务相关操作
1人
2024-02-01
编辑
保存更改
取消
访问码:
dz7gpggk
复制链接
重新生成