feat: 新增地址选择插件及订阅消息等多项功能优化

- 新增地址选择插件,支持地图位置选择并返回地址和经纬度
- 新增微信订阅消息发送功能,支持审核结果、提现通知等场景
- 新增订单支付状态查询、提现收款人姓名保存等接口
- 新增服务区域管理,支持按省市区划分并同步到信息发布
- 新增资金流水和营收报表导出功能
- 新增可用优惠券查询、订单退款拆分处理等功能
- 优化后台角标显示、首页数据统计、UI配置下发等
- 修复订单支付并发问题、地区管理逻辑等
这个提交包含在:
2026-10-22 17:14:56 +08:00
父节点 088a08d43a
当前提交 cb12bf5fc8
共有 180 个文件被更改,包括 9695 次插入 和 1680 次删除

查看文件

@@ -0,0 +1,241 @@
<template>
<picker
class="fc-area-picker"
:class="'fc-area-picker--' + variant"
mode="multiSelector"
:range="columns"
range-key="label"
:value="index"
:disabled="disabled || !hasAreas"
@columnchange="onColumnChange"
@change="onChange"
>
<view class="fc-area-picker__inner">
<text class="fc-area-picker__text" :class="{ 'fc-area-picker__text--placeholder': !display }">
{{ display || placeholder }}
</text>
<text class="fc-area-picker__arrow">▾</text>
</view>
</picker>
</template>
<script>
import { groupAreaTree } from '@/common/utils/area.js'
/**
* 服务区域级联选择器(省 > 市 > 区县)
*
* 数据源为平铺的 /home/areas 列表,每条记录自带省 / 市 / 区县;
* 组件内部按省、市生成三列级联,选中项以区县(areaId)为准。
*/
export default {
name: 'FcAreaPicker',
props: {
// 平铺服务区域:[{ id, province, city, district }]
areas: { type: Array, default: () => [] },
// 当前选中的服务区域 ID
value: { type: [Number, String], default: 0 },
// 是否允许选择「全部区域」(列表筛选用)
allowAll: { type: Boolean, default: false },
placeholder: { type: String, default: '请选择区域' },
// field:表单行样式;chip:筛选栏胶囊样式
variant: { type: String, default: 'field' },
disabled: { type: Boolean, default: false },
// 是否展示「省 / 市 / 区」完整路径
showFull: { type: Boolean, default: false },
},
data() {
return {
tree: [],
columns: [[], [], []],
index: [0, 0, 0],
display: '',
}
},
computed: {
hasAreas() {
return Array.isArray(this.areas) && this.areas.length > 0
},
},
watch: {
areas: {
handler() {
this.rebuildTree()
},
deep: true,
},
value() {
this.syncFromValue()
},
allowAll() {
this.syncFromValue()
},
},
mounted() {
this.rebuildTree()
},
methods: {
/** 平铺列表 → 省市级联树 */
rebuildTree() {
this.tree = groupAreaTree(this.areas || [])
this.syncFromValue()
},
/** 按当前选中值回显三列索引 */
syncFromValue() {
const areaId = Number(this.value) || 0
const offset = this.allowAll ? 1 : 0
let pi = 0
let ci = 0
let di = 0
let matched = null
if (areaId > 0) {
for (let p = 0; p < this.tree.length && !matched; p++) {
const cities = this.tree[p].cities || []
for (let c = 0; c < cities.length && !matched; c++) {
const districts = cities[c].districts || []
for (let d = 0; d < districts.length; d++) {
if (Number(districts[d].id) === areaId) {
pi = p
ci = c
di = d
matched = { province: this.tree[p].name, city: cities[c].name, district: districts[d] }
break
}
}
}
}
}
this.index = [pi + offset, ci, di]
this.buildColumns()
this.display = matched ? this.formatDisplay(matched) : ''
},
/** 按当前索引重建三列 */
buildColumns() {
const offset = this.allowAll ? 1 : 0
const pi = Math.max(0, Number(this.index[0]) - offset)
const ci = Math.max(0, Number(this.index[1]) || 0)
const first = this.allowAll ? [{ label: '全部区域', type: 'all' }] : []
this.columns = [
first.concat(this.tree.map((p) => ({ label: p.name, type: 'province', province: p.name }))),
((this.tree[pi] && this.tree[pi].cities) || []).map((c) => ({
label: c.name,
type: 'city',
city: c.name,
})),
(((this.tree[pi] && this.tree[pi].cities[ci]) || {}).districts || []).map((d) => ({
label: d.name,
type: 'area',
area: d,
})),
]
},
/** 滚动某一列时联动后续列 */
onColumnChange(e) {
const column = Number(e.detail.column)
const value = Number(e.detail.value)
const next = [...this.index]
next[column] = value
if (column === 0) {
next[1] = 0
next[2] = 0
} else if (column === 1) {
next[2] = 0
}
this.index = next
this.buildColumns()
},
/** 点确定后向上抛出选中的区县 */
onChange(e) {
const values = e.detail.value || []
this.index = [Number(values[0] || 0), Number(values[1] || 0), Number(values[2] || 0)]
this.buildColumns()
const offset = this.allowAll ? 1 : 0
const pi = this.index[0] - offset
if (pi < 0) {
this.display = ''
this.$emit('change', null)
return
}
const province = this.tree[pi]
const city = province && province.cities ? province.cities[this.index[1]] : null
const district = city && city.districts ? city.districts[this.index[2]] : null
if (!province || !city || !district) {
this.display = ''
this.$emit('change', null)
return
}
const selected = { province: province.name, city: city.name, district }
this.display = this.formatDisplay(selected)
this.$emit('change', {
areaId: Number(district.id) || 0,
province: province.name,
city: city.name,
district: district.name,
})
},
formatDisplay(selected) {
if (!selected) return ''
const district = selected.district || {}
const districtName = typeof district === 'string' ? district : district.name
if (this.showFull) {
return `${selected.province} / ${selected.city} / ${districtName}`
}
return districtName || ''
},
},
}
</script>
<style lang="scss" scoped>
.fc-area-picker {
display: block;
}
.fc-area-picker__inner {
display: flex;
align-items: center;
justify-content: space-between;
}
.fc-area-picker--field .fc-area-picker__inner {
min-height: 88rpx;
padding: 0 24rpx;
background: #ffffff;
border: 2rpx solid $fc-border;
border-radius: $fc-radius;
}
.fc-area-picker--chip .fc-area-picker__inner {
justify-content: flex-start;
}
.fc-area-picker--plain .fc-area-picker__inner {
justify-content: flex-end;
}
.fc-area-picker--plain .fc-area-picker__text {
text-align: right;
font-size: $fc-font-sm;
color: $fc-text-secondary;
}
.fc-area-picker__text {
flex: 1;
font-size: $fc-font;
color: $fc-text;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
&--placeholder {
color: $fc-text-placeholder;
}
}
.fc-area-picker--chip .fc-area-picker__text {
flex: none;
font-size: $fc-font-sm;
color: $fc-text-regular;
}
.fc-area-picker__arrow {
margin-left: 8rpx;
font-size: 22rpx;
color: $fc-text-muted;
}
</style>

查看文件

@@ -4,22 +4,26 @@
:class="{ 'fc-post-card--compact': compact }"
@click="$emit('click', post)"
>
<!-- 缩略图:有真实实拍图展示实拍大图;无图时展示高品质分类徽章微名片 -->
<!-- 缩略图:有真实实拍图展示实拍大图;无图时展示分类图标微名片(分类名统一由下方分类标签承载,避免重复) -->
<view class="fc-post-card__thumb" :class="{ 'fc-post-card__thumb--badge': !thumbUrl }">
<image v-if="thumbUrl" class="fc-post-card__thumb-img" :src="thumbUrl" mode="aspectFill" />
<view v-else class="fc-post-card__deco-badge">
<view class="fc-post-card__deco-halo">
<image class="fc-post-card__deco-icon" :src="categoryIconUrl(post.categoryId)" mode="aspectFit" />
</view>
<text class="fc-post-card__deco-name">{{ shortCatName }}</text>
</view>
</view>
<!-- 内容主体 -->
<view class="fc-post-card__body">
<view class="fc-post-card__title fc-ellipsis-2">{{ post.title }}</view>
<view v-if="post.isTop || (post.tags && post.tags.length)" class="fc-post-card__tags">
<view v-if="post.isTop || post.categoryName || (post.tags && post.tags.length)" class="fc-post-card__tags">
<text v-if="post.isTop" class="fc-tag fc-post-card__tag fc-post-card__tag--top">置顶</text>
<!-- 分类标签:列表卡片固定展示,图标 + 分类名 -->
<view v-if="post.categoryName" class="fc-tag fc-post-card__tag fc-post-card__tag--cat">
<image class="fc-post-card__tag-icon" :src="categoryIconUrl(post.categoryId)" mode="aspectFit" />
<text>{{ post.categoryName }}</text>
</view>
<text v-for="t in (post.tags || []).slice(0, 2)" :key="t" class="fc-tag fc-post-card__tag">{{ t }}</text>
</view>
<view class="fc-post-card__meta">
@@ -74,11 +78,6 @@ export default {
distanceText() {
return this.post.distance == null ? '' : formatKm(this.post.distance)
},
/** 缩略图角标精简分类名(2~4字) */
shortCatName() {
const n = this.post.categoryName || ''
return n.length > 4 ? n.slice(0, 4) : (n || '同城精选')
},
/**
* 帖子封面图:优先使用实际上传封面或第一张实拍图,无图时回退为空由图标微卡片兜底
*/
@@ -160,8 +159,8 @@ export default {
}
.fc-post-card__deco-halo {
width: 76rpx;
height: 76rpx;
width: 84rpx;
height: 84rpx;
border-radius: 50%;
background: rgba(255, 255, 255, 0.88);
display: flex;
@@ -171,16 +170,8 @@ export default {
}
.fc-post-card__deco-icon {
width: 44rpx;
height: 44rpx;
}
.fc-post-card__deco-name {
margin-top: 10rpx;
font-size: 20rpx;
font-weight: 600;
color: $fc-primary-text;
letter-spacing: 0.5rpx;
width: 50rpx;
height: 50rpx;
}
/* 内容主体 */
@@ -201,7 +192,8 @@ export default {
}
.fc-post-card__tags {
display: flex;
flex-wrap: wrap;
flex-wrap: nowrap;
overflow: hidden;
gap: 8rpx;
margin-bottom: 8rpx;
}
@@ -209,6 +201,19 @@ export default {
margin: 0;
font-size: 20rpx;
padding: 2rpx 10rpx;
white-space: nowrap;
flex-shrink: 0;
}
/* 分类标签:浅绿底 + 墨绿字(亮绿背景禁用白字),与全局 fc-tag 规范一致 */
.fc-post-card__tag--cat {
gap: 6rpx;
padding: 2rpx 14rpx 2rpx 10rpx;
font-weight: 600;
}
.fc-post-card__tag-icon {
width: 22rpx;
height: 22rpx;
flex-shrink: 0;
}
.fc-post-card__tag--top {
background: $fc-gradient-primary;
@@ -304,16 +309,12 @@ export default {
border-radius: 12rpx;
}
.fc-post-card__deco-halo {
width: 58rpx;
height: 58rpx;
width: 64rpx;
height: 64rpx;
}
.fc-post-card__deco-icon {
width: 34rpx;
height: 34rpx;
}
.fc-post-card__deco-name {
margin-top: 6rpx;
font-size: 18rpx;
width: 38rpx;
height: 38rpx;
}
.fc-post-card__title {
font-size: 27rpx;
@@ -329,6 +330,13 @@ export default {
font-size: 18rpx;
padding: 2rpx 8rpx;
}
.fc-post-card__tag--cat {
padding: 2rpx 12rpx 2rpx 8rpx;
}
.fc-post-card__tag-icon {
width: 20rpx;
height: 20rpx;
}
.fc-post-card__meta {
font-size: 20rpx;
margin-bottom: 4rpx;