|
@@ -5,7 +5,6 @@ import ProjectItem from './item'
|
5
|
5
|
import Banner from './banner'
|
6
|
6
|
import HelpGroupBanner from './swiper'
|
7
|
7
|
// import ActivityItem from '../activity/item'
|
8
|
|
-
|
9
|
8
|
import ready from '@utils/ready'
|
10
|
9
|
import { getLocationCity } from '@services/map'
|
11
|
10
|
|
|
@@ -14,6 +13,7 @@ import { queryNewsList, queryHelpGroup } from '@services/news'
|
14
|
13
|
import { queryActivityList } from '@services/activity'
|
15
|
14
|
import { dispatchCitySelected } from '@actions/city'
|
16
|
15
|
import { ROLE_CODE, DECREASE_UNREADNUM } from '@constants/user'
|
|
16
|
+import { SET_SCREEN_SHOWED } from '@constants/project'
|
17
|
17
|
import { getStore, connect } from '@tarojs/redux'
|
18
|
18
|
import * as actions from '@actions/project'
|
19
|
19
|
import { transferImage } from '@utils/tools'
|
|
@@ -85,6 +85,7 @@ export default class Index extends Component {
|
85
|
85
|
componentDidShow() {
|
86
|
86
|
if (this.props.curCity.id) {
|
87
|
87
|
ready.queue(() => {
|
|
88
|
+ // debugger
|
88
|
89
|
this.loadData()
|
89
|
90
|
})
|
90
|
91
|
}
|
|
@@ -153,6 +154,7 @@ export default class Index extends Component {
|
153
|
154
|
this.loadBannerList()
|
154
|
155
|
this.loadHelpGroupList()
|
155
|
156
|
this.loadNewsList()
|
|
157
|
+ this.loadOpenScreenBanner()
|
156
|
158
|
// this.loadActivityList()
|
157
|
159
|
this.loadList()
|
158
|
160
|
|
|
@@ -163,32 +165,30 @@ export default class Index extends Component {
|
163
|
165
|
const payload = {}
|
164
|
166
|
if (curCity.id) {
|
165
|
167
|
payload.cityId = curCity.id
|
166
|
|
- } else {
|
167
|
|
-
|
168
|
168
|
}
|
|
169
|
+
|
169
|
170
|
// 获取开屏广告图
|
170
|
|
- queryBanners('screen', payload).then(res => {
|
|
171
|
+ this.props.dispatchProjectScreen(payload).then(res => {
|
171
|
172
|
const banner = res[0]
|
172
|
|
- if (banner) {
|
|
173
|
+ debugger
|
|
174
|
+ const maskVisible = this.props.screenShow !== (banner || {}).contentId
|
|
175
|
+
|
|
176
|
+ if (maskVisible) {
|
173
|
177
|
Taro.hideTabBar({
|
174
|
178
|
animation: true
|
175
|
179
|
})
|
176
|
180
|
}
|
|
181
|
+
|
177
|
182
|
this.setState({
|
178
|
|
- maskVisible: banner ? true : false,
|
|
183
|
+ maskVisible,
|
179
|
184
|
maskBanner: banner
|
|
185
|
+ }, () => {
|
|
186
|
+ const { dispatch } = getStore()
|
|
187
|
+ dispatch({ type: SET_SCREEN_SHOWED, payload: (banner || {}).contentId })
|
180
|
188
|
})
|
181
|
189
|
})
|
182
|
190
|
}
|
183
|
|
- componentWillReceiveProps(nextProps) {
|
184
|
|
- console.log(nextProps.curCity, "curCitycurCitycurCitycurCitycurCity")
|
185
|
|
- console.log(this.state.maskBanner, "maskBannermaskBannermaskBannermaskBannermaskBanner")
|
186
|
|
-
|
187
|
|
- if (!this.state.maskBanner && JSON.stringify(nextProps.curCity) != '{}') {
|
188
|
191
|
|
189
|
|
- this.loadOpenScreenBanner()
|
190
|
|
- }
|
191
|
|
- }
|
192
|
192
|
loadBannerList() {
|
193
|
193
|
const { curCity } = this.props
|
194
|
194
|
// 获取首页banner
|