This commit is contained in:
cansnow
2026-01-01 04:15:30 +08:00
parent 09c7889525
commit 78386d4cc1
75 changed files with 1995 additions and 1715 deletions
+17 -31
View File
@@ -1,24 +1,9 @@
<template>
<view class="scan_page" :style="{height:windowHeight+'px'}">
<uni-nav-bar
left-icon="back"
@clickLeft="back"
fixed
backgroundColor="#FFF"
statusBar
>
<uni-nav-bar left-icon="back" @clickLeft="back" fixed backgroundColor="#FFF" statusBar>
</uni-nav-bar>
<barcode id='1'
class="barcode"
ref="barcode"
:autostart="true"
background="rgb(0,0,0)"
frameColor="#07c160"
scanbarColor="#07c160"
:style="{height:windowHeight+'px'}"
:filters="fil"
@marked="success"
@error="fail">
<barcode id='1' class="barcode" ref="barcode" :autostart="true" background="rgb(0,0,0)" frameColor="#07c160"
scanbarColor="#07c160" :style="{height:windowHeight+'px'}" :filters="fil" @marked="success" @error="fail">
</barcode>
<view class="overlay">
<button class="btn" @click="toStart">开始扫码识别</button>
@@ -33,8 +18,8 @@
export default {
data() {
return {
fil: [0, 2, 1,3,4,12],
windowHeight:500,
fil: [0, 2, 1, 3, 4, 12],
windowHeight: 500,
}
},
@@ -52,10 +37,10 @@
},
methods: {
success(e) {
console.log("success1:" + JSON.stringify(e));
//console.log("success1:" + JSO1N.stringify(e));
},
fail(e) {
console.log("fail1:" + JSON.stringify(e));
//console.log("fail1:" + JSON1.stringify(e));
},
toStart: function() {
this.$refs.barcode.start({
@@ -63,7 +48,7 @@
filename: '_doc/barcode/'
});
},
tocancel:function(){
tocancel: function() {
this.$refs.barcode.cancel();
},
toFlash: function() {
@@ -73,12 +58,11 @@
toscan: function() {
console.log("scan:");
const barcodeModule = uni.requireNativePlugin('barcodeScan');
barcodeModule.scan("/static/barcode1.png"
,(e)=>{
console.log("scan_error:"+JSON.stringify(e));
barcodeModule.scan("/static/barcode1.png", (e) => {
console.log("scan_error:", e);
});
},
back(){
back() {
uni.navigateBack();
}
}
@@ -86,14 +70,15 @@
</script>
<style lang="scss" scoped>
.scan_page{
.scan_page {
width: 750rpx;
position: relative;
.barcode {
width: 750rpx;
background-color: #808080;
}
.btn {
top: 20rpx;
width: 730rpx;
@@ -102,7 +87,8 @@
background-color: #458B00;
border-radius: 10rpx;
}
.overlay{
.overlay {
background: rgba(0, 0, 0, 0.1);
position: absolute;
bottom: 100rpx;
@@ -111,4 +97,4 @@
height: 200rpx;
}
}
</style>
</style>