
const showLoading = (title) => {
	uni.showLoading({
		title: title || '',
		mask: true
	})
}

const hideLoading = () => {
	uni.hideLoading()
}

const show = (title, icon) => {
	if (!title) { return }
	uni.showToast({
		title: title || '',
		mask: true,
		icon: icon || 'none',
		duration: 2000
	})
}

const showSuccess = (title) => {
	uni.showToast({
		title: title || 'Success!',
		icon: 'success',
		mask: true,
		duration: 1500
	})
}

const hide = () => {
	uni.hideToast()
}

export default {
	showLoading,
	hideLoading,
	show,
	hide,
	showSuccess
}
