1.最重要的就是一個(gè)函數(shù)uni.scanCode()
下邊是我的代碼可以直接使用文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-844867.html
<view @click="scanCode">
<img src="../../../static/images/icon/scan.png" alt="" style="width: 20px; height: 20px" />
</view>
scanCode() {
uni.scanCode({
success: (res) => {
this.result = res.result
console.log(this.result, "0000000");
this.merInfo.terminalSn = this.result
console.log(this.result, "0000000");
},
fail: (res) => {
uni.showToast({
title: '掃描失敗',
icon: 'none'
})
console.log(res);
}
})
},
上述代碼就直接實(shí)現(xiàn)了掃描功能很簡(jiǎn)單記得定義下掃描結(jié)果!有啥問(wèn)題隨時(shí)@我文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-844867.html
到了這里,關(guān)于uniapp寫(xiě)微信小程序?qū)崿F(xiàn)二維碼條形碼掃描識(shí)別的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!