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

按钮防抖处理

parent 5dfaa271
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<image class="pic" :src="files[0]" mode="aspectFit" @click="showPreviewFn"></image> <image class="pic" :src="files[0]" mode="aspectFit" @click="showPreviewFn"></image>
</view> </view>
<view class="bottomView"> <view class="bottomView">
<image class="btn" :src="btn_remake" @click="remakePhoto"></image> <image class="btn" :src="btn_remake" @click="$u.debounce(remakePhoto, 500)"></image>
<image class="btn" :src="btn_continue" @click="continuePhoto"></image> <image class="btn" :src="btn_continue" @click="$u.debounce(continuePhoto, 500)"></image>
</view> </view>
<image class="btn finish" src="/static/photo/finish.png" @click="finishPhoto"></image> <image class="btn finish" src="/static/photo/finish.png" @click="$u.debounce(finishPhoto, 500)"></image>
</view> </view>
</template> </template>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</camera> </camera>
<cover-view class="bottom-box" v-if="!standardShow"> <cover-view class="bottom-box" v-if="!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="$u.debounce(takePhoto, 500)"> </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" id="photoCanvas" class="canvas" <canvas canvas-id="canvas" id="photoCanvas" class="canvas"
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
let arr = [] let arr = []
// 包含经纬度 // 包含经纬度
const waterInfo = this.waterInfo const waterInfo = this.waterInfo
arr = ['经度: ' + waterInfo.longitude, '纬度: ' + waterInfo.latitude, '地址: ' + waterInfo.address, '时间: ' + arr = ['经度:' + waterInfo.longitude, '纬度:' + waterInfo.latitude, '地址:' + waterInfo.address, '时间:' +
waterInfo.date waterInfo.date
] ]
let settingTxtArr = [] let settingTxtArr = []
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
if (idx > -1) { if (idx > -1) {
settingTxtArr.push(arr[idx]) settingTxtArr.push(arr[idx])
} else { } else {
settingTxtArr.push(item.watemark_text + ': ' + item.watemark_value) settingTxtArr.push(item.watemark_text + ':' + item.watemark_value)
} }
} }
}) })
...@@ -145,8 +145,12 @@ ...@@ -145,8 +145,12 @@
const photo = getApp().globalData.photo const photo = getApp().globalData.photo
this.waterSetting = photo.waterSetting this.waterSetting = photo.waterSetting
this.standardShow = this.shadowInitShow this.standardShow = this.shadowInitShow
this.cameraChange = true
// this.initData() // this.initData()
}, },
onHide(){
this.cameraChange = false
},
methods: { methods: {
closeShadow() { closeShadow() {
this.shadowInitShow = false this.shadowInitShow = false
...@@ -199,7 +203,6 @@ ...@@ -199,7 +203,6 @@
console.log(globalData.navHeight,'globalData.navHeight') console.log(globalData.navHeight,'globalData.navHeight')
this.ratio = globalData.screenHeight / globalData.rpxScreenHeight this.ratio = globalData.screenHeight / globalData.rpxScreenHeight
console.log(globalData.screenHeight,globalData.rpxScreenHeight,this.ratio) console.log(globalData.screenHeight,globalData.rpxScreenHeight,this.ratio)
this.cameraChange = true
this.waterSetting = globalData.photo.waterSetting this.waterSetting = globalData.photo.waterSetting
// this.cameraHeight = globalData.rpxScreenHeight // this.cameraHeight = globalData.rpxScreenHeight
}, },
...@@ -362,13 +365,16 @@ ...@@ -362,13 +365,16 @@
canvas.setFontSize(16) canvas.setFontSize(16)
canvas.setFillStyle('#f2f2f2') canvas.setFillStyle('#f2f2f2')
let txt = settingTxtArr[i] let txt = settingTxtArr[i]
// if(txt.length>14){ if(txt.indexOf('时间')>=0){
// canvas.fillText(txt.substr(14,18), 10, canvasHeight - txtHeight * h++); canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
// canvas.fillText(txt.substr(0,18), 10, canvasHeight - txtHeight * h++); }else{
// }else{ if(txt.length>14){
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++); canvas.fillText(txt.substr(14,14), 10, canvasHeight - txtHeight * h++);
// } canvas.fillText(txt.substr(0,14), 10, canvasHeight - txtHeight * h++);
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++); }else{
canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
}
}
// canvas.fillText(txt, 10, canvasHeight - txtHeight * h++); // canvas.fillText(txt, 10, canvasHeight - txtHeight * h++);
} }
const title = this.titleTxt const title = this.titleTxt
...@@ -506,6 +512,9 @@ ...@@ -506,6 +512,9 @@
padding: 20rpx; padding: 20rpx;
.txt { .txt {
max-width: 400rpx;
max-height: 80rpx;
overflow: hidden;
margin-top: 5rpx; margin-top: 5rpx;
line-height: 40rpx; line-height: 40rpx;
white-space: normal; white-space: normal;
...@@ -539,6 +548,7 @@ ...@@ -539,6 +548,7 @@
background-color: black; background-color: black;
.txt { .txt {
white-space: nowrap;
line-height: 60rpx; line-height: 60rpx;
color: #fff; color: #fff;
} }
......
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