文件
fenleixinxi/uniapp/components/fc-post-card/fc-post-card.vue
linda 376a7ed793 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 合并会把密码永久写入本仓库历史,故采用快照方式。
2026-10-17 14:19:03 +08:00

158 行
3.8 KiB
Vue

<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>