Foxtable(狐表)用户栏目专家坐堂 → 用微信扫电子fa piao,如何把数据传到狐表中?


  共有4802人关注过本帖树形打印复制链接

主题:用微信扫电子fa piao,如何把数据传到狐表中?

帅哥哟,离线,有人找我吗?
有点甜
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/24 16:55:00 [只看该作者]

以下是引用lihe60在2017/11/24 16:16:00的发言:
用HBuilder可以扫了,但这个数据如何导入狐表中?
[此贴子已经被作者于2017/11/24 16:20:57编辑过]

 

扫描以后,得到以后,用js提交给foxtable不就行了?

 

【如何把得到的扫描信息填入文本框里,执行如下js代码? 】

    wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById('姓名').value=r;}</script>")

 

 


 回到顶部
帅哥哟,离线,有人找我吗?
lihe60
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6804 积分:43033 威望:0 精华:0 注册:2009/3/2 14:07:00
  发帖心情 Post By:2017/11/24 20:00:00 [只看该作者]

 wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById('姓名').value=r;}</script>")
这个代码写在什么地方?

 回到顶部
帅哥,在线噢!
有点蓝
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105965 积分:538900 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/11/24 20:25:00 [只看该作者]

生成网页的代码的地方

 回到顶部
帅哥哟,离线,有人找我吗?
lihe60
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6804 积分:43033 威望:0 精华:0 注册:2009/3/2 14:07:00
  发帖心情 Post By:2017/11/24 21:07:00 [只看该作者]

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 = " & path & "/plus/barcode_scan.html',true,true);"""
        End With
                
        wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById('姓名').value=r;}</script>")
        wb.InsertHTML("<script>function scaned( t, r, f ) {plus.nativeUI.alert('扫描返回的信息如:\n编码:' + t + '\n内容:' + r + '\n图片存放路径(在手机端):' + f);}</script>")
        e.WriteString(wb.Build)
End Select


代码这样写了,数据还是不能导入到狐表。

 回到顶部
帅哥,在线噢!
有点蓝
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105965 积分:538900 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/11/24 21:18:00 [只看该作者]

要提交数据,然后还要有代码接收数据:http://www.foxtable.com/mobilehelp/scr/0055.htm

建议把移动开发帮助的例子都试试,理解一下基础的概念

 回到顶部
帅哥哟,离线,有人找我吗?
lihe60
  16楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6804 积分:43033 威望:0 精华:0 注册:2009/3/2 14:07:00
  发帖心情 Post By:2017/11/25 7:20:00 [只看该作者]

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("年龄","年龄","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 ) {document.getElementById('年龄').value=r;}</script>")
            '  wb.InsertHTML("<script>function scaned( t, r, f ) {plus.nativeUI.alert('扫描返回的信息如:\n编码:' + t + '\n内容:' + r + '\n图片存放路径(在手机端):' + f);}</script>")
            e.WriteString(wb.Build)

            
            Dim sb As New StringBuilder
            For Each key As String In e.PostValues.Keys
                Tables("表A").current("第二列")=e.PostValues(key)
            Next
            e.WriteString(sb.ToString)

End Select

加了这个代码,数据还是不能导入狐表

 回到顶部
帅哥,在线噢!
有点蓝
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:105965 积分:538900 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2017/11/25 8:53:00 [只看该作者]

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"
        If e.PostValues.count = 0 Then
            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("年龄","年龄","text")
            End With
            
            With wb.AddButtonGroup("form1","btg1",True)
                .Add("btn1", "扫一扫", "button").Attribute = "onclick=""clicked('"  & path & "/plus/barcode_scan.html',True,True);"""
            End With
            
            wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById('年龄').value=r;}</script>")
            '  wb.InsertHTML("<script>function scaned( t, r, f ) {plus.nativeUI.alert('扫描返回的信息如:\n编码:' + t + '\n内容:' + r + '\n图片存放路径(在手机端):' + f);}</script>")
            e.WriteString(wb.Build)
            
        Else
            Tables("表A").current("第一列")=e.PostValues("姓名")
            Tables("表A").current("第二列")=e.PostValues("年龄")
            Dim sb As New StringBuilder
            sb.AppendLine("<meta name='viewport' c>")
            sb.AppendLine("接收到的数据有:<br/><br/>")
            For Each key As String In e.PostValues.Keys
                sb.AppendLine(key & ":" & e.PostValues(key) & "<br/>")
            Next
            e.WriteString(sb.ToString)
        End If
End Select

 回到顶部
帅哥哟,离线,有人找我吗?
lihe60
  18楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6804 积分:43033 威望:0 精华:0 注册:2009/3/2 14:07:00
  发帖心情 Post By:2017/11/25 18:19:00 [只看该作者]

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"
        If e.PostValues.count = 0 Then
            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("年龄","年龄","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 ) {document.getElementById('年龄').value=r;}</script>")
            '  wb.InsertHTML("<script>function scaned( t, r, f ) {plus.nativeUI.alert('扫描返回的信息如:\n编码:' + t + '\n内容:' + r + '\n图片存放路径(在手机端):' + f);}</script>")
            e.WriteString(wb.Build)
        Else
            Tables("表A").current("第一列")=e.PostValues("姓名")
            Tables("表A").current("第二列")=e.PostValues("年龄")
            Dim sb As New StringBuilder
            sb.AppendLine("<meta name='viewport' c>")
            sb.AppendLine("接收到的数据有:<br/><br/>")
            For Each key As String In e.PostValues.Keys
                sb.AppendLine(key & ":" & e.PostValues(key) & "<br/>")
            Next
            e.WriteString(sb.ToString)
        End If
End Select

这个代码还是不能把数据导入狐表,else后面的代码不执行。
[此贴子已经被作者于2017/11/25 18:39:35编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
lihe60
  19楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6804 积分:43033 威望:0 精华:0 注册:2009/3/2 14:07:00
  发帖心情 Post By:2017/11/26 11:10:00 [只看该作者]

有点甜老师,如何解决呀?

 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  20楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/26 11:52:00 [只看该作者]

以下是引用lihe60在2017/11/26 11:10:00的发言:
有点甜老师,如何解决呀?

 

用ajax提交啊

 

wb.InsertHTML("<script>function scaned( t, r, f ) {document.getElementById('年龄').value=r;var result = submitAjaxForm('form1','',false);alert(result)}</script>")

 

http://www.foxtable.com/mobilehelp/scr/0101.htm

 


 回到顶部
总数 31 上一页 1 2 3 4 下一页