|
@@ -5,10 +5,13 @@ import { ScrollView } from '@tarojs/components'
|
5
|
5
|
import withLayout from '@/layout'
|
6
|
6
|
import ProjectListItem from '@/components/ProjectListItem/index'
|
7
|
7
|
// import ShareToCircle from '@/components/ShareToCircle/index'
|
|
8
|
+import FirstScreen from '@/components/FirstScreen'
|
8
|
9
|
import { fetch } from '@/utils/request'
|
9
|
10
|
import { API_BANNER_LIST, API_INDEX_PROJECTS } from '@/constants/api'
|
10
|
11
|
import useParams from '@/utils/hooks/useParams'
|
11
|
12
|
import useShare from '@/utils/hooks/useShare'
|
|
13
|
+import useScreen from '@/utils/hooks/useScreen'
|
|
14
|
+import nav2Target from '@/utils/nav2Target'
|
12
|
15
|
import ChatIcon from '@/components/ChatIcon/index'
|
13
|
16
|
import Location from './components/Location/index'
|
14
|
17
|
import Banner from './components/Banner/index'
|
|
@@ -21,7 +24,8 @@ import useIndexShareContent from './useIndexShareContent'
|
21
|
24
|
import './index.scss'
|
22
|
25
|
|
23
|
26
|
export default withLayout((props) => {
|
24
|
|
- const { city, router, person, trackData, page } = props
|
|
27
|
+ const { city, router, person, trackData, page, mode } = props
|
|
28
|
+ const isSinglePage = mode === 'singlePage'
|
25
|
29
|
|
26
|
30
|
// 本页面分享或者海报参数
|
27
|
31
|
const paramsRef = useParams({person, from: `${page.type}_share`})
|
|
@@ -31,6 +35,9 @@ export default withLayout((props) => {
|
31
|
35
|
const [ShowHotRecommend, setShowHotRecommend] = useState(false)
|
32
|
36
|
const [ShowLive, setShowLive] = useState(false)
|
33
|
37
|
const shareContent = useIndexShareContent(miniApp, paramsRef, router)
|
|
38
|
+
|
|
39
|
+ // 开屏广告
|
|
40
|
+ const [screenInfo, screenVisible, toggleShowScreen] = useScreen(city.id, person)
|
34
|
41
|
|
35
|
42
|
// 分享
|
36
|
43
|
useShare(shareContent, trackData)
|
|
@@ -54,6 +61,12 @@ export default withLayout((props) => {
|
54
|
61
|
const LiveChange = (e) => {
|
55
|
62
|
setShowLive(e)
|
56
|
63
|
}
|
|
64
|
+
|
|
65
|
+ const handleScreen = () => {
|
|
66
|
+ toggleShowScreen()
|
|
67
|
+ nav2Target(screenInfo)
|
|
68
|
+ }
|
|
69
|
+
|
57
|
70
|
|
58
|
71
|
useEffect(() => {
|
59
|
72
|
if (city?.id) {
|
|
@@ -66,6 +79,14 @@ export default withLayout((props) => {
|
66
|
79
|
return (
|
67
|
80
|
<view className='Page Index'>
|
68
|
81
|
<ChatIcon />
|
|
82
|
+
|
|
83
|
+ {/* 开屏广告 */}
|
|
84
|
+ <FirstScreen
|
|
85
|
+ info={screenInfo}
|
|
86
|
+ visible={screenVisible && !isSinglePage}
|
|
87
|
+ onClick={handleScreen}
|
|
88
|
+ onClose={toggleShowScreen}
|
|
89
|
+ />
|
69
|
90
|
|
70
|
91
|
<ScrollView scroll-y>
|
71
|
92
|
<view className='PageContent'>
|