diff --git a/src/js/utils/audio.js b/src/js/utils/audio.js index b927f5c..beaca48 100644 --- a/src/js/utils/audio.js +++ b/src/js/utils/audio.js @@ -1,7 +1,12 @@ import msgReceive from '@/assets/audio/msgreceive.mp3' import msgSend from '@/assets/audio/msgsend.mp3' +import { userStore } from '@/stores' +const userData = userStore() export const playMsgReceive = () => { + if (!userData.user.newMsgTips) { + return + } const audio = new Audio(msgReceive) audio.play().catch(() => { // do nothing @@ -9,6 +14,9 @@ export const playMsgReceive = () => { } export const playMsgSend = () => { + if (!userData.user.sendMsgTips) { + return + } const audio = new Audio(msgSend) audio.play().catch(() => { // do nothing diff --git a/src/router/index.js b/src/router/index.js index c6988d1..df7532a 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -151,6 +151,13 @@ const router = createRouter({ meta: { active_1: '/setting' // 一级导航default-active } + }, + { + path: '/setting/notify', + component: () => import('@/views/setting/sub/SettingNotify.vue'), + meta: { + active_1: '/setting' // 一级导航default-active + } } ] } diff --git a/src/views/setting/SettingLayout.vue b/src/views/setting/SettingLayout.vue index f18ebf8..68756e5 100644 --- a/src/views/setting/SettingLayout.vue +++ b/src/views/setting/SettingLayout.vue @@ -1,5 +1,5 @@ @@ -10,13 +10,17 @@ import { User, Key } from '@element-plus/icons-vue' - 个人信息 + 个人设置 安全设置 + + + 通知设置 + diff --git a/src/views/setting/sub/SettingNotify.vue b/src/views/setting/sub/SettingNotify.vue new file mode 100644 index 0000000..432f567 --- /dev/null +++ b/src/views/setting/sub/SettingNotify.vue @@ -0,0 +1,111 @@ + + + + + + 通知设置 + + + + 新消息提示音 + 当前状态:{{ isNewMsgTips ? '开启' : '关闭' }} + + + + + + + + + 发送消息提示音 + 当前状态:{{ isSendMsgTips ? '开启' : '关闭' }} + + + + + + + + + + +