提示保存成功,使用
wx.showToast({
title: '成功',
icon: 'success',
duration: 2000
})
提示保存失败
wx.showToast({
title: 'ERROR',
icon: 'error',
duration: 2000
})
提示页面加载中.....
wx.showLoading({
title: '加载中...',
})
setTimeout(() => {
wx.hideLoading()
},1000)
动态模拟提示框
//动态模态弹窗
wx.showModal({
title: '提示',
content: '这是一个模态弹窗',
success (res) {
if(res.confirm) {
console.log('用户点击确定')
}else if (res.cancel){
console.log('用户点击取消')
}
}
})
隐藏返回首页的按钮
onShow(){
//隐藏返回首页的按钮
wx.hideHomeButton()
}