<!-- 提示view -->
<loading hidden="{{loadingHidden}}">提交中...</loading>
<modal bindconfirm="onTipsConfirm" hidden="{{hiddenTips}}" no-cancel>{{tipsContent}}</modal>
<toast hidden="{{hideCommitSuccessToast}}">提交成功</toast>
// 提示框参数
hiddenTips: true,
tipsContent: '',
loadingHidden: true,
hiddenCommitTips: true,
hideCommitSuccessToast: true,
// 提示框
onTipsConfirm: function (e) {
this.setData({
hiddenTips: true,
tipsContent: ''
})
},
if (!name) {
this.setData({
hiddenTips: false,
tipsContent: '请填写您的姓名'
})
return;
}
第二种方式:
// 提交成功
this.setData({
loadingHidden: true,
hideCommitSuccessToast: false
})
// 定时,3秒消化
setTimeout(() => {
this.setData({
hideCommitSuccessToast: true
})
}, 3000)