Your Name vor 2 Jahren
Ursprung
Commit
b94e80d121
7 geänderte Dateien mit 44 neuen und 13 gelöschten Zeilen
  1. 3
    1
      index.html
  2. 3
    3
      public/config.js
  3. 1
    0
      src/main.js
  4. 1
    1
      src/pages/bk1/pg1.vue
  5. 1
    1
      src/pages/pg1/Md1.vue
  6. 17
    1
      src/pages/pg1/video.vue
  7. 18
    6
      src/utils/wx.js

+ 3
- 1
index.html Datei anzeigen

@@ -4,7 +4,8 @@
4 4
     <meta charset="UTF-8" />
5 5
     <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6 6
     <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover" />
7
-    <script src="./wx/jweixin-1.6.0.js"></script>
7
+    <!-- <script src="./wx/jweixin-1.6.0.js"></script> -->
8
+    <script src="http://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
8 9
     <script src="./jquery.1.9.1.js"></script>
9 10
     <script src="./turn.min.js"></script>
10 11
     <script src="./config.js"></script>
@@ -26,6 +27,7 @@
26 27
     </script> -->
27 28
   </head>
28 29
   <body>
30
+    <img src="/share.jpg" style="display: none;" />
29 31
     <div id="app"></div>
30 32
     <script type="module" src="/src/main.js"></script>
31 33
   </body>

+ 3
- 3
public/config.js Datei anzeigen

@@ -1,9 +1,9 @@
1 1
 // 微信分享
2 2
 const shareOptTpl = {
3 3
   title: '向世界讲述——南京1937',
4
-  desc: '',
5
-  link: location.href,
6
-  imgUrl: location.origin + location.pathname.replace('index.html', '') + 'share.jpg',
4
+  desc: '让和平理念,在全世界生根发芽',
5
+  link: 'http://zjc.nbs.cn/index.html',
6
+  imgUrl: 'http://zjc.nbs.cn/share.jpg',
7 7
 }
8 8
 
9 9
 // 跳转链接

+ 1
- 0
src/main.js Datei anzeigen

@@ -2,6 +2,7 @@ import { createApp } from 'vue'
2 2
 import VueSplide from '@splidejs/vue-splide';
3 3
 import 'animate.css'
4 4
 import '@splidejs/vue-splide/css/core';
5
+
5 6
 import { getCode, redirect } from '@/utils/wx';
6 7
 
7 8
 import App from './App.vue'

+ 1
- 1
src/pages/bk1/pg1.vue Datei anzeigen

@@ -45,7 +45,7 @@
45 45
         加拿大、日本、韩国、马拉西亚、澳大利亚、<br>
46 46
         新西兰、新加坡,紫金草在14个国家被点亮,<br>
47 47
         播撒和平的种子。<br>
48
-        近20万枚紫金草徽章佩戴在了人们的心口
48
+        近20万枚紫金草徽章佩戴在了人们的胸前
49 49
       </p>
50 50
     </div>
51 51
 

+ 1
- 1
src/pages/pg1/Md1.vue Datei anzeigen

@@ -12,7 +12,7 @@
12 12
           加拿大、日本、韩国、马拉西亚、澳大利亚、<br>
13 13
           新西兰、新加坡,紫金草在14个国家被点亮,<br>
14 14
           播撒和平的种子。<br>
15
-          近20万枚紫金草徽章佩戴在了人们的心口
15
+          近20万枚紫金草徽章佩戴在了人们的胸前
16 16
         </p>
17 17
         <!-- <div class="map-img" ref="mapRef" /> -->
18 18
         <!-- <img class="map-img" src="/images/pg2/map.gif" alt=""> -->

+ 17
- 1
src/pages/pg1/video.vue Datei anzeigen

@@ -16,7 +16,7 @@
16 16
 </template>
17 17
 
18 18
 <script setup>
19
-import { onMounted, ref } from "vue";
19
+import { onBeforeUnmount, onMounted, ref } from "vue";
20 20
 import { useRouter } from "vue-router";
21 21
 import { useModel } from "@zjxpcyc/vue-tiny-store";
22 22
 import GoBack from "@/components/GoBack.vue";
@@ -51,7 +51,23 @@ onMounted(() => {
51 51
     console.log("---err---", err);
52 52
     controls.value = "controls";
53 53
   }
54
+
55
+  
56
+  // 自动全屏
57
+  function launchFullscreen(element) {
58
+    if(element.requestFullscreen) {
59
+      element.requestFullscreen();
60
+    } else if(element.mozRequestFullScreen) {
61
+      element.mozRequestFullScreen();
62
+    } else if(element.webkitRequestFullscreen) {
63
+      element.webkitRequestFullscreen();
64
+    } else if(element.msRequestFullscreen) {
65
+      element.msRequestFullscreen();
66
+  }}
67
+
68
+  launchFullscreen(mediaRef.value);
54 69
 });
70
+
55 71
 </script>
56 72
 
57 73
 <style lang="less" scoped>

+ 18
- 6
src/utils/wx.js Datei anzeigen

@@ -32,7 +32,6 @@ function wxsdk() {
32 32
   // API_BASE 来源 public/config.js
33 33
   const apiBase = API_BASE // import.meta.env.VITE_APP_API_BASE
34 34
 
35
-
36 35
   // 分享接口
37 36
   const shareAPIs = [
38 37
     // 自定义“分享给朋友”及“分享到QQ”按钮的分享内容(1.4.0)
@@ -51,6 +50,8 @@ function wxsdk() {
51 50
     'onMenuShareQZone',
52 51
   ]
53 52
 
53
+  let inited = false;
54
+
54 55
   function init() {
55 56
     if (isDev) return;
56 57
     const url = window.location.href;
@@ -77,12 +78,13 @@ function wxsdk() {
77 78
     })
78 79
   }
79 80
 
80
-  // 立即执行
81
-  init();
82
-
83 81
   function share(params = {}) {
84 82
     if (isDev) return;
85 83
 
84
+    if (!inited) {
85
+      init();
86
+    }
87
+
86 88
     wx.ready(() => {
87 89
 
88 90
       const shareData = {
@@ -93,10 +95,20 @@ function wxsdk() {
93 95
       console.log('---分享参数-->', shareData);
94 96
 
95 97
       for (let api of shareAPIs) {
96
-        if (typeof wx[api] === 'function') continue;
97
-        wx[api](shareData);
98
+        wx[api]({
99
+          ...shareData,
100
+          success: () => {
101
+            console.log('分享成功: ', api)
102
+          },
103
+        });
98 104
       }
99 105
     });
106
+
107
+    wx.error(function(res){
108
+      console.error('wx js-sdk error');
109
+      console.error(res);
110
+      console.error('<==============');
111
+    });
100 112
   }
101 113
 
102 114
   return {