-
Notifications
You must be signed in to change notification settings - Fork 544
/
mutations.js
46 lines (44 loc) · 1.3 KB
/
mutations.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const mutations = {
//切换语言 后期需要
switchLang(state, lang) {
state.currentLang = lang
// Vue.config.lang = lang
document.cookie = "VR_LANG=" + lang + "; path=/;domain=.snail.com"
// location.reload()
},
//设置当前页面名字
setPageName(state, name) {
state.currentPageName = name
},
//设置前一页名字 已遗弃
// setBackPageName(state, name) {
// state.backPageName = name
// },
//当 search 组件全屏/非全屏时 切换公共头部状态
toggleHeaderStatus(state, status) {
state.headerStatus = status
},
//切换“微信”页中右上角菜单
toggleTipsStatus(state, status) {
if (status == -1) {
state.tipsStatus = false
} else {
state.tipsStatus = !state.tipsStatus
}
},
//增加未读消息数
addNewMsg(state) {
state.newMsgCount > 99 ? state.newMsgCount = "99+" : state.newMsgCount++
},
//减少未读消息数
minusNewMsg(state) {
state.newMsgCount < 1 ? state.newMsgCount = 0 : state.newMsgCount--
},
//将消息置顶 待完成
// setMsgStick(state, mid) {
// },
//取消置顶消息 待完成
// cancelMsgStick(state, mid) {
// }
}
export default mutations