微信小程序防止重复提交

//防止重复提交
subFlag=false;
if (this.data.subFlag){
wx.showToast({
title: ‘请勿重复提交’,
icon: ‘none’
})
return ;
}

  **this.data.subFlag = true;**
  call.httpRequest("/Question", param, "POST", this.doSuccess, this.doFail).then(function (res) {
    wx.showToast({
      title: '提交成功',
      icon: 'none'
    })
    that.setData({
      **subFlag:false,**
      questionTitle:''
    })
    wx.navigateTo({
      url: '/pages/union/unionDetail/unionDetail?questionTitle=' + res.data.questionTitle + '&questionID=' + res.data.questionID
    })
  })

你可能感兴趣的:(微信小程序)