调用钉钉扫一扫

1.使用npm安装

npm install dingtalk-jsapi --save

2.在所需要的界面,引入

import * as dd from "dingtalk-jsapi";

3.写入代码

dd.biz.util.scan({
    type: String , // type 为 all、qrCode、barCode,默认是all。
    onSuccess: function(data) {
    //onSuccess将在扫码成功之后回调
      /* data结构
        { 'text': String}
      */
    },
   onFail : function(err) {
   }
})

 

可以对获取到的数据进行处理,需要再钉钉环境下

你可能感兴趣的:(智物系统)