Commit cc3fd630 by FE

build conflict

parents 4e879b33 ef91ba3d
...@@ -5,7 +5,7 @@ import { connect } from "react-redux"; ...@@ -5,7 +5,7 @@ import { connect } from "react-redux";
import { setCurrentUser, startFetchUser } from "@/store/userAction"; import { setCurrentUser, startFetchUser } from "@/store/userAction";
import { withRouter } from 'react-router-dom' import { withRouter } from 'react-router-dom'
import { compose } from 'redux' import { compose } from 'redux'
import { getParam, http } from "@/utils"; import { getParam, http, browser } from "@/utils";
import { Toast } from "antd-mobile"; import { Toast } from "antd-mobile";
import { addDays } from 'date-fns' import { addDays } from 'date-fns'
...@@ -41,6 +41,10 @@ class App extends Component { ...@@ -41,6 +41,10 @@ class App extends Component {
//平台信息 //平台信息
cookie.set('plat', '5', {domain: '.julyedu.com'}) cookie.set('plat', '5', {domain: '.julyedu.com'})
if (browser.isWeixin && browser.isIOS) {
sessionStorage.setItem('enter_url', window.location.href)
}
this.props.startFetchUser() this.props.startFetchUser()
http.get(`${API.home}/m/user_info`).then(res => { http.get(`${API.home}/m/user_info`).then(res => {
this.props.setCurrentUser(this.transformUser(res)) this.props.setCurrentUser(this.transformUser(res))
...@@ -51,7 +55,7 @@ class App extends Component { ...@@ -51,7 +55,7 @@ class App extends Component {
history.listen(location => { history.listen(location => {
const {pathname} = location const {pathname} = location
if (pathname.startsWith('/passport')) { if (pathname.startsWith('/passport')) {
if(routeMatchRule.test(pathname)){ if (routeMatchRule.test(pathname)) {
return return
} }
location.state = {from: this.previousLocation}; location.state = {from: this.previousLocation};
......
...@@ -46,12 +46,14 @@ class Detail extends Component { ...@@ -46,12 +46,14 @@ class Detail extends Component {
} }
componentDidMount() { componentDidMount() {
if(browser.isWeixin){
wxShare({ wxShare({
title: `课程详情页`, title: `课程详情页`,
desc: `课程详情页`, desc: `课程详情页`,
link: encodeURI(location.origin + '/detail?id=' + getParam('id')), link: location.href,
imgUrl: '' imgUrl: `${location.origin}/favicon.ico`
}); })
}
this.fetchCourseInfo(); this.fetchCourseInfo();
const { location: { state = {} } } = this.props; const { location: { state = {} } } = this.props;
...@@ -472,7 +474,6 @@ class Detail extends Component { ...@@ -472,7 +474,6 @@ class Detail extends Component {
title='课程详情' title='课程详情'
arrow={true} arrow={true}
cart={true} cart={true}
toHref={href}
/> />
<CallApp className='toapp' /> <CallApp className='toapp' />
......
...@@ -35,6 +35,7 @@ class CampResolve extends Component { ...@@ -35,6 +35,7 @@ class CampResolve extends Component {
this.body = document.getElementsByTagName('body')[0]; this.body = document.getElementsByTagName('body')[0];
this.body.style.position = 'static'; this.body.style.position = 'static';
} else { } else {
<<<<<<< HEAD
const { history, location: { state={} } } = this.props; const { history, location: { state={} } } = this.props;
let to = ''; let to = '';
if(state.from && state.from.indexOf('video') !== -1) { if(state.from && state.from.indexOf('video') !== -1) {
...@@ -50,6 +51,9 @@ class CampResolve extends Component { ...@@ -50,6 +51,9 @@ class CampResolve extends Component {
to to
} }
); );
=======
this.props.history.push(`${this.props.location.state.from}`,{href: '/purchased'})
>>>>>>> ef91ba3d8a0a94933546e5e626e4683a35469b0d
} }
}; };
componentDidMount() { componentDidMount() {
......
...@@ -71,6 +71,7 @@ class CampTest extends Component { ...@@ -71,6 +71,7 @@ class CampTest extends Component {
this.body = document.getElementsByTagName('body')[0]; this.body = document.getElementsByTagName('body')[0];
this.body.style.position = 'static'; this.body.style.position = 'static';
} else { } else {
<<<<<<< HEAD
const { history, location: { state={} } } = this.props; const { history, location: { state={} } } = this.props;
let to = ''; let to = '';
if(state.from && state.from.indexOf('video') !== -1) { if(state.from && state.from.indexOf('video') !== -1) {
...@@ -86,6 +87,9 @@ class CampTest extends Component { ...@@ -86,6 +87,9 @@ class CampTest extends Component {
to to
} }
); );
=======
this.props.history.push(`${this.props.location.state.from}`,{href: '/classify'})
>>>>>>> ef91ba3d8a0a94933546e5e626e4683a35469b0d
} }
}; };
// 选择答案 // 选择答案
......
...@@ -35,6 +35,7 @@ class VideoCatalog extends Component { ...@@ -35,6 +35,7 @@ class VideoCatalog extends Component {
</div> </div>
{ {
(item.practice && item.practice.qid) (item.practice && item.practice.qid)
<<<<<<< HEAD
? <Link ? <Link
to={{ to={{
pathname: item.practice.is_tested ? '/campResolve' : '/campTest', pathname: item.practice.is_tested ? '/campResolve' : '/campTest',
...@@ -44,6 +45,13 @@ class VideoCatalog extends Component { ...@@ -44,6 +45,13 @@ class VideoCatalog extends Component {
} }
}} }}
> >
=======
? <Link to={{
pathname: item.practice.is_tested ? '/campResolve' : '/campTest',
search: `?keshi_id=${item.id}&qid=${item.practice.qid}`,
state: {from: `/play/video${window.location.search}`}
}}>
>>>>>>> ef91ba3d8a0a94933546e5e626e4683a35469b0d
<div className="exercise"> <div className="exercise">
课后练习:{item.practice.title} 课后练习:{item.practice.title}
<i className={classnames('iconfont',!item.video_auth ? 'iconiconfront-74' : item.practice.is_tested ? 'iconiconfront-3' : '')}/> <i className={classnames('iconfont',!item.video_auth ? 'iconiconfront-74' : item.practice.is_tested ? 'iconiconfront-3' : '')}/>
......
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