Yansen 2 anos atrás
pai
commit
dd986a9419
3 arquivos alterados com 65 adições e 64 exclusões
  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 Ver arquivo

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 Ver arquivo

1
 <template>
1
 <template>
2
   <div style="height: 100%;">
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
       </div>
13
       </div>
28
     </div>
14
     </div>
29
   </div>
15
   </div>
39
 // import parallaxing from '@/utils/parallaxing.js'
25
 // import parallaxing from '@/utils/parallaxing.js'
40
 
26
 
41
 const { play, pause } = useModel('audio');
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
 onMounted(() => {
29
 onMounted(() => {
67
-  vidRef.value.play();
68
-
69
   // parallaxing()
30
   // parallaxing()
70
   play()
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
 </script>
48
 </script>
73
 
49
 
74
 <style lang="less">
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
 .bell {
51
 .bell {
90
   position: fixed;
52
   position: fixed;
91
   z-index: 100;
53
   z-index: 100;

+ 2
- 1
src/router.js Ver arquivo

3
 
3
 
4
 const routes = [
4
 const routes = [
5
   // { path: '/', component: () => import('@/pages/Language.vue') },
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
   { path: '/bk1', component: () => import('@/pages/bk1/index.vue') },
8
   { path: '/bk1', component: () => import('@/pages/bk1/index.vue') },
8
   { path: '/pg2-2', component: () => import('@/pages/pg2-2/index.vue') },
9
   { path: '/pg2-2', component: () => import('@/pages/pg2-2/index.vue') },
9
   { path: '/pg4', component: () => import('@/pages/pg4/video.vue') },
10
   { path: '/pg4', component: () => import('@/pages/pg4/video.vue') },