import { Notify, NotifyType } from 'vant'
import { timerInterceptor } from '@/utils/timer'
import plus from '@/utils/h5plus'

/**
 * 消息通知
 * @param message 
 * @param type 
 * @param duration 
 */
export function notify(message?: string, type?: NotifyType, duration = 2000) {
    plus.hideStatusBar();

    Notify({ type, message, duration });

    timerInterceptor.debounce(() => {
        plus.showStatusBar();
    }, duration, 'notify')
}