Foxtable(狐表)用户栏目专家坐堂 → 一个网页,多个微信扫码输入要怎么实现


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

主题:一个网页,多个微信扫码输入要怎么实现

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


加好友 发短信
等级:超级版主 帖子:107147 积分:544978 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/4/26 20:59:00 [显示全部帖子]

绑定多个按钮即可

wx.ready(function () {
    document.getElementById('
scan1').onclick = function () {
        wx.scanQRCode({
            needResult: 1,
            scanType: ['qrCode','barCode'],
            success: function (res) {
                document.getElementById('
number1
').value = res.resultStr;
            }
        });
    };
});

wx.ready(function () {
    document.getElementById('
scan2').onclick = function () {
        wx.scanQRCode({
            needResult: 1,
            scanType: ['qrCode','barCode'],
            success: function (res) {
                document.getElementById('
number2
').value = res.resultStr;
            }
        });
    };
});

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


加好友 发短信
等级:超级版主 帖子:107147 积分:544978 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/4/26 21:41:00 [显示全部帖子]

wx.ready(function () {
    document.getElementById('scan').onclick = function () {
        wx.scanQRCode({
            needResult: 1,
            scanType: ['qrCode','barCode'],
            success: function (res) {
                document.getElementById('number').value = res.resultStr;findtype();findCodes()
            }

        });
    };
    document.getElementById('scanw').onclick = function () {
        wx.scanQRCode({
            needResult: 1,
            scanType: ['qrCode','barCode'],
            success: function (res) {
                document.getElementById('outnumber').value = res.resultStr;findouttype();find10Codes()
            }

        });
    };
    document.getElementById('scann').onclick = function () {
        wx.scanQRCode({
            needResult: 1,
            scanType: ['qrCode','barCode'],
            success: function (res) {
                document.getElementById('innernumber').value = res.resultStr;findinnertype();find11Codes()
            }

        });
    };
});
wx.error(function (res) {
    //alert(res.errMsg);
});

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


加好友 发短信
等级:超级版主 帖子:107147 积分:544978 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/4/26 22:27:00 [显示全部帖子]

js文件发过来看看

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


加好友 发短信
等级:超级版主 帖子:107147 积分:544978 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/4/27 9:02:00 [显示全部帖子]

安装微信开发者工具打开页面测试看提示什么错误

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


加好友 发短信
等级:超级版主 帖子:107147 积分:544978 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/4/27 13:37:00 [显示全部帖子]

access_token 过期了,重新获取一下

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


加好友 发短信
等级:超级版主 帖子:107147 积分:544978 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2023/4/27 20:57:00 [显示全部帖子]

点击scann,看微信开发者工具提示什么信息

 回到顶部