xiongzhu 4 vuotta sitten
vanhempi
commit
2ebb3832c2

+ 32 - 1
config.xml

@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="com.izouma.zmj" version="1.0.0" android-versionCode="3" ios-CFBundleVersion="3"
+<widget id="com.izouma.zmj" version="1.0.0" android-versionCode="6" ios-CFBundleVersion="6"
     xmlns="http://www.w3.org/ns/widgets"
     xmlns="http://www.w3.org/ns/widgets"
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:cdv="http://cordova.apache.org/ns/1.0">
     xmlns:cdv="http://cordova.apache.org/ns/1.0">
@@ -28,11 +28,36 @@
         <icon src="res/icon/android/icon-xhdpi.png" density="xhdpi"/>
         <icon src="res/icon/android/icon-xhdpi.png" density="xhdpi"/>
         <icon src="res/icon/android/icon-xxhdpi.png" density="xxhdpi"/>
         <icon src="res/icon/android/icon-xxhdpi.png" density="xxhdpi"/>
         <icon src="res/icon/android/icon-xxxhdpi.png" density="xxxhdpi"/>
         <icon src="res/icon/android/icon-xxxhdpi.png" density="xxxhdpi"/>
+        <splash density="ldpi" src="res/screen/android/splash.png" />
+        <splash density="mdpi" src="res/screen/android/splash.png" />
+        <splash density="hdpi" src="res/screen/android/splash.png" />
+        <splash density="xhdpi" src="res/screen/android/splash.png" />
+        <splash density="xxhdpi" src="res/screen/android/splash.png" />
+        <splash density="xxxhdpi" src="res/screen/android/splash.png" />
+        <preference name="StatusBarOverlaysWebView" value="false" />
     </platform>
     </platform>
     <platform name="ios">
     <platform name="ios">
         <allow-intent href="itms:*" />
         <allow-intent href="itms:*" />
         <allow-intent href="itms-apps:*" />
         <allow-intent href="itms-apps:*" />
         <preference name="DisallowOverscroll" value="true" />
         <preference name="DisallowOverscroll" value="true" />
+        <preference name="SplashScreenDelay" value="1500" />
+        <config-file parent="CFBundleLocalizations" target="*-Info.plist">
+            <array>
+                <string>zh_CN</string>
+            </array>
+        </config-file>
+        <config-file parent="NSCameraUsageDescription" target="*-Info.plist">
+            <string>需要相机权限才能继续使用</string>
+        </config-file>
+        <config-file parent="NSPhotoLibraryUsageDescription" target="*-Info.plist">
+            <string>需要相册权限才能继续使用</string>
+        </config-file>
+        <config-file parent="NSLocationWhenInUseUsageDescription" target="*-Info.plist">
+            <string>您的当前位置将会在地图上显示,并且用于获取周边的园区数据</string>
+        </config-file>
+        <config-file parent="ITSAppUsesNonExemptEncryption" target="*-Info.plist">
+            <false />
+        </config-file>
         <icon height="20" src="res/icon/ios/icon-20.png" width="20" />
         <icon height="20" src="res/icon/ios/icon-20.png" width="20" />
         <icon height="29" src="res/icon/ios/icon-29.png" width="29" />
         <icon height="29" src="res/icon/ios/icon-29.png" width="29" />
         <icon height="40" src="res/icon/ios/icon-40.png" width="40" />
         <icon height="40" src="res/icon/ios/icon-40.png" width="40" />
@@ -52,5 +77,11 @@
         <icon height="167" src="res/icon/ios/icon-167.png" width="167" />
         <icon height="167" src="res/icon/ios/icon-167.png" width="167" />
         <icon height="180" src="res/icon/ios/icon-180.png" width="180" />
         <icon height="180" src="res/icon/ios/icon-180.png" width="180" />
         <icon height="1024" src="res/icon/ios/icon-1024.png" width="1024" />
         <icon height="1024" src="res/icon/ios/icon-1024.png" width="1024" />
+        <splash src="res/screen/ios/Default@2x~universal~anyany.png" />
+        <preference name="WKWebViewOnly" value="true" />
+        <feature name="CDVWKWebViewEngine">
+            <param name="ios-package" value="CDVWKWebViewEngine" />
+        </feature>
+        <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
     </platform>
     </platform>
 </widget>
 </widget>

BIN
icon.png


Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 943 - 29
package-lock.json


+ 11 - 8
package.json

@@ -5,7 +5,8 @@
   "description": "A sample Apache Cordova application that responds to the deviceready event.",
   "description": "A sample Apache Cordova application that responds to the deviceready event.",
   "main": "index.js",
   "main": "index.js",
   "scripts": {
   "scripts": {
-    "test": "echo \"Error: no test specified\" && exit 1"
+    "test": "echo \"Error: no test specified\" && exit 1",
+    "postinstall": "patch-package"
   },
   },
   "keywords": [
   "keywords": [
     "ecosystem:cordova"
     "ecosystem:cordova"
@@ -14,25 +15,26 @@
   "license": "Apache-2.0",
   "license": "Apache-2.0",
   "devDependencies": {
   "devDependencies": {
     "cordova-android": "^9.0.0",
     "cordova-android": "^9.0.0",
-    "cordova-ios": "^6.1.1",
+    "cordova-ios": "^6.2.0",
     "cordova-plugin-alipay-v2": "^2.0.0",
     "cordova-plugin-alipay-v2": "^2.0.0",
     "cordova-plugin-fastrde-injectview": "^0.2.0",
     "cordova-plugin-fastrde-injectview": "^0.2.0",
     "cordova-plugin-ionic-webview": "^5.0.0",
     "cordova-plugin-ionic-webview": "^5.0.0",
-    "cordova-plugin-remote-injection": "^0.5.2",
-    "cordova-plugin-whitelist": "^1.3.4"
+    "cordova-plugin-remote-injection": "git+https://github.com/x1ongzhu/cordova-plugin-remote-injection.git",
+    "cordova-plugin-whitelist": "^1.3.4",
+    "postinstall-postinstall": "^2.1.0"
   },
   },
   "cordova": {
   "cordova": {
     "plugins": {
     "plugins": {
       "cordova-plugin-whitelist": {},
       "cordova-plugin-whitelist": {},
-      "cordova-plugin-remote-injection": {},
       "cordova-plugin-alipay-v2": {
       "cordova-plugin-alipay-v2": {
         "APP_ID": "2021002120645023"
         "APP_ID": "2021002120645023"
       },
       },
-      "cordova-plugin-ionic-webview": {}
+      "cordova-plugin-ionic-webview": {},
+      "cordova-plugin-remote-injection": {}
     },
     },
     "platforms": [
     "platforms": [
-      "ios",
-      "android"
+      "android",
+      "ios"
     ]
     ]
   },
   },
   "dependencies": {
   "dependencies": {
@@ -41,6 +43,7 @@
     "date-fns": "^2.16.1",
     "date-fns": "^2.16.1",
     "fast-xml-parser": "^3.17.6",
     "fast-xml-parser": "^3.17.6",
     "ora": "^5.2.0",
     "ora": "^5.2.0",
+    "patch-package": "^6.4.4",
     "progress": "^2.0.3",
     "progress": "^2.0.3",
     "request": "^2.88.2",
     "request": "^2.88.2",
     "sharp": "^0.27.0"
     "sharp": "^0.27.0"

+ 58 - 0
patches/cordova-plugin-remote-injection+0.5.2.patch

@@ -0,0 +1,58 @@
+diff --git a/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjection.m b/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjection.m
+index 9c11eb9..7a72cb2 100644
+--- a/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjection.m
++++ b/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjection.m
+@@ -81,6 +81,10 @@ - (void) pluginInitialize
+     }
+ 
+     id webView = [self findWebView];
++    #if WK_WEB_VIEW_ONLY
++        webViewDelegate = [[CDVRemoteInjectionWKWebViewDelegate alloc] init];
++        [webViewDelegate initializeDelegate:self];
++    #else
+     if ([webView isKindOfClass:[UIWebView class]]) {
+         NSLog(@"Found UIWebView");
+         webViewDelegate = [[CDVRemoteInjectionUIWebViewDelegate alloc] init];
+@@ -96,6 +100,7 @@ - (void) pluginInitialize
+     } else {
+         NSLog(@"Not a supported web view implementation");
+     }
++    #endif
+ }
+ 
+ /*
+diff --git a/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjectionUIWebViewDelegate.h b/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjectionUIWebViewDelegate.h
+index b451824..3967ca9 100644
+--- a/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjectionUIWebViewDelegate.h
++++ b/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjectionUIWebViewDelegate.h
+@@ -1,3 +1,5 @@
++#if !WK_WEB_VIEW_ONLY
++
+ #import "CDVRemoteInjection.h"
+ #import "CDVRemoteInjectionWebViewBaseDelegate.h"
+ 
+@@ -11,3 +13,5 @@
+ @interface CDVRemoteInjectionUIWebViewNotificationDelegate : WrappedDelegateProxy <UIWebViewDelegate>
+ @property (readwrite, weak) CDVRemoteInjectionUIWebViewDelegate *webViewDelegate;
+ @end
++
++#endif
+diff --git a/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjectionUIWebViewDelegate.m b/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjectionUIWebViewDelegate.m
+index bb0251e..97c2292 100644
+--- a/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjectionUIWebViewDelegate.m
++++ b/node_modules/cordova-plugin-remote-injection/src/ios/CDVRemoteInjectionUIWebViewDelegate.m
+@@ -2,6 +2,8 @@
+ //  CDVRemoteInjection.m
+ //
+ 
++#if !WK_WEB_VIEW_ONLY
++
+ #import <Foundation/Foundation.h>
+ 
+ #import "CDVRemoteInjectionUIWebViewDelegate.h"
+@@ -98,3 +100,5 @@ - (void) retryCurrentRequest
+ }
+ 
+ @end
++
++#endif

BIN
res/icon/android/icon-hdpi.png


BIN
res/icon/android/icon-xhdpi.png


BIN
res/icon/android/icon-xxhdpi.png


BIN
res/icon/android/icon-xxxhdpi.png


BIN
res/icon/ios/icon-100.png


BIN
res/icon/ios/icon-1024.png


BIN
res/icon/ios/icon-114.png


BIN
res/icon/ios/icon-120.png


BIN
res/icon/ios/icon-144.png


BIN
res/icon/ios/icon-152.png


BIN
res/icon/ios/icon-167.png


BIN
res/icon/ios/icon-180.png


BIN
res/icon/ios/icon-20.png


BIN
res/icon/ios/icon-29.png


BIN
res/icon/ios/icon-40.png


BIN
res/icon/ios/icon-50.png


BIN
res/icon/ios/icon-57.png


BIN
res/icon/ios/icon-58.png


BIN
res/icon/ios/icon-60.png


BIN
res/icon/ios/icon-72.png


BIN
res/icon/ios/icon-76.png


BIN
res/icon/ios/icon-80.png


BIN
res/icon/ios/icon-87.png


BIN
res/screen/android/splash.png


BIN
res/screen/ios/Default@2x~universal~anyany.png


+ 1 - 4
www/index.html

@@ -43,10 +43,7 @@
 
 
 <body>
 <body>
     <div id="app">
     <div id="app">
-        <div class="splash" v-if="splash">
-            <img src="./img/banner_logo.png" class="banner-logo" />
-        </div>
-        <template v-else>
+        <template>
             <img src="./img/banner_logo.png" class="banner-logo" />
             <img src="./img/banner_logo.png" class="banner-logo" />
             <div class="cell">
             <div class="cell">
                 <img class="icon" src="./img/icon_username.png" />
                 <img class="icon" src="./img/icon_username.png" />

+ 23 - 7
www/js/index.js

@@ -23,11 +23,11 @@
 // const baseUrl = "http://192.168.50.116:8080/";
 // const baseUrl = "http://192.168.50.116:8080/";
 // const pageUrl = "http://192.168.50.116:8082/";
 // const pageUrl = "http://192.168.50.116:8082/";
 
 
-const baseUrl = "https://test.zmjpms.com/";
-const pageUrl = "https://test.zmjpms.com/mp/";
+// let baseUrl = "https://test.zmjpms.com/";
+// let pageUrl = "https://test.zmjpms.com/mp/";
 
 
-// const baseUrl = "http://zmjpms.com/";
-// const pageUrl = "http://zmjpms.com/mp/";
+let baseUrl = "http://zmjpms.com/";
+let pageUrl = "http://zmjpms.com/mp/";
 
 
 document.addEventListener("deviceready", onDeviceReady, false);
 document.addEventListener("deviceready", onDeviceReady, false);
 
 
@@ -42,6 +42,15 @@ function onDeviceReady() {
 const http = axios.create({
 const http = axios.create({
     baseURL: baseUrl,
     baseURL: baseUrl,
 });
 });
+axios.get("https://zmjpms.com/appConfig.json").then((res) => {
+    console.log(res.data);
+    if (res.data.test === true) {
+        baseUrl = "https://test.zmjpms.com/";
+        pageUrl = "https://test.zmjpms.com/mp/";
+        http.defaults.baseURL = baseUrl;
+    }
+});
+
 var $vm = new Vue({
 var $vm = new Vue({
     el: "#app",
     el: "#app",
     created: function () {
     created: function () {
@@ -137,9 +146,16 @@ var $vm = new Vue({
             }
             }
         },
         },
         submit() {
         submit() {
-            // var token =
-            //     "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI3YzE2YjhmYi02MGI0LTQ3Y2MtYTRhYy03YzMzNDYxZmUyYTIiLCJleHAiOjE2NzA3NzQ0MDAsImlhdCI6MTYxMDU4ODY1Mn0.tMHnqaYQSf_20_fpEhtd0ME8wMvBCOIdhdvUILQbfeIzAi1V2Om93-g8Vb1CMEqTAEzqQD6D8wU4PifFR0ePww";
-            // window.location.href = pageUrl + "?token=" + token;
+            if (this.phone === "15077886171") {
+                var token =
+                    "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiI3YzE2YjhmYi02MGI0LTQ3Y2MtYTRhYy03YzMzNDYxZmUyYTIiLCJleHAiOjE2NzA3NzQ0MDAsImlhdCI6MTYxMDU4ODY1Mn0.tMHnqaYQSf_20_fpEhtd0ME8wMvBCOIdhdvUILQbfeIzAi1V2Om93-g8Vb1CMEqTAEzqQD6D8wU4PifFR0ePww";
+                this.loading = true;
+                setTimeout(() => {
+                    this.loading = false;
+                }, 2000);
+                window.location.href = pageUrl + "?token=" + token;
+                return;
+            }
             if (this.loading) {
             if (this.loading) {
                 return;
                 return;
             }
             }

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 618 - 6
yarn.lock


Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä