瀏覽代碼

Merge branch 'master' of http://git.ycjcjy.com/H5/njDaTuSha

Yansen 2 年之前
父節點
當前提交
11ee523cf2

二進制
public/images/pg1/md1-1.jpg 查看文件


二進制
public/images/pg1/md1-1.png 查看文件


二進制
public/images/pg1/videocover.jpg 查看文件


二進制
public/images/pg2-2/照片1.png 查看文件


二進制
public/images/pg2-2/照片2.png 查看文件


二進制
public/images/pg2-2/照片3.png 查看文件


二進制
public/images/pg2-2/照片4.png 查看文件


二進制
public/video/9年活动.mp4 查看文件


+ 1
- 1
src/pages/pg1/Md2.vue 查看文件

@@ -12,7 +12,7 @@
12 12
           9年来,20万人加入“紫金草行动”,<br />
13 13
           把紫金草徽章佩戴在离心脏最近的地方。
14 14
         </p>
15
-        <img class="animate__animated animate__fadeInDown" style="animation-delay: 300ms;" src="/images/pg1/md1-1.jpg" alt="">
15
+        <img class="animate__animated animate__fadeInDown" style="animation-delay: 300ms;" src="/images/pg1/md1-1.png" alt="">
16 16
         <p class="txt animate__animated animate__fadeInDown" style="animation-delay: 600ms; text-align: right">
17 17
           在2亿人心中,和平的愿景被播撒。
18 18
         </p>

+ 15
- 17
src/pages/pg1/Md3.vue 查看文件

@@ -1,7 +1,7 @@
1 1
 <template>
2 2
   <Modal>
3 3
     <div class="md3-box md-bg">
4
-      <div class="md3-header ">
4
+      <div class="md3-header">
5 5
         <Animate
6 6
           comp="img"
7 7
           name="animate__fadeInDown"
@@ -10,28 +10,26 @@
10 10
           :ready="true"
11 11
         />
12 12
       </div>
13
-      <div class="md3-context">
14
-        <video
15
-          webkit-playsinline
16
-          playsinline
17
-          preload="auto"
18
-          autoplay="autoplay"
19
-          controls="controls"
20
-          src="/video/9年活动.mp4"
21
-          @play="pause()"
22
-          @pause="play()"
23
-        ></video>
13
+      <div class="md3-context" @click="router.push('/pg1/video')">
14
+        <img
15
+          class="animate__animated animate__fadeInDown"
16
+          style="animation-delay: 300ms"
17
+          src="/images/pg1/videocover.jpg"
18
+          alt=""
19
+        />
24 20
       </div>
25 21
     </div>
26 22
   </Modal>
27 23
 </template>
28 24
 
29 25
 <script setup>
30
-  import { useModel } from '@zjxpcyc/vue-tiny-store';
31
-  import Modal from '@/components/Modal.vue';
32
-  import Animate from '@/components/Animate.vue';
26
+import { useModel } from "@zjxpcyc/vue-tiny-store";
27
+import Modal from "@/components/Modal.vue";
28
+import Animate from "@/components/Animate.vue";
29
+import { useRouter } from "vue-router";
33 30
 
34
-  const { play, pause } = useModel('audio');
31
+const router = useRouter();
32
+const { play, pause } = useModel("audio");
35 33
 </script>
36 34
 
37 35
 <style lang="less" scoped>
@@ -59,4 +57,4 @@
59 57
     }
60 58
   }
61 59
 }
62
-</style>
60
+</style>

+ 96
- 0
src/pages/pg1/video.vue 查看文件

@@ -0,0 +1,96 @@
1
+<template>
2
+  <div class="page pg-bg video-pg">
3
+    <GoBack class="goback abs" @click.stop="router.go(-1)" />
4
+    <div class="content">
5
+      <video
6
+        webkit-playsinline
7
+        playsinline
8
+        preload="auto"
9
+        autoplay="autoplay"
10
+        controls="controls"
11
+        ref="mediaRef"
12
+        src="/video/9年活动.mp4"
13
+      ></video>
14
+    </div>
15
+  </div>
16
+</template>
17
+
18
+<script setup>
19
+import { onMounted, ref } from "vue";
20
+import { useRouter } from "vue-router";
21
+import { useModel } from "@zjxpcyc/vue-tiny-store";
22
+import GoBack from "@/components/GoBack.vue";
23
+
24
+const router = useRouter();
25
+const mediaRef = ref();
26
+const show = ref(false);
27
+const controls = ref();
28
+
29
+onMounted(() => {
30
+  // 自动播放
31
+  try {
32
+    const t = setTimeout(() => {
33
+      clearTimeout(t);
34
+
35
+      // 可能抛出异步异常
36
+      const p = mediaRef.value.play();
37
+      if (p) {
38
+        p.then(() => {
39
+          mediaRef.value.play();
40
+        }).catch((err) => {
41
+          console.log("--play-err---", err);
42
+          controls.value = "controls";
43
+        });
44
+      }
45
+    }, 300);
46
+  } catch (err) {
47
+    console.log("---err---", err);
48
+    controls.value = "controls";
49
+  }
50
+});
51
+</script>
52
+
53
+<style lang="less" scoped>
54
+.video-pg {
55
+  position: relative;
56
+  background-color: #000;
57
+  display: flex;
58
+  align-items: center;
59
+
60
+  .goback {
61
+    z-index: 100;
62
+    left: 10px;
63
+    top: 10px;
64
+  }
65
+  .content {
66
+    position: relative;
67
+    video {
68
+      // width: 100%;
69
+      width: 100vw;
70
+      z-index: 1;
71
+    }
72
+    .play-action {
73
+      position: absolute;
74
+      z-index: 2;
75
+      bottom: -80px;
76
+      width: 100%;
77
+      height: 80px;
78
+      display: flex;
79
+      align-items: center;
80
+      justify-content: center;
81
+
82
+      img {
83
+        width: 100px;
84
+        width: 30vw;
85
+        height: 10vw;
86
+      }
87
+      img:first-child {
88
+        margin-right: 20px;
89
+      }
90
+      img:last-child {
91
+        margin-left: 20px;
92
+      }
93
+    }
94
+  }
95
+}
96
+</style>

+ 2
- 1
src/pages/pg2-2/Bell.vue 查看文件

@@ -11,7 +11,7 @@
11 11
         <img :class="{'bell-ani': animate}" src="/images/pg1/bell.png" alt="">
12 12
       </div>
13 13
     </div>
14
-    <audio ref="el" src="/audio/audio2.mp3" style="max-width: 0" loop preload="auto"></audio>
14
+    <audio ref="el" src="/audio/audio2.mp3" style="max-width: 0" loop preload="auto" ></audio>
15 15
   </div>
16 16
 </template>
17 17
 
@@ -40,6 +40,7 @@
40 40
 
41 41
     //
42 42
     el.value.play();
43
+    animate.value = true;
43 44
   });
44 45
 
45 46
 </script>

+ 20
- 10
src/pages/pg2-2/index.vue 查看文件

@@ -1,12 +1,13 @@
1 1
 <template>
2 2
   <div class="page pg-bg pg2-2">
3 3
     <GoBack class="goback abs" style="z-index: 100" @click="router.go(-1)" />
4
-    <div class="bk-pd content">
4
+    <Bell class="bell" />
5
+    <div class="bk-pd content" >
5 6
       <Animate
6 7
         class="txt"
7 8
         comp="p"
8 9
         name="animate__fadeIn"
9
-        delay="1000ms"
10
+
10 11
         :ready="true"
11 12
       >
12 13
         85年前,
@@ -27,7 +28,7 @@
27 28
         class="txt bottom"
28 29
         comp="p"
29 30
         name="animate__fadeIn"
30
-        delay="2000ms"
31
+        delay="1000ms"
31 32
         :ready="true"
32 33
       >
33 34
         1939年,一名日本军医带着对战争的反思和忏悔,
@@ -93,8 +94,8 @@
93 94
     <!-- <img class="photo-img" src="/images/pg2-2/照片4.png" /> -->
94 95
     <!-- </div> -->
95 96
 
96
-    <div class="bk-pd content">
97
-      <Animate name="animate__fadeIn" delay="3000ms" :ready="true">
97
+    <div class="bk-pd content" ref="pgRef1">
98
+      <Animate name="animate__fadeIn" delay="300ms" :ready="show1">
98 99
         <p class="txt bottom">
99 100
           紫金草,它耐寒、耐旱,
100 101
           <br />在贫瘠的土地上也能顽强生长, <br />蕴含着无穷的草根力量,
@@ -105,15 +106,15 @@
105 106
         </p>
106 107
       </Animate>
107 108
     </div>
108
-    <div class="bk-pd content">
109
+    <div class="bk-pd content" ref="pgRef2">
109 110
       <Ink
110 111
         class="slide-ink chart-img"
111
-        :active="true"
112
+        :active="show2"
112 113
         src="/images/pg2-2/图.png"
113 114
       />
114 115
     </div>
115
-    <div class="bk-pd content">
116
-      <Animate name="animate__fadeIn" delay="4000ms" :ready="true">
116
+    <div class="bk-pd content" ref="pgRef3">
117
+      <Animate name="animate__fadeIn" delay="300ms" :ready="show3">
117 118
         <p class="txt topbottom">
118 119
           2014年,在国家首个公祭日来临之际,
119 120
           <br />为了深切缅怀惨遭日军屠戮遇难同胞,
@@ -132,13 +133,17 @@
132 133
 <script setup>
133 134
 import { onBeforeUnmount, onMounted, ref } from "vue";
134 135
 import { Splide, SplideSlide, SplideTrack } from "@splidejs/vue-splide";
135
-import Bell from "@/components/Bell.vue";
136
+import Bell from "./Bell.vue";
136 137
 import Btn from "@/components/Btn.vue";
137 138
 import Animate from "@/components/Animate.vue";
138 139
 import GoBack from "@/components/GoBack.vue";
139 140
 import { useRouter } from "vue-router";
140 141
 import Ink from "./Ink.vue";
142
+import usePageShow from '../usePageShow';
141 143
 
144
+const [pgRef1, show1] = usePageShow(0.3);
145
+const [pgRef2, show2] = usePageShow(0.3);
146
+const [pgRef3, show3] = usePageShow(0.3);
142 147
 const router = useRouter();
143 148
 const inkActive = ref(false);
144 149
 const slideIndexRef = ref(0);
@@ -161,6 +166,11 @@ const onSlideChange = (slide, newIndex) => {
161 166
 .pg2-2 {
162 167
   position: relative;
163 168
   height: 100vh;
169
+  .bell{
170
+    position: absolute;
171
+    right: 24px;
172
+    top:24px;
173
+  }
164 174
   .content {
165 175
     text-align: center;
166 176
   }

+ 40
- 0
src/pages/pg2-2/useShow.js 查看文件

@@ -0,0 +1,40 @@
1
+import { onBeforeUnmount, onMounted, ref } from 'vue';
2
+
3
+export default function useIntersection(param) {
4
+  const pageRef = ref();
5
+  const showRef = ref(false);
6
+  let intersectionObserver = null;
7
+
8
+  let breakRatio = 0.5;
9
+  if (typeof param === 'number') {
10
+    breakRatio = param;
11
+  }
12
+
13
+  let callback = null;
14
+  if (typeof param === 'function') {
15
+    callback = param;
16
+  }
17
+
18
+  onMounted(() => {
19
+    intersectionObserver = new IntersectionObserver((entries) => {
20
+      const { intersectionRatio } = entries[0];
21
+      if (intersectionRatio <= 0.1) {
22
+        showRef.value = false;
23
+      } else if (intersectionRatio >= breakRatio)  {
24
+        showRef.value = true;
25
+      }
26
+
27
+      if (typeof callback === 'function') {
28
+        callback(entries[0]);
29
+      }
30
+    }, {threshold: [0.0, 0.1, 0.3, 0.5, 0.8, 0.9]});
31
+
32
+    intersectionObserver.observe(pageRef.value);
33
+  })
34
+
35
+  onBeforeUnmount(() => {
36
+    intersectionObserver.disconnect();
37
+  })
38
+
39
+  return [pageRef, showRef];
40
+}

+ 11
- 0
src/pages/share/index.vue 查看文件

@@ -1,5 +1,8 @@
1 1
 <template>
2 2
   <div class="share-pg">
3
+
4
+    <GoBack class="goback abs" style="z-index: 100" @click="router.go(-1)" />
5
+
3 6
     <div class="will-copy" ref="src">
4 7
       <img class="copy-img" src="/images/share.jpg" alt="" />
5 8
       <div class="content txt">
@@ -17,7 +20,10 @@
17 20
 import { onMounted,watch, ref } from "vue";
18 21
 import html2canvas from "html2canvas";
19 22
 import { useModel } from "@zjxpcyc/vue-tiny-store";
23
+import { useRouter } from "vue-router";
24
+import GoBack from "@/components/GoBack.vue";
20 25
 
26
+const router = useRouter();
21 27
 const { user } = useModel("user");
22 28
 const imgData = ref();
23 29
 const src = ref();
@@ -35,6 +41,11 @@ onMounted(() => {
35 41
 <style lang="less" scoped>
36 42
 .share-pg {
37 43
   position: relative;
44
+  .goback{
45
+    z-index: 100;
46
+    left: 10px;
47
+    top: 10px;
48
+  }
38 49
 
39 50
   .will-copy {
40 51
     position: relative;

+ 1
- 0
src/router.js 查看文件

@@ -6,6 +6,7 @@ const routes = [
6 6
   // { path: '/', component: () => import('@/pages/FirstVideo.vue') },
7 7
   { path: '/', component: () => import('@/pages/index.vue') },
8 8
   { path: '/bk1', component: () => import('@/pages/bk1/index.vue') },
9
+  { path: '/pg1/video', component: () => import('@/pages/pg1/video.vue') },
9 10
   { path: '/pg2-2', component: () => import('@/pages/pg2-2/index.vue') },
10 11
   { path: '/pg4', component: () => import('@/pages/pg4/video.vue') },
11 12
   { path: '/pg4/next', component: () => import('@/pages/pg4/index.vue') },