<view bindtap="togetherSteps"></view>
data:{
isTogether:false,//默认是false, 可点击
},
//点击事件
togetherSteps(){
let that = this
if (!this.data.isTogether){
this.setData({
isTogether: true
},() => {
//如果是false就发送请求
wx.request({
url:"user/togetherSteps",
data:{
id:0,
step:1,
},
})
.then((res)=>{
console.log('操作成功')
})
//五秒后把isTogethe设成false,让可以点击
setTimeout(function(){
that.data.isTogether=false;
},5000)
})
}else{
console.log('请勿重复操作!')
return
}
}