以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 关于移动扫码输入的一个问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=144944) |
-- 作者:1669607010 -- 发布时间:2020/1/3 16:04:00 -- 关于移动扫码输入的一个问题 以下是扫码录入的代码,程序已经能成功扫码,并将扫到的内容输入到指定的位置,现在的问题是如果扫码扫到的内容是“生产原料-锦纶-导电锦纶-0123-20190102”,如何能把扫码得到的内容按“-”分隔开分别输入到位置,哪位老师给指导一下, Dim fl As String = ProjectPath & "web\\" & e.path Dim path As String = "foxtableAppTest"
If filesys.FileExists(fl) Dim idx As Integer =
fl.LastIndexOf(".") Dim ext As String = fl.SubString(idx) Select Case ext Case
".jpg",".gif",".png",".bmp",".wmf",".js",".css"
,".html",".htm",".zip",".rar",".txt" e.WriteFile(fl) Return \'这里必须返回 End Select End If
Select Case e.path 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("姓名","姓名","Text") .AddInput("年龄","年龄","number") End With With
wb.AddButtonGroup("form1","btg1",True) .Add("btn1",
"扫一扫", "button").Attribute =
"web\\"&"
& path & "/plus/barcode_scan.html\',true,true);""" End With e.WriteString(wb.Build) End Select
|
-- 作者:有点蓝 -- 发布时间:2020/1/3 16:45:00 -- 到js文件里定义函数,比如 function dosomthing(result){ var sr = result.split("-"); document.getElementById(\'某某控件1\').value=sr[0]; document.getElementById(\'某某控件2\').value=sr[1];} 然后代码改为 wb.InsertHTML("<script>function scaned( t, r, f ) {dosomthing(r);}</script>") wb.AppendHTML("<script type=\'text/javascript\' src=\'/" & path & "/js/包含上面js函数的js文件.js\'></script>", True)
|
-- 作者:1669607010 -- 发布时间:2020/1/3 16:45:00 -- 谢谢蓝老师 |
-- 作者:1669607010 -- 发布时间:2020/1/4 9:08:00 -- 老师,再请教一个问题,移动开发按如下代码增加的输入框,请问如何在前两个文本框输入数字后,第三个文本框根据(出库件数*每件标重)自动计算出数值 .AddInput("出库件数","出库件数","number") .AddInput("每件标重","每件标重","number")
.AddInput("出库标重","出库标重","number") |
-- 作者:有点蓝 -- 发布时间:2020/1/4 9:13:00 -- 参考:http://www.foxtable.com/mobilehelp/topics/0061.htm |