'以下是动态生成网页的代码
Select Case e.Path
Case "addnew.htm"
Dim wb As New WeUI '定义一个基于weui框架的网页生成器
wb.AddForm("","form1","addnew.htm")
With wb.AddInputGroup("form1","ipg1","新增订单")
.AddSelect("cp","产品","PD01|PD02|PD03|PD04|PD05")
.AddInput("gy","雇员","text")
.AddInput("kh","客户","text")
.AddInput("dj","单价","number")
.AddInput("zk","折扣","number")
.AddInput("sl","数量","number")
.AddInput("rq","日期","date")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btnok","确定")
End With
e.WriteString(wb.Build) '生成网页
Case "test.htm"
Dim wb As new weui
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","零件信息")
.AddInput("gys","供应商编号","Text")
.AddInput("ljh","零件号","Text")
.AddInput("kxlh","空箱料号","Text")
.AddInput("bzs","包装数","number")
.AddInput("zdbm","自动编码","Text")
.AddInput("gc","工厂","Text")
End With
With wb.AddButtonGroup("form1","btg1",True)
.Add("btn1", "扫一扫", "button").Attribute = " & path & "/plus/barcode_scan.html',true,true);"""
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 ) {document.getElementById('gys').value=r;}</script>")
我想实现function scaned( t, r, f ) 中变量r值,按“—”分割成6个字符串,并赋值到以上6个输入框的值,请教如何实现?谢谢指点!!
e.WriteString(wb.Build)
End Select