feat(mobile-h5): add OA form-sink web-view entry and test menu

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-08-11 12:09:00 +08:00
1 parent 9adff5584e
commit 1b02c29114
5 files changed
+69 -1

No files matched your search

+8
View File
@@ -32,6 +32,14 @@
"navigationBarTitleText": "工作台"
}
},
{
"path": "pages/oa/form-sink/index",
"style": {
"navigationBarTitleText": "表单水槽测试",
"navigationBarBackgroundColor": "#0a9f6d",
"navigationBarTextStyle": "white"
}
},
{
"path": "pages/demo/list",
"style": {
+9 -1
View File
@@ -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',
+21
View File
@@ -0,0 +1,21 @@
<template>
<web-view v-if="src" :src="src" @message="onMessage" />
</template>
<script>
import { buildFormSinkUrl } from '../../../utils/oa-h5.js'
export default {
data() {
return { src: '' }
},
onLoad() {
this.src = buildFormSinkUrl()
},
methods: {
onMessage(e) {
console.log('oa-h5 message', e && e.detail)
}
}
}
</script>
+7
View File
@@ -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'
+24
View File
@@ -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()}`
}