showToast
uni.showToast({
title: 'Toast显示',
duration: 1500
})
//隐藏消息提示框
uni.hideToast()
showLoading
uni.showLoading({
title:'正在加载中',
})
//隐藏loading提示框
uni.hideLoading()
showModal
uni.showModal({
title: '提示',
content: '这是一个模态弹窗',
success: function(res) {
if (res.confirm) {
console.log('用户点击确定');
} else if (res.cancel) {
console.log('用户点击取消');
}
}
});
showActionSheet
uni.showActionSheet({
itemList: ['A', 'B', 'C'],
success: function (res) {
console.log('选中了第' + (res.tapIndex + 1) + '个按钮');
},
fail: function (res) {
console.log(res.errMsg);
}
});
效果图: