From 1b02c29114f0854d0a28a02c04b17d83f73e12fe Mon Sep 17 00:00:00 2001 From: zlwu <704541015@qq.com> Date: Tue, 11 Aug 2026 12:09:00 +0800 Subject: [PATCH] feat(mobile-h5): add OA form-sink web-view entry and test menu Co-authored-by: Cursor --- mobile-h5/pages.json | 8 ++++++++ mobile-h5/pages/index/index.vue | 10 +++++++++- mobile-h5/pages/oa/form-sink/index.vue | 21 +++++++++++++++++++++ mobile-h5/utils/config.js | 7 +++++++ mobile-h5/utils/oa-h5.js | 24 ++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 mobile-h5/pages/oa/form-sink/index.vue create mode 100644 mobile-h5/utils/oa-h5.js diff --git a/mobile-h5/pages.json b/mobile-h5/pages.json index bc361a78..7d82236c 100644 --- a/mobile-h5/pages.json +++ b/mobile-h5/pages.json @@ -32,6 +32,14 @@ "navigationBarTitleText": "工作台" } }, + { + "path": "pages/oa/form-sink/index", + "style": { + "navigationBarTitleText": "表单水槽测试", + "navigationBarBackgroundColor": "#0a9f6d", + "navigationBarTextStyle": "white" + } + }, { "path": "pages/demo/list", "style": { diff --git a/mobile-h5/pages/index/index.vue b/mobile-h5/pages/index/index.vue index 7d8085d5..bf5630a0 100644 --- a/mobile-h5/pages/index/index.vue +++ b/mobile-h5/pages/index/index.vue @@ -95,7 +95,15 @@ userName: '', postName: '', deptName: '', - menus: [], + menus: [ + { + id: 'oa-form-sink', + title: '表单水槽测试', + icon: 'orders-o', + path: '/pages/oa/form-sink/index', + tone: '' + } + ], banners: [ { id: 'banner-video-1', diff --git a/mobile-h5/pages/oa/form-sink/index.vue b/mobile-h5/pages/oa/form-sink/index.vue new file mode 100644 index 00000000..7c288856 --- /dev/null +++ b/mobile-h5/pages/oa/form-sink/index.vue @@ -0,0 +1,21 @@ + + + diff --git a/mobile-h5/utils/config.js b/mobile-h5/utils/config.js index 361ae0e8..aae6b7e5 100644 --- a/mobile-h5/utils/config.js +++ b/mobile-h5/utils/config.js @@ -8,3 +8,10 @@ export const API_BASE_URL = 'http://127.0.0.1:8000/api' export const REQUEST_TIMEOUT_MS = 15000 + +/** + * OA 表单 H5 源(web-view)。 + * 本地:电脑局域网 IP + Vite 端口,须与手机同网;真机/体验版改为已配置业务域名。 + * 例:http://192.168.1.8:5178/oa-h5/ + */ +export const OA_H5_ORIGIN = 'http://127.0.0.1:5178/oa-h5' diff --git a/mobile-h5/utils/oa-h5.js b/mobile-h5/utils/oa-h5.js new file mode 100644 index 00000000..c85dbc99 --- /dev/null +++ b/mobile-h5/utils/oa-h5.js @@ -0,0 +1,24 @@ +import { OA_H5_ORIGIN } from './config.js' +import { getToken } from './auth.js' + +function trimSlash(s) { + return String(s || '').replace(/\/$/, '') +} + +/** 水槽页 URL */ +export function buildFormSinkUrl() { + const base = trimSlash(OA_H5_ORIGIN) + const token = encodeURIComponent(getToken() || '') + return `${base}/oa-form-sink?token=${token}` +} + +/** 正式发起页 URL(阶段二) */ +export function buildOaStartUrl({ appId, draftId }) { + const base = trimSlash(OA_H5_ORIGIN) + const q = new URLSearchParams() + if (appId) q.set('appId', appId) + if (draftId) q.set('draftId', draftId) + const token = getToken() + if (token) q.set('token', token) + return `${base}/oa-start?${q.toString()}` +}