|
|
|
@ -375,6 +375,7 @@ export const whatsappError = {
|
|
|
|
|
* 系统弹窗通知
|
|
|
|
|
*/
|
|
|
|
|
export const handleNotification = (title, _options) => {
|
|
|
|
|
var notification;
|
|
|
|
|
const options = {
|
|
|
|
|
requireInteraction: true, // 设置手动关闭
|
|
|
|
|
tag: 'global-sales-notification', // 通知ID,同类通知建议设置相同ID,避免通知过多遮挡桌面
|
|
|
|
@ -384,11 +385,11 @@ export const handleNotification = (title, _options) => {
|
|
|
|
|
|
|
|
|
|
// 检查用户是否同意接受通知
|
|
|
|
|
if (Notification.permission === 'granted') {
|
|
|
|
|
var notification = new Notification(title, options);
|
|
|
|
|
notification = new Notification(title, options);
|
|
|
|
|
} else if (Notification.permission !== 'denied') {
|
|
|
|
|
Notification.requestPermission().then(function (permission) {
|
|
|
|
|
if (permission === 'granted') {
|
|
|
|
|
var notification = new Notification(title, options);
|
|
|
|
|
notification = new Notification(title, options);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|