|
|
@ -181,126 +181,128 @@ export const totalPageAni = async (activeIndex, previousIndex) => { |
|
|
|
} |
|
|
|
|
|
|
|
export const addAnchor = activeIndex => { |
|
|
|
const search = location.search |
|
|
|
if (activeIndex == 0) { |
|
|
|
var url = location.pathname + '#home' |
|
|
|
var url = search + '#home' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 1) { |
|
|
|
var url = location.pathname + '#service' |
|
|
|
var url = search + '#service' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 2) { |
|
|
|
var url = location.pathname + '#cooperation' |
|
|
|
var url = search + '#cooperation' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 3) { |
|
|
|
var url = location.pathname + '#caselist' |
|
|
|
var url = search + '#caselist' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 4) { |
|
|
|
var url = location.pathname + '#casedetail' |
|
|
|
var url = search + '#casedetail' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 5) { |
|
|
|
var url = location.pathname + '#hardware' |
|
|
|
var url = search + '#hardware' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 6) { |
|
|
|
var url = location.pathname + '#harddetail' |
|
|
|
var url = search + '#harddetail' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 7) { |
|
|
|
var url = location.pathname + '#experience' |
|
|
|
var url = search + '#experience' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 8) { |
|
|
|
var url = location.pathname + '#hardwareshow' |
|
|
|
var url = search + '#hardwareshow' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 9) { |
|
|
|
var url = location.pathname + '#webofthing' |
|
|
|
var url = search + '#webofthing' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 10) { |
|
|
|
var url = location.pathname + '#control' |
|
|
|
var url = search + '#control' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 11) { |
|
|
|
var url = location.pathname + '#drive' |
|
|
|
var url = search + '#drive' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 12) { |
|
|
|
var url = location.pathname + '#readwidely' |
|
|
|
var url = search + '#readwidely' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 13) { |
|
|
|
var url = location.pathname + '#culture' |
|
|
|
var url = search + '#culture' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 14) { |
|
|
|
var url = location.pathname + '#recruit' |
|
|
|
var url = search + '#recruit' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 15) { |
|
|
|
var url = location.pathname + '#video' |
|
|
|
var url = search + '#video' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
if (activeIndex == 16) { |
|
|
|
var url = location.pathname + '#contact' |
|
|
|
var url = search + '#contact' |
|
|
|
history.pushState({ url: url, title: document.title }, document.title, url) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
export const toAnchor = url => { |
|
|
|
if (url == '/#home') { |
|
|
|
const search = location.search |
|
|
|
if (url == search + '#home') { |
|
|
|
return 0 |
|
|
|
} |
|
|
|
if (url == '/#service') { |
|
|
|
if (url == search + '#service') { |
|
|
|
return 1 |
|
|
|
} |
|
|
|
if (url == '/#cooperation') { |
|
|
|
if (url == search + '#cooperation') { |
|
|
|
return 2 |
|
|
|
} |
|
|
|
if (url == '/#caselist') { |
|
|
|
if (url == search + '#caselist') { |
|
|
|
return 3 |
|
|
|
} |
|
|
|
if (url == '/#casedetail') { |
|
|
|
if (url == search + '#casedetail') { |
|
|
|
return 4 |
|
|
|
} |
|
|
|
if (url == '/#hardware') { |
|
|
|
if (url == search + '#hardware') { |
|
|
|
return 5 |
|
|
|
} |
|
|
|
if (url == '/#harddetail') { |
|
|
|
if (url == search + '#harddetail') { |
|
|
|
return 6 |
|
|
|
} |
|
|
|
if (url == '/#experience') { |
|
|
|
if (url == search + '#experience') { |
|
|
|
return 7 |
|
|
|
} |
|
|
|
if (url == '/#hardwareshow') { |
|
|
|
if (url == search + '#hardwareshow') { |
|
|
|
return 8 |
|
|
|
} |
|
|
|
if (url == '/#webofthing') { |
|
|
|
if (url == search + '#webofthing') { |
|
|
|
return 9 |
|
|
|
} |
|
|
|
if (url == '/#control') { |
|
|
|
if (url == search + '#control') { |
|
|
|
return 10 |
|
|
|
} |
|
|
|
if (url == '/#drive') { |
|
|
|
if (url == search + '#drive') { |
|
|
|
return 11 |
|
|
|
} |
|
|
|
if (url == '/#readwidely') { |
|
|
|
if (url == search + '#readwidely') { |
|
|
|
return 12 |
|
|
|
} |
|
|
|
if (url == '/#culture') { |
|
|
|
if (url == search + '#culture') { |
|
|
|
return 13 |
|
|
|
} |
|
|
|
if (url == '/#recruit') { |
|
|
|
if (url == search + '#recruit') { |
|
|
|
return 14 |
|
|
|
} |
|
|
|
if (url == '/#video') { |
|
|
|
if (url == search + '#video') { |
|
|
|
return 15 |
|
|
|
} |
|
|
|
if (url == '/#contact') { |
|
|
|
if (url == search + '#contact') { |
|
|
|
return 16 |
|
|
|
} |
|
|
|
} |