|
|
@@ -21,7 +21,14 @@ function JumpRouter(url, name) {
|
|
|
if (path.indexOf(window.location.host) !== -1) {
|
|
|
path = path.substring(path.indexOf(window.location.host) + window.location.host.length)
|
|
|
}
|
|
|
- let title = name ? name : document.title;
|
|
|
+ let titles = document.getElementsByClassName("goods-show-title")
|
|
|
+ let text = ""
|
|
|
+ if (titles.length === 0) {
|
|
|
+ text = document.title
|
|
|
+ } else {
|
|
|
+ text = document.getElementsByClassName("goods-show-title")[0].textContent
|
|
|
+ }
|
|
|
+ let title = name ? name : text;
|
|
|
if (path === '' || path === "/") {
|
|
|
sessionStorage.setItem(RouterLinkName, JSON.stringify([]))
|
|
|
}
|
|
|
@@ -80,7 +87,7 @@ function RouterBarCreate() {
|
|
|
|
|
|
if (routerLink) {
|
|
|
for (let i = 0; i < routerLink.length; i++) {
|
|
|
- if (routerLink[i].url==="/"){
|
|
|
+ if (routerLink[i].url === "/") {
|
|
|
continue
|
|
|
}
|
|
|
let liEle = document.createElement("li");
|
|
|
@@ -98,7 +105,8 @@ function RouterBarCreate() {
|
|
|
}
|
|
|
|
|
|
let nowEle = document.createElement("li")
|
|
|
- nowEle.innerText = document.title
|
|
|
+ let text = document.getElementsByClassName("goods-show-title")[0].textContent
|
|
|
+ nowEle.innerText = text.trim()
|
|
|
nowEle.className = "router-bar-text"
|
|
|
ulEle.appendChild(nowEle)
|
|
|
}
|