瀏覽代碼

修改数字滚动

zy1125 1 年之前
父節點
當前提交
436c68c65a
共有 4 個文件被更改,包括 36 次插入9 次删除
  1. 26 5
      package-lock.json
  2. 1 0
      package.json
  3. 6 3
      src/components/CircleProgress.vue
  4. 3 1
      src/components/home.vue

+ 26 - 5
package-lock.json

@@ -79,11 +79,6 @@
79 79
         "fastq": "^1.6.0"
80 80
       }
81 81
     },
82
-    "@popperjs/core": {
83
-      "version": "npm:@sxzz/popperjs-es@2.11.7",
84
-      "resolved": "https://registry.npmmirror.com/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
85
-      "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
86
-    },
87 82
     "@rollup/pluginutils": {
88 83
       "version": "5.0.2",
89 84
       "resolved": "https://registry.npmmirror.com/@rollup/pluginutils/-/pluginutils-5.0.2.tgz",
@@ -349,6 +344,11 @@
349 344
         "delayed-stream": "~1.0.0"
350 345
       }
351 346
     },
347
+    "core-js": {
348
+      "version": "3.33.0",
349
+      "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.33.0.tgz",
350
+      "integrity": "sha512-HoZr92+ZjFEKar5HS6MC776gYslNOKHt75mEBKWKnPeFDpZ6nH5OeF3S6HFT1mUAUZKrzkez05VboaX8myjSuw=="
351
+    },
352 352
     "csstype": {
353 353
       "version": "2.6.20",
354 354
       "resolved": "https://registry.npmmirror.com/csstype/-/csstype-2.6.20.tgz",
@@ -402,6 +402,13 @@
402 402
         "lodash-unified": "^1.0.2",
403 403
         "memoize-one": "^6.0.0",
404 404
         "normalize-wheel-es": "^1.2.0"
405
+      },
406
+      "dependencies": {
407
+        "@popperjs/core": {
408
+          "version": "npm:@sxzz/popperjs-es@2.11.7",
409
+          "resolved": "https://registry.npmjs.org/@sxzz/popperjs-es/-/popperjs-es-2.11.7.tgz",
410
+          "integrity": "sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ=="
411
+        }
405 412
       }
406 413
     },
407 414
     "emojis-list": {
@@ -1192,11 +1199,25 @@
1192 1199
         "@vue/shared": "3.2.37"
1193 1200
       }
1194 1201
     },
1202
+    "vue-count-to": {
1203
+      "version": "1.0.13",
1204
+      "resolved": "https://registry.npmjs.org/vue-count-to/-/vue-count-to-1.0.13.tgz",
1205
+      "integrity": "sha512-6R4OVBVNtQTlcbXu6SJ8ENR35M2/CdWt3Jmv57jOUM+1ojiFmjVGvZPH8DfHpMDSA+ITs+EW5V6qthADxeyYOQ=="
1206
+    },
1195 1207
     "vue-demi": {
1196 1208
       "version": "0.14.5",
1197 1209
       "resolved": "https://registry.npmmirror.com/vue-demi/-/vue-demi-0.14.5.tgz",
1198 1210
       "integrity": "sha512-o9NUVpl/YlsGJ7t+xuqJKx8EBGf1quRhCiT6D/J0pfwmk9zUwYkC7yrF4SZCe6fETvSM3UNL2edcbYrSyc4QHA=="
1199 1211
     },
1212
+    "vue3-count-to": {
1213
+      "version": "1.1.2",
1214
+      "resolved": "https://registry.npmjs.org/vue3-count-to/-/vue3-count-to-1.1.2.tgz",
1215
+      "integrity": "sha512-C5AvlcGfyM4XvFqPDkni94rqGd5K/+RB+B4xv/1NQx3RrdC+GvXPFzeXW5hWL/jh8ehWLm4LITyK0eMKf4iJbg==",
1216
+      "requires": {
1217
+        "core-js": "^3.8.1",
1218
+        "vue-count-to": "^1.0.13"
1219
+      }
1220
+    },
1200 1221
     "vue3-video-play": {
1201 1222
       "version": "1.3.1-beta.6",
1202 1223
       "resolved": "https://registry.npmmirror.com/vue3-video-play/-/vue3-video-play-1.3.1-beta.6.tgz",

+ 1 - 0
package.json

@@ -15,6 +15,7 @@
15 15
     "leader-line": "^1.0.7",
16 16
     "postcss-pxtorem": "^6.0.0",
17 17
     "vue": "^3.2.25",
18
+    "vue3-count-to": "^1.1.2",
18 19
     "vue3-video-play": "^1.3.1-beta.6"
19 20
   },
20 21
   "devDependencies": {

+ 6 - 3
src/components/CircleProgress.vue

@@ -2,7 +2,8 @@
2 2
     <div>
3 3
         <div class="number" v-if="textPosition == 'top'">
4 4
             <ul class="flex">
5
-                <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" />
5
+                <!-- <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" /> -->
6
+                <count-to :useEasing="false" style="font-size: 0.08rem;"  :startVal='1' :endVal='targetValue' :duration='2000'></count-to>
6 7
                 <span>个</span>
7 8
             </ul>
8 9
         </div>
@@ -21,7 +22,8 @@
21 22
 
22 23
     <div class="bottomNumber" v-if="textPosition == 'bottom'">
23 24
         <ul class="flex">
24
-            <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" />
25
+            <!-- <ScrollNum v-for="(num, idx) of numArr" :key="idx" as="li" :i="num" :delay="idx + 1" /> -->
26
+            <count-to :useEasing="false" style="font-size: 0.08rem;"  :startVal='1' :endVal='targetValue' :duration='2000'></count-to>
25 27
             <span> (人)</span>
26 28
         </ul>
27 29
 
@@ -29,7 +31,8 @@
29 31
 </template>
30 32
 <script setup lang="ts">
31 33
 import { ref, computed, toRefs, watch, onMounted } from 'vue';
32
-import ScrollNum from './roll.vue'
34
+import ScrollNum from './roll.vue';
35
+import { CountTo } from 'vue3-count-to';
33 36
 
34 37
 const props = defineProps({
35 38
     targetValue: {

+ 3 - 1
src/components/home.vue

@@ -183,7 +183,9 @@ export default ({
183 183
             }
184 184
             clickData.value = json;
185 185
             if (json.deviceCode) {
186
-                getClassDetail(json.deviceCode).then(res => {
186
+                console.log('sadasd',json.deviceCode);
187
+                let replacedStr = json.deviceCode.replace("/", "A");
188
+                getClassDetail(replacedStr).then(res => {
187 189
                     classDeviceInfo.value = res.data;
188 190
                     classDeviceInfo.value.map(i => {
189 191
                         if (i.value == "在线") {