header.js
2.13 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
import {
mapState
} from 'vuex'
import VDropdown from '@components/home/dropdown/dropdown.vue'
export default {
name: 'VHeader',
components: {
VDropdown
},
data() {
return {
maxClientWidth: 950,
navList: [{
name: "產品介紹",
path: "",
list: []
},
{
name: "客戶服務",
path: "",
list: [{
name: "保單查詢",
path: ""
},
{
name: "理賠報案",
path: ""
},
{
name: "客戶投訴",
path: ""
},
{
name: "保全變更",
path: ""
},
{
name: "聯繫方式",
path: ""
},
{
name: "續期繳費",
path: ""
},
{
name: "預約服務",
path: "/reservation"
}
]
},
{
name: "新聞資訊",
path: "/news/list",
list: []
},
{
name: "關於平安人壽",
path: "",
list: [{
name: "公司簡介",
path: "/profile"
},
{
name: "領導人概況",
path: ""
},
]
},
],
loginData: {
name: "登入",
path: "",
list: [{
name: "登入",
path: "/login",
value: ""
},
{
name: "修改密码",
path: "",
value: ""
},
{
name: "登出",
path: "",
value: ""
},
]
},
langData: {
name: "繁",
path: "",
list: [{
name: "繁",
path: "",
value: "tc"
},
{
name: "简",
path: "",
value: "zh"
},
{
name: "EN",
path: "",
value: "en"
},
]
}
}
},
computed: {
...mapState({
isSmallScreen: state => state.isSmallScreen
})
},
methods: {
toIndex() {
this.$router.push({
path: "/"
})
},
checkIsSmallScreen() {
const self = this;
if (document.body.clientWidth > self.maxClientWidth) {
self.$store.commit('IS_SMALL_SCREEN', false)
} else {
self.$store.commit('IS_SMALL_SCREEN', true)
}
}
},
mounted() {
const self = this;
self.checkIsSmallScreen();
document.body.onresize = () => {
self.checkIsSmallScreen();
}
}
}