panxingxin 5 年 前
コミット
7c4e9f4f96

+ 1 - 1
src/app/app-routing.module.ts

@@ -31,7 +31,7 @@ const routes: Routes = [
   { path: 'sample-count-zero', loadChildren: './sample-count-zero/sample-count-zero.module#SampleCountZeroPageModule' },
   { path: 'store-pending-search', loadChildren: './store-pending-search/store-pending-search.module#StorePendingSearchPageModule' },
   { path: 'inspection', loadChildren: './inspection/inspection.module#InspectionPageModule' },
-  // { path: 'inspection-list/:poCode/:scCode', loadChildren: './inspection-list/inspection-list.module#InspectionListPageModule' }
+  { path: 'inspection-list/:poCode/:scCode', loadChildren: './inspection-list/inspection-list.module#InspectionListPageModule' }
   // { path: 'scanning', loadChildren: './scanning/scanning.module#ScanningPageModule', canActivate: [LoginGuardGuard] }
 ];
 @NgModule({

+ 39 - 39
src/app/inspection-list/inspection-list.page.ts

@@ -43,51 +43,51 @@ export class InspectionListPage implements OnInit {
   }
 
   choosePicture() {
-    // const options: ImagePickerOptions = {
-    //   maximumImagesCount: 30,
-    //   outputType: 1,
-    //   width: 1800,
-    //   height: 1350,
-    //   quality: 90
-    // };
+    const options: ImagePickerOptions = {
+      maximumImagesCount: 30,
+      outputType: 1,
+      width: 1800,
+      height: 1350,
+      quality: 90
+    };
 
-    // this.imagePicker.getPictures(options).then((results) => {
-    //   for (var i = 0; i < results.length; i++) {
-    //     this.base64.encodeFile(results[i]).then((base64File: string) => {
-    //       this.imgList.push(
-    //         base64File
-    //       )
-    //       let imageData = base64File.split('base64,')[1]
-    //       if (this.imageData) {
-    //         this.imageData = this.imageData + ',' + imageData
-    //       } else {
-    //         this.imageData = '' + imageData
-    //       }
-    //     }, (err) => {
-    //       console.log(err);
-    //     });
-    //   }
-    // }, (err) => { });
-    // this.showPicture(qc, this.cameraSetting.albumOption)
+    this.imagePicker.getPictures(options).then((results) => {
+      for (var i = 0; i < results.length; i++) {
+        this.base64.encodeFile(results[i]).then((base64File: string) => {
+          this.imgList.push(
+            base64File
+          )
+          let imageData = base64File.split('base64,')[1]
+          if (this.imageData) {
+            this.imageData = this.imageData + ',' + imageData
+          } else {
+            this.imageData = '' + imageData
+          }
+        }, (err) => {
+          console.log(err);
+        });
+      }
+    }, (err) => { });
+    this.showPicture(qc, this.cameraSetting.albumOption)
   }
 
   takePicture() {
-    // this.showPicture(this.cameraSetting.takePhotoOption)
+    this.showPicture(this.cameraSetting.takePhotoOption)
   }
   showPicture(options) {
-    // this.camera.getPicture(options).then((imageData) => {
-    //   this.imgList.push(
-    //     'data:image/png;base64,' + imageData
-    //   )
-    //   if (this.imageData) {
-    //     this.imageData = this.imageData + ',' + imageData
-    //   } else {
-    //     this.imageData = '' + imageData
-    //   }
-    // }, (err) => {
-    //   // Handle error
-    //   console.log("Camera issue: " + err);
-    // });
+    this.camera.getPicture(options).then((imageData) => {
+      this.imgList.push(
+        'data:image/png;base64,' + imageData
+      )
+      if (this.imageData) {
+        this.imageData = this.imageData + ',' + imageData
+      } else {
+        this.imageData = '' + imageData
+      }
+    }, (err) => {
+      // Handle error
+      console.log("Camera issue: " + err);
+    });
   }
 
   showFullScreenImage(data) {