You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.0 KiB

2 years ago
const alert = {
// 显示等待对话框
showLoading: function(msg) {
uni.showToast({
title: msg,
icon: "loading",
duration: 100000
});
},
// 隐藏等待对话框
hideLoading: function(msg) {
uni.hideToast();
},
// 成功
showSuccess: function(msg) {
uni.showToast({
title: msg,
icon: "success",
duration: 2000
});
},
//显示警告
showWarning: function(msg) {
uni.showToast({
title: msg,
icon: "none",
duration: 2000
});
},
showError: function(msg) {
uni.showToast({
title: msg,
icon: "none",
duration: 2000
});
},
askLogin: function () {
uni.showModal({
title: '尚未登录',
content: '前往授权登录页面吗?',
success(res) {
console.log(res)
if (res.confirm) {
uni.redirectTo({
url: '/pages/login/login'
})
}
}
})
}
}
export default alert