main^2
zouyanyan 5 hours ago
parent 42084bb341
commit ec90555905

@ -1,13 +1,25 @@
<template>
<view class="easy-scancode" v-if="show">
<view id="reader"></view>
<!-- 装饰区域 -->
<view class="scan-mask">
<view class="scan-box">
<view class="line"></view>
<view class="corner top-left"></view>
<view class="corner top-right"></view>
<view class="corner bottom-left"></view>
<view class="corner bottom-right"></view>
</view>
</view>
<!-- 扫码提示区域 -->
<view class="scan-tip-overlay">
<view class="scan-tip"> 请将二维码放入框内 </view>
</view>
<view class="scan-back">
<button class="action-btn" @tap="stop"></button>
</view>
<!-- 扫码提示区域 -->
<view class="scan-tip-overlay">
<view class="scan-tip"> 请将二维码放入框内 </view>
</view>
</view>
</template>
@ -22,7 +34,7 @@ export default {
fail: () => {},
},
show: false,
html5QrCode: null,
html5QrCode: null
};
},
methods: {
@ -94,16 +106,13 @@ export default {
// console.log(devices)
that.html5QrCode = new Html5Qrcode("reader");
let windowInfo = uni.getWindowInfo();
// console.log(windowInfo);
let windowInfo = uni.getWindowInfo();
const width = windowInfo&&windowInfo.windowWidth?windowInfo.windowWidth:375;
const height = windowInfo&&windowInfo.windowHeight?windowInfo.windowHeight:720;
const height = windowInfo&&windowInfo.windowHeight?windowInfo.windowHeight:720;
//
const aspectRatio = width / height;
//
const reverseAspectRatio = height / width;
const mobileAspectRatio =
reverseAspectRatio > 1.5
? reverseAspectRatio + (reverseAspectRatio * 12) / 100
@ -116,10 +125,15 @@ export default {
} else {
cameraId = devices[0].id;
}
// - 使/
//
// - 使/
//
const qrboxSize = Math.min(width, height) * 0.7;
console.log(qrboxSize);
console.log(aspectRatio);
console.log(width,mobileAspectRatio);
that.$forceUpdate();
// 使
that.html5QrCode
.start(
@ -127,18 +141,32 @@ export default {
facingMode: "environment",
},
{
fps: 10, //
aspectRatio: aspectRatio,
qrbox: { width: qrboxSize, height: qrboxSize }, // UI
videoConstraints: {
facingMode: "environment",
aspectRatio: width < 600 ? mobileAspectRatio : aspectRatio,
},
autofocus:true, // 使
colorDark: '#0000ff', //
colorLight: '#ffffff',//
visualFeedback:true, //
halfSample:true,//
fps: 10, //
aspectRatio: aspectRatio,
qrbox: { width: qrboxSize, height: qrboxSize }, // UI
videoConstraints: {
facingMode: "environment",
aspectRatio: width < 600 ? mobileAspectRatio : aspectRatio,
},
// fps: 15, //
// aspectRatio: 1.0, // 1:1
// qrbox: {
// width: 280,
// height: 280
// }, //
// videoConstraints: {
// focusMode: "continuous", //
// width: { ideal: 1280 }, //
// height: { ideal: 720 },
// frameRate: { ideal: 30 }
// },
// disableFlip: false, //
// rememberLastUsedCamera: true, // 使
// showTorchButtonIfSupported: true,
// showZoomSliderIfSupported: true,
// defaultZoomValueIfSupported: 2,
// //
},
(decodedText, decodedResult) => {
//
@ -180,15 +208,14 @@ export default {
z-index: 1000;
top: 0;
left: 0;
background-color: rgba(0, 0, 0, 0.5);
background-color: rgba(0, 0, 0, 0.4);
}
#reader {
top: 50%;
left: 0;
transform: translateY(-50%);
width: 100vw;
height: 100vh;
position: relative;
}
.scan-tip-overlay {
@ -227,4 +254,80 @@ export default {
padding: 10px;
border-radius: 5px;
}
/* 装饰层 */
.scan-mask {
position: absolute;
inset: 0;
background: rgba(0, 0, 0, 0.3);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.scan-box {
position: relative;
width: 480rpx;
height: 480rpx;
box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.4);
/* 形成中间镂空感 */
background: transparent;
}
.corner {
position: absolute;
width: 30rpx;
height: 30rpx;
border: 6rpx solid #ffffff;
}
.top-left {
top: 0;
left: 0;
border-right: none;
border-bottom: none;
}
.top-right {
top: 0;
right: 0;
border-left: none;
border-bottom: none;
}
.bottom-left {
bottom: 0;
left: 0;
border-right: none;
border-top: none;
}
.bottom-right {
bottom: 0;
right: 0;
border-left: none;
border-top: none;
}
.line {
position: absolute;
width: 100%;
height: 2px;
background: linear-gradient(to right, transparent, #ffffff, transparent);
animation: scanMove 2s infinite linear;
}
@keyframes scanMove {
0% {
top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rLon+CU9sScsdIMoeG03n+uYnJpRGIch/
ws068Y+Yj62LpypWTt6MMkjy0ctgs7DjzJw+j3fUNj3REqqFTJZrZlvTa7YQ+/Go
ccYkA7mOfQKBgAin+Qqge5cA4VppkTX9sQYnbnm5sOq/W5MurBfKyjAcl8KH0H4O
SPwwmZ5kQAJhCz62T4CaNJLGn3HDEy4fA8MRs1iGduappSUZXa49279jh8EyIB3J
eSOnKePksEYk5Ti9yc3HmqRakjk3hvriniOETcepFTSkeLmFhrmexGqnAoGADsas
Gh6SBG/YYW/50qfo1zLGwNyFnNoUN3EHVyOwHFKDz1WlKwKJY1ixZjhvzu2wCg0M
wdxoVsggAWVlgHtESBqHy5b+OV8RIWUdmaP/nugRSSOz4R9tX0QmXV6pDwF2tEJ0
wxGh1A6PtCdk9lBAWc4pi8prnJcXt7Fi6gqgczECgYEAgCE/87+aUsb374IU3Ta3
fKVkMSRO2JgONdskBwm72fdQBcnJMjcJQlbE3rClxznDoWVSLkL0w9Xc5gdYEPX+
EmJrWUXq66arEA35J00Gu1lQPlNmPWb2Gq+WneHkRsSTJElpi6gSqQWRYEQTbIYt
SQuJZof0xt8gUYLPF8jJRTY=
-----END PRIVATE KEY-----

@ -203,24 +203,11 @@
"landscape-primary",
"landscape-secondary"
],
"h5" : {},
// "title" : "工装托盘管理",
// "template" : "template.h5.html",
// // h5
// "devServer" : {
// "port" : 8080,
// "disableHostCheck" : true, // Host
// "proxy" : {
// "/api" : {
// "target" :"http://pallet.dsic.cn", // "http://tpapp.runpengsoft.com",
// "changeOrigin" : true,
// "secure" : false,
// "pathRewrite" : {
// "^/api" : ""
// }
// }
// }
// }
"h5" : {
// "devServer" : {
// "https" : true
// }
},
// "h5" : {
// "title" : "工装托盘管理",
// "template" : "template.h5.html",

@ -1043,7 +1043,7 @@ export default {
// requireAddress
this.itemList.requireAddress=firstpallet?firstpallet.requireAddress:'';
// requireName+ +requirePhone
this.itemList.requireName=firstpallet?firstpallet.requireName:''+' '+firstpallet?firstpallet.requirePhone:'';
this.itemList.requireName=firstpallet&&firstpallet.requireName?firstpallet.requireName:''+' '+firstpallet&&firstpallet.requirePhone?firstpallet.requirePhone:'';
// deliveryDate
this.itemList.deliveryDate=firstpallet?firstpallet.deliveryDate:'';
// deliveryCar

Loading…
Cancel
Save