Yansen пре 2 година
родитељ
комит
dd986a9419
3 измењених фајлова са 65 додато и 64 уклоњено
  1. 38
    0
      src/pages/FirstVideo.vue
  2. 25
    63
      src/pages/index.vue
  3. 2
    1
      src/router.js

+ 38
- 0
src/pages/FirstVideo.vue Прегледај датотеку

@@ -0,0 +1,38 @@
1
+<template>
2
+  <div class="page pg-bg">
3
+    <video
4
+      webkit-playsinline
5
+      playsinline
6
+      src="/video/开始视频.mp4"
7
+      autoplay="autoplay"
8
+      ref="vidRef"
9
+      @play="pause()"
10
+      @pause="play()"
11
+      @ended="router.replace('/index')"
12
+    />
13
+  </div>
14
+</template>
15
+
16
+<script setup>
17
+import { onMounted, ref, watch } from 'vue'
18
+import { useModel } from '@zjxpcyc/vue-tiny-store'
19
+import { useRouter } from 'vue-router';
20
+
21
+const { play, pause } = useModel('audio');
22
+const vidRef = ref();
23
+const first = ref(true);
24
+
25
+const router = useRouter();
26
+
27
+onMounted(() => {
28
+  vidRef.value.play();
29
+})
30
+
31
+</script>
32
+
33
+<style lang="less" scoped>
34
+ video {
35
+    width: 100%;
36
+    height: 100%;
37
+  }
38
+</style>

+ 25
- 63
src/pages/index.vue Прегледај датотеку

@@ -1,29 +1,15 @@
1 1
 <template>
2 2
   <div style="height: 100%;">
3
-    <div class="first-video" v-if="first">
4
-      <video
5
-        webkit-playsinline
6
-        playsinline
7
-        src="/video/开始视频.mp4"
8
-        autoplay="autoplay"
9
-        ref="vidRef"
10
-        @play="pause()"
11
-        @pause="play()"
12
-        @ended="first = false"
13
-      />
14
-    </div>
15
-    <div v-else style="height: 100%;">
16
-      <Bell class="bell" />
17
-      <div class="pages slide-container">
18
-        <div class="slide-page">
19
-          <Pg1 class="container" />
20
-        </div>
21
-        <div class="slide-page">
22
-          <Pg2 class="container" />
23
-        </div>
24
-        <div class="slide-page">
25
-          <Pg3 class="container" />
26
-        </div>
3
+    <Bell class="bell" />
4
+    <div class="pages slide-container">
5
+      <div class="slide-page">
6
+        <Pg1 class="container" />
7
+      </div>
8
+      <div class="slide-page">
9
+        <Pg2 class="container" />
10
+      </div>
11
+      <div class="slide-page">
12
+        <Pg3 class="container" />
27 13
       </div>
28 14
     </div>
29 15
   </div>
@@ -39,53 +25,29 @@ import Pg3 from './pg3/index.vue'
39 25
 // import parallaxing from '@/utils/parallaxing.js'
40 26
 
41 27
 const { play, pause } = useModel('audio');
42
-const vidRef = ref();
43
-const first = ref(true);
44
-
45
-watch(first, (val) => {
46
-  if (!val) {
47
-    const t = setTimeout(() => {
48
-      var slidepage = new window.slidePage({
49
-        slideContainer: '.slide-container',
50
-        slidePages: '.slide-page',
51
-        page: 1,
52
-        refresh: false,
53
-        dragMode: false,
54
-        useWheel: true,
55
-        useSwipe: true,
56
-        useAnimation : true,
57
-
58
-        // Events
59
-        before: function(origin,direction,target){},
60
-        after: function(origin,direction,target){},
61
-    });
62
-    }, 500);
63
-  }
64
-});
65 28
 
66 29
 onMounted(() => {
67
-  vidRef.value.play();
68
-
69 30
   // parallaxing()
70 31
   play()
32
+  
33
+  var slidepage = new window.slidePage({
34
+    slideContainer: '.slide-container',
35
+    slidePages: '.slide-page',
36
+    page: 1,
37
+    refresh: false,
38
+    dragMode: false,
39
+    useWheel: true,
40
+    useSwipe: true,
41
+    useAnimation : true,
42
+
43
+    // Events
44
+    before: function(origin,direction,target){},
45
+    after: function(origin,direction,target){},
46
+    });
71 47
 })
72 48
 </script>
73 49
 
74 50
 <style lang="less">
75
-.first-video {
76
-  position: absolute;
77
-  z-index: 10;
78
-  width: 100%;
79
-  height: 100%;
80
-  left: 0;
81
-  top: 0;
82
-
83
-  & > video {
84
-    width: 100%;
85
-    height: 100%;
86
-  }
87
-}
88
-
89 51
 .bell {
90 52
   position: fixed;
91 53
   z-index: 100;

+ 2
- 1
src/router.js Прегледај датотеку

@@ -3,7 +3,8 @@ import { createRouter, createWebHashHistory } from 'vue-router'
3 3
 
4 4
 const routes = [
5 5
   // { path: '/', component: () => import('@/pages/Language.vue') },
6
-  { path: '/', component: () => import('@/pages/index.vue') },
6
+  { path: '/', component: () => import('@/pages/FirstVideo.vue') },
7
+  { path: '/index', component: () => import('@/pages/index.vue') },
7 8
   { path: '/bk1', component: () => import('@/pages/bk1/index.vue') },
8 9
   { path: '/pg2-2', component: () => import('@/pages/pg2-2/index.vue') },
9 10
   { path: '/pg4', component: () => import('@/pages/pg4/video.vue') },