mirror of
https://gitee.com/ShopeX/ECShopX_desktop-frontend
synced 2026-08-11 09:25:33 +08:00
chore(release): 4.2.0
This commit is contained in:
8
.env
8
.env
@@ -1,5 +1,5 @@
|
||||
VUE_APP_TITLE=
|
||||
VUE_APP_HOST=
|
||||
VUE_APP_API_BASE_URL=
|
||||
VUE_APP_COMPANYID=
|
||||
VUE_APP_TITLE=云店连锁Demo
|
||||
VUE_APP_HOST=https://demo-ecshopx.ishopex.cn
|
||||
VUE_APP_API_BASE_URL=https://demo-ecshopx.ishopex.cn
|
||||
VUE_APP_COMPANYID=38
|
||||
VUE_APP_DEFAULT_LANG=en
|
||||
|
||||
217
CHANGELOG.md
217
CHANGELOG.md
@@ -2,7 +2,222 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
### [4.1.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v4.1.0...v4.1.1) (2025-12-10)
|
||||
## [4.2.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v4.1.0...v4.2.0) (2025-12-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 去除一些非必要文档 ([9ae272f](https://git.ishopex.cn/onex/ecshopx-newpc/commit/9ae272fd384479cfc020f4120cd68bb5e1784aaa))
|
||||
* add .gitgnore ([178dac6](https://git.ishopex.cn/onex/ecshopx-newpc/commit/178dac60ff34d686d6d36967ddb5b7a3838ab255))
|
||||
* Fix some issues ([8c78a2d](https://git.ishopex.cn/onex/ecshopx-newpc/commit/8c78a2d08dbc52a5794880390c4cd885f7a1750e))
|
||||
* Fix some issues ([2187ff3](https://git.ishopex.cn/onex/ecshopx-newpc/commit/2187ff3dfe817760144c2c6d77b169135496ffc5))
|
||||
* **scope:** update package ([d733a9c](https://git.ishopex.cn/onex/ecshopx-newpc/commit/d733a9c64a652b38483f3db16a483296806f3669))
|
||||
* **scope:** update readme ([958707f](https://git.ishopex.cn/onex/ecshopx-newpc/commit/958707f09f91aa2b6716012aa0d0791cd90b1f28))
|
||||
* Some parameter errors ([4c165cc](https://git.ishopex.cn/onex/ecshopx-newpc/commit/4c165ccd1daac350621f934814f7c6438798d9c9))
|
||||
|
||||
## [3.21.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.20.0...v3.21.0) (2025-05-29)
|
||||
|
||||
## [3.20.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.4...v3.20.0) (2025-04-27)
|
||||
|
||||
### [3.19.4](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.3...v3.19.4) (2025-04-23)
|
||||
|
||||
### [3.19.3](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.2...v3.19.3) (2025-04-17)
|
||||
|
||||
### [3.19.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.1...v3.19.2) (2025-04-16)
|
||||
|
||||
### [3.19.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.0...v3.19.1) (2025-04-09)
|
||||
|
||||
## [3.19.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.18.0...v3.19.0) (2025-03-27)
|
||||
|
||||
## [3.18.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.17.0...v3.18.0) (2025-03-18)
|
||||
|
||||
## [3.17.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.16.2...v3.17.0) (2025-02-14)
|
||||
|
||||
### [3.16.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.16.1...v3.16.2) (2025-02-08)
|
||||
|
||||
### [3.16.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.16.0...v3.16.1) (2025-02-07)
|
||||
|
||||
## [3.16.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.3...v3.16.0) (2024-10-28)
|
||||
|
||||
### [3.15.3](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.2...v3.15.3) (2024-08-28)
|
||||
|
||||
### [3.15.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.1...v3.15.2) (2024-08-16)
|
||||
|
||||
### [3.15.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.0...v3.15.1) (2024-07-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 添加储值支付 ([c74f28c](https://git.ishopex.cn/onex/ecshopx-newpc/commit/c74f28cd9b5ec1bffed7ed225e737d258ef8440a))
|
||||
|
||||
## [3.15.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.14.1...v3.15.0) (2024-07-08)
|
||||
|
||||
### [3.14.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.14.0...v3.14.1) (2024-04-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 登录页logo、背景图,支持后台配置 ([4ff9b07](https://git.ishopex.cn/onex/ecshopx-newpc/commit/4ff9b07cea9c71e9cbaa29466a250d47d1dbbac5))
|
||||
* 优化图片展示、报错 ([f569c4a](https://git.ishopex.cn/onex/ecshopx-newpc/commit/f569c4a87641ced4263545ff7949c6ac0c01b630))
|
||||
|
||||
## [3.14.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.5...v3.14.0) (2024-03-11)
|
||||
|
||||
### [3.13.5](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.4...v3.13.5) (2024-03-10)
|
||||
|
||||
### [3.13.4](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.3...v3.13.4) (2023-09-27)
|
||||
|
||||
### [3.13.3](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.2...v3.13.3) (2023-09-26)
|
||||
|
||||
### [3.13.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.1...v3.13.2) (2023-09-26)
|
||||
|
||||
### [3.13.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.0...v3.13.1) (2023-06-05)
|
||||
|
||||
## [3.13.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.12.1...v3.13.0) (2023-06-01)
|
||||
|
||||
### [3.12.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.12.0...v3.12.1) (2023-05-24)
|
||||
|
||||
## [3.12.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.10.1...v3.12.0) (2023-05-18)
|
||||
|
||||
### 3.10.1 (2023-04-04)
|
||||
|
||||
## [3.21.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.20.0...v3.21.0) (2025-05-29)
|
||||
|
||||
## [3.20.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.4...v3.20.0) (2025-04-27)
|
||||
|
||||
### [3.19.4](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.3...v3.19.4) (2025-04-23)
|
||||
|
||||
### [3.19.3](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.2...v3.19.3) (2025-04-17)
|
||||
|
||||
### [3.19.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.1...v3.19.2) (2025-04-16)
|
||||
|
||||
### [3.19.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.0...v3.19.1) (2025-04-09)
|
||||
|
||||
## [3.19.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.18.0...v3.19.0) (2025-03-27)
|
||||
|
||||
## [3.18.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.17.0...v3.18.0) (2025-03-18)
|
||||
|
||||
## [3.17.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.16.2...v3.17.0) (2025-02-14)
|
||||
|
||||
### [3.16.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.16.1...v3.16.2) (2025-02-08)
|
||||
|
||||
### [3.16.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.16.0...v3.16.1) (2025-02-07)
|
||||
|
||||
## [3.16.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.3...v3.16.0) (2024-10-28)
|
||||
|
||||
### [3.15.3](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.2...v3.15.3) (2024-08-28)
|
||||
|
||||
### [3.15.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.1...v3.15.2) (2024-08-16)
|
||||
|
||||
### [3.15.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.0...v3.15.1) (2024-07-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 添加储值支付 ([c74f28c](https://git.ishopex.cn/onex/ecshopx-newpc/commit/c74f28cd9b5ec1bffed7ed225e737d258ef8440a))
|
||||
|
||||
## [3.15.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.14.1...v3.15.0) (2024-07-08)
|
||||
|
||||
### [3.14.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.14.0...v3.14.1) (2024-04-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 登录页logo、背景图,支持后台配置 ([4ff9b07](https://git.ishopex.cn/onex/ecshopx-newpc/commit/4ff9b07cea9c71e9cbaa29466a250d47d1dbbac5))
|
||||
* 优化图片展示、报错 ([f569c4a](https://git.ishopex.cn/onex/ecshopx-newpc/commit/f569c4a87641ced4263545ff7949c6ac0c01b630))
|
||||
|
||||
## [3.14.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.5...v3.14.0) (2024-03-11)
|
||||
|
||||
### [3.13.5](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.4...v3.13.5) (2024-03-10)
|
||||
|
||||
### [3.13.4](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.3...v3.13.4) (2023-09-27)
|
||||
|
||||
### [3.13.3](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.2...v3.13.3) (2023-09-26)
|
||||
|
||||
### [3.13.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.1...v3.13.2) (2023-09-26)
|
||||
|
||||
### [3.13.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.0...v3.13.1) (2023-06-05)
|
||||
|
||||
## [3.13.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.12.1...v3.13.0) (2023-06-01)
|
||||
|
||||
### [3.12.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.12.0...v3.12.1) (2023-05-24)
|
||||
|
||||
## [3.12.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.10.1...v3.12.0) (2023-05-18)
|
||||
|
||||
### 3.10.1 (2023-04-04)
|
||||
|
||||
## [3.21.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.20.0...v3.21.0) (2025-05-29)
|
||||
|
||||
## [3.20.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.4...v3.20.0) (2025-04-27)
|
||||
|
||||
### [3.19.4](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.3...v3.19.4) (2025-04-23)
|
||||
|
||||
### [3.19.3](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.2...v3.19.3) (2025-04-17)
|
||||
|
||||
### [3.19.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.1...v3.19.2) (2025-04-16)
|
||||
|
||||
### [3.19.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.19.0...v3.19.1) (2025-04-09)
|
||||
|
||||
## [3.19.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.18.0...v3.19.0) (2025-03-27)
|
||||
|
||||
## [3.18.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.17.0...v3.18.0) (2025-03-18)
|
||||
|
||||
## [3.17.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.16.2...v3.17.0) (2025-02-14)
|
||||
|
||||
### [3.16.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.16.1...v3.16.2) (2025-02-08)
|
||||
|
||||
### [3.16.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.16.0...v3.16.1) (2025-02-07)
|
||||
|
||||
## [3.16.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.3...v3.16.0) (2024-10-28)
|
||||
|
||||
### [3.15.3](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.2...v3.15.3) (2024-08-28)
|
||||
|
||||
### [3.15.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.1...v3.15.2) (2024-08-16)
|
||||
|
||||
### [3.15.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.15.0...v3.15.1) (2024-07-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* 添加储值支付 ([c74f28c](https://git.ishopex.cn/onex/ecshopx-newpc/commit/c74f28cd9b5ec1bffed7ed225e737d258ef8440a))
|
||||
|
||||
## [3.15.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.14.1...v3.15.0) (2024-07-08)
|
||||
|
||||
### [3.14.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.14.0...v3.14.1) (2024-04-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* 登录页logo、背景图,支持后台配置 ([4ff9b07](https://git.ishopex.cn/onex/ecshopx-newpc/commit/4ff9b07cea9c71e9cbaa29466a250d47d1dbbac5))
|
||||
* 优化图片展示、报错 ([f569c4a](https://git.ishopex.cn/onex/ecshopx-newpc/commit/f569c4a87641ced4263545ff7949c6ac0c01b630))
|
||||
|
||||
## [3.14.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.5...v3.14.0) (2024-03-11)
|
||||
|
||||
### [3.13.5](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.4...v3.13.5) (2024-03-10)
|
||||
|
||||
### [3.13.4](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.3...v3.13.4) (2023-09-27)
|
||||
|
||||
### [3.13.3](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.2...v3.13.3) (2023-09-26)
|
||||
|
||||
### [3.13.2](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.1...v3.13.2) (2023-09-26)
|
||||
|
||||
### [3.13.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.13.0...v3.13.1) (2023-06-05)
|
||||
|
||||
## [3.13.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.12.1...v3.13.0) (2023-06-01)
|
||||
|
||||
### [3.12.1](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.12.0...v3.12.1) (2023-05-24)
|
||||
|
||||
## [3.12.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.10.1...v3.12.0) (2023-05-18)
|
||||
|
||||
### 3.10.1 (2023-04-04)
|
||||
|
||||
## [4.2.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v4.1.0...v4.2.0) (2025-12-29)
|
||||
|
||||
## [4.1.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v4.0.0...v4.1.0) (2025-12-11)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* squash merge ([4662fd2](https://git.ishopex.cn/onex/ecshopx-newpc/commit/4662fd2167c16a9175f19f6a38d1e98abaada3f1))
|
||||
|
||||
## [4.0.0](https://git.ishopex.cn/onex/ecshopx-newpc/compare/v3.21.0...v4.0.0) (2025-11-19)
|
||||
|
||||
|
||||
73
package-lock.json
generated
73
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "ecshopx-pc",
|
||||
"version": "4.1.1",
|
||||
"version": "4.2.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "ecshopx-pc",
|
||||
"version": "4.1.1",
|
||||
"version": "4.2.0",
|
||||
"dependencies": {
|
||||
"@nuxtjs/component-cache": "^1.1.5",
|
||||
"@nuxtjs/device": "^1.2.4",
|
||||
@@ -61,7 +61,7 @@
|
||||
"qn-webpack": "^2.0.3",
|
||||
"sass": "1.77.6",
|
||||
"sass-loader": "10.5.2",
|
||||
"standard-version": "^9.5.0",
|
||||
"standard-version": "^9.3.0",
|
||||
"webpack-merge": "^4.2.1"
|
||||
}
|
||||
},
|
||||
@@ -10331,29 +10331,13 @@
|
||||
}
|
||||
},
|
||||
"node_modules/buffer": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://packages.aliyun.com/664eb139ced1b9e566e182d4/npm/businesstech-apac/buffer/-/buffer-6.0.3.tgz",
|
||||
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"version": "4.9.2",
|
||||
"resolved": "https://registry.npmmirror.com/buffer/-/buffer-4.9.2.tgz",
|
||||
"integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==",
|
||||
"dependencies": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.2.1"
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4",
|
||||
"isarray": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/buffer-from": {
|
||||
@@ -20044,17 +20028,6 @@
|
||||
"vm-browserify": "^1.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/node-libs-browser/node_modules/buffer": {
|
||||
"version": "4.9.2",
|
||||
"resolved": "https://packages.aliyun.com/664eb139ced1b9e566e182d4/npm/businesstech-apac/buffer/-/buffer-4.9.2.tgz",
|
||||
"integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4",
|
||||
"isarray": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/node-libs-browser/node_modules/punycode": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/punycode/-/punycode-1.4.1.tgz",
|
||||
@@ -25434,10 +25407,9 @@
|
||||
},
|
||||
"node_modules/standard-version": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://packages.aliyun.com/664eb139ced1b9e566e182d4/npm/businesstech-apac/standard-version/-/standard-version-9.5.0.tgz",
|
||||
"resolved": "https://registry.npmmirror.com/standard-version/-/standard-version-9.5.0.tgz",
|
||||
"integrity": "sha512-3zWJ/mmZQsOaO+fOlsa0+QK90pwhNd042qEcw6hKFNoLFs7peGyvPffpEBbK/DSGPbyOvli0mUIFv5A4qTjh2Q==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"chalk": "^2.4.2",
|
||||
"conventional-changelog": "3.1.25",
|
||||
@@ -36468,14 +36440,13 @@
|
||||
}
|
||||
},
|
||||
"buffer": {
|
||||
"version": "6.0.3",
|
||||
"resolved": "https://packages.aliyun.com/664eb139ced1b9e566e182d4/npm/businesstech-apac/buffer/-/buffer-6.0.3.tgz",
|
||||
"integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
|
||||
"optional": true,
|
||||
"peer": true,
|
||||
"version": "4.9.2",
|
||||
"resolved": "https://registry.npmmirror.com/buffer/-/buffer-4.9.2.tgz",
|
||||
"integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==",
|
||||
"requires": {
|
||||
"base64-js": "^1.3.1",
|
||||
"ieee754": "^1.2.1"
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4",
|
||||
"isarray": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"buffer-from": {
|
||||
@@ -43891,16 +43862,6 @@
|
||||
"vm-browserify": "^1.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"buffer": {
|
||||
"version": "4.9.2",
|
||||
"resolved": "https://packages.aliyun.com/664eb139ced1b9e566e182d4/npm/businesstech-apac/buffer/-/buffer-4.9.2.tgz",
|
||||
"integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==",
|
||||
"requires": {
|
||||
"base64-js": "^1.0.2",
|
||||
"ieee754": "^1.1.4",
|
||||
"isarray": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"punycode": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/punycode/-/punycode-1.4.1.tgz",
|
||||
@@ -48068,7 +48029,7 @@
|
||||
},
|
||||
"standard-version": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://packages.aliyun.com/664eb139ced1b9e566e182d4/npm/businesstech-apac/standard-version/-/standard-version-9.5.0.tgz",
|
||||
"resolved": "https://registry.npmmirror.com/standard-version/-/standard-version-9.5.0.tgz",
|
||||
"integrity": "sha512-3zWJ/mmZQsOaO+fOlsa0+QK90pwhNd042qEcw6hKFNoLFs7peGyvPffpEBbK/DSGPbyOvli0mUIFv5A4qTjh2Q==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
|
||||
16
package.json
16
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ecshopx-pc",
|
||||
"version": "4.1.1",
|
||||
"version": "4.2.0",
|
||||
"private": true,
|
||||
"repository": "https://git.ishopex.cn/onex/ecshopx-newpc.git",
|
||||
"scripts": {
|
||||
@@ -19,8 +19,10 @@
|
||||
"upload": "node build/upload.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nuxtjs/component-cache": "^1.1.5",
|
||||
"nuxt": "^2.15.8",
|
||||
"nuxt-i18n": "^6.28.1",
|
||||
"@nuxtjs/device": "^1.2.4",
|
||||
"@nuxtjs/component-cache": "^1.1.5",
|
||||
"@nuxtjs/proxy": "^1.3.3",
|
||||
"axios": "^0.26.0",
|
||||
"cache-manager": "^2.10.0",
|
||||
@@ -30,8 +32,6 @@
|
||||
"lodash-es": "^4.17.11",
|
||||
"md5": "^2.2.1",
|
||||
"moment": "^2.24.0",
|
||||
"nuxt": "^2.15.8",
|
||||
"nuxt-i18n": "^6.28.1",
|
||||
"qrcode": "^1.4.4",
|
||||
"social-share.js": "^1.0.16",
|
||||
"ssr-window": "^1.0.1",
|
||||
@@ -45,8 +45,8 @@
|
||||
"vue-hotzone": "^1.1.0",
|
||||
"vue-infinite-scroll": "^2.0.2",
|
||||
"vue-lazyload": "^1.2.6",
|
||||
"vue-template-compiler": "^2.7.10",
|
||||
"vuex-persistedstate": "3.0.0"
|
||||
"vuex-persistedstate": "3.0.0",
|
||||
"vue-template-compiler": "^2.7.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/babel-preset-app": "^3.7.0",
|
||||
@@ -66,13 +66,13 @@
|
||||
"glob": "^7.1.4",
|
||||
"husky": "^4.3.0",
|
||||
"lint-staged": "^10.5.4",
|
||||
"postcss-html": "^1.5.0",
|
||||
"prettier-eslint-cli": "^5.0.0",
|
||||
"process-argv-parser": "0.0.1",
|
||||
"qn-webpack": "^2.0.3",
|
||||
"sass": "1.77.6",
|
||||
"sass-loader": "10.5.2",
|
||||
"standard-version": "^9.5.0",
|
||||
"postcss-html": "^1.5.0",
|
||||
"standard-version": "^9.3.0",
|
||||
"webpack-merge": "^4.2.1"
|
||||
},
|
||||
"postcss": {
|
||||
|
||||
@@ -8,6 +8,12 @@
|
||||
<div v-if="visible" class="cookie-consent">
|
||||
<div class="cookie-consent__mask" @click="handleMaskClick"></div>
|
||||
<div class="cookie-consent__content">
|
||||
<div
|
||||
class="cookie-consent__close"
|
||||
@click="handleReject"
|
||||
>
|
||||
<span class="cookie-consent__close-icon" aria-label="关闭">×</span>
|
||||
</div>
|
||||
<div class="cookie-consent__body">
|
||||
<div class="cookie-consent__text">
|
||||
<div
|
||||
@@ -50,8 +56,13 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fetchPrivacyContent()
|
||||
this.checkAndShow()
|
||||
this.fetchPrivacyContent().then((res)=>{
|
||||
|
||||
if(res){
|
||||
|
||||
this.checkAndShow()
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
@@ -63,6 +74,7 @@ export default {
|
||||
if (res && res.pc_privacy_content) {
|
||||
this.privacyContent = res.pc_privacy_content
|
||||
}
|
||||
return res.pc_privacy_content
|
||||
} catch (error) {
|
||||
console.warn('Failed to fetch privacy content:', error)
|
||||
// 如果接口失败,使用 i18n 翻译作为后备
|
||||
@@ -158,6 +170,34 @@ export default {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
&__close {
|
||||
position: absolute;
|
||||
top: 13px;
|
||||
right: 13px;
|
||||
z-index: 3;
|
||||
cursor: pointer;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: opacity 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
&-icon {
|
||||
font-size: 24px;
|
||||
color: #666;
|
||||
line-height: 1;
|
||||
display: inline-block;
|
||||
font-weight: 300;
|
||||
user-select: none;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
}
|
||||
|
||||
&__body {
|
||||
padding: 55px 44px;
|
||||
display: flex;
|
||||
@@ -252,6 +292,17 @@ export default {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
&__close {
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
|
||||
.ec-icon-close {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
|
||||
&__body {
|
||||
padding: 40px 30px;
|
||||
gap: 30px;
|
||||
|
||||
@@ -38,17 +38,24 @@
|
||||
<div class="bread-crumb">
|
||||
<!-- <nuxt-link to="/">首页</nuxt-link> -->
|
||||
<span v-for="(item, index) in value" :key="index" class="bread-crumb__name">
|
||||
<nuxt-link :to="item.url" v-if="item.url">{{item.name}}</nuxt-link>
|
||||
<nuxt-link :to="getLocalizedPath(item.url)" v-if="item.url">{{item.name}}</nuxt-link>
|
||||
<span v-else>{{item}}</span><i class="ec-icon ec-icon-right" v-if="index < value.length - 1"></i>
|
||||
</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { localePath } from '@/utils/localePath'
|
||||
export default {
|
||||
name: 'SpBreadCrumb',
|
||||
props: {
|
||||
value: Array
|
||||
},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
}
|
||||
}
|
||||
// created () {
|
||||
// const { catname } = this.$route.query
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
<template>
|
||||
<div class="sp-footer">
|
||||
<!-- 挂件 -->
|
||||
<!-- <component
|
||||
<component
|
||||
mode="render"
|
||||
v-for="(wgt, index) in wgts"
|
||||
:is="wgt.type"
|
||||
:value="wgt"
|
||||
:page-props="pageConfig"
|
||||
:key="`wgt-${index}`"
|
||||
></component> -->
|
||||
></component>
|
||||
|
||||
<!-- 开源标识 -->
|
||||
<OpenSourceBadge />
|
||||
@@ -43,10 +43,10 @@ export default {
|
||||
|
||||
computed: {
|
||||
...mapState({
|
||||
// wgts: (state) => {
|
||||
// const res = state.footerTemplate
|
||||
// return res ? JSON.parse(res.params) : []
|
||||
// },
|
||||
wgts: (state) => {
|
||||
const res = state.footerTemplate
|
||||
return res ? JSON.parse(res.params) : []
|
||||
},
|
||||
pageConfig: (state) => {
|
||||
return state.pageConfig
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
</style>
|
||||
<template>
|
||||
<div class="sp-goods-card">
|
||||
<nuxt-link :to="`/items/${info.item_id}?distributor_id=${info.distributor_id}`">
|
||||
<nuxt-link :to="getLocalizedPath(`/items/${info.item_id}?distributor_id=${info.distributor_id}`)">
|
||||
<div class="goods-card-hd">
|
||||
<img :src="info.imgUrl" alt="" width="100%">
|
||||
</div>
|
||||
@@ -102,6 +102,7 @@
|
||||
|
||||
<script>
|
||||
// import i18n from '@/i18n'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
export default {
|
||||
name: 'SpGoodsCard',
|
||||
props: {
|
||||
@@ -114,6 +115,10 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
FilterPriceLabel(info) {
|
||||
const { activity_price, member_price } = info
|
||||
if(activity_price) {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
}
|
||||
.slider-item {
|
||||
overflow: hidden;
|
||||
width: 85px;
|
||||
height: 85px;
|
||||
}
|
||||
.goodsinfo-right {
|
||||
@@ -290,7 +291,7 @@
|
||||
}"
|
||||
>{{ $t('sp-goods-info.index.091195-4') }}{{ info.vipgrade_guide_title.gradeDiscount }}{{ $t('sp-goods-info.index.091195-5') }}</span
|
||||
>
|
||||
<nuxt-link to="/member/vip">
|
||||
<nuxt-link :to="getLocalizedPath('/member/vip')">
|
||||
<span class="vip-desc"
|
||||
>{{ info.vipgrade_guide_title.guide_title_desc }}
|
||||
<i class="espier-icon espier-icon-xiangyou-01"></i>
|
||||
@@ -411,6 +412,7 @@ const swiperOptions = {
|
||||
}
|
||||
import S from '@/spx'
|
||||
import BuyToolbar from './buy-toolbar'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
export default {
|
||||
name: 'SpGoodsInfo',
|
||||
props: {
|
||||
@@ -479,6 +481,10 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
FilterPriceLabel(info) {
|
||||
const { act_price, member_price } = info
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
<div class="container ">
|
||||
<div class="topbar-login fl">
|
||||
<div class="no-login active">
|
||||
<NuxtLink to="/" class="index-link">{{ $t('sp-header.index.663900-0') }}</NuxtLink>
|
||||
<NuxtLink :to="getLocalizedPath('/')" class="index-link">{{ $t('sp-header.index.663900-0') }}</NuxtLink>
|
||||
<template v-if="!userInfo">
|
||||
<NuxtLink to="/auth/login" class="topbar-login__link " style="color:#FF5D02;">{{
|
||||
<NuxtLink :to="getLocalizedPath('/auth/login')" class="topbar-login__link " style="color:#FF5D02;">{{
|
||||
$t('sp-header.index.663900-1') }}</NuxtLink>
|
||||
<NuxtLink to="/auth/reg" class="topbar-login__link topbar-register__link ">{{
|
||||
<NuxtLink :to="getLocalizedPath('/auth/reg')" class="topbar-login__link topbar-register__link ">{{
|
||||
$t('sp-header.index.663900-2') }}</NuxtLink>
|
||||
<!-- <img src="../../assets/imgs/top.png" /> -->
|
||||
</template>
|
||||
@@ -59,13 +59,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="topbar-member fr">
|
||||
<NuxtLink to="/cart" style="margin-right:0;">{{ $t('sp-header.index.663900-5') }}</NuxtLink>
|
||||
<NuxtLink :to="getLocalizedPath('/cart')" style="margin-right:0;">{{ $t('sp-header.index.663900-5') }}</NuxtLink>
|
||||
<span>|</span>
|
||||
<NuxtLink to="/member/trade" style="margin-right:0;">{{ $t('sp-header.index.663900-6') }}</NuxtLink>
|
||||
<NuxtLink :to="getLocalizedPath('/member/trade')" style="margin-right:0;">{{ $t('sp-header.index.663900-6') }}</NuxtLink>
|
||||
<span>|</span>
|
||||
<NuxtLink to="/member/user-info" style="margin-right:0;">{{ $t('sp-header.index.663900-7') }}</NuxtLink>
|
||||
<NuxtLink :to="getLocalizedPath('/member/user-info')" style="margin-right:0;">{{ $t('sp-header.index.663900-7') }}</NuxtLink>
|
||||
<span>|</span>
|
||||
<NuxtLink to="/shop">{{ $t('sp-header.index.663900-8') }}</NuxtLink>
|
||||
<NuxtLink :to="getLocalizedPath('/shop')">{{ $t('sp-header.index.663900-8') }}</NuxtLink>
|
||||
<!-- 隐藏商家中心 -->
|
||||
<!-- <NuxtLink to="/member/user-info">商家中心</NuxtLink> -->
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 挂件 -->
|
||||
<!-- <component
|
||||
<component
|
||||
mode="render"
|
||||
v-for="(wgt, index) in wgts"
|
||||
:is="wgt.type"
|
||||
@@ -84,7 +84,7 @@
|
||||
:page-props="pageConfig"
|
||||
:key="`wgt-${index}`"
|
||||
@callback="handleCallback"
|
||||
></component> -->
|
||||
></component>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -93,6 +93,7 @@ import { mixin as clickaway } from '@/plugins/clickaway'
|
||||
import { mapState } from 'vuex'
|
||||
import { lockScreen } from '@/utils/dom'
|
||||
import S from '@/spx'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
|
||||
export default {
|
||||
name: 'SpHeader',
|
||||
@@ -137,10 +138,11 @@ export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
userInfo: (state) => state.user.userInfo,
|
||||
// wgts: (state) => {
|
||||
// const res = state.headerTemplate
|
||||
// return res ? JSON.parse(res.params) : []
|
||||
// },
|
||||
wgts: (state) => {
|
||||
console.log('state',state.headerTemplate)
|
||||
const res = state.headerTemplate
|
||||
return res ? JSON.parse(res.params) : []
|
||||
},
|
||||
pageConfig: (state) => {
|
||||
return state.pageConfig
|
||||
}
|
||||
@@ -154,6 +156,10 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
getCurrentLanguageName() {
|
||||
if (!this.$i18n || !this.$i18n.locale) {
|
||||
return '中文'
|
||||
@@ -216,14 +222,50 @@ export default {
|
||||
if (path.includes('/ar')) return 'ar'
|
||||
return ''
|
||||
},
|
||||
handleLogout() {
|
||||
async handleLogout() {
|
||||
try {
|
||||
// 调用后端 logout API 清除服务端 session
|
||||
await this.$api.auth.logout()
|
||||
} catch (e) {
|
||||
// 即使 API 调用失败,也继续执行退出流程
|
||||
console.warn('Logout API call failed:', e)
|
||||
}
|
||||
|
||||
// 清除 cookie
|
||||
this.$cookies.remove('ECSHOPX_TOKEN')
|
||||
|
||||
// 清除 Vuex store 中的用户信息
|
||||
this.$store.commit('user/resetInfo')
|
||||
|
||||
// 清除 localStorage 中由 vuex-persistedstate 保存的状态
|
||||
if (process.client && window.localStorage) {
|
||||
// 清除 vuex-persistedstate 保存的 user 模块数据
|
||||
const persistedState = localStorage.getItem('xiaocao-store')
|
||||
if (persistedState) {
|
||||
try {
|
||||
const state = JSON.parse(persistedState)
|
||||
if (state.user) {
|
||||
state.user = {
|
||||
token: null,
|
||||
userInfo: null,
|
||||
sessionId: null
|
||||
}
|
||||
localStorage.setItem('xiaocao-store', JSON.stringify(state))
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('Failed to clear persisted state:', e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 调用 S.logout() 清除 AUTH_TOKEN 并跳转
|
||||
S.logout()
|
||||
},
|
||||
handleCallback(params) {
|
||||
if (params) {
|
||||
let keywords = params.data.keyword
|
||||
this.$router.push(`/items?keywords=${keywords}`)
|
||||
const path = this.getLocalizedPath(`/items?keywords=${keywords}`)
|
||||
this.$router.push(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -70,14 +70,34 @@
|
||||
right: 13px;
|
||||
z-index: 1102;
|
||||
cursor: pointer;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: opacity 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
&.top16 {
|
||||
top: 16px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ec-icon-close {
|
||||
font-size: 20px;
|
||||
&-icon {
|
||||
font-size: 24px;
|
||||
color: #666;
|
||||
line-height: 1;
|
||||
display: inline-block;
|
||||
font-weight: 300;
|
||||
user-select: none;
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
&.top16 &-icon {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
&__header {
|
||||
@@ -136,7 +156,7 @@
|
||||
v-if="!confirm && !maskClose && closeIconVisible"
|
||||
>
|
||||
<!-- <img src="~/assets/imgs/close-btn.png" :width="54" :height="54"> -->
|
||||
<div class="ec-icon ec-icon-close"></div>
|
||||
<span class="sp-modal__close-icon">×</span>
|
||||
</div>
|
||||
<div class="sp-modal__header" v-if="title">{{ title }}</div>
|
||||
<slot name="title"></slot>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<img class="sp-tip-message__img" v-if="img" :src="require(`~/assets/imgs/${img}`)" alt>
|
||||
<span>
|
||||
<span class="sp-tip-message__txt">{{tipText || $t('tip-message.index.587556-1')}}</span>
|
||||
<nuxt-link v-if="tipLink" :to="to">{{tipLink}}</nuxt-link>
|
||||
<nuxt-link v-if="tipLink" :to="getLocalizedPath(to)">{{tipLink}}</nuxt-link>
|
||||
</span>
|
||||
</div>
|
||||
<slot></slot>
|
||||
@@ -45,6 +45,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { localePath } from '@/utils/localePath'
|
||||
export default {
|
||||
name: 'SpTipMessage',
|
||||
props: {
|
||||
@@ -82,6 +83,13 @@ export default {
|
||||
}, 300)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
if (!path) return ''
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,8 +8,13 @@ $reg-pic-w: 555px;
|
||||
|
||||
.page-auth-reg {
|
||||
background: transparent;
|
||||
height: 590px;
|
||||
min-height: 590px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@include justify-content-end;
|
||||
position: relative;
|
||||
@include padding-inline-end(100px);
|
||||
@include padding-inline-start(100px);
|
||||
.reg-logo{
|
||||
left: auto;
|
||||
// top: 100px;
|
||||
@@ -20,20 +25,22 @@ $reg-pic-w: 555px;
|
||||
.reg-main{
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
width: 350px;
|
||||
height: 430px;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
top: 82px;;
|
||||
left: 844px;
|
||||
position: relative;
|
||||
padding: 24px 0;
|
||||
overflow: visible;
|
||||
flex-shrink: 0;
|
||||
.reg-title {
|
||||
font-weight: 400;
|
||||
color: #8C8C8C;
|
||||
height: 26px;
|
||||
line-height: 39px;
|
||||
font-size: 26px;
|
||||
margin: 24px 0;
|
||||
margin: 0 0 24px 0;
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
}
|
||||
.auth-header {
|
||||
border-bottom: 1px solid $color-border-gray;
|
||||
@@ -44,7 +51,11 @@ $reg-pic-w: 555px;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
.reg {
|
||||
.auth {
|
||||
width: 100%;
|
||||
flex: 0 0 auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
&-process {
|
||||
text-align: center;
|
||||
height: 60px;
|
||||
@@ -110,8 +121,11 @@ $reg-pic-w: 555px;
|
||||
}
|
||||
}
|
||||
&-form {
|
||||
width: 100%;
|
||||
margin-top: 0;
|
||||
.form {
|
||||
margin-top: 4px;
|
||||
margin-top: 0;
|
||||
width: 100%;
|
||||
.dash-line {
|
||||
border-top: 1px dashed $color-border-gray;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
<style lang="scss" src="./reg.scss"></style>
|
||||
<template>
|
||||
<div class="page-auth-reg container">
|
||||
<div class="page-auth-reg ">
|
||||
<!-- <div class="reg-logo">
|
||||
<img
|
||||
referrerpolicy="no-referrer"
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<SpRadio type="checkbox" :theme="themeColor" :value="item.is_checked"
|
||||
@change="(val) => handleOnChangeCheck(val, item.cart_id)" />
|
||||
<div class="g-wrap">
|
||||
<nuxt-link :to="`/items/${item.item_id}`">
|
||||
<nuxt-link :to="getLocalizedPath(`/items/${item.item_id}`)">
|
||||
<SpImg class="spimg" noSize :src="item.pics" />
|
||||
</nuxt-link>
|
||||
<div class="goods-name">{{ item.item_name }}</div>
|
||||
@@ -85,7 +85,7 @@
|
||||
<img class="cart-empty-img" src="@/assets/imgs/cart-empty.png" alt="" />
|
||||
<div class="cart-empty-info">
|
||||
<div class="txt">{{ $t('cart.index.281938-15') }}</div>
|
||||
<nuxt-link to="/items">
|
||||
<nuxt-link :to="getLocalizedPath('/items')">
|
||||
<span :style="{
|
||||
color: themeColor
|
||||
}">{{ $t('cart.index.281938-16') }}<i class="ec-icon ec-icon-right"></i></span>
|
||||
@@ -127,6 +127,7 @@
|
||||
import {
|
||||
mixin
|
||||
} from '@/mixins'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
import CartRecommend from './comps/cart-recommend'
|
||||
import CouponPicker from './comps/coupon-picker'
|
||||
export default {
|
||||
@@ -196,6 +197,10 @@
|
||||
...mapActions({
|
||||
CART_GETINFO: 'cart/CART_GETINFO'
|
||||
}),
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
async handleOnChangeCheck(val, cart_id) {
|
||||
await this.$api.cart.updateCheckStatus({
|
||||
cart_id,
|
||||
@@ -281,7 +286,14 @@
|
||||
// 去结算
|
||||
handleClickSubmit(shop) {
|
||||
if (shop.goodsCheckNum > 0) {
|
||||
this.$router.push(`cart/checkout?mode=cart&id=${shop.shop_id}`)
|
||||
const basePath = this.getLocalizedPath('/cart/checkout')
|
||||
this.$router.push({
|
||||
path: basePath,
|
||||
query: {
|
||||
mode: 'cart',
|
||||
id: shop.shop_id
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,11 +38,14 @@ export default {
|
||||
bodyTemplate.forEach((item) => {
|
||||
const config = JSON.parse(item.config)
|
||||
if (config.type != 'W0000') {
|
||||
|
||||
_bodyTemplate.push(config)
|
||||
}else{
|
||||
console.log('W0000',config)
|
||||
store.commit('setPageConfig', config)
|
||||
}
|
||||
})
|
||||
console.log('_bodyTemplate',_bodyTemplate)
|
||||
return {
|
||||
wgts: _bodyTemplate
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@
|
||||
<script>
|
||||
import GoodsCard from './goods-card'
|
||||
import { analytics } from '@/plugins/analytics'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
export default {
|
||||
name: 'SpGoodsRecommend',
|
||||
props: {
|
||||
@@ -192,9 +193,13 @@ export default {
|
||||
}]
|
||||
}, 'productRecommendationClick')
|
||||
},
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
resolveLink (item) {
|
||||
const { item_id } = item
|
||||
return `/items/${item_id}`
|
||||
return this.getLocalizedPath(`/items/${item_id}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
<div class="recommend-list">
|
||||
<div class="recommend-item" v-for="(item, index) in recommendList" :key="`recommend-item__${index}`">
|
||||
<nuxt-link :to="`/items/${item.item_id}`">
|
||||
<nuxt-link :to="getLocalizedPath(`/items/${item.item_id}`)">
|
||||
<div class="recommend-item__img">
|
||||
<img :src="item.pics[0]" v-if="item.pics && item.pics.length>0" width="100%" />
|
||||
</div>
|
||||
@@ -63,6 +63,7 @@
|
||||
|
||||
<script>
|
||||
import GoodsRecommend from './goods-recommend'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
export default {
|
||||
name: 'SpRecommend',
|
||||
props: {},
|
||||
@@ -76,6 +77,10 @@ export default {
|
||||
this.getRecommend()
|
||||
},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
async getRecommend () {
|
||||
let params = {
|
||||
page: 1,
|
||||
@@ -86,7 +91,8 @@ export default {
|
||||
this.recommendList = list
|
||||
},
|
||||
clickeTo(item){
|
||||
this.$router.push(`/items/${item.itemId}`)
|
||||
const path = this.getLocalizedPath(`/items/${item.itemId}`)
|
||||
this.$router.push(path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="vip-card" v-if="info" :style="{'background-image':'url(' + vip_bg + ')'}">
|
||||
<div class="vip-card__hd">
|
||||
<span>{{info.username || info.mobile}}</span>
|
||||
<nuxt-link to="/member/rights">
|
||||
<nuxt-link :to="getLocalizedPath('/member/rights')">
|
||||
<span class="vip-card__rights">{{ $t('comps.vip-card.642296-0') }}</span>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
<script>
|
||||
import ProgressBar from './progress-bar'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
|
||||
import grade_1 from '~/assets/imgs/grade_1.png'
|
||||
import grade_2 from '~/assets/imgs/grade_2.png'
|
||||
@@ -55,6 +56,12 @@ export default {
|
||||
const { grade_id } = this.info
|
||||
return this.GRADE_MAP[grade_id] || this.GRADE_MAP[1]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
{{ $t('member.coupon-center.473557-1') }}
|
||||
</div>
|
||||
</div>
|
||||
<nuxt-link class="coupon-my" to="/member/coupon">
|
||||
<nuxt-link class="coupon-my" :to="getLocalizedPath('/member/coupon')">
|
||||
<img src="@/assets/imgs/coupons/quan (5).png" alt="">
|
||||
<span class="vip-desc"
|
||||
>{{ $t('member.coupon-center.473557-2') }}
|
||||
@@ -90,6 +90,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
|
||||
import smenu from './comps/smenu'
|
||||
import couponCenterItem from './comps/coupon-center-item'
|
||||
@@ -138,6 +139,10 @@ export default {
|
||||
this.getCouponList()
|
||||
},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
async getCouponList() {
|
||||
let params = {
|
||||
page_no: this.page,
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<div class="product-status-warp">
|
||||
<div
|
||||
class="p-status-text"
|
||||
:class="child.orderStatus == 'NOTPAY' ? 'nopay-color' : ''"
|
||||
|
||||
>
|
||||
{{ orderStatusText[child.orderStatus] }}
|
||||
</div>
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
}
|
||||
}
|
||||
.bd {
|
||||
width: 100%;
|
||||
width: 1190px;
|
||||
margin: 0 auto;
|
||||
background-color: #fff;
|
||||
.rate-item {
|
||||
width: 100%;
|
||||
|
||||
@@ -429,7 +429,7 @@ $num-color : #FF5D02;
|
||||
<div class="order-container">
|
||||
<div class="block-hd">
|
||||
<span class="title">{{ $t('member.user-info.869309-22') }}</span>
|
||||
<nuxt-link class="more" to="/member/trade">
|
||||
<nuxt-link class="more" :to="getLocalizedPath('/member/trade')">
|
||||
{{ $t('member.user-info.869309-23') }}<i class="ec-icon ec-icon-right"></i>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
@@ -453,7 +453,7 @@ $num-color : #FF5D02;
|
||||
<div class="follow-goods">
|
||||
<div class="block-hd">
|
||||
<span class="title">{{ $t('member.user-info.869309-24') }}</span>
|
||||
<nuxt-link class="more" to="/member/collector">
|
||||
<nuxt-link class="more" :to="getLocalizedPath('/member/collector')">
|
||||
{{ $t('member.user-info.869309-23') }}<i class="ec-icon ec-icon-right"></i>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
@@ -477,7 +477,7 @@ $num-color : #FF5D02;
|
||||
<div class="footprint-container">
|
||||
<div class="block-hd">
|
||||
<span class="title">{{ $t('member.user-info.869309-25') }}</span>
|
||||
<nuxt-link class="more" to="/member/foottrace">
|
||||
<nuxt-link class="more" :to="getLocalizedPath('/member/foottrace')">
|
||||
{{ $t('member.user-info.869309-23') }}<i class="ec-icon ec-icon-right"></i>
|
||||
</nuxt-link>
|
||||
</div>
|
||||
@@ -507,6 +507,7 @@ $num-color : #FF5D02;
|
||||
<script>
|
||||
import { memberInfo, getCount, getHistoryList } from '@/api/member'
|
||||
import { mixin } from '@/mixins'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
import smenu from '../member/comps/smenu'
|
||||
import goodFocus from './comps/good-focus'
|
||||
|
||||
@@ -566,7 +567,7 @@ export default {
|
||||
num: 0,
|
||||
icon: 'icon-new-pc-daiziti',
|
||||
title: this.$t('member.user-info.869309-34'),
|
||||
link: '/member/trade?status=6'
|
||||
link: '/member/trade?status=4'
|
||||
},
|
||||
aftersales: {
|
||||
num: 0,
|
||||
@@ -611,15 +612,21 @@ export default {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
// 跳转
|
||||
toLink(link) {
|
||||
this.$router.push(link)
|
||||
const localizedLink = this.getLocalizedPath(link)
|
||||
this.$router.push(localizedLink)
|
||||
},
|
||||
handelClick(type, i) {
|
||||
this.active = i
|
||||
},
|
||||
handelClickToLink(id) {
|
||||
this.$router.push(`/items/${id}`)
|
||||
const path = this.getLocalizedPath(`/items/${id}`)
|
||||
this.$router.push(path)
|
||||
},
|
||||
async getMemberInfo() {
|
||||
let res = await memberInfo()
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
</div>
|
||||
<div class="news-list clearfix">
|
||||
<div class="news-list__item" v-for="(item, index) in list" :key="index">
|
||||
<nuxt-link :to="`/article/detail/${item.article_id}`" @click.native="$track('news', `/article/detail/${item.article_id}`, item.article_id)">
|
||||
<nuxt-link :to="getLocalizedPath(`/article/detail/${item.article_id}`)" @click.native="$track('news', `/article/detail/${item.article_id}`, item.article_id)">
|
||||
<div
|
||||
class="news-list__item-img"
|
||||
|
||||
@@ -168,6 +168,7 @@
|
||||
<script>
|
||||
import { formatDataTime } from '@/utils'
|
||||
import { analytics } from '@/plugins/analytics'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
|
||||
export default {
|
||||
data () {
|
||||
@@ -193,6 +194,10 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
// 分页查询
|
||||
handleChangePage (page) {
|
||||
this.page_no = page
|
||||
|
||||
@@ -144,6 +144,7 @@
|
||||
<script>
|
||||
import GoodsCard from './goods-card'
|
||||
import { analytics } from '@/plugins/analytics'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
export default {
|
||||
name: 'SpGoodsRecommend',
|
||||
props: {
|
||||
@@ -192,9 +193,13 @@ export default {
|
||||
}]
|
||||
}, 'productRecommendationClick')
|
||||
},
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
resolveLink (item) {
|
||||
const { item_id } = item
|
||||
return `/items/${item_id}`
|
||||
return this.getLocalizedPath(`/items/${item_id}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,22 +50,22 @@
|
||||
<img src="~/assets/imgs/resource/201911/pc/prec/prec1.jpg" alt />
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<nuxt-link :to="`/items/179`">
|
||||
<nuxt-link :to="getLocalizedPath('/items/179')">
|
||||
<img src="~/assets/imgs/resource/201911/pc/prec/prec2.jpg" alt />
|
||||
</nuxt-link>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<nuxt-link :to="`/items/182`">
|
||||
<nuxt-link :to="getLocalizedPath('/items/182')">
|
||||
<img src="~/assets/imgs/resource/201911/pc/prec/prec3.jpg" alt />
|
||||
</nuxt-link>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<nuxt-link :to="`/items/181`">
|
||||
<nuxt-link :to="getLocalizedPath('/items/181')">
|
||||
<img src="~/assets/imgs/resource/201911/pc/prec/prec4.jpg" alt />
|
||||
</nuxt-link>
|
||||
</div>
|
||||
<div class="swiper-slide">
|
||||
<nuxt-link :to="`/items/183`">
|
||||
<nuxt-link :to="getLocalizedPath('/items/183')">
|
||||
<img src="~/assets/imgs/resource/201911/pc/prec/prec5.jpg" alt />
|
||||
</nuxt-link>
|
||||
</div>
|
||||
@@ -80,6 +80,7 @@
|
||||
|
||||
<script>
|
||||
import { analytics } from '@/plugins/analytics'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -113,6 +114,11 @@ export default {
|
||||
// }
|
||||
// })
|
||||
},
|
||||
methods: {}
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<SpFormItem class="clearfix">
|
||||
<SpRadio type="checkbox" size="small" v-model="license">
|
||||
<span class="license-info">
|
||||
{{ $t('staff.login.275114-6') }}<nuxt-link class="license-content" to="/license/staff">{{ $t('staff.login.275114-7') }}</nuxt-link>
|
||||
{{ $t('staff.login.275114-6') }}<nuxt-link class="license-content" :to="getLocalizedPath('/license/staff')">{{ $t('staff.login.275114-7') }}</nuxt-link>
|
||||
</span>
|
||||
</SpRadio>
|
||||
</SpFormItem>
|
||||
@@ -60,7 +60,7 @@
|
||||
</SpFormItem>
|
||||
</SpForm>
|
||||
<div class="jump">
|
||||
<nuxt-link class="license-content" to="/auth/login">
|
||||
<nuxt-link class="license-content" :to="getLocalizedPath('/auth/login')">
|
||||
{{ $t('staff.login.275114-8') }}<i class="mb-iconfont mb-iconfont-right"></i><br>
|
||||
({{ $t('staff.login.275114-9') }})
|
||||
</nuxt-link>
|
||||
@@ -75,6 +75,7 @@ import store from 'store'
|
||||
import _debounce from 'lodash/debounce'
|
||||
import S from '@/spx'
|
||||
import { analytics } from '@/plugins/analytics'
|
||||
import { localePath } from '@/utils/localePath'
|
||||
|
||||
export default {
|
||||
beforeRouteEnter (to, from, next) {
|
||||
@@ -131,6 +132,10 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 生成本地化路径
|
||||
getLocalizedPath(path) {
|
||||
return localePath(path, this.$i18n.locale, this)
|
||||
},
|
||||
...mapActions(['initStore']),
|
||||
handleBlurWorkId (e) {
|
||||
this.getStaffMobile()
|
||||
|
||||
@@ -127,56 +127,56 @@ export const actions = {
|
||||
} catch (e) {
|
||||
// console.error(e)
|
||||
}
|
||||
// const [headerTemplate, bodyTemplate, footerTemplate, seoInfo] = await Promise.all([
|
||||
// app.$api.theme.getHeaderOrFooter({
|
||||
// page_name: 'header'
|
||||
// }),
|
||||
// app.$api.theme.getTemplateContent(),
|
||||
// app.$api.theme.getHeaderOrFooter({
|
||||
// page_name: 'footer'
|
||||
// } ),
|
||||
// app.$api.global.getGlobalTdk()
|
||||
// ] )
|
||||
// console.log('promise ending...')
|
||||
// commit('setSeoInfo', seoInfo)
|
||||
const [headerTemplate, bodyTemplate, footerTemplate, seoInfo] = await Promise.all([
|
||||
app.$api.theme.getHeaderOrFooter({
|
||||
page_name: 'header'
|
||||
}),
|
||||
app.$api.theme.getTemplateContent(),
|
||||
app.$api.theme.getHeaderOrFooter({
|
||||
page_name: 'footer'
|
||||
} ),
|
||||
app.$api.global.getGlobalTdk()
|
||||
] )
|
||||
console.log('promise ending...')
|
||||
commit('setSeoInfo', seoInfo)
|
||||
|
||||
// const _bodyTemplate = []
|
||||
// bodyTemplate.forEach((item) => {
|
||||
// const config = JSON.parse(item.config)
|
||||
// if (config.type != 'W0000') {
|
||||
// _bodyTemplate.push(config)
|
||||
// } else {
|
||||
// commit('setPageConfig', config)
|
||||
// }
|
||||
// })
|
||||
const _bodyTemplate = []
|
||||
bodyTemplate.forEach((item) => {
|
||||
const config = JSON.parse(item.config)
|
||||
if (config.type != 'W0000') {
|
||||
_bodyTemplate.push(config)
|
||||
} else {
|
||||
commit('setPageConfig', config)
|
||||
}
|
||||
})
|
||||
|
||||
// console.log("_bodyTemplate:", _bodyTemplate);
|
||||
console.log("_bodyTemplate:", _bodyTemplate);
|
||||
|
||||
// const _headerTemplate = {
|
||||
// params: '[]'
|
||||
// }
|
||||
// if (typeof headerTemplate.params != 'undefined') {
|
||||
// _headerTemplate.params = headerTemplate.params
|
||||
// }
|
||||
const _headerTemplate = {
|
||||
params: '[]'
|
||||
}
|
||||
if (typeof headerTemplate.params != 'undefined') {
|
||||
_headerTemplate.params = headerTemplate.params
|
||||
}
|
||||
|
||||
// const _footerTemplate = {
|
||||
// params: '[]'
|
||||
// }
|
||||
// if (typeof footerTemplate.params != 'undefined') {
|
||||
// _footerTemplate.params = footerTemplate.params
|
||||
// }
|
||||
const _footerTemplate = {
|
||||
params: '[]'
|
||||
}
|
||||
if (typeof footerTemplate.params != 'undefined') {
|
||||
_footerTemplate.params = footerTemplate.params
|
||||
}
|
||||
console.log('setHeaderTemplate',headerTemplate)
|
||||
commit( 'setHeaderTemplate', headerTemplate )
|
||||
|
||||
// commit( 'setHeaderTemplate', headerTemplate )
|
||||
commit('setFooterTemplate', footerTemplate)
|
||||
|
||||
// commit('setFooterTemplate', footerTemplate)
|
||||
const commonWgts = {
|
||||
headerTemplate: _headerTemplate,
|
||||
bodyTemplate: _bodyTemplate,
|
||||
footerTemplate: _footerTemplate
|
||||
}
|
||||
|
||||
// const commonWgts = {
|
||||
// headerTemplate: _headerTemplate,
|
||||
// bodyTemplate: _bodyTemplate,
|
||||
// footerTemplate: _footerTemplate
|
||||
// }
|
||||
|
||||
// commit('fetchCommonWgts', commonWgts)
|
||||
commit('fetchCommonWgts', commonWgts)
|
||||
},
|
||||
|
||||
async initStore({ state, commit, dispatch }) {
|
||||
|
||||
75
src/utils/localePath.js
Normal file
75
src/utils/localePath.js
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Copyright © ShopeX (http://www.shopex.cn). All rights reserved.
|
||||
* See LICENSE file for license details.
|
||||
*/
|
||||
|
||||
import { defaultLocale } from './language'
|
||||
import { getlanguageByPath } from './doc'
|
||||
|
||||
/**
|
||||
* 生成本地化路径(带语言前缀)
|
||||
* @param {string} path - 原始路径,如 '/items/123' 或 '/items'
|
||||
* @param {string} locale - 语言代码,如 'zh', 'en', 'ar'。如果不提供,则从当前路由或默认语言获取
|
||||
* @param {Object} context - Vue 实例或 Nuxt 上下文,用于获取当前语言
|
||||
* @returns {string} 带语言前缀的路径,如 '/zh/items/123' 或 '/en/items'
|
||||
*/
|
||||
export function localePath(path, locale = null, context = null) {
|
||||
if (!path) return ''
|
||||
|
||||
// 如果路径已经是绝对 URL,直接返回
|
||||
if (/^(https?|mailto|tel):/.test(path)) {
|
||||
return path
|
||||
}
|
||||
|
||||
// 获取当前语言
|
||||
let currentLocale = locale
|
||||
|
||||
if (!currentLocale) {
|
||||
// 尝试从 context 获取
|
||||
if (context) {
|
||||
if (context.$i18n && context.$i18n.locale) {
|
||||
currentLocale = context.$i18n.locale
|
||||
} else if (context.$route && context.$route.path) {
|
||||
const pathLang = getlanguageByPath(context.$route.path)
|
||||
if (pathLang) {
|
||||
currentLocale = pathLang
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 如果还是没有,尝试从全局获取
|
||||
if (!currentLocale && process.client && window.$nuxt && window.$nuxt.$i18n) {
|
||||
currentLocale = window.$nuxt.$i18n.locale
|
||||
}
|
||||
|
||||
// 最后使用默认语言
|
||||
if (!currentLocale) {
|
||||
currentLocale = defaultLocale
|
||||
}
|
||||
}
|
||||
|
||||
// 如果路径已经包含语言前缀,先移除
|
||||
const pathWithoutLang = path.replace(/^\/(zh|en|ar)(\/|$)/, '/')
|
||||
|
||||
// 如果是默认语言且路径是根路径,可以不添加语言前缀(根据 nuxt-i18n 的 prefix_and_default 策略)
|
||||
// 但为了保持一致性,我们总是添加语言前缀
|
||||
if (currentLocale === defaultLocale && pathWithoutLang === '/') {
|
||||
return '/'
|
||||
}
|
||||
|
||||
// 确保路径以 / 开头
|
||||
const normalizedPath = pathWithoutLang.startsWith('/') ? pathWithoutLang : `/${pathWithoutLang}`
|
||||
|
||||
// 生成带语言前缀的路径
|
||||
return `/${currentLocale}${normalizedPath}`
|
||||
}
|
||||
|
||||
/**
|
||||
* 在 Vue 组件中使用的辅助方法
|
||||
* 可以通过 mixin 或直接在组件中使用
|
||||
*/
|
||||
export function getLocalePath(path, locale = null) {
|
||||
// 在 Vue 组件中,this 会被自动传入
|
||||
return localePath(path, locale, this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user