Foxtable(狐表)用户栏目专家坐堂 → 关于微信二维码扫描输入


  共有3906人关注过本帖平板打印复制链接

主题:关于微信二维码扫描输入

帅哥哟,离线,有人找我吗?
sky-18
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:655 积分:5004 威望:0 精华:0 注册:2011/11/26 17:46:00
  发帖心情 Post By:2020/2/2 16:42:00 [只看该作者]

今天又继续研究了一下代码。有个不懂的地方要问老师
那就是怎么没见给二维码扫描按钮设置事件代码呢?

Select Case e.Path
    Case "test.htm",""
        Dim wb As New weui
        wb.AppendHTML("<script src='http://res.wx.qq.com/open/js/jweixin-1.0.0.js'></script>",True)
'
引入JS-SDK
        wb.AppendHTML("<script src='./lib/jssdk.js'></script>")
'
引入脚本文件
       
'
在页面注入权限验证配置
        Dim st As New Date(1970,1,1,8,0,0)
        Dim appid As String = "wxa31aba4cd83af57e"
'CorpID
        Dim timestamp As Integer = CInt((Date.Now - st).TotalSeconds())
'
时间戳
        Dim noncestr As String = Rand.NextString(16)
'
随机字符
        Dim url As String  = e.Request.URL.ToString
'
当前页面地址
        Dim signature As String = Functions.Execute("GetJsSignature", noncestr, timestamp, url)
'
生成权限验证签名
        Dim cfg As String = "wx.config({appId:'{0}',timestamp:{1},nonceStr:'{2}',signature:'{3}',jsApiList:['scanQRCode']});"
        wb.AppendHTML("<script>" & CExp(cfg,appid,timestamp,noncestr,signature) & "</script>",True)
       
'开始正常生成网页内容
       
wb.AddForm("","form1","test.htm")
        With wb.AddInputGroup("form1","ipg1",
"
产品输入")
            .AddInput("product",
"
产品","text")
            With .AddInputCell("ic1")
                .AddLabel("lbh",
"
编号",0)
                .AddInput("number","text",1)
                .AddVcodeButton("scan",
"
扫码输入",2) '扫描二维码的按钮怎么没有设置事件代码呢
            End With
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1",
"
确定", "submit")
        End With
       
e.WriteString(wb.Build) '生成网页
End
Select

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