Merge branch 'master' of https://git.yunzer.cn/yunzerwebsite/yunzerwebsiteallinone
This commit is contained in:
Generated
+300
@@ -25,6 +25,7 @@
|
||||
"pdfjs-dist": "^6.2.108",
|
||||
"pinia": "^3.0.3",
|
||||
"pinyin-pro": "^3.29.4",
|
||||
"qrcode": "^1.5.4",
|
||||
"tesseract.js": "^7.0.0",
|
||||
"v-viewer": "^3.0.11",
|
||||
"vue": "^3.5.22",
|
||||
@@ -3306,6 +3307,42 @@
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-regex": {
|
||||
"version": "5.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/ansi-regex/-/ansi-regex-5.0.1.tgz",
|
||||
"integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-styles": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/ansi-styles/-/ansi-styles-4.3.0.tgz",
|
||||
"integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/ansi-styles/node_modules/color-convert": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz",
|
||||
"integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"color-name": "~1.1.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/argparse/-/argparse-2.0.1.tgz",
|
||||
@@ -3495,6 +3532,15 @@
|
||||
"tslib": "^2.0.3"
|
||||
}
|
||||
},
|
||||
"node_modules/camelcase": {
|
||||
"version": "5.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/camelcase/-/camelcase-5.3.1.tgz",
|
||||
"integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/canvg": {
|
||||
"version": "3.0.11",
|
||||
"resolved": "https://registry.npmmirror.com/canvg/-/canvg-3.0.11.tgz",
|
||||
@@ -3578,6 +3624,17 @@
|
||||
"node": ">= 10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/cliui": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/cliui/-/cliui-6.0.0.tgz",
|
||||
"integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"string-width": "^4.2.0",
|
||||
"strip-ansi": "^6.0.0",
|
||||
"wrap-ansi": "^6.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/codepage": {
|
||||
"version": "1.15.0",
|
||||
"resolved": "https://registry.npmmirror.com/codepage/-/codepage-1.15.0.tgz",
|
||||
@@ -4289,6 +4346,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/decamelize": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/default-passive-events": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/default-passive-events/-/default-passive-events-4.0.0.tgz",
|
||||
@@ -4369,6 +4435,12 @@
|
||||
"url": "https://github.com/sponsors/wooorm"
|
||||
}
|
||||
},
|
||||
"node_modules/dijkstrajs": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/dijkstrajs/-/dijkstrajs-1.0.3.tgz",
|
||||
"integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/docx-preview": {
|
||||
"version": "0.3.7",
|
||||
"resolved": "https://registry.npmmirror.com/docx-preview/-/docx-preview-0.3.7.tgz",
|
||||
@@ -4519,6 +4591,12 @@
|
||||
"vue": "^3.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/emoji-regex": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
|
||||
"integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/entities/-/entities-7.0.1.tgz",
|
||||
@@ -4859,6 +4937,19 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/find-up": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz",
|
||||
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"locate-path": "^5.0.0",
|
||||
"path-exists": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.11",
|
||||
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.11.tgz",
|
||||
@@ -4981,6 +5072,15 @@
|
||||
"node": ">= 0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/get-caller-file": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz",
|
||||
"integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
|
||||
"license": "ISC",
|
||||
"engines": {
|
||||
"node": "6.* || 8.* || >= 10.*"
|
||||
}
|
||||
},
|
||||
"node_modules/get-intrinsic": {
|
||||
"version": "1.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
|
||||
@@ -5519,6 +5619,15 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/is-fullwidth-code-point": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
|
||||
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/is-generator-function": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmmirror.com/is-generator-function/-/is-generator-function-1.1.2.tgz",
|
||||
@@ -5938,6 +6047,18 @@
|
||||
"url": "https://github.com/sponsors/antfu"
|
||||
}
|
||||
},
|
||||
"node_modules/locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz",
|
||||
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"p-locate": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.23",
|
||||
"resolved": "https://registry.npmmirror.com/lodash/-/lodash-4.17.23.tgz",
|
||||
@@ -6427,6 +6548,42 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/p-limit": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz",
|
||||
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"p-try": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/p-locate": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/p-locate/-/p-locate-4.1.0.tgz",
|
||||
"integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"p-limit": "^2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/p-try": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/p-try/-/p-try-2.2.0.tgz",
|
||||
"integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/package-manager-detector": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/package-manager-detector/-/package-manager-detector-1.7.0.tgz",
|
||||
@@ -6474,6 +6631,15 @@
|
||||
"integrity": "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/path-exists": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/path-exists/-/path-exists-4.0.0.tgz",
|
||||
"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/pathe": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/pathe/-/pathe-2.0.3.tgz",
|
||||
@@ -6587,6 +6753,15 @@
|
||||
"url-polyfill": "^1.1.13"
|
||||
}
|
||||
},
|
||||
"node_modules/pngjs": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/pngjs/-/pngjs-5.0.0.tgz",
|
||||
"integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/points-on-curve": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/points-on-curve/-/points-on-curve-0.2.0.tgz",
|
||||
@@ -6952,6 +7127,23 @@
|
||||
"integrity": "sha512-uxq2BMTdnKW7jDghpLJrczCd9KDOdyghFtEEpfomqMJkUM83/N+W7sFJPJ3AxBf0mJ3xtxAycl6NW8p6F53jEw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/qrcode": {
|
||||
"version": "1.5.4",
|
||||
"resolved": "https://registry.npmmirror.com/qrcode/-/qrcode-1.5.4.tgz",
|
||||
"integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"dijkstrajs": "^1.0.1",
|
||||
"pngjs": "^5.0.0",
|
||||
"yargs": "^15.3.1"
|
||||
},
|
||||
"bin": {
|
||||
"qrcode": "bin/qrcode"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/quansync": {
|
||||
"version": "0.2.11",
|
||||
"resolved": "https://registry.npmmirror.com/quansync/-/quansync-0.2.11.tgz",
|
||||
@@ -7091,6 +7283,21 @@
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/require-main-filename": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/require-main-filename/-/require-main-filename-2.0.0.tgz",
|
||||
"integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/reusify": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/reusify/-/reusify-1.1.0.tgz",
|
||||
@@ -7317,6 +7524,12 @@
|
||||
"semver": "bin/semver"
|
||||
}
|
||||
},
|
||||
"node_modules/set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/set-function-length": {
|
||||
"version": "1.2.2",
|
||||
"resolved": "https://registry.npmmirror.com/set-function-length/-/set-function-length-1.2.2.tgz",
|
||||
@@ -7552,6 +7765,20 @@
|
||||
"safe-buffer": "~5.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/string-width": {
|
||||
"version": "4.2.3",
|
||||
"resolved": "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz",
|
||||
"integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"emoji-regex": "^8.0.0",
|
||||
"is-fullwidth-code-point": "^3.0.0",
|
||||
"strip-ansi": "^6.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/string.prototype.trim": {
|
||||
"version": "1.2.10",
|
||||
"resolved": "https://registry.npmmirror.com/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz",
|
||||
@@ -7608,6 +7835,18 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-ansi": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||
"integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/strip-literal": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/strip-literal/-/strip-literal-3.1.0.tgz",
|
||||
@@ -8406,6 +8645,12 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/which-module": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/which-module/-/which-module-2.0.1.tgz",
|
||||
"integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/which-typed-array": {
|
||||
"version": "1.1.20",
|
||||
"resolved": "https://registry.npmmirror.com/which-typed-array/-/which-typed-array-1.1.20.tgz",
|
||||
@@ -8445,6 +8690,20 @@
|
||||
"node": ">=0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/wrap-ansi": {
|
||||
"version": "6.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
|
||||
"integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ansi-styles": "^4.0.0",
|
||||
"string-width": "^4.1.0",
|
||||
"strip-ansi": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/xlsx": {
|
||||
"version": "0.18.5",
|
||||
"resolved": "https://registry.npmmirror.com/xlsx/-/xlsx-0.18.5.tgz",
|
||||
@@ -8524,6 +8783,47 @@
|
||||
"yjs": "^13.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/y18n": {
|
||||
"version": "4.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/y18n/-/y18n-4.0.3.tgz",
|
||||
"integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/yargs": {
|
||||
"version": "15.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/yargs/-/yargs-15.4.1.tgz",
|
||||
"integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cliui": "^6.0.0",
|
||||
"decamelize": "^1.2.0",
|
||||
"find-up": "^4.1.0",
|
||||
"get-caller-file": "^2.0.1",
|
||||
"require-directory": "^2.1.1",
|
||||
"require-main-filename": "^2.0.0",
|
||||
"set-blocking": "^2.0.0",
|
||||
"string-width": "^4.2.0",
|
||||
"which-module": "^2.0.0",
|
||||
"y18n": "^4.0.0",
|
||||
"yargs-parser": "^18.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/yargs-parser": {
|
||||
"version": "18.1.3",
|
||||
"resolved": "https://registry.npmmirror.com/yargs-parser/-/yargs-parser-18.1.3.tgz",
|
||||
"integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"camelcase": "^5.0.0",
|
||||
"decamelize": "^1.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/yjs": {
|
||||
"version": "13.6.29",
|
||||
"resolved": "https://registry.npmmirror.com/yjs/-/yjs-13.6.29.tgz",
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
"pdfjs-dist": "^6.2.108",
|
||||
"pinia": "^3.0.3",
|
||||
"pinyin-pro": "^3.29.4",
|
||||
"qrcode": "^1.5.4",
|
||||
"tesseract.js": "^7.0.0",
|
||||
"v-viewer": "^3.0.11",
|
||||
"vue": "^3.5.22",
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
import request from "@/utils/request";
|
||||
|
||||
/*************************************************
|
||||
* 租户端「产品购买」相关接口
|
||||
*************************************************/
|
||||
|
||||
/** 可购买产品列表(含功能节点与价格档位) */
|
||||
export function getProductList(params) {
|
||||
return request({
|
||||
url: "/backend/product/list",
|
||||
method: "get",
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 按产品编码取详情 */
|
||||
export function getProductDetailByCode(code) {
|
||||
return request({
|
||||
url: `/backend/product/detail/${code}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
/** 下单(channel 为空表示线下/待平台开通) */
|
||||
export function createProductOrder(data) {
|
||||
return request({
|
||||
url: "/backend/product/order/create",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询订单状态(已支付会自动开通) */
|
||||
export function getProductOrderStatus(orderNo) {
|
||||
return request({
|
||||
url: "/backend/product/order/status",
|
||||
method: "get",
|
||||
params: { order_no: orderNo },
|
||||
});
|
||||
}
|
||||
|
||||
/** 本租户购买记录 */
|
||||
export function getMyProductOrders() {
|
||||
return request({
|
||||
url: "/backend/product/order/list",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
/** 收银台可用支付渠道 */
|
||||
export function getPaymentChannels() {
|
||||
return request({
|
||||
url: "/backend/payment/channels",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
@@ -41,10 +41,12 @@
|
||||
<el-menu-item
|
||||
v-if="!item.children || item.children.length === 0"
|
||||
:index="item.path || item.id.toString()"
|
||||
:class="{ 'is-locked': item.locked }"
|
||||
>
|
||||
<i v-if="item.icon" :class="item.icon" class="menu-icon"></i>
|
||||
<template #title>
|
||||
<span>{{ item.title }}</span>
|
||||
<i v-if="item.locked" class="fa-solid fa-lock lock-badge"></i>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
|
||||
@@ -53,10 +55,12 @@
|
||||
v-else
|
||||
:index="item.path || item.id.toString()"
|
||||
:unique-opened="true"
|
||||
:class="{ 'is-locked': item.locked }"
|
||||
>
|
||||
<template #title>
|
||||
<i v-if="item.icon" :class="item.icon" class="menu-icon"></i>
|
||||
<span>{{ item.title }}</span>
|
||||
<i v-if="item.locked" class="fa-solid fa-lock lock-badge"></i>
|
||||
</template>
|
||||
|
||||
<!-- 递归渲染子菜单 -->
|
||||
@@ -64,10 +68,12 @@
|
||||
<el-menu-item
|
||||
v-if="!child.children || child.children.length === 0"
|
||||
:index="child.path || child.id.toString()"
|
||||
:class="{ 'is-locked': child.locked }"
|
||||
>
|
||||
<i v-if="child.icon" :class="child.icon" class="menu-icon"></i>
|
||||
<template #title>
|
||||
<span>{{ child.title }}</span>
|
||||
<i v-if="child.locked" class="fa-solid fa-lock lock-badge"></i>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
|
||||
@@ -75,10 +81,12 @@
|
||||
v-else
|
||||
:index="child.path || child.id.toString()"
|
||||
:unique-opened="true"
|
||||
:class="{ 'is-locked': child.locked }"
|
||||
>
|
||||
<template #title>
|
||||
<i v-if="child.icon" :class="child.icon" class="menu-icon"></i>
|
||||
<span>{{ child.title }}</span>
|
||||
<i v-if="child.locked" class="fa-solid fa-lock lock-badge"></i>
|
||||
</template>
|
||||
|
||||
<!-- 继续递归渲染子菜单 -->
|
||||
@@ -91,6 +99,7 @@
|
||||
!grandchild.children || grandchild.children.length === 0
|
||||
"
|
||||
:index="grandchild.path || grandchild.id.toString()"
|
||||
:class="{ 'is-locked': grandchild.locked }"
|
||||
>
|
||||
<i
|
||||
v-if="grandchild.icon"
|
||||
@@ -99,6 +108,7 @@
|
||||
></i>
|
||||
<template #title>
|
||||
<span>{{ grandchild.title }}</span>
|
||||
<i v-if="grandchild.locked" class="fa-solid fa-lock lock-badge"></i>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
|
||||
@@ -106,6 +116,7 @@
|
||||
v-else
|
||||
:index="grandchild.path || grandchild.id.toString()"
|
||||
:unique-opened="true"
|
||||
:class="{ 'is-locked': grandchild.locked }"
|
||||
>
|
||||
<template #title>
|
||||
<i
|
||||
@@ -114,6 +125,7 @@
|
||||
class="menu-icon"
|
||||
></i>
|
||||
<span>{{ grandchild.title }}</span>
|
||||
<i v-if="grandchild.locked" class="fa-solid fa-lock lock-badge"></i>
|
||||
</template>
|
||||
|
||||
<!-- 继续递归渲染... -->
|
||||
@@ -125,6 +137,7 @@
|
||||
:index="
|
||||
greatGrandchild.path || greatGrandchild.id.toString()
|
||||
"
|
||||
:class="{ 'is-locked': greatGrandchild.locked }"
|
||||
>
|
||||
<i
|
||||
v-if="greatGrandchild.icon"
|
||||
@@ -133,6 +146,7 @@
|
||||
></i>
|
||||
<template #title>
|
||||
<span>{{ greatGrandchild.title }}</span>
|
||||
<i v-if="greatGrandchild.locked" class="fa-solid fa-lock lock-badge"></i>
|
||||
</template>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
@@ -283,6 +297,7 @@ const processMenus = (menus) => {
|
||||
title: menu.title,
|
||||
route: menu.path,
|
||||
component_path: menu.component_path,
|
||||
locked: !!menu.locked,
|
||||
parentId: menu.pid || 0,
|
||||
order: menu.sort || 0,
|
||||
children: menu.children ? processMenus(menu.children) : [],
|
||||
@@ -608,6 +623,18 @@ h3 {
|
||||
padding-left: 48px !important;
|
||||
}
|
||||
|
||||
// 套餐未开通模块:锁定态置灰 + 锁图标
|
||||
.el-menu-item.is-locked,
|
||||
.el-sub-menu.is-locked > .el-sub-menu__title {
|
||||
opacity: 0.65;
|
||||
|
||||
.lock-badge {
|
||||
margin-left: 6px;
|
||||
font-size: 12px;
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
}
|
||||
}
|
||||
|
||||
// 暗色主题适配
|
||||
html.dark & {
|
||||
.el-menu-item.is-active {
|
||||
|
||||
@@ -38,6 +38,9 @@ function resolvePageComponent(menu) {
|
||||
return () => import('@/views/404/404.vue');
|
||||
}
|
||||
|
||||
/** 套餐未开通模块的锁定占位页组件 */
|
||||
const lockedPageComponent = () => import('@/views/locked/index.vue');
|
||||
|
||||
/**
|
||||
* 菜单子节点 -> 嵌套路由(path 相对 layoutAbsPath)
|
||||
*/
|
||||
@@ -59,6 +62,20 @@ function nestedMenuToRoute(menu, layoutAbsPath) {
|
||||
componentPath: menu.component_path,
|
||||
};
|
||||
|
||||
// 套餐未开通模块:渲染锁定占位页(子路由同样注册,保证深链接不 404)
|
||||
if (menu.locked) {
|
||||
const route = {
|
||||
path: relPath,
|
||||
name: `menu_${menu.id}`,
|
||||
meta,
|
||||
component: lockedPageComponent,
|
||||
};
|
||||
if (hasChildren) {
|
||||
route.children = convertNestedMenuChildren(menu.children, childAbs);
|
||||
}
|
||||
return route;
|
||||
}
|
||||
|
||||
// 既有自己的页面又有子菜单:套一层 EmptyLayout,避免父页面组件里没有 <router-view> 导致子路由无法渲染
|
||||
if (hasChildren && ownPage) {
|
||||
return {
|
||||
@@ -128,6 +145,20 @@ export function convertMenusToRoutes(menus, parentPath = '') {
|
||||
componentPath: menu.component_path,
|
||||
};
|
||||
|
||||
// 套餐未开通模块:渲染锁定占位页(子路由同样注册,保证深链接不 404)
|
||||
if (menu.locked) {
|
||||
const route = {
|
||||
path: fullPath || menu.path || '',
|
||||
name: `menu_${menu.id}`,
|
||||
meta,
|
||||
component: lockedPageComponent,
|
||||
};
|
||||
if (hasChildren) {
|
||||
route.children = convertMenusToRoutes(menu.children, fullPath);
|
||||
}
|
||||
return route;
|
||||
}
|
||||
|
||||
// 顶层:有页面 + 有子菜单 -> EmptyLayout + 默认子路由 + 相对 path 子路由
|
||||
if (hasChildren && ownPage) {
|
||||
return {
|
||||
|
||||
@@ -157,6 +157,13 @@ const staticRoutes = [
|
||||
path: "/apps/erp/dashborad",
|
||||
redirect: "/apps/erp/dashboard"
|
||||
},
|
||||
// 产品购买页:home 未开通卡片「购买」按钮跳转,独立于 Main 框架展示
|
||||
{
|
||||
path: "/product/:code",
|
||||
name: "ProductPurchase",
|
||||
component: () => import("@/views/product/index.vue"),
|
||||
meta: { requiresAuth: true, title: "产品购买", isStandalone: true }
|
||||
},
|
||||
{
|
||||
path: "/:pathMatch(.*)*",
|
||||
name: "NotFound",
|
||||
|
||||
@@ -75,7 +75,10 @@
|
||||
@click="handleNavigate(module)"
|
||||
>
|
||||
<div class="card-header">
|
||||
<span class="card-title">{{ module.name }}</span>
|
||||
<span class="card-title">
|
||||
{{ module.name }}
|
||||
<el-icon v-if="module.locked" class="lock-badge"><Lock /></el-icon>
|
||||
</span>
|
||||
<div class="card-icon-wrapper" v-html="module.icon"></div>
|
||||
</div>
|
||||
<div class="card-divider"></div>
|
||||
@@ -117,7 +120,10 @@
|
||||
@click="handleNavigate(module)"
|
||||
>
|
||||
<div class="card-header">
|
||||
<span class="card-title">{{ module.name }}</span>
|
||||
<span class="card-title">
|
||||
{{ module.name }}
|
||||
<el-icon v-if="module.locked" class="lock-badge"><Lock /></el-icon>
|
||||
</span>
|
||||
<div class="card-icon-wrapper" v-html="module.icon"></div>
|
||||
</div>
|
||||
<div class="card-divider"></div>
|
||||
@@ -159,7 +165,10 @@
|
||||
@click="handleNavigate(module)"
|
||||
>
|
||||
<div class="card-header">
|
||||
<span class="card-title">{{ module.name }}</span>
|
||||
<span class="card-title">
|
||||
{{ module.name }}
|
||||
<el-icon v-if="module.locked" class="lock-badge"><Lock /></el-icon>
|
||||
</span>
|
||||
<div class="card-icon-wrapper" v-html="module.icon"></div>
|
||||
</div>
|
||||
<div class="card-divider"></div>
|
||||
@@ -206,7 +215,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, onMounted } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
|
||||
import {
|
||||
ArrowDown,
|
||||
@@ -218,6 +227,7 @@ import {
|
||||
Moon,
|
||||
OfficeBuilding,
|
||||
Lock,
|
||||
Lock,
|
||||
} from "@element-plus/icons-vue";
|
||||
|
||||
import { getTenantList } from "@/api/modules";
|
||||
@@ -243,15 +253,22 @@ const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
const menuStore = useMenuStore();
|
||||
|
||||
// 已开通模块排在前面,套餐未开通(锁定)的模块沉到后方
|
||||
function sortUnlockedFirst(list: ModuleItem[]): ModuleItem[] {
|
||||
return [...list].sort(
|
||||
(a, b) => Number(!!a.locked) - Number(!!b.locked)
|
||||
);
|
||||
}
|
||||
|
||||
// 根据type分组模块
|
||||
const basicModules = computed(() =>
|
||||
moduleList.value.filter((item) => item.type === 1)
|
||||
sortUnlockedFirst(moduleList.value.filter((item) => item.type === 1))
|
||||
);
|
||||
const systemModules = computed(() =>
|
||||
moduleList.value.filter((item) => item.type === 2)
|
||||
sortUnlockedFirst(moduleList.value.filter((item) => item.type === 2))
|
||||
);
|
||||
const uncategorizedModules = computed(() =>
|
||||
moduleList.value.filter((item) => item.type === 0)
|
||||
sortUnlockedFirst(moduleList.value.filter((item) => item.type === 0))
|
||||
);
|
||||
|
||||
const moduleList = ref<ModuleItem[]>([]);
|
||||
@@ -327,6 +344,25 @@ const fetchUserProfile = async () => {
|
||||
// 当前租户(企业)名称,来自后端 /backend/getCurrentUser 或登录接口返回的 tenant_name
|
||||
const tenantName = computed(() => authStore.user?.tenant_name || "");
|
||||
|
||||
// 当前租户生效套餐名称(用于未开通提示)
|
||||
const packageName = ref("");
|
||||
// 套餐购买链接(平台端配置,为空时点击「购买」仅提示联系管理员)
|
||||
const purchaseUrl = ref("");
|
||||
|
||||
// 套餐未开通模块:不跳转,提示购买套餐后使用
|
||||
function showLockedTip(module: ModuleItem) {
|
||||
const pkg = packageName.value ? `「${packageName.value}」` : "当前";
|
||||
ElMessageBox.alert(
|
||||
`${pkg}套餐未包含「${module.name}」功能模块,请购买或升级套餐后使用。如有疑问请联系平台管理员。`,
|
||||
"功能未开通",
|
||||
{
|
||||
confirmButtonText: "我知道了",
|
||||
type: "warning",
|
||||
customClass: "module-locked-tip"
|
||||
}
|
||||
).catch(() => {});
|
||||
}
|
||||
|
||||
// 处理导航跳转
|
||||
function handleNavigate(module: ModuleItem) {
|
||||
if (module.enabled === false) {
|
||||
@@ -657,7 +693,7 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.module-card {
|
||||
height: 180px;
|
||||
min-height: 180px;
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 30px;
|
||||
@@ -683,9 +719,17 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.card-title {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: @text-main;
|
||||
|
||||
.lock-badge {
|
||||
font-size: 14px;
|
||||
color: #c0c4cc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -708,6 +752,79 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
|
||||
.card-lock-tip {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
margin-top: 12px;
|
||||
font-size: 12px;
|
||||
color: #c0c4cc;
|
||||
|
||||
.buy-btn {
|
||||
flex-shrink: 0;
|
||||
padding: 2px 10px;
|
||||
border: 1px solid #3973ff;
|
||||
border-radius: 12px;
|
||||
color: #3973ff;
|
||||
font-size: 12px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: #3973ff;
|
||||
border-color: #3973ff;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 套餐未开通模块:置灰 + 禁止点击效果
|
||||
&.is-locked {
|
||||
background: #fafafa;
|
||||
border-style: dashed;
|
||||
border-color: #dcdfe6;
|
||||
box-shadow: none;
|
||||
cursor: not-allowed;
|
||||
filter: grayscale(1);
|
||||
opacity: 0.8;
|
||||
|
||||
.card-title {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.card-desc {
|
||||
color: #a8abb2;
|
||||
}
|
||||
|
||||
.card-icon-wrapper {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
|
||||
.card-divider {
|
||||
border-color: #e4e7ed;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
transform: none;
|
||||
background: #fafafa;
|
||||
box-shadow: none;
|
||||
|
||||
.card-title,
|
||||
.card-desc {
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.card-icon-wrapper {
|
||||
color: #c0c4cc;
|
||||
}
|
||||
|
||||
.card-divider {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 8px 24px rgba(102, 126, 234, 0.15);
|
||||
@@ -1140,6 +1257,19 @@ onMounted(() => {
|
||||
.modules-section .module-card .card-desc {
|
||||
color: #8c8c8c !important;
|
||||
}
|
||||
|
||||
.modules-section .module-card.is-locked {
|
||||
background: #1f1f1f;
|
||||
|
||||
.card-title {
|
||||
color: #8c8c8c !important;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.card-desc {
|
||||
color: #6b6b6b !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
<template>
|
||||
<div class="locked-container">
|
||||
<div class="locked-content">
|
||||
<div class="locked-icon">
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
</div>
|
||||
<div class="locked-message">功能未开通</div>
|
||||
<div class="locked-desc">
|
||||
当前套餐未包含<template v-if="moduleName">「{{ moduleName }}」</template>功能模块,请联系管理员升级套餐后使用。
|
||||
</div>
|
||||
<div class="locked-actions">
|
||||
<a href="javascript:void(0)" class="back-home-btn" @click.prevent="backToHome">返回首页</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const moduleName = computed(() => route.meta?.title || "");
|
||||
|
||||
const backToHome = () => {
|
||||
router.push("/home");
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.locked-container {
|
||||
min-height: 100%;
|
||||
background: linear-gradient(120deg, #e0e7ff 0%, #fce7f3 100%);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.locked-content {
|
||||
background: #fff;
|
||||
padding: 48px 48px 40px;
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
|
||||
text-align: center;
|
||||
max-width: 460px;
|
||||
animation: float-in 0.6s cubic-bezier(0.7, 0.13, 0.45, 0.81) both;
|
||||
}
|
||||
|
||||
.locked-icon {
|
||||
width: 88px;
|
||||
height: 88px;
|
||||
margin: 0 auto 20px;
|
||||
border-radius: 50%;
|
||||
background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 36px;
|
||||
color: #f59e0b;
|
||||
}
|
||||
|
||||
.locked-message {
|
||||
font-size: 24px;
|
||||
color: #222;
|
||||
margin-bottom: 10px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.locked-desc {
|
||||
font-size: 15px;
|
||||
color: #888;
|
||||
margin-bottom: 28px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.locked-actions {
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.back-home-btn {
|
||||
display: inline-block;
|
||||
background: linear-gradient(90deg, #3973ff 0%, #6a82fb 100%);
|
||||
color: #fff;
|
||||
padding: 10px 36px;
|
||||
border-radius: 24px;
|
||||
font-size: 15px;
|
||||
text-decoration: none;
|
||||
font-weight: 500;
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
|
||||
.back-home-btn:hover {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
@keyframes float-in {
|
||||
0% {
|
||||
transform: translateY(30px) scale(0.97);
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
transform: translateY(0) scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,585 @@
|
||||
<template>
|
||||
<div class="product-page">
|
||||
<!-- 顶部栏 -->
|
||||
<div class="page-top">
|
||||
<div class="toolbar">
|
||||
<div class="toolbar-left">
|
||||
<el-button link class="back-btn" @click="goHome">
|
||||
<el-icon><ArrowLeft /></el-icon>
|
||||
返回
|
||||
</el-button>
|
||||
<span v-if="tenantName" class="tenant-name">
|
||||
<el-icon><OfficeBuilding /></el-icon>
|
||||
{{ tenantName }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="toolbar-right">
|
||||
<el-button link @click="ordersVisible = true">我的订单</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="page-body">
|
||||
<el-skeleton v-if="loading" :rows="8" animated />
|
||||
|
||||
<div v-else-if="!product" class="empty-state">
|
||||
<el-icon :size="64"><Box /></el-icon>
|
||||
<p class="empty-text">该产品暂未发布定价</p>
|
||||
<p class="empty-tip">请联系平台管理员配置产品与价格后购买</p>
|
||||
<el-button type="primary" @click="goHome">返回首页</el-button>
|
||||
</div>
|
||||
|
||||
<template v-else>
|
||||
<!-- 产品头部 -->
|
||||
<section class="hero">
|
||||
<div class="hero-main">
|
||||
<h1 class="hero-title">{{ product.name }}</h1>
|
||||
<p class="hero-code">产品编码:{{ product.code }}</p>
|
||||
</div>
|
||||
<div class="hero-price">
|
||||
<span class="price-symbol">¥</span>
|
||||
<span class="price-value">{{ Number(product.price || 0).toFixed(2) }}</span>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 功能节点树 -->
|
||||
<section v-if="featureTree.length > 0" class="section">
|
||||
<h2 class="section-title">功能清单</h2>
|
||||
<div class="feature-box">
|
||||
<el-tree
|
||||
:data="featureTree"
|
||||
:props="{ label: 'title', children: 'children' }"
|
||||
node-key="key"
|
||||
default-expand-all
|
||||
>
|
||||
<template #default="{ data }">
|
||||
<div class="tree-node">
|
||||
<span class="node-title">{{ data.title }}</span>
|
||||
<span v-if="data.description" class="node-desc">{{ data.description }}</span>
|
||||
</div>
|
||||
</template>
|
||||
</el-tree>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 结算区 -->
|
||||
<section class="section">
|
||||
<div class="checkout">
|
||||
<div class="checkout-info">
|
||||
<span class="checkout-label">应付金额:</span>
|
||||
<span class="checkout-amount">¥{{ Number(product.price || 0).toFixed(2) }}</span>
|
||||
</div>
|
||||
<div v-if="channels.length > 0" class="checkout-pay">
|
||||
<span class="checkout-label">支付方式:</span>
|
||||
<el-radio-group v-model="channel">
|
||||
<el-radio v-for="c in channels" :key="c.channel" :value="c.channel">
|
||||
{{ c.name || c.channel }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<el-button type="primary" size="large" :loading="submitting" @click="handleBuy">
|
||||
立即购买
|
||||
</el-button>
|
||||
</div>
|
||||
<p v-if="channels.length === 0" class="checkout-tip">
|
||||
平台暂未配置在线支付渠道,点击「立即购买」将提交购买申请,由平台确认后开通。
|
||||
</p>
|
||||
</section>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
<!-- 支付弹窗 -->
|
||||
<el-dialog v-model="payVisible" title="扫码支付" width="420px" :close-on-click-modal="false">
|
||||
<div v-if="payParams?.code_url" class="pay-body">
|
||||
<canvas ref="qrRef" class="pay-qr"></canvas>
|
||||
<p class="pay-tip">请使用{{ currentChannelName }}扫码支付</p>
|
||||
<p class="pay-amount">¥{{ Number(product?.price || 0).toFixed(2) }}</p>
|
||||
</div>
|
||||
<div v-else-if="payParams?.redirect_url" class="pay-body">
|
||||
<p class="pay-tip">正在跳转{{ currentChannelName }}收银台…</p>
|
||||
<el-button type="primary" @click="openPayUrl(payParams.redirect_url)">重新打开支付页</el-button>
|
||||
</div>
|
||||
<div v-else class="pay-body">
|
||||
<el-icon :size="48" color="#67c23a"><CircleCheckFilled /></el-icon>
|
||||
<p class="pay-tip">购买申请已提交,请等待平台确认开通</p>
|
||||
</div>
|
||||
<p class="pay-status">{{ payStatusText }}</p>
|
||||
<template #footer>
|
||||
<el-button @click="handleCancelPay">取消支付</el-button>
|
||||
<el-button type="primary" :loading="checking" @click="checkOrder">我已完成支付</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 我的订单 -->
|
||||
<el-dialog v-model="ordersVisible" title="我的订单" width="720px">
|
||||
<el-table :data="myOrders" size="small" v-loading="ordersLoading">
|
||||
<el-table-column prop="order_no" label="订单号" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="product_name" label="产品" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column label="金额" width="100" align="center">
|
||||
<template #default="{ row }">¥{{ Number(row.amount || 0).toFixed(2) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="100" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="orderStatusType(row.status)" size="small">
|
||||
{{ orderStatusText(row.status) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="下单时间" width="170" align="center" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, ref, watch, nextTick } from "vue";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { ArrowLeft, OfficeBuilding, Box, CircleCheckFilled } from "@element-plus/icons-vue";
|
||||
import QRCode from "qrcode";
|
||||
import {
|
||||
getProductDetailByCode,
|
||||
createProductOrder,
|
||||
getProductOrderStatus,
|
||||
getMyProductOrders,
|
||||
getPaymentChannels,
|
||||
} from "@/api/product";
|
||||
import { useAuthStore } from "@/stores/auth";
|
||||
|
||||
interface FeatureNode {
|
||||
key: number;
|
||||
title: string;
|
||||
description: string;
|
||||
children?: FeatureNode[];
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
|
||||
const loading = ref(false);
|
||||
const product = ref<any>(null);
|
||||
const channels = ref<any[]>([]);
|
||||
const channel = ref("");
|
||||
const submitting = ref(false);
|
||||
|
||||
const payVisible = ref(false);
|
||||
const payParams = ref<any>(null);
|
||||
const orderNo = ref("");
|
||||
const checking = ref(false);
|
||||
const payStatusText = ref("");
|
||||
const qrRef = ref<HTMLCanvasElement | null>(null);
|
||||
let pollTimer: any = null;
|
||||
|
||||
const ordersVisible = ref(false);
|
||||
const myOrders = ref<any[]>([]);
|
||||
const ordersLoading = ref(false);
|
||||
|
||||
const tenantName = computed(() => authStore.user?.tenant_name || "");
|
||||
|
||||
/** 扁平功能节点 -> 树 */
|
||||
const featureTree = computed<FeatureNode[]>(() => {
|
||||
const list: any[] = product.value?.features || [];
|
||||
const map = new Map<number, FeatureNode>();
|
||||
const roots: FeatureNode[] = [];
|
||||
list.forEach((f) =>
|
||||
map.set(Number(f.id), {
|
||||
key: Number(f.id),
|
||||
title: f.title || "",
|
||||
description: f.description || "",
|
||||
children: [],
|
||||
})
|
||||
);
|
||||
list.forEach((f) => {
|
||||
const node = map.get(Number(f.id))!;
|
||||
const parent = f.pid ? map.get(Number(f.pid)) : undefined;
|
||||
if (parent) parent.children!.push(node);
|
||||
else roots.push(node);
|
||||
});
|
||||
return roots;
|
||||
});
|
||||
|
||||
const currentChannelName = computed(() => {
|
||||
const c = channels.value.find((x) => x.channel === channel.value);
|
||||
return c?.name || channel.value;
|
||||
});
|
||||
|
||||
const orderStatusText = (s: string) =>
|
||||
({ pending: "待支付", paid: "已支付", activated: "已开通", closed: "已关闭" }[s] || s);
|
||||
const orderStatusType = (s: string) =>
|
||||
({ pending: "warning", paid: "primary", activated: "success", closed: "info" }[s] || "info");
|
||||
|
||||
const goHome = () => router.push("/home");
|
||||
|
||||
const loadProduct = async () => {
|
||||
const code = String(route.params.code || "").trim();
|
||||
if (!code) {
|
||||
product.value = null;
|
||||
return;
|
||||
}
|
||||
loading.value = true;
|
||||
try {
|
||||
const res = await getProductDetailByCode(code);
|
||||
product.value = res.code === 200 && res.data ? res.data : null;
|
||||
} catch {
|
||||
product.value = null;
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const loadChannels = async () => {
|
||||
try {
|
||||
const res = await getPaymentChannels();
|
||||
if (res.code === 200) {
|
||||
channels.value = res.data?.list || [];
|
||||
if (channels.value.length > 0) channel.value = channels.value[0].channel;
|
||||
}
|
||||
} catch {
|
||||
channels.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
const openPayUrl = (url: string) => {
|
||||
if (url) window.open(url, "_blank", "noopener,noreferrer");
|
||||
};
|
||||
|
||||
const renderQR = async () => {
|
||||
if (!payParams.value?.code_url) return;
|
||||
await nextTick();
|
||||
if (!qrRef.value) return;
|
||||
try {
|
||||
await QRCode.toCanvas(qrRef.value, payParams.value.code_url, { width: 200, margin: 1 });
|
||||
} catch (e) {
|
||||
console.error("二维码生成失败:", e);
|
||||
}
|
||||
};
|
||||
|
||||
const handleBuy = async () => {
|
||||
if (!product.value) return;
|
||||
submitting.value = true;
|
||||
try {
|
||||
const res = await createProductOrder({
|
||||
product_code: product.value.code,
|
||||
channel: channels.value.length > 0 ? channel.value : "",
|
||||
pay_type: "",
|
||||
});
|
||||
if (res.code !== 200) {
|
||||
ElMessage.error(res.msg || "下单失败");
|
||||
return;
|
||||
}
|
||||
orderNo.value = res.data?.order_no || "";
|
||||
payParams.value = res.data?.pay_params || null;
|
||||
payStatusText.value = res.data?.offline
|
||||
? "购买申请已提交,请等待平台确认开通"
|
||||
: "请在有效期内完成支付,支付成功后由平台开通功能";
|
||||
payVisible.value = true;
|
||||
await renderQR();
|
||||
if (payParams.value?.redirect_url) openPayUrl(payParams.value.redirect_url);
|
||||
if (!res.data?.offline) startPolling();
|
||||
} catch (e: any) {
|
||||
ElMessage.error(e?.message || "下单失败");
|
||||
} finally {
|
||||
submitting.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const startPolling = () => {
|
||||
stopPolling();
|
||||
pollTimer = setInterval(() => checkOrder(true), 5000);
|
||||
};
|
||||
|
||||
const stopPolling = () => {
|
||||
if (pollTimer) {
|
||||
clearInterval(pollTimer);
|
||||
pollTimer = null;
|
||||
}
|
||||
};
|
||||
|
||||
const checkOrder = async (silent = false) => {
|
||||
if (!orderNo.value) return;
|
||||
checking.value = true;
|
||||
try {
|
||||
const res = await getProductOrderStatus(orderNo.value);
|
||||
if (res.code === 200 && res.data) {
|
||||
const status = res.data.status;
|
||||
if (status === "activated") {
|
||||
stopPolling();
|
||||
ElMessage.success("购买成功,功能已开通");
|
||||
payVisible.value = false;
|
||||
loadMyOrders();
|
||||
return;
|
||||
}
|
||||
if (status === "paid") {
|
||||
payStatusText.value = "已支付,等待平台开通…";
|
||||
return;
|
||||
}
|
||||
payStatusText.value = silent
|
||||
? payStatusText.value || "等待支付…"
|
||||
: "尚未检测到支付成功,请确认已完成支付";
|
||||
if (!silent) ElMessage.info("尚未检测到支付成功");
|
||||
}
|
||||
} catch {
|
||||
if (!silent) ElMessage.error("查询订单失败");
|
||||
} finally {
|
||||
checking.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const handleCancelPay = () => {
|
||||
stopPolling();
|
||||
payVisible.value = false;
|
||||
ElMessage.info("已取消,订单仍可在「我的订单」中查看");
|
||||
};
|
||||
|
||||
const loadMyOrders = async () => {
|
||||
ordersLoading.value = true;
|
||||
try {
|
||||
const res = await getMyProductOrders();
|
||||
if (res.code === 200) myOrders.value = res.data?.list || [];
|
||||
} catch {
|
||||
myOrders.value = [];
|
||||
} finally {
|
||||
ordersLoading.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
watch(ordersVisible, (v) => {
|
||||
if (v) loadMyOrders();
|
||||
});
|
||||
|
||||
watch(payVisible, (v) => {
|
||||
if (!v) stopPolling();
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
loadProduct();
|
||||
loadChannels();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="less">
|
||||
.product-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.page-top {
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
|
||||
.toolbar {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 10px 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.toolbar-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
|
||||
.tenant-name {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.page-body {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.hero {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
border-radius: 14px;
|
||||
padding: 28px;
|
||||
color: #fff;
|
||||
|
||||
.hero-title {
|
||||
margin: 0 0 8px;
|
||||
font-size: 26px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hero-code {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.hero-price {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 2px;
|
||||
|
||||
.price-symbol {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.price-value {
|
||||
font-size: 34px;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-top: 28px;
|
||||
|
||||
.section-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #1a1a2e;
|
||||
margin: 0 0 16px;
|
||||
padding-left: 8px;
|
||||
border-left: 4px solid #667eea;
|
||||
}
|
||||
}
|
||||
|
||||
.feature-box {
|
||||
background: #fff;
|
||||
border-radius: 10px;
|
||||
border: 1px solid #ebeef5;
|
||||
padding: 16px 18px;
|
||||
|
||||
.tree-node {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 10px;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.node-title {
|
||||
font-size: 14px;
|
||||
color: #1a1a2e;
|
||||
}
|
||||
|
||||
.node-desc {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.checkout {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
flex-wrap: wrap;
|
||||
background: #fff;
|
||||
border-radius: 12px;
|
||||
padding: 18px 22px;
|
||||
border: 1px solid #ebeef5;
|
||||
|
||||
.checkout-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
|
||||
.checkout-amount {
|
||||
color: #f56c6c;
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
|
||||
.checkout-pay {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.checkout-label {
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.checkout-tip {
|
||||
margin: 10px 0 0;
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.pay-body {
|
||||
text-align: center;
|
||||
|
||||
.pay-qr {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
|
||||
.pay-tip {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
margin: 12px 0 4px;
|
||||
}
|
||||
|
||||
.pay-amount {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: #f56c6c;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.pay-status {
|
||||
text-align: center;
|
||||
font-size: 13px;
|
||||
color: #909399;
|
||||
margin: 10px 0 0;
|
||||
}
|
||||
|
||||
.empty-state {
|
||||
text-align: center;
|
||||
padding: 80px 20px;
|
||||
color: #c0c4cc;
|
||||
|
||||
.empty-text {
|
||||
font-size: 18px;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.empty-tip {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.page-body {
|
||||
padding: 16px 12px;
|
||||
}
|
||||
|
||||
.hero {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.checkout {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user