Commit 706deb86 by zhanghaozhe

Merge branch 'bug' into pre

parents 7e26dc24 5b6a3eca
...@@ -44,6 +44,8 @@ class App extends Component { ...@@ -44,6 +44,8 @@ class App extends Component {
script.language = 'JavaScript'; script.language = 'JavaScript';
document.body.appendChild(script); document.body.appendChild(script);
this.setNavigationRecord(this.props.location)
//平台信息 //平台信息
cookie.set('plat', '5', {domain: '.julyedu.com'}) cookie.set('plat', '5', {domain: '.julyedu.com'})
...@@ -56,8 +58,9 @@ class App extends Component { ...@@ -56,8 +58,9 @@ class App extends Component {
const routeMatchRule = /binding-tel|forgot|set-password/ const routeMatchRule = /binding-tel|forgot|set-password/
const {history} = this.props const {history} = this.props
history.listen(location => { history.listen((location, action) => {
if(cookie.get('uid') && this.props.user.hasError){ this.setNavigationRecord(location)
if (cookie.get('uid') && this.props.user.hasError) {
this.getUser() this.getUser()
} }
const {pathname} = location const {pathname} = location
...@@ -70,9 +73,19 @@ class App extends Component { ...@@ -70,9 +73,19 @@ class App extends Component {
}) })
}
setNavigationRecord = (location) => {
let {location: _location} = this.props
let {state: _state = {}} = _location
let {state = {}} = location
location.state = {
...state, ...{
record: _state.record ?
[..._state.record, {pathname: location.pathname}] :
[{pathname: location.pathname}]
}
}
} }
getUser = () => { getUser = () => {
......
...@@ -9,10 +9,15 @@ class HeaderBar extends Component { ...@@ -9,10 +9,15 @@ class HeaderBar extends Component {
} }
goBack = () => { goBack = () => {
const {state} = this.props.location
if(browser.isWeixin && getParam('code') && getParam('state')){ if(browser.isWeixin && getParam('code') && getParam('state')){
window.history.go(-2) window.history.go(-2)
} }
if(state.record && state.record.length > 1){
window.history.go(-1); window.history.go(-1);
}else{
window.location.href = window.location.origin
}
} }
toLink = () => { toLink = () => {
......
.search-result { .search-result {
padding-top: 44px; padding-top: 44px;
/*&.fixed-header{
padding-top: 44px;
.search-head{
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 10;
}
}
&.static-header{
padding-top: 0;
.search-head{
position: static;
}
}*/
.search-head{ .search-head{
position: absolute; position: absolute;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment