Browse Source

静态页面

1002884655 3 years ago
parent
commit
1c417a3ee4

+ 4
- 4
config/prod.js View File

3
     NODE_ENV: '"production"'
3
     NODE_ENV: '"production"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"https://xlj.newlandsh.com"', //正式
7
-    WSS_HOST: '"wss://xlj.newlandsh.com"',
8
-    // HOST: '"https://xlk.njyz.tech"', //正式
9
-    // WSS_HOST: '"wss://xlk.njyz.tech"',
6
+    // HOST: '"https://xlj.newlandsh.com"', //正式
7
+    // WSS_HOST: '"wss://xlj.newlandsh.com"',
8
+    HOST: '"https://xlk.njyz.tech"', //正式
9
+    WSS_HOST: '"wss://xlk.njyz.tech"',
10
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
10
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
11
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
11
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
12
     ICON_FONT: '"https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/css/iconfont.ttf"',
12
     ICON_FONT: '"https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/css/iconfont.ttf"',

+ 2
- 6
src/components/FirstScreen/index.jsx View File

4
 import './style.scss'
4
 import './style.scss'
5
 
5
 
6
 export default (props) => {
6
 export default (props) => {
7
-  const { info, visible = false, onClose } = props
8
-
9
-  const ImgClick = () => {
10
-
11
-  }
7
+  const { info, visible = false, onClose, onClick } = props
12
 
8
 
13
   return (
9
   return (
14
     <view className='components Adv' style={{display: visible ? 'block' : 'none'}}>
10
     <view className='components Adv' style={{display: visible ? 'block' : 'none'}}>
15
       <view className='centerLabel'>
11
       <view className='centerLabel'>
16
         <view>
12
         <view>
17
-          <view className='Img' onClick={ImgClick}>
13
+          <view className='Img' onClick={onClick}>
18
             <Image mode='scaleToFill' src={getImgURL(info?.image)}></Image>
14
             <Image mode='scaleToFill' src={getImgURL(info?.image)}></Image>
19
           </view>
15
           </view>
20
           <text className='iconfont icon-guanbi' onClick={onClose}></text>
16
           <text className='iconfont icon-guanbi' onClick={onClose}></text>

+ 3
- 0
src/components/FirstScreen/style.scss View File

23
         >image {
23
         >image {
24
           width: 100%;
24
           width: 100%;
25
           height: 100%;
25
           height: 100%;
26
+          position: absolute;
27
+          left: 0;
28
+          top: 0;
26
         }
29
         }
27
       }
30
       }
28
       >text {
31
       >text {

+ 12
- 1
src/layout/index.js View File

10
 import FixedConsultant from '@/components/FixedConsultant'
10
 import FixedConsultant from '@/components/FixedConsultant'
11
 import FirstScreen from '@/components/FirstScreen'
11
 import FirstScreen from '@/components/FirstScreen'
12
 import { report as reportCustomer } from '@/utils/customer'
12
 import { report as reportCustomer } from '@/utils/customer'
13
+import nav2Target from '@/utils/nav2Target'
13
 import { ROLE_CODE } from '@/constants/user'
14
 import { ROLE_CODE } from '@/constants/user'
14
 import useAuth from './useAuth'
15
 import useAuth from './useAuth'
15
 import useScreen from './useScreen'
16
 import useScreen from './useScreen'
37
   // 开屏广告
38
   // 开屏广告
38
   const [screenInfo, screenVisible, toggleShowScreen] = useScreen(city.id, person)
39
   const [screenInfo, screenVisible, toggleShowScreen] = useScreen(city.id, person)
39
 
40
 
41
+  const handleScreen = () => {
42
+    toggleShowScreen()
43
+    nav2Target(screenInfo)
44
+  }
45
+
40
   // 报备客户
46
   // 报备客户
41
   useEffect(() => {
47
   useEffect(() => {
42
     reportCustomer(person, consultant, false).catch(() => {})
48
     reportCustomer(person, consultant, false).catch(() => {})
106
       {
112
       {
107
         !!showConsultant && (<FixedConsultant consultant={consultant} />)
113
         !!showConsultant && (<FixedConsultant consultant={consultant} />)
108
       }
114
       }
109
-      <FirstScreen info={screenInfo} visible={screenVisible} onClose={toggleShowScreen} />
115
+      <FirstScreen
116
+        info={screenInfo}
117
+        visible={screenVisible}
118
+        onClick={handleScreen}
119
+        onClose={toggleShowScreen}
120
+      />
110
     </>
121
     </>
111
   )
122
   )
112
 }
123
 }

+ 2
- 1
src/pages/index/components/Banner/index.jsx View File

2
 import { Swiper, SwiperItem, Image } from '@tarojs/components'
2
 import { Swiper, SwiperItem, Image } from '@tarojs/components'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
 import { getImgURL } from '@/utils/image'
4
 import { getImgURL } from '@/utils/image'
5
+import nav2Target from '@/utils/nav2Target'
5
 import './index.scss'
6
 import './index.scss'
6
 
7
 
7
 export default function Banner (props) {
8
 export default function Banner (props) {
48
 
49
 
49
   const handleBannerClick = (item) => {
50
   const handleBannerClick = (item) => {
50
     if (item.contentType && item.contentType != "nothing") {
51
     if (item.contentType && item.contentType != "nothing") {
51
-      redirectTo(item)
52
+      nav2Target(item)
52
     } 
53
     } 
53
   }
54
   }
54
   return (
55
   return (

+ 1
- 3
src/pages/index/components/HotRecommend/index.jsx View File

40
       setCurrentId(id)
40
       setCurrentId(id)
41
     }
41
     }
42
   }
42
   }
43
-  // x?type=dymic' },
44
-  //     { name: '团房信息', id: 8, icon: require('../../../../assets/index-icon12.png'), router: '/pages/index/activityList/index?type=house'
45
   const ToMore = () => {
43
   const ToMore = () => {
46
     Taro.navigateTo({ url: `/pages/index/activityList/index?type=${CurrentId}` })
44
     Taro.navigateTo({ url: `/pages/index/activityList/index?type=${CurrentId}` })
47
   }
45
   }
51
       Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${CurrentContentInfo.dynamicId}` })
49
       Taro.navigateTo({ url: `/pages/index/activityDetail/index?id=${CurrentContentInfo.dynamicId}` })
52
     }
50
     }
53
   }
51
   }
54
-  // url: `/pages/index/activityDetail/index?id=${data.dynamicId}`
52
+
55
   return (
53
   return (
56
     <view className='components HotRecommend'>
54
     <view className='components HotRecommend'>
57
       <view>
55
       <view>

+ 1
- 1
src/reducers/system.js View File

46
     case 'TOGGLE_FIRSTSCREEN': {
46
     case 'TOGGLE_FIRSTSCREEN': {
47
       const { cityId } = action.payload
47
       const { cityId } = action.payload
48
       let cityState = state.firstScreen.filter(x => x.cityId === cityId)[0]
48
       let cityState = state.firstScreen.filter(x => x.cityId === cityId)[0]
49
-console.log('---------cityState-------->', cityState)
49
+
50
       if (!cityState) {
50
       if (!cityState) {
51
         return {
51
         return {
52
           ...state,
52
           ...state,

+ 42
- 0
src/utils/nav2Target.js View File

1
+import Taro from '@tarojs/taro'
2
+
3
+export default ({ targetId, contentType, buildingId } = {})=> {
4
+  if (!targetId && !buildingId) return;
5
+
6
+  switch (contentType) {
7
+    // 项目
8
+    case 'project':
9
+      Taro.navigateTo({
10
+        url: '/pages/index/buildingDetail/index?id=' + buildingId
11
+      })
12
+      return;
13
+
14
+    // 活动
15
+    case 'activity':
16
+      Taro.navigateTo({
17
+        url: '/pages/index/activityDetail/index?id=' + targetId
18
+      })
19
+      return;
20
+
21
+    // 资讯
22
+    case 'news':
23
+      Taro.navigateTo({
24
+        url: '/pages/index/newsDetail/index?id=' + targetId
25
+      })
26
+      return;
27
+
28
+    // live
29
+    case 'live':
30
+      Taro.navigateTo({
31
+        url: '/pages/video/liveDetail/index?id=' + targetId
32
+      })
33
+      return;
34
+
35
+
36
+    // 其他
37
+    case 'others':
38
+    default:
39
+      
40
+      return;
41
+  }
42
+}