更新
This commit is contained in:
parent
3c988ca0e5
commit
2a43fa33ab
@ -4,6 +4,14 @@
|
||||
|
||||
# CHANGE
|
||||
|
||||
## 0.8.3
|
||||
|
||||
2023年03月02日
|
||||
|
||||
### 添加
|
||||
|
||||
- 物品查价
|
||||
|
||||
## 0.8.2
|
||||
|
||||
2023年02月01日
|
||||
|
||||
411
package-lock.json
generated
411
package-lock.json
generated
@ -23,6 +23,7 @@
|
||||
"rollup": "^2.79.0",
|
||||
"rollup-plugin-postcss": "^4.0.2",
|
||||
"rollup-plugin-string-html": "^1.0.0",
|
||||
"rollup-plugin-typescript2": "^0.34.1",
|
||||
"tslib": "^2.4.0",
|
||||
"typescript": "^4.8.3",
|
||||
"vue": "^3.2.47"
|
||||
@ -1037,6 +1038,12 @@
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/commondir": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/commondir/-/commondir-1.0.1.tgz",
|
||||
"integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/concat-with-sourcemaps": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz",
|
||||
@ -1347,6 +1354,47 @@
|
||||
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/find-cache-dir": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz",
|
||||
"integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"commondir": "^1.0.1",
|
||||
"make-dir": "^3.0.2",
|
||||
"pkg-dir": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"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==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"locate-path": "^5.0.0",
|
||||
"path-exists": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-extra": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
@ -1376,6 +1424,12 @@
|
||||
"loader-utils": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.10",
|
||||
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/has": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||
@ -1502,6 +1556,18 @@
|
||||
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/lilconfig": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.0.6.tgz",
|
||||
@ -1520,6 +1586,18 @@
|
||||
"node": ">= 12.13.0"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"p-locate": "^4.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash.camelcase": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
|
||||
@ -1544,6 +1622,18 @@
|
||||
"integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"yallist": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/magic-string": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.25.9.tgz",
|
||||
@ -1553,6 +1643,27 @@
|
||||
"sourcemap-codec": "^1.4.8"
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/make-dir/-/make-dir-3.1.0.tgz",
|
||||
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"semver": "^6.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/make-dir/node_modules/semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
}
|
||||
},
|
||||
"node_modules/mdn-data": {
|
||||
"version": "2.0.14",
|
||||
"resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.0.14.tgz",
|
||||
@ -4185,6 +4296,30 @@
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"p-try": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"p-limit": "^2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/p-queue": {
|
||||
"version": "6.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/p-queue/-/p-queue-6.6.2.tgz",
|
||||
@ -4210,6 +4345,15 @@
|
||||
"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==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/param-case": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/param-case/-/param-case-2.1.1.tgz",
|
||||
@ -4219,6 +4363,15 @@
|
||||
"no-case": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/path-key": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz",
|
||||
@ -4258,6 +4411,18 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/pkg-dir": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-4.2.0.tgz",
|
||||
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"find-up": "^4.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.21.tgz",
|
||||
@ -4901,6 +5066,42 @@
|
||||
"rollup-pluginutils": "^2.8.1"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-plugin-typescript2": {
|
||||
"version": "0.34.1",
|
||||
"resolved": "https://registry.npmmirror.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.34.1.tgz",
|
||||
"integrity": "sha512-P4cHLtGikESmqi1CA+tdMDUv8WbQV48mzPYt77TSTOPJpERyZ9TXdDgjSDix8Fkqce6soYz3+fa4lrC93IEkcw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": "^4.1.2",
|
||||
"find-cache-dir": "^3.3.2",
|
||||
"fs-extra": "^10.0.0",
|
||||
"semver": "^7.3.7",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"rollup": ">=1.26.3",
|
||||
"typescript": ">=2.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-plugin-typescript2/node_modules/@rollup/pluginutils": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
|
||||
"integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"estree-walker": "^2.0.1",
|
||||
"picomatch": "^2.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup-plugin-typescript2/node_modules/estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/rollup-pluginutils": {
|
||||
"version": "2.8.2",
|
||||
"resolved": "https://registry.npmmirror.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
|
||||
@ -4928,6 +5129,21 @@
|
||||
"integrity": "sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/semver": {
|
||||
"version": "7.3.8",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-7.3.8.tgz",
|
||||
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lru-cache": "^6.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/serialize-javascript": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz",
|
||||
@ -5143,6 +5359,15 @@
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.0.tgz",
|
||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/update-browserslist-db": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz",
|
||||
@ -5266,6 +5491,12 @@
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/yaml": {
|
||||
"version": "1.10.2",
|
||||
"resolved": "https://registry.npmmirror.com/yaml/-/yaml-1.10.2.tgz",
|
||||
@ -5948,6 +6179,12 @@
|
||||
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
|
||||
"dev": true
|
||||
},
|
||||
"commondir": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/commondir/-/commondir-1.0.1.tgz",
|
||||
"integrity": "sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==",
|
||||
"dev": true
|
||||
},
|
||||
"concat-with-sourcemaps": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz",
|
||||
@ -6193,6 +6430,38 @@
|
||||
"integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
|
||||
"dev": true
|
||||
},
|
||||
"find-cache-dir": {
|
||||
"version": "3.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/find-cache-dir/-/find-cache-dir-3.3.2.tgz",
|
||||
"integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commondir": "^1.0.1",
|
||||
"make-dir": "^3.0.2",
|
||||
"pkg-dir": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"find-up": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/find-up/-/find-up-4.1.0.tgz",
|
||||
"integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"locate-path": "^5.0.0",
|
||||
"path-exists": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"fs-extra": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"fsevents": {
|
||||
"version": "2.3.2",
|
||||
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz",
|
||||
@ -6215,6 +6484,12 @@
|
||||
"loader-utils": "^3.2.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.2.10",
|
||||
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.10.tgz",
|
||||
"integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==",
|
||||
"dev": true
|
||||
},
|
||||
"has": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
|
||||
@ -6312,6 +6587,16 @@
|
||||
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
|
||||
"dev": true
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6",
|
||||
"universalify": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"lilconfig": {
|
||||
"version": "2.0.6",
|
||||
"resolved": "https://registry.npmmirror.com/lilconfig/-/lilconfig-2.0.6.tgz",
|
||||
@ -6324,6 +6609,15 @@
|
||||
"integrity": "sha512-ZvFw1KWS3GVyYBYb7qkmRM/WwL2TQQBxgCK62rlvm4WpVQ23Nb4tYjApUlfjrEGvOs7KHEsmyUn75OHZrJMWPw==",
|
||||
"dev": true
|
||||
},
|
||||
"locate-path": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/locate-path/-/locate-path-5.0.0.tgz",
|
||||
"integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-locate": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"lodash.camelcase": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
|
||||
@ -6348,6 +6642,15 @@
|
||||
"integrity": "sha512-2Fgx1Ycm599x+WGpIYwJOvsjmXFzTSc34IwDWALRA/8AopUKAVPwfJ+h5+f85BCp0PWmmJcWzEpxOpoXycMpdA==",
|
||||
"dev": true
|
||||
},
|
||||
"lru-cache": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/lru-cache/-/lru-cache-6.0.0.tgz",
|
||||
"integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"yallist": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"magic-string": {
|
||||
"version": "0.25.9",
|
||||
"resolved": "https://registry.npmmirror.com/magic-string/-/magic-string-0.25.9.tgz",
|
||||
@ -6357,6 +6660,23 @@
|
||||
"sourcemap-codec": "^1.4.8"
|
||||
}
|
||||
},
|
||||
"make-dir": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/make-dir/-/make-dir-3.1.0.tgz",
|
||||
"integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"semver": "^6.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"semver": {
|
||||
"version": "6.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.0.tgz",
|
||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"mdn-data": {
|
||||
"version": "2.0.14",
|
||||
"resolved": "https://registry.npmmirror.com/mdn-data/-/mdn-data-2.0.14.tgz",
|
||||
@ -8194,6 +8514,24 @@
|
||||
"integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
|
||||
"dev": true
|
||||
},
|
||||
"p-limit": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmmirror.com/p-limit/-/p-limit-2.3.0.tgz",
|
||||
"integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-try": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"p-limit": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"p-queue": {
|
||||
"version": "6.6.2",
|
||||
"resolved": "https://registry.npmmirror.com/p-queue/-/p-queue-6.6.2.tgz",
|
||||
@ -8213,6 +8551,12 @@
|
||||
"p-finally": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true
|
||||
},
|
||||
"param-case": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/param-case/-/param-case-2.1.1.tgz",
|
||||
@ -8222,6 +8566,12 @@
|
||||
"no-case": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"dev": true
|
||||
},
|
||||
"path-key": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmmirror.com/path-key/-/path-key-3.1.1.tgz",
|
||||
@ -8252,6 +8602,15 @@
|
||||
"integrity": "sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA==",
|
||||
"dev": true
|
||||
},
|
||||
"pkg-dir": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/pkg-dir/-/pkg-dir-4.2.0.tgz",
|
||||
"integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"find-up": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"postcss": {
|
||||
"version": "8.4.21",
|
||||
"resolved": "https://registry.npmmirror.com/postcss/-/postcss-8.4.21.tgz",
|
||||
@ -8670,6 +9029,37 @@
|
||||
"rollup-pluginutils": "^2.8.1"
|
||||
}
|
||||
},
|
||||
"rollup-plugin-typescript2": {
|
||||
"version": "0.34.1",
|
||||
"resolved": "https://registry.npmmirror.com/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.34.1.tgz",
|
||||
"integrity": "sha512-P4cHLtGikESmqi1CA+tdMDUv8WbQV48mzPYt77TSTOPJpERyZ9TXdDgjSDix8Fkqce6soYz3+fa4lrC93IEkcw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@rollup/pluginutils": "^4.1.2",
|
||||
"find-cache-dir": "^3.3.2",
|
||||
"fs-extra": "^10.0.0",
|
||||
"semver": "^7.3.7",
|
||||
"tslib": "^2.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@rollup/pluginutils": {
|
||||
"version": "4.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
|
||||
"integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"estree-walker": "^2.0.1",
|
||||
"picomatch": "^2.2.2"
|
||||
}
|
||||
},
|
||||
"estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"rollup-pluginutils": {
|
||||
"version": "2.8.2",
|
||||
"resolved": "https://registry.npmmirror.com/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz",
|
||||
@ -8699,6 +9089,15 @@
|
||||
"integrity": "sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w==",
|
||||
"dev": true
|
||||
},
|
||||
"semver": {
|
||||
"version": "7.3.8",
|
||||
"resolved": "https://registry.npmmirror.com/semver/-/semver-7.3.8.tgz",
|
||||
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lru-cache": "^6.0.0"
|
||||
}
|
||||
},
|
||||
"serialize-javascript": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz",
|
||||
@ -8859,6 +9258,12 @@
|
||||
"integrity": "sha512-X5BGTIDH8U6IQ1TIRP62YC36k+ULAa1d59BxlWvPUJ1NkW5L3FwcGfEzuVvGmhJFBu0YJ5Ge25tmRISqCmLiRQ==",
|
||||
"dev": true
|
||||
},
|
||||
"universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.0.tgz",
|
||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||
"dev": true
|
||||
},
|
||||
"update-browserslist-db": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmmirror.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz",
|
||||
@ -8929,6 +9334,12 @@
|
||||
"isexe": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"yallist": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/yallist/-/yallist-4.0.0.tgz",
|
||||
"integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==",
|
||||
"dev": true
|
||||
},
|
||||
"yaml": {
|
||||
"version": "1.10.2",
|
||||
"resolved": "https://registry.npmmirror.com/yaml/-/yaml-1.10.2.tgz",
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
{
|
||||
"name": "wuhu-torn-helper",
|
||||
"version": "0.8.2",
|
||||
"version": "0.8.3",
|
||||
"description": "芜湖助手",
|
||||
"scripts": {
|
||||
"release": "cross-env NODE_ENV=production rollup -c rollup-prod.config.js && node build.js",
|
||||
"watch": "cross-env NODE_ENV=development rollup -c -w"
|
||||
"watch": "cross-env NODE_ENV=development rollup -c -w",
|
||||
"rollup": "cross-env NODE_ENV=development rollup -c"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-alias": "^4.0.3",
|
||||
@ -22,6 +23,7 @@
|
||||
"rollup": "^2.79.0",
|
||||
"rollup-plugin-postcss": "^4.0.2",
|
||||
"rollup-plugin-string-html": "^1.0.0",
|
||||
"rollup-plugin-typescript2": "^0.34.1",
|
||||
"tslib": "^2.4.0",
|
||||
"typescript": "^4.8.3",
|
||||
"vue": "^3.2.47"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,4 +1,8 @@
|
||||
import typescript from "@rollup/plugin-typescript";
|
||||
// [!] Error: Unexpected token (Note that you need plugins to import files that are not JavaScript)
|
||||
// src/vue/ItemPrice.vue?vue&type=script&lang.ts (35:13)
|
||||
// import typescript from "@rollup/plugin-typescript";
|
||||
|
||||
import typescript2 from "rollup-plugin-typescript2";
|
||||
import json from "@rollup/plugin-json";
|
||||
import html from "rollup-plugin-string-html";
|
||||
import resolve from "@rollup/plugin-node-resolve";
|
||||
@ -9,9 +13,9 @@ import vue from "@vitejs/plugin-vue";
|
||||
|
||||
let node_env = process.env.NODE_ENV;
|
||||
let vuePath = node_env === 'production' ?
|
||||
'vue/dist/vue.runtime.esm-browser.prod.js' : 'vue/dist/vue.runtime.esm-browser.js';
|
||||
'vue/dist/vue.runtime.esm-browser.prod.js' :
|
||||
'vue/dist/vue.runtime.esm-browser.js';
|
||||
export default {
|
||||
// input: 'src/ts/index.ts',
|
||||
input: 'src/ts/class/Application.ts',
|
||||
output: {
|
||||
file: 'dist/bundle.js',
|
||||
@ -20,9 +24,11 @@ export default {
|
||||
},
|
||||
plugins: [
|
||||
json(),
|
||||
// 根据环境更改vue源
|
||||
alias({
|
||||
entries: [{ find: 'vue', replacement: vuePath }]
|
||||
}),
|
||||
// 为vue替换环境变量
|
||||
replace({
|
||||
values: {
|
||||
'process.env.NODE_ENV': () => JSON.stringify(node_env),
|
||||
@ -31,13 +37,19 @@ export default {
|
||||
},
|
||||
preventAssignment: true,
|
||||
}),
|
||||
vue({ isProduction: node_env === 'production' }),
|
||||
postcss({ minimize: true }),
|
||||
// 引入node相关方法
|
||||
resolve({
|
||||
browser: true,
|
||||
preferBuiltins: false,
|
||||
}),
|
||||
typescript(),
|
||||
vue({ isProduction: node_env === 'production' }),
|
||||
// TODO watch模式下vue更新不完全
|
||||
typescript2({
|
||||
tsconfig: "tsconfig.json",
|
||||
// clean: true,
|
||||
// check: false,
|
||||
}),
|
||||
postcss({ minimize: true }),
|
||||
html({
|
||||
// include: ["**/*.html", "**/*.css"],
|
||||
include: ["**/*.html"],
|
||||
@ -54,5 +66,6 @@ export default {
|
||||
minifyCSS: true,
|
||||
}
|
||||
}),
|
||||
// typescript(),
|
||||
],
|
||||
};
|
||||
|
||||
5
src/shims-vue.d.ts
vendored
5
src/shims-vue.d.ts
vendored
@ -4,3 +4,8 @@ declare module '*.vue' {
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
declare module '*vue&type=script&lang.ts' {
|
||||
import type { DefineComponent } from 'vue'
|
||||
const component: DefineComponent<{}, {}, any>
|
||||
export default component
|
||||
}
|
||||
|
||||
@ -5,10 +5,10 @@ import WuhuBase from "./WuhuBase";
|
||||
import CommonUtils from "./utils/CommonUtils";
|
||||
import Log from "./Log";
|
||||
import WuhuConfig from "./WuhuConfig";
|
||||
import SHOP_BEER_STATIC_ITEM_HTML from "../static/html/buyBeer/shop_beer_static_item.html";
|
||||
import ADD_BEER_HEAD_HTML from "../static/html/buyBeer/add_beer_head.html";
|
||||
import QUICK_CRIMES_HTML from "../static/html/quick_crimes.html";
|
||||
import RW_RIDER_HTML from "../static/html/rw_rider.html";
|
||||
import SHOP_BEER_STATIC_ITEM_HTML from "../../static/html/buyBeer/shop_beer_static_item.html";
|
||||
import ADD_BEER_HEAD_HTML from "../../static/html/buyBeer/add_beer_head.html";
|
||||
import QUICK_CRIMES_HTML from "../../static/html/quick_crimes.html";
|
||||
import RW_RIDER_HTML from "../../static/html/rw_rider.html";
|
||||
import christmasTownHelper from "../func/module/christmasTownHelper";
|
||||
import LotteryHelper from "./action/LotteryHelper";
|
||||
import TornStyleBlock from "./utils/TornStyleBlock";
|
||||
|
||||
@ -5,7 +5,7 @@ import Log from "./Log";
|
||||
|
||||
export default class WuhuBase extends Provider {
|
||||
public static glob: IGlobal = null;
|
||||
readonly className: string = 'WuhuBase';
|
||||
className: string = 'WuhuBase';
|
||||
|
||||
/**
|
||||
* 获取 localStorage 中的 wh_trans_settings 值 (json),以对象形式返回
|
||||
@ -32,9 +32,4 @@ export default class WuhuBase extends Provider {
|
||||
);
|
||||
if (condition) throw '芜湖';
|
||||
}
|
||||
|
||||
// public getClassName() {
|
||||
// return this.className;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@ import WuhuBase from "./WuhuBase";
|
||||
import TravelItem from "./action/TravelItem";
|
||||
import Global from "./Global";
|
||||
import Log from "./Log";
|
||||
import COMMON_CSS from "../static/css/common.css";
|
||||
import COMMON_CSS from "../../static/css/common.css";
|
||||
import globVars from "../globVars";
|
||||
|
||||
/**
|
||||
@ -34,7 +34,7 @@ export default class WuHuTornHelper extends WuhuBase {
|
||||
|
||||
// 扩展正则方法
|
||||
String.prototype.contains = function (keywords) {
|
||||
let that: string = this;
|
||||
let that: string = String(this);
|
||||
if ('string' === typeof keywords) {
|
||||
return new RegExp(keywords).test(that);
|
||||
} else {
|
||||
|
||||
@ -5,13 +5,13 @@ import WuhuBase from "./WuhuBase";
|
||||
import Log from "./Log";
|
||||
import CommonUtils from "./utils/CommonUtils";
|
||||
import Alert from "./utils/Alert";
|
||||
import * as EVENTS from "../static/json/event.json";
|
||||
import * as FEST from "../static/json/fest.json";
|
||||
import * as EVENTS from "../../static/json/event.json";
|
||||
import * as FEST from "../../static/json/fest.json";
|
||||
import Popup from "./utils/Popup";
|
||||
import TravelItem from "./action/TravelItem";
|
||||
import ZHONG_MENU_HTML from "../static/html/zhong/zhong_menu.html";
|
||||
import ZHONG_UPDATE_HTML from "../static/html/zhong/zhong_update.html";
|
||||
import ZHONG_LOOT_HTML from "../static/html/zhong/zhong_loot.html";
|
||||
import ZHONG_MENU_HTML from "../../static/html/zhong/zhong_menu.html";
|
||||
import ZHONG_UPDATE_HTML from "../../static/html/zhong/zhong_update.html";
|
||||
import ZHONG_LOOT_HTML from "../../static/html/zhong/zhong_loot.html";
|
||||
import Test from "../test/Test";
|
||||
import Global from "./Global";
|
||||
import Timer from "./utils/Timer";
|
||||
@ -22,6 +22,7 @@ import ItemPriceWatcherHandler from "./handler/ItemPriceWatcherHandler";
|
||||
import ChangeLogHandler from "./handler/ChangeLogHandler";
|
||||
import SettingsHandler from "./handler/SettingsHandler";
|
||||
import WuhuConfig from "./WuhuConfig";
|
||||
import ItemPriceHandler from "./handler/ItemPriceHandler";
|
||||
|
||||
export default class ZhongIcon extends WuhuBase {
|
||||
className = 'ZhongIcon';
|
||||
@ -403,6 +404,15 @@ export default class ZhongIcon extends WuhuBase {
|
||||
window.location.replace('https://www.torn.com/item.php?temp=4#xunzhaomuzhuang')
|
||||
}
|
||||
});
|
||||
// 物品查价
|
||||
list.push({
|
||||
domType: 'button',
|
||||
domId: '',
|
||||
domText: '🍺 物品查价',
|
||||
clickFunc() {
|
||||
ItemPriceHandler.show();
|
||||
}
|
||||
});
|
||||
// 更新历史
|
||||
list.push({
|
||||
domType: 'button',
|
||||
|
||||
@ -5,7 +5,7 @@ import Log from "../Log";
|
||||
import Alert from "../utils/Alert";
|
||||
import Global from "../Global";
|
||||
import Device from "../../enum/Device";
|
||||
import ATTACK_HELPER_CSS from "../../static/css/attack_helper.css";
|
||||
import ATTACK_HELPER_CSS from "../../../static/css/attack_helper.css";
|
||||
import ActionButtonUtils from "../utils/ActionButtonUtils";
|
||||
import TornStyleBlock from "../utils/TornStyleBlock";
|
||||
import TornStyleSwitch from "../utils/TornStyleSwitch";
|
||||
|
||||
@ -4,7 +4,7 @@ import Log from "../Log";
|
||||
import InfoUtils from "../utils/InfoUtils";
|
||||
import Alert from "../utils/Alert";
|
||||
import MathUtils from "../utils/MathUtils";
|
||||
import NOTIFY_HTML from "../../static/html/buyBeer/notify.html";
|
||||
import NOTIFY_HTML from "../../../static/html/buyBeer/notify.html";
|
||||
import CommonUtils from "../utils/CommonUtils";
|
||||
import Popup from "../utils/Popup";
|
||||
import ResponseInject from "../../interface/ResponseInject";
|
||||
|
||||
@ -0,0 +1 @@
|
||||
export default {};
|
||||
@ -340,7 +340,11 @@ export default class TranslateNew extends Provider implements ResponseInject {
|
||||
}
|
||||
// 物品列表
|
||||
else if ((url.includes('item.php') || url.includes('inventory.php')) && opt?.method === 'POST' &&
|
||||
typeof opt?.requestBody === 'string' && (opt?.requestBody.includes('step=getCategoryList') || opt?.requestBody.includes('step=getList'))) {
|
||||
typeof opt?.requestBody === 'string' &&
|
||||
(opt?.requestBody.includes('step=getCategoryList') ||
|
||||
opt?.requestBody.includes('step=getList') ||
|
||||
opt?.requestBody.includes('step=getNotAllItemsListWithoutGroups')
|
||||
)) {
|
||||
let resp = body.json as { html: string };
|
||||
if (resp.html) {
|
||||
let tmp = document.createElement('div');
|
||||
|
||||
@ -3,8 +3,8 @@ import Log from "../Log";
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import UserScriptEngine from "../../enum/UserScriptEngine";
|
||||
import Popup from "../utils/Popup";
|
||||
import STOCK_IMG_HTML from "../../static/html/stock_img.html";
|
||||
import * as FILTER from "../../static/json/for_stock_item_filter.json";
|
||||
import STOCK_IMG_HTML from "../../../static/html/stock_img.html";
|
||||
import * as FILTER from "../../../static/json/for_stock_item_filter.json";
|
||||
import WindowActiveState from "./WindowActiveState";
|
||||
|
||||
export default class TravelItem extends WuhuBase {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import XUNZHAOMUZHUANG_HTML from "../../static/html/xunzhaomuzhuang/index.html";
|
||||
import * as MUZHUANG_ID_LIST_JSON from "../../static/json/muzhuang_id_list.json";
|
||||
import XUNZHAOMUZHUANG_HTML from "../../../static/html/xunzhaomuzhuang/index.html";
|
||||
import * as MUZHUANG_ID_LIST_JSON from "../../../static/json/muzhuang_id_list.json";
|
||||
import CommonUtils from "../utils/CommonUtils";
|
||||
import XUNZHAOMUZHUANG_CSS from "../../static/css/xunzhaomuzhuang.css";
|
||||
import XUNZHAOMUZHUANG_CSS from "../../../static/css/xunzhaomuzhuang.css";
|
||||
import TornStyleBlock from "../utils/TornStyleBlock";
|
||||
import MathUtils from "../utils/MathUtils";
|
||||
import FetchUtils from "../utils/FetchUtils";
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import CommonUtils from "../utils/CommonUtils";
|
||||
import Popup from "../utils/Popup";
|
||||
import QUICK_CRIMES_HTML from "../../static/html/quick_crimes.html";
|
||||
import QUICK_CRIMES_HTML from "../../../static/html/quick_crimes.html";
|
||||
|
||||
export default class IFrameCrimeHandler extends WuhuBase {
|
||||
className = 'IFrameCrimeHandler';
|
||||
|
||||
14
src/ts/class/handler/ItemPriceHandler.ts
Normal file
14
src/ts/class/handler/ItemPriceHandler.ts
Normal file
@ -0,0 +1,14 @@
|
||||
import MenuHandler from "../../interface/MenuHandler";
|
||||
import Popup from "../utils/Popup";
|
||||
import { createApp } from "vue";
|
||||
import ItemPrice from "../../../vue/ItemPrice.vue";
|
||||
|
||||
// 物品查价
|
||||
export default <MenuHandler>{
|
||||
show(): void {
|
||||
createApp(ItemPrice).mount(
|
||||
new Popup('', '物品查价', () => createApp(ItemPrice).unmount())
|
||||
.getElement()
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import WuhuConfig from "../WuhuConfig";
|
||||
import PRICE_WATCHER_HTML from "../../static/html/price_watcher.html";
|
||||
import PRICE_WATCHER_HTML from "../../../static/html/price_watcher.html";
|
||||
import Popup from "../utils/Popup";
|
||||
import Global from "../Global";
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import NNB_INFO_HTML from "../../static/html/nnb_info.html";
|
||||
import NNB_INFO_HTML from "../../../static/html/nnb_info.html";
|
||||
import Popup from "../utils/Popup";
|
||||
import Global from "../Global";
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import CommonUtils from "../utils/CommonUtils";
|
||||
import QUICK_FLY_CSS from "../../static/css/quick_fly.css";
|
||||
import QUICK_FLY_HTML from "../../static/html/quick_fly.html";
|
||||
import QUICK_FLY_CSS from "../../../static/css/quick_fly.css";
|
||||
import QUICK_FLY_HTML from "../../../static/html/quick_fly.html";
|
||||
import Alert from "../utils/Alert";
|
||||
import TravelItem from "../action/TravelItem";
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import CommonUtils from "../utils/CommonUtils";
|
||||
import QUICK_LINK_CSS from "../../static/css/quick_link.css";
|
||||
import QUICK_LINK_CSS from "../../../static/css/quick_link.css";
|
||||
import Popup from "../utils/Popup";
|
||||
|
||||
export default class QuickLinksHandler extends WuhuBase {
|
||||
|
||||
@ -2,7 +2,7 @@ import WuhuBase from "../WuhuBase";
|
||||
import Log from "../Log";
|
||||
import Popup from "../utils/Popup";
|
||||
import CommonUtils from "../utils/CommonUtils";
|
||||
import VIEW_LOGS_HANDLER_HTML from "../../static/html/view_logs_handler.html";
|
||||
import VIEW_LOGS_HANDLER_HTML from "../../../static/html/view_logs_handler.html";
|
||||
|
||||
export default class ViewLogsHandler extends WuhuBase {
|
||||
className = 'ViewLogsHandler';
|
||||
|
||||
@ -3,7 +3,7 @@ import IWHNotify from "../../interface/IWHNotify";
|
||||
import NotificationUtils from "./NotificationUtils";
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import MathUtils from "./MathUtils";
|
||||
import NOTIFY_HTML from "../../static/html/notify.html";
|
||||
import NOTIFY_HTML from "../../../static/html/notify.html";
|
||||
import WindowActiveState from "../action/WindowActiveState";
|
||||
|
||||
export default class Alert extends WuhuBase {
|
||||
|
||||
@ -2,7 +2,7 @@ import UserScriptEngine from "../../enum/UserScriptEngine";
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import Log from "../Log";
|
||||
import Device from "../../enum/Device";
|
||||
import LOADING_IMG_HTML from "../../static/html/loading_img.html";
|
||||
import LOADING_IMG_HTML from "../../../static/html/loading_img.html";
|
||||
import Timer from "./Timer";
|
||||
import FetchUtils from "./FetchUtils";
|
||||
import TornStyleSwitch from "./TornStyleSwitch";
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import Log from "../Log";
|
||||
import DIALOG_MSG_BOX_HTML from "../../static/html/dialog_msg_box.html";
|
||||
import DIALOG_MSG_BOX_HTML from "../../../static/html/dialog_msg_box.html";
|
||||
|
||||
export default class DialogMsgBox {
|
||||
private static existed = false;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import WuhuBase from "../WuhuBase";
|
||||
import POPUP_HTML from "../../static/html/popup.html";
|
||||
import POPUP_HTML from "../../../static/html/popup.html";
|
||||
import Log from "../Log";
|
||||
|
||||
/**
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
import Log from "../class/Log";
|
||||
|
||||
export default function (tar: unknown) {
|
||||
Log.info("TestDeco", tar);
|
||||
}
|
||||
@ -1,18 +1,18 @@
|
||||
import WuhuConfig from "../../class/WuhuConfig";
|
||||
import WT_HTML from "../../static/html/xmasTown/wt.html";
|
||||
import WT_XMAS_TOWN_HTML from "../../static/html/xmasTown/wt_xmas_town.html";
|
||||
import WT_MALTESE_SNOW_GLOBE_HTML from "../../static/html/xmasTown/wt_maltese_snow_globe.html";
|
||||
import WT_LONG_WAY_FROM_HOME_HTML from "../../static/html/xmasTown/wt_long_way_from_home.html";
|
||||
import WT_CHEDBURN_TOWERS_HTML from "../../static/html/xmasTown/wt_chedburn_towers.html";
|
||||
import WT_KIDNAPPED_SANTA_HTML from "../../static/html/xmasTown/wt_kidnapped_santa.html";
|
||||
import WT_HOLIDAY_TERROR_HTML from "../../static/html/xmasTown/wt_holiday_terror.html";
|
||||
import WT_AMONG_US_HTML from "../../static/html/xmasTown/wt_among_us.html";
|
||||
import WT_KISS_MY_FESTIVUS_HTML from "../../static/html/xmasTown/wt_kiss_my_festivus.html";
|
||||
import WT_STANLEY_HOTEL_HTML from "../../static/html/xmasTown/wt_stanley_hotel.html";
|
||||
import WT_DOGGOQUEST_HTML from "../../static/html/xmasTown/wt_doggoQuest.html";
|
||||
import WT_POKEMON_CT_HTML from "../../static/html/xmasTown/wt_pokemon_ct.html";
|
||||
import WT_WINTER_IN_GATLIN_HTML from "../../static/html/xmasTown/wt_winter_in_gatlin.html";
|
||||
import XMAS_TOWN_NOTIFY_HTML from "../../static/html/xmasTown/xmas_town_notify.html";
|
||||
import WT_HTML from "../../../static/html/xmasTown/wt.html";
|
||||
import WT_XMAS_TOWN_HTML from "../../../static/html/xmasTown/wt_xmas_town.html";
|
||||
import WT_MALTESE_SNOW_GLOBE_HTML from "../../../static/html/xmasTown/wt_maltese_snow_globe.html";
|
||||
import WT_LONG_WAY_FROM_HOME_HTML from "../../../static/html/xmasTown/wt_long_way_from_home.html";
|
||||
import WT_CHEDBURN_TOWERS_HTML from "../../../static/html/xmasTown/wt_chedburn_towers.html";
|
||||
import WT_KIDNAPPED_SANTA_HTML from "../../../static/html/xmasTown/wt_kidnapped_santa.html";
|
||||
import WT_HOLIDAY_TERROR_HTML from "../../../static/html/xmasTown/wt_holiday_terror.html";
|
||||
import WT_AMONG_US_HTML from "../../../static/html/xmasTown/wt_among_us.html";
|
||||
import WT_KISS_MY_FESTIVUS_HTML from "../../../static/html/xmasTown/wt_kiss_my_festivus.html";
|
||||
import WT_STANLEY_HOTEL_HTML from "../../../static/html/xmasTown/wt_stanley_hotel.html";
|
||||
import WT_DOGGOQUEST_HTML from "../../../static/html/xmasTown/wt_doggoQuest.html";
|
||||
import WT_POKEMON_CT_HTML from "../../../static/html/xmasTown/wt_pokemon_ct.html";
|
||||
import WT_WINTER_IN_GATLIN_HTML from "../../../static/html/xmasTown/wt_winter_in_gatlin.html";
|
||||
import XMAS_TOWN_NOTIFY_HTML from "../../../static/html/xmasTown/xmas_town_notify.html";
|
||||
|
||||
export default function christmasTownHelper() {
|
||||
let $root = document.querySelector('#christmastownroot');
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import toThousands from "../utils/toThousands";
|
||||
import CommonUtils from "../../class/utils/CommonUtils";
|
||||
import CITY_FINDER_CSS from "../../static/css/city_finder.css";
|
||||
import CITY_FINDER_CSS from "../../../static/css/city_finder.css";
|
||||
import TornStyleBlock from "../../class/utils/TornStyleBlock";
|
||||
import ItemHelper from "../../class/utils/ItemHelper";
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ import Alert from "../../class/utils/Alert";
|
||||
import ActionButtonUtils from "../../class/utils/ActionButtonUtils";
|
||||
import WuhuConfig from "../../class/WuhuConfig";
|
||||
import FetchUtils from "../../class/utils/FetchUtils";
|
||||
import DEPO_CSS from "../../static/css/depo.css";
|
||||
import DEPO_CSS from "../../../static/css/depo.css";
|
||||
import TornStyleBlock from "../../class/utils/TornStyleBlock";
|
||||
|
||||
export default function depoHelper() {
|
||||
|
||||
@ -6,8 +6,8 @@ import Alert from "../../class/utils/Alert";
|
||||
import ActionButtonUtils from "../../class/utils/ActionButtonUtils";
|
||||
import WuhuConfig from "../../class/WuhuConfig";
|
||||
import CommonUtils from "../../class/utils/CommonUtils";
|
||||
import TRAVEL_ALARM_CSS from "../../static/css/travel_alarm.css";
|
||||
import TRAVEL_ALARM_HTML from "../../static/html/travel_alarm.html";
|
||||
import TRAVEL_ALARM_CSS from "../../../static/css/travel_alarm.css";
|
||||
import TRAVEL_ALARM_HTML from "../../../static/html/travel_alarm.html";
|
||||
import TornStyleBlock from "../../class/utils/TornStyleBlock";
|
||||
import QuickFlyBtnHandler from "../../class/handler/QuickFlyBtnHandler";
|
||||
import TRAVEL_STATE from "../../enum/TravelState";
|
||||
|
||||
@ -28,37 +28,41 @@ export default function initMiniProf(selector) {
|
||||
const that = this;
|
||||
let width = $(window).width();
|
||||
|
||||
function handleResize(e) {
|
||||
if ($(this).width() !== width) {
|
||||
width = $(this).width();
|
||||
function handleResize(this: Window, e) {
|
||||
let $this = $(this);
|
||||
if ($this.width() !== width) {
|
||||
width = $this.width();
|
||||
hideMiniProfile.call(that, e);
|
||||
}
|
||||
}
|
||||
|
||||
function handleScroll(e) {
|
||||
function handleScroll(this, e) {
|
||||
if (!document.activeElement.classList.contains('send-cash-input')) {
|
||||
hideMiniProfile.call(that, e);
|
||||
}
|
||||
}
|
||||
|
||||
function hideMiniProfile(e) {
|
||||
function hideMiniProfile(this: typeof profileMini, e) {
|
||||
if ($(e.target).closest(this.rootSelector).length === 0 || ['resize', 'scroll'].includes(e.type)) {
|
||||
that.targetElement = null
|
||||
that.targetElement = null;
|
||||
let $thisUserNameSelector = $(this.userNameSelector);
|
||||
window.ReactDOM.unmountComponentAtNode($(this.rootSelector).get(0));
|
||||
$(this.userNameSelector).off('click', this.handleUserNameClick);
|
||||
$(this.userNameSelector).unbind('contextmenu');
|
||||
$thisUserNameSelector.off('click', this.handleUserNameClick);
|
||||
$thisUserNameSelector.unbind('contextmenu');
|
||||
$(document).off('click', hideMiniProfile);
|
||||
$(window).off('hashchange', hideMiniProfile);
|
||||
$(window).off('resize', handleResize);
|
||||
$(window).off('scroll', handleScroll);
|
||||
let $window = $(window);
|
||||
$window.off('hashchange', hideMiniProfile);
|
||||
$window.off('resize', handleResize);
|
||||
$window.off('scroll', handleScroll);
|
||||
}
|
||||
}
|
||||
|
||||
let $window = $(window);
|
||||
$(document).on('click', hideMiniProfile.bind(this));
|
||||
$(window).on('hashchange', hideMiniProfile.bind(this));
|
||||
$(window).on('resize', handleResize);
|
||||
$window.on('hashchange', hideMiniProfile.bind(this));
|
||||
$window.on('resize', handleResize);
|
||||
if (that.targetElement.closest('#chatRoot')) {
|
||||
$(window).on('scroll', handleScroll);
|
||||
$window.on('scroll', handleScroll);
|
||||
}
|
||||
},
|
||||
subscribeForUserNameClick: function () {
|
||||
@ -87,7 +91,7 @@ export default function initMiniProf(selector) {
|
||||
that.targetElement = e.currentTarget;
|
||||
that.subscribeForContextMenu(that.targetElement);
|
||||
that.handleFocusLost(e.currentTarget);
|
||||
that.timeout = setTimeout(function () {
|
||||
that.timeout = window.setTimeout(function () {
|
||||
if (e.type !== 'touchstart') {
|
||||
that.setClickable(false);
|
||||
that.subscribeForUserNameClick();
|
||||
|
||||
3
src/ts/interface/MenuHandler.ts
Normal file
3
src/ts/interface/MenuHandler.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export default interface MenuHandler {
|
||||
show(): void
|
||||
}
|
||||
@ -3,8 +3,6 @@ import Log from "../class/Log";
|
||||
import Popup from "../class/utils/Popup";
|
||||
import CompanyHelper from "../class/action/CompanyHelper";
|
||||
import globVars from "../globVars";
|
||||
import { createApp } from "vue";
|
||||
import ItemPrice from "../vue/ItemPrice.vue"
|
||||
|
||||
export default class Test extends WuhuBase {
|
||||
className = 'Test';
|
||||
@ -13,9 +11,9 @@ export default class Test extends WuhuBase {
|
||||
let popup = new Popup('');
|
||||
popup.getElement()['__POOL__'] = Test.getPool();
|
||||
Log.info({ NET: globVars.WH_NET_LOG });
|
||||
let vueApp = createApp(ItemPrice);
|
||||
vueApp.mount('#wh-popup-cont');
|
||||
popup.setOnClosing(() => vueApp.unmount());
|
||||
// let vueApp = createApp(ItemPrice);
|
||||
// vueApp.mount('#wh-popup-cont');
|
||||
// popup.setOnClosing(() => vueApp.unmount());
|
||||
}
|
||||
|
||||
private case1() {
|
||||
|
||||
@ -1,146 +0,0 @@
|
||||
<template>
|
||||
<input v-model="itemNameInput" placeholder="输入物品名(英)"/>
|
||||
<select v-if="itemNameInput" v-model="itemSelected" @change="onSelectChange">
|
||||
<option disabled value="">{{ optDefault }}</option>
|
||||
<option v-for="item in filteredItems">{{ item }}</option>
|
||||
</select>
|
||||
<div v-if="itemInfo.id !== -1">
|
||||
<p>物品名:{{ itemInfo.name }}<img :src="`/images/items/${itemInfo.id}/medium.png`" alt="itemImg"/></p>
|
||||
<p>估价 (缓存):{{ itemInfo.price }}</p>
|
||||
<div>
|
||||
实时市价 (API):
|
||||
<span v-if="apiPriceResult.status === -1">
|
||||
<button @click="(ev) => onApiPricePress(itemInfo.name, ev)">API查询</button>
|
||||
</span>
|
||||
<div v-else>
|
||||
<ul>
|
||||
<li v-for="item in apiPriceResult.data">{{ moneyFormat(item.cost) }} x {{ item.quantity }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<button @click="(ev) => onApiPricePress(itemInfo.name, ev)">API查询</button>
|
||||
</div>
|
||||
<p>昨日市值 (Value):
|
||||
<span v-if="itemInfo.value">{{ itemInfo.value }}</span>
|
||||
<span v-else>...</span>
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
<p><a :href="'/imarket.php#/p=shop&step=shop&type=&searchname='+itemInfo.name.toString().replaceAll(' ','+')"
|
||||
target="_blank">前往市场</a></p>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Log from "../class/Log";
|
||||
import Hello from "./Hello.vue";
|
||||
import ItemHelper from "../class/utils/ItemHelper";
|
||||
import toThousands from "../func/utils/toThousands";
|
||||
import FetchUtils from "../class/utils/FetchUtils";
|
||||
import Alert from "../class/utils/Alert";
|
||||
import Global from "../class/Global";
|
||||
|
||||
export default {
|
||||
name: "ItemPrice",
|
||||
components: { Hello },
|
||||
data() {
|
||||
return {
|
||||
itemNameInput: '',
|
||||
itemInfo: {
|
||||
id: -1,
|
||||
name: 0,
|
||||
price: 0,
|
||||
value: '',
|
||||
},
|
||||
// mounted加载物品名-id对应
|
||||
itemNameMap: null,
|
||||
optDefault: '加载中...',
|
||||
itemSelected: '',
|
||||
apiPriceResult: {
|
||||
status: -1,
|
||||
data: []
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
filteredItems() {
|
||||
if (!this.itemNameMap) return [];
|
||||
// let arr = ['123', '456', '789', '135', '246', '357', '579'];
|
||||
let arr = Object.keys(this.itemNameMap);
|
||||
let out = [];
|
||||
if (this.itemNameInput) {
|
||||
arr.forEach(v => {
|
||||
v.toLowerCase().includes(this.itemNameInput.toLowerCase()) && out.push(v);
|
||||
})
|
||||
}
|
||||
return out;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
async onApiPricePress(itemName, ev) {
|
||||
ev.target.disabled = true;
|
||||
// Log.info({ itemName });
|
||||
// this.apiPriceResult.status = -99;
|
||||
// BazaarApiResponse
|
||||
let res = null;
|
||||
let apiKey = Global.getInstance().isPDA ? Global.getInstance().PDA_APIKey : localStorage.getItem('APIKey');
|
||||
try {
|
||||
if (!apiKey) return new Error('无APIKEY');
|
||||
res = JSON.parse(
|
||||
await FetchUtils
|
||||
.getInstance()
|
||||
.fetchText(`//api.torn.com/market/${ this.itemNameMap[itemName] }?selections=bazaar&key=${ apiKey }`)
|
||||
).bazaar.slice(0, 5);
|
||||
} catch (e) {
|
||||
Log.error(e.stack || e.message || e);
|
||||
new Alert(e.message || e.toString());
|
||||
ev.target.disabled = false;
|
||||
}
|
||||
this.apiPriceResult.status = 0;
|
||||
this.apiPriceResult.data = res;
|
||||
ev.target.disabled = false;
|
||||
},
|
||||
onSelectChange() {
|
||||
this.apiPriceResult.status = -1;
|
||||
this.itemInfo.value = '';
|
||||
let priceData = ItemHelper.getInstance().getLocalPriceData();
|
||||
let update = (data) => {
|
||||
this.itemInfo.name = this.itemSelected;
|
||||
this.itemInfo.price = '$' + toThousands(data[this.itemNameMap[this.itemSelected]].price);
|
||||
this.itemInfo.id = this.itemNameMap[this.itemSelected];
|
||||
};
|
||||
if (priceData.data) {
|
||||
update(priceData.data);
|
||||
} else {
|
||||
window.setTimeout(async () => {
|
||||
let data = await priceData.promise;
|
||||
update(data);
|
||||
}, 0);
|
||||
}
|
||||
ItemHelper.getInstance().getItemData(this.itemSelected).then((data) => {
|
||||
this.itemInfo.value = data.itemValue;
|
||||
});
|
||||
},
|
||||
moneyFormat(input) {
|
||||
return '$' + toThousands(input);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let itemName = ItemHelper.getInstance().getItemNameMap();
|
||||
if (itemName.data) {
|
||||
this.itemNameMap = itemName.data;
|
||||
this.optDefault = '-';
|
||||
} else {
|
||||
window.setTimeout(async () => {
|
||||
this.itemNameMap = await itemName.promise;
|
||||
this.optDefault = '-';
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
select {
|
||||
padding: 0.5em;
|
||||
}
|
||||
</style>
|
||||
198
src/vue/ItemPrice.vue
Normal file
198
src/vue/ItemPrice.vue
Normal file
@ -0,0 +1,198 @@
|
||||
<!--<script setup lang="ts">-->
|
||||
<!--import { itemNameDict } from "../ts/dictionary/translation";-->
|
||||
<!--</script>-->
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<input v-model="itemNameInput" placeholder="输入物品名(英)"/>
|
||||
<input v-model="tNameQuery" placeholder="译名反查(!)"/>
|
||||
</div>
|
||||
<select v-if="selectOpts.length" v-model="itemSelected" @change="onSelectChange">
|
||||
<option disabled value="">{{ optDefault }}</option>
|
||||
<option v-for="item in selectOpts" :value="item">
|
||||
{{ item }}
|
||||
{{ itemNameDict[item] ? '(' + itemNameDict[item] + ')' : '' }}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<div v-if="itemInfo.id !== -1">
|
||||
<p><img :alt="itemInfo.id" :src="`/images/items/${itemInfo.id}/medium.png`"/></p>
|
||||
<p>
|
||||
物品名:{{ itemInfo.name }}{{ itemNameDict[itemInfo.name] ? '(' + itemNameDict[itemInfo.name] + ')' : '' }}
|
||||
</p>
|
||||
<p>估价 (缓存):{{ itemInfo.price }}</p>
|
||||
<div>
|
||||
<span>实时市价 (API):</span>
|
||||
<span v-if="apiPriceResult.status === -1">
|
||||
<button class="torn-btn" @click="(ev) => onApiPricePress(itemInfo.name, ev)">API查询</button>
|
||||
</span>
|
||||
<div v-else class="apiResults">
|
||||
<ul>
|
||||
<li v-for="item in apiPriceResult.data">{{ moneyFormat(item.cost) }} x {{ item.quantity }}</li>
|
||||
</ul>
|
||||
<button class="torn-btn" @click="(ev) => onApiPricePress(itemInfo.name, ev)">刷新</button>
|
||||
</div>
|
||||
</div>
|
||||
<p>
|
||||
<span>昨日市值 (Value):</span>
|
||||
<span v-if="itemInfo.value">{{ itemInfo.value }}</span>
|
||||
<span v-else>...</span>
|
||||
</p>
|
||||
<p>
|
||||
</p>
|
||||
<p>
|
||||
<a :href="'/imarket.php#/p=shop&step=shop&type=&searchname=' + String(itemInfo.name).replaceAll(' ','+')"
|
||||
class="torn-btn" target="_blank">前往市场</a>
|
||||
</p>
|
||||
</div>
|
||||
<div v-else><p>未选择或未找到</p></div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import Log from "../ts/class/Log";
|
||||
import ItemHelper from "../ts/class/utils/ItemHelper";
|
||||
import toThousands from "../ts/func/utils/toThousands";
|
||||
import FetchUtils from "../ts/class/utils/FetchUtils";
|
||||
import Alert from "../ts/class/utils/Alert";
|
||||
import Global from "../ts/class/Global";
|
||||
import { defineComponent } from "vue";
|
||||
import BazaarApiResponse from "../ts/interface/BazaarApiResponse";
|
||||
import { ItemPrice } from "../ts/interface/PriceData";
|
||||
import { itemNameDict } from "../ts/dictionary/translation";
|
||||
|
||||
export default defineComponent({
|
||||
name: "ItemPrice",
|
||||
data() {
|
||||
return {
|
||||
itemNameInput: '',
|
||||
itemInfo: {
|
||||
id: -1,
|
||||
name: '',
|
||||
price: '',
|
||||
value: '',
|
||||
},
|
||||
// mounted加载物品名-id对应
|
||||
itemNameMap: <{ [k: string]: number }>{},
|
||||
optDefault: '加载中...',
|
||||
itemSelected: '',
|
||||
apiPriceResult: {
|
||||
status: -1,
|
||||
data: <BazaarApiResponse['bazaar']>[]
|
||||
},
|
||||
tNameQuery: '',
|
||||
itemNameTranslated: <{ translatedName: string, itemName: string }[]>[],
|
||||
selectOpts: <string[]>[],
|
||||
itemNameDict,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// itemNameDict() {
|
||||
// return itemNameDict
|
||||
// },
|
||||
// filteredItems() {
|
||||
// if (!this.itemNameMap) return [];
|
||||
// let out: string[] = [];
|
||||
// if (this.itemNameInput) {
|
||||
// Object.keys(this.itemNameMap).forEach(v => {
|
||||
// v.toLowerCase().includes(this.itemNameInput.toLowerCase()) && out.push(v);
|
||||
// })
|
||||
// }
|
||||
// return out;
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
async onApiPricePress(itemName, ev) {
|
||||
ev.target.disabled = true;
|
||||
let res: BazaarApiResponse["bazaar"] = null;
|
||||
let apiKey = Global.getInstance().isPDA ? Global.getInstance().PDA_APIKey : localStorage.getItem('APIKey');
|
||||
try {
|
||||
if (!apiKey) return new Error('无APIKEY');
|
||||
res = JSON.parse(
|
||||
await FetchUtils
|
||||
.getInstance()
|
||||
.fetchText(`//api.torn.com/market/${ this.itemNameMap[itemName] }?selections=bazaar&key=${ apiKey }`)
|
||||
).bazaar.slice(0, 5);
|
||||
} catch (e) {
|
||||
Log.error(e.stack || e.message || e);
|
||||
new Alert(e.message || e.toString());
|
||||
ev.target.disabled = false;
|
||||
}
|
||||
this.apiPriceResult.status = 0;
|
||||
this.apiPriceResult.data = res;
|
||||
ev.target.disabled = false;
|
||||
},
|
||||
onSelectChange() {
|
||||
this.apiPriceResult.status = -1;
|
||||
this.itemInfo.value = '';
|
||||
let priceData = ItemHelper.getInstance().getLocalPriceData();
|
||||
let update = (data: { [p: number]: ItemPrice }) => {
|
||||
this.itemInfo.name = this.itemSelected;
|
||||
this.itemInfo.price = '$' + toThousands(data[this.itemNameMap[this.itemSelected]]?.price);
|
||||
this.itemInfo.id = this.itemNameMap[this.itemSelected];
|
||||
};
|
||||
if (priceData.data) {
|
||||
update(priceData.data);
|
||||
} else {
|
||||
window.setTimeout(async () => update(await priceData.promise), 0);
|
||||
}
|
||||
ItemHelper.getInstance().getItemData(this.itemSelected).then((data) => {
|
||||
this.itemInfo.value = data.itemValue;
|
||||
});
|
||||
},
|
||||
moneyFormat(input) {
|
||||
return '$' + toThousands(input);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
let itemName = ItemHelper.getInstance().getItemNameMap();
|
||||
if (itemName.data) {
|
||||
this.itemNameMap = itemName.data;
|
||||
this.optDefault = '-';
|
||||
} else {
|
||||
window.setTimeout(async () => {
|
||||
this.itemNameMap = await itemName.promise;
|
||||
this.optDefault = '-';
|
||||
}, 0);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
tNameQuery(newVal) {
|
||||
this.selectOpts = [];
|
||||
if (this.itemNameTranslated.length === 0) {
|
||||
Object.keys(itemNameDict).forEach(iName => {
|
||||
let tName = itemNameDict[iName];
|
||||
if (tName) {
|
||||
this.itemNameTranslated.push({ translatedName: tName, itemName: iName });
|
||||
}
|
||||
});
|
||||
}
|
||||
this.itemNameTranslated.forEach(el => {
|
||||
if (el.translatedName.includes(newVal)) {
|
||||
this.selectOpts.push(el.itemName);
|
||||
}
|
||||
});
|
||||
},
|
||||
itemNameInput(newVal) {
|
||||
// if (!newVal) return [];
|
||||
if (newVal) {
|
||||
this.selectOpts = [];
|
||||
Object.keys(this.itemNameMap).forEach(v => {
|
||||
v.toLowerCase().includes(this.itemNameInput.toLowerCase()) && this.selectOpts.push(v);
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
select {
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.apiResults {
|
||||
background: #ebebeb;
|
||||
padding: 1em;
|
||||
}
|
||||
</style>
|
||||
@ -14,6 +14,11 @@
|
||||
"moduleResolution": "node",
|
||||
"experimentalDecorators": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": false
|
||||
"strictFunctionTypes": false,
|
||||
"noImplicitThis": true
|
||||
}
|
||||
// "exclude": [
|
||||
// "./node_modules/*",
|
||||
// "./node_modules",
|
||||
// ]
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user