Compare commits

...

3 Commits

Author SHA1 Message Date
hongchao 1215eb19b4 Merge branch 'master' into dev-hc 2025-01-17 15:35:34 +08:00
hongchao 536c5c27de Merge branch 'master' into dev-hc 2024-12-23 14:58:44 +08:00
jjLv c8f62074a3 二维码 2024-11-29 12:13:36 +08:00
3 changed files with 95 additions and 4 deletions

View File

@ -36,15 +36,14 @@
</div> </div>
<div class="card" style="margin-top: 10px;"> <div class="card" style="margin-top: 20px;">
<!-- <div>扫码识别</div> <div>扫码识别</div>
<div style="width: 94%;height: 120px;margin: 10px;border: 1px solid #ccc;"> <div style="width: 94%;height: 120px;margin: 10px;border: 1px solid #ccc;">
</div> --> </div> -->
<uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;"> <uni-row :gutter="24" style="display: flex; align-items: center;margin-bottom: 10px;">
<uni-col :span="6">设备编码</uni-col>
<uni-col :span="12"> <uni-col :span="12">
<uni-easyinput placeholder="请输入内容" v-model="maCode"/> <uni-easyinput placeholder="请输入内容" v-model="maCode"/>
</uni-col> </uni-col>
@ -238,6 +237,67 @@ const uploadImg = () => {
}) })
} }
const toBase64 = (path) => {
return new Promise((resolve, reject) => {
// #ifdef APP-PLUS
plus.io.resolveLocalFileSystemURL(path, (entry) => {
entry.file((file) => {
let fileReader = new plus.io.FileReader()
fileReader.readAsDataURL(file)
fileReader.onloadend = (evt) => {
let base64 = evt.target.result.split(",")[1]
resolve(base64)
}
})
})
})
}
//
const onCodeIdentify1 = () => {
console.log('编码识别--')
//
uni.chooseImage({
count: 1, //
sourceType: ['camera'], //
success: (res) => {
const tempFilePath = res.tempFilePaths[0];
toBase64(tempFilePath)
},
fail: (err) => {
console.error("选择图片失败", err);
}
});
};
// OCR API
const recognizeCode =((imagePath)=>{
// Base64
toBase64(imagePath).then(res=>{
callBaiduOcrApi(res);
}
)
})
const onCodeIdentify2 = () => {
console.log('二维码识别--')
//
uni.scanCode({
onlyFromCamera: true,
scanType: ['qrCode', 'pdf417'],
success: function (res) {
console.log('条码类型:' + res.scanType)
console.log('条码内容:' + res)
maCode.value = res.result;
getMaInfo();
},
})
}
onLoad((options)=>{ onLoad((options)=>{
console.log(options) console.log(options)
taskInfo.value = JSON.parse(options.taskInfo) taskInfo.value = JSON.parse(options.taskInfo)

View File

@ -42,6 +42,9 @@
<uni-col :span="6"> <uni-col :span="6">
<view class="coding-btn" @tap="boxScan">标准箱出库</view> <view class="coding-btn" @tap="boxScan">标准箱出库</view>
</uni-col> </uni-col>
<uni-col :span="6">
<view class="coding-btn" @tap="boxScan">标准箱识别</view>
</uni-col>
</uni-row> </uni-row>
</view> </view>
@ -276,7 +279,7 @@ const getCodeDeviceListData = async () => {
} }
// //
const onCodeIdentify = () => { const onCodeIdentify1 = () => {
console.log('编码识别--') console.log('编码识别--')
// uni.navigateTo({ // uni.navigateTo({
// url: `/pages/picking/outbound/code-outScan?queryParams=${JSON.stringify( // url: `/pages/picking/outbound/code-outScan?queryParams=${JSON.stringify(

View File

@ -153,6 +153,34 @@ const boxList = ref([
}, },
]) ])
// 退
const backList = ref([
{
title: '退料',
url: '/pages/back/index',
iconSrc: '../../static/workbench/fix.png',
},
])
//
const boxList = ref([
{
title: '标准箱管理',
url: '/pages/standardBox/index',
iconSrc: '../../static/workbench/fetchMaterialOutStore.png',
},
{
title: '标准箱移交',
url: '/pages/standardBox/transferBox',
iconSrc: '../../static/workbench/fetchMaterialOutStore.png',
},
{
title: '标准箱接收',
url: '/pages/standardBox/acceptBox',
iconSrc: '../../static/workbench/fetchMaterialOutStore.png',
},
])
const onNavigateTo = (url) => { const onNavigateTo = (url) => {
uni.navigateTo({ url }) uni.navigateTo({ url })
} }