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

按钮防抖处理

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