|

楼主 |
发表于 2018-1-2 17:41:32
|
显示全部楼层
第一步:
引用var scan = require('$UI/system/api/native/scan');
第二步:
写扫一扫代码
- //扫一扫
- Model.prototype.sysBtnClick = function(event){
- var input1 = this.comp("input1");
- scan.scanQRCode({
- needResult : 1,
- desc : 'scanQRCode desc',
- success : function(res) {
- // alert(JSON.stringify(res));
- var no = res.resultStr.split(',')[1];
- // alert(no);
- input1.set({value: no});
- },
- fail : function(res) {
- alert("fail:" + JSON.stringify(res));
- }
- });
- };
复制代码
第三步:
修改 /UI2/system/config/config.json 添加配置debug:false; 就表示微信jssdk非调试模式运行
|
|