當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript ionic-native.BarcodeScanner類代碼示例

本文整理匯總了TypeScript中ionic-native.BarcodeScanner的典型用法代碼示例。如果您正苦於以下問題:TypeScript BarcodeScanner類的具體用法?TypeScript BarcodeScanner怎麽用?TypeScript BarcodeScanner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了BarcodeScanner類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: scan

 scan(event) {
     BarcodeScanner.scan().then((data) => {
         this.barcodeData = data;
     }, (error) => {
         console.log("Error: ", error);
     })
 }
開發者ID:webdeziner,項目名稱:barcodeScannerApp,代碼行數:7,代碼來源:home.ts

示例2: scanCode

 scanCode() {
   BarcodeScanner.scan().then((barcodeData) => {
     if (barcodeData.cancelled !== 1) {
       this.dataStore.checkHistory(barcodeData.text).then((data) => {
         var isDuplicate = (data.res.rows.length > 0);
         this.local.get(OPTIONS_KEY_NAME).then((res) => {
           let options = JSON.parse(res) || {};
           if (options.ignoreDuplicateScans && isDuplicate) {
             let alert = this.alerts.create({
               title: 'Duplicate Entry',
               subTitle: 'This scan has been ignored.',
               buttons: ['Dismiss']
             });
             alert.present();
           }
           else {
             this.fetchItem(barcodeData);
           }
         });
       });
     }
   }, (err) => {
     let alert = this.alerts.create({
       title: 'Scan Error',
       subTitle: err,
       buttons: ['Dismiss']
     });
     alert.present();
   });
 }
開發者ID:dstreicher,項目名稱:bmnh-specimen-label-scanner,代碼行數:30,代碼來源:tabs.ts

示例3: function

 this.platform.ready().then(() => {
   BarcodeScanner.scan().then((barcodeData) => {
     //this.test = JSON.stringify(barcodeData);
   }, function (error) {
     //this.test = 'error : ' + error;
   })
 })
開發者ID:RemaxThailand,項目名稱:RemaxMobile,代碼行數:7,代碼來源:login.ts

示例4: scan

 private scan() {
   BarcodeScanner.scan().then((barcodeData) => {
     this.isbn = barcodeData.text;
     this.searchBook();
   }, (err) => {
     console.error('une erreur est interceptée', err)
   });
 }
開發者ID:pom421,項目名稱:biblio,代碼行數:8,代碼來源:ajouter-livre.ts

示例5: loginForQR

 //通過掃描二維碼登陸
 loginForQR(){
   BarcodeScanner.scan().then((barcodeData) => {
     this.accesstoken=barcodeData.text;
     this.login();
     }, (err) => {
       alert("調用本地相機失敗!");
     });
 }
開發者ID:XueRainey,項目名稱:Ioniclub,代碼行數:9,代碼來源:login.ts

示例6: scan

  scan() {
    BarcodeScanner.scan().then(barcodeData => {

      this.barcodeData = barcodeData;

    }, (err) => {
      console.log(err);
    });
  }
開發者ID:plinionaves,項目名稱:curso-iniciando-ionic-2-native,代碼行數:9,代碼來源:barcode-test.ts

示例7: loginForQR

  //通過掃描二維碼登陸
  loginForQR(){
// 問題是,掃描後,accesstoken如何寫入input
    BarcodeScanner.scan().then((barcodeData) => {
      this.accesstoken=barcodeData.text;
      this.login();
      }, (err) => {
          // An error occurred
      });
  }
開發者ID:cnodejs-client,項目名稱:Ioniclub,代碼行數:10,代碼來源:login.ts

示例8: scan

 scan(){
     BarcodeScanner.scan().then(
         barcodeData=>{
             this.data = barcodeData;
         },
         err=>{
             this.data = 'There was an error:'+err;
         }
     );
 }
開發者ID:ralphowino,項目名稱:ionic-native-kitchen-sink,代碼行數:10,代碼來源:barcode.ts

示例9: startScan

 startScan() {
    return BarcodeScanner.scan().then(
     (result) => {
       console.log(result);
     },
     (error) => {
       console.log(error);
     }
   )
 }
開發者ID:thomaskarlrichter,項目名稱:StreetCred-1,代碼行數:10,代碼來源:home.ts

示例10:

        this.platform.ready().then(() => {
            BarcodeScanner.scan().then((result) => {
                if (!result.cancelled) {
					this.barcodeText = result.text;
					this.barcodeFormat = result.format;
					this.scanningDone({'text':result.text,'format':result.format});
				}
            }, (error) => {
            	console.log('error when scanning product barcode');
            });
        });  		
開發者ID:ahnerd,項目名稱:ionic2-barcode-scanner,代碼行數:11,代碼來源:home.ts


注:本文中的ionic-native.BarcodeScanner類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。