1***@qq.com
1***@qq.com
  • 发布:2020-08-10 14:38
  • 更新:2021-04-02 16:54
  • 阅读:4538

uniapp里的scanCode扫一扫功能为啥总是扫码失败

分类:uni-app

<view class="uni-btn">
<button type="primary" @tap="scarn">扫一扫</button>
</view>

scarn:function(){
var that = this;
var show;
uni.scanCode({
success: (res) => {
console.log('kkk')
that.show = res.result;
uni.showModal({
title: '提示',
content: '您当前所选用户:' + that.data.cityname,
success(res) {
if (res.confirm) {
// 向后台发送请求
uni.request({
url: 'https://www.globalbigdata.cn/zhp/app/devInput',
method: 'GET',
data: {
deviceCode: that.show,
ownedId: that.data.idArr[that.data.index]
},
success: function (res) {
uni.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
})
}
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
fail: (res) => {
console.log(res)
uni.showToast({
title: '扫码失败',
icon: 'success',
duration: 2000
})
},
complete: (res) => { }
})
}

扫码的结果总是失败:
errMsg: "scanCode:fail 系统错误,错误码:1, [20200810 14:20:52][touristappid]"

2020-08-10 14:38 负责人:无 分享
已邀请:
小橙子的围脖

小橙子的围脖

我也是这样的,请问解决了嘛?

3***@qq.com

3***@qq.com

同样 一直失败请问解决了吗

DCloud_uniAD_HDX

DCloud_uniAD_HDX

运行到哪个平台?
请使用bug反馈模板提供更多信息

  • m***@163.com

    你好,遇到同样的问题,运行到微信小程序,用HBuiler X3.1.11,微信开发者工具版本是Stable 1.05.2103200

    2021-05-06 15:07

z***@qq.com

z***@qq.com

我也是这样..一直走失败..

1***@qq.com

1***@qq.com

我的是在manifest.json文件 - 微信小程序 - 添加上了一个appID就可以了

  • m***@163.com

    你好,尝试了添加appID,但依然报错

    2021-05-06 15:06

  • 4***@qq.com

    真的可以!太赞啦!

    2021-07-20 09:55

该问题目前已经被锁定, 无法添加新回复