Foxtable(狐表)用户栏目专家坐堂 → [求助]网页扫码输入如何触发JS函数


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

主题:[求助]网页扫码输入如何触发JS函数

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


加好友 发短信
等级:超级版主 帖子:106209 积分:540168 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2019/2/22 12:06:00 [显示全部帖子]

调用微信接口扫码后调用其他js

wx.ready(function () {
    document.getElementById('
scan').onclick = function () {
        wx.scanQRCode({
            needResult: 1,
            scanType: ['qrCode','barCode'],
            success: function (res) {
                document.getElementById('
number
').value = res.resultStr;
//这里写其他js,或者调用其他js函数
            }
        });
    };
});
wx.error(function (res) {
    //alert(res.errMsg);
});




 回到顶部