/** * Mock 数据集 * 说明:所有封面图为空字符串,页面使用生态绿渐变占位,避免依赖外部图床/域名白名单。 */ const now = Date.now() const day = 86400000 const iso = (offsetDays) => new Date(now - offsetDays * day).toISOString() export const datasets = { /** 当前登录用户 */ user: { id: 1001, nickname: '同城小助手', avatar: '', phone: '13800001111', userType: 1, // 1 个人 / 2 商家 isMember: true, memberLevel: '年卡会员', memberExpireAt: new Date(now + 300 * day).toISOString(), balance: 128.5, // 元 realnameStatus: 1, }, /** 首页轮播广告位(color 为生态绿家族渐变,image 为空时前端用「绿底 + 白色插画」内置配图) */ banners: [ { id: 1, title: '同城好物节 · 二手直降', image: '', link: '/pages/category/channel?categoryId=3', color: 'linear-gradient(105deg, #00e070 0%, #00c860 42%, #046b3b 100%)' }, { id: 2, title: '招聘旺季 · 免费发布', image: '', link: '/pages/post/create', color: 'linear-gradient(105deg, #00d96c 0%, #00b85c 40%, #023a21 100%)' }, { id: 3, title: '本地服务 · 上门更省心', image: '', link: '/pages/category/channel?categoryId=5', color: 'linear-gradient(105deg, #00e878 0%, #049e52 45%, #045c34 100%)' }, ], /** 分类导航 */ categories: [ { id: 1, name: '招聘求职', iconKey: 'cat-job', color: '#04874a', count: 1280 }, { id: 2, name: '房产租售', iconKey: 'cat-house', color: '#1f8c4c', count: 860 }, { id: 3, name: '二手闲置', iconKey: 'cat-goods', color: '#5f9a2f', count: 2340 }, { id: 4, name: '车辆买卖', iconKey: 'cat-car', color: '#0e8c6a', count: 430 }, { id: 5, name: '本地服务', iconKey: 'cat-service', color: '#17bf7a', count: 760 }, { id: 6, name: '教育培训', iconKey: 'cat-education', color: '#3e8c5e', count: 320 }, { id: 7, name: '家政保洁', iconKey: 'cat-clean', color: '#17b368', count: 210 }, { id: 8, name: '同城交友', iconKey: 'cat-friend', color: '#e9a23b', count: 190 }, ], /** 热门搜索 */ hotKeywords: ['租房 一室一厅', '二手电动车', '急招快递员', '钢琴家教', '空调维修'], /** 信息流(含待审核/已通过/已驳回,供两端联调;lat/lng 为 LBS 坐标,distance 单位 km 一位小数) */ posts: [ { id: 101, categoryId: 1, categoryName: '招聘求职', title: '急招快递分拣员(日结)', content: '站点直招,日结 180-220 元,包工作餐,当日结算。有意者电话联系。', cover: '', price: 0, priceUnit: '面议', area: '云岩区', address: '贵阳北站物流园', contact: '139****8888', contactFull: '13988888888', views: 1892, likes: 32, isPaid: false, auditStatus: 1, createdAt: iso(0.2), tags: ['日结', '包吃'], publisher: { id: 2001, name: '顺捷物流', avatar: '', isMerchant: true, verified: true }, commentCount: 12, lat: 26.6157, lng: 106.6979, distance: 7.6, }, { id: 102, categoryId: 2, categoryName: '房产租售', title: '整租·未来方舟精装一室一厅', content: '家电齐全,拎包入住,近地铁 2 号线,押一付一,可短租。', cover: '', price: 1800, priceUnit: '元/月', area: '南明区', address: '未来方舟 B 区', contact: '135****6666', contactFull: '13566666666', views: 3204, likes: 88, isPaid: true, auditStatus: 1, createdAt: iso(0.5), tags: ['精装', '近地铁'], publisher: { id: 2002, name: '安家房产', avatar: '', isMerchant: true, verified: true }, commentCount: 26, lat: 26.5716, lng: 106.7314, distance: 13.1, }, { id: 103, categoryId: 3, categoryName: '二手闲置', title: '九成新山地自行车 转让', content: '骑行不到 300 公里,27 速,原价 1599,现 680 出,可小刀,同城自提。', cover: '', price: 680, priceUnit: '元', area: '观山湖区', address: '世纪城', contact: '137****1234', contactFull: '13712341234', views: 640, likes: 21, isPaid: false, isTop: true, auditStatus: 1, createdAt: iso(1), tags: ['自提', '9成新'], publisher: { id: 2003, name: '骑行爱好者', avatar: '', isMerchant: false, verified: false }, commentCount: 4, lat: 26.6300, lng: 106.6250, distance: 1.9, }, { id: 104, categoryId: 4, categoryName: '车辆买卖', title: '2019 款家用轿车 一手车', content: '车况精品,无事故无泡水,4S 店保养记录齐全,支持第三方检测。', cover: '', price: 68000, priceUnit: '元', area: '云岩区', address: '贵阳市云岩区', contact: '138****0000', contactFull: '13800000000', views: 1120, likes: 40, isPaid: true, auditStatus: 0, createdAt: iso(0.1), tags: ['无事故', '可检测'], publisher: { id: 2004, name: '车行天下', avatar: '', isMerchant: true, verified: true }, commentCount: 0, lat: 26.6049, lng: 106.7194, distance: 10.0, }, { id: 105, categoryId: 5, categoryName: '本地服务', title: '专业空调清洗 / 加氟上门', content: '10 年老师傅,上门服务,清洗 60 元/台,加氟 80 元起,不满意不收费。', cover: '', price: 60, priceUnit: '元/台', area: '南明区', address: '花果园', contact: '131****5678', contactFull: '13156785678', views: 2310, likes: 66, isPaid: false, auditStatus: 0, createdAt: iso(0.05), tags: ['上门', '不满意不收费'], publisher: { id: 2005, name: '洁净到家', avatar: '', isMerchant: true, verified: true }, commentCount: 18, lat: 26.5600, lng: 106.6870, distance: 11.2, }, { id: 106, categoryId: 3, categoryName: '二手闲置', title: 'iPad 2021 64G 深空灰', content: '学生自用,无磕碰,配件齐全,支持当面验机。', cover: '', price: 1450, priceUnit: '元', area: '观山湖区', address: '贵阳奥体中心', contact: '150****3344', contactFull: '15033443344', views: 480, likes: 15, isPaid: false, auditStatus: 2, createdAt: iso(2), tags: ['验机'], publisher: { id: 2006, name: '小王同学', avatar: '', isMerchant: false, verified: false }, commentCount: 1, lat: 26.6230, lng: 106.6400, distance: 2.8, }, ], /** 付费查看后的完整联系方式 */ secretContact: { phone: '13988888888', wechat: 'tongcheng_101', note: '请说明来自同城分类信息' }, /** 草稿箱 */ drafts: [ { draftId: 9001, title: '转租单间(草稿)', content: '还未填完……', categoryId: 2, savedAt: iso(0.1) }, ], /** * 发布配置(后台「发布与费用配置」下发;与 fa_fc_config 的 post.* 对齐) * mode:free 免费发布 / paid 付费发布(付费模式下按 singlePrice 或套餐额度) * quotaLeft:当前用户的剩余发布条数(套餐额度,随会员有效期) * discountRate:会员发布折扣率(1 = 无折扣,0.8 = 8 折);单条金额 = round(singlePrice * discountRate, 2) * discountText:折扣展示文案(如「8 折」),无折扣时为空 */ publishRule: { mode: 'paid', singlePrice: 5, discountRate: 1, discountText: '', monthPrice: 19.9, monthQuota: 30, yearPrice: 168, yearQuota: 500, quotaLeft: 30, // 免费发布条数(字段名与后端 Post::publishConfig 对齐:freeQuota/freeQuotaCycle/freeQuotaUsed/freeQuotaLeft/freeUnlimited) freeQuota: 2, // 周期内免费发布条数 freeQuotaCycle: 'daily', freeQuotaUsed: 0, freeQuotaLeft: 2, // -1 表示不限制 freeUnlimited: false, quotaExpireAt: iso(-25), isMember: true, memberExpireAt: iso(-25), }, /** 我的发布(用户端「我的发布」页数据源;覆盖待审核/已通过/已驳回/已下架四种状态) */ myPosts: [ { id: 9001, title: '急招快递分拣员(日结)', content: '站点直招,日结 180-220 元。', categoryId: 1, categoryName: '招聘求职', cover: '', price: 0, priceUnit: '面议', area: '云岩区', address: '贵阳北站物流园', auditStatus: 0, auditReason: '', status: 1, isTop: false, isPaid: false, amount: 0, views: 0, likes: 0, commentCount: 0, createdAt: iso(0.05), }, { id: 9002, title: '九成新山地自行车 转让', content: '骑行不到 300 公里,27 速,同城自提。', categoryId: 3, categoryName: '二手闲置', cover: '', price: 680, priceUnit: '元', area: '观山湖区', address: '世纪城', auditStatus: 1, auditReason: '', status: 1, isTop: true, isPaid: true, amount: 5, views: 128, likes: 6, commentCount: 2, createdAt: iso(1), }, { id: 9003, title: '求租一室一厅(云岩区)', content: '预算 1500,可押一付一。', categoryId: 2, categoryName: '房产租售', cover: '', price: 0, priceUnit: '面议', area: '云岩区', address: '', auditStatus: 2, auditReason: '联系方式不完整,请补充手机号', status: 1, isTop: false, isPaid: false, amount: 0, views: 12, likes: 0, commentCount: 0, createdAt: iso(2), }, { id: 9004, title: '高价回收家电', content: '上门回收冰箱洗衣机。', categoryId: 7, categoryName: '家政保洁', cover: '', price: 0, priceUnit: '面议', area: '南明区', address: '', auditStatus: 1, auditReason: '', status: 0, isTop: false, isPaid: false, amount: 0, views: 33, likes: 1, commentCount: 0, createdAt: iso(3), }, ], /** 发布费用标准(后台可配) */ priceRule: { singlePost: 5, // 元/条 freePostPerDay: 2, memberMonth: 19.9, memberQuarter: 49.9, memberYear: 168, }, /** 会员套餐 */ memberPlans: [ // postQuota:套餐含发布条数(后台「发布与费用配置」同步) { planId: 'M1', name: '月卡', price: 19.9, originPrice: 29.9, days: 30, tag: '尝鲜', postQuota: 30 }, { planId: 'M3', name: '季卡', price: 49.9, originPrice: 89.7, days: 90, tag: '最划算', postQuota: 90 }, { planId: 'M12', name: '年卡', price: 168, originPrice: 358.8, days: 365, tag: '省心', postQuota: 500 }, ], /** 会员权益 */ memberBenefits: { freeView: 20, // 每日免费查看联系方式条数 postDiscount: '8 折', distRate: '一级 20% / 二级 10%', benefits: ['每日免费查看 20 条联系方式', '发布信息 8 折', '专属会员标识', '分销佣金加速结算'], }, /** 我的资产(coupons / couponCount 由 /member/assets 从 fc_user_coupon 实时聚合) */ assets: { balance: 128.5, points: 320, }, /** 可领取的优惠券定义(fc_coupon) */ coupons: [ { id: 1, name: '发布立减 3 元', type: 'fixed', amount: 3, minAmount: 0, total: 1000, receivedCount: 12, enabled: true, sort: 1, days: 30 }, { id: 2, name: '满 50 减 10', type: 'fixed', amount: 10, minAmount: 50, total: 500, receivedCount: 88, enabled: true, sort: 2, days: 15 }, { id: 3, name: '会员开通 9 折', type: 'discount', amount: 0.9, minAmount: 0, total: 200, receivedCount: 30, enabled: true, sort: 3, days: 7 }, { id: 4, name: '已停发券', type: 'fixed', amount: 5, minAmount: 20, total: 100, receivedCount: 100, enabled: false, sort: 4, days: 10 }, ], /** 我已领取的优惠券(fc_user_coupon) */ userCoupons: [ { id: 1, couponId: 1, status: 'unused', orderNo: '', usetime: '', expiretime: iso(-20), createtime: iso(2) }, ], /** 我的收藏(fc_favorite:user_id + post_id) */ favorites: [ { id: 1, postId: 101, createtime: iso(1) }, ], /** 我的关注(fc_follow:user_id + target_user_id) */ follows: [ { id: 1, targetUserId: 2001, createtime: iso(2) }, ], /** 微信支付商户参数是否已配置(未配置时 /pay/prepay 返回「微信支付未配置」,余额支付不受影响) */ wxPayConfigured: true, /** 订单(发布/会员/充值 三类,供用户端与后台共用) */ orders: [ { id: 3001, orderNo: 'PO20240101001', type: 'post', title: '单条付费发布', amount: 5, payType: 'wxpay', status: 'paid', createdAt: iso(1) }, { id: 3002, orderNo: 'MO20240102002', type: 'member', title: '年卡会员', amount: 168, payType: 'wxpay', status: 'paid', createdAt: iso(2) }, { id: 3003, orderNo: 'RO20240103003', type: 'recharge', title: '余额充值', amount: 100, payType: 'wxpay', status: 'paid', createdAt: iso(3) }, { id: 3004, orderNo: 'PO20240104004', type: 'post', title: '单条付费发布', amount: 5, payType: 'balance', status: 'pending', createdAt: iso(0.5) }, ], /** 分销中心概览 */ distOverview: { totalCommission: 1286.4, settled: 980.0, withdrawable: 186.4, todayCommission: 32.6, teamCount: 28, l1Count: 12, l2Count: 16, inviteCode: 'TC8A9K', posterUrl: '', minWithdraw: 50, }, /** 分销团队 */ distTeam: [ { id: 1, nickname: '小李', level: 1, joinedAt: iso(10), performance: 320, commission: 64 }, { id: 2, nickname: '阿强', level: 1, joinedAt: iso(20), performance: 180, commission: 36 }, { id: 3, nickname: '果果', level: 2, joinedAt: iso(6), performance: 90, commission: 9 }, { id: 4, nickname: '老周', level: 2, joinedAt: iso(30), performance: 260, commission: 26 }, ], /** 提现记录 */ withdrawRecords: [ { id: 1, withdrawNo: 'WD20231220001', amount: 100, status: 'paid', createdAt: iso(25) }, { id: 2, withdrawNo: 'WD20240105002', amount: 50, status: 'auditing', createdAt: iso(1) }, ], /** 消息中心 */ messages: [ { id: 1, type: 'system', title: '审核通过', content: '您发布的信息「急招快递分拣员(日结)」已审核通过。', read: false, createdAt: iso(0.2) }, { id: 2, type: 'system', title: '会员到期提醒', content: '您的年卡会员将于 30 天后到期,续费可享 9 折。', read: false, createdAt: iso(1) }, { id: 3, type: 'interact', title: '收到新评价', content: '用户「小王同学」评价了您的信息:服务很到位,五星好评!', read: true, createdAt: iso(2) }, { id: 4, type: 'interact', title: '点赞提醒', content: '您发布的信息获得 5 个赞。', read: true, createdAt: iso(3) }, ], /** 后台数据总览 */ dashboard: { overview: { pv: 128932, uv: 20431, todayPostCount: 156, todayOrderAmount: 2864.5, memberCount: 1320, merchantCount: 86, commissionTotal: 12864.3, pendingAudit: 23, postGrowth: 12.5, orderGrowth: -3.2, userGrowth: 8.1, }, trend: { traffic: [ { date: '2024-01-01', pv: 3200, uv: 820 }, { date: '2024-01-02', pv: 3600, uv: 910 }, { date: '2024-01-03', pv: 3100, uv: 780 }, { date: '2024-01-04', pv: 4200, uv: 1100 }, { date: '2024-01-05', pv: 4800, uv: 1290 }, { date: '2024-01-06', pv: 5100, uv: 1380 }, { date: '2024-01-07', pv: 4700, uv: 1210 }, ], revenue: [ { date: '2024-01-01', amount: 320 }, { date: '2024-01-02', amount: 410 }, { date: '2024-01-03', amount: 280 }, { date: '2024-01-04', amount: 560 }, { date: '2024-01-05', amount: 720 }, { date: '2024-01-06', amount: 680 }, { date: '2024-01-07', amount: 610 }, ], userGrowth: [ { date: '2024-01-01', newUser: 42, totalUser: 1200 }, { date: '2024-01-02', newUser: 55, totalUser: 1255 }, { date: '2024-01-03', newUser: 38, totalUser: 1293 }, { date: '2024-01-04', newUser: 66, totalUser: 1359 }, { date: '2024-01-05', newUser: 71, totalUser: 1430 }, { date: '2024-01-06', newUser: 88, totalUser: 1518 }, { date: '2024-01-07', newUser: 60, totalUser: 1578 }, ], }, }, /** 后台 · 商家列表 */ merchants: [ { id: 2001, name: '顺捷物流', logo: '', contact: '13988888888', category: '物流服务', auditStatus: 1, license: '营业执照.jpg', shopStatus: 'normal', violations: 0, postCount: 32, createdAt: iso(120) }, { id: 2002, name: '安家房产', logo: '', contact: '13566666666', category: '房产中介', auditStatus: 1, license: '营业执照.jpg', shopStatus: 'normal', violations: 1, postCount: 68, createdAt: iso(200) }, { id: 2005, name: '洁净到家', logo: '', contact: '13156785678', category: '家政服务', auditStatus: 0, license: '营业执照.jpg', shopStatus: 'pending', violations: 0, postCount: 12, createdAt: iso(3) }, { id: 2007, name: '优选二手车', logo: '', contact: '13700000000', category: '汽车服务', auditStatus: 2, license: '', shopStatus: 'banned', violations: 3, postCount: 0, createdAt: iso(60) }, ], /** 后台 · 用户列表 */ users: [ { id: 1001, nickname: '同城小助手', phone: '13800001111', userType: 1, isMember: true, status: 1, registerAt: iso(180) }, { id: 1002, nickname: '小王同学', phone: '15033443344', userType: 1, isMember: false, status: 1, registerAt: iso(30) }, { id: 1003, nickname: '洁净到家', phone: '13156785678', userType: 2, isMember: true, status: 1, registerAt: iso(3) }, { id: 1004, nickname: '违规用户A', phone: '13000000000', userType: 1, isMember: false, status: 0, registerAt: iso(9) }, ], /** 后台 · 评价列表 */ comments: [ { id: 5001, postId: 101, postTitle: '急招快递分拣员(日结)', user: '小王同学', score: 5, content: '联系很及时,当天就上岗了。', images: [], reply: '', top: false, createdAt: iso(0.5) }, { id: 5002, postId: 102, postTitle: '整租·未来方舟精装一室一厅', user: '果果', score: 4, content: '房子不错,房东好说话。', images: [], reply: '感谢支持,欢迎续租~', top: true, createdAt: iso(2) }, { id: 5003, postId: 103, postTitle: '九成新山地自行车 转让', user: '匿名用户', score: 1, content: '广告信息,疑似虚假。', images: [], reply: '', top: false, createdAt: iso(0.2) }, ], /** 后台 · 举报处理 */ reports: [ { id: 1, targetType: 'comment', targetId: 5003, reason: '疑似虚假信息', reporter: '1002', status: 'pending', createdAt: iso(0.2) }, { id: 2, targetType: 'post', targetId: 106, reason: '重复发布', reporter: '1004', status: 'handled', createdAt: iso(4) }, ], /** 后台 · 分销设置 */ distSetting: { enabled: true, level: 2, level1Rate: 20, level2Rate: 10, settleCycle: 'T+7', minWithdraw: 50 }, /** 后台 · 提现审核列表 */ adminWithdraws: [ { id: 2, withdrawNo: 'WD20240105002', user: '同城小助手', amount: 50, status: 'auditing', channel: 'wxpay', createdAt: iso(1) }, { id: 3, withdrawNo: 'WD20240106003', user: '小李', amount: 200, status: 'auditing', channel: 'wxpay', createdAt: iso(0.4) }, { id: 1, withdrawNo: 'WD20231220001', user: '同城小助手', amount: 100, status: 'paid', channel: 'wxpay', createdAt: iso(25) }, ], /** 后台 · 资金流水 */ financeFlows: [ { id: 1, flowNo: 'F20240107001', type: 'income', scene: '发布付费', amount: 5, balance: 2864.5, createdAt: iso(0.2) }, { id: 2, flowNo: 'F20240107002', type: 'income', scene: '会员开通', amount: 168, balance: 2859.5, createdAt: iso(0.5) }, { id: 3, flowNo: 'F20240106003', type: 'expense', scene: '佣金提现', amount: 100, balance: 2691.5, createdAt: iso(1) }, { id: 4, flowNo: 'F20240105004', type: 'income', scene: '余额充值', amount: 100, balance: 2791.5, createdAt: iso(2) }, ], /** 后台 · 财务报表 */ financeReport: [ { period: '2024-01-01', postIncome: 320, memberIncome: 199, rechargeIncome: 500, withdraw: 100, net: 919 }, { period: '2024-01-02', postIncome: 410, memberIncome: 349, rechargeIncome: 300, withdraw: 0, net: 1059 }, { period: '2024-01-03', postIncome: 280, memberIncome: 168, rechargeIncome: 200, withdraw: 50, net: 598 }, ], /** 后台 · 角色 */ roles: [ { id: 1, name: '超级管理员', permissions: ['*'], remark: '拥有全部权限' }, { id: 2, name: '运营', permissions: ['dashboard', 'post', 'merchant', 'member', 'dist'], remark: '日常运营' }, { id: 3, name: '客服', permissions: ['comment', 'message', 'order'], remark: '处理用户反馈' }, { id: 4, name: '财务', permissions: ['finance', 'order', 'dist'], remark: '对账与提现审核' }, ], /** 后台 · 子账号 */ accounts: [ { id: 1, username: 'admin', roleId: 1, roleName: '超级管理员', status: 1, lastLoginAt: iso(0.01) }, { id: 2, username: 'oper01', roleId: 2, roleName: '运营', status: 1, lastLoginAt: iso(1) }, { id: 3, username: 'cs01', roleId: 3, roleName: '客服', status: 0, lastLoginAt: iso(15) }, ], /** 后台 · 操作日志 */ logs: [ { id: 1, account: 'admin', action: '审核通过信息 #105', ip: '8.137.181.63', createdAt: iso(0.1) }, { id: 2, account: 'oper01', action: '修改分销比例 一级20%/二级10%', ip: '8.137.181.63', createdAt: iso(0.6) }, { id: 3, account: 'admin', action: '下架违规信息 #106', ip: '8.137.181.63', createdAt: iso(1) }, ], /** 后台 · 基础配置 */ baseSetting: { appName: '同城分类信息', logo: '', servicePhone: '400-000-0000', aboutUs: '本地同城分类信息服务平台,招聘/房产/二手/服务一站直达。', shareTitle: '同城分类信息 · 身边的好帮手', }, /** 后台 · 服务区域(平铺:每条自带省/市/区县) */ areas: [ { id: 1, province: '贵州省', city: '贵阳市', district: '云岩区', lat: 26.605, lng: 106.71, sort: 1, enabled: true }, { id: 2, province: '贵州省', city: '贵阳市', district: '南明区', lat: 26.568, lng: 106.716, sort: 2, enabled: true }, { id: 3, province: '贵州省', city: '贵阳市', district: '观山湖区', lat: 26.625, lng: 106.625, sort: 3, enabled: true }, { id: 4, province: '贵州省', city: '贵阳市', district: '花溪区', lat: 26.43, lng: 106.67, sort: 4, enabled: true }, { id: 5, province: '贵州省', city: '贵阳市', district: '白云区', lat: 26.678, lng: 106.623, sort: 5, enabled: false }, ], /** * 站点 UI 配置(LOGO + 图标覆盖) * 说明:logo 为空表示使用前端内置 /static/logo.png;icons 为空使用内置图标。 * 后台「系统设置 → LOGO 与图标」保存后会写入这里,用户端读取后立即生效。 */ uiConfig: { siteName: '同城分类信息', appName: '同城分类信息', logo: '', icons: {}, servicePhone: '400-000-0000', aboutUs: '本地同城分类信息服务平台,招聘/房产/二手/服务一站直达。', shareTitle: '同城分类信息 · 身边的好帮手', updatedAt: iso(0), }, }