feat(store): v4.0.18 门店多收款账户与子账号继承二维码

C 端门店列表拼接省市区县地址;门店多银行账户与默认打款账户;子账号独立 sa_ 关联码及统计维度;同步 v4.0.18 开发文档。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-07 15:56:16 +08:00
parent a9c466930d
commit 4bdb09068c
26 changed files with 1193 additions and 102 deletions
+1 -1
View File
@@ -32,7 +32,7 @@ type EnterOptionsLike = {
function normalizeAssocScene(raw: unknown): string | null {
if (raw == null || raw === '') return null;
const s = safeDecode(String(raw)).trim();
return /^pa_\d+$/.test(s) ? s : null;
return /^(pa|sa)_\d+$/.test(s) ? s : null;
}
function extractAssocSceneFromEnterOptions(opts?: EnterOptionsLike | null): string | null {
+16
View File
@@ -17,6 +17,22 @@ export function storeStarCount(rating?: number | string | null): number {
return Math.min(5, Math.max(1, Math.round(n)));
}
/** 省市区县 + 详细地址 拼接;空则回退占位文案 */
export function fullStoreAddress(
store: {
province?: string | null;
cityName?: string | null;
city?: string | null;
district?: string | null;
address?: string | null;
},
fallback = '地址待完善',
): string {
const city = store.cityName || store.city || '';
const text = `${store.province || ''}${city}${store.district || ''}${store.address || ''}`.trim();
return text || fallback;
}
export function storeCategoryTags(
store: {
tags?: unknown;
+8 -3
View File
@@ -42,7 +42,7 @@ import {
toWeappShareTimeline,
} from '../../lib/wechat-share';
import BenefitSloganBar from '../../components/BenefitSloganBar';
import { storeCategoryTags, storeLeafCategoryIds, storeStarCount } from '../../lib/store-display';
import { fullStoreAddress, storeCategoryTags, storeLeafCategoryIds, storeStarCount } from '../../lib/store-display';
import openBadgeImg from '../../assets/icons/store-open-badge.png';
type Store = {
@@ -317,7 +317,12 @@ export default function StoresPage() {
if (!matchesCategory(s)) return false;
if (!keyword.trim()) return true;
const q = keyword.trim();
return s.name.includes(q) || (s.address ?? '').includes(q) || (s.district ?? '').includes(q);
return (
s.name.includes(q) ||
(s.address ?? '').includes(q) ||
(s.district ?? '').includes(q) ||
fullStoreAddress(s, '').includes(q)
);
});
const next = [...list];
next.sort((a, b) => {
@@ -498,7 +503,7 @@ export default function StoresPage() {
</View>
<View className="store-card-row store-card-row--mid">
<Text className="store-card-address" numberOfLines={2}>
{s.address || (s.district ? `${s.district}` : '地址待完善')}
{fullStoreAddress(s)}
</Text>
<Text className="store-card-distance">
{formatDistanceMeters(s.distanceMeters)}