Parcourir la source

具体游戏文件优化

JutarryWu il y a 7 mois
Parent
commit
15f3b64079

+ 22 - 4
.gitignore

@@ -1,7 +1,25 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+lerna-debug.log*
+
 node_modules
-.DS_Store
-dist*
+dist
 dist-ssr
 *.local
-.eslintcache
-.stylelintcache
+stats.html
+
+# Editor directories and files
+.idea
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
+
+# Misc
+.DS_Store

+ 2 - 1
package.json

@@ -32,7 +32,6 @@
     "dayjs": "^1.11.13",
     "echarts": "^5.5.1",
     "eruda": "^3.2.3",
-    "lodash-es": "^4.17.21",
     "mitt": "^3.0.1",
     "mockjs": "^1.1.0",
     "nprogress": "^0.2.0",
@@ -74,6 +73,7 @@
     "http-server": "^14.1.1",
     "less": "^4.2.0",
     "lint-staged": "^15.2.9",
+    "lodash-es": "^4.17.21",
     "npm-run-all2": "^6.2.2",
     "picocolors": "^1.0.1",
     "plop": "^4.0.1",
@@ -102,6 +102,7 @@
     "vite-plugin-pages": "^0.32.3",
     "vite-plugin-svg-icons": "^2.0.1",
     "vite-plugin-vue-devtools": "^7.3.9",
+    "vue-countup-v3": "^1.4.2",
     "vue-tsc": "^2.1.4"
   },
   "simple-git-hooks": {

+ 21 - 3
pnpm-lock.yaml

@@ -38,9 +38,6 @@ importers:
       eruda:
         specifier: ^3.2.3
         version: 3.2.3
-      lodash-es:
-        specifier: ^4.17.21
-        version: 4.17.21
       mitt:
         specifier: ^3.0.1
         version: 3.0.1
@@ -159,6 +156,9 @@ importers:
       lint-staged:
         specifier: ^15.2.9
         version: 15.2.9
+      lodash-es:
+        specifier: ^4.17.21
+        version: 4.17.21
       npm-run-all2:
         specifier: ^6.2.2
         version: 6.2.2
@@ -243,6 +243,9 @@ importers:
       vite-plugin-vue-devtools:
         specifier: ^7.3.9
         version: 7.3.9(rollup@4.21.2)(vite@5.4.2(@types/node@22.5.2)(less@4.2.0)(sass@1.77.8)(terser@5.31.6))(vue@3.4.38(typescript@5.5.4))
+      vue-countup-v3:
+        specifier: ^1.4.2
+        version: 1.4.2(vue@3.4.38(typescript@5.5.4))
       vue-tsc:
         specifier: ^2.1.4
         version: 2.1.4(typescript@5.5.4)
@@ -2721,6 +2724,9 @@ packages:
       typescript:
         optional: true
 
+  countup.js@2.8.0:
+    resolution: {integrity: sha512-f7xEhX0awl4NOElHulrl4XRfKoNH3rB+qfNSZZyjSZhaAoUk6elvhH+MNxMmlmuUJ2/QNTWPSA7U4mNtIAKljQ==}
+
   crc-32@1.2.2:
     resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==}
     engines: {node: '>=0.8'}
@@ -5886,6 +5892,11 @@ packages:
   vscode-uri@3.0.8:
     resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==}
 
+  vue-countup-v3@1.4.2:
+    resolution: {integrity: sha512-nRC65jBcdgwybxqztgd/WaK8ZN5T9ECPyiCFGYFMewCsvqdRVo1CtpT7JREcPNF837Fgu/izTSFiuzrIGD6w0A==}
+    peerDependencies:
+      vue: ^3.0.0
+
   vue-demi@0.14.10:
     resolution: {integrity: sha512-nMZBOwuzabUO0nLgIcc6rycZEebF6eeUfaiQx9+WSk8e29IbLvPU9feI6tqW4kTo3hvoYAJkMh8n8D0fuISphg==}
     engines: {node: '>=12'}
@@ -8747,6 +8758,8 @@ snapshots:
     optionalDependencies:
       typescript: 5.5.4
 
+  countup.js@2.8.0: {}
+
   crc-32@1.2.2: {}
 
   crc32-stream@6.0.0:
@@ -12230,6 +12243,11 @@ snapshots:
 
   vscode-uri@3.0.8: {}
 
+  vue-countup-v3@1.4.2(vue@3.4.38(typescript@5.5.4)):
+    dependencies:
+      countup.js: 2.8.0
+      vue: 3.4.38(typescript@5.5.4)
+
   vue-demi@0.14.10(vue@3.4.38(typescript@5.5.4)):
     dependencies:
       vue: 3.4.38(typescript@5.5.4)

+ 0 - 1
src/types/typed-router.d.ts

@@ -21,7 +21,6 @@ declare module 'vue-router/auto-routes' {
     '/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
     '/[...all]': RouteRecordInfo<'/[...all]', '/:all(.*)', { all: ParamValue<true> }, { all: ParamValue<false> }>,
     '/cognitiveTasks/BreadthTraining/': RouteRecordInfo<'/cognitiveTasks/BreadthTraining/', '/cognitiveTasks/BreadthTraining', Record<never, never>, Record<never, never>>,
-    '/cognitiveTasks/BreadthTraining/BTRandomPentagram': RouteRecordInfo<'/cognitiveTasks/BreadthTraining/BTRandomPentagram', '/cognitiveTasks/BreadthTraining/BTRandomPentagram', Record<never, never>, Record<never, never>>,
     '/cognitiveTasks/cocos/': RouteRecordInfo<'/cognitiveTasks/cocos/', '/cognitiveTasks/cocos', Record<never, never>, Record<never, never>>,
     '/cognitiveTasks/ContinueAddition/': RouteRecordInfo<'/cognitiveTasks/ContinueAddition/', '/cognitiveTasks/ContinueAddition', Record<never, never>, Record<never, never>>,
     '/cognitiveTasks/main/': RouteRecordInfo<'/cognitiveTasks/main/', '/cognitiveTasks/main', Record<never, never>, Record<never, never>>,

+ 2 - 2
src/views/[...all].vue

@@ -27,7 +27,7 @@ onMounted(() => {
 })
 
 function goBack() {
-  router.push('/')
+  router.go(-1)
 }
 </script>
 
@@ -42,7 +42,7 @@ function goBack() {
         抱歉,你访问的页面不存在
       </div>
       <HButton @click="goBack">
-        {{ data.countdown }} 秒后,返回
+        {{ data.countdown }} 秒后,返回上一
       </HButton>
     </div>
   </div>

+ 1 - 1
src/views/cognitiveTasks/BreadthTraining/BTRandomPentagram.vue → src/views/cognitiveTasks/BreadthTraining/components/BTRandomPentagram.vue

@@ -103,7 +103,7 @@ defineExpose({
         :class="{ 'change-show': !changeShow }"
         :width="starWidth"
         :height="starHeight"
-        src="@/assets/images/task/breadthTraining/star.png"
+        src="../../../../assets/images/task/breadthTraining/star.png"
         alt=""
       >
     </div>

+ 2 - 2
src/views/cognitiveTasks/BreadthTraining/index.vue

@@ -10,7 +10,7 @@
 import { shuffle } from 'lodash-es'
 import CountUp from 'vue-countup-v3'
 import { showSuccessToast } from 'vant'
-import BTRandomPentagram from './BTRandomPentagram.vue'
+import BTRandomPentagram from './components/BTRandomPentagram.vue'
 import GameAPI, { type GameResultVO, type GameVO } from '@/api/game'
 
 const router = useRouter()
@@ -148,7 +148,7 @@ function nextClick() {
 function choiceClick(choice: number, index: number) {
   setTimeout(() => {
     choiceAreaShow.value = false
-  }, 400)
+  }, 500)
   if (mainData.dataList[currentIndex.value].choice === '') {
     selectiveIndex.value = index
     mainData.dataList[currentIndex.value].endTime = Date.now()