1002884655 3 vuotta sitten
vanhempi
commit
c3d4fcb0ca

+ 66
- 0
src/components/FixedConsultant/index.jsx Näytä tiedosto

@@ -0,0 +1,66 @@
1
+import { useState } from 'react'
2
+import classNames from 'classnames'
3
+import Taro from '@tarojs/taro'
4
+import { Image } from '@tarojs/components'
5
+import { getImgURL } from '@/utils/image'
6
+import './index.scss'
7
+
8
+export default function FixedCard (props) {
9
+  const { consultant } = props
10
+  const { id: consultantId, name, picture, company, avatar, phone } = consultant || {}
11
+
12
+  const [Show, setShow] = useState(false)
13
+
14
+  const toggleVisible = () => {
15
+    setShow(!Show)
16
+  }
17
+
18
+  const handleChat = () => {
19
+    Taro.navigateTo({
20
+      url: `/pages/chat/chatDetail/index?targetPerson=${consultantId}}`
21
+    })
22
+  }
23
+  
24
+  const handleCall = () => {
25
+    if (phone) {
26
+      Taro.makePhoneCall({ phoneNumber: phone })
27
+      return
28
+    }
29
+
30
+    Taro.showToast({ title: '暂无联系电话', icon: 'none' })
31
+  }
32
+
33
+  return !!consultantId && (
34
+    <view className={classNames('components FixedCard', { spread: Show })}>
35
+      <view className='Icon' onClick={toggleVisible}>
36
+        <Image mode='aspectFill' src={getImgURL(picture||avatar)}></Image>
37
+      </view>
38
+      <view className='Name' onClick={toggleVisible}>
39
+        <text>{name}</text>
40
+        {/* <text style={{display: Show ? 'block' : 'none'}}>{company}</text> */}
41
+      </view>
42
+      <text
43
+        style={{display: Show ? 'inline-block' : 'none'}}
44
+        className='iconfont icon-liaotian Btn'
45
+        onClick={handleChat}
46
+      ></text>
47
+
48
+      <text
49
+        style={{display: Show ? 'inline-block' : 'none'}}
50
+        className='iconfont icon-dianhua1 Btn'
51
+        onClick={handleCall}
52
+      ></text>
53
+
54
+      <text
55
+        style={{display: Show ? 'inline-block' : 'none'}}
56
+        className='iconfont icon-guanbi Btn'
57
+        onClick={toggleVisible}
58
+      ></text>
59
+
60
+      <text
61
+        style={{display: Show ? 'none' : 'inline-block'}}
62
+        className='iconfont icon-jiantouright'
63
+      ></text>
64
+    </view>
65
+  )
66
+}

src/pages/index/buildingDetail/components/FixedCard/index.scss → src/components/FixedConsultant/index.scss Näytä tiedosto

@@ -1,6 +1,6 @@
1 1
 .components.FixedCard {
2
-  transition: all .2s ease-out;
3
-  -webkit-transition: all .2s ease-out;
2
+  transition: width .2s ease-out;
3
+  -webkit-transition: width .2s ease-out;
4 4
   position: fixed;
5 5
   right: 0;
6 6
   background: #fff;
@@ -11,6 +11,13 @@
11 11
   font-size: 0;
12 12
   white-space: nowrap;
13 13
   border-radius: 94px 0 0 94px;
14
+  box-sizing: border-box;
15
+  width: 222rpx;
16
+
17
+  &.spread {
18
+    width: 452rpx;
19
+  }
20
+
14 21
   >view {
15 22
     display: inline-block;
16 23
     vertical-align: middle;
@@ -34,12 +41,12 @@
34 41
         white-space: nowrap;
35 42
         line-height: 32px;
36 43
         display: block;
37
-        &:last-child {
38
-          font-weight: normal;
39
-          font-size: 20px;
40
-          line-height: 1;
41
-          color: #202020;
42
-        }
44
+        // &:last-child {
45
+        //   font-weight: normal;
46
+        //   font-size: 20px;
47
+        //   line-height: 1;
48
+        //   color: #202020;
49
+        // }
43 50
       }
44 51
     }
45 52
   }

+ 9
- 4
src/layout/index.js Näytä tiedosto

@@ -7,6 +7,7 @@ import Loading from '@/components/Loading'
7 7
 import AuthAvatar from '@/components/Auth/AuthAvatar'
8 8
 import AuthPhone from '@/components/Auth/AuthPhone'
9 9
 import Spin from '@/components/Spin/Spin2'
10
+import FixedConsultant from '@/components/FixedConsultant'
10 11
 import { ROLE_CODE } from '@/constants/user'
11 12
 import useAuth from './useAuth'
12 13
 import { routes } from '../routes'
@@ -23,6 +24,7 @@ export default (ChildComponent) => (props) => {
23 24
   const [authPhone, authAvatar] = useAuth(person, page)
24 25
 
25 26
   const { id } = router.params
27
+  const showConsultant = page.shortcut && page.shortcut.consultant
26 28
 
27 29
   // 页面分享
28 30
   const [shareContent, setShareContent] = useState({})
@@ -80,8 +82,8 @@ export default (ChildComponent) => (props) => {
80 82
       </Overlay>
81 83
       <Spin size={32} spinning={spinning} />
82 84
       {
83
-        person && person.personId
84
-        ? <ChildComponent
85
+        person && !!person.personId && (
86
+          <ChildComponent
85 87
             person={person}
86 88
             router={router}
87 89
             consultant={consultant}
@@ -90,8 +92,11 @@ export default (ChildComponent) => (props) => {
90 92
             trackData={trackData}
91 93
             {...props}
92 94
             {...extInfo}
93
-        />
94
-        : null
95
+          />
96
+        )
97
+      }
98
+      {
99
+        !!showConsultant && (<FixedConsultant consultant={consultant} />)
95 100
       }
96 101
     </>
97 102
   )

+ 1
- 1
src/pages/index/activityDetail/index.jsx Näytä tiedosto

@@ -194,7 +194,7 @@ export default withLayout((props) => {
194 194
             className="iconfont icon-shoucang"
195 195
             style={isSaved ? { color: "red" } : undefined}
196 196
           ></text>
197
-          <text>收藏</text>
197
+          <text>{isSaved ? '已收藏' : '收藏'}</text>
198 198
         </view>
199 199
         <view className="flex-item"></view>
200 200
 

+ 12
- 6
src/pages/index/activityList/index.jsx Näytä tiedosto

@@ -10,9 +10,9 @@ import ActivityListItem from '../components/ActivityListItem/index'
10 10
 import './index.scss'
11 11
 
12 12
 export default function MyCollectForActivity (props) {
13
- const router=useRouter()
14 13
 
15
-   const { type } = router.params;
14
+ const router=useRouter()
15
+   const { type,buildingId } = router.params;
16 16
   const city = useSelector(state => state.city)
17 17
  
18 18
   const [PageList, setPageList] = useState([])
@@ -35,16 +35,22 @@ export default function MyCollectForActivity (props) {
35 35
   
36 36
 
37 37
  const getList = (params) => {
38
-  queryActivityList({...params,type,cityId: city.curCity.id}).then((res)=>{
38
+  params.cityId = city.curCity.id;
39
+  if(buildingId){
40
+    params.buildingId = buildingId;
41
+  }else{
42
+    params.cityId = city?.curCity?.id;
43
+  }
44
+  queryActivityList({...params,type}).then((res)=>{
39 45
     setPageList(res.list)
40 46
   })
41 47
   }
42 48
   useEffect(()=>{
43
-    if(city?.curCity?.id){
49
+ 
44 50
       getList({page :0, pageSize : 10})
45
-    }
51
+
46 52
    
47
-  },[city])
53
+  },[])
48 54
   // useDidShow(() => {
49 55
   //   getList({page :0, pageSize : 10})
50 56
   // })

+ 8
- 1
src/pages/index/buildingDetail/components/BasicInfo/index.jsx Näytä tiedosto

@@ -15,6 +15,13 @@ export default function BasicInfo (props) {
15 15
 
16 16
   const goto = (url) => Taro.navigateTo({ url })
17 17
 
18
+  const handleSubscribeMessage = () => {
19
+    Taro.showToast({
20
+      title: '暂未开启',
21
+      icon: 'none',
22
+    })
23
+  }
24
+
18 25
   return (
19 26
     <view className='components BasicInfo'>
20 27
 
@@ -161,7 +168,7 @@ export default function BasicInfo (props) {
161 168
       {/* 互动 */}
162 169
       <view className='Interact flex-h'>
163 170
         <text className='flex-item' onClick={() => goto(`/pages/index/buildingInfo/index?id=${buildingId}`)}>更多楼盘信息</text>
164
-        <text className='flex-item active'>订阅活动通知</text>
171
+        <text className='flex-item active' onClick={handleSubscribeMessage}>订阅活动通知</text>
165 172
       </view>
166 173
 
167 174
       {/* 提示 */}

+ 1
- 1
src/pages/index/buildingDetail/components/BuildingDetailBanner/index.jsx Näytä tiedosto

@@ -10,7 +10,7 @@ const getImage = item => getImgURL(item.image || item.coverImg || item.url || it
10 10
 export default function BuildingDetailBanner (props) {
11 11
   const { Info } = props
12 12
   const { buildingImg, panoramaList, videoUrl, videoImage } = Info || {}
13
-  const videoPoster = videoImage ? videoImage[0] : undefined
13
+  const videoPoster = videoImage ? videoImage[0].url : undefined
14 14
 
15 15
   const showPicBtn = buildingImg && buildingImg.length > 0
16 16
   const showVRBtn = panoramaList && panoramaList.length > 0

+ 1
- 7
src/pages/index/buildingDetail/components/DetailBottom/index.jsx Näytä tiedosto

@@ -30,7 +30,7 @@ export default function DetailBottom (props) {
30 30
 
31 31
     if (consultant?.id) {
32 32
       Taro.navigateTo({
33
-        url: `/pages/chat/detail?targetPerson=${consultant.id}}`
33
+        url: `/pages/chat/chatDetail/index?targetPerson=${consultant.id}}`
34 34
       })
35 35
     } else {
36 36
       Taro.navigateTo({
@@ -92,12 +92,6 @@ export default function DetailBottom (props) {
92 92
               <Image mode='heightFix' src={require('@/assets/buildingDetail-icon1.png')}></Image>
93 93
               <text>一键带看</text>
94 94
             </view>
95
-            <AuthRole role={ROLE_CODE.CONSULTANT}>
96
-              <view className='Item' onClick={handleRecommender}>
97
-                <Image mode='heightFix' src={require('@/assets/buildingDetail-icon2.png')}></Image>
98
-                <text>一键推荐</text>
99
-              </view>
100
-            </AuthRole>
101 95
           </AuthRole>
102 96
         </view>
103 97
         <view className='Btn'>

+ 0
- 31
src/pages/index/buildingDetail/components/FixedCard/index.jsx Näytä tiedosto

@@ -1,31 +0,0 @@
1
-import { useState } from 'react'
2
-import { Image } from '@tarojs/components'
3
-import { getImgURL } from '@/utils/image'
4
-import './index.scss'
5
-
6
-export default function FixedCard () {
7
-
8
-  const [Show, setShow] = useState(false)
9
-
10
-  const TriggerShow = (bool) => {
11
-    return () => {
12
-      setShow(bool)
13
-    }
14
-  }
15
-
16
-  return (
17
-    <view className='components FixedCard'>
18
-      <view className='Icon' onClick={TriggerShow(true)}>
19
-        <Image mode='aspectFill' src={null}></Image>
20
-      </view>
21
-      <view className='Name'>
22
-        <text>李双舟</text>
23
-        <text style={{display: Show ? 'block' : 'none'}}>南京云致科技服务有限公司</text>
24
-      </view>
25
-      <text style={{display: Show ? 'inline-block' : 'none'}} className='iconfont icon-liaotian Btn'></text>
26
-      <text style={{display: Show ? 'inline-block' : 'none'}} className='iconfont icon-dianhua1 Btn'></text>
27
-      <text style={{display: Show ? 'inline-block' : 'none'}} className='iconfont icon-guanbi Btn' onClick={TriggerShow(false)}></text>
28
-      <text style={{display: Show ? 'none' : 'inline-block'}} className='iconfont icon-jiantouright'></text>
29
-    </view>
30
-  )
31
-}

+ 33
- 14
src/pages/index/buildingDetail/components/PropertyConsultant/index.jsx Näytä tiedosto

@@ -1,23 +1,42 @@
1
-import { useState } from 'react'
1
+
2 2
 import { Image } from '@tarojs/components'
3 3
 import Taro from '@tarojs/taro'
4 4
 import '@/assets/css/iconfont.css'
5 5
 import './index.scss'
6 6
 
7
-export default function PropertyConsultant (props) {
7
+const TipsList = [
8
+  {name: '官方保障', icon: 'icon-baozhang'},
9
+  {name: '免费咨询', icon: 'icon-zixun'},
10
+  {name: '户型解读', icon: 'icon-jiedu'},
11
+  {name: '贴心服务', icon: 'icon-tiexin'}
12
+]
8 13
 
9
-  const { List = [] } = props
10
-  const [TipsList] = useState([
11
-    {name: '官方保障', icon: 'icon-baozhang'},
12
-    {name: '免费咨询', icon: 'icon-zixun'},
13
-    {name: '户型解读', icon: 'icon-jiedu'},
14
-    {name: '贴心服务', icon: 'icon-tiexin'}
15
-  ])
14
+export default function PropertyConsultant (props) {
15
+  const { Info } = props
16
+  const List = Info?.consultants || []
16 17
 
17 18
   const CallPhone = (phone) => { // 拨打电话
18 19
     Taro.makePhoneCall({ phoneNumber: phone })
19 20
   }
20 21
 
22
+  const handleMore = () => {
23
+    Taro.navigateTo({
24
+      url: `/pages/index/buildingPropertyConsultant/index?buildingId=${Info?.buildingId}`
25
+    })
26
+  }
27
+
28
+  const handleChat = (item) => {
29
+    Taro.navigateTo({
30
+      url: `/pages/chat/chatDetail/index?targetPerson=${item.id}}`
31
+    })
32
+  }
33
+  
34
+  const gotoDetail = (item) => {
35
+    Taro.navigateTo({
36
+      url: `/pages/mine/myHomepage/index?id=${item.id}`
37
+    })
38
+  }
39
+
21 40
   return List.length > 0 ? (
22 41
     <view className='components PropertyConsultant'>
23 42
 
@@ -25,7 +44,7 @@ export default function PropertyConsultant (props) {
25 44
         <view className='flex-item'>
26 45
           <text>置业顾问</text>
27 46
         </view>
28
-        <text>更多</text>
47
+        <text onClick={handleMore}>更多</text>
29 48
         <text className='iconfont icon-jiantouright'></text>
30 49
       </view>
31 50
 
@@ -44,15 +63,15 @@ export default function PropertyConsultant (props) {
44 63
         {
45 64
           List.map((item, index) => (
46 65
             <view key={`PersonItem-${index}`} className='flex-h'>
47
-              <view className='Icon'>
66
+              <view className='Icon' onClick={() => gotoDetail(item)}>
48 67
                 <Image mode='aspectFill' src={item.photo || item.avatar}></Image>
49 68
               </view>
50
-              <view className='flex-item'>
69
+              <view className='flex-item' onClick={() => gotoDetail(item)}>
51 70
                 <text>{item.userName}</text>
52 71
                 <text>{item.description || ''}</text>
53 72
               </view>
54
-              <text className='iconfont icon-liaotian Chat'></text>
55
-              <text className='iconfont icon-dianhua Phone' onClick={CallPhone(item.phone || item.tel)}></text>
73
+              <text className='iconfont icon-liaotian Chat' onClick={() => handleChat(item)}></text>
74
+              <text className='iconfont icon-dianhua Phone' onClick={() => CallPhone(item.phone || item.tel)}></text>
56 75
             </view>
57 76
           ))
58 77
         }

+ 1
- 4
src/pages/index/buildingDetail/index.jsx Näytä tiedosto

@@ -20,7 +20,6 @@ import MarketingActivity from './components/MarketingActivity/index'
20 20
 import LivingActivity from './components/LivingActivity/index'
21 21
 import News from './components/News/index'
22 22
 import Pictures from './components/Pictures/index'
23
-import FixedCard from './components/FixedCard/index'
24 23
 
25 24
 import './index.scss'
26 25
 
@@ -101,7 +100,7 @@ export default withLayout((props) => {
101 100
 
102 101
                 {/* 置业顾问 */}
103 102
                 <view className='PropertyConsultant' style={{minHeight: 0}}>
104
-                  <PropertyConsultant List={DetailInfo?.consultants}></PropertyConsultant>
103
+                  <PropertyConsultant Info={DetailInfo}></PropertyConsultant>
105 104
                 </view>
106 105
 
107 106
                 {/* 位置及周边 */}
@@ -153,8 +152,6 @@ export default withLayout((props) => {
153 152
         onClose={() => setShowPoster(false)}
154 153
         onSuccess={() => setShowPoster(false)}
155 154
       />
156
-
157
-      <FixedCard></FixedCard>
158 155
     </view>
159 156
   )
160 157
 })

+ 52
- 27
src/pages/index/buildingPropertyConsultant/index.jsx Näytä tiedosto

@@ -1,38 +1,57 @@
1 1
 import { useState, useEffect } from 'react'
2
+import Taro from '@tarojs/taro'
2 3
 import withLayout from '@/layout'
3 4
 import { ScrollView, Image } from '@tarojs/components'
5
+import { getCardList } from '@/services/card'
6
+import { getImgURL } from '@/utils/image'
4 7
 import '@/assets/css/iconfont.css'
5 8
 import './index.scss'
6 9
 
7 10
 export default withLayout((props) => {
11
+  const { router } = props
12
+  const { buildingId } = router.params
8 13
 
9
-  const [IsPull, setPull] = useState(false)
10
-  const [PullTimer, setPullTimer] = useState(null)
11
-  const [List, setList] = useState([
12
-    { name: '乖戾', icon: '', time: '11:49' },
13
-    { name: '乖戾', icon: '', time: '11:49' },
14
-    { name: '乖戾', icon: '', time: '11:49' },
15
-    { name: '乖戾', icon: '', time: '11:49' },
16
-    { name: '乖戾', icon: '', time: '11:49' },
17
-    { name: '乖戾', icon: '', time: '11:49' },
18
-  ])
14
+  const [List, setList] = useState([])
19 15
 
20
-  const PageRefresh = () => { // 页面下拉刷新回调
21
-    setPull(true)
16
+  const handleChat = (item) => {
17
+    Taro.navigateTo({
18
+      url: `/pages/chat/chatDetail/index?targetPerson=${item.id}}`
19
+    })
22 20
   }
23 21
 
24
-  useEffect(() => { // 下拉刷新触发
25
-    if (IsPull) {
26
-      clearTimeout(PullTimer)
27
-      setPullTimer(setTimeout(() => {
28
-        setPull(false)
29
-      }, 2000))
22
+  const handleCall = (item) => {
23
+    if (item.phone) {
24
+      Taro.makePhoneCall({ phoneNumber: item.phone })
25
+      return
30 26
     }
31
-  }, [IsPull])
27
+
28
+    Taro.showToast({ title: '暂无联系电话', icon: 'none' })
29
+  }
30
+
31
+  const gotoDetail = (item) => {
32
+    Taro.navigateTo({
33
+      url: `/pages/mine/myHomepage/index?id=${item.id}`
34
+    })
35
+  }
36
+
37
+  useEffect(() => {
38
+    if (!buildingId) {
39
+      Taro.showToast({
40
+        title: '没有楼盘信息',
41
+        icon: 'none',
42
+      })
43
+      return
44
+    }
45
+
46
+    getCardList({ pageSize: 500, buildingId }).then((res) => {
47
+      const { records } = res || []
48
+      setList(records)
49
+    })
50
+  }, [buildingId])
32 51
 
33 52
   return (
34 53
     <view className='Page buildingPropertyConsultant'>
35
-      <ScrollView scroll-y refresher-enabled refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} refresher-background='#fff'>
54
+      <ScrollView scroll-y>
36 55
         <text className='TopTips'>有任何买卖房屋的问题,欢迎随时咨询</text>
37 56
         <view className='List'>
38 57
           {
@@ -42,24 +61,30 @@ export default withLayout((props) => {
42 61
                 <view className='flex-h'>
43 62
 
44 63
                   <view className='Icon'>
45
-                    <Image mode='scaleToFill' src={item.icon || null}></Image>
64
+                    <Image mode='scaleToFill' src={getImgURL(item.photo || item.avatar)}></Image>
46 65
                   </view>
47 66
 
48
-                  <view className='flex-item'>
67
+                  <view className='flex-item' onClick={() => gotoDetail(item)}>
49 68
                     <view className='Name'>
50
-                      <text>陆毅</text>
69
+                      <text>{item.name}</text>
51 70
                       <Image mode='heightFix' src={require('@/assets/index-icon17.png')}></Image>
52 71
                     </view>
53
-                    <text>13045678976</text>
72
+                    <text>{item.phone}</text>
54 73
                   </view>
55 74
 
56
-                  <text className='iconfont icon-liaotian'></text>
57
-                  <text className='iconfont icon-dianhua'></text>
75
+                  <text
76
+                    className='iconfont icon-liaotian'
77
+                    onClick={() => handleChat(item)}
78
+                  ></text>
79
+                  <text
80
+                    className='iconfont icon-dianhua'
81
+                    onClick={() => handleCall(item)}
82
+                  ></text>
58 83
                   
59 84
                 </view>
60 85
 
61 86
                 <view className='Desc'>
62
-                  <text>好评经纪人,熟悉楼盘特色</text>
87
+                  <text>{item.description}</text>
63 88
                 </view>
64 89
 
65 90
               </view>

+ 1
- 1
src/pages/index/buildingRules/index.jsx Näytä tiedosto

@@ -36,7 +36,7 @@ export default withLayout(() => {
36 36
               </view>
37 37
               <view>
38 38
                 <text>&emsp;&emsp;以上价格仅供参考,具体一房一价的信息以售楼处展示为准。房屋位置交通、医疗、教育、商业等配套信息,来源于第三方不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。本平台对项目周边文化教育的介绍旨在提供相关信息1 意味着信息发布方对就学安排作出承诺。相关教育资首页信息存在调整的可能,应以政府教育主管部门门及办学颁布的政策规定为准。详情请仔细阅读</text>
39
-                <text className='active'>《新联使用免责条款》</text>
39
+                <text className='active'>《新联使用免责条款》</text>
40 40
               </view>
41 41
             </view>
42 42
           </view>

+ 1
- 1
src/pages/index/buildingTakeLook/index.jsx Näytä tiedosto

@@ -100,7 +100,7 @@ export default withLayout((props) => {
100 100
               </view>
101 101
               <view>
102 102
                 <text>&emsp;&emsp;以上价格仅供参考,具体一房一价的信息以售楼处展示为准。房屋位置交通、医疗、教育、商业等配套信息,来源于第三方不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。本平台对项目周边文化教育的介绍旨在提供相关信息1 意味着信息发布方对就学安排作出承诺。相关教育资首页信息存在调整的可能,应以政府教育主管部门门及办学颁布的政策规定为准。详情请仔细阅读</text>
103
-                <text className='active'>《新联使用免责条款》</text>
103
+                <text className='active'>《新联使用免责条款》</text>
104 104
               </view>
105 105
             </view>
106 106
           </view>

+ 1
- 1
src/pages/index/index.config.js Näytä tiedosto

@@ -1,3 +1,3 @@
1 1
 export default {
2
-  navigationBarTitleText: '新联'
2
+  navigationBarTitleText: '新联'
3 3
 }

+ 64
- 46
src/pages/index/newsList/index.jsx Näytä tiedosto

@@ -1,33 +1,40 @@
1
-import React, { useState, useEffect } from 'react'
2
-import withLayout from '@/layout'
3
-import './index.scss'
4
-import { ScrollView } from '@tarojs/components'
5
-import '@/assets/css/iconfont.css'
6
-import NewsListItem from '../components/NewsListItem/index'
7
-import { useDidShow } from '@tarojs/taro'
8
-import { queryNewsList } from '@/services/news'
1
+import React, { useState, useEffect } from "react";
2
+import { useRouter } from "@tarojs/taro";
3
+import { useSelector } from "react-redux";
4
+import withLayout from "@/layout";
5
+import "./index.scss";
6
+import { ScrollView } from "@tarojs/components";
7
+import "@/assets/css/iconfont.css";
8
+import NewsListItem from "../components/NewsListItem/index";
9
+import { useDidShow } from "@tarojs/taro";
10
+import { queryNewsList } from "@/services/news";
9 11
 
10 12
 export default withLayout((props) => {
11
-
13
+  const router = useRouter();
14
+  const { buildingId, from } = router.params;
15
+  const city = useSelector((state) => state.city);
12 16
   // const [PageProps] = useState(props)
13
-  const [PageList, setPageList] = useState([])
14
-  const [IsPull, setPull] = useState(false)
15
-  const [PullTimer, setPullTimer] = useState(null)
17
+  const [PageList, setPageList] = useState([]);
18
+  const [IsPull, setPull] = useState(false);
19
+  const [PullTimer, setPullTimer] = useState(null);
16 20
 
17
-  const PageRefresh = () => { // 页面下拉刷新回调
18
-    setPull(true)
19
-  }
21
+  const PageRefresh = () => {
22
+    // 页面下拉刷新回调
23
+    setPull(true);
24
+  };
20 25
 
21
-  useEffect(() => { // 下拉刷新触发
26
+  useEffect(() => {
27
+    // 下拉刷新触发
22 28
     if (IsPull) {
23
-      clearTimeout(PullTimer)
24
-      setPullTimer(setTimeout(() => {
25
-        setPull(false)
26
-      }, 2000))
29
+      clearTimeout(PullTimer);
30
+      setPullTimer(
31
+        setTimeout(() => {
32
+          setPull(false);
33
+        }, 2000)
34
+      );
27 35
     }
28
-  }, [IsPull])
36
+  }, [IsPull]);
29 37
 
30
- 
31 38
   // componentDidShow() {
32 39
   //   // // this.onPullDownRefresh()
33 40
   //   // console.log('----', this)
@@ -58,12 +65,23 @@ export default withLayout((props) => {
58 65
 
59 66
   const loadData = (params) => {
60 67
     // const currentPage = page || this.state.pageIndex
68
+    // const { curCity: { id: cityId } } = this.props
69
+
70
+ 
71
+    // if (from === "mine") {
72
+    //   params.mine = true;
73
+    // }
74
+    // // 从项目详情过来
75
+    if (buildingId) {
76
+      params.buildingId = buildingId;
77
+    }else if(city?.curCity?.id){
78
+      params.cityId = city.curCity.id;
79
+    }
61 80
 
62
-    queryNewsList(params).then(res=>{
63
-      console.log(res,'queryNewsList')
64
-      const { records, list, total, current, pages, size } = res || {}
65
-      setPageList([...PageList, ...records])
66
-    })
81
+    queryNewsList(params).then((res) => {
82
+      const { records, list, total, current, pages, size } = res || {};
83
+      setPageList([...PageList, ...records]);
84
+    });
67 85
 
68 86
     // this.loadList(currentPage, pageSize).then(res => {
69 87
     //   const { records, list, total, current, pages, size } = res || {}
@@ -80,31 +98,31 @@ export default withLayout((props) => {
80 98
     //     // pageIndex: current >= pages ? pages : current,
81 99
     //   })
82 100
     // })
83
-  }
84
-  useEffect(()=>{
85
-    loadData({page : 0, pageSize : 10})
86
-  },[])
101
+  };
102
+  useEffect(() => {
103
+    loadData({ page: 0, pageSize: 10 });
104
+  }, []);
87 105
 
88 106
   return (
89
-    <view className='Page newsList'>
90
-
91
-      <ScrollView scroll-y={true} refresher-enabled={true} refresher-triggered={IsPull} onrefresherrefresh={PageRefresh} refresher-background='#fff'>
92
-        <view className='PageContent'>
93
-
94
-          {
95
-            PageList.map((item, index) => (
96
-              <NewsListItem data={item}></NewsListItem>
97
-            ))
98
-          }
107
+    <view className="Page newsList">
108
+      <ScrollView
109
+        scroll-y={true}
110
+        refresher-enabled={true}
111
+        refresher-triggered={IsPull}
112
+        onrefresherrefresh={PageRefresh}
113
+        refresher-background="#fff"
114
+      >
115
+        <view className="PageContent">
116
+          {PageList.map((item, index) => (
117
+            <NewsListItem data={item}></NewsListItem>
118
+          ))}
99 119
 
100 120
           {/* bottom */}
101
-          <view className='PageBottom'>
121
+          <view className="PageBottom">
102 122
             <text>已经到底了~</text>
103 123
           </view>
104
-
105 124
         </view>
106 125
       </ScrollView>
107
-
108 126
     </view>
109
-  )
110
-})
127
+  );
128
+});

+ 1
- 1
src/pages/index/specialPriceHouse/index.jsx Näytä tiedosto

@@ -103,7 +103,7 @@ export default withLayout(() => {
103 103
               </view>
104 104
               <view>
105 105
                 <text>&emsp;&emsp;以上价格仅供参考,具体一房一价的信息以售楼处展示为准。房屋位置交通、医疗、教育、商业等配套信息,来源于第三方不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。本平台对项目周边文化教育的介绍旨在提供相关信息1 意味着信息发布方对就学安排作出承诺。相关教育资首页信息存在调整的可能,应以政府教育主管部门门及办学颁布的政策规定为准。详情请仔细阅读</text>
106
-                <text className='active'>《新联使用免责条款》</text>
106
+                <text className='active'>《新联使用免责条款》</text>
107 107
               </view>
108 108
             </view>
109 109
           </view>

+ 1
- 1
src/pages/index/webview/index.config.js Näytä tiedosto

@@ -1,3 +1,3 @@
1 1
 export default {
2
-  navigationBarTitleText: '新联全景'
2
+  navigationBarTitleText: '新联全景'
3 3
 }

+ 1
- 1
src/pages/mine/components/NeedLogin/index.jsx Näytä tiedosto

@@ -21,7 +21,7 @@ export default function Banner (props) {
21 21
           </view>
22 22
           <view>
23 23
             <text>以上价格仅供参考,具体一房一价的信息以售楼处展示为准。房屋位置交通、医疗、教育、商业等配套信息,来源于第三方不作为要约,仅供参考,双方具体权利义务应以法律规定及买卖合同约定为准。本平台对项目周边文化教育的介绍旨在提供相关信息1 意味着信息发布方对就学安排作出承诺。相关教育资首页信息存在调整的可能,应以政府教育主管部门门及办学颁布的政策规定为准。详情请仔细阅读</text>
24
-            <text className='active'>《新联使用免责条款》</text>
24
+            <text className='active'>《新联使用免责条款》</text>
25 25
           </view>
26 26
         </view>
27 27
       </view>

+ 0
- 4
src/pages/mine/myHomepage/index.jsx Näytä tiedosto

@@ -163,10 +163,6 @@ export default withLayout(() => {
163 163
             <text>已经到底了~</text>
164 164
           </view>
165 165
 
166
-          {/* <view className='Share'>
167
-            <text onClick={() => { setShowPopup(true) }}>生成海报分享好友</text>
168
-          </view> */}
169
-
170 166
         </view>
171 167
       </ScrollView>
172 168
 

+ 8
- 1
src/routes.js Näytä tiedosto

@@ -10,6 +10,10 @@ const routes = [
10 10
     pkg: 'main',
11 11
     isTab: true,
12 12
     type: 'main',
13
+    shortcut: {
14
+      chat: false,
15
+      consultant: true,
16
+    },
13 17
     // auth: ['phone', 'avatar']
14 18
   },
15 19
   {
@@ -39,7 +43,6 @@ const routes = [
39 43
     name: '聊天',
40 44
     page: 'pages/chat/chatDetail/index',
41 45
     pkg: 'main',
42
-    isTab: true,
43 46
     type: 'other',
44 47
   },
45 48
 
@@ -82,6 +85,10 @@ const routes = [
82 85
     pkg: 'main',
83 86
     type: 'building',
84 87
     auth: ['phone', 'avatar'],
88
+    shortcut: {
89
+      chat: false,
90
+      consultant: true,
91
+    },
85 92
   },
86 93
   {
87 94
     name: '全景看房',

+ 1
- 1
src/services/common.js Näytä tiedosto

@@ -24,7 +24,7 @@ export const getPreloadData = payload =>
24 24
  *
25 25
  */
26 26
 export const getMiniQrcode = payload =>
27
-  fetch({ url: API_QRCODE, payload, method: "POST" });
27
+  fetch({ url: API_QRCODE, payload, method: "POST", showToast: false });
28 28
 
29 29
 /**
30 30
  * 获取二维码参数