Commit 327b500d by FE

未登陆时,课程详情页提示未登陆问题修改,改变判断方式

parent 410540a6
...@@ -30,7 +30,7 @@ class Bargain extends Component { ...@@ -30,7 +30,7 @@ class Bargain extends Component {
componentDidMount() { componentDidMount() {
const { user= {} } = this.props; const { user= {} } = this.props;
if(user.code === 200) { if(user.data && user.data.uid) {
this.getBargainInfo(); this.getBargainInfo();
} }
} }
...@@ -183,7 +183,6 @@ class Bargain extends Component { ...@@ -183,7 +183,6 @@ class Bargain extends Component {
} }
render() { render() {
console.log(this.state);
const { list, outList, barInfo } = this.state; const { list, outList, barInfo } = this.state;
const {user} = this.props const {user} = this.props
const uid = user && user.data && user.data.uid const uid = user && user.data && user.data.uid
......
...@@ -40,7 +40,7 @@ class BtnStatus extends Component { ...@@ -40,7 +40,7 @@ class BtnStatus extends Component {
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
const { data = {}, user = {}} = nextProps; const { data = {}, user = {}} = nextProps;
if(data.is_bargain && user.code !== 4030) { if(data.is_bargain && user.data && user.data.uid) {
this.getBargainInfo(); this.getBargainInfo();
} }
// if(nextProps.data && nextProps.data.is_bargain) { // if(nextProps.data && nextProps.data.is_bargain) {
...@@ -234,12 +234,10 @@ class BtnStatus extends Component { ...@@ -234,12 +234,10 @@ class BtnStatus extends Component {
} }
render() { render() {
console.log(this.state);
// data 课程信息;barInfo 砍价信息 // data 课程信息;barInfo 砍价信息
const { user = {}, toCart } = this.props; const { user = {}, toCart } = this.props;
const { countdown ,barInfo, courseInfo: info = {}} = this.state; const { countdown ,barInfo, courseInfo: info = {}} = this.state;
const uid = user.data && user.data.uid; const uid = user.data && user.data.uid;
console.log(info.in_cart);
return ( return (
<div> <div>
{/*正常购买*/} {/*正常购买*/}
......
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