|
@@ -18,6 +18,7 @@ export default withLayout((props) => {
|
18
|
18
|
{ name: '新房推荐', id: 'new' },
|
19
|
19
|
{ name: '视频', id: 'video' }
|
20
|
20
|
])
|
|
21
|
+ const [PageList, setPageList] = useState([])
|
21
|
22
|
// 全部或者新房的列表
|
22
|
23
|
const [activityList, setActivityList] = useState([])
|
23
|
24
|
// 预告与直播的列表
|
|
@@ -36,18 +37,18 @@ export default withLayout((props) => {
|
36
|
37
|
if (['all', 'new'].indexOf(CurrnetMenuId) > -1) {
|
37
|
38
|
// 全部与新房用的一个接口
|
38
|
39
|
fetch({ url: API_LIVE_LIST, payload: { ...params, cityId: city.id }, spin: true }).then((res) => {
|
39
|
|
- setActivityList(res.records || [])
|
|
40
|
+ setPageList(res.records || [])
|
40
|
41
|
})
|
41
|
42
|
} else if (['notice', 'live'].indexOf(CurrnetMenuId) > -1) {
|
42
|
43
|
// 预告与直播是虽然是同一个接口, 但是返回值字段不一样
|
43
|
44
|
const process = 'notice' === CurrnetMenuId ? 1 : 2;
|
44
|
45
|
fetch({ url: API_LIVE_LIST, payload: { ...params, cityId: city.id, process }, spin: true}).then((res) => {
|
45
|
|
- setLiveList(res.records || [])
|
|
46
|
+ setPageList(res.records || [])
|
46
|
47
|
})
|
47
|
48
|
} else {
|
48
|
49
|
// 视频另外一个接口
|
49
|
50
|
fetch({ url: API_VIDEO_LIST, payload: { ...params, cityId: city.id }, spin: true }).then((res) => {
|
50
|
|
- setVideoList(res.records || [])
|
|
51
|
+ setPageList(res.records || [])
|
51
|
52
|
})
|
52
|
53
|
}
|
53
|
54
|
}
|
|
@@ -87,32 +88,7 @@ export default withLayout((props) => {
|
87
|
88
|
<ScrollView scroll-y>
|
88
|
89
|
<view className='PageContent'>
|
89
|
90
|
{
|
90
|
|
- /* 全部 与 新房 */
|
91
|
|
- ['all', 'new'].indexOf(CurrnetMenuId) > -1 && activityList.map((item, index) => (
|
92
|
|
- <view className='ListItem' key={`List-${index}`}>
|
93
|
|
- <view>
|
94
|
|
- <view>
|
95
|
|
- <VideoListItem Data={item}></VideoListItem>
|
96
|
|
- </view>
|
97
|
|
- </view>
|
98
|
|
- </view>
|
99
|
|
- ))
|
100
|
|
- }
|
101
|
|
- {
|
102
|
|
- /* 预告 与 直播 */
|
103
|
|
- ['notice', 'live'].indexOf(CurrnetMenuId) > -1 && activityList.map((item, index) => (
|
104
|
|
- <view className='ListItem' key={`List-${index}`}>
|
105
|
|
- <view>
|
106
|
|
- <view>
|
107
|
|
- <VideoListItem Data={item}></VideoListItem>
|
108
|
|
- </view>
|
109
|
|
- </view>
|
110
|
|
- </view>
|
111
|
|
- ))
|
112
|
|
- }
|
113
|
|
- {
|
114
|
|
- /* 视频 */
|
115
|
|
- 'video' === CurrnetMenuId && activityList.map((item, index) => (
|
|
91
|
+ PageList.map((item, index) => (
|
116
|
92
|
<view className='ListItem' key={`List-${index}`}>
|
117
|
93
|
<view>
|
118
|
94
|
<view>
|