xiongzhu 3 éve
szülő
commit
984eb69454

BIN
android/app/src/main/assets/cdvasset.manifest


+ 2 - 2
capacitor.config.json

@@ -18,9 +18,9 @@
             "launchAutoHide": false
         },
         "CodePush": {
-            "IOS_DEPLOY_KEY": "ZrEsHcngd89oYtHZYQxLRUSMJ8trafzoNUVDN",
+            "IOS_DEPLOY_KEY": "eAdEIJJkMhuRwBKVpDXvbay6Ay0yEJAbzi0Ur",
             "IOS_PUBLIC_KEY": "APP_SECRET_KEY",
-            "ANDROID_DEPLOY_KEY": "eAdEIJJkMhuRwBKVpDXvbay6Ay0yEJAbzi0Ur",
+            "ANDROID_DEPLOY_KEY": "ZrEsHcngd89oYtHZYQxLRUSMJ8trafzoNUVDN",
             "ANDROID_PUBLIC_KEY": "APP_SECRET_KEY",
             "SERVER_URL": "https://codepush.appcenter.ms/"
         }

+ 2 - 0
pushAndroid.sh

@@ -1 +1,3 @@
+yarn build --mode=app
+npx cap sync android
 appcenter codepush release -a  da736134-gmail.com/ASNFTNGFHP-Android -c android/app/src/main/assets/public/ -t '~1.0.0' -d Release

+ 7 - 2
src/main.js

@@ -75,7 +75,9 @@ if (navigator.language === 'zh-CN') {
 } else {
     setDefaultOptions({ locale: enUS })
 }
-
+document.addEventListener('online', () => {
+    console.log('online')
+})
 document.addEventListener('deviceready', () => {
     console.log('deviceready')
     if (Capacitor.isNativePlatform()) {
@@ -141,7 +143,10 @@ document.addEventListener('deviceready', () => {
         setTimeout(() => {
             SplashScreen.hide()
         }, 1000)
-        codePush.sync()
+        window.codePush = codePush
+        codePush.sync({}).then(status => {
+            console.log('codePush sync status:', status)
+        })
     }
 })
 

+ 50 - 21
src/utils/console.js

@@ -1,26 +1,55 @@
+// import eruda from 'eruda'
+// import erudaCode from 'eruda-code'
+// import erudaFeatures from 'eruda-features'
+// import erudaFps from 'eruda-fps'
+// import erudaTiming from 'eruda-timing'
+// import erudaMemory from 'eruda-memory'
+let initialized = false
+let loading = false
 function init() {
-    import('eruda').then(eruda => {
-        eruda.init({
-            useShadowDom: false,
-            defaults: {
-                theme: 'Material Oceanic'
-            }
+    // eruda.init({
+    //     useShadowDom: false,
+    //     defaults: {
+    //         theme: 'Material Oceanic'
+    //     }
+    // })
+    // eruda.add(erudaCode)
+    // eruda.add(erudaFeatures)
+    // eruda.add(erudaFps)
+    // eruda.add(erudaTiming)
+    // eruda.add(erudaMemory)
+    if (loading || initialized) return
+    loading = true
+    import('eruda')
+        .then(res => {
+            loading = false
+            let eruda = res.default
+            eruda.init({
+                useShadowDom: false,
+                defaults: {
+                    theme: 'Material Oceanic'
+                }
+            })
+            initialized = true
+            import('eruda-code').then(res => {
+                eruda.add(res.default)
+            })
+            import('eruda-features').then(res => {
+                eruda.add(res.default)
+            })
+            import('eruda-fps').then(res => {
+                eruda.add(res.default)
+            })
+            import('eruda-timing').then(res => {
+                eruda.add(res.default)
+            })
+            import('eruda-memory').then(res => {
+                eruda.add(res.default)
+            })
         })
-        import('eruda-code').then(res => {
-            eruda.add(res.default)
+        .catch(e => {
+            loading = false
+            console.log(e)
         })
-        import('eruda-features').then(res => {
-            eruda.add(res.default)
-        })
-        import('eruda-fps').then(res => {
-            eruda.add(res.default)
-        })
-        import('eruda-timing').then(res => {
-            eruda.add(res.default)
-        })
-        import('eruda-memory').then(res => {
-            eruda.add(res.default)
-        })
-    })
 }
 export { init }

+ 35 - 36
vite.config.js

@@ -40,39 +40,41 @@ export default defineConfig(({ command, mode }) => {
                 },
                 webp: false
             }),
-            VitePWA({
-                registerType: 'autoUpdate',
-                manifest: {
-                    name: 'FirstCash',
-                    short_name: 'FirstCash',
-                    theme_color: '#161616',
-                    background_color: '#161616',
-                    display: 'fullscreen',
-                    icons: [
-                        {
-                            src: '/icon-192x192.png',
-                            sizes: '192x192',
-                            type: 'image/png'
-                        },
-                        {
-                            src: '/icon-256x256.png',
-                            sizes: '256x256',
-                            type: 'image/png'
-                        },
-                        {
-                            src: '/icon-384x384.png',
-                            sizes: '384x384',
-                            type: 'image/png'
-                        },
-                        {
-                            src: '/icon-512x512.png',
-                            sizes: '512x512',
-                            type: 'image/png'
-                        }
-                    ]
-                }
-            })
-        ],
+            mode === 'app'
+                ? null
+                : VitePWA({
+                      registerType: 'autoUpdate',
+                      manifest: {
+                          name: 'FirstCash',
+                          short_name: 'FirstCash',
+                          theme_color: '#161616',
+                          background_color: '#161616',
+                          display: 'fullscreen',
+                          icons: [
+                              {
+                                  src: '/icon-192x192.png',
+                                  sizes: '192x192',
+                                  type: 'image/png'
+                              },
+                              {
+                                  src: '/icon-256x256.png',
+                                  sizes: '256x256',
+                                  type: 'image/png'
+                              },
+                              {
+                                  src: '/icon-384x384.png',
+                                  sizes: '384x384',
+                                  type: 'image/png'
+                              },
+                              {
+                                  src: '/icon-512x512.png',
+                                  sizes: '512x512',
+                                  type: 'image/png'
+                              }
+                          ]
+                      }
+                  })
+        ].filter(i => i != null),
         resolve: {
             alias: {
                 '@': fileURLToPath(new URL('./src', import.meta.url))
@@ -85,9 +87,6 @@ export default defineConfig(({ command, mode }) => {
                     additionalData: '@import "@/styles/common.less";'
                 }
             }
-        },
-        build: {
-            rollupOptions: {}
         }
     }
 })