Commit 327b500d by FE

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

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