默认提交
Showing
17 changed files
with
368 additions
and
165 deletions
... | @@ -139,9 +139,14 @@ npm版本: 推荐6.10.3或以上 | ... | @@ -139,9 +139,14 @@ npm版本: 推荐6.10.3或以上 |
139 | - 简体[zh] | 139 | - 简体[zh] |
140 | - 英文[en] | 140 | - 英文[en] |
141 | 141 | ||
142 | 三语文件所在目录: | ||
143 | |||
144 | |||
142 | #### 执行逻辑 | 145 | #### 执行逻辑 |
143 | 146 | ||
144 | 访问页面时,会先从localStorage里获取历史选取语言,若活动结果为空,则默认使用繁体。 | 147 | 访问页面时,会先从localStorage里获取历史选取语言,若活动结果为空,则默认使用繁体。 |
148 | |||
149 | |||
145 | 150 | ||
146 | 语言切换时,把当前选择语言注入到i18n并埋到localStorage,同时广播事件,通知页面初始化(重新读取cms内容)。 | 151 | 语言切换时,把当前选择语言注入到i18n并埋到localStorage,同时广播事件,通知页面初始化(重新读取cms内容)。 |
147 | 152 | ... | ... |
... | @@ -49,7 +49,8 @@ export default { | ... | @@ -49,7 +49,8 @@ export default { |
49 | let deviceType = output.device.type; | 49 | let deviceType = output.device.type; |
50 | let isMobile = deviceType == "mobile"; | 50 | let isMobile = deviceType == "mobile"; |
51 | this.$store.commit("IS_MOBILE", isMobile); | 51 | this.$store.commit("IS_MOBILE", isMobile); |
52 | }, | 52 | }, |
53 | // 设置用户Profile | ||
53 | refreshProfile() { | 54 | refreshProfile() { |
54 | let userInfoStr = decodeURIComponent(getCookie("_user_profile")); | 55 | let userInfoStr = decodeURIComponent(getCookie("_user_profile")); |
55 | if (userInfoStr) { | 56 | if (userInfoStr) { | ... | ... |
... | @@ -122,17 +122,6 @@ export default { | ... | @@ -122,17 +122,6 @@ export default { |
122 | 122 | ||
123 | let b10 = this.policyIllegal; | 123 | let b10 = this.policyIllegal; |
124 | 124 | ||
125 | // console.log("b1:", b1); | ||
126 | // console.log("b2:", b2); | ||
127 | // console.log("b3:", b3); | ||
128 | // console.log("b4:", b4); | ||
129 | // console.log("b5:", b5); | ||
130 | // console.log("b6:", b6); | ||
131 | // console.log("b7:", b7); | ||
132 | // console.log("b8:", b8); | ||
133 | // console.log("b9:", b9); | ||
134 | // console.log("b10:", b10); | ||
135 | |||
136 | return b1 || b2 || b3 || b4 || b5 || b6 || b7 || b8 || b9 || b10; | 125 | return b1 || b2 || b3 || b4 || b5 || b6 || b7 || b8 || b9 || b10; |
137 | }, | 126 | }, |
138 | isLogin() { | 127 | isLogin() { |
... | @@ -152,7 +141,6 @@ export default { | ... | @@ -152,7 +141,6 @@ export default { |
152 | sessionStorage.removeItem("clarmDataForm"); | 141 | sessionStorage.removeItem("clarmDataForm"); |
153 | let aggressStr = sessionStorage.getItem("clarmAggressStr"); | 142 | let aggressStr = sessionStorage.getItem("clarmAggressStr"); |
154 | 143 | ||
155 | |||
156 | if (clarmDataFormStr) { | 144 | if (clarmDataFormStr) { |
157 | try { | 145 | try { |
158 | this.data = JSON.parse(clarmDataFormStr); | 146 | this.data = JSON.parse(clarmDataFormStr); | ... | ... |
1 | import api from '@/api/api' | 1 | /** |
2 | import { | 2 | * 组件描述:日历选择器 |
3 | httpGet, | 3 | */ |
4 | httpPost | ||
5 | } from '@/api/fetch-api.js' | ||
6 | 4 | ||
7 | import Date from '@/utils/date.js'; | 5 | import Date from '@/utils/date.js'; |
8 | import { toSolar } from '@/utils/lunar.js'; | 6 | import { |
7 | toSolar | ||
8 | } from '@/utils/lunar.js'; | ||
9 | 9 | ||
10 | import { | 10 | import { |
11 | ddMMyyyy2yyyyMMdd | 11 | ddMMyyyy2yyyyMMdd |
12 | } from '@utils/utils.js'; | 12 | } from '@utils/utils.js'; |
13 | 13 | ||
14 | |||
14 | export default { | 15 | export default { |
15 | inheritAttrs: false, | 16 | inheritAttrs: false, |
16 | props: { | 17 | props: { |
17 | value: { | 18 | value: { |
18 | type: String, | 19 | type: String, |
... | @@ -36,14 +37,14 @@ export default { | ... | @@ -36,14 +37,14 @@ export default { |
36 | // holiday : 节假日不可选择 | 37 | // holiday : 节假日不可选择 |
37 | filtModel: { | 38 | filtModel: { |
38 | type: Array, | 39 | type: Array, |
39 | default() { | 40 | default () { |
40 | return ["history", "weekend", "today"] | 41 | return ["history", "weekend", "today"] |
41 | } | 42 | } |
42 | }, | 43 | }, |
43 | // 需要过滤的日期列表 格式 ["yyyy-MM-dd","yyyy-MM-dd"] | 44 | // 需要过滤的日期列表 格式 ["yyyy-MM-dd","yyyy-MM-dd"] |
44 | filterDates: { | 45 | filterDates: { |
45 | type: Array, | 46 | type: Array, |
46 | default() { | 47 | default () { |
47 | return [] // ["2019-11-26", "2019-11-28"] | 48 | return [] // ["2019-11-26", "2019-11-28"] |
48 | } | 49 | } |
49 | }, | 50 | }, |
... | @@ -70,9 +71,10 @@ export default { | ... | @@ -70,9 +71,10 @@ export default { |
70 | type: Function, | 71 | type: Function, |
71 | default: null | 72 | default: null |
72 | }, | 73 | }, |
74 | // 属性值 | ||
73 | cusStyle: { | 75 | cusStyle: { |
74 | type: Object, | 76 | type: Object, |
75 | default() { | 77 | default () { |
76 | return {}; | 78 | return {}; |
77 | } | 79 | } |
78 | }, | 80 | }, |
... | @@ -103,9 +105,23 @@ export default { | ... | @@ -103,9 +105,23 @@ export default { |
103 | visible: false, | 105 | visible: false, |
104 | hkHolidayDefine: { | 106 | hkHolidayDefine: { |
105 | // 公历假期,缺少复活节,缺少聖誕節後第一個周日 | 107 | // 公历假期,缺少复活节,缺少聖誕節後第一個周日 |
106 | gl: [[1, 1], [5, 1], [7, 1], [10, 1], [10, 2], [12, 25]], | 108 | gl: [ |
109 | [1, 1], | ||
110 | [5, 1], | ||
111 | [7, 1], | ||
112 | [10, 1], | ||
113 | [10, 2], | ||
114 | [12, 25] | ||
115 | ], | ||
107 | // 农历假期,缺少清明节 | 116 | // 农历假期,缺少清明节 |
108 | nl: [[1, 1], [1, 2], [1, 3], [5, 5], [8, 15], [9, 9]], | 117 | nl: [ |
118 | [1, 1], | ||
119 | [1, 2], | ||
120 | [1, 3], | ||
121 | [5, 5], | ||
122 | [8, 15], | ||
123 | [9, 9] | ||
124 | ], | ||
109 | // 清明节 | 125 | // 清明节 |
110 | qm: [ | 126 | qm: [ |
111 | // 4月4号 | 127 | // 4月4号 |
... | @@ -114,37 +130,223 @@ export default { | ... | @@ -114,37 +130,223 @@ export default { |
114 | ["2022", "2023", "2026", "2027", "2030", "2031", "2034", "2035", "2038", "2039"] | 130 | ["2022", "2023", "2026", "2027", "2030", "2031", "2034", "2035", "2038", "2039"] |
115 | ], | 131 | ], |
116 | pub: { | 132 | pub: { |
117 | 2020: [[4, 10], [4, 11], [4, 12], [4, 13], [4, 30]], | 133 | 2020: [ |
118 | 2021: [[4, 2], [4, 3], [4, 4], [4, 5], [5, 19]], | 134 | [4, 10], |
119 | 2022: [[4, 15], [4, 16], [4, 17], [4, 18], [5, 8]], | 135 | [4, 11], |
120 | 2023: [[4, 7], [4, 8], [4, 9], [4, 10], [5, 26]], | 136 | [4, 12], |
121 | 2024: [[3, 29], [3, 30], [3, 31], [4, 1], [5, 15]], | 137 | [4, 13], |
122 | 2025: [[4, 18], [4, 19], [4, 20], [4, 21], [5, 5]], | 138 | [4, 30] |
123 | 2026: [[4, 3], [4, 4], [4, 5], [4, 6], [5, 24]], | 139 | ], |
124 | 2027: [[3, 26], [3, 27], [3, 28], [3, 29], [5, 13]], | 140 | 2021: [ |
125 | 2028: [[4, 14], [4, 15], [4, 16], [4, 17], [5, 2]], | 141 | [4, 2], |
126 | 2029: [[3, 30], [3, 31], [4, 1], [4, 2], [5, 20]], | 142 | [4, 3], |
127 | 2030: [[4, 19], [4, 20], [4, 21], [4, 22], [5, 9]], | 143 | [4, 4], |
128 | 2031: [[4, 11], [4, 12], [4, 13], [4, 14], [5, 28]], | 144 | [4, 5], |
129 | 2032: [[3, 26], [3, 27], [3, 28], [3, 29], [5, 16]], | 145 | [5, 19] |
130 | 2033: [[4, 15], [4, 16], [4, 17], [4, 18], [5, 6]], | 146 | ], |
131 | 2034: [[4, 7], [4, 8], [4, 9], [4, 10], [5, 25]], | 147 | 2022: [ |
132 | 2035: [[3, 23], [3, 24], [3, 25], [3, 26], [5, 15]], | 148 | [4, 15], |
133 | 2036: [[4, 11], [4, 12], [4, 13], [4, 14], [5, 3]], | 149 | [4, 16], |
134 | 2037: [[4, 3], [4, 4], [4, 5], [4, 6], [5, 22]], | 150 | [4, 17], |
135 | 2038: [[4, 23], [4, 24], [4, 25], [4, 26], [5, 11]], | 151 | [4, 18], |
136 | 2039: [[4, 8], [4, 9], [4, 10], [4, 11], [4, 30]], | 152 | [5, 8] |
137 | 2040: [[3, 30], [3, 31], [4, 1], [4, 2], [5, 18]], | 153 | ], |
138 | 2041: [[4, 19], [4, 20], [4, 21], [4, 22], [5, 7]], | 154 | 2023: [ |
139 | 2042: [[4, 4], [4, 5], [4, 6], [4, 7], [5, 26]], | 155 | [4, 7], |
140 | 2043: [[3, 27], [3, 28], [3, 29], [3, 30], [5, 16]], | 156 | [4, 8], |
141 | 2044: [[4, 15], [4, 16], [4, 17], [4, 18], [5, 5]], | 157 | [4, 9], |
142 | 2045: [[4, 7], [4, 8], [4, 9], [4, 10], [5, 24]], | 158 | [4, 10], |
143 | 2046: [[3, 23], [3, 24], [3, 25], [3, 26], [5, 13]], | 159 | [5, 26] |
144 | 2047: [[4, 12], [4, 13], [4, 14], [4, 15], [5, 2]], | 160 | ], |
145 | 2048: [[4, 3], [4, 4], [4, 5], [4, 6], [5, 20]], | 161 | 2024: [ |
146 | 2049: [[4, 16], [4, 17], [4, 18], [4, 19], [5, 9]], | 162 | [3, 29], |
147 | 2050: [[4, 8], [4, 9], [4, 10], [4, 11], [5, 28]] | 163 | [3, 30], |
164 | [3, 31], | ||
165 | [4, 1], | ||
166 | [5, 15] | ||
167 | ], | ||
168 | 2025: [ | ||
169 | [4, 18], | ||
170 | [4, 19], | ||
171 | [4, 20], | ||
172 | [4, 21], | ||
173 | [5, 5] | ||
174 | ], | ||
175 | 2026: [ | ||
176 | [4, 3], | ||
177 | [4, 4], | ||
178 | [4, 5], | ||
179 | [4, 6], | ||
180 | [5, 24] | ||
181 | ], | ||
182 | 2027: [ | ||
183 | [3, 26], | ||
184 | [3, 27], | ||
185 | [3, 28], | ||
186 | [3, 29], | ||
187 | [5, 13] | ||
188 | ], | ||
189 | 2028: [ | ||
190 | [4, 14], | ||
191 | [4, 15], | ||
192 | [4, 16], | ||
193 | [4, 17], | ||
194 | [5, 2] | ||
195 | ], | ||
196 | 2029: [ | ||
197 | [3, 30], | ||
198 | [3, 31], | ||
199 | [4, 1], | ||
200 | [4, 2], | ||
201 | [5, 20] | ||
202 | ], | ||
203 | 2030: [ | ||
204 | [4, 19], | ||
205 | [4, 20], | ||
206 | [4, 21], | ||
207 | [4, 22], | ||
208 | [5, 9] | ||
209 | ], | ||
210 | 2031: [ | ||
211 | [4, 11], | ||
212 | [4, 12], | ||
213 | [4, 13], | ||
214 | [4, 14], | ||
215 | [5, 28] | ||
216 | ], | ||
217 | 2032: [ | ||
218 | [3, 26], | ||
219 | [3, 27], | ||
220 | [3, 28], | ||
221 | [3, 29], | ||
222 | [5, 16] | ||
223 | ], | ||
224 | 2033: [ | ||
225 | [4, 15], | ||
226 | [4, 16], | ||
227 | [4, 17], | ||
228 | [4, 18], | ||
229 | [5, 6] | ||
230 | ], | ||
231 | 2034: [ | ||
232 | [4, 7], | ||
233 | [4, 8], | ||
234 | [4, 9], | ||
235 | [4, 10], | ||
236 | [5, 25] | ||
237 | ], | ||
238 | 2035: [ | ||
239 | [3, 23], | ||
240 | [3, 24], | ||
241 | [3, 25], | ||
242 | [3, 26], | ||
243 | [5, 15] | ||
244 | ], | ||
245 | 2036: [ | ||
246 | [4, 11], | ||
247 | [4, 12], | ||
248 | [4, 13], | ||
249 | [4, 14], | ||
250 | [5, 3] | ||
251 | ], | ||
252 | 2037: [ | ||
253 | [4, 3], | ||
254 | [4, 4], | ||
255 | [4, 5], | ||
256 | [4, 6], | ||
257 | [5, 22] | ||
258 | ], | ||
259 | 2038: [ | ||
260 | [4, 23], | ||
261 | [4, 24], | ||
262 | [4, 25], | ||
263 | [4, 26], | ||
264 | [5, 11] | ||
265 | ], | ||
266 | 2039: [ | ||
267 | [4, 8], | ||
268 | [4, 9], | ||
269 | [4, 10], | ||
270 | [4, 11], | ||
271 | [4, 30] | ||
272 | ], | ||
273 | 2040: [ | ||
274 | [3, 30], | ||
275 | [3, 31], | ||
276 | [4, 1], | ||
277 | [4, 2], | ||
278 | [5, 18] | ||
279 | ], | ||
280 | 2041: [ | ||
281 | [4, 19], | ||
282 | [4, 20], | ||
283 | [4, 21], | ||
284 | [4, 22], | ||
285 | [5, 7] | ||
286 | ], | ||
287 | 2042: [ | ||
288 | [4, 4], | ||
289 | [4, 5], | ||
290 | [4, 6], | ||
291 | [4, 7], | ||
292 | [5, 26] | ||
293 | ], | ||
294 | 2043: [ | ||
295 | [3, 27], | ||
296 | [3, 28], | ||
297 | [3, 29], | ||
298 | [3, 30], | ||
299 | [5, 16] | ||
300 | ], | ||
301 | 2044: [ | ||
302 | [4, 15], | ||
303 | [4, 16], | ||
304 | [4, 17], | ||
305 | [4, 18], | ||
306 | [5, 5] | ||
307 | ], | ||
308 | 2045: [ | ||
309 | [4, 7], | ||
310 | [4, 8], | ||
311 | [4, 9], | ||
312 | [4, 10], | ||
313 | [5, 24] | ||
314 | ], | ||
315 | 2046: [ | ||
316 | [3, 23], | ||
317 | [3, 24], | ||
318 | [3, 25], | ||
319 | [3, 26], | ||
320 | [5, 13] | ||
321 | ], | ||
322 | 2047: [ | ||
323 | [4, 12], | ||
324 | [4, 13], | ||
325 | [4, 14], | ||
326 | [4, 15], | ||
327 | [5, 2] | ||
328 | ], | ||
329 | 2048: [ | ||
330 | [4, 3], | ||
331 | [4, 4], | ||
332 | [4, 5], | ||
333 | [4, 6], | ||
334 | [5, 20] | ||
335 | ], | ||
336 | 2049: [ | ||
337 | [4, 16], | ||
338 | [4, 17], | ||
339 | [4, 18], | ||
340 | [4, 19], | ||
341 | [5, 9] | ||
342 | ], | ||
343 | 2050: [ | ||
344 | [4, 8], | ||
345 | [4, 9], | ||
346 | [4, 10], | ||
347 | [4, 11], | ||
348 | [5, 28] | ||
349 | ] | ||
148 | } | 350 | } |
149 | }, | 351 | }, |
150 | // 节假日,key是月份,value是日期列表 | 352 | // 节假日,key是月份,value是日期列表 |
... | @@ -155,6 +357,7 @@ export default { | ... | @@ -155,6 +357,7 @@ export default { |
155 | }, | 357 | }, |
156 | components: {}, | 358 | components: {}, |
157 | computed: { | 359 | computed: { |
360 | // 节日计算 | ||
158 | holiday() { | 361 | holiday() { |
159 | // 计算新历 | 362 | // 计算新历 |
160 | let result = {}; | 363 | let result = {}; |
... | @@ -164,7 +367,6 @@ export default { | ... | @@ -164,7 +367,6 @@ export default { |
164 | } | 367 | } |
165 | let hkHolidayDefine = this.hkHolidayDefine; | 368 | let hkHolidayDefine = this.hkHolidayDefine; |
166 | 369 | ||
167 | |||
168 | // 加入清明节 | 370 | // 加入清明节 |
169 | if (hkHolidayDefine.qm[0].indexOf(year + "") >= 0) { | 371 | if (hkHolidayDefine.qm[0].indexOf(year + "") >= 0) { |
170 | // 如果是周六/周日,顺延到下周一 | 372 | // 如果是周六/周日,顺延到下周一 |
... | @@ -508,7 +710,9 @@ export default { | ... | @@ -508,7 +710,9 @@ export default { |
508 | let _this = this; | 710 | let _this = this; |
509 | let type = boo ? "show" : "close"; | 711 | let type = boo ? "show" : "close"; |
510 | setTimeout(function () { | 712 | setTimeout(function () { |
511 | _this.pluginActivity({ type: type }); | 713 | _this.pluginActivity({ |
714 | type: type | ||
715 | }); | ||
512 | }, 100); | 716 | }, 100); |
513 | } | 717 | } |
514 | }, | 718 | }, |
... | @@ -561,18 +765,13 @@ export default { | ... | @@ -561,18 +765,13 @@ export default { |
561 | } | 765 | } |
562 | }, | 766 | }, |
563 | formatDateValue(year, month, date) { | 767 | formatDateValue(year, month, date) { |
564 | // console.log("year:", year); | ||
565 | // console.log("month:", month); | ||
566 | // console.log("date:", date); | ||
567 | if (month < 10) { | 768 | if (month < 10) { |
568 | month = "0" + month | 769 | month = "0" + month |
569 | } | 770 | } |
570 | if (date < 10) { | 771 | if (date < 10) { |
571 | date = "0" + date | 772 | date = "0" + date |
572 | } | 773 | } |
573 | // this.dateValue = `${year}-${month}-${date}`; | ||
574 | this.dateValue = Date.parse(`${year}.${month}.${date}`).toString(this.formatter); | 774 | this.dateValue = Date.parse(`${year}.${month}.${date}`).toString(this.formatter); |
575 | // console.log("this.dateValue:", this.dateValue); | ||
576 | }, | 775 | }, |
577 | /** | 776 | /** |
578 | * 校验并返回日期 | 777 | * 校验并返回日期 |
... | @@ -613,16 +812,6 @@ export default { | ... | @@ -613,16 +812,6 @@ export default { |
613 | // 设置今天日期 | 812 | // 设置今天日期 |
614 | let isInit = false; | 813 | let isInit = false; |
615 | if (this.value) { | 814 | if (this.value) { |
616 | // console.log("this.value:", this.value); | ||
617 | // let ymd = this.value.split("-"); | ||
618 | // if (ymd.length == 3) { | ||
619 | // try { | ||
620 | // this.year = Number(ymd[0]); | ||
621 | // this.month = Number(ymd[1]); | ||
622 | // this.date = Number(ymd[2]); | ||
623 | // isInit = true; | ||
624 | // } catch (e) {} | ||
625 | // } | ||
626 | try { | 815 | try { |
627 | let dateStr = this.value; | 816 | let dateStr = this.value; |
628 | if (this.formatter == "dd-MM-yyyy") { | 817 | if (this.formatter == "dd-MM-yyyy") { |
... | @@ -635,7 +824,7 @@ export default { | ... | @@ -635,7 +824,7 @@ export default { |
635 | this.month = curDate.getMonth() + 1; | 824 | this.month = curDate.getMonth() + 1; |
636 | this.date = curDate.getDate(); | 825 | this.date = curDate.getDate(); |
637 | isInit = true; | 826 | isInit = true; |
638 | } catch (error) { } | 827 | } catch (error) {} |
639 | } | 828 | } |
640 | if (!isInit) { | 829 | if (!isInit) { |
641 | let today = Date.today(); | 830 | let today = Date.today(); |
... | @@ -678,7 +867,7 @@ export default { | ... | @@ -678,7 +867,7 @@ export default { |
678 | // if (date.getDay() == 6) { | 867 | // if (date.getDay() == 6) { |
679 | // // 周六 | 868 | // // 周六 |
680 | // date.addDays(2); | 869 | // date.addDays(2); |
681 | // } else | 870 | // } else |
682 | if (date.getDay() == 0) { | 871 | if (date.getDay() == 0) { |
683 | date.addDays(1); | 872 | date.addDays(1); |
684 | } | 873 | } |
... | @@ -687,7 +876,7 @@ export default { | ... | @@ -687,7 +876,7 @@ export default { |
687 | return [m, d]; | 876 | return [m, d]; |
688 | } | 877 | } |
689 | }, | 878 | }, |
690 | mounted() { }, | 879 | mounted() {}, |
691 | created() { | 880 | created() { |
692 | this.initData(); | 881 | this.initData(); |
693 | }, | 882 | }, |
... | @@ -700,8 +889,6 @@ export default { | ... | @@ -700,8 +889,6 @@ export default { |
700 | this.checkDateValue(); | 889 | this.checkDateValue(); |
701 | this.$emit('input', val); | 890 | this.$emit('input', val); |
702 | }, | 891 | }, |
703 | year() { | 892 | year() {} |
704 | // this.calculateHolidays(); | ||
705 | } | ||
706 | } | 893 | } |
707 | } | 894 | } | ... | ... |
1 | import { | 1 | /** |
2 | mapState | 2 | * 组件描述:PC顶栏导航下拉菜单 |
3 | } from 'vuex' | 3 | */ |
4 | |||
5 | import api from '@/api/api' | 4 | import api from '@/api/api' |
6 | import { | 5 | import { |
7 | httpPost | 6 | httpPost |
... | @@ -17,27 +16,39 @@ export default { | ... | @@ -17,27 +16,39 @@ export default { |
17 | }; | 16 | }; |
18 | }, | 17 | }, |
19 | props: { | 18 | props: { |
19 | /** | ||
20 | * 导航类型 | ||
21 | * nav:普通菜单导航 | ||
22 | * login:登陆菜单 | ||
23 | * lang:三语切换菜单 | ||
24 | */ | ||
20 | type: { | 25 | type: { |
21 | type: String, | 26 | type: String, |
22 | default() { | 27 | default () { |
23 | return "nav"; | 28 | return "nav"; |
24 | } | 29 | } |
25 | }, | 30 | }, |
31 | /** | ||
32 | * 传入菜单完整数据 | ||
33 | */ | ||
26 | dataObj: { | 34 | dataObj: { |
27 | type: Object, | 35 | type: Object, |
28 | default() { | 36 | default () { |
29 | return {}; | 37 | return {}; |
30 | } | 38 | } |
31 | }, | 39 | }, |
40 | /** | ||
41 | * 传入菜单列表 | ||
42 | */ | ||
32 | dataList: { | 43 | dataList: { |
33 | type: Array, | 44 | type: Array, |
34 | default() { | 45 | default () { |
35 | return []; | 46 | return []; |
36 | } | 47 | } |
37 | }, | 48 | }, |
38 | labelProperty: { | 49 | labelProperty: { |
39 | type: String, | 50 | type: String, |
40 | default() { | 51 | default () { |
41 | return "name"; | 52 | return "name"; |
42 | } | 53 | } |
43 | } | 54 | } |
... | @@ -51,6 +62,7 @@ export default { | ... | @@ -51,6 +62,7 @@ export default { |
51 | }, | 62 | }, |
52 | methods: { | 63 | methods: { |
53 | onNavHandler() { | 64 | onNavHandler() { |
65 | console.log("this.dataObj:", this.dataObj); | ||
54 | let path = this.dataObj && this.dataObj.path || ""; | 66 | let path = this.dataObj && this.dataObj.path || ""; |
55 | if (path) { | 67 | if (path) { |
56 | this.$router.push({ | 68 | this.$router.push({ |
... | @@ -69,8 +81,6 @@ export default { | ... | @@ -69,8 +81,6 @@ export default { |
69 | }, | 81 | }, |
70 | onClickHandler(event, index) { | 82 | onClickHandler(event, index) { |
71 | // 隐藏其他 | 83 | // 隐藏其他 |
72 | // let path = event.path || (event.composedPath && event.composedPath()); //兼容火狐和safari | ||
73 | // path[1].style.display = "none"; | ||
74 | if (this.$refs.ul) { | 84 | if (this.$refs.ul) { |
75 | this.$refs.ul.style.display = "none"; | 85 | this.$refs.ul.style.display = "none"; |
76 | } | 86 | } |
... | @@ -90,21 +100,13 @@ export default { | ... | @@ -90,21 +100,13 @@ export default { |
90 | this.sTitle = curData.name; | 100 | this.sTitle = curData.name; |
91 | this.$root.eventBus.$emit("langChange"); | 101 | this.$root.eventBus.$emit("langChange"); |
92 | } | 102 | } |
93 | // console.log(this.$route); | ||
94 | } | 103 | } |
95 | } else { | 104 | } else { |
96 | // if (curData.value == "logout") { | ||
97 | // this.loginHandler(); | ||
98 | // } else { | ||
99 | // this.$router.push({ | ||
100 | // path: curData.path | ||
101 | // }) | ||
102 | // } | ||
103 | let item = curData; | 105 | let item = curData; |
104 | let path = item && item.path || ""; | 106 | let path = item && item.path || ""; |
105 | this.$root.eventBus.$emit(item.path); | 107 | this.$root.eventBus.$emit(item.path); |
106 | if (path) { | 108 | if (path) { |
107 | console.log("path:", path); | 109 | // console.log("path:", path); |
108 | // modify | 110 | // modify |
109 | if (path == "/custom/service?q=m5") { | 111 | if (path == "/custom/service?q=m5") { |
110 | path = "/clarms" | 112 | path = "/clarms" |
... | @@ -177,5 +179,5 @@ export default { | ... | @@ -177,5 +179,5 @@ export default { |
177 | return this.dataList[this.activeIndex][this.labelProperty]; | 179 | return this.dataList[this.activeIndex][this.labelProperty]; |
178 | } | 180 | } |
179 | }, | 181 | }, |
180 | created() { }, | 182 | created() {}, |
181 | }; | 183 | }; | ... | ... |
... | @@ -66,7 +66,6 @@ | ... | @@ -66,7 +66,6 @@ |
66 | <!-- 版权 --> | 66 | <!-- 版权 --> |
67 | <div class="copyright"> | 67 | <div class="copyright"> |
68 | {{$t('footer.copyright')}} | 68 | {{$t('footer.copyright')}} |
69 | <!-- <br>Copyright © PING AN INSURANCE (GROUP) COMPANY OF CHINA ,LTD. All Rights Reserved --> | ||
70 | </div> | 69 | </div> |
71 | </div> | 70 | </div> |
72 | </div> | 71 | </div> | ... | ... |
1 | /** | ||
2 | * 组件描述:官网顶栏导航 | ||
3 | * 通过@midea 媒体查询决定显示PC/移动端样式 | ||
4 | */ | ||
5 | |||
1 | import { | 6 | import { |
2 | mapState | 7 | mapState |
3 | } from 'vuex' | 8 | } from 'vuex' |
... | @@ -24,26 +29,29 @@ export default { | ... | @@ -24,26 +29,29 @@ export default { |
24 | dropdownMVisible: false, | 29 | dropdownMVisible: false, |
25 | loginMVisible: false, | 30 | loginMVisible: false, |
26 | maxClientWidth: 1200, | 31 | maxClientWidth: 1200, |
32 | // 用于传入到导航组件dropdown 常规导航菜单数据 | ||
27 | navList: [], | 33 | navList: [], |
34 | // 用于传入到导航组件dropdown 登菜单数据 | ||
28 | loginData: {}, | 35 | loginData: {}, |
36 | // 用于传入到导航组件dropdown 语言菜单数据 | ||
29 | langData: { | 37 | langData: { |
30 | name: "繁", | 38 | name: "繁", |
31 | path: "", | 39 | path: "", |
32 | list: [{ | 40 | list: [{ |
33 | name: "繁", | 41 | name: "繁", |
34 | path: "", | 42 | path: "", |
35 | value: "tc" | 43 | value: "tc" |
36 | }, | 44 | }, |
37 | { | 45 | { |
38 | name: "简", | 46 | name: "简", |
39 | path: "", | 47 | path: "", |
40 | value: "zh" | 48 | value: "zh" |
41 | }, | 49 | }, |
42 | { | 50 | { |
43 | name: "EN", | 51 | name: "EN", |
44 | path: "", | 52 | path: "", |
45 | value: "en" | 53 | value: "en" |
46 | }, | 54 | }, |
47 | ] | 55 | ] |
48 | } | 56 | } |
49 | } | 57 | } |
... | @@ -67,7 +75,7 @@ export default { | ... | @@ -67,7 +75,7 @@ export default { |
67 | this.dropdownMVisible = true; | 75 | this.dropdownMVisible = true; |
68 | } else if (evtStr == 'login') { | 76 | } else if (evtStr == 'login') { |
69 | this.loginMVisible = true; | 77 | this.loginMVisible = true; |
70 | } else { } | 78 | } else {} |
71 | }, | 79 | }, |
72 | checkIsSmallScreen() { | 80 | checkIsSmallScreen() { |
73 | const self = this; | 81 | const self = this; |
... | @@ -79,14 +87,15 @@ export default { | ... | @@ -79,14 +87,15 @@ export default { |
79 | }, | 87 | }, |
80 | initData() { | 88 | initData() { |
81 | let i18n = this.$i18n.messages[this.$i18n.locale] || {}; | 89 | let i18n = this.$i18n.messages[this.$i18n.locale] || {}; |
82 | // this.loginData = i18n.nav.loginData; | 90 | this.buildLoginMenu(); |
83 | this._buildLoginMenu(); | ||
84 | this.navList = i18n.nav.navList; | 91 | this.navList = i18n.nav.navList; |
85 | let curLang = getObjByListKeyValue(this.$i18n.locale, "value", this.langData.list) | 92 | let curLang = getObjByListKeyValue(this.$i18n.locale, "value", this.langData.list) |
86 | this.langData.name = curLang.name; | 93 | this.langData.name = curLang.name; |
87 | }, | 94 | }, |
88 | _buildLoginMenu() { | 95 | /** |
89 | // 构建登录页 | 96 | * 根据登陆状态构建登陆菜单 |
97 | */ | ||
98 | buildLoginMenu() { | ||
90 | let i18n = this.$i18n.messages[this.$i18n.locale] || {}; | 99 | let i18n = this.$i18n.messages[this.$i18n.locale] || {}; |
91 | let menuData = JSON.parse(JSON.stringify(i18n.nav.loginData)); | 100 | let menuData = JSON.parse(JSON.stringify(i18n.nav.loginData)); |
92 | let list = []; | 101 | let list = []; |
... | @@ -109,18 +118,12 @@ export default { | ... | @@ -109,18 +118,12 @@ export default { |
109 | } | 118 | } |
110 | menuData.list = list; | 119 | menuData.list = list; |
111 | this.$set(this, 'loginData', menuData); | 120 | this.$set(this, 'loginData', menuData); |
112 | // console.log(this.userInfo); | ||
113 | } | 121 | } |
114 | }, | 122 | }, |
115 | beforeDestroy() { | 123 | beforeDestroy() { |
116 | window.removeEventListener('resize', this.checkIsSmallScreen(), false) | 124 | window.removeEventListener('resize', this.checkIsSmallScreen(), false) |
117 | }, | 125 | }, |
118 | mounted() { | 126 | mounted() { |
119 | // const self = this; | ||
120 | // self.checkIsSmallScreen(); | ||
121 | // document.body.onresize = () => { | ||
122 | // self.checkIsSmallScreen(); | ||
123 | // } | ||
124 | window.addEventListener('resize', () => this.checkIsSmallScreen(), false); | 127 | window.addEventListener('resize', () => this.checkIsSmallScreen(), false); |
125 | this.$root.eventBus.$on("langChange", () => { | 128 | this.$root.eventBus.$on("langChange", () => { |
126 | this.initData(); | 129 | this.initData(); | ... | ... |
... | @@ -21,19 +21,28 @@ export default { | ... | @@ -21,19 +21,28 @@ export default { |
21 | props: { | 21 | props: { |
22 | visible: { | 22 | visible: { |
23 | type: Boolean, | 23 | type: Boolean, |
24 | default() { | 24 | default () { |
25 | return false; | 25 | return false; |
26 | } | 26 | } |
27 | }, | 27 | }, |
28 | /** | ||
29 | * 导航类型 | ||
30 | * nav:普通菜单导航 | ||
31 | * login:登陆菜单 | ||
32 | * lang:三语切换菜单 | ||
33 | */ | ||
28 | type: { | 34 | type: { |
29 | type: String, | 35 | type: String, |
30 | default() { | 36 | default () { |
31 | return "nav"; | 37 | return "nav"; |
32 | } | 38 | } |
33 | }, | 39 | }, |
40 | /** | ||
41 | * 传入菜单列表 | ||
42 | */ | ||
34 | langList: { | 43 | langList: { |
35 | type: Array, | 44 | type: Array, |
36 | default() { | 45 | default () { |
37 | return []; | 46 | return []; |
38 | } | 47 | } |
39 | }, | 48 | }, |
... | @@ -88,10 +97,14 @@ export default { | ... | @@ -88,10 +97,14 @@ export default { |
88 | if (this.$route.name == "login") { | 97 | if (this.$route.name == "login") { |
89 | return; | 98 | return; |
90 | } else if (this.$route.name == "register" || this.$route.name == "passwordFind") { | 99 | } else if (this.$route.name == "register" || this.$route.name == "passwordFind") { |
91 | this.$router.push({ path: "/login" }); | 100 | this.$router.push({ |
101 | path: "/login" | ||
102 | }); | ||
92 | } else { | 103 | } else { |
93 | let callback = this.$route.fullPath; | 104 | let callback = this.$route.fullPath; |
94 | this.$router.push({ path: "/login?callback=" + callback }); | 105 | this.$router.push({ |
106 | path: "/login?callback=" + callback | ||
107 | }); | ||
95 | } | 108 | } |
96 | }, | 109 | }, |
97 | logoutHandler() { | 110 | logoutHandler() { | ... | ... |
This diff is collapsed.
Click to expand it.
1 | import api from '@/api/api' | 1 | /** |
2 | import { | 2 | * 组件描述:官网通用模态窗 第二类 |
3 | httpGet, | 3 | * PC端样式为左图标右文案 |
4 | httpPost | 4 | * 主要用于错误提示 |
5 | } from '@/api/fetch-api.js' | 5 | */ |
6 | |||
7 | export default { | 6 | export default { |
8 | name: "pagination", | 7 | name: "pagination", |
9 | props: { | 8 | props: { |
9 | // 总页数 | ||
10 | total: { | 10 | total: { |
11 | type: Number, | 11 | type: Number, |
12 | default: 1 | 12 | default: 1 |
13 | }, | 13 | }, |
14 | // 总条数,名字自取 还有国家化 | 14 | // 总条数 |
15 | totalItem: { | 15 | totalItem: { |
16 | type: Number, | 16 | type: Number, |
17 | default: 1 | 17 | default: 1 |
... | @@ -19,7 +19,6 @@ export default { | ... | @@ -19,7 +19,6 @@ export default { |
19 | }, | 19 | }, |
20 | data() { | 20 | data() { |
21 | return { | 21 | return { |
22 | // total: 10, // 总页数 | ||
23 | cur: 1, // 当前页码 | 22 | cur: 1, // 当前页码 |
24 | sel: 1, // 选择的页码 | 23 | sel: 1, // 选择的页码 |
25 | } | 24 | } |
... | @@ -80,7 +79,7 @@ export default { | ... | @@ -80,7 +79,7 @@ export default { |
80 | this.sendPage(); | 79 | this.sendPage(); |
81 | }, | 80 | }, |
82 | sendPage() { | 81 | sendPage() { |
83 | // 发送事件 | 82 | // 发送选页事件 |
84 | this.$emit("selpage", { | 83 | this.$emit("selpage", { |
85 | page: this.cur | 84 | page: this.cur |
86 | }); | 85 | }); | ... | ... |
1 | /** | ||
2 | * 组件描述:网销弹窗组件 | ||
3 | * 该组件挂载在app.vue内跟导航header,页脚footer,主要内容main同级 | ||
4 | */ | ||
5 | |||
1 | import { | 6 | import { |
2 | mapState | 7 | mapState |
3 | } from "vuex"; | 8 | } from "vuex"; |
... | @@ -125,9 +130,6 @@ export default { | ... | @@ -125,9 +130,6 @@ export default { |
125 | let d = now.getDate(); | 130 | let d = now.getDate(); |
126 | 131 | ||
127 | if (this.$i18n.locale == 'en') { | 132 | if (this.$i18n.locale == 'en') { |
128 | // this.policyDetail.nowYmd1 = m > 10 ? m : "0" + m; | ||
129 | // this.policyDetail.nowYmd2 = d > 10 ? d : "0" + d; | ||
130 | // this.policyDetail.nowYmd3 = y; | ||
131 | this.policyDetail.nowYmd2 = m > 10 ? m : "0" + m; | 133 | this.policyDetail.nowYmd2 = m > 10 ? m : "0" + m; |
132 | this.policyDetail.nowYmd1 = d > 10 ? d : "0" + d; | 134 | this.policyDetail.nowYmd1 = d > 10 ? d : "0" + d; |
133 | this.policyDetail.nowYmd3 = y; | 135 | this.policyDetail.nowYmd3 = y; |
... | @@ -193,6 +195,7 @@ export default { | ... | @@ -193,6 +195,7 @@ export default { |
193 | this.checkIfShowPolicy(); | 195 | this.checkIfShowPolicy(); |
194 | } | 196 | } |
195 | }, | 197 | }, |
198 | // 下载政策协议 | ||
196 | downloadPolicy() { | 199 | downloadPolicy() { |
197 | if (this.policyDetail) { | 200 | if (this.policyDetail) { |
198 | httpPost({ | 201 | httpPost({ | ... | ... |
-
Please register or sign in to post a comment