feat(uniapp): 小程序端(用户端 uni-app)源码入库到 uniapp/ 目录

需求:小程序端代码要同时同步到服务器与 git 远程仓库,此前前端仅存在于本地目录(无 remote,从未推送),
服务器与 gitcode 上只有后端。现并入本仓库,复用现有「push 即部署」链路,一次推送双端落地。

- 新增 uniapp/:小程序端源码全量快照(150 文件 / 1.2M)
  pages(13 页面) · components(fc-navbar/fc-tabbar/fc-post-card/fc-empty) ·
  common(api·utils·mock·assets·store·config) · static(74 图标 + 3 轮播插画 + LOGO) ·
  docs(01-04 交付文档) · tests(零依赖全链路用例) · tools(图标/主题/轮播配图生成脚本)
- 明确排除:AGENTS.md(含后台密码、服务器 root 密码、小程序 AppSecret,切勿入库)、
  unpackage/(构建产物,由 uniapp/.gitignore 忽略)、node_modules、.DS_Store、*.log
- .gitignore 新增 /uniapp/AGENTS.md 兜底(与根 /AGENTS.md、/fluniapp/ 同一约定)
- README.md 增补「本项目结构 + 部署链路」章节,说明 uniapp/ 为源码快照、
  小程序真正上线仍需微信开发者工具 cli upload

说明:本次为源码快照,未携带前端本地仓库历史——其历史提交中含 AGENTS.md 凭据,
若做 subtree 合并会把密码永久写入本仓库历史,故采用快照方式。
这个提交包含在:
linda
2026-10-17 14:19:03 +08:00
父节点 d452be1d60
当前提交 376a7ed793
共有 152 个文件被更改,包括 13390 次插入 和 0 次删除

查看文件

@@ -0,0 +1,69 @@
/**
* 轮播配图注册表(前端唯一轮播视觉清单)
* ------------------------------------------------------------
* 首页轮播卡 = 「后台下发的渐变底色 + 页面 CSS 装饰层 + 一张白色插画」:
* · 底色 color —— 后台 `fc_banner.color`(可随时换季调整,装饰层是中性半透明白/深绿,不串色)
* · 装饰层 —— `pages/index/index.vue` 的 `.home__banner-*`(圆环 / 远山 / 光晕 / 叶脉)
* · 插画 —— `static/banners/` 下的白色透明 PNG,`tools/gen-banner-art.mjs` 生成
* 若后台给某条轮播配置了 `image`(整幅配图),前端直接铺满并隐藏装饰层。
*/
export const BANNER_BASE = '/static/banners/'
/** 3 套内置插画:二手包裹箱 / 公文包 / 上门小家(与 icon-svg.mjs 母版同源) */
export const BANNER_ART = ['banner-art-1.png', 'banner-art-2.png', 'banner-art-3.png']
/** 内置生态绿渐变(1/2/3 号,取自 uni.scss 主色家族),后台未配置颜色时按位置取用 */
export const BANNER_BG = [
'linear-gradient(105deg, #00e070 0%, #00c860 42%, #046b3b 100%)',
'linear-gradient(105deg, #00d96c 0%, #00b85c 40%, #023a21 100%)',
'linear-gradient(105deg, #00e878 0%, #049e52 45%, #045c34 100%)',
]
/**
* 后台下发的底色是否「完整可用」。
* 只认**结构完整**的渐变:`linear-gradient(...)` / `radial-gradient(...)` 等,
* 括号配平、至少两个色标(顶层含逗号)、以 `)` 收尾。
* 这样既能拦下历史暖色纯色(`#FF8A5B`),也能拦下被字段宽度**截断**的半截值
* (如 `linear-gradient(` / `linear-gradient(135deg`),避免出现「样式非法 → 卡片空白」。
* 顶层括号计数而非正则,是为了兼容 `rgba(24,165,135,.9)` 这类**色标内自带括号/逗号**的写法。
*/
function isCompleteGradient(value) {
const head = /^(repeating-)?(linear|radial|conic)-gradient\(/i.exec(value)
if (!head || value.charAt(value.length - 1) !== ')') return false
let depth = 1 // 渐变函数自身的左括号已在 head 内,先计入
let commas = 0
for (let i = head[0].length; i < value.length; i++) {
const ch = value.charAt(i)
if (ch === '(') depth++
else if (ch === ')') depth--
else if (ch === ',' && depth === 1) commas++ // 只数「渐变函数这一层」的逗号(色标分隔)
}
return depth === 0 && commas >= 1
}
/**
* 轮播底色:只信任后台下发的**完整渐变**,其余一律回落内置春绿渐变(105deg 亮绿→深绿)。
* 历史遗留的纯色值(如旧暖色 `#FF8A5B` / `#FFB86B` / `#FF6F61`)、空值、被截断的半截值
* 都会被视为「未配置」,保证后台数据没同步时首页也不会出现与新主题冲突的暖色或空白卡;文案固定用墨绿字,故换底色不会改坏可读性。
* 需要纯色时后台填 `linear-gradient(105deg, #00E070 0%, #00E070 100%)` 即可(亮绿面 + 前端墨绿字)。
*/
export function bannerBg(banner, index = 0) {
const color = String((banner && banner.color) || '').trim()
if (isCompleteGradient(color)) return color
return BANNER_BG[Math.abs(index) % BANNER_BG.length]
}
/** 第 i 条轮播的默认插画(按位置循环) */
export function bannerArtUrl(index = 0) {
return BANNER_BASE + BANNER_ART[Math.abs(index) % BANNER_ART.length]
}
/**
* 是否展示金色「价值点缀」。
* 规则:绿 = 平台与内容、金 = 价值与特权 —— 只有「直降 / 免费」这类价值主张才配金色。
*/
export function bannerHasValue(index = 0) {
return Math.abs(index) % BANNER_ART.length !== 2
}
export default { BANNER_BASE, BANNER_ART, BANNER_BG, bannerArtUrl, bannerHasValue, bannerBg }

查看文件

@@ -0,0 +1,150 @@
/**
* 图标注册表(前端唯一图标清单)
* ------------------------------------------------------------
* 每个图标有:
* key —— 业务代码引用键(后端按 key 覆盖)
* name —— 中文名(后台管理界面展示)
* file —— static/icons/ 下的默认文件
* 后端可通过 /admin/setting/ui 按 key 覆盖为自传图片 URL。
*/
export const ICON_BASE = '/static/icons/'
export const ICON_GROUPS = [
{
group: '底部导航',
items: [
{ key: 'tab-home', name: '首页(常态)', file: 'tab-home.png' },
{ key: 'tab-home-on', name: '首页(选中)', file: 'tab-home-on.png' },
{ key: 'tab-post', name: '发布(常态)', file: 'tab-post.png' },
{ key: 'tab-post-on', name: '发布(选中)', file: 'tab-post-on.png' },
{ key: 'tab-message', name: '消息(常态)', file: 'tab-message.png' },
{ key: 'tab-message-on', name: '消息(选中)', file: 'tab-message-on.png' },
{ key: 'tab-mine', name: '我的(常态)', file: 'tab-mine.png' },
{ key: 'tab-mine-on', name: '我的(选中)', file: 'tab-mine-on.png' },
],
},
{
group: '同城分类',
items: [
{ key: 'cat-job', name: '招聘求职', file: 'cat-job.png' },
{ key: 'cat-house', name: '房产租售', file: 'cat-house.png' },
{ key: 'cat-goods', name: '二手闲置', file: 'cat-goods.png' },
{ key: 'cat-car', name: '车辆买卖', file: 'cat-car.png' },
{ key: 'cat-service', name: '本地服务', file: 'cat-service.png' },
{ key: 'cat-education', name: '教育培训', file: 'cat-education.png' },
{ key: 'cat-clean', name: '家政保洁', file: 'cat-clean.png' },
{ key: 'cat-friend', name: '同城交友', file: 'cat-friend.png' },
],
},
{
group: '首页与展示',
items: [
{ key: 'home-location', name: '定位(头部/白)', file: 'home-location.png' },
{ key: 'location', name: '定位(橙)', file: 'location.png' },
{ key: 'home-search', name: '搜索(头部)', file: 'home-search.png' },
{ key: 'home-bell', name: '消息铃铛', file: 'home-bell.png' },
{ key: 'home-crown', name: '会员王冠(头部)', file: 'home-crown.png' },
],
},
{
group: '通用功能',
items: [
{ key: 'search', name: '搜索', file: 'search.png' },
{ key: 'plus-white', name: '发布加号(白)', file: 'plus-white.png' },
{ key: 'plus-ink', name: '发布加号(墨绿)', file: 'plus-ink.png' },
{ key: 'close', name: '关闭/清空', file: 'close.png' },
{ key: 'fire', name: '热门', file: 'fire.png' },
{ key: 'crown', name: '会员王冠', file: 'crown.png' },
{ key: 'check', name: '权益已享', file: 'check.png' },
{ key: 'shield', name: '认证/安全', file: 'shield.png' },
{ key: 'image', name: '图片', file: 'image.png' },
{ key: 'image-white', name: '图片(白)', file: 'image-white.png' },
{ key: 'wallet', name: '余额钱包', file: 'wallet.png' },
{ key: 'paywechat', name: '微信支付', file: 'paywechat.png' },
{ key: 'phone', name: '电话(白)', file: 'phone.png' },
{ key: 'phone-orange', name: '电话', file: 'phone-orange.png' },
{ key: 'phonebind', name: '手机绑定', file: 'phonebind.png' },
{ key: 'lock', name: '锁定', file: 'lock.png' },
{ key: 'star', name: '星标(实)', file: 'star.png' },
{ key: 'star-o', name: '星标(空)', file: 'star-o.png' },
{ key: 'share', name: '分享', file: 'share.png' },
{ key: 'qrcode', name: '扫码', file: 'qrcode.png' },
{ key: 'eye', name: '浏览量', file: 'eye.png' },
{ key: 'comment-gray', name: '评论数', file: 'comment-gray.png' },
{ key: 'edit', name: '编辑/发布', file: 'edit.png' },
{ key: 'folder', name: '草稿箱', file: 'folder.png' },
{ key: 'inbox', name: '空消息', file: 'inbox.png' },
{ key: 'users', name: '团队/下线', file: 'users.png' },
{ key: 'settings', name: '设置', file: 'settings.png' },
{ key: 'info', name: '关于/说明', file: 'info.png' },
{ key: 'receipt', name: '订单凭据', file: 'receipt.png' },
{ key: 'network', name: '分销网络', file: 'network.png' },
],
},
{
group: '登录与消息',
items: [
{ key: 'login-person', name: '个人用户', file: 'login-person.png' },
{ key: 'login-shop', name: '商家用户', file: 'login-shop.png' },
{ key: 'msg-system', name: '系统通知', file: 'msg-system.png' },
{ key: 'msg-interact', name: '互动消息', file: 'msg-interact.png' },
],
},
{
group: '我的',
items: [
{ key: 'mine-post', name: '我的发布', file: 'mine-post.png' },
{ key: 'mine-order', name: '我的订单', file: 'mine-order.png' },
{ key: 'mine-dist', name: '分销中心', file: 'mine-dist.png' },
{ key: 'mine-vip', name: '会员中心', file: 'mine-vip.png' },
{ key: 'mine-draft', name: '草稿箱', file: 'mine-draft.png' },
{ key: 'mine-history', name: '搜索记录', file: 'mine-history.png' },
{ key: 'mine-setting', name: '系统设置', file: 'mine-setting.png' },
{ key: 'mine-about', name: '关于我们', file: 'mine-about.png' },
],
},
{
group: '会员与订单',
items: [
{ key: 'link-order', name: '订单管理', file: 'link-order.png' },
{ key: 'link-recharge', name: '余额充值', file: 'link-recharge.png' },
{ key: 'link-dist', name: '分销中心入口', file: 'link-dist.png' },
{ key: 'order-post', name: '发布订单', file: 'order-post.png' },
{ key: 'order-member', name: '会员订单', file: 'order-member.png' },
{ key: 'order-recharge', name: '充值订单', file: 'order-recharge.png' },
{ key: 'order-other', name: '其他订单', file: 'order-other.png' },
],
},
{
group: '详情操作栏',
items: [
{ key: 'bar-fav', name: '收藏(未收藏)', file: 'bar-fav.png' },
{ key: 'bar-fav-on', name: '收藏(已收藏)', file: 'bar-fav-on.png' },
{ key: 'bar-share', name: '分享', file: 'bar-share.png' },
{ key: 'bar-poster', name: '海报', file: 'bar-poster.png' },
],
},
]
/** 扁平化:{ key: 默认文件 } */
export const ICON_DEFAULTS = ICON_GROUPS.reduce((acc, g) => {
for (const it of g.items) acc[it.key] = it.file
return acc
}, {})
/** 分类 ID → 分类图标 key */
export const CATEGORY_ICON_KEY = {
1: 'cat-job',
2: 'cat-house',
3: 'cat-goods',
4: 'cat-car',
5: 'cat-service',
6: 'cat-education',
7: 'cat-clean',
8: 'cat-friend',
}
/** 默认 LOGO */
export const DEFAULT_LOGO = '/static/logo.png'
export default { ICON_BASE, ICON_GROUPS, ICON_DEFAULTS, CATEGORY_ICON_KEY, DEFAULT_LOGO }