API
Class

Scan ($UI/system/api/native/scan)

使用范围:UI2

Contents

class Scan ($UI/system/api/native/scan)

二维码扫描。

 
	 
	 	var scan = require('$UI/system/api/native/scan');
	        scan.scanQRCode({
			needResult : 1,
			success : function(res) {
				alert(JSON.stringify(res));
			}
		});
	

Constructor Top

  Scan ()

Static Methods Top

void scanQRCode (Object options)

Constructor details Top

public Scan ()

二维码扫描。

 
	 
	 	var scan = require('$UI/system/api/native/scan');
	        scan.scanQRCode({
			needResult : 1,
			success : function(res) {
				alert(JSON.stringify(res));
			}
		});
	

Static Methods Detail Top

static public void scanQRCode (Object options)

扫描二维码。(微信可在应用内处理: needResult=0)

Parameters

Object options

选项
结构如下:

{ "needResult": 是否返回扫描结果 1:需要;0:不需要 , "success" : {function} success 回调函数 "fail" : {function} fail 回调函数 }

Return Value

void