Commit eec44dbe authored by 李俊赕's avatar 李俊赕

edit-take-photo

parent 1092ea9e
......@@ -132,6 +132,7 @@
{
"path": "pages/photo/take",
"style": {
"navigationStyle":"custom",
"navigationBarTitleText": "拍照",
"navigationBarBackgroundColor": "#333333",
"navigationBarTextStyle": "#FFFFFF",
......
<template>
<view class="blackBackColor">
<view class="camera-container">
<cover-view class="header-box">
<cover-image bindtap="changeScale" class="icon" mode="aspectFit" src="/static/photo/icon-switch.png"></cover-image>
<cover-image bindtap="changeScale" class="icon" mode="aspectFit" src="/static/photo/icon-light.png"></cover-image>
<cover-image bindtap="changeScale" class="icon" mode="aspectFit" src="/static/photo/icon-setting.png"></cover-image>
</cover-view>
<camera device-position="front" flash="on" style='width:100%; height:100vh; overflow: hidden;' @error="cameraRefuse">
<cover-view class="locationView">
<cover-view class="mark-box">
<cover-view class="locationText u-m-l-20 u-m-t-30">经度:{{longitude}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-10">维度:{{latitude}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-10">地址:{{address}}</cover-view>
<cover-view class="locationText u-m-l-20 u-m-t-10">时间:{{date}}</cover-view>
</cover-view>
<cover-image class="liveWatermarkNormal" mode="aspectFit" :src="liveWaterMarkImage"></cover-image>
<cover-image class="mark-water liveWatermarkNormal" mode="aspectFit" :src="liveWaterMarkImage"></cover-image>
</camera>
<cover-view class="bottomView">
<cover-image class="backIcon" :src="icon_arrow_down" mode="" @click="simpleBack"></cover-image>
<cover-view class="bottom-box">
<cover-image class="icon" :src="icon_arrow_down" mode="" @click="simpleBack"></cover-image>
<!--cover-image class='switchIcon' :src='icon_switch_white' @click="switchClick()"> </cover-image-->
<cover-image class='takeIcon' :src='icon_take' @click="takePhoto()"> </cover-image>
<cover-image class='icon-take icon' src='/static/photo/icon-take.png' @click="takePhoto()"> </cover-image>
<cover-view class="txt">拍照要求</cover-view>
<!--cover-image class='flashIcon' :src='icon_light_on_white' @click="flashClick()"> </cover-image-->
</cover-view>
<!--button @click="openSetting">打开设置页</button-->
......@@ -344,9 +349,7 @@
//第一步: 拍照
takePhoto() {
this.getLocation()
return
let that = this
console.log((new Date).getTime(),'开始渲染')
this.ctx.takePhoto({
quality: 'high',
success: (res) => {
......@@ -419,8 +422,10 @@
},
canvasImage() {
let self = this
this.canvas.draw(false, setTimeout(() => {
this.canvas.draw(false,
setTimeout(() => {
console.log((new Date).getTime(),'结束渲染')
uni.canvasToTempFilePath({
// x: 0,
// y: 0,
......@@ -428,6 +433,7 @@
height: Number(this.canvasHeight),
canvasId: 'canvas',
success: (res) => {
self.saveToLocal(res.tempFilePath)
const FileSystemManager = wx.getFileSystemManager()
FileSystemManager.saveFile({
......@@ -449,8 +455,7 @@
uni.hideLoading();
}
}, this);
}, 500);
}));
}, 500));
},
showPreviewFn(img) {
uni.previewImage({
......@@ -622,74 +627,21 @@
}
</script>
<style>
.blackBackColor {
background-color: #000000;
overflow: hidden;
<style scoped lang="scss">
.camera-container{
padding-top:var(--status-bar-height);
background-color: black;
}
.bottomView {
background-color: #333333;
z-index: 5;
width: 100%;
height: 200rpx;
position: absolute;
bottom: 0;
.header-box{
padding:10rpx 20rpx;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.switchIcon {
background-color: #000000;
width: 50rpx;
height: 50rpx;
}
.takeIcon {
background-color: #333333;
width: 150rpx;
height: 150rpx;
}
.flashIcon {
background-color: #000000;
width: 50rpx;
height: 50rpx;
margin-left: 100rpx;
}
.locationView {
/* z-index: 5;
width: 300rpx;
position: absolute;
left: 0;
bottom: 200rpx;
display: flex;
flex-direction: column;
padding-bottom: 20rpx;
padding-right: 20rpx; */
bottom: 200rpx;
padding-bottom: 20rpx;
padding-right: 20rpx;
z-index: 4;
position: absolute;
font-size: 14px;
line-height: 18px;
color: #fff;
}
.locationText {
/* font-size: 24rpx;
color: #999999;
width: 260rpx; */
margin: 2px 0;
.icon{
display: block;
width:50rpx;
height:50rpx;
}
}
.liveWatermarkNormal {
z-index: 3;
.mark-water{
position: absolute;
left: 50%;
top: 50%;
......@@ -698,17 +650,124 @@
height: 90rpx;
z-index: 6;
}
.backIcon {
background-color: #FFFFFF;
width: 54rpx;
height: 54rpx;
border-radius: 27rpx;
position: fixed;
left: 60rpx;
bottom: 50rpx;
border: 2rpx solid #aaa;
.mark-box{
position: absolute;
left:0;
bottom:240rpx;
padding:20rpx;
}
.bottom-box{
position: absolute;
left:0;right:0;
bottom: 0;
z-index: 5;
height: 160rpx;
display: flex;
justify-content: space-between;
padding:20rpx;
align-items: center;
background-color: black;
.txt{
line-height:60rpx;
color:#fff;
}
.icon{
display: block;
width:60rpx;
height:60rpx;
&.icon-take{
width:150rpx;
height:150rpx;
}
}
}
// .blackBackColor {
// background-color: #000000;
// overflow: hidden;
// }
// .bottomView {
// background-color: #333333;
// z-index: 5;
// width: 100%;
// height: 200rpx;
// position: absolute;
// bottom: 0;
// display: flex;
// flex-direction: row;
// align-items: center;
// justify-content: center;
// }
// .switchIcon {
// background-color: #000000;
// width: 50rpx;
// height: 50rpx;
// }
// .takeIcon {
// background-color: #333333;
// width: 150rpx;
// height: 150rpx;
// }
// .flashIcon {
// background-color: #000000;
// width: 50rpx;
// height: 50rpx;
// margin-left: 100rpx;
// }
// .locationView {
// /* z-index: 5;
// width: 300rpx;
// position: absolute;
// left: 0;
// bottom: 200rpx;
// display: flex;
// flex-direction: column;
// padding-bottom: 20rpx;
// padding-right: 20rpx; */
// bottom: 200rpx;
// padding-bottom: 20rpx;
// padding-right: 20rpx;
// z-index: 4;
// position: absolute;
// font-size: 14px;
// line-height: 18px;
// color: #fff;
// }
// .locationText {
// /* font-size: 24rpx;
// color: #999999;
// width: 260rpx; */
// margin: 2px 0;
// }
// .liveWatermarkNormal {
// z-index: 3;
// position: absolute;
// left: 50%;
// top: 50%;
// transform: translate(-50%, -50%);
// width: 360rpx;
// height: 90rpx;
// z-index: 6;
// }
// // .backIcon {
// // background-color: #FFFFFF;
// // width: 54rpx;
// // height: 54rpx;
// // border-radius: 27rpx;
// // position: fixed;
// // left: 60rpx;
// // bottom: 50rpx;
// // border: 2rpx solid #aaa;
// // }
.showCanvas {
background-color: #007AFF;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment