张延森 3 anos atrás
pai
commit
5a27007554

+ 4
- 1
src/constants/api.js Ver arquivo

@@ -276,4 +276,7 @@ export const API_BUILDINGSPECIALROOM_LIST = resolvePath('buildingSpecialRoom')
276 276
 export const API_BUILDINGSPECIALROOM_BUILDING_LIST = resolvePath('buildingSpecialRoom/building')
277 277
 
278 278
 // video
279
-export const API_VIDEO_DETAIL = resolvePath('detail')
279
+export const API_VIDEO_DETAIL = resolvePath('detail')
280
+
281
+// 客服热线
282
+export const API_FEEDBACK_SETTING = resolvePath('/searchHouse/setting')

+ 19
- 4
src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.jsx Ver arquivo

@@ -1,12 +1,27 @@
1 1
 
2
-import '@/assets/css/iconfont.css'
2
+import { useState } from 'react'
3
+import Taro from '@tarojs/taro'
3 4
 import { Image, Block } from '@tarojs/components'
4 5
 import { getImgURL } from '@/utils/image'
5
-import Taro from '@tarojs/taro'
6
+import '@/assets/css/iconfont.css'
6 7
 import './index.scss'
7 8
 
8 9
 export default function SubmitBuyHouseResult (props) {
9
-  const { List = [] } = props
10
+  const { List = [], setting } = props
11
+
12
+  const handlePhone = () => {
13
+    if (!setting?.phone) {
14
+      Taro.showToast({
15
+        title: '暂不提供相关服务',
16
+        icon: 'none',
17
+      })
18
+    }
19
+
20
+    Taro.makePhoneCall({
21
+      phoneNumber: setting.phone,
22
+    })
23
+  }
24
+
10 25
   return (
11 26
     <view className='components SubmitBuyHouseResult'>
12 27
       <view className='centerLabel'>
@@ -26,7 +41,7 @@ export default function SubmitBuyHouseResult (props) {
26 41
 
27 42
             <view className='Btn flex-h'>
28 43
               <text className='flex-item'>一键咨询</text>
29
-              <text className='flex-item active'>一键电话</text>
44
+              <text className='flex-item active' onClick={handlePhone}>一键电话</text>
30 45
             </view>
31 46
 
32 47
             {/* 匹配楼盘 */}

+ 8
- 2
src/pages/index/helpToFindHouse/index.jsx Ver arquivo

@@ -1,4 +1,4 @@
1
-import { useState } from 'react'
1
+import { useEffect, useState } from 'react'
2 2
 import withLayout from '@/layout'
3 3
 import { ScrollView, Image } from '@tarojs/components'
4 4
 import { fetch } from '@/utils/request'
@@ -6,6 +6,7 @@ import { API_HELP_FIND_HOUSE_SUBMIT } from '@/constants/api'
6 6
 import '@/assets/css/iconfont.css'
7 7
 import { useSelector } from 'react-redux'
8 8
 import AreaPickerView from '@/components/AreaPickerView/index'
9
+import { getFeedbackSetting } from '@/services/common'
9 10
 import './index.scss'
10 11
 import BuyHouse from './components/BuyHouse/index'
11 12
 import RentingHouse from './components/RentingHouse/index'
@@ -26,6 +27,7 @@ export default withLayout(() => {
26 27
   const [ShowPopup, setShowPopup] = useState(false)
27 28
   const [ShowCitysPopup, setShowCitysPopup] = useState(false)
28 29
   const [AreaInfo, setAreaInfo] = useState({})
30
+  const [setting, setSetting] = useState({})
29 31
 
30 32
   const CutDemandId = (id) => {
31 33
     return () => {
@@ -69,6 +71,10 @@ export default withLayout(() => {
69 71
     })
70 72
   }
71 73
 
74
+  useEffect(() => {
75
+    getFeedbackSetting().then((res) => setSetting(res))
76
+  }, [])
77
+
72 78
   return (
73 79
     <view className='Page helpToFindHouse'>
74 80
 
@@ -76,7 +82,7 @@ export default withLayout(() => {
76 82
 
77 83
       {
78 84
         ShowPopup &&
79
-        <SubmitBuyHouseResult List={ResultList}></SubmitBuyHouseResult>
85
+        <SubmitBuyHouseResult setting={setting} List={ResultList}></SubmitBuyHouseResult>
80 86
       }
81 87
 
82 88
       <ScrollView scroll-y refresher-enabled={false}>

+ 5
- 2
src/services/common.js Ver arquivo

@@ -9,7 +9,8 @@ import {
9 9
   API_TEMPLATE_TYPE,
10 10
   API_BRAND_LIST,
11 11
   API_BRAND_INFO,
12
-  API_INDEX_ICONS
12
+  API_INDEX_ICONS,
13
+  API_FEEDBACK_SETTING,
13 14
 } from "@/constants/api";
14 15
 
15 16
 /**
@@ -102,4 +103,6 @@ export const queryBrandList = (params) => fetch({ url: API_BRAND_LIST, params })
102 103
  * 获取品牌房企列表
103 104
  * @param {*}
104 105
  */
105
- export const queryBrandInfo = (id) => fetch({ url: `${API_BRAND_INFO}/${id}`});
106
+export const queryBrandInfo = (id) => fetch({ url: `${API_BRAND_INFO}/${id}`});
107
+
108
+export const getFeedbackSetting = () => fetch({ url: API_FEEDBACK_SETTING });