diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 37df9ef..de057d9 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -51,6 +51,89 @@ jobs: echo "publish=false" >> $GITHUB_OUTPUT fi + # 从 CHANGELOG.md 提取当前版本的说明,落到 release-note.txt + # 用文件而不是 step output 传递:note 是多行文本,多行 output 在各版本 runner 上行为不一致 + - name: Resolve release note + env: + VERSION: ${{ steps.version.outputs.version }} + run: | + if [ ! -f CHANGELOG.md ]; then + echo "WARN: 缺少 CHANGELOG.md,本次发布不带变更说明" + : > release-note.txt + exit 0 + fi + node --input-type=module <<'NODE' + import fs from "node:fs"; + + const version = process.env.VERSION; + const heading = "## v" + version; + const lines = fs.readFileSync("CHANGELOG.md", "utf8").split(/\r?\n/); + const start = lines.findIndex(line => line.trim() === heading); + + if (start < 0) { + console.error("WARN: CHANGELOG.md 中没有 " + heading + ",本次发布不带变更说明"); + fs.writeFileSync("release-note.txt", ""); + process.exit(0); + } + + const LIMIT = 480; + const picked = []; + let inComment = false; + for (let i = start + 1; i < lines.length; i += 1) { + const raw = lines[i]; + if (/^##\s/.test(raw)) { + break; + } + // 跳过 HTML 注释,避免注释内容占掉长度 + if (inComment) { + if (raw.includes("-->")) { + inComment = false; + } + continue; + } + if (raw.includes("")) { + inComment = true; + } + continue; + } + if (raw.trim() === "") { + // 连续空行压成一个,只用于分隔段落 + if (picked.length > 0 && picked[picked.length - 1] !== "") { + picked.push(""); + } + continue; + } + // 去掉行尾空白,保留行首缩进(嵌套列表) + picked.push(raw.replace(/\s+$/, "")); + } + while (picked.length > 0 && picked[picked.length - 1] === "") { + picked.pop(); + } + + if (picked.length === 0) { + console.error("WARN: " + heading + " 下没有内容,本次发布不带变更说明"); + } + + // 按行累积到上限,不切半行,避免出现断句 + const kept = []; + let total = 0; + for (const line of picked) { + const length = Array.from(line).length + (kept.length > 0 ? 1 : 0); + if (LIMIT < total + length) { + console.error("WARN: 内容超过 " + LIMIT + " 字,截断到第 " + kept.length + " 行"); + break; + } + kept.push(line); + total += length; + } + + // 尖括号转义:note 最终走 v-html 渲染,不能让 CHANGELOG 里的 HTML 被执行 + const note = kept.join("\n").replace(/ WorkBuddy 本地工作目录 # 内含 AI 工作记忆与每日日志:写明本机绝对路径与调试上下文,且每次会话都在追加, diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..68ad9dc --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,41 @@ +# 更新日志 + + + +## v1.3.1 + +### 新增 + +- 系统更新日志 +- 回收兑换单支持快速履约 +- 新增回收兑换单时,选择了客户、回收物后显示客户可用额度 +- 库存日历的流水增加汇总,支持切换单位 +- 客户回收物列表 + +### 调整 + +- 更新提醒不再是按钮,而是通知栏 +- 回收兑换单的详情不再显示无意义的金额 + +### 修复 + +- 兑换模板列表没有显示兑换物照片 +- 登录/注册页在平板模式下用户协议窗口过小 +- 部分页面样式 diff --git a/components.d.ts b/components.d.ts index 66ac3c9..95b65d8 100644 --- a/components.d.ts +++ b/components.d.ts @@ -45,7 +45,6 @@ declare module 'vue' { SegmentedSlider: typeof import('./src/components/SegmentedSlider.vue')['default'] StoreRemoveDialog: typeof import('./src/components/StoreRemoveDialog.vue')['default'] TagSelector: typeof import('./src/components/TagSelector.vue')['default'] - TAvatar: typeof import('tdesign-mobile-vue')['Avatar'] TBadge: typeof import('tdesign-mobile-vue')['Badge'] TButton: typeof import('tdesign-mobile-vue')['Button'] TCalendar: typeof import('tdesign-mobile-vue')['Calendar'] diff --git a/package.json b/package.json index cdc22a2..cfb1891 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gao-customer-h5", "private": true, - "version": "1.3.0", + "version": "1.3.1", "type": "module", "scripts": { "dev": "vite --host", @@ -30,7 +30,7 @@ "less": "^4.3.0", "pinia": "^3.0.2", "tdesign-mobile-vue": "^1.17.1", - "timi-tdesign-mobile": "^1.1.1", + "timi-tdesign-mobile": "^1.2.0", "timi-ts": "^1.0.0", "timi-web": "^1.0.2", "timi-web-api": "^1.0.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ff9c0a6..d7489b8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,8 +47,8 @@ importers: specifier: ^1.17.1 version: 1.17.1(patch_hash=c98db305008fbfd00046666ca890e1c6cb88257c0619418694689cddf8cd78c3)(vue@3.5.40(typescript@5.8.3)) timi-tdesign-mobile: - specifier: ^1.1.1 - version: 1.1.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3)) + specifier: ^1.2.0 + version: 1.2.0(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3)) timi-ts: specifier: ^1.0.0 version: 1.0.0 @@ -2748,8 +2748,8 @@ packages: through2@4.0.2: resolution: {integrity: sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==} - timi-tdesign-mobile@1.1.1: - resolution: {integrity: sha512-aR6SKu8zVbaqHRJHRtria3amvp9UKS6jTT99FNei38ZrP1sJDBsvCoQmWi0xzUD3F/wkGnSECWWrJQToqso6PQ==} + timi-tdesign-mobile@1.2.0: + resolution: {integrity: sha512-FW9LyZlh+aSjaG3tEXBf3+YYmm+OruYVH+atQMFmlCT33q3e6Gt0rr6n6d4vLH5n0tzyidlAJ0hmrvKspKKDdw==} engines: {node: '>=20.0.0'} peerDependencies: vue: ^3.5.0 @@ -5849,7 +5849,7 @@ snapshots: dependencies: readable-stream: 3.6.2 - timi-tdesign-mobile@1.1.1(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3)): + timi-tdesign-mobile@1.2.0(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue-router@4.5.1(vue@3.5.40(typescript@5.8.3)))(vue@3.5.40(typescript@5.8.3)): dependencies: tdesign-mobile-vue: 1.17.1(patch_hash=c98db305008fbfd00046666ca890e1c6cb88257c0619418694689cddf8cd78c3)(vue@3.5.40(typescript@5.8.3)) timi-web: 1.0.2(@floating-ui/dom@1.8.0)(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/extensions@3.33.0(@tiptap/core@3.33.0(@tiptap/pm@3.33.0))(@tiptap/pm@3.33.0))(typescript@5.8.3)(vue@3.5.40(typescript@5.8.3)) diff --git a/src/api/AppUpdateAPI.ts b/src/api/AppUpdateAPI.ts new file mode 100644 index 0000000..ca47a60 --- /dev/null +++ b/src/api/AppUpdateAPI.ts @@ -0,0 +1,31 @@ +import { axios } from "timi-web-api"; +import type { AppUpdateNotesQuery, AppUpdateNotesResult } from "@/types/AppUpdate"; + +const URI = "/app/update"; + +/** + * 查询更新日志 + * + * 区间为「当前版本 → 通道当前版本」,与灰度无关,免登录态 + * + * @param query 查询参数,versionName 传当前运行的 Web 包版本 + * @returns 变更说明列表,按版本号从新到旧 + */ +async function notes(query: AppUpdateNotesQuery): Promise { + const { appId, versionName, versionCode, platform, channel } = query; + // 后端按 Capgo 插件的上报协议接收下划线字段,只在这一层转换 + /* eslint-disable camelcase */ + const payload = { + app_id: appId, + version_name: versionName, + version_code: versionCode, + platform, + channel + }; + /* eslint-enable camelcase */ + return await axios.post(`${URI}/notes`, payload); +} + +export default { + notes +}; diff --git a/src/api/RecycleAPI.ts b/src/api/RecycleAPI.ts index 57def7d..13226df 100644 --- a/src/api/RecycleAPI.ts +++ b/src/api/RecycleAPI.ts @@ -3,6 +3,7 @@ import type { OrderTransaction, RecycleAccount, RecycleAccountAdjustRequest, + RecycleCustomerAccountPage, RecycleExchange, RecycleExchangeCreateRequest, RecycleExchangeDetail, @@ -117,6 +118,18 @@ async function accountList(customerId: string): Promise { }); } +/** 按客户分页查询有余额的回收物及全门店汇总。 */ +async function accountCustomers(offset: number, limit: number, recycleItemId?: string, keyword?: string, customerIds?: string[]): Promise { + return await axios.post(`${ACCOUNT_URI}/customers`, undefined, { + params: { storeId: getCurrentStoreId() || undefined, offset, limit, recycleItemId: recycleItemId || undefined, keyword: keyword || undefined, customerIds: customerIds?.length ? customerIds.join(",") : undefined } + }); +} + +/** 获取额度查询可用的回收物选项。 */ +async function accountItems(): Promise { + return await axios.post(`${ACCOUNT_URI}/items`, undefined, { params: { storeId: getCurrentStoreId() || undefined } }); +} + /** 额度流水,服务端当前最多返回 100 条。 */ async function accountLedger(customerId: string): Promise { return await axios.post(`${ACCOUNT_URI}/ledger`, undefined, { @@ -244,6 +257,8 @@ export default { create, detail, accountList, + accountCustomers, + accountItems, accountLedger, accountAdjust, yieldList, diff --git a/src/composables/useAppUpdate.ts b/src/composables/useAppUpdate.ts index 8af04fc..570565c 100644 --- a/src/composables/useAppUpdate.ts +++ b/src/composables/useAppUpdate.ts @@ -6,11 +6,23 @@ import { ref } from "vue"; /** 自动更新的存储键 */ export const AUTO_UPDATE_KEY = "app.autoUpdate"; +/** Capacitor appId,与 capacitor.config.ts 保持一致 */ +export const APP_ID = "com.imyeyu.gao.customer"; + +/** + * 服务端下发的更新信息 + * + * 在插件协议基础上多一个 note:更新说明由后端附加,插件不识别但会原样透传 + */ +export type UpdateInfo = LatestVersion & { + note?: string; +}; + // 模块级状态,页面与启动逻辑共享同一份 const supported = Capacitor.isNativePlatform(); const currentVersion = ref(""); const nativeVersion = ref(""); -const latest = ref(null); +const latest = ref(null); const checking = ref(false); const downloading = ref(false); const percent = ref(0); @@ -34,7 +46,7 @@ async function loadCurrent(): Promise { } /** 查询服务端最新版本 */ -async function check(): Promise { +async function check(): Promise { if (!supported) { error.value = "仅在 App 内可用"; return null; diff --git a/src/pages/customer/CustomerRecycleList.vue b/src/pages/customer/CustomerRecycleList.vue new file mode 100644 index 0000000..8e6092d --- /dev/null +++ b/src/pages/customer/CustomerRecycleList.vue @@ -0,0 +1,185 @@ + + + + + diff --git a/src/pages/fulfillment/components/OrderFulfillmentQuickSourceOrders.vue b/src/pages/fulfillment/components/OrderFulfillmentQuickSourceOrders.vue index c55c321..c73c419 100644 --- a/src/pages/fulfillment/components/OrderFulfillmentQuickSourceOrders.vue +++ b/src/pages/fulfillment/components/OrderFulfillmentQuickSourceOrders.vue @@ -33,7 +33,7 @@ - + + + diff --git a/src/pages/recycle/RecycleExchangeCreate.vue b/src/pages/recycle/RecycleExchangeCreate.vue index 9795262..fde307f 100644 --- a/src/pages/recycle/RecycleExchangeCreate.vue +++ b/src/pages/recycle/RecycleExchangeCreate.vue @@ -54,6 +54,14 @@ + + + @@ -149,7 +157,7 @@ @@ -162,7 +170,13 @@ @click="selectRule(item)" >