af-mobile-client-vue3 1.1.53 → 1.2.0

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 (68) hide show
  1. package/.env +4 -1
  2. package/.node-version +1 -0
  3. package/.vscode/extensions.json +6 -1
  4. package/.vscode/settings.json +32 -27
  5. package/build/vite/index.ts +29 -29
  6. package/build/vite/optimize.ts +34 -0
  7. package/build/vite/vconsole.ts +5 -2
  8. package/commitlint.config.ts +32 -0
  9. package/eslint.config.ts +30 -0
  10. package/index.html +15 -9
  11. package/mock/data.ts +15 -15
  12. package/mock/index.ts +2 -0
  13. package/mock/modules/prose.mock.ts +5 -8
  14. package/mock/util.ts +19 -0
  15. package/netlify.toml +2 -2
  16. package/package.json +66 -66
  17. package/postcss.config.ts +27 -0
  18. package/public/favicon.ico +0 -0
  19. package/public/pwa-192x192.png +0 -0
  20. package/public/pwa-512x512.png +0 -0
  21. package/public/safari-pinned-tab.svg +3 -31
  22. package/src/App.vue +45 -7
  23. package/src/components/core/ImageUploader/index.vue +159 -159
  24. package/src/components/core/NavBar/index.vue +33 -2
  25. package/src/components/core/Tabbar/index.vue +17 -25
  26. package/src/components/data/XBadge/index.vue +4 -9
  27. package/src/components/data/XCellDetail/index.vue +0 -1
  28. package/src/components/data/XCellList/index.vue +2 -1
  29. package/src/components/data/XOlMap/utils/wgs84ToGcj02.js +154 -154
  30. package/src/composables/dark.ts +5 -0
  31. package/src/config/routes.ts +5 -0
  32. package/src/layout/PageLayout.vue +1 -43
  33. package/src/locales/en-US.json +81 -2
  34. package/src/locales/zh-CN.json +81 -2
  35. package/src/main.ts +6 -6
  36. package/src/router/index.ts +13 -39
  37. package/src/router/routes.ts +6 -4
  38. package/src/stores/index.ts +4 -0
  39. package/src/stores/modules/user.ts +11 -10
  40. package/src/styles/app.less +16 -57
  41. package/src/styles/login.less +22 -8
  42. package/src/styles/var.less +16 -0
  43. package/src/{vue-router.d.ts → types/vue-router.d.ts} +2 -0
  44. package/src/utils/i18n.ts +72 -41
  45. package/src/utils/inline-px-to-vw.ts +28 -0
  46. package/src/utils/set-page-title.ts +1 -1
  47. package/src/views/component/XCellListView/index.vue +96 -13
  48. package/src/views/component/XFormGroupView/index.vue +39 -2
  49. package/src/views/component/XFormView/index.vue +9 -30
  50. package/src/views/component/XOlMapView/XLocationPicker/index.vue +118 -118
  51. package/src/views/component/index.vue +36 -6
  52. package/src/views/user/login/LoginForm.vue +6 -6
  53. package/src/views/user/login/LoginTitle.vue +14 -6
  54. package/src/views/user/my/index.vue +17 -14
  55. package/tsconfig.json +0 -1
  56. package/uno.config.ts +39 -24
  57. package/vite.config.ts +7 -29
  58. package/.husky/commit-msg +0 -1
  59. package/.husky/pre-commit +0 -1
  60. package/LICENSE +0 -21
  61. package/eslint.config.js +0 -15
  62. package/mock/modules/demo.mock.ts +0 -20
  63. package/src/components.d.ts +0 -53
  64. package/src/stores/modules/routeTransitionName.ts +0 -26
  65. package/src/typing.ts +0 -3
  66. package/src/views/component/XFormView/oldindex.vue +0 -70
  67. /package/src/{env.d.ts → types/env.d.ts} +0 -0
  68. /package/src/{settings.ts → types/settings.ts} +0 -0
@@ -1,154 +1,154 @@
1
- // 导入proj控件
2
- import * as proj from 'ol/proj'
3
-
4
- function forEachPoint(func) {
5
- return function (input, opt_output, opt_dimension) {
6
- const len = input.length
7
-
8
- const dimension = opt_dimension || 2
9
- let output
10
-
11
- if (opt_output) {
12
- output = opt_output
13
- }
14
- else {
15
- if (dimension !== 2) {
16
- output = input.slice()
17
- }
18
- else {
19
- output = [len]
20
- }
21
- }
22
- for (let offset = 0; offset < len; offset += dimension) {
23
- func(input, output, offset)
24
- }
25
- return output
26
- }
27
- }
28
-
29
- const gcj02 = {}
30
- const PI = Math.PI
31
- const AXIS = 6378245.0
32
- // eslint-disable-next-line no-loss-of-precision
33
- const OFFSET = 0.00669342162296594323 // (a^2 - b^2) / a^2
34
-
35
- function delta(wgLon, wgLat) {
36
- let dLat = transformLat(wgLon - 105.0, wgLat - 35.0)
37
- let dLon = transformLon(wgLon - 105.0, wgLat - 35.0)
38
- const radLat = (wgLat / 180.0) * PI
39
- let magic = Math.sin(radLat)
40
- magic = 1 - OFFSET * magic * magic
41
- const sqrtMagic = Math.sqrt(magic)
42
- dLat = (dLat * 180.0) / (((AXIS * (1 - OFFSET)) / (magic * sqrtMagic)) * PI)
43
- dLon = (dLon * 180.0) / ((AXIS / sqrtMagic) * Math.cos(radLat) * PI)
44
- return [dLon, dLat]
45
- }
46
-
47
- function outOfChina(lon, lat) {
48
- if (lon < 72.004 || lon > 137.8347) {
49
- return true
50
- }
51
- return lat < 0.8293 || lat > 55.8271
52
- }
53
-
54
- function transformLat(x, y) {
55
- let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x))
56
- ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
57
- ret += ((20.0 * Math.sin(y * PI) + 40.0 * Math.sin((y / 3.0) * PI)) * 2.0) / 3.0
58
- ret += ((160.0 * Math.sin((y / 12.0) * PI) + 320 * Math.sin((y * PI) / 30.0)) * 2.0) / 3.0
59
- return ret
60
- }
61
-
62
- function transformLon(x, y) {
63
- let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x))
64
- ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
65
- ret += ((20.0 * Math.sin(x * PI) + 40.0 * Math.sin((x / 3.0) * PI)) * 2.0) / 3.0
66
- ret += ((150.0 * Math.sin((x / 12.0) * PI) + 300.0 * Math.sin((x / 30.0) * PI)) * 2.0) / 3.0
67
- return ret
68
- }
69
-
70
- gcj02.toWGS84 = forEachPoint((input, output, offset) => {
71
- let lng = input[offset]
72
- let lat = input[offset + 1]
73
- if (!outOfChina(lng, lat)) {
74
- const deltaD = delta(lng, lat)
75
- lng = lng - deltaD[0] // 改回减法
76
- lat = lat - deltaD[1] // 改回减法
77
- }
78
- output[offset] = lng
79
- output[offset + 1] = lat
80
- })
81
-
82
- gcj02.fromWGS84 = forEachPoint((input, output, offset) => {
83
- let lng = input[offset]
84
- let lat = input[offset + 1]
85
- if (!outOfChina(lng, lat)) {
86
- const deltaD = delta(lng, lat)
87
- lng = lng + deltaD[0] // 改回加法
88
- lat = lat + deltaD[1] // 改回加法
89
- }
90
- output[offset] = lng
91
- output[offset + 1] = lat
92
- })
93
-
94
- const sphericalMercator = {}
95
- const RADIUS = 6378137
96
- const MAX_LATITUDE = 85.0511287798
97
- const RAD_PER_DEG = Math.PI / 180
98
-
99
- sphericalMercator.forward = forEachPoint((input, output, offset) => {
100
- const lat = Math.max(Math.min(MAX_LATITUDE, input[offset + 1]), -MAX_LATITUDE)
101
- const sin = Math.sin(lat * RAD_PER_DEG)
102
- output[offset] = RADIUS * input[offset] * RAD_PER_DEG
103
- output[offset + 1] = (RADIUS * Math.log((1 + sin) / (1 - sin))) / 2
104
- })
105
-
106
- sphericalMercator.inverse = forEachPoint((input, output, offset) => {
107
- output[offset] = input[offset] / RADIUS / RAD_PER_DEG
108
- output[offset + 1] = (2 * Math.atan(Math.exp(input[offset + 1] / RADIUS)) - Math.PI / 2) / RAD_PER_DEG
109
- })
110
-
111
- const projzh = {}
112
-
113
- projzh.ll2gmerc = function (input, opt_output, opt_dimension) {
114
- const output = gcj02.toWGS84(input, opt_output, opt_dimension) // 改用 toWGS84
115
- return projzh.ll2smerc(output, output, opt_dimension)
116
- }
117
-
118
- projzh.gmerc2ll = function (input, opt_output, opt_dimension) {
119
- const output = projzh.smerc2ll(input, input, opt_dimension)
120
- return gcj02.fromWGS84(output, opt_output, opt_dimension) // 改用 fromWGS84
121
- }
122
-
123
- // smerc2gmerc 需要修改
124
-
125
- projzh.smerc2gmerc = function (input, opt_output, opt_dimension) {
126
- let output = projzh.smerc2ll(input, input, opt_dimension)
127
- output = gcj02.toWGS84(output, output, opt_dimension) // 这里应该用 toWGS84
128
- return projzh.ll2smerc(output, output, opt_dimension)
129
- }
130
-
131
- // gmerc2smerc 需要修改
132
-
133
- projzh.gmerc2smerc = function (input, opt_output, opt_dimension) {
134
- let output = projzh.smerc2ll(input, input, opt_dimension)
135
- output = gcj02.fromWGS84(output, output, opt_dimension) // 这里应该用 fromWGS84
136
- return projzh.ll2smerc(output, output, opt_dimension)
137
- }
138
-
139
- projzh.ll2smerc = sphericalMercator.forward
140
- projzh.smerc2ll = sphericalMercator.inverse
141
-
142
- // 定义WGS84转GCJ02的投影
143
- const extent = [-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]
144
- export const wgs84ToGcj02Projection = new proj.Projection({
145
- code: 'WGS84-TO-GCJ02',
146
- extent,
147
- units: 'm',
148
- })
149
-
150
- // 添加投影和转换方法
151
- proj.addProjection(wgs84ToGcj02Projection)
152
- // 注意这里转换方法的顺序与原来相反
153
- proj.addCoordinateTransforms('EPSG:4326', wgs84ToGcj02Projection, projzh.ll2gmerc, projzh.gmerc2ll)
154
- proj.addCoordinateTransforms('EPSG:3857', wgs84ToGcj02Projection, projzh.smerc2gmerc, projzh.gmerc2smerc)
1
+ // 导入proj控件
2
+ import * as proj from 'ol/proj'
3
+
4
+ function forEachPoint(func) {
5
+ return function (input, opt_output, opt_dimension) {
6
+ const len = input.length
7
+
8
+ const dimension = opt_dimension || 2
9
+ let output
10
+
11
+ if (opt_output) {
12
+ output = opt_output
13
+ }
14
+ else {
15
+ if (dimension !== 2) {
16
+ output = input.slice()
17
+ }
18
+ else {
19
+ output = [len]
20
+ }
21
+ }
22
+ for (let offset = 0; offset < len; offset += dimension) {
23
+ func(input, output, offset)
24
+ }
25
+ return output
26
+ }
27
+ }
28
+
29
+ const gcj02 = {}
30
+ const PI = Math.PI
31
+ const AXIS = 6378245.0
32
+ // eslint-disable-next-line no-loss-of-precision
33
+ const OFFSET = 0.00669342162296594323 // (a^2 - b^2) / a^2
34
+
35
+ function delta(wgLon, wgLat) {
36
+ let dLat = transformLat(wgLon - 105.0, wgLat - 35.0)
37
+ let dLon = transformLon(wgLon - 105.0, wgLat - 35.0)
38
+ const radLat = (wgLat / 180.0) * PI
39
+ let magic = Math.sin(radLat)
40
+ magic = 1 - OFFSET * magic * magic
41
+ const sqrtMagic = Math.sqrt(magic)
42
+ dLat = (dLat * 180.0) / (((AXIS * (1 - OFFSET)) / (magic * sqrtMagic)) * PI)
43
+ dLon = (dLon * 180.0) / ((AXIS / sqrtMagic) * Math.cos(radLat) * PI)
44
+ return [dLon, dLat]
45
+ }
46
+
47
+ function outOfChina(lon, lat) {
48
+ if (lon < 72.004 || lon > 137.8347) {
49
+ return true
50
+ }
51
+ return lat < 0.8293 || lat > 55.8271
52
+ }
53
+
54
+ function transformLat(x, y) {
55
+ let ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * Math.sqrt(Math.abs(x))
56
+ ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
57
+ ret += ((20.0 * Math.sin(y * PI) + 40.0 * Math.sin((y / 3.0) * PI)) * 2.0) / 3.0
58
+ ret += ((160.0 * Math.sin((y / 12.0) * PI) + 320 * Math.sin((y * PI) / 30.0)) * 2.0) / 3.0
59
+ return ret
60
+ }
61
+
62
+ function transformLon(x, y) {
63
+ let ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * Math.sqrt(Math.abs(x))
64
+ ret += ((20.0 * Math.sin(6.0 * x * PI) + 20.0 * Math.sin(2.0 * x * PI)) * 2.0) / 3.0
65
+ ret += ((20.0 * Math.sin(x * PI) + 40.0 * Math.sin((x / 3.0) * PI)) * 2.0) / 3.0
66
+ ret += ((150.0 * Math.sin((x / 12.0) * PI) + 300.0 * Math.sin((x / 30.0) * PI)) * 2.0) / 3.0
67
+ return ret
68
+ }
69
+
70
+ gcj02.toWGS84 = forEachPoint((input, output, offset) => {
71
+ let lng = input[offset]
72
+ let lat = input[offset + 1]
73
+ if (!outOfChina(lng, lat)) {
74
+ const deltaD = delta(lng, lat)
75
+ lng = lng - deltaD[0] // 改回减法
76
+ lat = lat - deltaD[1] // 改回减法
77
+ }
78
+ output[offset] = lng
79
+ output[offset + 1] = lat
80
+ })
81
+
82
+ gcj02.fromWGS84 = forEachPoint((input, output, offset) => {
83
+ let lng = input[offset]
84
+ let lat = input[offset + 1]
85
+ if (!outOfChina(lng, lat)) {
86
+ const deltaD = delta(lng, lat)
87
+ lng = lng + deltaD[0] // 改回加法
88
+ lat = lat + deltaD[1] // 改回加法
89
+ }
90
+ output[offset] = lng
91
+ output[offset + 1] = lat
92
+ })
93
+
94
+ const sphericalMercator = {}
95
+ const RADIUS = 6378137
96
+ const MAX_LATITUDE = 85.0511287798
97
+ const RAD_PER_DEG = Math.PI / 180
98
+
99
+ sphericalMercator.forward = forEachPoint((input, output, offset) => {
100
+ const lat = Math.max(Math.min(MAX_LATITUDE, input[offset + 1]), -MAX_LATITUDE)
101
+ const sin = Math.sin(lat * RAD_PER_DEG)
102
+ output[offset] = RADIUS * input[offset] * RAD_PER_DEG
103
+ output[offset + 1] = (RADIUS * Math.log((1 + sin) / (1 - sin))) / 2
104
+ })
105
+
106
+ sphericalMercator.inverse = forEachPoint((input, output, offset) => {
107
+ output[offset] = input[offset] / RADIUS / RAD_PER_DEG
108
+ output[offset + 1] = (2 * Math.atan(Math.exp(input[offset + 1] / RADIUS)) - Math.PI / 2) / RAD_PER_DEG
109
+ })
110
+
111
+ const projzh = {}
112
+
113
+ projzh.ll2gmerc = function (input, opt_output, opt_dimension) {
114
+ const output = gcj02.toWGS84(input, opt_output, opt_dimension) // 改用 toWGS84
115
+ return projzh.ll2smerc(output, output, opt_dimension)
116
+ }
117
+
118
+ projzh.gmerc2ll = function (input, opt_output, opt_dimension) {
119
+ const output = projzh.smerc2ll(input, input, opt_dimension)
120
+ return gcj02.fromWGS84(output, opt_output, opt_dimension) // 改用 fromWGS84
121
+ }
122
+
123
+ // smerc2gmerc 需要修改
124
+
125
+ projzh.smerc2gmerc = function (input, opt_output, opt_dimension) {
126
+ let output = projzh.smerc2ll(input, input, opt_dimension)
127
+ output = gcj02.toWGS84(output, output, opt_dimension) // 这里应该用 toWGS84
128
+ return projzh.ll2smerc(output, output, opt_dimension)
129
+ }
130
+
131
+ // gmerc2smerc 需要修改
132
+
133
+ projzh.gmerc2smerc = function (input, opt_output, opt_dimension) {
134
+ let output = projzh.smerc2ll(input, input, opt_dimension)
135
+ output = gcj02.fromWGS84(output, output, opt_dimension) // 这里应该用 fromWGS84
136
+ return projzh.ll2smerc(output, output, opt_dimension)
137
+ }
138
+
139
+ projzh.ll2smerc = sphericalMercator.forward
140
+ projzh.smerc2ll = sphericalMercator.inverse
141
+
142
+ // 定义WGS84转GCJ02的投影
143
+ const extent = [-20037508.342789244, -20037508.342789244, 20037508.342789244, 20037508.342789244]
144
+ export const wgs84ToGcj02Projection = new proj.Projection({
145
+ code: 'WGS84-TO-GCJ02',
146
+ extent,
147
+ units: 'm',
148
+ })
149
+
150
+ // 添加投影和转换方法
151
+ proj.addProjection(wgs84ToGcj02Projection)
152
+ // 注意这里转换方法的顺序与原来相反
153
+ proj.addCoordinateTransforms('EPSG:4326', wgs84ToGcj02Projection, projzh.ll2gmerc, projzh.gmerc2ll)
154
+ proj.addCoordinateTransforms('EPSG:3857', wgs84ToGcj02Projection, projzh.smerc2gmerc, projzh.gmerc2smerc)
@@ -0,0 +1,5 @@
1
+ import { useDark, usePreferredDark, useToggle } from '@vueuse/core'
2
+
3
+ export const isDark = useDark()
4
+ export const toggleDark = useToggle(isDark)
5
+ export const preferredDark = usePreferredDark()
@@ -0,0 +1,5 @@
1
+ // 定义导航栏和标签栏可见的路由白名单
2
+ export const routeWhiteList: readonly string[] = [
3
+ 'ComponentView', // 首页
4
+ 'userProfile', // 个人中心
5
+ ]
@@ -1,51 +1,9 @@
1
1
  <script setup lang="ts">
2
- import Tabbar from '@af-mobile-client-vue3/components/core/Tabbar/index.vue'
3
- import useRouteCache from '@af-mobile-client-vue3/stores/modules/routeCache'
4
- import useRouteTransitionNameStore from '@af-mobile-client-vue3/stores/modules/routeTransitionName'
5
- import { getFunction } from '@af-mobile-client-vue3/utils/common'
6
- import { storeToRefs } from 'pinia'
7
- import { computed } from 'vue'
8
- import { useRoute } from 'vue-router'
9
-
10
- const keepAliveRouteNames = computed(() => {
11
- return useRouteCache().routeCaches as string[]
12
- })
13
- const routeTransitionNameStore = useRouteTransitionNameStore()
14
- const { routeTransitionName } = storeToRefs(routeTransitionNameStore)
15
-
16
- const tabbarData: any = [...getFunction().children.sort((a, b) => a.position - b.position).map((item) => {
17
- return {
18
- icon: item.icon ? item.icon : 'svg:appDome',
19
- title: item.name,
20
- to: {
21
- name: item.link,
22
- },
23
- }
24
- })]
25
-
26
- const routeState = useRoute()
27
2
  </script>
28
3
 
29
4
  <template>
30
- <div class="pageLayout">
31
- <!-- transition 包裹 router-view 控制台会有警告,router-view在外层会导致动画开始时会闪过一帧上一级页面。先忽略警告这样写 -->
32
- <transition :name="routeTransitionName">
33
- <router-view v-slot="{ Component, route }">
34
- <keep-alive :include="keepAliveRouteNames">
35
- <div :key="route.name" class="app-wrapper">
36
- <component :is="Component" />
37
- </div>
38
- </keep-alive>
39
- </router-view>
40
- </transition>
41
- <Tabbar v-show="routeState.meta.index !== undefined" :tabbar-data="tabbarData" />
42
- </div>
5
+ <div class="pageLayout" />
43
6
  </template>
44
7
 
45
8
  <style lang="less" scoped>
46
- .app-wrapper {
47
- width: 100%;
48
- height: 100%;
49
- overflow-y: auto;
50
- }
51
9
  </style>
@@ -1,12 +1,22 @@
1
1
  {
2
- "home": {
2
+ "menus": {
3
+ "home": "Home",
4
+ "profile": "My Center",
3
5
  "darkMode": "🌗 Dark Mode",
4
6
  "mockGuide": "💿 Mock Guide",
5
7
  "language": "📚 Language",
6
8
  "404Demo": "🙅 Page 404 Demo",
7
9
  "echartsDemo": "📊 Echarts Demo",
8
10
  "persistPiniaState": "🍍 Persistent Pinia state",
9
- "unocssExample": "🎨 Unocss example"
11
+ "unocssExample": "🎨 Unocss example",
12
+ "keepAlive": "🧡 KeepAlive Demo",
13
+ "scrollCache": "📜 Scroll Cache Demo",
14
+ "login": "🔒 Login",
15
+ "register": "Register",
16
+ "settings": "Settings",
17
+ "basicSettings": "Basic Settings",
18
+ "exampleComponents": "Example components",
19
+ "forgot-password": "Forgot Password"
10
20
  },
11
21
  "mock": {
12
22
  "fromAsyncData": "Data from asynchronous requests",
@@ -21,5 +31,74 @@
21
31
  "April": "Apr",
22
32
  "May": "May",
23
33
  "June": "Jun"
34
+ },
35
+ "layouts": {
36
+ "home": "HOME",
37
+ "profile": "PROFILE"
38
+ },
39
+ "profile": {
40
+ "login": "Login",
41
+ "settings": "Settings",
42
+ "docs": "Docs"
43
+ },
44
+ "keepAlive": {
45
+ "label": "The current component will be cached"
46
+ },
47
+ "scrollCache": {
48
+ "sectionTitle": "Section title",
49
+ "sectionText": "Section text text text text text text text text text text",
50
+ "finished": "Already at the bottom ~",
51
+ "loading": "Loading..."
52
+ },
53
+ "login": {
54
+ "login": "Sign In",
55
+ "logout": "Sign Out",
56
+ "email": "Email",
57
+ "password": "Password",
58
+ "pleaseEnterEmail": "Please enter email",
59
+ "pleaseEnterPassword": "Please enter password",
60
+ "sign-up": "Click to sign up",
61
+ "forgot-password": "Forgot password?"
62
+ },
63
+ "forgot-password": {
64
+ "email": "Email",
65
+ "code": "Code",
66
+ "password": "Password",
67
+ "comfirmPassword": "Password again",
68
+ "pleaseEnterEmail": "Please enter email",
69
+ "pleaseEnterCode": "Please enter code",
70
+ "pleaseEnterPassword": "Please enter password",
71
+ "pleaseEnterConfirmPassword": "Please enter password again",
72
+ "passwordsDoNotMatch": "Passwords do not match",
73
+ "confirm": "Confirm",
74
+ "backToLogin": "Back to login",
75
+ "getCode": "Get code",
76
+ "gettingCode": "Getting code",
77
+ "sendCodeSuccess": "Sent, the code is",
78
+ "passwordResetSuccess": "Password reset succeeded"
79
+ },
80
+ "register": {
81
+ "email": "Email",
82
+ "code": "Code",
83
+ "nickname": "Nickname",
84
+ "password": "Password",
85
+ "comfirmPassword": "Password again",
86
+ "pleaseEnterEmail": "Please enter email",
87
+ "pleaseEnterCode": "Please enter code",
88
+ "pleaseEnterNickname": "Please enter nickname",
89
+ "pleaseEnterPassword": "Please enter password",
90
+ "pleaseEnterConfirmPassword": "Please enter password again",
91
+ "passwordsDoNotMatch": "Passwords do not match",
92
+ "confirm": "Confirm",
93
+ "backToLogin": "Back to login",
94
+ "getCode": "Get code",
95
+ "gettingCode": "Getting code",
96
+ "sendCodeSuccess": "Sent, the code is",
97
+ "registerSuccess": "Register succeeded"
98
+ },
99
+ "settings": {
100
+ "logout": "Sign Out",
101
+ "currentVersion": "Current Version",
102
+ "comfirmTitle": "Confirm Exit?"
24
103
  }
25
104
  }
@@ -1,12 +1,22 @@
1
1
  {
2
- "home": {
2
+ "menus": {
3
+ "home": "主页",
4
+ "profile": "个人中心",
3
5
  "darkMode": "🌗 暗黑模式",
4
6
  "mockGuide": "💿 Mock 指南",
5
7
  "language": "📚 语言",
6
8
  "echartsDemo": "📊 Echarts 演示",
7
9
  "persistPiniaState": "🍍 持久化 Pinia 状态",
8
10
  "404Demo": "🙅 404页 演示",
9
- "unocssExample": "🎨 Unocss 示例"
11
+ "unocssExample": "🎨 Unocss 示例",
12
+ "keepAlive": "🧡 KeepAlive 演示",
13
+ "scrollCache": "📜 滚动缓存 演示",
14
+ "login": "🔒 用户登录",
15
+ "register": "用户注册",
16
+ "settings": "设置",
17
+ "basicSettings": "基本设置",
18
+ "exampleComponents": "示例组件",
19
+ "forgot-password": "忘记密码"
10
20
  },
11
21
  "mock": {
12
22
  "fromAsyncData": "来自异步请求的数据",
@@ -21,5 +31,74 @@
21
31
  "April": "4月",
22
32
  "May": "5月",
23
33
  "June": "6月"
34
+ },
35
+ "layouts": {
36
+ "home": "首页",
37
+ "profile": "我的"
38
+ },
39
+ "profile": {
40
+ "login": "登录",
41
+ "settings": "设置",
42
+ "docs": "文档"
43
+ },
44
+ "keepAlive": {
45
+ "label": "当前组件将会被缓存"
46
+ },
47
+ "scrollCache": {
48
+ "sectionTitle": "段落标题",
49
+ "sectionText": "段落内容段落内容段落内容段落内容段落内容段落内容",
50
+ "finished": "已经到底啦 ~",
51
+ "loading": "加载中..."
52
+ },
53
+ "login": {
54
+ "login": "登录",
55
+ "logout": "退出",
56
+ "email": "邮箱",
57
+ "password": "密码",
58
+ "pleaseEnterEmail": "请输入邮箱",
59
+ "pleaseEnterPassword": "请输入密码",
60
+ "sign-up": "还没有账号?点击注册",
61
+ "forgot-password": "忘记密码?"
62
+ },
63
+ "forgot-password": {
64
+ "email": "邮箱",
65
+ "code": "验证码",
66
+ "password": "密码",
67
+ "comfirmPassword": "再次输入密码",
68
+ "pleaseEnterEmail": "请输入邮箱",
69
+ "pleaseEnterCode": "请输入验证码",
70
+ "pleaseEnterPassword": "请输入密码",
71
+ "pleaseEnterConfirmPassword": "请再次输入密码",
72
+ "passwordsDoNotMatch": "两次输入的密码不一致",
73
+ "confirm": "确认",
74
+ "backToLogin": "返回登录",
75
+ "getCode": "获取验证码",
76
+ "gettingCode": "获取中",
77
+ "sendCodeSuccess": "已发送,验证码为",
78
+ "passwordResetSuccess": "密码重置成功"
79
+ },
80
+ "register": {
81
+ "email": "邮箱",
82
+ "code": "验证码",
83
+ "nickname": "昵称",
84
+ "password": "密码",
85
+ "comfirmPassword": "再次输入密码",
86
+ "pleaseEnterEmail": "请输入邮箱",
87
+ "pleaseEnterCode": "请输入验证码",
88
+ "pleaseEnterNickname": "请输入昵称",
89
+ "pleaseEnterPassword": "请输入密码",
90
+ "pleaseEnterConfirmPassword": "请再次输入密码",
91
+ "passwordsDoNotMatch": "两次输入的密码不一致",
92
+ "confirm": "确认",
93
+ "backToLogin": "返回登录",
94
+ "getCode": "获取验证码",
95
+ "gettingCode": "获取中",
96
+ "sendCodeSuccess": "已发送,验证码为",
97
+ "registerSuccess": "注册成功"
98
+ },
99
+ "settings": {
100
+ "logout": "退出登录",
101
+ "currentVersion": "当前版本",
102
+ "comfirmTitle": "确认退出?"
24
103
  }
25
104
  }
package/src/main.ts CHANGED
@@ -3,17 +3,16 @@ import bootstrap from '@af-mobile-client-vue3/bootstrap'
3
3
  import Plugins from '@af-mobile-client-vue3/plugins'
4
4
  import router from '@af-mobile-client-vue3/router'
5
5
  import pinia from '@af-mobile-client-vue3/stores'
6
+ import { i18n } from '@af-mobile-client-vue3/utils/i18n'
6
7
  import { createHead } from '@unhead/vue/client'
7
8
  import { createApp } from 'vue'
8
9
  import 'virtual:uno.css'
9
10
  import '@af-mobile-client-vue3/styles/app.less'
10
- import 'vant/lib/index.css'
11
- import 'vant/lib/tabbar/index.css'
12
- import 'vant/lib/tabbar-item/index.css'
13
- // svg icon
14
- import 'virtual:svg-icons-register'
11
+ import '@af-mobile-client-vue3/styles/var.less'
12
+
15
13
  // Vant 桌面端适配
16
14
  import '@vant/touch-emulator'
15
+
17
16
  /* --------------------------------
18
17
  Vant 中有个别组件是以函数的形式提供的,
19
18
  包括 Toast,Dialog,Notify 和 ImagePreview 组件。
@@ -30,8 +29,9 @@ import 'vant/es/image-preview/style'
30
29
  const head = createHead()
31
30
 
32
31
  app.use(head)
33
- app.use(pinia)
34
32
  app.use(router)
33
+ app.use(pinia)
34
+ app.use(i18n)
35
35
  app.use(Plugins)
36
36
 
37
37
  await bootstrap(router)