Select Case e.path
Case "test.htm"
Dim wb As new weui
Dim scod As String
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 .AddInputCell("ic1")
.AddLabel("lbh","资产编号",0)
.AddInput("cod","text",1)
.AddVcodeButton("scan","扫码输入",2).Attribute = " & path & "/plus/barcode_scan.html',true,true);""" '增加二维码扫描按钮,2表示显示在右边
End With
.AddInput("员工姓名","员工姓名","Text")
.AddInput("部门名称","部门名称","Text")
.AddInput("资产名称","资产名称","Text")
End With
' wb.InsertHTML("<script>Function scaned( t, r, f ) {plus.nativeUI.alert('扫描返回的信息如:\n编码:' + t + '\n内容:' + r + '\n图片存放路径(在手机端):' + f);}</script>")
' wb.InsertHTML("<script>function scaned( t, r, f ) {scod=r; }</script>")
'wb.InsertHTML("<script>Function scaned( t, r, f ){document.getElementById('cod').value=r;}</script>")
wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById('cod').value=r;}</script>")
e.WriteString(wb.Build)
End Select
为什么,我扫码后,会出现选择打开方式的提示,打开方式为手机中的不同浏览器,如下图
此主题相关图片如下:微信图片_20190618114058.jpg