From 39ea6f2fb182cbd81e0ed5e68fdec468a422a420 Mon Sep 17 00:00:00 2001 From: "DESKTOP-V763RJ7\\Administrator" <835606593@qq.com> Date: Wed, 14 Jan 2026 11:07:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=98=E6=A1=A3=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 24 +- config.js | 24 +- convert.js | 35 ++ manifest.json | 10 +- package-lock.json | 509 +++++++++++++++++ package.json | 7 + pages.json | 50 +- pages/category-question/category-question.vue | 373 ++++++++++++ pages/category/category.vue | 162 ++++++ pages/gameplay/gameplay.vue | 190 +++++++ pages/index/index.vue | 371 +++++------- pages/login/login.vue | 308 ++++++---- pages/mine/mine.vue | 82 ++- pages/quick/quick.vue | 533 ++++++++++++++++++ pages/random/random.vue | 368 ++++++++++++ static/tab-game-active.png | Bin 0 -> 707 bytes static/tab-game-active.svg | 6 + static/tab-game.png | Bin 0 -> 705 bytes static/tab-game.svg | 6 + static/tab-home-active.png | Bin 0 -> 1249 bytes static/tab-home-active.svg | 5 + static/tab-home.png | Bin 0 -> 1257 bytes static/tab-home.svg | 5 + static/tab-mine-active.png | Bin 0 -> 1271 bytes static/tab-mine-active.svg | 5 + static/tab-mine.png | Bin 0 -> 1301 bytes static/tab-mine.svg | 5 + utils/api.js | 78 ++- 28 files changed, 2738 insertions(+), 418 deletions(-) create mode 100644 convert.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 pages/category-question/category-question.vue create mode 100644 pages/category/category.vue create mode 100644 pages/gameplay/gameplay.vue create mode 100644 pages/quick/quick.vue create mode 100644 pages/random/random.vue create mode 100644 static/tab-game-active.png create mode 100644 static/tab-game-active.svg create mode 100644 static/tab-game.png create mode 100644 static/tab-game.svg create mode 100644 static/tab-home-active.png create mode 100644 static/tab-home-active.svg create mode 100644 static/tab-home.png create mode 100644 static/tab-home.svg create mode 100644 static/tab-mine-active.png create mode 100644 static/tab-mine-active.svg create mode 100644 static/tab-mine.png create mode 100644 static/tab-mine.svg diff --git a/App.vue b/App.vue index 8c2b732..d9d2e01 100644 --- a/App.vue +++ b/App.vue @@ -1,17 +1,19 @@ diff --git a/config.js b/config.js index 5806535..f8146b8 100644 --- a/config.js +++ b/config.js @@ -1,11 +1,29 @@ const config = { - baseUrl: 'http://127.0.0.1:8503', + baseUrl: getBaseUrl(), api: { login: '/gw/login', - getQuestion: '/user/get_question', - answerQuestion: '/user/answer_question' + getQuestion: '/qgdzs/get_question', + answerQuestion: '/qgdzs/answer_question', + getAllCategory: '/qgdzs/get_all_category' }, timeout: 30000 } +function getBaseUrl() { + var baseUrl = 'http://127.0.0.1:8503' + //#ifdef MP-WEIXIN + const accountInfo = uni.getAccountInfoSync(); + if (accountInfo.miniProgram.envVersion == 'develop') { + baseUrl = 'http://127.0.0.1:8503' + } + if (accountInfo.miniProgram.envVersion == 'trial') { + baseUrl = 'https://www.hlsq.asia/api' + } + if (accountInfo.miniProgram.envVersion == 'release') { + baseUrl = 'https://www.hlsq.asia/api' + } + //#endif + return baseUrl +} + export default config diff --git a/convert.js b/convert.js new file mode 100644 index 0000000..68e4624 --- /dev/null +++ b/convert.js @@ -0,0 +1,35 @@ +const sharp = require('sharp'); +const fs = require('fs'); +const path = require('path'); + +const icons = [ + { svg: 'static/tab-home.svg', png: 'static/tab-home.png' }, + { svg: 'static/tab-home-active.svg', png: 'static/tab-home-active.png' }, + { svg: 'static/tab-game.svg', png: 'static/tab-game.png' }, + { svg: 'static/tab-game-active.svg', png: 'static/tab-game-active.png' }, + { svg: 'static/tab-mine.svg', png: 'static/tab-mine.png' }, + { svg: 'static/tab-mine-active.svg', png: 'static/tab-mine-active.png' } +]; + +async function convertSvgToPng() { + console.log('开始转换SVG到PNG...'); + + for (const icon of icons) { + try { + const svgBuffer = fs.readFileSync(icon.svg); + + await sharp(svgBuffer) + .resize(81, 81) + .png() + .toFile(icon.png); + + console.log(`✓ ${icon.svg} -> ${icon.png}`); + } catch (error) { + console.error(`✗ 转换失败: ${icon.svg}`, error.message); + } + } + + console.log('转换完成!'); +} + +convertSvgToPng().catch(console.error); diff --git a/manifest.json b/manifest.json index 4aff211..7261f00 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,9 @@ { - "name" : "qgdzs", - "appid" : "", + "name" : "卷王大乱斗", + "appid" : "__UNI__3947B70", "description" : "", - "versionName" : "1.0.0", - "versionCode" : "100", + "versionName" : "1.0.7", + "versionCode" : 107, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { @@ -50,7 +50,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "", + "appid" : "wx1b6ea981a8bafd4e", "setting" : { "urlCheck" : false }, diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..3e87209 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,509 @@ +{ + "name": "svg-to-png", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "svg-to-png", + "version": "1.0.0", + "dependencies": { + "sharp": "^0.33.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.8.1", + "resolved": "https://registry.npmmirror.com/@emnapi/runtime/-/runtime-1.8.1.tgz", + "integrity": "sha512-mehfKSMWjjNol8659Z8KxEMrdSJDDot5SXMq00dM8BN4o+CLNXQ0xH2V7EchNHV4RmbZLmmPdEaXZc5H2FXmDg==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmmirror.com/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmmirror.com/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmmirror.com/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmmirror.com/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "license": "MIT", + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmmirror.com/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-arrayish": { + "version": "0.3.4", + "resolved": "https://registry.npmmirror.com/is-arrayish/-/is-arrayish-0.3.4.tgz", + "integrity": "sha512-m6UrgzFVUYawGBh1dUsWR5M2Clqic9RVXC/9f8ceNlv2IcO9j9J/z8UoCLPqtsPBFNzEpfR3xftohbfqDx8EQA==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmmirror.com/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmmirror.com/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5" + } + }, + "node_modules/simple-swizzle": { + "version": "0.2.4", + "resolved": "https://registry.npmmirror.com/simple-swizzle/-/simple-swizzle-0.2.4.tgz", + "integrity": "sha512-nAu1WFPQSMNr2Zn9PGSZK9AGn4t/y97lEm+MXTtUDwfP0ksAIX4nO+6ruD9Jwut4C49SB1Ws+fbXsm/yScWOHw==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", + "optional": true + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..cd1e5ad --- /dev/null +++ b/package.json @@ -0,0 +1,7 @@ +{ + "name": "svg-to-png", + "version": "1.0.0", + "dependencies": { + "sharp": "^0.33.0" + } +} diff --git a/pages.json b/pages.json index 10beca0..397d3c5 100644 --- a/pages.json +++ b/pages.json @@ -18,31 +18,67 @@ "navigationBarTitleText": "登录", "navigationStyle": "custom" } + }, + { + "path": "pages/gameplay/gameplay", + "style": { + "navigationBarTitleText": "玩法选择" + } + }, + { + "path": "pages/random/random", + "style": { + "navigationBarTitleText": "随机答题" + } + }, + { + "path": "pages/category/category", + "style": { + "navigationBarTitleText": "类目答题" + } + }, + { + "path": "pages/category-question/category-question", + "style": { + "navigationBarTitleText": "类目题目" + } + }, + { + "path": "pages/quick/quick", + "style": { + "navigationBarTitleText": "快速答题" + } } ], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "qgdzs", "navigationBarBackgroundColor": "#F8F8F8", - "backgroundColor": "#F8F8F8" + "backgroundColor": "#f0f0f0" }, "tabBar": { "color": "#7A7E83", "selectedColor": "#667eea", "borderStyle": "black", - "backgroundColor": "#ffffff", - "fontSize": "14px", + "backgroundColor": "#f5f5f5", + "fontSize": "15px", "list": [ { "pagePath": "pages/index/index", - "iconPath": "", - "selectedIconPath": "", + "iconPath": "static/tab-home.png", + "selectedIconPath": "static/tab-home-active.png", "text": "首页" }, + { + "pagePath": "pages/gameplay/gameplay", + "iconPath": "static/tab-game.png", + "selectedIconPath": "static/tab-game-active.png", + "text": "玩法选择" + }, { "pagePath": "pages/mine/mine", - "iconPath": "", - "selectedIconPath": "", + "iconPath": "static/tab-mine.png", + "selectedIconPath": "static/tab-mine-active.png", "text": "我的" } ] diff --git a/pages/category-question/category-question.vue b/pages/category-question/category-question.vue new file mode 100644 index 0000000..89afcfb --- /dev/null +++ b/pages/category-question/category-question.vue @@ -0,0 +1,373 @@ + + + + + diff --git a/pages/category/category.vue b/pages/category/category.vue new file mode 100644 index 0000000..f320e87 --- /dev/null +++ b/pages/category/category.vue @@ -0,0 +1,162 @@ + + + + + diff --git a/pages/gameplay/gameplay.vue b/pages/gameplay/gameplay.vue new file mode 100644 index 0000000..a3c1e79 --- /dev/null +++ b/pages/gameplay/gameplay.vue @@ -0,0 +1,190 @@ + + + + + diff --git a/pages/index/index.vue b/pages/index/index.vue index 0f7cd54..f4ebeb3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1,147 +1,74 @@ + + diff --git a/pages/random/random.vue b/pages/random/random.vue new file mode 100644 index 0000000..2b9b7dc --- /dev/null +++ b/pages/random/random.vue @@ -0,0 +1,368 @@ + + + + + diff --git a/static/tab-game-active.png b/static/tab-game-active.png new file mode 100644 index 0000000000000000000000000000000000000000..8c89eb804579c3c70855c1af692663315cf7eaca GIT binary patch literal 707 zcmeAS@N?(olHy`uVBq!ia0vp^fgsGm1|(PYdzk?#&H|6fVg?3oVGw3ym^DX&fq|*i z)5S5QV$R!Jr}Hj5h_F4_yl@Zql;bC*A2^%GreEF|->_gA?+2z%}63{j{5NO|Cckgk)cFUgK zGRKtpl7pRYR_mju>UG|>(8yFtKKv=eitj-{_XGDgRztP{>vyaF%@t7sysxm_a{I8^y#ogcthoJm6ta*Mr|tjHZ6Lh>oJv=73bVLQ(9vW%T;}O=V@ho|it(>E9OKr?cBzP6s4;U&?e^2%-+!*N z0GV8I@zqUhKmRlJ;>ox3POm%g-%!o-I4hIpY7Z+h0U;+IL8YI39ExomhEIQeNXyRn zR_*yK{D{`gkNm$n1FhY^a&5dRHS1!^)`zj?^UhqV%ocuBr*CLi^G@w6XW_0#V*3RD zH_WKwDl}Rf*uh?F|Mt(z4Q_AOl=WTe-RHCTeQ|o>(T&;{L=#+{ zt}NfDf4N&L;8)8M?hj(iEyAjzOF9$J~>_WwD zE46^J!+q#S@Ba(yrgX&{&yEgJ?LD#Prun6R(YMd7zde=vgVt}iTXr9}E>DW&cX(^_ nvSwjkXc|8YJT)*dESUY&T+#kON!cNjw;*9pS3j3^P6 + + + + + diff --git a/static/tab-game.png b/static/tab-game.png new file mode 100644 index 0000000000000000000000000000000000000000..45abbe55e8140707959fd6b2ec3c926a1238d0f2 GIT binary patch literal 705 zcmeAS@N?(olHy`uVBq!ia0vp^fgsGm1|(PYdzk?#&H|6fVg?3oVGw3ym^DX&fq|*m z)5S5QV$R!J7xOL~h_F2v_PwtztTKM_&w@apW0xg1rhPh?8?F4SQIqlwfCX5d?tTW>OlzEF+Xv*mVf_52;ex7;2cjtV;UwbOcK&KYYLYo&KBMfaQ8 zx7K*Z3zi#Ic&zT;F`36HtEA(6+@4c6Q2C~WZEK25bj+1k1ErrdIsR7Nc4~U}=^(|hm!5Y{vNro&E_up)J}q;l z09e5-ew*749o;~ULZ^3H?M%4vZ*ua~<%g#)by{<2@{Y-@{BP|oyXNe%*A`8wI;0eXUNi_Sa_iW+sIj~{(5z4Wr~gLZ zPk$euth{C~VWNE`Pyf^;m6O{vJ(vBgl@@+vF)u~2=h*z&!jEzed;bXg!)VAY@~Gt2 z0s)|g2?F-LkDj&Mu$Oou{nza79hJ!MiOq33pT0}q%KuU~|CY-A`{xfVV#pR+w3q9z z;oddCfa|dC+-z~x^Xa$9^Dep7N9G#Lo%^RlzxlvFU2E}W#r>}ww5m^(h`EJ`ADc1l z$~)fG3{z|O?*9FR?`o&vvZv=g+T(APy-QDc%k*cmz4F`sAHTLg+Q!%L?EA;>m$!w_ iwiSRU2nL3Ryy@}xqBKN(G8GPkggssTT-G@yGywoN$VSot literal 0 HcmV?d00001 diff --git a/static/tab-game.svg b/static/tab-game.svg new file mode 100644 index 0000000..170b540 --- /dev/null +++ b/static/tab-game.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/static/tab-home-active.png b/static/tab-home-active.png new file mode 100644 index 0000000000000000000000000000000000000000..e7f3982d8b4c4249f66d99c84c694705daa1b865 GIT binary patch literal 1249 zcmV<71Rnc|P)J#*XbwoTnF?CzLzcNNRtt#fI^KE@@y%Js}%ypL^VhK8=~C@b@Qh1@EvT z!KG2YMN2hl4zr@Hfx@>~Jq=puo3fB8N9GZsU@^;s9y?jF6Bm~4^!3}ey4bXhhE1;c zdHlk%J$kZ|eY4T=ZWgQ`DBax{IXY)A|6I5Khi`wX+h}wygOKn|kbb0)=78%%jec6S zf7V)dJ=E$gd*XC8i;x2>BwjjHeaJNu`QTL5Hk;ideRp-mzVS)L4!#yA*DF_7y4v7< z$3Jruk}If);mR%+3PKs}I)!mWr3skU{!+?x#}Pd8zT4F1%8alO7#g~^!!?<3`Iqj| zg}nZ8`sRTnvez2vG_9qH`}Fj7-x@Lut6U!7*hlGtAOlCz?-@86r?zjkY?fWS6hde> z;nI0@V|uaHeZ4q$e%Wy}!dbrp>Ki*TG3wHJ^!xG@@weY^xlZYt*MzRn@TB7uvI|Si zTt%E;Y`RWo+ppt2{zOd9M2u6%Z#QhNBI5VC_65BQpCXRAb{s>wTu0)9`$*&xKKCbL za{6X$q1Qw-2~*xgkVzjEB2+tJH)pCT@0$=2lRC!TQ6?%=t$HxY$` zhVv9sCW$oih*&0naEw^~F=%)bG3xy}@KdTKn&R?G6){Yb|^DJ@>Sj_mP-o zO%xr&EKFJ!=gM7KoHPOPK1`!!?St1fG0W~O{$(fxj;Qs3*`E(H->ENro)DaBmTf@+M-t z9M0Inn~WbXWEMw+V!pFD2$wKkY!TrLuL33_MrNOPAu?E5!&8MmV-fz%1aZcK2xVjd zf)u+pr%%s6h!v{E5)kHsI(J5}#Miqp>oBh3G7GdOd$JG$O1P-Cy^n=j6~;U7o`h;a zSB0%U%!ih5vC=K+*E6gLaAijP3zlLM4zVI3B)siiwAJ<&EAHC^;CX683$snE$dudf z?`0}McD2qXSBy3Azv$QIQK8`L4HobsdJAkbQ7YMOSmK*hsNU;HM9%CF)(^~s7hZ|) z=gJ(+(}v~_M2F6 z22bDc81qgsJyes=$txak2HRo#EiW8F5ClOG1VIo4K@bE%unpxe-OCg*8eHHC00000 LNkvXXu0mjf?&nz4 literal 0 HcmV?d00001 diff --git a/static/tab-home-active.svg b/static/tab-home-active.svg new file mode 100644 index 0000000..a017d6c --- /dev/null +++ b/static/tab-home-active.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/static/tab-home.png b/static/tab-home.png new file mode 100644 index 0000000000000000000000000000000000000000..debac2240b482ee2b031cd91819db2dd186204e1 GIT binary patch literal 1257 zcmV=P)?1IM4Qlr^bJsXqiHBF1*$%@aW1^k01|C!Z6n#091l9S5lyoWWOnPB zP0mj`TCF^5&;EU8=IoiXj1dGu5ClOG1VIo4K@bGdFSOPVb6I#^C@2VJX1RnbT)}T# znu<`y;<0lMS2~}Yp`13);dN{$GcZuxlT+pZSMUv&<}Ql0b%TbG<{Zz%e*8YRQ_xyJ zDijO~1vlM<>nZ3>^iZw!6KuPZ$(-HAm3c!bxRb1S>y1luTgbxe_3FW2e zIk5E6Cz0*ZBcr%hUUZxr%?+*f?hrzngDy94{KJoX&Udmf5_ye+k;wL~mUUjWb80x_ zTSJEVK$p&A7}JZ*uIt753*Wg7X=%RpDj;T-1tvxvI*)N*k|O?cebseH*S#imv)a7i z^zSQUYqh@;6|qvSx_KfFX>Im-6S2D|VqL7+Y$hrqexGY!FuL$4qM3E=I6lfH>WLM1 zPvjD&y@}Y}eY0tv6T2c__9mi`=6BbQpTBT1Q4znLn|Bvc!KybAC3f~IT7(J&j6#1qTaYh~v?bPSr_M2x!uRU9uxW^XXr5Y>KZWn&VeUa#A+ z_gtTyL-52HbE4?l>8a=}4hq@H;vDH@aaMX{aVA}}IKj+`?yK{?_E|fhShrivCr+OE zBKB|lU!7ybiQ+!PbQWe~aFN&y{QT-dIrb0^C{8p(N!`f3t2Tx|8290$96pKQ5zjHn z5N8$cEuv8#MZ|KrWN*laaanjam027ShRH z2=4}e1hL102n8~gUKmnsj@Ei_yFxWx0^SO0-x@8 z)(^2ztHOBq-IGu)=&G>woB7c4E!HOWi7&G>AQa>R^};Mm6GED?pafL#E=wb#^X8Q2 zp$#p}HnB95Q|3V2666@ex00GU@W06Fk*9<*KlE2XxP;LH+fHOKj+BK%SfToWz3-Ng zh1Y_O1C!wJ;UkZ51#cy>$#tK2H@a_`?qxd#t@Uo6hnKKE5EG-0!qvHgudq-vm~4#K z7s$2Q*L@Rf26x|Z8}r{{dboq<-B&zjupPGF@xl=VK@bE%5ClOG1VIo4>nnc)i2Af! T? + + + + diff --git a/static/tab-mine-active.png b/static/tab-mine-active.png new file mode 100644 index 0000000000000000000000000000000000000000..f8e50d9c0e40c8aaa3bfb3317a527a98c018f894 GIT binary patch literal 1271 zcmVMHI)UzbJ@9`6EF5KBB_^z>kw}NIf+3oR$WZ z1V~9ev(O6x@mn0A{=T9A-POGVpLI3Q6{duE+Db)a@)Cl9?%ixed! z>)Ewu)|rp=Q^qqd|%(>PS))N0d5DOp9iU~ry<^I4^>lKr~~xxux_L$C_N5B z|JD}qR)_l~5XIfBd%!JR>K8z&g^mb#JH&-*aG_oe0^G{7On?8McY#pjofK~k`C8v_>=60ilOYC;8?l6)abpxE|q56W=&mNfO#a%w<57 zo}jy;$>csfF^i4H62^hf`{4Mjk%-awTupz1uC!o-z&lCXY`xkO*zPJ;MjA%f4UCjcMZ8XXc;*T~ z#RNl-ICAm^CgGzmZkT(c2!Xi*B&f!Wp7}eGh$m0a8H>n;nqV%_Qz$-czAkC}>hxSP z5x+GTk<5vDB##QJ=9BpNON-$gg|sf%){s#}I>{uG-dO1RWFo4wb_E375xbx2hYXVKo3$l;dxhl-`aWwS@*sRVjY*KvHZJbA zZ=tb-?;kVU_O0!W;ZycRlwm%#iAaqjM=PkO*DpY*=_bB@BuN2cwe?8N?TIMVi)l`V zj7nXfeN)9Nlk-@)RSKg|`cA*^OHvB^Ur*En)JN-NXu1Qp3SHBdPuDdC>aR?NvryNZ>#XHM9mv*=MeSp*k;~z>IBVm}Z~f{$IQkFGTF>^%w+Hl?Wf4a+=Ygy7@3Ews{y<9a@@;5BU35N; zF(sG7ZPcL}cZ+Bs-Zk2ZIGaeP-&q^d`^*002ovPDHLkV1i*-WoG~Y literal 0 HcmV?d00001 diff --git a/static/tab-mine-active.svg b/static/tab-mine-active.svg new file mode 100644 index 0000000..8ac09a5 --- /dev/null +++ b/static/tab-mine-active.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/static/tab-mine.png b/static/tab-mine.png new file mode 100644 index 0000000000000000000000000000000000000000..e3d7de5017c9d506fdcd9b038bcca4e442168a6a GIT binary patch literal 1301 zcmV+w1?u{VP)qE6#cW3wB znQiBjoa}9PH#_sqnb|XE&JyDBcsw4D$K&yMJRXn7TAYjjd7*_&nT!l3i2z)B~a1vAlZlrA#P_- z+(|)BL=i25eNVZ1s;%wN7P8(ELbNa_?WSB_NlCoF8>n9x6nEis$a;i{(jyGyxrT_h zYPidZ0u;BC^@F~Ja``Oda-kUlu9!FL6x54Ch)pER?AgkungJcmQ z#9b8RH#P-aVdMFHc`M1B2XZy;fOsqC$qz6Y%XejP87ZcPF&e6nmC@5yy$s=zb)iXD4=(VWM%;?wNcsqet$~-9w)1-$N^caIwmYgKnP{1HO5n65y&x?jKWn^ZEc6Pgi9`i&Xmd(y|lDsB;wN2AG%cT zG89o>!8JT_1qQ{PrXF#;Z$KxZr?=nO8!^2`T!ALY#*BUXc_I-%KKYsXkOp~%xIhrd z2aG)dMLd~M#81pc425(dA4!)Js>Yq@`Jg|Mi0}7)m`p@afo%=Raz@&`6UkpJm4qV7 zFRcoQdmSudN`EcGP{o9ElNS;__b*SJvl=r}(Q$9mPM}q~4~M~X9OmX~y7R!xiJy%Y z1o9qhA{K;vB8^U<;W94zvaha>9_vZvxuHSnacd&t<`7G(BV2`vg=%$XO#y$cR`si| zzm=YV%d3|st%+Cw^?aJ0LBmwn;P9xvI5n+*o1G0)VR-y$YFZBrk7_7(r20Ixy`Y}6 zCL)FhEaeW_FsorsBRr8=FuR_Z@|?(Qd7{-hG2z>Jf7eTT{M*y|>b2{7etsb|{Eh#^ zbIlU5Amn4#L=20MxLL!8N5|F-Y499g(;N}S-BwpD6x3YYMvsh+MGmSPFQmL_Ja2J}IBHOhV2IOsFrAgjf7lnqHjGP%(`cOU;)3@yN<`e9%v?V4>b2{!MZ|j=CZY@Z zLG=wbqba@n7W`a}e4Tqwv>X^W6>9z5k#?M)Q&`SMm*N{&&$ z%++lF#rbv}$SrM0zhGghcZT_VOdP?vEf;%p$D zer2u9F|NK#$@9)&GC>G&8`+3Z(Q!ZS`(kxg^sNSY6Eo6`%e_G$@3Y+prw~H4U~v)F z#-OKCF5B_Dlkf;Khr4ok-uj-1$K&yMJRXn7 + + + + diff --git a/utils/api.js b/utils/api.js index b8d79b3..6d84dcb 100644 --- a/utils/api.js +++ b/utils/api.js @@ -1,50 +1,75 @@ import config from '../config.js' -import storage from './storage.js' const request = (options) => { return new Promise((resolve, reject) => { + const fullUrl = config.baseUrl + options.url + console.log('=== 请求开始 ===') + console.log('URL:', fullUrl) + console.log('Method:', options.method || 'GET') + console.log('Data:', options.data) + uni.request({ - url: config.baseUrl + options.url, + url: fullUrl, method: options.method || 'GET', data: options.data || {}, header: { 'Content-Type': 'application/json', - 'Authorization': storage.getToken() ? `Bearer ${storage.getToken()}` : '', ...options.header }, timeout: config.timeout, success: (res) => { + console.log('=== 请求成功 ===') + console.log('StatusCode:', res.statusCode) + console.log('Response:', res.data) + const { statusCode, data } = res if (statusCode === 200) { if (data.code === 0 || data.success === true) { resolve(data) } else { - uni.showToast({ - title: data.message || '请求失败', - icon: 'none' + console.error('=== 业务错误 ===') + console.error('Code:', data.code) + console.error('Message:', data.message) + uni.showModal({ + title: '请求失败', + content: data.message || '服务器返回错误', + showCancel: false }) reject(data) } - } else if (statusCode === 401) { - storage.removeToken() - storage.removeUserInfo() - uni.reLaunch({ - url: '/pages/login/login' - }) - reject(res) } else { - uni.showToast({ + console.error('=== HTTP错误 ===') + console.error('StatusCode:', statusCode) + console.error('Response:', data) + uni.showModal({ title: '网络错误', - icon: 'none' + content: `状态码: ${statusCode}`, + showCancel: false }) reject(res) } }, fail: (err) => { - uni.showToast({ - title: '网络连接失败', - icon: 'none' + console.error('=== 请求失败 ===') + console.error('Error:', err) + console.error('Error Message:', err.errMsg) + + let errorMsg = '网络连接失败' + if (err.errMsg) { + if (err.errMsg.includes('timeout')) { + errorMsg = '请求超时,请检查网络' + } else if (err.errMsg.includes('fail')) { + errorMsg = '网络连接失败,请检查网络设置' + } else if (err.errMsg.includes('request:fail')) { + errorMsg = `连接失败: ${err.errMsg}` + } + } + + uni.showModal({ + title: '错误', + content: errorMsg, + showCancel: false }) reject(err) } @@ -53,21 +78,21 @@ const request = (options) => { } const api = { - login(phone, code) { + wxLogin(code) { return request({ url: config.api.login, method: 'POST', data: { - phone, - code + wxMiniCode: code } }) }, - getQuestion() { + getQuestion(categorySn) { return request({ url: config.api.getQuestion, - method: 'POST' + method: 'POST', + data: categorySn ? { category_sn: categorySn } : {} }) }, @@ -82,6 +107,13 @@ const api = { }) }, + getAllCategory() { + return request({ + url: config.api.getAllCategory, + method: 'POST' + }) + }, + get(url, data = {}) { return request({ url,