lex-xin 3 bulan lalu
induk
melakukan
af035128d8

+ 7 - 3
src/views/activation-code/activation-register/index.tsx

@@ -1509,11 +1509,15 @@ export default defineComponent({
                 forms.reslutPopupType === 'ACTIVATING' ||
                 forms.reslutPopupType === 'ACTIVATING-TWO'
               ) {
-                let url = '/download'
                 if(route.query.wx === 'wx_lite') {
-                  url += '?wx=wx_lite'
+                  // @ts-ignore
+                  wx.miniProgram.redirectTo({
+                    url: 'page/download/download'
+                  })
+                } else {
+                  router.push('/download');
                 }
-                router.push('/download');
+                
               } else {
                 forms.showResultPopup = false;
               }

+ 14 - 9
src/views/activation-code/download/index.tsx

@@ -7,18 +7,23 @@ import MSticky from '@/components/m-sticky';
 export default defineComponent({
   name: 'activation-download',
   setup() {
-    const onDownload = () => {
-      // @ts-ignore
-      window.wx.downloadImage('https://oss.dayaedu.com/ktyq/1733226456374.png')
-    }
+    // const onDownload = () => {
+    //   // @ts-ignore
+    //   window.wx.downloadImage('https://oss.dayaedu.com/ktyq/1733226456374.png')
+    // }
     const onDownload2 = () => {
       console.log('发送消息')
-      window.parent.postMessage({
-        type: 'downloadImageRequest',
+      // @ts-ignore
+      wx.miniProgram.postMessage({
         data: {
-            url: 'https://oss.dayaedu.com/ktyq/1733226456374.png'
+          action: 'download',
+          url: 'https://oss.dayaedu.com/ktyq/1733226456374.png'
         }
-    }, '*');
+      })
+      // @ts-ignore
+      wx.miniProgram.redirectTo({
+        url: 'page/download/download'
+      })
     }
     return () => (
       <div class={styles.activationDownload}>
@@ -33,7 +38,7 @@ export default defineComponent({
 
         <MSticky position="bottom">
           <div class={styles.btnGroup}>
-            <img src={btnImg} class={styles.btnImg} onClick={onDownload} />
+            {/* <img src={btnImg} class={styles.btnImg} onClick={onDownload} /> */}
             <img src={btnImg} class={styles.btnImg} onClick={onDownload2} />
           </div>
         </MSticky>