Переглянути джерело

日期输入更替,隐藏键盘

panxingxin 5 роки тому
батько
коміт
9068a73543

+ 1 - 1
config.xml

@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="com.ionicframework.sgZongLi" version="1.0.20" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.ionicframework.sgZongLi" version="1.0.21" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <name>SG综礼</name>
     <description>An awesome Ionic/Cordova app.</description>
     <author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>

+ 1 - 1
dev.xml

@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="com.ionicframework.devSgZongLi" version="1.0.20" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.ionicframework.devSgZongLi" version="1.0.21" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <name>SG测试</name>
     <description>An awesome Ionic/Cordova app.</description>
     <author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>

+ 118 - 27
package-lock.json

@@ -760,12 +760,34 @@
         "@types/cordova": "^0.0.34"
       }
     },
+    "@ionic-native/date-picker": {
+      "version": "5.17.1",
+      "resolved": "https://registry.npmjs.org/@ionic-native/date-picker/-/date-picker-5.17.1.tgz",
+      "integrity": "sha512-5sFXVje0WUN+pRtKnHP0PIj+laERv8ribu07FJwyT8xg904Gf6kB+YqjYNqAOwyV/t8xBf13CyHz38opC51UoA==",
+      "requires": {
+        "@types/cordova": "^0.0.34"
+      },
+      "dependencies": {
+        "@types/cordova": {
+          "version": "0.0.34",
+          "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
+          "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
+        }
+      }
+    },
     "@ionic-native/device": {
-      "version": "5.16.0",
-      "resolved": "https://registry.npmjs.org/@ionic-native/device/-/device-5.16.0.tgz",
-      "integrity": "sha512-pQQn0YcYCTu+lVhOvIxmvE3XU21CGQrmwr/w7M0Mf8T9h+6bB9o6OMF1Q2WmbXtx3MeEGVB4HopGQ+ZDQL35MQ==",
+      "version": "5.17.1",
+      "resolved": "https://registry.npmjs.org/@ionic-native/device/-/device-5.17.1.tgz",
+      "integrity": "sha512-E2NPir/DwF7YU9m5wKccDxmjp9BqS/r3o7zDPm+a/M88YC7M8HScPpsfvXKX299Af0DD3uC5ApkjKzZrrorDLw==",
       "requires": {
         "@types/cordova": "^0.0.34"
+      },
+      "dependencies": {
+        "@types/cordova": {
+          "version": "0.0.34",
+          "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
+          "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
+        }
       }
     },
     "@ionic-native/downloader": {
@@ -816,12 +838,34 @@
         "@types/cordova": "^0.0.34"
       }
     },
+    "@ionic-native/image-picker": {
+      "version": "5.17.1",
+      "resolved": "https://registry.npmjs.org/@ionic-native/image-picker/-/image-picker-5.17.1.tgz",
+      "integrity": "sha512-ESDARcigSnE6xqfe4FTRrCYLDLTrCMEerBwa/pK/5OXQyp+zsw7nqSJ1NYWYH1Oz/Yg6MW5eChdzj6V7TSs4Pg==",
+      "requires": {
+        "@types/cordova": "^0.0.34"
+      },
+      "dependencies": {
+        "@types/cordova": {
+          "version": "0.0.34",
+          "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
+          "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
+        }
+      }
+    },
     "@ionic-native/keyboard": {
-      "version": "5.16.0",
-      "resolved": "https://registry.npmjs.org/@ionic-native/keyboard/-/keyboard-5.16.0.tgz",
-      "integrity": "sha512-WG0k2gI72nmyv8sH+5Q1Fp4WIKUBBF5es60pzwgqmo/Wle3EqneRHIVW445/Vrh93DFYMgZR0MPQlzjbzD40kQ==",
+      "version": "5.17.1",
+      "resolved": "https://registry.npmjs.org/@ionic-native/keyboard/-/keyboard-5.17.1.tgz",
+      "integrity": "sha512-Wnb1DVv3OBMokDFV9sm9VF7UTtcfunBL/4Gj6RrHEgkOh2hEbktzazWQB2Kxu+T6v2tLdUxMwGSocMcZ3n/nNA==",
       "requires": {
         "@types/cordova": "^0.0.34"
+      },
+      "dependencies": {
+        "@types/cordova": {
+          "version": "0.0.34",
+          "resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
+          "integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
+        }
       }
     },
     "@ionic-native/local-notifications": {
@@ -1418,6 +1462,7 @@
       "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
       "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
       "dev": true,
+      "optional": true,
       "requires": {
         "delegates": "^1.0.0",
         "readable-stream": "^2.0.6"
@@ -2642,7 +2687,8 @@
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
       "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
-      "dev": true
+      "dev": true,
+      "optional": true
     },
     "constants-browserify": {
       "version": "1.0.0",
@@ -2793,6 +2839,11 @@
       "resolved": "https://registry.npmjs.org/cordova-plugin-camera/-/cordova-plugin-camera-4.0.3.tgz",
       "integrity": "sha1-c3Olk4MYyGzP2E43E+I4LRD+B2s="
     },
+    "cordova-plugin-datepicker": {
+      "version": "0.9.3",
+      "resolved": "https://registry.npmjs.org/cordova-plugin-datepicker/-/cordova-plugin-datepicker-0.9.3.tgz",
+      "integrity": "sha1-JVipzlmY9tbcBs+S/Yu7nQkB8Wo="
+    },
     "cordova-plugin-device": {
       "version": "2.0.2",
       "resolved": "https://registry.npmjs.org/cordova-plugin-device/-/cordova-plugin-device-2.0.2.tgz",
@@ -2814,11 +2865,14 @@
       "resolved": "https://registry.npmjs.org/cordova-plugin-file-transfer/-/cordova-plugin-file-transfer-1.7.1.tgz",
       "integrity": "sha1-p12L4uvDu5sjxbG70ZkhTsJnWGs="
     },
+    "cordova-plugin-image-picker": {
+      "version": "git+https://github.com/abelabbesnabi/cordova-plugin-image-picker.git#9d9d22439381bfacd83afabaefe3cb26d30d079c",
+      "from": "git+https://github.com/abelabbesnabi/cordova-plugin-image-picker.git"
+    },
     "cordova-plugin-ionic-keyboard": {
       "version": "2.2.0",
       "resolved": "https://registry.npmjs.org/cordova-plugin-ionic-keyboard/-/cordova-plugin-ionic-keyboard-2.2.0.tgz",
-      "integrity": "sha512-yDUG+9ieKVRitq5mGlNxjaZh/MgEhFFIgTIPhqSbUaQ8UuZbawy5mhJAVClqY97q8/rcQtL6dCDa7x2sEtCLcA==",
-      "dev": true
+      "integrity": "sha512-yDUG+9ieKVRitq5mGlNxjaZh/MgEhFFIgTIPhqSbUaQ8UuZbawy5mhJAVClqY97q8/rcQtL6dCDa7x2sEtCLcA=="
     },
     "cordova-plugin-ionic-webview": {
       "version": "4.1.3",
@@ -3201,7 +3255,8 @@
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
       "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
-      "dev": true
+      "dev": true,
+      "optional": true
     },
     "depd": {
       "version": "1.1.2",
@@ -4192,7 +4247,8 @@
         "ansi-regex": {
           "version": "2.1.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "aproba": {
           "version": "1.2.0",
@@ -4213,12 +4269,14 @@
         "balanced-match": {
           "version": "1.0.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "brace-expansion": {
           "version": "1.1.11",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "balanced-match": "^1.0.0",
             "concat-map": "0.0.1"
@@ -4233,17 +4291,20 @@
         "code-point-at": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "concat-map": {
           "version": "0.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "console-control-strings": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "core-util-is": {
           "version": "1.0.2",
@@ -4360,7 +4421,8 @@
         "inherits": {
           "version": "2.0.3",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "ini": {
           "version": "1.3.5",
@@ -4372,6 +4434,7 @@
           "version": "1.0.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "number-is-nan": "^1.0.0"
           }
@@ -4386,6 +4449,7 @@
           "version": "3.0.4",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "brace-expansion": "^1.1.7"
           }
@@ -4393,12 +4457,14 @@
         "minimist": {
           "version": "0.0.8",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "minipass": {
           "version": "2.3.5",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "safe-buffer": "^5.1.2",
             "yallist": "^3.0.0"
@@ -4417,6 +4483,7 @@
           "version": "0.5.1",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "minimist": "0.0.8"
           }
@@ -4497,7 +4564,8 @@
         "number-is-nan": {
           "version": "1.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "object-assign": {
           "version": "4.1.1",
@@ -4509,6 +4577,7 @@
           "version": "1.4.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "wrappy": "1"
           }
@@ -4594,7 +4663,8 @@
         "safe-buffer": {
           "version": "5.1.2",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "safer-buffer": {
           "version": "2.1.2",
@@ -4630,6 +4700,7 @@
           "version": "1.0.2",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "code-point-at": "^1.0.0",
             "is-fullwidth-code-point": "^1.0.0",
@@ -4649,6 +4720,7 @@
           "version": "3.0.1",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "ansi-regex": "^2.0.0"
           }
@@ -4692,12 +4764,14 @@
         "wrappy": {
           "version": "1.0.2",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "yallist": {
           "version": "3.0.3",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         }
       }
     },
@@ -4706,6 +4780,7 @@
       "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz",
       "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==",
       "dev": true,
+      "optional": true,
       "requires": {
         "graceful-fs": "^4.1.2",
         "inherits": "~2.0.0",
@@ -4723,6 +4798,7 @@
       "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
       "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
       "dev": true,
+      "optional": true,
       "requires": {
         "aproba": "^1.0.3",
         "console-control-strings": "^1.0.0",
@@ -4760,7 +4836,8 @@
       "version": "4.0.1",
       "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",
       "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",
-      "dev": true
+      "dev": true,
+      "optional": true
     },
     "get-stream": {
       "version": "3.0.0",
@@ -4955,7 +5032,8 @@
       "version": "2.0.1",
       "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
       "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
-      "dev": true
+      "dev": true,
+      "optional": true
     },
     "has-value": {
       "version": "1.0.0",
@@ -5722,7 +5800,8 @@
       "version": "0.2.1",
       "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
       "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=",
-      "dev": true
+      "dev": true,
+      "optional": true
     },
     "is-windows": {
       "version": "1.0.2",
@@ -6366,6 +6445,7 @@
       "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
       "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
       "dev": true,
+      "optional": true,
       "requires": {
         "graceful-fs": "^4.1.2",
         "parse-json": "^2.2.0",
@@ -6378,13 +6458,15 @@
           "version": "2.3.0",
           "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
           "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "strip-bom": {
           "version": "2.0.0",
           "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
           "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
           "dev": true,
+          "optional": true,
           "requires": {
             "is-utf8": "^0.2.0"
           }
@@ -6662,7 +6744,8 @@
       "version": "1.0.1",
       "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
       "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=",
-      "dev": true
+      "dev": true,
+      "optional": true
     },
     "map-visit": {
       "version": "1.0.0",
@@ -7314,6 +7397,7 @@
       "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
       "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
       "dev": true,
+      "optional": true,
       "requires": {
         "are-we-there-yet": "~1.1.2",
         "console-control-strings": "~1.1.0",
@@ -8406,6 +8490,7 @@
       "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
       "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
       "dev": true,
+      "optional": true,
       "requires": {
         "load-json-file": "^1.0.0",
         "normalize-package-data": "^2.3.2",
@@ -8417,6 +8502,7 @@
           "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
           "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
           "dev": true,
+          "optional": true,
           "requires": {
             "graceful-fs": "^4.1.2",
             "pify": "^2.0.0",
@@ -8427,7 +8513,8 @@
           "version": "2.3.0",
           "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
           "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=",
-          "dev": true
+          "dev": true,
+          "optional": true
         }
       }
     },
@@ -8436,6 +8523,7 @@
       "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
       "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
       "dev": true,
+      "optional": true,
       "requires": {
         "find-up": "^1.0.0",
         "read-pkg": "^1.0.0"
@@ -8446,6 +8534,7 @@
           "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
           "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
           "dev": true,
+          "optional": true,
           "requires": {
             "path-exists": "^2.0.0",
             "pinkie-promise": "^2.0.0"
@@ -8456,6 +8545,7 @@
           "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
           "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
           "dev": true,
+          "optional": true,
           "requires": {
             "pinkie-promise": "^2.0.0"
           }
@@ -11157,6 +11247,7 @@
       "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
       "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
       "dev": true,
+      "optional": true,
       "requires": {
         "string-width": "^1.0.2 || 2"
       }

+ 12 - 6
package.json

@@ -31,14 +31,16 @@
     "@ionic-native/bluetooth-serial": "^5.15.1",
     "@ionic-native/camera": "^5.5.1",
     "@ionic-native/core": "^5.0.0",
-    "@ionic-native/device": "^5.16.0",
+    "@ionic-native/date-picker": "^5.17.1",
+    "@ionic-native/device": "^5.17.1",
     "@ionic-native/downloader": "^5.16.0",
     "@ionic-native/file": "^5.16.0",
     "@ionic-native/file-opener": "^5.16.0",
     "@ionic-native/file-transfer": "^5.16.0",
     "@ionic-native/full-screen-image": "^5.16.0",
     "@ionic-native/http": "^5.6.0",
-    "@ionic-native/keyboard": "^5.9.0",
+    "@ionic-native/image-picker": "^5.17.1",
+    "@ionic-native/keyboard": "^5.17.1",
     "@ionic-native/local-notifications": "^5.16.0",
     "@ionic-native/photo-viewer": "^5.16.0",
     "@ionic-native/qr-scanner": "^5.16.0",
@@ -55,9 +57,12 @@
     "cordova-plugin-bluetooth-serial": "^0.4.7",
     "cordova-plugin-bluetoothle": "^4.5.5",
     "cordova-plugin-camera": "4.0.3",
+    "cordova-plugin-datepicker": "^0.9.3",
     "cordova-plugin-file": "6.0.1",
     "cordova-plugin-file-opener2": "^2.2.1",
     "cordova-plugin-file-transfer": "^1.7.1",
+    "cordova-plugin-image-picker": "git+https://github.com/abelabbesnabi/cordova-plugin-image-picker.git",
+    "cordova-plugin-ionic-keyboard": "^2.2.0",
     "cordova-plugin-local-notification": "^0.9.0-beta.2",
     "cordova-sqlite-storage": "3.2.0",
     "core-js": "^2.5.4",
@@ -83,7 +88,6 @@
     "@types/node": "~12.0.0",
     "codelyzer": "~4.5.0",
     "cordova-plugin-device": "2.0.2",
-    "cordova-plugin-ionic-keyboard": "^2.0.5",
     "cordova-plugin-ionic-webview": "^4.0.0",
     "cordova-plugin-splashscreen": "5.0.2",
     "cordova-plugin-statusbar": "2.4.2",
@@ -110,7 +114,6 @@
       "cordova-plugin-ionic-webview": {
         "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
       },
-      "cordova-plugin-ionic-keyboard": {},
       "cordova-plugin-camera": {},
       "cordova-sqlite-storage": {},
       "cordova-plugin-advanced-http": {},
@@ -126,11 +129,14 @@
       "com-sarriaroman-photoviewer": {},
       "phonegap-plugin-barcodescanner": {
         "ANDROID_SUPPORT_V4_VERSION": "27.+"
-      }
+      },
+      "cordova-plugin-image-picker": {},
+      "cordova-plugin-ionic-keyboard": {},
+      "cordova-plugin-datepicker": {}
     },
     "platforms": [
       "browser",
       "android"
     ]
   }
-}
+}

+ 1 - 0
prod.sh

@@ -13,6 +13,7 @@ echo '{
 
 #sed -e "s@1@$cversion_old@g" -i version.json
 
+npm install
 ionic cordova build android --prod
 
 mv  ./platforms/android/app/build/outputs/apk/debug/app-debug.apk  ./sgApp.apk

+ 1 - 1
prod.xml

@@ -1,5 +1,5 @@
 <?xml version='1.0' encoding='utf-8'?>
-<widget id="com.ionicframework.sgZongLi" version="1.0.20" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget id="com.ionicframework.sgZongLi" version="1.0.21" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
     <name>SG综礼</name>
     <description>An awesome Ionic/Cordova app.</description>
     <author email="hi@ionicframework.com" href="http://ionicframework.com/">Ionic Framework Team</author>

+ 4 - 0
src/app/app.module.ts

@@ -13,6 +13,8 @@ import { HttpClientModule } from '@angular/common/http';
 import { HTTP } from '@ionic-native/http/ngx';
 import { IonicStorageModule  } from '@ionic/storage'
 import { Camera } from '@ionic-native/camera/ngx';
+import { DatePicker } from '@ionic-native/date-picker/ngx';
+// import { ImagePicker } from '@ionic-native/image-picker/ngx';
 import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
 import { PhotoService } from '../services/photo.service';
 import { HttpserviceService} from '../services/httpservice.service';
@@ -40,6 +42,8 @@ import { FileTransfer, FileTransferObject } from '@ionic-native/file-transfer/ng
     LoginGuardGuard,
     PhotoService,
     Camera,
+    // ImagePicker,
+    DatePicker,
     PhotoViewer,
     Device,
     File,

+ 8 - 16
src/app/contract/contract.page.html

@@ -11,31 +11,23 @@
   <ion-list>
     <ion-item>
       <ion-label>采购合同号:</ion-label>
-      <ion-input [(ngModel)]="contractInfo.sscCode"></ion-input>
+      <ion-input [(ngModel)]="sscCode"></ion-input>
     </ion-item>
-    <!-- <ion-item>
-      <ion-label>供应商名称:</ion-label>
-      <ion-datetime [(ngModel)]="contractInfo.sdCreateDateGt"></ion-datetime>
-    </ion-item>
-    <ion-item>
-      <ion-label>供应商编号:</ion-label>
-      <ion-input [(ngModel)]="contractInfo.sdStatus"></ion-input>
-    </ion-item> -->
     <ion-item>
       <ion-label>业务人员:</ion-label>
-      <ion-input [(ngModel)]="contractInfo.sscCreator"></ion-input>
+      <ion-input [(ngModel)]="sscCreator"></ion-input>
     </ion-item>
-    <!-- <ion-item>
-      <ion-label>状态:</ion-label>
-      <ion-input [(ngModel)]="contractInfo.sscState"></ion-input>
-    </ion-item> -->
     <ion-item>
       <ion-label>合同开始:</ion-label>
-      <ion-datetime [(ngModel)]="contractInfo.sscContractdateGt"></ion-datetime>
+      <!-- <ion-datetime displayFormat="MM/DD/YYYY" [(ngModel)]="sscContractdateGt"></ion-datetime> -->
+      <ion-input [(ngModel)]="sscContractdateGt" clearInput (click)="getDate('sscContractdateGt')" readonly ></ion-input>
+      <ion-icon name="close" *ngIf="sscContractdateGt" (click)="clearDate('sscContractdateGt')" slot="end"></ion-icon>
     </ion-item>
     <ion-item>
       <ion-label>合同结束:</ion-label>
-      <ion-datetime [(ngModel)]="contractInfo.sscContractdateLt"></ion-datetime>
+      <!-- <ion-datetime displayFormat="MM/DD/YYYY" [(ngModel)]="sscContractdateLt"></ion-datetime> -->
+      <ion-input [(ngModel)]="sscContractdateLt" clearInput (click)="getDate('sscContractdateLt')" readonly ></ion-input>
+      <ion-icon name="close" *ngIf="sscContractdateLt" (click)="clearDate('sscContractdateLt')" slot="end"></ion-icon>
     </ion-item>
   </ion-list>
   <div class="ion-padding">

+ 41 - 19
src/app/contract/contract.page.ts

@@ -2,6 +2,8 @@ import { Component, OnInit } from '@angular/core';
 import { UserData } from '../../providers/user-data';
 import { Storage } from '@ionic/storage'
 import { Router } from '@angular/router';
+import { DatePicker } from '@ionic-native/date-picker/ngx';
+import { commonService } from '../../providers/common.service'
 
 @Component({
   selector: 'app-contract',
@@ -10,16 +12,16 @@ import { Router } from '@angular/router';
 })
 export class ContractPage implements OnInit {
 
-  contractInfo={
-    sscContractdateGt: '',
-    sscContractdateLt: '',
-    sscState: '',
-    sscCreator: '',
-    sscCode: ''
-  }
+  public sscContractdateGt: any
+  public sscContractdateLt: any
+  public sscCreator: string
+  public sscCode: string
+
   constructor(public userData: UserData,
-    private router: Router, 
-    private storage: Storage,) { }
+    private router: Router,
+    public commonService: commonService,
+    private datePicker: DatePicker,
+    private storage: Storage, ) { }
 
   ngOnInit() {
   }
@@ -27,6 +29,26 @@ export class ContractPage implements OnInit {
     this.storage.set('contractForm', this.getSerchForm())
     this.router.navigateByUrl('/contract-table');
   }
+  getDate(val) {  
+    this.datePicker.show({
+      date: this[val]?new Date(this[val]):new Date(),
+      mode: 'date',
+      androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK
+    }).then(
+      date => {
+        if(date) {
+          this[val] = this.commonService.getFormatDate(new Date(date))
+        } else {
+          this[val] = ''
+        }
+        
+      } ,
+      err => console.log('Error occurred while getting date: ', err)
+    );
+  }
+  clearDate(val) {
+    this[val] = ''
+  }
   getSerchForm() {
     let queryForm = {
       query: {
@@ -38,33 +60,33 @@ export class ContractPage implements OnInit {
       },
       from: 0,
       size: 10,
-      sort: [{sscContractdate: {order: "desc"}}],
+      sort: [{ sscContractdate: { order: "desc" } }],
       aggs: {}
     };
-    if (this.contractInfo.sscCode) {
+    if (this.sscCode) {
       let prefix = {}
-      prefix['sscCode.keyword'] = this.contractInfo.sscCode.toUpperCase()
+      prefix['sscCode.keyword'] = this.sscCode.toUpperCase()
       queryForm.query.bool.must.push({
         prefix: prefix
       })
     }
-    if (this.contractInfo.sscContractdateGt || this.contractInfo.sscContractdateLt) {
+    if (this.sscContractdateGt || this.sscContractdateLt) {
       let range = {
         sscContractdate: {}
       }
-      if (this.contractInfo.sscContractdateGt) {
-        range.sscContractdate['gt'] = new Date(this.contractInfo.sscContractdateGt).getTime()
+      if (this.sscContractdateGt) {
+        range.sscContractdate['gte'] = new Date(this.sscContractdateGt).getTime()-28800000 // 00:00:00,默认为08:00:00
       }
-      if (this.contractInfo.sscContractdateLt) {
-        range.sscContractdate['lt'] = new Date(this.contractInfo.sscContractdateLt).getTime()
+      if (this.sscContractdateLt) {
+        range.sscContractdate['lte'] = new Date(this.sscContractdateLt).getTime()+57599000 // 23:59:59
       }
       queryForm.query.bool.must.push({
         range: range
       })
     }
-    if (this.contractInfo.sscCreator) {
+    if (this.sscCreator) {
       let prefix = {}
-      prefix['sscCreator.keyword'] = this.contractInfo.sscCreator
+      prefix['sscCreator.keyword'] = this.sscCreator
       queryForm.query.bool.must.push({
         prefix: prefix
       })

+ 1 - 1
src/app/drawTab/drawTab.page.html

@@ -17,7 +17,7 @@
 <ion-content (click)="doClick()">
   <ion-item>
     <ion-label>开单号:</ion-label>
-    <ion-input [(ngModel)]="ssfCode" #drawInput (ionChange)="codechange()" autofocus></ion-input>
+    <ion-input [(ngModel)]="ssfCode" #drawInput (ionFocus)="inputFocus()" (ionChange)="codechange()" autofocus></ion-input>
   </ion-item>
   <ion-item>
     <ion-label>当前单号:</ion-label>

+ 5 - 3
src/app/drawTab/drawTab.page.ts

@@ -27,16 +27,18 @@ export class drawTabPage {
     }
   }
   ionViewDidEnter() {
-    this.keyboard.hide()
     this.inputFocus()
   }
+  
   inputFocus() {
     this.drawInput.setFocus();
-    this.keyboard.hide()
+    window['keyboardVisible'] = false
+    setTimeout(() => {
+      this.keyboard.hide()
+    }, 300)
   }
   doClick() {
     this.inputFocus()
-    this.keyboard.hide()
   }
   // 获取扫描信息
   async getInfo() {

+ 15 - 8
src/app/enter-store/enter-store.page.html

@@ -19,10 +19,11 @@
 <ion-content>
   <ion-item>
     <ion-label>条形码编号:</ion-label>
-    <ion-input #scanInput clear-on-edit autofocus (ionChange)="getStoreDetail()" [(ngModel)]="scanCode"></ion-input>
+    <ion-input #scanInput clear-on-edit autofocus (ionFocus)="hideKeyboard()" (ionChange)="getStoreDetail()"
+      [(ngModel)]="scanCode"></ion-input>
   </ion-item>
   <form #storeForm="ngForm" novalidate>
-    <ion-list *ngFor="let store of storeDetailList">
+    <ion-list *ngFor="let store of storeDetailList index as i">
       <ion-item-group>
         <ion-item-divider sticky>
           <ion-label>
@@ -92,7 +93,8 @@
         <ion-label>
           外箱长度:
         </ion-label>
-        <ion-input [(ngModel)]="store.outboxlength" type="number" (ionFocus)="hideKeyboard()" name="outboxlength" #outboxlength="ngModel" required></ion-input>
+        <ion-input [(ngModel)]="store.outboxlength" type="number" (keyup)="enterEdit($event, 'outboxwidth')"
+          (ionFocus)="hideKeyboard()" name="outboxlength" required></ion-input>
       </ion-item>
       <ion-text color="danger">
         <p [hidden]="!(!store.outboxlength&&clicked)" class="ion-padding-start">
@@ -104,7 +106,8 @@
         <ion-label>
           外箱宽度:
         </ion-label>
-        <ion-input [(ngModel)]="store.outboxwidth" type="number" name="outboxwidth" #outboxlength="ngModel" required></ion-input>
+        <ion-input [(ngModel)]="store.outboxwidth" type="number" (keyup)="enterEdit($event, 'outboxheigt')" #outboxwidth
+          (ionFocus)="hideKeyboard()" name="outboxwidth" required></ion-input>
       </ion-item>
       <ion-text color="danger">
         <p [hidden]="!(!store.outboxwidth&&clicked)" class="ion-padding-start">
@@ -116,7 +119,8 @@
         <ion-label>
           外箱高度:
         </ion-label>
-        <ion-input [(ngModel)]="store.outboxheigt" type="number" name="outboxheigt" #outboxlength="ngModel" required></ion-input>
+        <ion-input [(ngModel)]="store.outboxheigt" #outboxheigt type="number" (keyup)="enterEdit($event, 'enterBoxs')"
+          (ionFocus)="hideKeyboard()" name="outboxheigt" required></ion-input>
       </ion-item>
       <ion-text color="danger">
         <p [hidden]="!(!store.outboxheigt&&clicked)" class="ion-padding-start">
@@ -128,7 +132,8 @@
         <ion-label>
           入库箱数:
         </ion-label>
-        <ion-input [(ngModel)]="store.enterBoxs" name="enterBoxs" type="number" #outboxlength="ngModel" required></ion-input>
+        <ion-input [(ngModel)]="store.enterBoxs" #enterBoxs name="enterBoxs"
+          (keyup)="enterEdit($event, 'storelocation')" (ionFocus)="hideKeyboard()" type="number" required></ion-input>
       </ion-item>
       <ion-text color="danger">
         <p [hidden]="!(!store.enterBoxs&&clicked)" class="ion-padding-start">
@@ -140,7 +145,8 @@
         <ion-label>
           仓位编号:
         </ion-label>
-        <ion-input [(ngModel)]="store.storelocation" name="storelocation" #outboxlength="ngModel" required></ion-input>
+        <ion-input [(ngModel)]="store.storelocation" #storelocation name="storelocation"
+          (keyup)="enterEdit($event, 'grossweight')" (ionFocus)="showKeyboard()" required></ion-input>
       </ion-item>
       <ion-text color="danger">
         <p [hidden]="!(!store.storelocation&&clicked)" class="ion-padding-start">
@@ -152,7 +158,8 @@
         <ion-label>
           毛重:
         </ion-label>
-        <ion-input [(ngModel)]="store.grossweight" type="number" name="grossweight" #outboxlength="ngModel" required></ion-input>
+        <ion-input [(ngModel)]="store.grossweight" (keyup)="enterEdit($event, 'complete', i)" #grossweight type="number"
+          (ionFocus)="hideKeyboard()" name="grossweight" required></ion-input>
       </ion-item>
       <ion-text color="danger">
         <p [hidden]="!(!store.grossweight&&clicked)" class="ion-padding-start">

+ 49 - 15
src/app/enter-store/enter-store.page.ts

@@ -5,6 +5,7 @@ import { UserData } from '../../providers/user-data';
 import { NgForm } from '@angular/forms';
 import { Keyboard } from '@ionic-native/keyboard/ngx';
 import { BarcodeScanner } from '@ionic-native/barcode-scanner/ngx';
+import { Device } from '@ionic-native/device/ngx'
 
 @Component({
   selector: 'app-enter-store',
@@ -21,6 +22,7 @@ export class EnterStorePage implements OnInit {
   sscId: number
   entergoodsCode: any
   constructor(
+    private device: Device,
     private storage: Storage,
     private barcodeScanner: BarcodeScanner,
     public userData: UserData,
@@ -28,6 +30,12 @@ export class EnterStorePage implements OnInit {
     private alertController: AlertController, ) { }
 
   @ViewChild('scanInput') scanInput;
+  @ViewChild('outboxlength') outboxlength;
+  @ViewChild('outboxwidth') outboxwidth;
+  @ViewChild('outboxheigt') outboxheigt;
+  @ViewChild('enterBoxs') enterBoxs;
+  @ViewChild('storelocation') storelocation;
+  @ViewChild('grossweight') grossweight;
   ngOnInit() {
     this.storage.get('storeList').then(async (val) => {
       if (val) {
@@ -40,15 +48,21 @@ export class EnterStorePage implements OnInit {
 
   // 进入页面
   ionViewDidEnter() {
+    // 已打开键盘状态,切换另外input,不会再次进入此事件,故需hideKeyboard事件来隐藏键盘
+    window['keyboard'] = this.keyboard
+    window.addEventListener('keyboardDidShow', this.ifHideKeyboard)
     this.initialData()
   }
 
-  // ngAfterViewInit(): void {
-  //   window.addEventListener('keyboardDidShow', function() {
-  //     console.log('show')
-  //     this.keyboard
-  //   });
-  //   }
+  ifHideKeyboard() {
+    if(window['keyboardVisible']===false) {
+      window['keyboard'].hide()
+    }
+  }
+
+  ionViewWillLeave() {
+    window.removeEventListener('keyboardDidShow', this.ifHideKeyboard)
+  }
 
   ionViewDidLeave() {
     if (this.storeList.length !== 0) {
@@ -58,21 +72,41 @@ export class EnterStorePage implements OnInit {
     }
   }
 
-  // hideKeyboard() {
-  //   // setInterval(()=>{
-  //   //   console.log('hide')
-  //   //   this.scanInput.setFocus()
-  //   //   this.keyboard.hide()
-  //   // },1000)
-  // }
+  hideKeyboard() {
+    // 收缩键盘后还是聚焦状态,不会进入此事件,需监听事件来隐藏键盘
+    if (this.device.version == '6' || this.device.version == '6.0' || this.device.version == '6.0.0') {
+      window['keyboardVisible'] = false
+      setTimeout(() => {
+        this.keyboard.hide()
+      }, 300)
+    }
+  }
 
+  enterEdit(e, key, index) {
+    e.preventDefault()
+    let keycode = window.event ? e.keyCode : e.which;
+    if (keycode == 13) {
+      e.preventDefault();
+      this[key].setFocus();
+      if(key==='complete') {
+        this.saveRecord(this.storeDetailList[index])
+      }
+    }
+  }
+
+  // 显示键盘
+  showKeyboard() {
+    window['keyboardVisible'] = true
+  }
+
+  // 隐藏键盘
   initialData() {
     this.storeDetailList = []
     this.clicked = false
     this.scanCode = ''
     this.scanInput.setFocus();
   }
-  
+
   // async getId() {
   //   await this.storage.get('pId').then((val) => {
   //     this.pId = val
@@ -129,7 +163,7 @@ export class EnterStorePage implements OnInit {
       for (let i of this.storeList) {
         i.enterCount = Number(i.enterBoxs) * Number(i.scpOutrate)
         i.amount = i.enterCount
-        if(!i.scanCode) {
+        if (!i.scanCode) {
           i.scanCode = this.scanCode
         }
         // this.scpCodes.push(i.scpCode)

+ 4 - 1
src/app/infoTab/infoTab.page.ts

@@ -43,7 +43,10 @@ export class infoTabPage implements OnInit {
   }
   inputFocus() {
     this.infoInput.setFocus();
-    this.keyboard.hide()
+    window['keyboardVisible'] = false
+    setTimeout(() => {
+      this.keyboard.hide()
+    }, 300)
   }
   doClick() {
     this.inputFocus()

+ 0 - 1
src/app/sample-detail/sample-detail.page.ts

@@ -51,7 +51,6 @@ export class SampleDetailPage implements OnInit {
             i.imgsrc = i.pictures[0].smallPicture
             let qadata = await this.userData.getSampleQAlog(i.sdpId)
             if (JSON.parse(qadata).data.length !== 0) {
-              console.log(qadata)
               for (let j of JSON.parse(qadata).data) {
                 i['qaIdList'].push(j.id) // qa记录的id数组
               }

+ 10 - 21
src/app/sample/sample.page.html

@@ -16,35 +16,24 @@
   <ion-list>
     <ion-item>
       <ion-label>样品单号:</ion-label>
-      <ion-input [(ngModel)]="sampleInfo.sdDocument"></ion-input>
+      <ion-input [(ngModel)]="sdDocument"></ion-input>
     </ion-item>
-    <!-- <ion-item>
-      <ion-label>交样时间(起):</ion-label>
-      <ion-datetime [(ngModel)]="sampleInfo.sdFinishDateLt"></ion-datetime>
-    </ion-item>
-    <ion-item>
-      <ion-label>交样时间(止):</ion-label>
-      <ion-datetime [(ngModel)]="sampleInfo.sdFinishDateGt"></ion-datetime>
-    </ion-item> -->
     <ion-item>
       <ion-label>下单时间(起):</ion-label>
-      <ion-datetime [(ngModel)]="sampleInfo.sdCreateDateGt"></ion-datetime>
+      <!-- 扫码枪上同时出现两个ion-datetime和input时,多次点击切换会崩溃掉 -->
+      <!-- <ion-datetime displayFormat="MM/DD/YYYY" [(ngModel)]="sdCreateDateGt"></ion-datetime> -->
+      <ion-input [(ngModel)]="sdCreateDateGt" clearInput (click)="getDate('sdCreateDateGt')" readonly ></ion-input>
+      <ion-icon name="close" *ngIf="sdCreateDateGt" (click)="clearDate('sdCreateDateGt')" slot="end"></ion-icon>
     </ion-item>
     <ion-item>
       <ion-label>下单时间(止):</ion-label>
-      <ion-datetime [(ngModel)]="sampleInfo.sdCreateDateLt"></ion-datetime>
-    </ion-item>
-    <!-- <ion-item>
-      <ion-label>客 户:</ion-label>
-      <ion-input [(ngModel)]="sampleInfo.sdDocument"></ion-input>
-    </ion-item> -->
-    <!-- <ion-item>
-      <ion-label>状 态:</ion-label>
-      <ion-input [(ngModel)]="sampleInfo.sdStatus"></ion-input>
-    </ion-item> -->
+      <!-- <ion-datetime displayFormat="MM/DD/YYYY" [(ngModel)]="sdCreateDateLt"></ion-datetime> -->
+      <ion-input [(ngModel)]="sdCreateDateLt" (click)="getDate('sdCreateDateLt')" readonly></ion-input>
+      <ion-icon name="close" *ngIf="sdCreateDateLt" (click)="clearDate('sdCreateDateLt')" slot="end"></ion-icon>
+    </ion-item> 
     <ion-item>
       <ion-label>跟单 QA:</ion-label>
-      <ion-input [(ngModel)]="sampleInfo.sdMan"></ion-input>
+      <ion-input [(ngModel)]="sdMan"></ion-input>
     </ion-item>
   </ion-list>
   <div class="ion-padding">

+ 49 - 32
src/app/sample/sample.page.ts

@@ -1,7 +1,9 @@
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, ViewChild } from '@angular/core';
 import { UserData } from '../../providers/user-data';
 import { Storage } from '@ionic/storage'
 import { Router } from '@angular/router';
+import { DatePicker } from '@ionic-native/date-picker/ngx';
+import { commonService } from '../../providers/common.service'
 
 @Component({
   selector: 'app-sample',
@@ -9,26 +11,43 @@ import { Router } from '@angular/router';
   styleUrls: ['./sample.page.scss'],
 })
 export class SamplePage implements OnInit {
-  sampleInfo = {
-    sdDocument: '',
-    sdFinishDateLt: '',
-    sdFinishDateGt: '',
-    sdCreateDateLt: '',
-    sdCreateDateGt: '',
-    sdStatus: '',
-    sdMan: ''
-  };
+  public sdDocument: string
+  public sdCreateDateLt: any
+  public sdCreateDateGt: any
+  public sdMan: string
   constructor(
-    private router: Router, 
+    private router: Router,
+    public commonService: commonService,
+    private datePicker: DatePicker,
     private storage: Storage,
     public userData: UserData
   ) { }
 
   ngOnInit() { }
+  // ionViewDidEnter() {
+  //   this.initialData()
+  // }
   search() {
     this.storage.set('sampleForm', this.getSerchForm())
     this.router.navigateByUrl('/sample-table');
-    // this.userData.getSampleTableData(this.getSerchForm())
+  }
+  getDate(val) {
+    this.datePicker.show({
+      date: this[val]?new Date(this[val]):new Date(),
+      mode: 'date',
+      androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK
+    }).then(
+      date => {
+        if(date) {
+          this[val] = this.commonService.getFormatDate(new Date(date))
+        }
+      } ,
+      err => console.log('Error occurred while getting date: ', err)
+    );
+  }
+
+  clearDate(val) {
+    this[val] = ''
   }
 
   getSerchForm() {
@@ -42,48 +61,46 @@ export class SamplePage implements OnInit {
       },
       from: 0,
       size: 10,
-      sort: [{sdCreateDate: {order: "desc"}}],
+      sort: [{ sdCreateDate: { order: "desc" } }],
       aggs: {}
     };
-    if (this.sampleInfo.sdDocument) {
+    if (this.sdDocument) {
       let prefix = {}
-      prefix['sdDocument.keyword'] = this.sampleInfo.sdDocument.toUpperCase()
+      prefix['sdDocument.keyword'] = this.sdDocument.toUpperCase()
       queryForm.query.bool.must.push({
         prefix: prefix
       })
     }
-    if (this.sampleInfo.sdCreateDateGt || this.sampleInfo.sdCreateDateLt) {
+    if (this.sdCreateDateGt || this.sdCreateDateLt) {
       let range = {
         sdCreateDate: {}
       }
-      if (this.sampleInfo.sdCreateDateGt) {
-        range.sdCreateDate['gt'] = new Date(this.sampleInfo.sdCreateDateGt).getTime()
+      if (this.sdCreateDateGt) {
+        range.sdCreateDate['gte'] = new Date(this.sdCreateDateGt).getTime()-28800000 // 00:00:00,默认为08:00:00
       }
-      if (this.sampleInfo.sdCreateDateLt) {
-        range.sdCreateDate['lt'] = new Date(this.sampleInfo.sdCreateDateLt).getTime()
+      if (this.sdCreateDateLt) {
+        range.sdCreateDate['lte'] = new Date(this.sdCreateDateLt).getTime()+57599000 // 23:59:59
       }
       queryForm.query.bool.must.push({
         range: range
       })
     }
-    if (this.sampleInfo.sdMan) {
+    if (this.sdMan) {
       let prefix = {}
-      prefix['sdMan.keyword'] = this.sampleInfo.sdMan
+      prefix['sdMan.keyword'] = this.sdMan
       queryForm.query.bool.must.push({
         prefix: prefix
       })
     }
-     return queryForm
+    return queryForm
+  }
+  initialData() {
+    this.sdDocument = '',
+      this.sdCreateDateLt = '',
+      this.sdCreateDateGt = '',
+      this.sdMan = ''
   }
   clear() {
-    this.sampleInfo = {
-      sdDocument: '',
-      sdFinishDateLt: '',
-      sdFinishDateGt: '',
-      sdCreateDateLt: '',
-      sdCreateDateGt: '',
-      sdStatus: '',
-      sdMan: ''
-    }
+    this.initialData()
   }
 }

+ 16 - 1
src/app/tabs/tabs.page.ts

@@ -1,4 +1,5 @@
 import { Component } from '@angular/core';
+import { Keyboard } from '@ionic-native/keyboard/ngx';
 
 @Component({
   selector: 'app-tabs',
@@ -6,5 +7,19 @@ import { Component } from '@angular/core';
   styleUrls: ['tabs.page.scss']
 })
 export class TabsPage {
-  constructor() {}
+  constructor(private keyboard: Keyboard) {}
+  ionViewDidLeave(){
+    console.log('leave')
+    window.removeEventListener('keyboardDidShow', this.ifHideKeyboard)
+  }
+  ionViewDidEnter() {
+    window['keyboard'] = this.keyboard
+    window.addEventListener('keyboardDidShow', this.ifHideKeyboard)
+  }
+  ifHideKeyboard() {
+    console.log(window['keyboardVisible'])
+    if(window['keyboardVisible']===false) {
+      window['keyboard'].hide()
+    }
+  }
 }

+ 19 - 1
src/providers/common.service.ts

@@ -18,7 +18,7 @@ export class commonService {
   }
 
   convertBase64(url) {
-    this.http.get(url, {}, {'responseType':'blob'})
+    this.http.get(url, {}, { 'responseType': 'blob' })
       .then(data => {
         console.log(data.status);
         console.log(data.data); // data received by server
@@ -30,6 +30,24 @@ export class commonService {
         console.log(error.headers);
       });
   }
+
+  getFormatDate = (date) => {
+    let currentdate
+    if (date) {
+      let seperator1 = "-";
+      let year = date.getFullYear();
+      let month = date.getMonth() + 1;
+      let strDate = date.getDate();
+      if (month >= 1 && month <= 9) {
+        month = "0" + month;
+      }
+      if (strDate >= 0 && strDate <= 9) {
+        strDate = "0" + strDate;
+      }
+      currentdate = year + seperator1 + month + seperator1 + strDate
+    }
+    return currentdate;
+  }
   // toDataUrl(url, callback) {
   //   var xhr = new XMLHttpRequest();
   //   xhr.onload = function () {