wb.AppendHTML("<script src='http://g.alicdn.com/dingding/open-develop/1.9.0/dingtalk.js'></script>",True) '引入JS-SDK库
wb.AppendHTML("<script src='./lib/ddscan.js'></script>",True) '引入脚本文件
With wb.AddInputGroup("","ipg11","扫描单号自动流转")
With .AddInputCell("ic1")
.AddLabel("lbh","操作状态",0)
.AddInput("number","text",1)
.AddVcodeButton("scan","扫描二维码",2) '增加二维码扫描按钮,2表示显示在右边
End With
End With
js
dd.ready(function(){
document.getElementById('scan').onclick = function () {
dd.biz.util.scan({
type: 'qrCode' , // type 为 all、qrCode、barCode,默认是all。
tips: "扫描单号自动流转工作流", //进入扫码页面显示的自定义文案
onSuccess: function(data) {
document.getElementById('number').value = data.text;
},
onFail : function(err) {
}
});
};
});