Commit 8a2015b3 authored by 李俊赕's avatar 李俊赕

修改拍照页面

parent 42e0ed77
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<view class="camera-container"> <view class="camera-container">
<cover-view class="header-box" :style="{'height':navHeight + 'rpx'}"> <cover-view class="header-box" :style="{'height':navHeight + 'rpx'}">
<cover-view class="inner"> <cover-view class="inner">
<cover-image bindtap="changeScale" class="icon" mode="aspectFit" src="/static/photo/icon-switch.png"></cover-image> <cover-image @click="setCameraInfo('devicePosition')" 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 @click="setCameraInfo('flash')" 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-image @click="goPage('/pages/photo/markSetting')" class="icon" mode="aspectFit" src="/static/photo/icon-setting.png"></cover-image>
</cover-view> </cover-view>
</cover-view> </cover-view>
<camera class="camera-box" v-if="cameraChange" device-position="front" flash="on" :style="{'height':cameraHeight + 'rpx'}" <camera class="camera-box" v-if="cameraChange" :device-position="cameraInfo.devicePosition" :flash="cameraInfo.flash" :style="{'height':cameraHeight + 'rpx'}"
@error="cameraError"> @error="cameraError">
<cover-view class="mark-box"> <cover-view class="mark-box">
<cover-view class="txt u-m-l-20 u-m-t-30">经度:{{waterInfo.longitude || '正在获取中...'}}</cover-view> <cover-view class="txt u-m-l-20 u-m-t-30">经度:{{waterInfo.longitude || '正在获取中...'}}</cover-view>
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
</cover-view> </cover-view>
<cover-image class="mark-water" mode="aspectFit" :src="waterInfo.markImage"></cover-image> <cover-image class="mark-water" mode="aspectFit" :src="waterInfo.markImage"></cover-image>
</camera> </camera>
<cover-view class="bottom-box"> <cover-view class="bottom-box" v-show="!standardShow">
<cover-image class="icon" src='/static/photo/icon-back.png' mode="" @click="goBack"></cover-image> <cover-image class="icon" src='/static/photo/icon-back.png' mode="" @click="goBack"></cover-image>
<cover-image class='icon-take icon' src='/static/photo/icon-take.png' @click="takePhoto"> </cover-image> <cover-image class='icon-take icon' src='/static/photo/icon-take.png' @click="takePhoto"> </cover-image>
<cover-image class='icon' src='/static/photo/icon-standard.png' @click="standardShow = true"> </cover-image> <cover-image class='icon' src='/static/photo/icon-standard.png' @click="standardShow = true"> </cover-image>
</cover-view> </cover-view>
<canvas canvas-id="canvas" class="canvas" :style="{'width':750 + 'rpx','height': cameraHeight + 'rpx'}"></canvas> <canvas canvas-id="canvas" id="photoCanvas" class="canvas" :style="{'width':750 + 'rpx','height': cameraHeight + 'rpx'}"></canvas>
<cover-view class="page-mask" v-if="standardShow"> <cover-view class="page-mask" v-if="standardShow">
<photo-standard :currentItem="currentItem" /> <photo-standard :currentItem="currentItem" />
<cover-view class="btn-close" @click="standardShow = false"> <cover-view class="btn-close" @click="standardShow = false">
...@@ -51,6 +51,10 @@ ...@@ -51,6 +51,10 @@
images:['https://qn-static.banshouhui.com/live_mark.png','https://qn-static.banshouhui.com/live_mark.png','https://qn-static.banshouhui.com/live_mark.png'], images:['https://qn-static.banshouhui.com/live_mark.png','https://qn-static.banshouhui.com/live_mark.png','https://qn-static.banshouhui.com/live_mark.png'],
}, },
standardShow:false, standardShow:false,
cameraInfo:{
devicePosition:'front',
flash:'off'
},
waterInfo: { waterInfo: {
longitude: '', // 经度 longitude: '', // 经度
latitude: '', // 维度 latitude: '', // 维度
...@@ -115,6 +119,31 @@ ...@@ -115,6 +119,31 @@
url:'/pages/photo/brand' url:'/pages/photo/brand'
}) })
}, },
goPage(url){
url = url || '/pages/photo/index';
console.log(url,'url')
uni.navigateTo({
url:url
})
},
setCameraInfo(type){
// 设置相机前置后置、闪关灯等
const cameraInfo = this.cameraInfo
let val = cameraInfo[type]
switch(type){
case 'devicePosition':
val = val==='back' ? 'front' : 'back'
break;
case 'flash':
val = val==='auto' ? 'on' : 'auto'
break;
defalut:
break;
}
console.log(type,'type',val,'val')
this.cameraInfo[type] = val
},
initData() { initData() {
const globalData = getApp().globalData const globalData = getApp().globalData
this.navHeight = globalData.navHeight this.navHeight = globalData.navHeight
......
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