|
|
|
@ -5,8 +5,8 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import Setting from '@/setting'; |
|
|
|
|
import util from '@/libs/util'; |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import util from '@/libs/util' |
|
|
|
|
export default { |
|
|
|
|
name: 'App', |
|
|
|
|
created () { |
|
|
|
@ -32,55 +32,23 @@ export default { |
|
|
|
|
} |
|
|
|
|
return flagPc; |
|
|
|
|
} |
|
|
|
|
var flagZt = IsPCModel(); |
|
|
|
|
var flagZt = IsPCModel() |
|
|
|
|
this.$store.commit('updateModelType', flagZt) |
|
|
|
|
window.onresize = this.throttle(() => { |
|
|
|
|
if (document.body.clientWidth <= 1200) { |
|
|
|
|
const w = document.body.clientWidth |
|
|
|
|
if (w <= 680) { |
|
|
|
|
// w <= 480 && this.$store.commit('set', true) |
|
|
|
|
this.$store.commit('updateModelType', false) |
|
|
|
|
} else if (document.body.clientWidth > 1700) { |
|
|
|
|
this.$store.commit('updateModelType', true) |
|
|
|
|
this.$store.dispatch('updateNavSumA', 10) |
|
|
|
|
sessionStorage.setItem('navPageSize', 10) |
|
|
|
|
} else if (document.body.clientWidth > 1600 && document.body.clientWidth <= 1700) { |
|
|
|
|
this.$store.commit('updateModelType', true) |
|
|
|
|
if (this.$i18n.locale == 'en') { |
|
|
|
|
this.$store.dispatch('updateNavSumA', 9) |
|
|
|
|
sessionStorage.setItem('navPageSize', 9) |
|
|
|
|
} else { |
|
|
|
|
this.$store.dispatch('updateNavSumA', 10) |
|
|
|
|
sessionStorage.setItem('navPageSize', 10) |
|
|
|
|
} |
|
|
|
|
} else if (document.body.clientWidth > 1500 && document.body.clientWidth <= 1600) { |
|
|
|
|
this.$store.commit('updateModelType', true) |
|
|
|
|
this.$store.dispatch('updateNavSumA', 9) |
|
|
|
|
sessionStorage.setItem('navPageSize', 9) |
|
|
|
|
} else if (document.body.clientWidth > 1400 && document.body.clientWidth <= 1500) { |
|
|
|
|
this.$store.commit('updateModelType', true) |
|
|
|
|
if (this.$i18n.locale == 'en') { |
|
|
|
|
this.$store.dispatch('updateNavSumA', 7) |
|
|
|
|
sessionStorage.setItem('navPageSize', 7) |
|
|
|
|
} else { |
|
|
|
|
this.$store.dispatch('updateNavSumA', 8) |
|
|
|
|
sessionStorage.setItem('navPageSize', 8) |
|
|
|
|
} |
|
|
|
|
} else if (document.body.clientWidth > 1300 && document.body.clientWidth <= 1400) { |
|
|
|
|
this.$store.commit('updateModelType', true) |
|
|
|
|
if (this.$i18n.locale == 'en') { |
|
|
|
|
this.$store.dispatch('updateNavSumA', 6) |
|
|
|
|
sessionStorage.setItem('navPageSize', 6) |
|
|
|
|
} else { |
|
|
|
|
this.$store.dispatch('updateNavSumA', 7) |
|
|
|
|
sessionStorage.setItem('navPageSize', 7) |
|
|
|
|
} |
|
|
|
|
} else if (document.body.clientWidth > 1200 && document.body.clientWidth <= 1300) { |
|
|
|
|
this.$store.commit('updateModelType', true) |
|
|
|
|
if (this.$i18n.locale == 'en') { |
|
|
|
|
this.$store.dispatch('updateNavSumA', 6) |
|
|
|
|
sessionStorage.setItem('navPageSize', 6) |
|
|
|
|
} else { |
|
|
|
|
this.$store.dispatch('updateNavSumA', 6) |
|
|
|
|
sessionStorage.setItem('navPageSize', 6) |
|
|
|
|
} |
|
|
|
|
} else if (w > 1700) { |
|
|
|
|
this.setNav(10) |
|
|
|
|
} else if (w > 1600) { |
|
|
|
|
this.setNav(9) |
|
|
|
|
} else if (w > 1400) { |
|
|
|
|
this.setNav(8) |
|
|
|
|
} else if (w > 1200) { |
|
|
|
|
this.setNav(6) |
|
|
|
|
} else if (w > 980) { |
|
|
|
|
this.setNav(4) |
|
|
|
|
} else { |
|
|
|
|
this.$store.commit('updateModelType', true) |
|
|
|
|
} |
|
|
|
@ -90,15 +58,14 @@ export default { |
|
|
|
|
window.onbeforeunload = function () { |
|
|
|
|
sessionStorage.removeItem('navPageSize') |
|
|
|
|
} |
|
|
|
|
if (document.body.clientWidth > 1600) { |
|
|
|
|
const w = document.body.clientWidth |
|
|
|
|
if (w > 1700) { |
|
|
|
|
sessionStorage.setItem('navPageSize', 10) |
|
|
|
|
} else if (document.body.clientWidth > 1500 && document.body.clientWidth <= 1600) { |
|
|
|
|
} else if (w > 1600) { |
|
|
|
|
sessionStorage.setItem('navPageSize', 9) |
|
|
|
|
} else if (document.body.clientWidth > 1400 && document.body.clientWidth <= 1500) { |
|
|
|
|
} else if (w > 1400) { |
|
|
|
|
sessionStorage.setItem('navPageSize', 8) |
|
|
|
|
} else if (document.body.clientWidth > 1300 && document.body.clientWidth <= 1400) { |
|
|
|
|
sessionStorage.setItem('navPageSize', 7) |
|
|
|
|
} else if (document.body.clientWidth > 1200 && document.body.clientWidth <= 1300) { |
|
|
|
|
} else if (w > 1200) { |
|
|
|
|
sessionStorage.setItem('navPageSize', 6) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
@ -114,7 +81,12 @@ export default { |
|
|
|
|
prev = Date.now(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
setNav(num) { |
|
|
|
|
this.$store.commit('updateModelType', true) |
|
|
|
|
this.$store.dispatch('updateNavSumA', num) |
|
|
|
|
sessionStorage.setItem('navPageSize', num) |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|