.wxml
<view class="confirmbutton" catchtap="{{!buttonClicked ? 'savePicToPhone' : ''}}" >保存图片到手机</view>
.js
//保存图片
savePicToPhone: function () {
let that = this;
// 防止连续点击
this.setData({
buttonClicked: true
})
setTimeout(function () {
that.setData({
buttonClicked: false
})
}, 3000);//3秒间隔
//.......Actions
//.....
//.....
//.....
}
网友评论