質問編集履歴

1

コードの追加

2016/02/06 11:33

投稿

teratech
teratech

スコア17

test CHANGED
@@ -1 +1 @@
1
- monacaを用いてGS1コードをスキャンす
1
+ monacaを用いてGS1コードをスキャンしたいのでが・・・
test CHANGED
@@ -1,6 +1,6 @@
1
1
  アプリ開発初心者です。
2
2
 
3
- Monacaを利用して開発進めております。
3
+ Monacaを利用して開発進めております。
4
4
 
5
5
  Cordovaのバーコードプラグイン(plugins.barcodeScanner.scan)を用いて、バーコードをスキャンしているのですが、こちらですとJANコード等は読みとれるのですが、GS1コードが読み取れません。
6
6
 
@@ -9,3 +9,49 @@
9
9
  ご教示いただければ幸いです。
10
10
 
11
11
  よろしくお願い申し上げます。
12
+
13
+
14
+
15
+ CordovaのBarcodeScannerプラグインを組み込み、以下のように組んでおります。
16
+
17
+
18
+
19
+ ・・・
20
+
21
+ <script>
22
+
23
+ function scanBarcode() {
24
+
25
+ window.plugins.barcodeScanner.scan(function(result) {
26
+
27
+ $('#gs1').val(result.text);
28
+
29
+ }, function(error) {
30
+
31
+ alert("Scanning failed: " + error);
32
+
33
+ });
34
+
35
+ }
36
+
37
+ </script>
38
+
39
+ </head>
40
+
41
+ <body>
42
+
43
+ ・・・
44
+
45
+ <ons-col width="100px">
46
+
47
+ バーコード
48
+
49
+ </ons-col>
50
+
51
+ <ons-col>
52
+
53
+ <ons-button id="scan" modifier="cta" onClick ="scanBarcode()">スキャン</ons-button>
54
+
55
+ <input type="hidden" id="gs1">
56
+
57
+ </ons-col>