Commit 4ab8124c by wangshuo

精品特惠 赚奖学金 tab替换

parent c047e3d2
......@@ -43,7 +43,8 @@ class Preferential extends Component {
http.get(`${API.home}/m/home/bargainZone`).then((res) => {
if (res.data.code === 200) {
this.setState({
dataList: res.data.data
dataList: res.data.data,
isLoading: false,
})
} else {
Toast.info(res.data.msg, 2)
......@@ -55,7 +56,8 @@ class Preferential extends Component {
http.get(`${API.home}/m/home/grouponList`).then((res) => {
if (res.data.code === 200) {
this.setState({
dataList: res.data.data
dataList: res.data.data,
isLoading: false,
})
} else {
Toast.info(res.data.msg, 2)
......@@ -64,7 +66,10 @@ class Preferential extends Component {
}
// tab 切换
ontabclick = (tab, index) => {
this.state.courseStatus = index
this.setState({
courseStatus: index,
isLoading: true,
})
switch (index) {
case 0:
this.specialSale()
......@@ -104,10 +109,12 @@ class Preferential extends Component {
animated={false}
onChange={(tab, index) => this.ontabclick(tab, index)}
swipeable={false}
page={this.state.courseStatus}
renderTabBar={props => <div className={'custom-tab-bar'}>
<Tabs.DefaultTabBar {...props}/>
</div>}
>
</Tabs>
<div className='tabs'>
<ul>
{this.state.dataList.map((item, index) => {
......@@ -163,7 +170,6 @@ class Preferential extends Component {
</ul>
</div>
</Tabs>
<WhiteSpace/>
</div>
</Loading>
......
......@@ -31,6 +31,7 @@ class _Scholarship extends Component {
isLoading: false,
showNoData: false,
hasMore: true,
tab: 0,
}
this.downImage = React.createRef();
this.tabIndex = 0;
......@@ -307,6 +308,7 @@ class _Scholarship extends Component {
isLoading: false,
hasMore: true,
dataSource: this.state.dataSource.cloneWithRows(this.rData),
tab: index,
},
() => {
this.onEndReached();
......@@ -314,6 +316,9 @@ class _Scholarship extends Component {
);
}}
>
</Tabs>
{
this.state.tab === 0 ? (
<div style={{ marginTop: '15px', backgroundColor: '#FFF' }}>
{
this.state.dataSource._cachedRowCount !== 0 ? (
......@@ -332,6 +337,11 @@ class _Scholarship extends Component {
}
</div>
) : null
}
{
this.state.tab === 1 ? (
<div>
<Flex justify='center' align='center' className={'runtimeList'}>榜单实时更新,仅显示前50</Flex>
{
......@@ -350,7 +360,8 @@ class _Scholarship extends Component {
)
}
</div>
</Tabs>
) : null
}
</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