Commit 104df056 by zhanghaozhe

周年庆

parent 979ed9ac
import React, {Component} from 'react' import React, { Component } from 'react'
import {VList} from '../../common' import { VList } from '../../common'
import {Tabs, WhiteSpace, Toast} from 'antd-mobile' import { Tabs, WhiteSpace, Toast } from 'antd-mobile'
import './index.scss' import './index.scss'
import HeaderSearch from '../../common/HeaderSearch/index' import HeaderSearch from '../../common/HeaderSearch/index'
import {http} from "@/utils" import { http } from "@/utils"
import Loading from '@/common/Loading' import Loading from '@/common/Loading'
import {connect} from 'react-redux'; import { connect } from 'react-redux';
@connect(({user}) => ({ @connect(({user}) => ({
user user,
})) }))
class Preferential extends Component { class Preferential extends Component {
constructor(props) { constructor(props) {
...@@ -16,7 +16,7 @@ class Preferential extends Component { ...@@ -16,7 +16,7 @@ class Preferential extends Component {
this.state = { this.state = {
dataList: [], dataList: [],
courseStatus: 0, courseStatus: 0,
isLoading: true isLoading: true,
} }
} }
...@@ -30,7 +30,7 @@ class Preferential extends Component { ...@@ -30,7 +30,7 @@ class Preferential extends Component {
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ this.setState({
dataList: res.data.data, dataList: res.data.data,
isLoading: false isLoading: false,
}) })
} else { } else {
Toast.info(res.data.msg, 2) Toast.info(res.data.msg, 2)
...@@ -43,7 +43,7 @@ class Preferential extends Component { ...@@ -43,7 +43,7 @@ class Preferential extends Component {
http.get(`${API.home}/m/home/bargainZone`).then((res) => { http.get(`${API.home}/m/home/bargainZone`).then((res) => {
if (res.data.code === 200) { if (res.data.code === 200) {
this.setState({ this.setState({
dataList: JSON.stringify(res.data.data) == '{}' ? []:res.data.data, dataList: JSON.stringify(res.data.data) == '{}' ? [] : res.data.data,
isLoading: false, isLoading: false,
}) })
} else { } else {
...@@ -93,7 +93,7 @@ class Preferential extends Component { ...@@ -93,7 +93,7 @@ class Preferential extends Component {
const tabs = [ const tabs = [
{title: '限时特惠'}, {title: '限时特惠'},
{title: '砍价专区'}, {title: '砍价专区'},
{title: '一键拼团'} {title: '一键拼团'},
] ]
const {user = {}} = this.props; const {user = {}} = this.props;
let isLogin = user.data && user.data.uid ? true : false; let isLogin = user.data && user.data.uid ? true : false;
...@@ -117,7 +117,7 @@ class Preferential extends Component { ...@@ -117,7 +117,7 @@ class Preferential extends Component {
</Tabs> </Tabs>
<div className='tabs'> <div className='tabs'>
{ {
this.state.dataList.length>0? this.state.dataList.length > 0 ?
<ul> <ul>
{this.state.dataList.map((item, index) => { {this.state.dataList.map((item, index) => {
const Info = ( const Info = (
...@@ -170,7 +170,7 @@ class Preferential extends Component { ...@@ -170,7 +170,7 @@ class Preferential extends Component {
/> />
) )
})} })}
</ul>:<div className={'notdata'}>砍价的课程已被设置为双十一活动课程,参加双十一活动购买课程优惠更多哦!</div> </ul> : <div className={'notdata'}>特惠课程都去参加活动了,可以去活动页看看哦~</div>
} }
</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