Yansen 2 年之前
父節點
當前提交
1fd06bbaa0

+ 1
- 1
index.html 查看文件

@@ -14,7 +14,7 @@
14 14
     <link rel="stylesheet" href="./slidePage/slidePage.min.css">
15 15
 
16 16
     <link rel="stylesheet" href="./fonts/SourceHanSerifCN-Medium/SourceHanSerifCN-Medium.css">
17
-    <title>南京-紫金草行动</title>
17
+    <title>向世界讲述——南京1937</title>
18 18
     <!-- <script src="./vconsole.min.js"></script>
19 19
     <script>
20 20
       const vConsole = new VConsole();

+ 4
- 1
src/App.vue 查看文件

@@ -48,10 +48,13 @@
48 48
   }
49 49
   window.addEventListener('touchstart', onTouch);
50 50
 
51
+  // 初始化一些数据
52
+  localStorage.setItem('page', 1);
53
+
51 54
 </script>
52 55
 
53 56
 <template>
54
-  <Loading v-if="!show" class="loading" @ready="(show = true)" />
57
+  <Loading v-if="!show" class="loading" @ready="show = true" />
55 58
   <router-view v-else></router-view>
56 59
 
57 60
   <audio ref="el" src="/audio/audio.mp3" style="max-width: 0" loop preload="auto"></audio>

+ 1
- 1
src/components/Modal.vue 查看文件

@@ -41,7 +41,7 @@
41 41
   left: 0;
42 42
   width: 100vw;
43 43
   height: 100vh;
44
-  z-index: 1000;
44
+  z-index: 2000;
45 45
   animation-duration: 200ms;
46 46
   background: transparent;
47 47
     background: rgba(0, 0, 0, 0.5);

+ 5
- 0
src/pages/FirstVideo.vue 查看文件

@@ -5,6 +5,7 @@
5 5
       playsinline
6 6
       src="/video/开始视频.mp4"
7 7
       autoplay="autoplay"
8
+      controls="controls"
8 9
       ref="vidRef"
9 10
       @play="pause()"
10 11
       @pause="play()"
@@ -26,6 +27,10 @@ const router = useRouter();
26 27
 
27 28
 onMounted(() => {
28 29
   vidRef.value.play();
30
+
31
+  document.addEventListener('WeixinJSBridgeReady', () => {
32
+    vidRef.value.play();
33
+  });
29 34
 })
30 35
 
31 36
 </script>

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

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="page pg-bg loading-pg" @click="onClick">
2
+  <div class="page pg-bg loading-pg" @click="onClick" @touchmove="onClick">
3 3
     <div class="loading-bg">
4 4
       <img class="fl-bg1 abs" src="/images/fl-bg.png" alt="">
5 5
       <img class="fl-bg2 abs" src="/images/fl-bg.png" alt="">
@@ -41,6 +41,7 @@
41 41
 
42 42
     const t = setTimeout(() => {
43 43
       emit('ready');
44
+      clearTimeout(t)
44 45
     }, 1600);
45 46
   }
46 47
 

+ 6
- 2
src/pages/index.vue 查看文件

@@ -26,6 +26,8 @@ import Pg3 from './pg3/index.vue'
26 26
 
27 27
 const { play, pause } = useModel('audio');
28 28
 
29
+const page = ref(localStorage.getItem('page'));
30
+
29 31
 onMounted(() => {
30 32
   // parallaxing()
31 33
   play()
@@ -33,7 +35,7 @@ onMounted(() => {
33 35
   var slidepage = new window.slidePage({
34 36
     slideContainer: '.slide-container',
35 37
     slidePages: '.slide-page',
36
-    page: 1,
38
+    page: page.value || 1,
37 39
     refresh: false,
38 40
     dragMode: false,
39 41
     useWheel: true,
@@ -42,7 +44,9 @@ onMounted(() => {
42 44
 
43 45
     // Events
44 46
     before: function(origin,direction,target){},
45
-    after: function(origin,direction,target){},
47
+    after: function(origin,direction,target){
48
+      localStorage.setItem('page', target);
49
+    },
46 50
     });
47 51
 })
48 52
 </script>

+ 5
- 0
src/pages/pg1/index.vue 查看文件

@@ -57,6 +57,11 @@
57 57
 </script>
58 58
 
59 59
 <style lang="less" scoped>
60
+  .pg1 {
61
+    height: auto;
62
+    min-height: 100%;
63
+  }
64
+
60 65
   .bg {
61 66
     position: absolute;
62 67
     z-index: 0;

+ 8
- 1
src/pages/pg2/index.vue 查看文件

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div class="page pg-bg pg2" parallax ref="pgRef">
2
+  <div class="page pg-bg pg2" parallax ref="pgRef" @click="onClickTest">
3 3
     <div class="bg">
4 4
       <div>
5 5
         <Animate
@@ -104,6 +104,10 @@ const onClick = () => {
104 104
   router.push(`/pg2-2`);
105 105
 };
106 106
 
107
+const onClickTest = e => {
108
+  console.log(e)
109
+}
110
+
107 111
 const flowerAnimate = reactive({
108 112
   left: "",
109 113
   right: "",
@@ -139,6 +143,9 @@ watch(show, (val) => {
139 143
 <style lang="less" scoped>
140 144
 .pg2 {
141 145
   overflow: hidden;
146
+  height: auto;
147
+  min-height: 100%;
148
+
142 149
   .bg {
143 150
     position: absolute;
144 151
     z-index: 0;

+ 5
- 1
src/pages/pg3/index.vue 查看文件

@@ -153,6 +153,10 @@
153 153
 <style lang="less" scoped>
154 154
 .pg3 {
155 155
   position: relative;
156
+  height: auto;
157
+  min-height: 100%;
158
+  box-sizing: border-box;
159
+  padding-bottom: 50px;
156 160
 
157 161
   .pg3-bg {
158 162
     position: absolute;
@@ -183,7 +187,7 @@
183 187
   .header {
184 188
     width: 30vw;
185 189
     margin: auto;
186
-    margin-top: 30px;
190
+    // margin-top: 30px;
187 191
     position: relative;
188 192
   }
189 193
 

+ 2
- 2
src/pages/pg4/Share.vue 查看文件

@@ -4,9 +4,9 @@
4 4
       <img src="/images/pg4/btn_share.png" alt="" @click="emit('share')">
5 5
       <img src="/images/pg4/btn_badge.png" alt="" @click="emit('badge')">
6 6
     </div>
7
-    <div class="share-txt txt">
7
+    <!-- <div class="share-txt txt">
8 8
       目前总种植数量: {{user.num}}
9
-    </div>
9
+    </div> -->
10 10
   </div>
11 11
 </template>
12 12
 

+ 28
- 2
src/pages/pg4/video.vue 查看文件

@@ -7,6 +7,7 @@
7 7
         src="/video/和平宣言-视频-压缩.mp4"
8 8
         preload="preload"
9 9
         autoplay="autoplay"
10
+        :controls="controls"
10 11
         ref="mediaRef"
11 12
         @ended="show = true"
12 13
         @play="pause()"
@@ -29,6 +30,7 @@
29 30
   const router = useRouter();
30 31
   const mediaRef = ref();
31 32
   const show = ref(false);
33
+  const controls = ref();
32 34
 
33 35
   const onReplay = () => {
34 36
     mediaRef.value.play();
@@ -36,12 +38,36 @@
36 38
   };
37 39
 
38 40
   const onNext = () => {
39
-    router.push("/pg4/plant");
41
+    router.replace("/pg4/plant");
40 42
   };
41 43
 
42 44
   onMounted(() => {
43 45
     // 自动播放
44
-    mediaRef.value.play();
46
+    try {
47
+
48
+      const t = setTimeout(() => {
49
+        clearTimeout(t);
50
+      
51
+        // 可能抛出异步异常
52
+        const p = mediaRef.value.play();
53
+        if (p) {
54
+          p.then(() => {
55
+            mediaRef.value.play();
56
+          }).catch(err => {
57
+            console.log('--play-err---', err)
58
+            controls.value = "controls";
59
+          })
60
+        }
61
+
62
+      }, 300);
63
+    } catch (err) {
64
+      console.log('---err---', err)
65
+      controls.value = "controls";
66
+    }
67
+
68
+    // document.addEventListener('WeixinJSBridgeReady', () => {
69
+    //   mediaRef.value.play();
70
+    // });
45 71
   });
46 72
 
47 73
 </script>

+ 2
- 2
src/router.js 查看文件

@@ -3,8 +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/FirstVideo.vue') },
7
-  { path: '/index', component: () => import('@/pages/index.vue') },
6
+  // { path: '/', component: () => import('@/pages/FirstVideo.vue') },
7
+  { path: '/', component: () => import('@/pages/index.vue') },
8 8
   { path: '/bk1', component: () => import('@/pages/bk1/index.vue') },
9 9
   { path: '/pg2-2', component: () => import('@/pages/pg2-2/index.vue') },
10 10
   { path: '/pg4', component: () => import('@/pages/pg4/video.vue') },