Your Name 3 年之前
父節點
當前提交
985e9ed607

+ 4
- 4
config/prod.js 查看文件

@@ -3,10 +3,10 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 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 10
     OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
11 11
     OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
12 12
     ICON_FONT: '"https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/css/iconfont.ttf"',

+ 2
- 6
src/components/FirstScreen/index.jsx 查看文件

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

+ 3
- 0
src/components/FirstScreen/style.scss 查看文件

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

+ 12
- 1
src/layout/index.js 查看文件

@@ -10,6 +10,7 @@ import Spin from '@/components/Spin/Spin2'
10 10
 import FixedConsultant from '@/components/FixedConsultant'
11 11
 import FirstScreen from '@/components/FirstScreen'
12 12
 import { report as reportCustomer } from '@/utils/customer'
13
+import nav2Target from '@/utils/nav2Target'
13 14
 import { ROLE_CODE } from '@/constants/user'
14 15
 import useAuth from './useAuth'
15 16
 import useScreen from './useScreen'
@@ -37,6 +38,11 @@ export default (ChildComponent) => (props) => {
37 38
   // 开屏广告
38 39
   const [screenInfo, screenVisible, toggleShowScreen] = useScreen(city.id, person)
39 40
 
41
+  const handleScreen = () => {
42
+    toggleShowScreen()
43
+    nav2Target(screenInfo)
44
+  }
45
+
40 46
   // 报备客户
41 47
   useEffect(() => {
42 48
     reportCustomer(person, consultant, false).catch(() => {})
@@ -106,7 +112,12 @@ export default (ChildComponent) => (props) => {
106 112
       {
107 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 查看文件

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

+ 2
- 3
src/pages/index/components/HotRecommend/index.jsx 查看文件

@@ -40,8 +40,7 @@ export default function HotRecommend (props) {
40 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'
43
+
45 44
   const ToMore = () => {
46 45
     Taro.navigateTo({url: `/pages/index/activityList/index?type=${CurrentId}`})
47 46
   }
@@ -51,7 +50,7 @@ export default function HotRecommend (props) {
51 50
       Taro.navigateTo({url: `/pages/index/activityDetail/index?id=${CurrentContentInfo.dynamicId}`})
52 51
     }
53 52
   }
54
-  // url: `/pages/index/activityDetail/index?id=${data.dynamicId}`
53
+
55 54
   return (
56 55
     <view className='components HotRecommend'>
57 56
       <view>

+ 1
- 1
src/reducers/system.js 查看文件

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

+ 42
- 0
src/utils/nav2Target.js 查看文件

@@ -0,0 +1,42 @@
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
+}