xc-app/utils/msgUtils.js

28 lines
558 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
uni消息相关的api封转
*/
/*
* 统一的消息通提示命令封装
* @params {String} title 提示的内容
* @params {Number} duration 提示的延迟时间
* @params {Boolean} mask 是否显示透明蒙层防止触摸穿透默认false
* @params {String} icon 值success、loading、none
*/
const msg = (title, duration = 1500, mask = false, icon = 'none') => {
//统一提示方便全局修改
if(Boolean(title) === false){
return;
}
uni.showToast({
title,
duration,
mask,
icon
});
}
export default {
msg
}