lex-xin 6 tháng trước cách đây
mục cha
commit
f1973fac65

+ 1 - 0
index.html

@@ -36,6 +36,7 @@
   <meta name="msapplication-tap-highlight" content="no" />
   <meta name="referrer" content="no-referrer" />
   <title>音乐数字课堂</title>
+  <script src="/jweixin-1.3.2.js"></script>
   <script src="/flexible.js" charset="UTF-8"></script>
 </head>
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 0 - 0
public/jweixin-1.3.2.js


+ 36 - 17
src/views/activation-code/download/index.tsx

@@ -1,24 +1,43 @@
-import { defineComponent } from "vue";
-import styles from './index.module.less'
-import func from './images/function.png'
-import btnImg from './images/button-bg.png'
-import MSticky from "@/components/m-sticky";
+import { defineComponent } from 'vue';
+import styles from './index.module.less';
+import func from './images/function.png';
+import btnImg from './images/button-bg.png';
+import MSticky from '@/components/m-sticky';
 
 export default defineComponent({
   name: 'activation-download',
   setup() {
-    return () => <div class={styles.activationDownload}>
-      <div class={styles.section}>
-      <img src="https://oss.dayaedu.com/ktyq/1733226456374.png" class={styles.qrCodeImg} />
+    const onDownload = () => {
+      // @ts-ignore
+      window.wx.downloadImage('https://oss.dayaedu.com/ktyq/1733226456374.png')
+    }
+    const onDownload2 = () => {
+      console.log('发送消息')
+      window.parent.postMessage({
+        type: 'downloadImageRequest',
+        data: {
+            url: 'https://oss.dayaedu.com/ktyq/1733226456374.png'
+        }
+    }, '*');
+    }
+    return () => (
+      <div class={styles.activationDownload}>
+        <div class={styles.section}>
+          <img
+            src="https://oss.dayaedu.com/ktyq/1733226456374.png"
+            class={styles.qrCodeImg}
+          />
 
-<img src={func} class={styles.func} />
-      </div>
-
-      <MSticky position="bottom">
-        <div class={styles.btnGroup}>
-          <img src={btnImg} class={styles.btnImg} />
+          <img src={func} class={styles.func} />
         </div>
-      </MSticky>
-    </div>
+
+        <MSticky position="bottom">
+          <div class={styles.btnGroup}>
+            <img src={btnImg} class={styles.btnImg} onClick={onDownload} />
+            <img src={btnImg} class={styles.btnImg} onClick={onDownload2} />
+          </div>
+        </MSticky>
+      </div>
+    );
   }
-})
+});

+ 2 - 7
src/views/download/index.tsx

@@ -18,7 +18,7 @@ export default defineComponent({
     });
 
     const onDownload = () => {
-      if (browser().weixin && route.query.wx !== 'wx_lite') {
+      if (browser().weixin) {
         state.wxStatus = true;
         return;
       }
@@ -41,12 +41,7 @@ export default defineComponent({
       ) {
         urlIos && (window.location.href = urlIos);
       } else {
-        // 判断是否用微信小程打开的
-        if(route.query.wx === 'wx_lite') {
-          window.postMessage({action: 'download', url: 'urlAndroid'}, '*')
-        } else {
-          window.location.href = urlAndroid;
-        }
+        window.location.href = urlAndroid;
       }
     };
     onMounted(async () => {

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác