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,66 @@
<template>
<view class="fc-empty">
<view class="fc-empty__icon">
<image class="fc-empty__img" :src="iconUrl(icon)" mode="aspectFit" />
</view>
<text class="fc-empty__text">{{ text }}</text>
<view v-if="btnText" class="fc-empty__btn" @click="$emit('action')">
<text>{{ btnText }}</text>
</view>
</view>
</template>
<script>
import { iconUrl } from '@/common/store/ui.js'
export default {
name: 'FcEmpty',
props: {
// 图标 key(见 common/assets/icons.js,可由后台替换)
icon: { type: String, default: 'inbox' },
text: { type: String, default: '暂无数据' },
btnText: { type: String, default: '' },
},
methods: {
iconUrl,
},
}
</script>
<style lang="scss" scoped>
.fc-empty {
padding: 120rpx 0;
display: flex;
flex-direction: column;
align-items: center;
}
.fc-empty__icon {
width: 160rpx;
height: 160rpx;
border-radius: 50%;
background: $fc-gradient-soft;
display: flex;
align-items: center;
justify-content: center;
box-shadow: $fc-shadow;
}
.fc-empty__img {
width: 76rpx;
height: 76rpx;
}
.fc-empty__text {
margin-top: 28rpx;
font-size: $fc-font;
color: $fc-text-secondary;
}
.fc-empty__btn {
margin-top: 32rpx;
padding: 16rpx 48rpx;
border-radius: $fc-radius-pill;
background: $fc-gradient-primary;
color: $fc-primary-ink;
font-size: $fc-font;
font-weight: 600;
box-shadow: $fc-shadow;
}
</style>

查看文件

@@ -0,0 +1,113 @@
<template>
<view class="fc-navbar" :class="[`fc-navbar--${theme}`]">
<view class="fc-navbar__status" :style="{ height: statusBarHeight + 'px' }"></view>
<view class="fc-navbar__bar" :style="{ height: barHeight + 'px' }">
<view v-if="showBack" class="fc-navbar__back" @click="onBack">
<text class="fc-navbar__back-icon">‹</text>
</view>
<view class="fc-navbar__title" :class="{ 'fc-navbar__title--center': center }">
<slot>
<text class="fc-navbar__title-text">{{ title }}</text>
</slot>
</view>
<view class="fc-navbar__right">
<slot name="right"></slot>
</view>
</view>
</view>
</template>
<script>
export default {
name: 'FcNavbar',
props: {
title: { type: String, default: '' },
theme: { type: String, default: 'gradient' }, // gradient | white
showBack: { type: Boolean, default: false },
center: { type: Boolean, default: true },
},
data() {
return { statusBarHeight: 20, barHeight: 44 }
},
created() {
try {
const info = uni.getSystemInfoSync()
this.statusBarHeight = info.statusBarHeight || 20
} catch (e) {
/* 忽略(非 uni 环境) */
}
},
methods: {
onBack() {
const pages = getCurrentPages()
if (pages && pages.length > 1) uni.navigateBack()
else uni.reLaunch({ url: '/pages/index/index' })
},
},
}
</script>
<style lang="scss" scoped>
.fc-navbar {
position: sticky;
top: 0;
z-index: 99;
&--gradient {
background: $fc-gradient-hero;
.fc-navbar__title-text {
color: #ffffff;
}
.fc-navbar__back-icon {
color: #ffffff;
}
}
&--white {
background: #ffffff;
border-bottom: 2rpx solid $fc-border;
.fc-navbar__title-text {
color: $fc-text;
}
.fc-navbar__back-icon {
color: $fc-text;
}
}
}
.fc-navbar__bar {
display: flex;
align-items: center;
padding: 0 24rpx;
position: relative;
}
.fc-navbar__back {
width: 60rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
}
.fc-navbar__back-icon {
font-size: 52rpx;
line-height: 1;
font-weight: 300;
}
.fc-navbar__title {
flex: 1;
&--center {
position: absolute;
left: 0;
right: 0;
text-align: center;
pointer-events: none;
}
}
.fc-navbar__title-text {
font-size: $fc-font-xl;
font-weight: 600;
}
.fc-navbar__right {
position: relative;
z-index: 1;
display: flex;
align-items: center;
}
</style>

查看文件

@@ -0,0 +1,157 @@
<template>
<view class="fc-post-card" @click="$emit('click', post)">
<view class="fc-post-card__thumb">
<image class="fc-post-card__thumb-img" :src="categoryIconUrl(post.categoryId)" mode="aspectFit" />
</view>
<view class="fc-post-card__body">
<view class="fc-post-card__title fc-ellipsis-2">{{ post.title }}</view>
<view class="fc-post-card__tags">
<text v-for="t in (post.tags || []).slice(0, 2)" :key="t" class="fc-tag fc-post-card__tag">{{ t }}</text>
<text v-if="post.isTop" class="fc-post-card__tag fc-post-card__tag--top">置顶</text>
</view>
<view class="fc-post-card__meta">
<text class="fc-post-card__area">{{ post.area }}</text>
<text class="fc-post-card__dot">·</text>
<text class="fc-post-card__time">{{ timeText }}</text>
</view>
<view class="fc-post-card__bottom">
<view class="fc-price">
<text v-if="post.price > 0" class="fc-price__symbol">¥</text>
<text v-if="post.price > 0" class="fc-post-card__amount">{{ post.price }}</text>
<text v-else class="fc-post-card__neg">面议</text>
<text class="fc-post-card__unit">{{ post.priceUnit }}</text>
</view>
<view class="fc-post-card__stats">
<view class="fc-post-card__stat">
<image class="fc-icon fc-icon--xs" :src="iconUrl('eye')" mode="aspectFit" />
<text class="fc-post-card__stat-num">{{ post.views }}</text>
</view>
<view class="fc-post-card__stat">
<image class="fc-icon fc-icon--xs" :src="iconUrl('comment-gray')" mode="aspectFit" />
<text class="fc-post-card__stat-num">{{ post.commentCount || 0 }}</text>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import { iconUrl, categoryIconUrl } from '@/common/store/ui.js'
import { fromNow } from '@/common/utils/format.js'
export default {
name: 'FcPostCard',
props: {
post: { type: Object, required: true },
},
computed: {
timeText() {
return fromNow(this.post.createdAt)
},
},
methods: {
iconUrl,
categoryIconUrl,
},
}
</script>
<style lang="scss" scoped>
.fc-post-card {
display: flex;
padding: 24rpx;
margin: 0 24rpx 20rpx;
background: $fc-bg-card;
border-radius: $fc-radius-lg;
box-shadow: $fc-shadow;
transition: transform 0.15s ease;
&:active {
transform: scale(0.985);
}
}
.fc-post-card__thumb {
width: 200rpx;
height: 200rpx;
flex: 0 0 200rpx;
margin-right: 24rpx;
border-radius: 20rpx;
background: $fc-gradient-soft;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.fc-post-card__thumb-img {
width: 100%;
height: 100%;
}
.fc-post-card__body {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
}
.fc-post-card__title {
font-size: $fc-font-lg;
font-weight: 600;
color: $fc-text;
line-height: 1.35;
}
.fc-post-card__tags {
display: flex;
flex-wrap: wrap;
margin-top: 10rpx;
}
.fc-post-card__tag {
margin-right: 10rpx;
}
.fc-post-card__tag--top {
// 置顶:亮绿面 + 墨绿字(主题 v4 规则:亮绿面只配墨绿字)
background: $fc-gradient-primary;
color: $fc-primary-ink;
font-weight: 700;
}
.fc-post-card__meta {
margin-top: 12rpx;
display: flex;
align-items: center;
font-size: $fc-font-xs;
color: $fc-text-placeholder;
}
.fc-post-card__dot {
margin: 0 8rpx;
}
.fc-post-card__bottom {
margin-top: auto;
display: flex;
align-items: flex-end;
justify-content: space-between;
}
.fc-post-card__amount {
font-size: 38rpx;
}
.fc-post-card__neg {
font-size: $fc-font-lg;
font-weight: 700;
}
.fc-post-card__unit {
margin-left: 6rpx;
font-size: $fc-font-xs;
color: $fc-text-secondary;
font-weight: 400;
}
.fc-post-card__stats {
display: flex;
}
.fc-post-card__stat {
display: flex;
align-items: center;
margin-left: 16rpx;
}
.fc-post-card__stat-num {
margin-left: 6rpx;
font-size: $fc-font-xs;
color: $fc-text-placeholder;
}
</style>

查看文件

@@ -0,0 +1,110 @@
<template>
<view class="fc-tabbar">
<view
v-for="(item, idx) in tabs"
:key="item.path"
class="fc-tabbar__item"
:class="{ 'fc-tabbar__item--active': current === idx, 'fc-tabbar__item--primary': item.primary }"
@click="switchTo(item, idx)"
>
<view class="fc-tabbar__icon" :class="{ 'fc-tabbar__icon--circle': item.primary }">
<image v-if="item.primary" class="fc-tabbar__plus" :src="iconUrl('plus-ink')" mode="aspectFit" />
<image v-else class="fc-tabbar__img" :src="iconUrl(current === idx ? item.active : item.icon)" mode="aspectFit" />
</view>
<text class="fc-tabbar__text">{{ item.text }}</text>
</view>
<view class="fc-safe-bottom"></view>
</view>
</template>
<script>
import { iconUrl } from '@/common/store/ui.js'
export default {
name: 'FcTabbar',
props: {
current: { type: Number, default: 0 },
},
data() {
return {
tabs: [
{ text: '首页', icon: 'tab-home', active: 'tab-home-on', path: '/pages/index/index' },
{ text: '发布', icon: 'tab-post', active: 'tab-post-on', path: '/pages/post/create', primary: true },
{ text: '消息', icon: 'tab-message', active: 'tab-message-on', path: '/pages/message/index' },
{ text: '我的', icon: 'tab-mine', active: 'tab-mine-on', path: '/pages/mine/index' },
],
}
},
methods: {
// 暴露给模板:图标地址由后台配置决定(未配置则用内置图标)
iconUrl,
switchTo(item, idx) {
if (idx === this.current) return
uni.reLaunch({ url: item.path })
},
},
}
</script>
<style lang="scss" scoped>
.fc-tabbar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 100;
display: flex;
align-items: center;
justify-content: space-around;
padding-top: 10rpx;
background: #ffffff;
border-top: 2rpx solid $fc-border;
box-shadow: 0 -6rpx 24rpx rgba(4, 48, 30, 0.08);
}
.fc-tabbar__item {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-bottom: 8rpx;
&--active {
.fc-tabbar__text {
color: $fc-primary-text;
font-weight: 600;
}
}
&--primary {
.fc-tabbar__text {
color: $fc-primary-text;
}
}
}
.fc-tabbar__icon {
height: 52rpx;
display: flex;
align-items: center;
justify-content: center;
&--circle {
width: 76rpx;
height: 76rpx;
margin-top: -34rpx;
border-radius: 50%;
background: $fc-gradient-primary;
box-shadow: 0 8rpx 20rpx rgba(4, 48, 30, 0.4);
}
}
.fc-tabbar__img {
width: 44rpx;
height: 44rpx;
}
.fc-tabbar__plus {
width: 40rpx;
height: 40rpx;
}
.fc-tabbar__text {
font-size: $fc-font-xs;
color: $fc-text-secondary;
margin-top: 4rpx;
}
</style>