Commit e6bd5a5f by 张立顺

功能开发

1 parent bba6ba27
......@@ -62,7 +62,8 @@
"pages/carQuotation/CarQuotationDetail/CarQuotationDetail",
"pages/carQuotation/CarQuotationPay/CarQuotationPay",
"pages/carQuotation/createOrderCarQuotation/createOrderCarQuotation",
"pages/carQuotation/createOrderUserInfo/createOrderUserInfo"
"pages/carQuotation/createOrderUserInfo/createOrderUserInfo",
"pages/ocrEquityModules/ocrEquityModules"
]
},
{
......
{
"component": true,
"usingComponents": {},
"navigationBarTitleText": "识别"
}
\ No newline at end of file
<!-- components/OcrPhoto.wxml -->
<!-- <text>components/OcrPhoto.wxml</text> -->
<view class="cameraContainer">
<camera device-position="back" flash="auto" style="width: 100%; height:100vh;">
<cover-view class="camerabgImage-view">
<cover-view class='cameratop-tips'>{{tips[typeClass]}}</cover-view>
<!-- <cover-view class='cameratop-view2'>
<cover-view class='cameratop-view2-detail'>{{currentTime}}</cover-view>
<cover-view class='cameratop-view2-detail'>
经度:{{gps.longitude}} 纬度:{{gps.latitude}}
</cover-view>
<cover-view class='cameratop-view2-detail'>{{district}}附近</cover-view>
</cover-view> -->
<cover-view class="camera-background">
<cover-image src='{{bgSrc}}' />
</cover-view>
<cover-view class="upload-view" bindtap="choseImg">
<cover-image src="{{picUploadSrc}}" class="uploag-icon" />
<cover-view class="upload-label">相册选择</cover-view>
</cover-view>
<cover-view class="camerabotton-view">
<cover-image src='{{cameraBtnSrc}}' class='takephoto' bindtap='takePhoto' />
</cover-view>
</cover-view>
<!-- 上部线条 -->
<!-- 下部线条 -->
<!-- 右部线条 -->
<!-- 左部线条 -->
<!-- <cover-view class='biaochi' style='top:{{gap}}px; left:30px; width:{{width-30*2}}px; height:2px;' />
<cover-view class='biaochi' style='top:{{gap+460}}px; left:30px; width:{{width-30*2}}px; height:2px;' />
<cover-view class='biaochi' style='top:{{gap}}px; right:30px; width:2px; height:460px;' />
<cover-view class='biaochi' style='top:{{gap}}px; left:30px; width:2px; height:460px;' /> -->
</camera>
</view>
<!-- <view style="opacity: 0;"> -->
<!-- wx:if='{{isShowImage}}' -->
<!-- style='width:{{windowWidth}}px; height:{{windowHeight}}px;' -->
<!-- position:fixed;left: 10000rpx -->
<canvas
style='width:{{windowWidth}}px; height:{{windowHeight}}px;'
canvas-id="image-canvas"
id="image-canvas"
type="2d" />
<!-- </view> -->
/* components/OcrPhoto.wxss */
.cameraContainer{
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 10;
background-color: #fff;
}
.camerabgImage-view{
height: 100%;
width: 100%;
position:absolute;
/* background-position: center 0px;
background-size: cover; */
/* background-color: greenyellow; */
/* background: url('./image/backGroundImage.png') no-repeat 100% 100%; */
}
.cameratop-tips{
position: absolute;
text-align: center;
width: 100%;
color: #FFFFFF;
top: 35%;
z-index: 12;
}
.camera-background{
position: absolute;
width: 100%;
height: 100%;
/* z-index: ; */
}
/* .cameratop-view2-detail{
height: 44rpx;
margin:25rpx 55rpx;
width: 100%;
color: #FFFFFF;
} */
.camerabotton-view{
height: 144rpx;
width:144rpx;
bottom: 15%;
left: 50%;
transform: translateX(-50%);
position:absolute;
display: flex;
justify-content: space-around;
align-items: center;
z-index: 11;
}
.takephoto{
width: 144rpx;
height: 144rpx;
border-radius: 999px;
/* box-shadow: 0 0 50rpx gray; */
}
.upload-view {
height: 144rpx;
width: 144rpx;
bottom: 15%;
left: 10%;
position:absolute;
display: flex;
flex-direction: column;
/* justify-content: space-around; */
align-items: center;
justify-content: center;
z-index: 11;
}
.upload-label{
color: #fff;
font-size: 28rpx;
line-height: 40rpx;
margin-top: 15rpx;
}
.uploag-icon{
width: 38rpx;
height: 32rpx;
}
/* .biaochi{
position: absolute;
border: 1px dotted red;
} */
......@@ -18,7 +18,6 @@ Page({
canvas: '',
ctx: '',
iPath: '',
cameraBtnSrc: './image/cameraBtn.png',
picUploadSrc: './image/picPick.png',
bgSrc: './image/backGroundImage.png',
......@@ -57,19 +56,22 @@ Page({
initImg(imgUrl) {
let { canvas, ctx, windowWidth, windowHeight, iPath } = this.data
canvas.width = windowWidth
canvas.height = windowHeight
console.log(windowWidth, windowHeight)
canvas.width = +windowWidth
canvas.height = +windowHeight
let img = canvas.createImage()
img.src = iPath
img.onload = () => {
let c_x = windowWidth * (60 / 750)
let c_y = windowHeight * (160 / 1200)
let c_w = windowWidth * (680 / 750)
let c_h = windowHeight * (260 / 1200)
// wx.$util.showToast(img.width, imgheight)
let c_x = windowWidth
let c_y = windowHeight
let c_w = windowWidth
let c_h = windowHeight
// let c_x = windowWidth * (60 / 750)
// let c_y = windowHeight * (160 / 1200)
// let c_w = windowWidth * (680 / 750)
// let c_h = windowHeight * (260 / 1200)
//截取图片指定部分并绘制到canvas
ctx.drawImage(img, 0, 0, windowWidth, windowHeight)
......
......@@ -3,16 +3,11 @@
<view class="cameraContainer">
<camera device-position="back" flash="auto" style="width: 100%; height:100vh;">
<cover-view class="camerabgImage-view">
<cover-view class='cameratop-tips'>{{tips[typeClass]}}</cover-view>
<!-- <cover-view class='cameratop-view2'>
<cover-view class='cameratop-view2-detail'>{{currentTime}}</cover-view>
<cover-view class='cameratop-view2-detail'>
经度:{{gps.longitude}} 纬度:{{gps.latitude}}
</cover-view>
<cover-view class='cameratop-view2-detail'>{{district}}附近</cover-view>
</cover-view> -->
<!-- <cover-view class='cameratop-tips'>{{tips[typeClass]}}</cover-view> -->
<cover-view class='cameratop-tips'>请拍摄清晰图片,以便更好识别</cover-view>
<cover-view class="camera-background">
<cover-image src='{{bgSrc}}' />
<!-- <cover-image src='{{bgSrc}}' /> -->
<cover-view class="bg" />
</cover-view>
<cover-view class="upload-view" bindtap="choseImg">
<cover-image src="{{picUploadSrc}}" class="uploag-icon" />
......
/* components/OcrPhoto.wxss */
.cameraContainer{
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 10;
background-color: #fff;
.cameraContainer {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 10;
background-color: #fff;
}
.camerabgImage-view{
.camerabgImage-view {
height: 100%;
width: 100%;
position:absolute;
/* background-position: center 0px;
position: absolute;
/* background-position: center 0px;
background-size: cover; */
/* background-color: greenyellow; */
/* background: url('./image/backGroundImage.png') no-repeat 100% 100%; */
}
.cameratop-tips{
position: absolute;
text-align: center;
width: 100%;
color: #FFFFFF;
top: 35%;
z-index: 12;
}
.camera-background{
position: absolute;
width: 100%;
height: 100%;
/* z-index: ; */
}
/* .cameratop-view2-detail{
height: 44rpx;
margin:25rpx 55rpx;
}
.bg {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 324rpx;
opacity: 0.5;
background: #000000;
border-radius: 24rpx 24rpx 0 0;
}
.cameratop-tips {
position: absolute;
text-align: center;
width: 100%;
color: #FFFFFF;
} */
.camerabotton-view{
bottom: 25%;
z-index: 12;
font-size: 28rpx;
}
.camera-background {
position: absolute;
width: 100%;
height: 100%;
/* z-index: ; */
}
.camerabotton-view {
height: 144rpx;
width:144rpx;
bottom: 15%;
width: 144rpx;
bottom: 10%;
left: 50%;
transform: translateX(-50%);
position:absolute;
position: absolute;
display: flex;
justify-content: space-around;
align-items: center;
z-index: 11;
}
.takephoto{
}
.takephoto {
width: 144rpx;
height: 144rpx;
border-radius: 999px;
border-radius: 999px;
/* box-shadow: 0 0 50rpx gray; */
}
.upload-view {
.upload-view {
height: 144rpx;
width: 144rpx;
bottom: 15%;
bottom: 10%;
left: 10%;
position:absolute;
position: absolute;
display: flex;
flex-direction: column;
/* justify-content: space-around; */
align-items: center;
justify-content: center;
z-index: 11;
}
.upload-label{
justify-content: center;
z-index: 11;
}
.upload-label {
color: #fff;
font-size: 28rpx;
line-height: 40rpx;
margin-top: 15rpx;
}
.uploag-icon{
width: 38rpx;
height: 32rpx;
}
.uploag-icon {
width: 38rpx;
height: 32rpx;
}
}
/* .biaochi{
position: absolute;
border: 1px dotted red;
} */
} */
\ No newline at end of file
......@@ -143,6 +143,13 @@
"query": "",
"launchMode": "default",
"scene": null
},
{
"name": "2.0权益ocr",
"pathName": "packageEquity/pages/ocrEquityModules/ocrEquityModules",
"query": "",
"launchMode": "default",
"scene": null
}
]
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!