Compare commits

..

16 Commits

Author SHA1 Message Date
Dawn_Ocean 54091bb6b3 merging 2024-03-06 21:49:35 +08:00
Dawn_Ocean 098ddd3c13 Merge branch 'dev' into yhy 2024-03-06 21:45:28 +08:00
Dawn_Ocean 64e4b8d6bd fix unused components 2024-03-06 21:44:45 +08:00
FrozenArcher 349f125404 update duty info card 2024-03-06 20:57:52 +08:00
FrozenArcher d9d005986e refactor main page 2024-03-06 19:45:30 +08:00
FrozenArcher 7cd56d7c79 move card text to PlainText 2024-03-06 15:53:13 +08:00
FrozenArcher ff880de466 dutycard add data 2024-03-06 15:13:35 +08:00
FrozenArcher 11f16b6b06 remove format for project config
remove format for project config
2024-03-06 14:11:30 +08:00
FrozenArcher 5f2e66546c add request support 2024-03-06 14:04:17 +08:00
FrozenArcher 20b9016f51 change main page layout 2024-03-06 00:14:23 +08:00
FrozenArcher 08401dd64d add global plain text to main page 2024-03-06 00:02:41 +08:00
FrozenArcher a9d9415def add global plain text 2024-03-06 00:02:00 +08:00
Dawn_Ocean 0841fc91fc add userinfo page 2024-03-05 21:57:54 +08:00
FrozenArcher 83d2e8419e update main page 2024-03-05 19:56:13 +08:00
FrozenArcher eb7623917c add PageFooter 2024-03-05 19:50:57 +08:00
FrozenArcher f0fe2f6abf add main page items 2024-03-05 17:04:51 +08:00
21 changed files with 570 additions and 32 deletions

View File

@ -1,2 +1,4 @@
# 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config # 配置文档参考 https://taro-docs.jd.com/docs/next/env-mode-config
TARO_APP_ID="wx636eb7cf2b84f305" TARO_APP_ID="wx636eb7cf2b84f305"
TARO_APP_API="http://127.0.0.1:9527"
TARO_APP_API_OREO="http://127.0.0.1:9527"

View File

@ -1 +1,3 @@
TARO_APP_ID="wx636eb7cf2b84f305" TARO_APP_ID="wx636eb7cf2b84f305"
TARO_APP_API=""
TARO_APP_API_OREO=""

View File

@ -9,3 +9,8 @@ node_modules/
.husky .husky
.prettierignore .prettierignore
.env.* .env.*
<<<<<<< HEAD
project.*.json
=======
**/*.svg
>>>>>>> dev

View File

@ -1,5 +1,8 @@
export default { export default {
'GET /api/user/1': {}, 'GET /testdata': {
success: true,
'POST /api/upload': {}, data: {
test: 'test',
},
},
}; };

74
package-lock.json generated
View File

@ -12,7 +12,6 @@
"@tarojs/components": "3.6.24", "@tarojs/components": "3.6.24",
"@tarojs/helper": "3.6.24", "@tarojs/helper": "3.6.24",
"@tarojs/plugin-framework-react": "3.6.24", "@tarojs/plugin-framework-react": "3.6.24",
"@tarojs/plugin-mock": "^0.0.9",
"@tarojs/plugin-platform-alipay": "3.6.24", "@tarojs/plugin-platform-alipay": "3.6.24",
"@tarojs/plugin-platform-harmony-hybrid": "3.6.24", "@tarojs/plugin-platform-harmony-hybrid": "3.6.24",
"@tarojs/plugin-platform-jd": "3.6.24", "@tarojs/plugin-platform-jd": "3.6.24",
@ -24,6 +23,7 @@
"@tarojs/runtime": "3.6.24", "@tarojs/runtime": "3.6.24",
"@tarojs/shared": "3.6.24", "@tarojs/shared": "3.6.24",
"@tarojs/taro": "3.6.24", "@tarojs/taro": "3.6.24",
"process": "^0.11.10",
"react": "^18.0.0", "react": "^18.0.0",
"react-dom": "^18.0.0", "react-dom": "^18.0.0",
"taro-ui": "^3.3.0" "taro-ui": "^3.3.0"
@ -32,6 +32,7 @@
"@babel/core": "^7.8.0", "@babel/core": "^7.8.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
"@tarojs/cli": "3.6.24", "@tarojs/cli": "3.6.24",
"@tarojs/plugin-mock": "^0.0.9",
"@tarojs/plugin-platform-h5": "^3.6.24", "@tarojs/plugin-platform-h5": "^3.6.24",
"@tarojs/taro-loader": "3.6.24", "@tarojs/taro-loader": "3.6.24",
"@tarojs/test-utils-react": "^0.1.1", "@tarojs/test-utils-react": "^0.1.1",
@ -54,6 +55,7 @@
"jest": "^29.3.1", "jest": "^29.3.1",
"jest-environment-jsdom": "^29.5.0", "jest-environment-jsdom": "^29.5.0",
"lint-staged": "^15.2.2", "lint-staged": "^15.2.2",
"mockjs": "^1.1.0",
"postcss": "^8.4.18", "postcss": "^8.4.18",
"react-refresh": "^0.11.0", "react-refresh": "^0.11.0",
"stylelint": "^14.4.0", "stylelint": "^14.4.0",
@ -8842,6 +8844,7 @@
"version": "0.0.9", "version": "0.0.9",
"resolved": "https://registry.npmmirror.com/@tarojs/plugin-mock/-/plugin-mock-0.0.9.tgz", "resolved": "https://registry.npmmirror.com/@tarojs/plugin-mock/-/plugin-mock-0.0.9.tgz",
"integrity": "sha512-Q4z4lHp2mHVByQJ8gtIq0Rct8vkEqvCmyTmv+EJNf9sJY3F5H1fmDNfgMVn2fyZj7TmxuSMq/FDtgNlEA4eTow==", "integrity": "sha512-Q4z4lHp2mHVByQJ8gtIq0Rct8vkEqvCmyTmv+EJNf9sJY3F5H1fmDNfgMVn2fyZj7TmxuSMq/FDtgNlEA4eTow==",
"dev": true,
"dependencies": { "dependencies": {
"body-parser": "^1.19.0", "body-parser": "^1.19.0",
"cors": "^2.8.5", "cors": "^2.8.5",
@ -8856,17 +8859,16 @@
"version": "5.1.1", "version": "5.1.1",
"resolved": "https://registry.npmmirror.com/get-port/-/get-port-5.1.1.tgz", "resolved": "https://registry.npmmirror.com/get-port/-/get-port-5.1.1.tgz",
"integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==", "integrity": "sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ==",
"dev": true,
"engines": { "engines": {
"node": ">=8" "node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/@tarojs/plugin-mock/node_modules/http-proxy-middleware": { "node_modules/@tarojs/plugin-mock/node_modules/http-proxy-middleware": {
"version": "1.3.1", "version": "1.3.1",
"resolved": "https://registry.npmmirror.com/http-proxy-middleware/-/http-proxy-middleware-1.3.1.tgz", "resolved": "https://registry.npmmirror.com/http-proxy-middleware/-/http-proxy-middleware-1.3.1.tgz",
"integrity": "sha512-13eVVDYS4z79w7f1+NPllJtOQFx/FdUW4btIvVRMaRlUY9VGstAbo5MOhLEuUgZFRHn3x50ufn25zkj/boZnEg==", "integrity": "sha512-13eVVDYS4z79w7f1+NPllJtOQFx/FdUW4btIvVRMaRlUY9VGstAbo5MOhLEuUgZFRHn3x50ufn25zkj/boZnEg==",
"dev": true,
"dependencies": { "dependencies": {
"@types/http-proxy": "^1.17.5", "@types/http-proxy": "^1.17.5",
"http-proxy": "^1.18.1", "http-proxy": "^1.18.1",
@ -8882,17 +8884,16 @@
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmmirror.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz", "resolved": "https://registry.npmmirror.com/is-plain-obj/-/is-plain-obj-3.0.0.tgz",
"integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==", "integrity": "sha512-gwsOE28k+23GP1B6vFl1oVh/WOzmawBrKwo5Ev6wMKzPkaXaCDIQKzLnvsA42DRlbVTWorkgTKIviAKCWkfUwA==",
"dev": true,
"engines": { "engines": {
"node": ">=10" "node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/@tarojs/plugin-mock/node_modules/path-to-regexp": { "node_modules/@tarojs/plugin-mock/node_modules/path-to-regexp": {
"version": "6.2.1", "version": "6.2.1",
"resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-6.2.1.tgz", "resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-6.2.1.tgz",
"integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==" "integrity": "sha512-JLyh7xT1kizaEvcaXOQwOc2/Yhw6KZOvPf1S8401UyLk86CU79LN3vl7ztXGm/pZ+YjoyAJ4rxmHwbkBXJX+yw==",
"dev": true
}, },
"node_modules/@tarojs/plugin-platform-alipay": { "node_modules/@tarojs/plugin-platform-alipay": {
"version": "3.6.24", "version": "3.6.24",
@ -9694,6 +9695,7 @@
"version": "1.17.14", "version": "1.17.14",
"resolved": "https://registry.npmmirror.com/@types/http-proxy/-/http-proxy-1.17.14.tgz", "resolved": "https://registry.npmmirror.com/@types/http-proxy/-/http-proxy-1.17.14.tgz",
"integrity": "sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==", "integrity": "sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==",
"dev": true,
"dependencies": { "dependencies": {
"@types/node": "*" "@types/node": "*"
} }
@ -11062,7 +11064,8 @@
"node_modules/array-flatten": { "node_modules/array-flatten": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmmirror.com/array-flatten/-/array-flatten-1.1.1.tgz", "resolved": "https://registry.npmmirror.com/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==" "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==",
"dev": true
}, },
"node_modules/array-includes": { "node_modules/array-includes": {
"version": "3.1.7", "version": "3.1.7",
@ -13628,6 +13631,7 @@
"version": "0.5.4", "version": "0.5.4",
"resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-0.5.4.tgz", "resolved": "https://registry.npmmirror.com/content-disposition/-/content-disposition-0.5.4.tgz",
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
"dev": true,
"dependencies": { "dependencies": {
"safe-buffer": "5.2.1" "safe-buffer": "5.2.1"
}, },
@ -13652,6 +13656,7 @@
"version": "0.5.0", "version": "0.5.0",
"resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.5.0.tgz", "resolved": "https://registry.npmmirror.com/cookie/-/cookie-0.5.0.tgz",
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==", "integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
@ -13659,7 +13664,8 @@
"node_modules/cookie-signature": { "node_modules/cookie-signature": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.0.6.tgz", "resolved": "https://registry.npmmirror.com/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==" "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==",
"dev": true
}, },
"node_modules/copy-anything": { "node_modules/copy-anything": {
"version": "2.0.6", "version": "2.0.6",
@ -13858,6 +13864,7 @@
"version": "2.8.5", "version": "2.8.5",
"resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.5.tgz", "resolved": "https://registry.npmmirror.com/cors/-/cors-2.8.5.tgz",
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
"dev": true,
"dependencies": { "dependencies": {
"object-assign": "^4", "object-assign": "^4",
"vary": "^1" "vary": "^1"
@ -16697,7 +16704,8 @@
"node_modules/eventemitter3": { "node_modules/eventemitter3": {
"version": "4.0.7", "version": "4.0.7",
"resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-4.0.7.tgz", "resolved": "https://registry.npmmirror.com/eventemitter3/-/eventemitter3-4.0.7.tgz",
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
"dev": true
}, },
"node_modules/events": { "node_modules/events": {
"version": "3.3.0", "version": "3.3.0",
@ -17426,6 +17434,7 @@
"version": "4.18.3", "version": "4.18.3",
"resolved": "https://registry.npmmirror.com/express/-/express-4.18.3.tgz", "resolved": "https://registry.npmmirror.com/express/-/express-4.18.3.tgz",
"integrity": "sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==", "integrity": "sha512-6VyCijWQ+9O7WuVMTRBTl+cjNNIzD5cY5mQ1WM8r/LEkI2u8EYpOotESNwzNlyCn3g+dmjKYI6BmNneSr/FSRw==",
"dev": true,
"dependencies": { "dependencies": {
"accepts": "~1.3.8", "accepts": "~1.3.8",
"array-flatten": "1.1.1", "array-flatten": "1.1.1",
@ -17467,6 +17476,7 @@
"version": "2.6.9", "version": "2.6.9",
"resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"dependencies": { "dependencies": {
"ms": "2.0.0" "ms": "2.0.0"
} }
@ -17474,17 +17484,20 @@
"node_modules/express/node_modules/ms": { "node_modules/express/node_modules/ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"dev": true
}, },
"node_modules/express/node_modules/path-to-regexp": { "node_modules/express/node_modules/path-to-regexp": {
"version": "0.1.7", "version": "0.1.7",
"resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz", "resolved": "https://registry.npmmirror.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==" "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==",
"dev": true
}, },
"node_modules/express/node_modules/qs": { "node_modules/express/node_modules/qs": {
"version": "6.11.0", "version": "6.11.0",
"resolved": "https://registry.npmmirror.com/qs/-/qs-6.11.0.tgz", "resolved": "https://registry.npmmirror.com/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"dev": true,
"dependencies": { "dependencies": {
"side-channel": "^1.0.4" "side-channel": "^1.0.4"
}, },
@ -17865,6 +17878,7 @@
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-1.2.0.tgz", "resolved": "https://registry.npmmirror.com/finalhandler/-/finalhandler-1.2.0.tgz",
"integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
"dev": true,
"dependencies": { "dependencies": {
"debug": "2.6.9", "debug": "2.6.9",
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
@ -17882,6 +17896,7 @@
"version": "2.6.9", "version": "2.6.9",
"resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz", "resolved": "https://registry.npmmirror.com/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"dependencies": { "dependencies": {
"ms": "2.0.0" "ms": "2.0.0"
} }
@ -17889,7 +17904,8 @@
"node_modules/finalhandler/node_modules/ms": { "node_modules/finalhandler/node_modules/ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmmirror.com/ms/-/ms-2.0.0.tgz",
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
"dev": true
}, },
"node_modules/find-babel-config": { "node_modules/find-babel-config": {
"version": "1.2.0", "version": "1.2.0",
@ -18095,6 +18111,7 @@
"version": "1.15.5", "version": "1.15.5",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.5.tgz", "resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.5.tgz",
"integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==", "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==",
"dev": true,
"funding": [ "funding": [
{ {
"type": "individual", "type": "individual",
@ -18187,6 +18204,7 @@
"version": "0.2.0", "version": "0.2.0",
"resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz", "resolved": "https://registry.npmmirror.com/forwarded/-/forwarded-0.2.0.tgz",
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
@ -19358,6 +19376,7 @@
"version": "1.18.1", "version": "1.18.1",
"resolved": "https://registry.npmmirror.com/http-proxy/-/http-proxy-1.18.1.tgz", "resolved": "https://registry.npmmirror.com/http-proxy/-/http-proxy-1.18.1.tgz",
"integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==",
"dev": true,
"dependencies": { "dependencies": {
"eventemitter3": "^4.0.0", "eventemitter3": "^4.0.0",
"follow-redirects": "^1.0.0", "follow-redirects": "^1.0.0",
@ -24533,7 +24552,8 @@
"node_modules/merge-descriptors": { "node_modules/merge-descriptors": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "resolved": "https://registry.npmmirror.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==" "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==",
"dev": true
}, },
"node_modules/merge-options": { "node_modules/merge-options": {
"version": "3.0.4", "version": "3.0.4",
@ -24591,6 +24611,7 @@
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmmirror.com/methods/-/methods-1.1.2.tgz", "resolved": "https://registry.npmmirror.com/methods/-/methods-1.1.2.tgz",
"integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.6" "node": ">= 0.6"
} }
@ -26347,6 +26368,18 @@
"resolved": "https://registry.npmmirror.com/mobile-detect/-/mobile-detect-1.4.5.tgz", "resolved": "https://registry.npmmirror.com/mobile-detect/-/mobile-detect-1.4.5.tgz",
"integrity": "sha512-yc0LhH6tItlvfLBugVUEtgawwFU2sIe+cSdmRJJCTMZ5GEJyLxNyC/NIOAOGk67Fa8GNpOttO3Xz/1bHpXFD/g==" "integrity": "sha512-yc0LhH6tItlvfLBugVUEtgawwFU2sIe+cSdmRJJCTMZ5GEJyLxNyC/NIOAOGk67Fa8GNpOttO3Xz/1bHpXFD/g=="
}, },
"node_modules/mockjs": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/mockjs/-/mockjs-1.1.0.tgz",
"integrity": "sha512-eQsKcWzIaZzEZ07NuEyO4Nw65g0hdWAyurVol1IPl1gahRwY+svqzfgfey8U8dahLwG44d6/RwEzuK52rSa/JQ==",
"dev": true,
"dependencies": {
"commander": "*"
},
"bin": {
"random": "bin/random"
}
},
"node_modules/ms": { "node_modules/ms": {
"version": "2.1.2", "version": "2.1.2",
"resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz", "resolved": "https://registry.npmmirror.com/ms/-/ms-2.1.2.tgz",
@ -29237,6 +29270,14 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/process": {
"version": "0.11.10",
"resolved": "https://registry.npmmirror.com/process/-/process-0.11.10.tgz",
"integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
"engines": {
"node": ">= 0.6.0"
}
},
"node_modules/process-nextick-args": { "node_modules/process-nextick-args": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz", "resolved": "https://registry.npmmirror.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@ -29313,6 +29354,7 @@
"version": "2.0.7", "version": "2.0.7",
"resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz", "resolved": "https://registry.npmmirror.com/proxy-addr/-/proxy-addr-2.0.7.tgz",
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
"dev": true,
"dependencies": { "dependencies": {
"forwarded": "0.2.0", "forwarded": "0.2.0",
"ipaddr.js": "1.9.1" "ipaddr.js": "1.9.1"
@ -29325,6 +29367,7 @@
"version": "1.9.1", "version": "1.9.1",
"resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz", "resolved": "https://registry.npmmirror.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
"dev": true,
"engines": { "engines": {
"node": ">= 0.10" "node": ">= 0.10"
} }
@ -31170,6 +31213,7 @@
"version": "5.2.1", "version": "5.2.1",
"resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz", "resolved": "https://registry.npmmirror.com/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
"dev": true,
"funding": [ "funding": [
{ {
"type": "github", "type": "github",

View File

@ -20,7 +20,7 @@
"build:jd": "taro build --type jd", "build:jd": "taro build --type jd",
"build:quickapp": "taro build --type quickapp", "build:quickapp": "taro build --type quickapp",
"build:harmony-hybrid": "taro build --type harmony-hybrid", "build:harmony-hybrid": "taro build --type harmony-hybrid",
"dev:weapp": "npm run build:weapp -- --watch", "dev:weapp": "npm run build:weapp -- --watch --mode dev",
"dev:swan": "npm run build:swan -- --watch", "dev:swan": "npm run build:swan -- --watch",
"dev:alipay": "npm run build:alipay -- --watch", "dev:alipay": "npm run build:alipay -- --watch",
"dev:tt": "npm run build:tt -- --watch", "dev:tt": "npm run build:tt -- --watch",
@ -44,7 +44,6 @@
"@tarojs/components": "3.6.24", "@tarojs/components": "3.6.24",
"@tarojs/helper": "3.6.24", "@tarojs/helper": "3.6.24",
"@tarojs/plugin-framework-react": "3.6.24", "@tarojs/plugin-framework-react": "3.6.24",
"@tarojs/plugin-mock": "^0.0.9",
"@tarojs/plugin-platform-alipay": "3.6.24", "@tarojs/plugin-platform-alipay": "3.6.24",
"@tarojs/plugin-platform-harmony-hybrid": "3.6.24", "@tarojs/plugin-platform-harmony-hybrid": "3.6.24",
"@tarojs/plugin-platform-jd": "3.6.24", "@tarojs/plugin-platform-jd": "3.6.24",
@ -56,6 +55,7 @@
"@tarojs/runtime": "3.6.24", "@tarojs/runtime": "3.6.24",
"@tarojs/shared": "3.6.24", "@tarojs/shared": "3.6.24",
"@tarojs/taro": "3.6.24", "@tarojs/taro": "3.6.24",
"process": "^0.11.10",
"react": "^18.0.0", "react": "^18.0.0",
"react-dom": "^18.0.0", "react-dom": "^18.0.0",
"taro-ui": "^3.3.0" "taro-ui": "^3.3.0"
@ -64,6 +64,7 @@
"@babel/core": "^7.8.0", "@babel/core": "^7.8.0",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.5", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.5",
"@tarojs/cli": "3.6.24", "@tarojs/cli": "3.6.24",
"@tarojs/plugin-mock": "^0.0.9",
"@tarojs/plugin-platform-h5": "^3.6.24", "@tarojs/plugin-platform-h5": "^3.6.24",
"@tarojs/taro-loader": "3.6.24", "@tarojs/taro-loader": "3.6.24",
"@tarojs/test-utils-react": "^0.1.1", "@tarojs/test-utils-react": "^0.1.1",
@ -86,6 +87,7 @@
"jest": "^29.3.1", "jest": "^29.3.1",
"jest-environment-jsdom": "^29.5.0", "jest-environment-jsdom": "^29.5.0",
"lint-staged": "^15.2.2", "lint-staged": "^15.2.2",
"mockjs": "^1.1.0",
"postcss": "^8.4.18", "postcss": "^8.4.18",
"react-refresh": "^0.11.0", "react-refresh": "^0.11.0",
"stylelint": "^14.4.0", "stylelint": "^14.4.0",

View File

@ -2,6 +2,7 @@
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "EVA-Notify", "projectname": "EVA-Notify",
"setting": { "setting": {
"compileHotReLoad": true "compileHotReLoad": true,
"urlCheck": false
} }
} }

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1709729147345" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7587" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M960 170.56L869.44 80 512 437.44 154.56 80 64 170.56 421.44 528 64 885.44l90.56 90.56L512 618.56 869.44 976 960 885.44 602.56 528 960 170.56z" p-id="7588" fill="#d4237a"></path></svg>

After

Width:  |  Height:  |  Size: 514 B

View File

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1709729289782" class="icon" viewBox="0 0 1418 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8708" width="44.3125" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M491.191709 1023.803077L0.136305 539.63733l111.888035-110.273886 379.167369 373.89186L1305.549204 0.433064 1417.437238 110.706951 491.191709 1023.803077z" p-id="8709" fill="#12c53d"></path></svg>

After

Width:  |  Height:  |  Size: 531 B

View File

@ -0,0 +1,3 @@
export default {
component: true,
};

View File

@ -0,0 +1,17 @@
import { View } from '@tarojs/components';
import { AtDivider } from 'taro-ui';
import pt from '@/plain-text';
export default () => {
const blankHeight = 120;
return (
<View>
<AtDivider
content={pt.get().pageFooter.dividerText}
fontColor='#dddddd'
lineColor='#dddddd'
/>
<View style={{ height: blankHeight }}></View>
</View>
);
};

View File

@ -0,0 +1,107 @@
import { Component, ReactNode } from 'react';
import { View, Image } from '@tarojs/components';
import { AtTimeline } from 'taro-ui';
import pt from '@/plain-text';
import tick from '@/assets/icons/MainPage/tick.svg';
import cross from '@/assets/icons/MainPage/cross.svg';
export class DutyData {
constructor() {
this.isInDuty = false;
this.inDutyCnt = 3;
this.currentDuty = '2';
this.offDutyReason = '学园维修';
this.dutyRecoverTime = '下周一';
}
isInDuty: boolean;
inDutyCnt: number;
currentDuty: 'off' | '1' | '2' | '3';
offDutyReason: string; // from backend
dutyRecoverTime: string; // from backend
}
class Card extends Component {
props = {
isInDuty: false,
};
render(): ReactNode {
const inDuty = this.props.isInDuty;
const dc = pt.get().mainPage.dutyCard;
const title = inDuty ? dc.inDuty.title : dc.offDuty.title;
const iconsrc = inDuty ? tick : cross;
return (
<View>
<View
style={{
display: 'flex',
alignItems: 'center',
marginBottom: 20,
}}
>
<Image
src={iconsrc}
style={{
width: 24,
height: 24,
}}
/>
<View
style={{
marginLeft: 10,
fontSize: 36,
}}
>
{title}
</View>
</View>
</View>
);
}
}
export class DutyInfo extends Component {
props = {
data: new DutyData(),
};
offDutyContent(): ReactNode {
const data = this.props.data;
const od = pt.get().mainPage.dutyCard.offDuty;
return (
<View>
<Card isInDuty={data.isInDuty} />
<AtTimeline
items={[
{ title: od.reason(data.offDutyReason) },
{ title: od.recoverTime(data.dutyRecoverTime) },
]}
/>
</View>
);
}
inDutyContent(): ReactNode {
const data = this.props.data;
const id = pt.get().mainPage.dutyCard.inDuty;
return (
<View>
<Card isInDuty={data.isInDuty} />
<AtTimeline
items={[
{ title: id.currentDutyText(data.currentDuty) },
{ title: id.inDutyCnt(data.inDutyCnt) },
]}
/>
</View>
);
}
render(): ReactNode {
if (this.props.data.isInDuty) {
return this.inDutyContent();
} else {
return this.offDutyContent();
}
}
}

View File

@ -0,0 +1,24 @@
import { Component, ReactNode } from 'react';
import { View } from '@tarojs/components';
import { AtTimeline } from 'taro-ui';
import pt from '@/plain-text';
export class StepInfo extends Component {
render(): ReactNode {
return (
<View>
<AtTimeline items={pt.get().mainPage.stepList}></AtTimeline>
</View>
);
}
}
export class TipsInfo extends Component {
render(): ReactNode {
return (
<View>
<AtTimeline items={pt.get().mainPage.tipsList}></AtTimeline>
</View>
);
}
}

View File

@ -0,0 +1,15 @@
import React from 'react';
import { View } from '@tarojs/components';
import pt from '@/plain-text';
export default class TitleCard extends React.Component {
render(): React.ReactNode {
const mainPage = pt.get().mainPage;
return (
<View className='page-title'>
<View className='at-article__h1'>{mainPage.mainTitleLine}</View>
<View className='at-article__h2'>{mainPage.subTitleLine}</View>
</View>
);
}
}

View File

@ -1,12 +1,81 @@
import { View, Text } from '@tarojs/components'; import { View } from '@tarojs/components';
import { Component, ReactNode } from 'react'; import { Component, ReactNode } from 'react';
import Taro from '@tarojs/taro'; import Taro from '@tarojs/taro';
import type CustomTabBar from '../../custom-tab-bar'; import { AtCard, AtAccordion } from 'taro-ui';
import type CustomTabBar from '@/custom-tab-bar';
import PageFooter from '@/components/PageFooter/PageFooter';
import pt from '@/plain-text';
import './index.scss'; import './index.scss';
import TitleCard from './TitleCard';
import { DutyInfo, DutyData } from './DutyInfo';
import { StepInfo, TipsInfo } from './StepTipsInfo';
class Index extends Component { class CardContent {
title: string;
note: string;
extra: JSX.Element | string;
content: () => JSX.Element;
}
function mainPageCard(c: CardContent): JSX.Element {
return (
<View style={{ marginTop: 10 }}>
<AtCard note={c.note} extra={c.extra} title={c.title}>
{c.content()}
</AtCard>
</View>
);
}
class ExpandItem extends Component {
state = { state = {
msg: 'Hello World!', open: false,
};
props = {
title: '',
content: <View></View>,
};
handleClick(value: boolean) {
this.setState({ open: value });
}
render(): ReactNode {
return (
<View>
<AtAccordion
open={this.state.open}
onClick={this.handleClick.bind(this)}
title={this.props.title}
>
{this.props.content}
</AtAccordion>
</View>
);
}
}
export default class Index extends Component {
state = {
dutyData: new DutyData(),
dutyInfoCard: {
title: pt.get().mainPage.cardTitle.dutyInfo,
note: 'Tips',
extra: '额外信息',
content: () => <DutyInfo data={this.state.dutyData} />,
},
stepInfoCard: {
title: pt.get().mainPage.cardTitle.stepInfo,
note: 'Tips 请在20:30以前取走自己的物品哦',
extra: '额外信息',
content: () => <StepInfo />,
},
tipsInfoCard: {
title: pt.get().mainPage.cardTitle.tipsInfo,
note: 'Tips',
extra: '额外信息',
content: () => <TipsInfo />,
},
}; };
// 以下是TabBar相关 // 以下是TabBar相关
@ -18,12 +87,20 @@ class Index extends Component {
// 以上是TabBar相关 // 以上是TabBar相关
render(): ReactNode { render(): ReactNode {
const mainPage = pt.get().mainPage;
return ( return (
<View> <View>
<Text>{this.state.msg}</Text> <TitleCard />
<View style={{ marginTop: 30 }}>
{mainPageCard(this.state.dutyInfoCard)}
{mainPageCard(this.state.tipsInfoCard)}
<ExpandItem
title={mainPage.expandTitle.stepInfo}
content={mainPageCard(this.state.stepInfoCard)}
/>
</View>
<PageFooter />
</View> </View>
); );
} }
} }
export default Index;

View File

@ -1,10 +1,60 @@
import { View } from '@tarojs/components';
import { Component, ReactNode } from 'react'; import { Component, ReactNode } from 'react';
import Taro from '@tarojs/taro'; import { AtForm, AtInput, AtButton } from 'taro-ui';
import './inform.scss'; import './inform.scss';
export default class InformPage extends Component { export default class InformPage extends Component {
state = {
phone: '',
name: '',
};
handleChangePhone(phone: string) {
this.setState({
phone: phone,
});
return phone;
}
handleChangeName(name: string) {
this.setState({
name: name,
});
return name;
}
onSubmit() {
console.log(this.state.name, this.state.phone);
}
onReset() {
this.setState({
phone: '',
name: '',
});
}
render(): ReactNode { render(): ReactNode {
return <View></View>; return (
<AtForm
onSubmit={this.onSubmit.bind(this)}
onReset={this.onReset.bind(this)}
>
<AtInput
name='phone'
title='手机号码'
type='text'
placeholder='便于查询工单'
value={this.state.phone}
onChange={this.handleChangePhone.bind(this)}
/>
<AtInput
required
name='name'
title='真实姓名'
type='text'
placeholder='必填,与工单绑定'
value={this.state.name}
onChange={this.handleChangeName.bind(this)}
/>
<AtButton formType='submit'></AtButton>
<AtButton formType='reset'></AtButton>
</AtForm>
);
} }
} }

View File

@ -0,0 +1,77 @@
export interface MainPageText {
mainTitleLine: string;
subTitleLine: string;
cardTitle: {
dutyInfo: string;
stepInfo: string;
tipsInfo: string;
};
expandTitle: {
stepInfo: string;
tipsInfo: string;
};
stepList: Array<{ title: string }>;
tipsList: Array<{ title: string }>;
dutyCard: {
offDuty: {
title: string;
reason: (s: string) => string;
recoverTime: (t: string) => string;
};
inDuty: {
title: string;
currentDutyText: (c: 'off' | '1' | '2' | '3') => string;
inDutyCnt: (n: number) => string;
};
};
}
export const mainPageZhCn: MainPageText = {
mainTitleLine: '您好这里是E志者协会',
subTitleLine: '维修请至【东三-204】实验室',
cardTitle: {
dutyInfo: '204值班情况',
stepInfo: '维修步骤',
tipsInfo: '注意事项',
},
expandTitle: {
stepInfo: '查看维修步骤',
tipsInfo: '查看注意事项',
},
stepList: [
{ title: '线上填写工单' },
{ title: '去`东三-204`实验室维修电脑' },
{ title: '等待电脑维修' },
{ title: '维修结束,取回电脑' },
],
tipsList: [
{ title: '戴尔、Surface、外星人、苹果电脑不能拆机哦~' },
{ title: '数据无价,请随时做好数据备份哦~' },
{ title: '204也是实验室请遵守实验室纪律请勿饮食~' },
{ title: '我们是志愿服务,不收任何礼物哦~' },
],
dutyCard: {
offDuty: {
title: '未值班',
reason: s => '值班停止原因:' + s,
recoverTime: t => '恢复值班时间:' + t,
},
inDuty: {
title: '值班中',
currentDutyText: c => {
switch (c) {
case 'off':
return '当前未值班';
case '1':
return '第一班 13:30-16:00';
case '2':
return '第二班 16:00-18:00';
case '3':
return '第三班 18:00-20:30';
}
},
inDutyCnt: n => '当前值班人数:' + n,
},
},
};

View File

@ -0,0 +1,7 @@
export interface PageFooterText {
dividerText: string;
}
export const pageFooterZhCn: PageFooterText = {
dividerText: 'EVA Notify',
};

View File

@ -0,0 +1,40 @@
import { PageFooterText, pageFooterZhCn } from './PageFooter';
import { MainPageText, mainPageZhCn } from './MainPage';
interface TextRecord {
pageFooter: PageFooterText;
mainPage: MainPageText;
}
const textZhCn: TextRecord = {
pageFooter: pageFooterZhCn,
mainPage: mainPageZhCn,
};
// type Lang = 'zh_CN' | 'en_US' | ...;
type Lang = 'zh_CN';
class PlainText {
private readonly textZhCn: TextRecord;
private lang: Lang;
constructor() {
this.textZhCn = textZhCn;
this.lang = 'zh_CN';
}
setLang(lang: Lang) {
this.lang = lang;
}
get(): TextRecord {
if (this.lang == 'zh_CN') {
return this.textZhCn;
}
return this.textZhCn;
}
}
const pt = new PlainText();
export default pt;

View File

@ -0,0 +1,60 @@
import process from 'process';
/**
* Get URL of backend
* @param path Relative path to base url, begins with `/`
* @returns Full url
*
* @example
*
* ``` tsx
* import { getUrl } from '@/service';
* import { Component, ReactNode } from 'react';
* import Taro from '@tarojs/taro';
*
* class Index extends Component {
* state = {
* testData: {},
* }
* componentDidMount(): void {
* Taro.request({
* url: getUrl('/testdata'),
* method: 'GET',
* }).then(res => {
* console.log(res.data);
* this.setState({ testData: res.data.data });
* });
* }
* render() { ... }
* }
* ```
*/
export function getUrl(path: string): string {
const baseUrl = process.env.TARO_APP_API;
// console.log('bu:', baseUrl);
if (baseUrl) {
return baseUrl + path;
} else {
console.log('env TARO_APP_API is undefined');
return '';
}
}
/**
* Get URL of Oreo backend
* @param path Relative path to base url, begins with `/`
* @returns Full url
*
* @example
* // see example of `getUrl`
*/
export function getUrlOreo(path: string): string {
const baseUrlOreo = process.env.TARO_APP_API_OREO;
// console.log('buo:', baseUrlOreo);
if (baseUrlOreo) {
return baseUrlOreo + path;
} else {
console.log('env TARO_APP_API_OREO is undefined');
return '';
}
}