import { Dialog } from 'vant';

let DialogService = {
  confirm({
    title,
    message,
    className,
    showCancelButton,
    confirmButtonColor,
    messageAlign,
    confirmButtonText,
    cancelButtonText
  }) {
    return Dialog.confirm({
      title: title || '提示',
      message: message || '',
      className: className || 'device_confirm',
      showCancelButton: showCancelButton || false,
      confirmButtonColor: confirmButtonColor || '#1989fa', //确认按钮颜色
      messageAlign: messageAlign || 'center', //文字对齐方式
      confirmButtonText: confirmButtonText || '确认', //确认文字
      cancelButtonText: cancelButtonText || '取消'
    });
  },
  close() {
    return Dialog.close();
  }
};

export default DialogService;
