看了例子,想在移动端实现一个扫码功能:如图,该表单有两行文本框,都需要通过扫码的方式录入。1.每一行都包括一个文本框,一个按钮,按钮功能为扫一扫,如何在weui下实现这种排布?
2.每一行的扫一扫都将扫到的信息输入到对应的文本框中。
例子中只讲到如果扫一个,按照上述需求代码该如何写?
Case "list.htm"
wb.AppendHTML("<script type='text/javascript' src='/" & path & "/js/common.js'></script>", True)
wb.AppendHTML("<link rel='stylesheet' href='/" & path & "/css/common.css' Type='text/css' charset='utf-8'/>", True)
wb.AddForm("","form1","test.htm")
With wb.AddInputGroup("form1","ipg1","测试")
With .AddInput("gwqm","工位全码","text")
.Readonly= True
End With
With .AddInput("wpqm","网片全码","text")
.Readonly= True
End With
End With
With wb.AddButtonGroup("","btg2", True)
.Add("btn1", "扫工位", "button").Attribute = " & path & "/plus/barcode_scan.html',true,true);"""
.Add("btn3", "返回首页", "button","default.htm").kind=2
End With
此主题相关图片如下:微信图片_20191201231339.png
wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById('gwqm').value=r;}</script>")
end select