/** * 酒谷小程序模拟数据 * 模拟后台数据结构,便于未来接口替换 * * 数据来源说明: * 1. 轮播图:后台 → 维护 → 开发配置 → 组合数据 * 2. 商品数据:后台 → 商品 → 商品管理 * 3. 商品图片:后台 → 维护 → 素材管理 */ // ========== 素材管理模拟数据 ========== // 模拟后台 → 维护 → 素材管理 export const MOCK_ASSETS = { // 轮播图素材 banners: { 'banner_001': 'https://images.unsplash.com/photo-1470337458703-46ad1756a187?w=750&h=400&fit=crop', 'banner_002': 'https://images.unsplash.com/photo-1569529465841-dfecdab7503b?w=750&h=400&fit=crop', 'banner_003': 'https://img95.699pic.com/photo/50050/8750.jpg_wh860.jpg', 'banner_004': 'https://img95.699pic.com/photo/50050/8750.jpg_wh860.jpg', 'banner_005': 'https://img95.699pic.com/photo/50050/8750.jpg_wh860.jpg', 'banner_006': 'https://img95.699pic.com/photo/50050/8750.jpg_wh860.jpg' }, // 商品图片素材 products: { // 酒谷酒系列 'product_jg_001': 'http://www.9998.tv/newUpload_File/image/2022/0901/20220901141427852785.jpg', 'product_jg_002': 'http://www.9998.tv/newUpload_File/image/2022/0901/20220901141427852785.jpg', 'product_jg_003': 'http://www.9998.tv/newUpload_File/image/2022/0901/20220901141427852785.jpg', // 茅台酒系列 'product_mt_001': 'https://image.suning.cn/uimg/sop/commodity/279989701748433590850500_x.jpg', 'product_mt_002': 'https://image.suning.cn/uimg/sop/commodity/279989701748433590850500_x.jpg', 'product_mt_003': 'https://image.suning.cn/uimg/sop/commodity/279989701748433590850500_x.jpg', // 红酒系列 'product_wine_001': 'https://img95.699pic.com/photo/50050/8750.jpg_wh860.jpg', 'product_wine_002': 'https://img95.699pic.com/photo/50050/8750.jpg_wh860.jpg', 'product_wine_003': 'https://img95.699pic.com/photo/50050/8750.jpg_wh860.jpg' } } // ========== 轮播图配置数据 ========== // 模拟后台 → 维护 → 开发配置 → 组合数据 export const MOCK_BANNER_CONFIG = { success: true, data: { banners: [ { id: 'banner_config_001', title: '新春特惠酒水节', subtitle: '全场酒水满299减50', assetId: 'banner_001', // 引用素材库ID linkType: 'product', // 跳转类型:product/category/activity/external linkTarget: 'product_jg_001', // 跳转目标 status: 1, // 1-启用 0-禁用 sort: 1, startTime: '2024-01-01 00:00:00', endTime: '2024-12-31 23:59:59' }, { id: 'banner_config_002', title: '茅台精品推荐', subtitle: '正品保证,假一赔十', assetId: 'banner_002', linkType: 'category', linkTarget: 'category_maotai', status: 1, sort: 2, startTime: '2024-01-01 00:00:00', endTime: '2024-12-31 23:59:59' }, { id: 'banner_config_003', title: '进口红酒专场', subtitle: '品味生活,从一瓶好酒开始', assetId: 'banner_003', linkType: 'activity', linkTarget: 'activity_wine_festival', status: 1, sort: 3, startTime: '2024-01-01 00:00:00', endTime: '2024-12-31 23:59:59' }, { id: 'banner_config_004', title: '限时秒杀专场', subtitle: '每日10点开抢,限时优惠', assetId: 'banner_004', linkType: 'activity', linkTarget: 'activity_flash_sale', status: 1, sort: 4, startTime: '2024-01-01 00:00:00', endTime: '2024-12-31 23:59:59' }, { id: 'banner_config_005', title: '会员专享福利', subtitle: 'VIP会员专享折扣', assetId: 'banner_005', linkType: 'activity', linkTarget: 'activity_vip_benefits', status: 1, sort: 5, startTime: '2024-01-01 00:00:00', endTime: '2024-12-31 23:59:59' }, { id: 'banner_config_006', title: '新品首发预告', subtitle: '酒谷新品即将上市', assetId: 'banner_006', linkType: 'product', linkTarget: 'product_jg_new', status: 1, sort: 6, startTime: '2024-01-01 00:00:00', endTime: '2024-12-31 23:59:59' } ] } } // ========== 商品分类数据 ========== // 模拟后台 → 商品 → 分类管理 export const MOCK_CATEGORIES = { success: true, data: { categories: [ { id: 'category_jiugu', name: '酒谷酒', sort: 1, status: 1, description: '自主品牌酒谷系列' }, { id: 'category_maotai', name: '茅台酒', sort: 2, status: 1, description: '茅台系列白酒' }, { id: 'category_wine', name: '红酒', sort: 3, status: 1, description: '进口和国产红酒' }, { id: 'category_baijiu', name: '白酒', sort: 4, status: 1, description: '传统名牌白酒系列' } ] } } // ========== 商品数据 ========== // 模拟后台 → 商品 → 商品管理 export const MOCK_PRODUCTS = { success: true, data: { products: [ // 酒谷酒系列 { id: 'product_jg_001', name: '酒谷陈酿', categoryId: 'category_jiugu', assetId: 'product_jg_001', // 引用素材库图片ID status: 1, // 1-上架 0-下架 sort: 1, stock: 100, sales: 256, createTime: '2024-01-01 10:00:00', updateTime: '2024-01-15 15:30:00' }, { id: 'product_jg_002', name: '酒谷特酿', categoryId: 'category_jiugu', assetId: 'product_jg_002', status: 1, sort: 2, stock: 88, sales: 189, createTime: '2024-01-02 11:00:00', updateTime: '2024-01-16 09:20:00' }, { id: 'product_jg_003', name: '酒谷珍藏', categoryId: 'category_jiugu', assetId: 'product_jg_003', status: 1, sort: 3, stock: 45, sales: 123, createTime: '2024-01-03 14:00:00', updateTime: '2024-01-17 16:45:00' }, { id: 'product_jg_004', name: '酒谷典藏版', categoryId: 'category_jiugu', assetId: 'product_jg_001', status: 1, sort: 4, stock: 35, sales: 89, createTime: '2024-01-10 14:00:00', updateTime: '2024-01-24 16:45:00' }, { id: 'product_jg_005', name: '酒谷限量版', categoryId: 'category_jiugu', assetId: 'product_jg_002', status: 1, sort: 5, stock: 8, sales: 45, createTime: '2024-01-11 14:00:00', updateTime: '2024-01-25 16:45:00' }, // 茅台酒系列 { id: 'product_mt_001', name: '飞天茅台', categoryId: 'category_maotai', assetId: 'product_mt_001', status: 1, sort: 1, stock: 20, sales: 89, createTime: '2024-01-04 09:00:00', updateTime: '2024-01-18 11:15:00' }, { id: 'product_mt_002', name: '五星茅台', categoryId: 'category_maotai', assetId: 'product_mt_002', status: 1, sort: 2, stock: 15, sales: 67, createTime: '2024-01-05 13:00:00', updateTime: '2024-01-19 10:30:00' }, { id: 'product_mt_003', name: '茅台王子酒', categoryId: 'category_maotai', assetId: 'product_mt_003', status: 1, sort: 3, stock: 78, sales: 234, createTime: '2024-01-06 16:00:00', updateTime: '2024-01-20 14:20:00' }, { id: 'product_mt_004', name: '茅台迎宾酒', categoryId: 'category_maotai', assetId: 'product_mt_001', status: 1, sort: 4, stock: 120, sales: 345, createTime: '2024-01-12 16:00:00', updateTime: '2024-01-26 14:20:00' }, { id: 'product_mt_005', name: '茅台1935', categoryId: 'category_maotai', assetId: 'product_mt_002', status: 1, sort: 5, stock: 12, sales: 56, createTime: '2024-01-13 16:00:00', updateTime: '2024-01-27 14:20:00' }, // 红酒系列 { id: 'product_wine_001', name: '法国波尔多', categoryId: 'category_wine', assetId: 'product_wine_001', status: 1, sort: 1, stock: 66, sales: 145, createTime: '2024-01-07 12:00:00', updateTime: '2024-01-21 17:10:00' }, { id: 'product_wine_002', name: '意大利红酒', categoryId: 'category_wine', assetId: 'product_wine_002', status: 1, sort: 2, stock: 55, sales: 98, createTime: '2024-01-08 15:00:00', updateTime: '2024-01-22 13:45:00' }, { id: 'product_wine_003', name: '智利红酒', categoryId: 'category_wine', assetId: 'product_wine_003', status: 1, sort: 3, stock: 99, sales: 167, createTime: '2024-01-09 11:00:00', updateTime: '2024-01-23 15:55:00' }, { id: 'product_wine_004', name: '澳洲红酒', categoryId: 'category_wine', assetId: 'product_wine_001', status: 1, sort: 4, stock: 77, sales: 134, createTime: '2024-01-14 11:00:00', updateTime: '2024-01-28 15:55:00' }, { id: 'product_wine_005', name: '西班牙红酒', categoryId: 'category_wine', assetId: 'product_wine_002', status: 1, sort: 5, stock: 43, sales: 87, createTime: '2024-01-15 11:00:00', updateTime: '2024-01-29 15:55:00' }, // 白酒系列 (新增分类) { id: 'product_bj_001', name: '五粮液', categoryId: 'category_baijiu', assetId: 'product_jg_001', status: 1, sort: 1, stock: 45, sales: 123, createTime: '2024-01-16 11:00:00', updateTime: '2024-01-30 15:55:00' }, { id: 'product_bj_002', name: '剑南春', categoryId: 'category_baijiu', assetId: 'product_jg_002', status: 1, sort: 2, stock: 67, sales: 156, createTime: '2024-01-17 11:00:00', updateTime: '2024-01-31 15:55:00' }, { id: 'product_bj_003', name: '泸州老窖', categoryId: 'category_baijiu', assetId: 'product_jg_003', status: 1, sort: 3, stock: 89, sales: 234, createTime: '2024-01-18 11:00:00', updateTime: '2024-02-01 15:55:00' } ] } } // ========== 首页数据组合 ========== // 模拟后台组合处理后的首页数据结构 export const MOCK_HOMEPAGE_DATA = { success: true, message: '数据获取成功', data: { banners: MOCK_BANNER_CONFIG.data.banners.map(banner => ({ ...banner, imageUrl: MOCK_ASSETS.banners[banner.assetId] // 自动组合素材URL })), categories: MOCK_CATEGORIES.data.categories.map(category => { // 获取该分类下的商品 const categoryProducts = MOCK_PRODUCTS.data.products .filter(product => product.categoryId === category.id && product.status === 1) .sort((a, b) => a.sort - b.sort) .slice(0, 3) // 首页每个分类只显示3个商品 .map(product => ({ ...product, imageUrl: MOCK_ASSETS.products[product.assetId] // 自动组合素材URL })) return { ...category, products: categoryProducts } }).filter(category => category.status === 1) } } /** * API 接口路径定义 * 未来需要替换为真实接口地址 */ export const API_ENDPOINTS = { // 首页数据 HOMEPAGE: '/api/homepage/data', // 轮播图配置 BANNER_CONFIG: '/api/config/banners', // 商品相关 PRODUCTS: '/api/products', PRODUCT_DETAIL: '/api/products/:id', CATEGORIES: '/api/categories', // 素材管理 ASSETS: '/api/assets', ASSET_DETAIL: '/api/assets/:id', // 搜索 SEARCH: '/api/search', SEARCH_SUGGESTIONS: '/api/search/suggestions', HOT_SEARCH: '/api/search/hot', SEARCH_RECORD: '/api/search/record' }