verce-vue-test 0.0.37 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/888/mini2.0-main/.editorconfig +8 -0
  2. package/888/mini2.0-main/.env.development +3 -0
  3. package/888/mini2.0-main/.env.production +3 -0
  4. package/888/mini2.0-main/.env.test +3 -0
  5. package/888/mini2.0-main/.gitattributes +1 -0
  6. package/888/mini2.0-main/.oxlintrc.json +10 -0
  7. package/888/mini2.0-main/.prettierrc.json +6 -0
  8. package/888/mini2.0-main/.vscode/extensions.json +9 -0
  9. package/888/mini2.0-main/README.md +179 -0
  10. package/888/mini2.0-main/auto-imports.d.ts +629 -0
  11. package/888/mini2.0-main/components.d.ts +21 -0
  12. package/888/mini2.0-main/design-qa.md +36 -0
  13. package/888/mini2.0-main/docs/MX_API.md +244 -0
  14. package/888/mini2.0-main/docs/REQUEST.md +217 -0
  15. package/888/mini2.0-main/docs/jsapi.js +515 -0
  16. package/888/mini2.0-main/docs/package-json-guide.md +132 -0
  17. package/888/mini2.0-main/env.d.ts +15 -0
  18. package/888/mini2.0-main/eslint.config.ts +26 -0
  19. package/888/mini2.0-main/index.html +16 -0
  20. package/888/mini2.0-main/output/playwright/rmb-position/design-comparison.png +0 -0
  21. package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-back-top.png +0 -0
  22. package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-page.png +0 -0
  23. package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-sticky-check.png +0 -0
  24. package/888/mini2.0-main/output/playwright/rmb-position/rmb-position-sticky-scrolled.png +0 -0
  25. package/888/mini2.0-main/package-lock.json +6442 -0
  26. package/888/mini2.0-main/package.json +66 -0
  27. package/888/mini2.0-main/plugins/bump-version.ts +61 -0
  28. package/888/mini2.0-main/postcss.config.ts +15 -0
  29. package/888/mini2.0-main/public/favicon.ico +0 -0
  30. package/888/mini2.0-main/public/images/12a73787-86a9-4891-a65f-66104746f6a8.png +0 -0
  31. package/888/mini2.0-main/public/images/5798d7aa-ba8b-4605-8079-58b35495ac55.png +0 -0
  32. package/888/mini2.0-main/public/images/73fef1e4-0fd0-4a1a-9b8b-a70a5b6acbbc.png +0 -0
  33. package/888/mini2.0-main/public/images/bc685b4c-0cca-4a79-924c-a8ee10e6f8eb.png +0 -0
  34. package/888/mini2.0-main/public/images/c3dbbd9d-be56-490e-b9f4-6ee17ebefffc.png +0 -0
  35. package/888/mini2.0-main/public/images/ea745a10-42aa-4f44-8d7f-3ab02cc0adcd.png +0 -0
  36. package/888/mini2.0-main/public/images/f5876785-b927-4347-ba19-999114240649.png +0 -0
  37. package/888/mini2.0-main/public/images/img.png +0 -0
  38. package/888/mini2.0-main/src/App.vue +59 -0
  39. package/888/mini2.0-main/src/api/health.ts +13 -0
  40. package/888/mini2.0-main/src/api/rmb-position.ts +287 -0
  41. package/888/mini2.0-main/src/api/user.ts +54 -0
  42. package/888/mini2.0-main/src/auto-imports.d.ts +639 -0
  43. package/888/mini2.0-main/src/components.d.ts +30 -0
  44. package/888/mini2.0-main/src/config/config.properties +3 -0
  45. package/888/mini2.0-main/src/config/env.ts +6 -0
  46. package/888/mini2.0-main/src/config/plugin.properties.pro +6 -0
  47. package/888/mini2.0-main/src/config/plugin.properties.test +6 -0
  48. package/888/mini2.0-main/src/core/mxApi/index.ts +344 -0
  49. package/888/mini2.0-main/src/core/request/index.ts +135 -0
  50. package/888/mini2.0-main/src/main.ts +39 -0
  51. package/888/mini2.0-main/src/router/index.ts +77 -0
  52. package/888/mini2.0-main/src/stores/app.ts +24 -0
  53. package/888/mini2.0-main/src/stores/counter.ts +12 -0
  54. package/888/mini2.0-main/src/stores/user.ts +85 -0
  55. package/888/mini2.0-main/src/types/api.d.ts +14 -0
  56. package/888/mini2.0-main/src/types/nprogress.d.ts +8 -0
  57. package/888/mini2.0-main/src/utils/auth-token.ts +197 -0
  58. package/888/mini2.0-main/src/utils/query.ts +27 -0
  59. package/888/mini2.0-main/src/utils/request.ts +233 -0
  60. package/888/mini2.0-main/src/views/clearing-detail/index.vue +49 -0
  61. package/888/mini2.0-main/src/views/foreign-position/index.vue +49 -0
  62. package/888/mini2.0-main/src/views/home/index.vue +213 -0
  63. package/888/mini2.0-main/src/views/login/index.vue +202 -0
  64. package/888/mini2.0-main/src/views/mine/index.vue +143 -0
  65. package/888/mini2.0-main/src/views/net-debit/index.vue +49 -0
  66. package/888/mini2.0-main/src/views/pbc-position/index.vue +49 -0
  67. package/888/mini2.0-main/src/views/position-estimate/index.vue +49 -0
  68. package/888/mini2.0-main/src/views/rmb-position/index.vue +1042 -0
  69. package/888/mini2.0-main/src/views/warning/index.vue +49 -0
  70. package/888/mini2.0-main/tsconfig.app.json +18 -0
  71. package/888/mini2.0-main/tsconfig.json +11 -0
  72. package/888/mini2.0-main/tsconfig.node.json +28 -0
  73. package/888/mini2.0-main/vite.config.ts +98 -0
  74. package/design-qa.md +39 -0
  75. package/mini2.0-main 2/.editorconfig +8 -0
  76. package/mini2.0-main 2/.env.development +3 -0
  77. package/mini2.0-main 2/.env.production +3 -0
  78. package/mini2.0-main 2/.env.test +3 -0
  79. package/mini2.0-main 2/.gitattributes +1 -0
  80. package/mini2.0-main 2/.oxlintrc.json +10 -0
  81. package/mini2.0-main 2/.prettierrc.json +6 -0
  82. package/mini2.0-main 2/.vscode/extensions.json +9 -0
  83. package/mini2.0-main 2/README.md +179 -0
  84. package/mini2.0-main 2/auto-imports.d.ts +629 -0
  85. package/mini2.0-main 2/components.d.ts +21 -0
  86. package/mini2.0-main 2/docs/MX_API.md +244 -0
  87. package/mini2.0-main 2/docs/REQUEST.md +217 -0
  88. package/mini2.0-main 2/docs/jsapi.js +515 -0
  89. package/mini2.0-main 2/docs/package-json-guide.md +132 -0
  90. package/mini2.0-main 2/env.d.ts +13 -0
  91. package/mini2.0-main 2/eslint.config.ts +26 -0
  92. package/mini2.0-main 2/index.html +16 -0
  93. package/mini2.0-main 2/package-lock.json +6442 -0
  94. package/mini2.0-main 2/package.json +66 -0
  95. package/mini2.0-main 2/plugins/bump-version.ts +61 -0
  96. package/mini2.0-main 2/postcss.config.ts +15 -0
  97. package/mini2.0-main 2/public/favicon.ico +0 -0
  98. package/mini2.0-main 2/public/images/12a73787-86a9-4891-a65f-66104746f6a8.png +0 -0
  99. package/mini2.0-main 2/public/images/5798d7aa-ba8b-4605-8079-58b35495ac55.png +0 -0
  100. package/mini2.0-main 2/public/images/73fef1e4-0fd0-4a1a-9b8b-a70a5b6acbbc.png +0 -0
  101. package/mini2.0-main 2/public/images/bc685b4c-0cca-4a79-924c-a8ee10e6f8eb.png +0 -0
  102. package/mini2.0-main 2/public/images/c3dbbd9d-be56-490e-b9f4-6ee17ebefffc.png +0 -0
  103. package/mini2.0-main 2/public/images/ea745a10-42aa-4f44-8d7f-3ab02cc0adcd.png +0 -0
  104. package/mini2.0-main 2/public/images/f5876785-b927-4347-ba19-999114240649.png +0 -0
  105. package/mini2.0-main 2/public/images/img.png +0 -0
  106. package/mini2.0-main 2/src/App.vue +11 -0
  107. package/mini2.0-main 2/src/api/user.ts +33 -0
  108. package/mini2.0-main 2/src/auto-imports.d.ts +639 -0
  109. package/mini2.0-main 2/src/components.d.ts +23 -0
  110. package/mini2.0-main 2/src/config/config.properties +3 -0
  111. package/mini2.0-main 2/src/config/env.ts +6 -0
  112. package/mini2.0-main 2/src/config/plugin.properties.pro +6 -0
  113. package/mini2.0-main 2/src/config/plugin.properties.test +6 -0
  114. package/mini2.0-main 2/src/core/mxApi/index.ts +217 -0
  115. package/mini2.0-main 2/src/core/request/index.ts +42 -0
  116. package/mini2.0-main 2/src/main.ts +28 -0
  117. package/mini2.0-main 2/src/router/index.ts +70 -0
  118. package/mini2.0-main 2/src/stores/app.ts +24 -0
  119. package/mini2.0-main 2/src/stores/counter.ts +12 -0
  120. package/mini2.0-main 2/src/stores/user.ts +52 -0
  121. package/mini2.0-main 2/src/types/api.d.ts +14 -0
  122. package/mini2.0-main 2/src/types/nprogress.d.ts +8 -0
  123. package/mini2.0-main 2/src/utils/query.ts +27 -0
  124. package/mini2.0-main 2/src/utils/request.ts +159 -0
  125. package/mini2.0-main 2/src/views/clearing-detail/index.vue +49 -0
  126. package/mini2.0-main 2/src/views/foreign-position/index.vue +49 -0
  127. package/mini2.0-main 2/src/views/home/index.vue +201 -0
  128. package/mini2.0-main 2/src/views/login/index.vue +196 -0
  129. package/mini2.0-main 2/src/views/net-debit/index.vue +49 -0
  130. package/mini2.0-main 2/src/views/pbc-position/index.vue +49 -0
  131. package/mini2.0-main 2/src/views/position-estimate/index.vue +49 -0
  132. package/mini2.0-main 2/src/views/rmb-position/index.vue +49 -0
  133. package/mini2.0-main 2/src/views/warning/index.vue +49 -0
  134. package/mini2.0-main 2/tsconfig.app.json +18 -0
  135. package/mini2.0-main 2/tsconfig.json +11 -0
  136. package/mini2.0-main 2/tsconfig.node.json +28 -0
  137. package/mini2.0-main 2/vite.config.ts +69 -0
  138. package/output/playwright/home-1672x941.png +0 -0
  139. package/output/playwright/home-preview-1672x941.png +0 -0
  140. package/output/playwright/home-reference-vs-preview.png +0 -0
  141. package/package.json +1 -1
  142. package/src/assets/home/card-clearing-city.png +0 -0
  143. package/src/assets/home/card-cross-border-map.png +0 -0
  144. package/src/assets/home/card-digital-currency.png +0 -0
  145. package/src/assets/home/card-eur-church.png +0 -0
  146. package/src/assets/home/card-hkd-skyline.png +0 -0
  147. package/src/assets/home/card-jpy-fuji.png +0 -0
  148. package/src/assets/home/card-rmb-great-wall.png +0 -0
  149. package/src/assets/home/card-usd-liberty.png +0 -0
  150. package/src/assets/home/home-page-bg.png +0 -0
  151. package/src/router/index.ts +1 -0
  152. package/src/views/FundCockpitView.vue +17 -23
  153. package/src/views/HomeView.vue +619 -33
@@ -0,0 +1,49 @@
1
+ <script setup lang="ts"></script>
2
+
3
+ <template>
4
+ <main class="page">
5
+ <header class="page-header">
6
+ <button class="back-btn" type="button" @click="$router.back()">←</button>
7
+ <h1>预警信息</h1>
8
+ </header>
9
+ <section class="page-body">
10
+ <p class="placeholder">页面建设中…</p>
11
+ </section>
12
+ </main>
13
+ </template>
14
+
15
+ <style scoped>
16
+ .page {
17
+ max-width: 750px;
18
+ min-height: 100vh;
19
+ margin: 0 auto;
20
+ padding: 0 11px;
21
+ background: #f7f8fa;
22
+ }
23
+ .page-header {
24
+ display: flex;
25
+ align-items: center;
26
+ gap: 8px;
27
+ height: 48px;
28
+ }
29
+ .back-btn {
30
+ border: 0;
31
+ background: transparent;
32
+ font-size: 20px;
33
+ cursor: pointer;
34
+ }
35
+ .page-header h1 {
36
+ margin: 0;
37
+ font-size: 17px;
38
+ font-weight: 700;
39
+ }
40
+ .page-body {
41
+ padding: 24px 0;
42
+ }
43
+ .placeholder {
44
+ text-align: center;
45
+ color: #969799;
46
+ font-size: 14px;
47
+ padding-top: 120px;
48
+ }
49
+ </style>
@@ -0,0 +1,18 @@
1
+ {
2
+ "extends": "@vue/tsconfig/tsconfig.dom.json",
3
+ "include": ["env.d.ts", "auto-imports.d.ts", "components.d.ts", "src/**/*", "src/**/*.vue"],
4
+ "exclude": ["src/**/__tests__/*"],
5
+ "compilerOptions": {
6
+ // Extra safety for array and object lookups, but may have false positives.
7
+ "noUncheckedIndexedAccess": true,
8
+
9
+ // Path mapping for cleaner imports.
10
+ "paths": {
11
+ "@/*": ["./src/*"]
12
+ },
13
+
14
+ // `vue-tsc --build` produces a .tsbuildinfo file for incremental type-checking.
15
+ // Specified here to keep it out of the root directory.
16
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo"
17
+ }
18
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.node.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.app.json"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,28 @@
1
+ // TSConfig for modules that run in Node.js environment via either transpilation or type-stripping.
2
+ {
3
+ "extends": "@tsconfig/node24/tsconfig.json",
4
+ "include": [
5
+ "vite.config.*",
6
+ "plugins/*.ts",
7
+ "vitest.config.*",
8
+ "cypress.config.*",
9
+ "playwright.config.*",
10
+ "eslint.config.*"
11
+ ],
12
+ "compilerOptions": {
13
+ // Most tools use transpilation instead of Node.js's native type-stripping.
14
+ // Bundler mode provides a smoother developer experience.
15
+ "module": "preserve",
16
+ "moduleResolution": "bundler",
17
+
18
+ // Include Node.js types and avoid accidentally including other `@types/*` packages.
19
+ "types": ["node"],
20
+
21
+ // Disable emitting output during `vue-tsc --build`, which is used for type-checking only.
22
+ "noEmit": true,
23
+
24
+ // `vue-tsc --build` produces a .tsbuildinfo file for incremental type-checking.
25
+ // Specified here to keep it out of the root directory.
26
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo"
27
+ }
28
+ }
@@ -0,0 +1,98 @@
1
+ import { fileURLToPath, URL } from 'node:url'
2
+ import { readFileSync } from 'node:fs'
3
+
4
+ import { defineConfig, loadEnv } from 'vite'
5
+ import vue from '@vitejs/plugin-vue'
6
+ import vueDevTools from 'vite-plugin-vue-devtools'
7
+ import AutoImport from 'unplugin-auto-import/vite'
8
+ import Components from 'unplugin-vue-components/vite'
9
+ import { VantResolver } from 'unplugin-vue-components/resolvers'
10
+ import { bumpVersion } from './plugins/bump-version'
11
+
12
+ // https://vite.dev/config/
13
+ export default defineConfig(({ command, mode }) => {
14
+ const env = loadEnv(mode, process.cwd(), '')
15
+ const apiBaseUrl = env.VITE_API_BASE_URL || '/api'
16
+ const appVersion = getAppVersion(mode, command)
17
+
18
+ return {
19
+ base: './',
20
+ define: {
21
+ __APP_VERSION__: JSON.stringify(appVersion),
22
+ },
23
+ plugins: [
24
+ vue(),
25
+ vueDevTools(),
26
+
27
+ // 自动导入 Vue / Vue Router / Pinia / VueUse / Vant 的 API,省去手动 import
28
+ AutoImport({
29
+ imports: [
30
+ 'vue',
31
+ 'vue-router',
32
+ 'pinia',
33
+ '@vueuse/core',
34
+ { vant: ['showToast', 'showDialog', 'showConfirmDialog', 'showLoadingToast', 'closeToast'] },
35
+ ],
36
+ dts: 'src/auto-imports.d.ts',
37
+ vueTemplate: true,
38
+ }),
39
+
40
+ // 自动导入组件(Vant 按需加载)
41
+ Components({
42
+ resolvers: [VantResolver()],
43
+ dts: 'src/components.d.ts',
44
+ }),
45
+
46
+ // 打包时自增版本号,并将 plugin.properties 输出到 dist/
47
+ bumpVersion(mode),
48
+ ],
49
+
50
+ server: {
51
+ host: '0.0.0.0',
52
+ port: 8080,
53
+ strictPort: true,
54
+ open: true,
55
+
56
+ proxy: {
57
+ '/oms': {
58
+ target: 'http://10.56.183.104:8090',
59
+ changeOrigin: true,
60
+ },
61
+ },
62
+ },
63
+
64
+ resolve: {
65
+ alias: {
66
+ '@': fileURLToPath(new URL('./src', import.meta.url)),
67
+ },
68
+ },
69
+
70
+ build: {
71
+ outDir: 'dist/www',
72
+ },
73
+ }
74
+ })
75
+
76
+ function getAppVersion(mode: string, command: 'build' | 'serve') {
77
+ const suffix = mode === 'production' ? 'pro' : 'test'
78
+ const content = readFileSync(`src/config/plugin.properties.${suffix}`, 'utf-8')
79
+
80
+ if (command === 'build') {
81
+ const versionCode = content.match(/version_code=(\d+)/)?.[1]
82
+
83
+ if (versionCode) {
84
+ return toVersionName(Number(versionCode) + 1)
85
+ }
86
+ }
87
+
88
+ return content.match(/version_name=([^;\n]+)/)?.[1] || '0.0.0'
89
+ }
90
+
91
+ function toVersionName(versionCode: number) {
92
+ const major = Math.floor(versionCode / 10000)
93
+ const minor = Math.floor((versionCode / 1000) % 10)
94
+ const patch = Math.floor((versionCode / 100) % 10)
95
+ const hotfix = String(versionCode % 100).padStart(2, '0')
96
+
97
+ return `${major}.${minor}.${patch}.${hotfix}`
98
+ }
package/design-qa.md ADDED
@@ -0,0 +1,39 @@
1
+ **Findings**
2
+ - No actionable P0/P1/P2 findings remain.
3
+
4
+ **Open Questions**
5
+ - None for the current homepage state.
6
+
7
+ **Implementation Checklist**
8
+ - Built the homepage as a fullscreen balance overview route.
9
+ - Reused the provided home assets and renamed them to ASCII filenames.
10
+ - Matched the reference viewport at 1672x941.
11
+ - Removed the extra white highlight dot from all circular badge icons.
12
+ - Verified the production preview screenshot against the source reference.
13
+
14
+ **Follow-up Polish**
15
+ - [P3] The three non-currency badge glyphs use the closest available Element Plus icons. If exact source icon artwork becomes available, replace those three glyphs with the supplied image assets for even tighter parity.
16
+
17
+ source visual truth path: `/var/folders/9_/635n2vmx5017pd592w50p_d80000gn/T/codex-clipboard-5312293c-ab94-4ddd-9cdd-53b6bbe19f2b.png`
18
+
19
+ implementation screenshot path: `/Users/bombingpig/WebstormProjects/verce-vue-test/output/playwright/home-preview-1672x941.png`
20
+
21
+ viewport: `1672x941`
22
+
23
+ state: production preview, `/`, default homepage
24
+
25
+ full-view comparison evidence: `/Users/bombingpig/WebstormProjects/verce-vue-test/output/playwright/home-reference-vs-preview.png`
26
+
27
+ focused region comparison evidence: badge row and first-row card regions were checked in the combined comparison image; the previously visible white highlight dot on circular icons is no longer present.
28
+
29
+ required fidelity surfaces:
30
+ - Fonts and typography: Chinese titles, timestamps, labels, amounts, decimals, and unit codes match the visual hierarchy and stay inside their containers.
31
+ - Spacing and layout rhythm: glass panel, two-column/four-row grid, card gaps, rounded corners, and bottom spacing are aligned to the 1672x941 reference viewport.
32
+ - Colors and visual tokens: red, green, blue, cyan, orange, and purple card themes follow the source palette and use supplied background art.
33
+ - Image quality and asset fidelity: all provided raster backgrounds are used from `src/assets/home`; no Chinese filenames remain in the app references.
34
+ - Copy and content: title, update time, account labels, amount strings, decimals, and currency codes match the screenshot.
35
+
36
+ patches made since previous QA pass:
37
+ - Removed the small white radial-gradient highlight dot from `.currency-badge`.
38
+
39
+ final result: passed
@@ -0,0 +1,8 @@
1
+ [*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue,css,scss,sass,less,styl}]
2
+ charset = utf-8
3
+ indent_size = 2
4
+ indent_style = space
5
+ insert_final_newline = true
6
+ trim_trailing_whitespace = true
7
+ end_of_line = lf
8
+ max_line_length = 100
@@ -0,0 +1,3 @@
1
+ VITE_APP_ENV=development
2
+ VITE_API_BASE_URL=/oms
3
+ VITE_API_TIMEOUT=10000
@@ -0,0 +1,3 @@
1
+ VITE_APP_ENV=production
2
+ VITE_API_BASE_URL=https://api.example.com
3
+ VITE_API_TIMEOUT=10000
@@ -0,0 +1,3 @@
1
+ VITE_APP_ENV=test
2
+ VITE_API_BASE_URL=https://test-api.example.com
3
+ VITE_API_TIMEOUT=10000
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -0,0 +1,10 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "plugins": ["eslint", "typescript", "unicorn", "oxc", "vue"],
4
+ "env": {
5
+ "browser": true
6
+ },
7
+ "categories": {
8
+ "correctness": "error"
9
+ }
10
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/prettierrc",
3
+ "semi": false,
4
+ "singleQuote": true,
5
+ "printWidth": 100
6
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "recommendations": [
3
+ "Vue.volar",
4
+ "dbaeumer.vscode-eslint",
5
+ "EditorConfig.EditorConfig",
6
+ "oxc.oxc-vscode",
7
+ "esbenp.prettier-vscode"
8
+ ]
9
+ }
@@ -0,0 +1,179 @@
1
+ # mini2.0 项目说明
2
+
3
+ ## 项目概述
4
+
5
+ 基于 Vue 3 + TypeScript + Vant 的移动端混合应用模板,已集成敏行原生桥接 API。
6
+
7
+ ## 技术栈
8
+
9
+ | 技术 | 版本 | 用途 |
10
+ |------|------|------|
11
+ | Vue 3 | ^3.5 | 前端框架 |
12
+ | TypeScript | ^6.0 | 类型检查 |
13
+ | Vite | ^8.0 | 构建工具 |
14
+ | Vant | ^4.9 | 移动端 UI 组件库 |
15
+ | Pinia | ^3.0 | 状态管理 |
16
+ | Vue Router | ^5.0 | 路由管理 |
17
+ | Axios | ^1.16 | HTTP 客户端 |
18
+
19
+ ## 目录结构
20
+
21
+ ```
22
+ mini2.0/
23
+ ├── src/
24
+ │ ├── core/
25
+ │ │ └── mxApi/
26
+ │ │ └── index.ts # 原生桥接 API
27
+ │ ├── api/ # API 接口定义
28
+ │ ├── config/
29
+ │ │ └── env.ts # 环境配置
30
+ │ ├── router/ # 路由配置
31
+ │ ├── stores/ # Pinia 状态管理
32
+ │ ├── types/ # TypeScript 类型定义
33
+ │ ├── utils/
34
+ │ │ └── request.ts # axios 封装
35
+ │ ├── views/ # 页面视图
36
+ │ ├── App.vue # 根组件
37
+ │ └── main.ts # 入口文件
38
+ ├── docs/
39
+ │ └── MX_API.md # 原生 API 文档
40
+ ├── vite.config.ts # Vite 配置
41
+ └── package.json
42
+ ```
43
+
44
+ ## 两种 HTTP 请求方案
45
+
46
+ ### 1. axios(默认,浏览器环境)
47
+
48
+ ```typescript
49
+ import { request } from '@/utils/request'
50
+
51
+ const res = await request({
52
+ url: '/api/users',
53
+ method: 'GET',
54
+ params: { page: 1 }
55
+ })
56
+ ```
57
+
58
+ ### 2. 原生 AJAX(绕过跨域)
59
+
60
+ ```typescript
61
+ import { ajaxGet } from '@/core/mxApi'
62
+
63
+ const { data } = await ajaxGet('/api/users', { page: 1 })
64
+ ```
65
+
66
+ ## 智能切换示例
67
+
68
+ ```typescript
69
+ import { isNativeApp, ajaxGet as nativeGet } from '@/core/mxApi'
70
+ import { request } from '@/utils/request'
71
+
72
+ export async function fetchUsers(page: number) {
73
+ if (isNativeApp()) {
74
+ return (await nativeGet('/api/users', { page })).data
75
+ } else {
76
+ return (await request({ url: '/api/users', params: { page } })).data
77
+ }
78
+ }
79
+ ```
80
+
81
+ ## 开发命令
82
+
83
+ ```bash
84
+ # 开发环境
85
+ npm run dev
86
+
87
+ # 测试环境
88
+ npm run dev:test
89
+
90
+ # 生产构建
91
+ npm run build:prod
92
+
93
+ # 类型检查
94
+ npm run type-check
95
+
96
+ # 代码检查
97
+ npm run lint
98
+ ```
99
+
100
+ ## 环境变量配置
101
+
102
+ 创建 `.env` 文件:
103
+
104
+ ```bash
105
+ # API 基础地址
106
+ VITE_API_BASE_URL=/api
107
+
108
+ # API 超时时间(毫秒)
109
+ VITE_API_TIMEOUT=10000
110
+
111
+ # 代理目标(开发环境)
112
+ VITE_PROXY_TARGET=http://localhost:3030
113
+
114
+ # 应用环境
115
+ VITE_APP_ENV=development
116
+ ```
117
+
118
+ ## 原生 API 使用
119
+
120
+ 详见 [MX_API.md](./MX_API.md)
121
+
122
+ ```typescript
123
+ import {
124
+ hideWebViewTitle,
125
+ getCurrentUser,
126
+ MXSelectUsers,
127
+ isNativeApp
128
+ } from '@/core/mxApi'
129
+
130
+ // 检测环境
131
+ if (isNativeApp()) {
132
+ // 获取用户
133
+ const user = await getCurrentUser()
134
+
135
+ // 选人
136
+ const users = await MXSelectUsers()
137
+ }
138
+ ```
139
+
140
+ ## Vant 组件使用
141
+
142
+ 自动导入,无需手动引入:
143
+
144
+ ```vue
145
+ <template>
146
+ <van-button type="primary" @click="handleClick">按钮</van-button>
147
+ <van-cell title="标题" value="内容" />
148
+ </template>
149
+
150
+ <script setup lang="ts">
151
+ // showToast 已自动导入
152
+ const handleClick = () => {
153
+ showToast('Hello')
154
+ }
155
+ </script>
156
+ ```
157
+
158
+ ## 构建产物
159
+
160
+ ```bash
161
+ npm run build:prod
162
+
163
+ # 输出到 dist/ 目录
164
+ # 部署到敏行 App 的资源目录即可
165
+ ```
166
+
167
+ ## 注意事项
168
+
169
+ 1. **原生 API 集成**:`src/core/mxApi/index.ts` 是核心,已适配 TypeScript
170
+ 2. **自动导入**:Vant 组件和 Vue API 已配置自动导入
171
+ 3. **移动端适配**:使用 postcss-px-to-viewport 插件
172
+ 4. **环境变量**:所有配置通过 `.env` 文件管理
173
+
174
+ ## 下一步
175
+
176
+ 1. 根据业务需求创建页面(`src/views/`)
177
+ 2. 定义 API 接口(`src/api/`)
178
+ 3. 配置路由(`src/router/`)
179
+ 4. 创建状态管理(`src/stores/`)