Browse Source

静态页面

1002884655 3 years ago
parent
commit
60b21859a6
5 changed files with 25 additions and 13 deletions
  1. 2
    2
      config/dev.js
  2. 3
    0
      src/constants/api.js
  3. 9
    1
      src/pages/index/helpToFindHouse/index.jsx
  4. 5
    4
      src/pages/mine/index.jsx
  5. 6
    6
      src/routes.js

+ 2
- 2
config/dev.js View File

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"https://wx.fangdeal.cn"', //正式
7
-    WSS_HOST: '"https://wx.fangdeal.cn"',
6
+    HOST: '"http://81.69.196.8:8567"', //正式
7
+    WSS_HOST: '"http://81.69.196.8:8567"',
8
     OSS_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
8
     OSS_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
9
     OSS_FAST_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
9
     OSS_FAST_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
10
     Version: '"V3.5.29-20201112"'
10
     Version: '"V3.5.29-20201112"'

+ 3
- 0
src/constants/api.js View File

12
 
12
 
13
 const resolvePath = api => `${host + pathname}/${api}`
13
 const resolvePath = api => `${host + pathname}/${api}`
14
 
14
 
15
+// 帮我找房
16
+export const API_HELP_FIND_HOUSE_QUESTION = resolvePath('houseProperty') // 问卷列表
17
+
15
 // common
18
 // common
16
 export const API_PRELOAD = resolvePath('preload')
19
 export const API_PRELOAD = resolvePath('preload')
17
 export const API_QRCODE = resolvePath('qrcode')
20
 export const API_QRCODE = resolvePath('qrcode')

+ 9
- 1
src/pages/index/helpToFindHouse/index.jsx View File

6
 import BuyHouse from './components/BuyHouse/index'
6
 import BuyHouse from './components/BuyHouse/index'
7
 import RentingHouse from './components/RentingHouse/index'
7
 import RentingHouse from './components/RentingHouse/index'
8
 import HousePurchasing from './components/HousePurchasing/index'
8
 import HousePurchasing from './components/HousePurchasing/index'
9
+import { fetch } from '@/utils/request'
10
+import { API_HELP_FIND_HOUSE_QUESTION } from '@/constants/api'
9
 
11
 
10
 export default withLayout((props) => {
12
 export default withLayout((props) => {
11
 
13
 
12
-  // const [PageProps] = useState(props)
14
+  const [PageProps] = useState(props)
13
   const [DemandList] = useState([
15
   const [DemandList] = useState([
14
     { name: '我要买房', id: 1, icon: '', spell: 'MAI FANG' },
16
     { name: '我要买房', id: 1, icon: '', spell: 'MAI FANG' },
15
     { name: '我要租房', id: 2, icon: '', spell: 'ZU FANG' },
17
     { name: '我要租房', id: 2, icon: '', spell: 'ZU FANG' },
18
   const [CurrentDemandId, setCurrentDemandId] = useState(2)
20
   const [CurrentDemandId, setCurrentDemandId] = useState(2)
19
   const [ShowDemand, setShowDemand] = useState(true)
21
   const [ShowDemand, setShowDemand] = useState(true)
20
 
22
 
23
+  useEffect(() => {
24
+    fetch({url: API_HELP_FIND_HOUSE_QUESTION}).then(() => {
25
+      
26
+    })
27
+  }, [])
28
+
21
   const CutDemandId = (id) => {
29
   const CutDemandId = (id) => {
22
     return () => {
30
     return () => {
23
       setCurrentDemandId(id)
31
       setCurrentDemandId(id)

+ 5
- 4
src/pages/mine/index.jsx View File

9
 
9
 
10
 export default withLayout((props) => {
10
 export default withLayout((props) => {
11
 
11
 
12
-  // const [PageProps] = useState(props)
13
-  const UserRole = 2 // 1-普通用户 2-经纪人 3-置业顾问 4-驻场管理
12
+  const [PageProps] = useState(props)
13
+  console.log(`PageProps`, PageProps.person)
14
+  const UserRole = PageProps.person.personType === 'customer' ? 1 : PageProps.person.personType === 'estate agent' ? 2 : PageProps.person.personType === 'Realty Consultant' ? 3 : 4 // 1-普通用户 2-经纪人 3-置业顾问 4-驻场管理
14
   const [MenuList, setMenuList] = useState(UserRole === 1 ? MineMenuList.User : UserRole === 2 ? MineMenuList.Broker : UserRole === 3 ? MineMenuList.Adviser : MineMenuList.Resident)
15
   const [MenuList, setMenuList] = useState(UserRole === 1 ? MineMenuList.User : UserRole === 2 ? MineMenuList.Broker : UserRole === 3 ? MineMenuList.Adviser : MineMenuList.Resident)
15
   const [IsPull, setPull] = useState(false)
16
   const [IsPull, setPull] = useState(false)
16
   const [ShowLogin, setShowLogin] = useState(false)
17
   const [ShowLogin, setShowLogin] = useState(false)
57
               {/* 用户信息 */}
58
               {/* 用户信息 */}
58
               <view className='UserInfo'>
59
               <view className='UserInfo'>
59
                 <view className='UserIcon'>
60
                 <view className='UserIcon'>
60
-                  <Image mode='aspectFill' className='centerLabel' src={require('../../assets/mine-icon18.png')} />
61
+                  <Image mode='aspectFill' className='centerLabel' src={PageProps.person.avatarurl || require('../../assets/mine-icon18.png')} />
61
                 </view>
62
                 </view>
62
                 <view className='OtherInfo'>
63
                 <view className='OtherInfo'>
63
                   <view className='Name'>
64
                   <view className='Name'>
64
                     <view>
65
                     <view>
65
-                      <text>用户姓名</text>
66
+                      <text>{PageProps.person.nickname}</text>
66
                       <view>
67
                       <view>
67
                         <text className='iconfont icon-bianji' onClick={() => { Taro.navigateTo({ url: `/pages/mine/userInfo/index` }) }}></text>
68
                         <text className='iconfont icon-bianji' onClick={() => { Taro.navigateTo({ url: `/pages/mine/userInfo/index` }) }}></text>
68
                         <text onClick={() => { Taro.navigateTo({ url: `/pages/mine/userInfo/index` }) }}>个人信息资料修改</text>
69
                         <text onClick={() => { Taro.navigateTo({ url: `/pages/mine/userInfo/index` }) }}>个人信息资料修改</text>

+ 6
- 6
src/routes.js View File

4
   /**********************************
4
   /**********************************
5
    *  Tab 页面
5
    *  Tab 页面
6
    *********************************/
6
    *********************************/
7
+  {
8
+    name: '帮我找房',
9
+    page: 'pages/index/helpToFindHouse/index',
10
+    pkg: 'main',
11
+    type: 'building',
12
+  },
7
   {
13
   {
8
     name: '首页',
14
     name: '首页',
9
     page: 'pages/index/index',
15
     page: 'pages/index/index',
66
     pkg: 'main',
72
     pkg: 'main',
67
     type: 'building',
73
     type: 'building',
68
   },
74
   },
69
-  {
70
-    name: '帮我找房',
71
-    page: 'pages/index/helpToFindHouse/index',
72
-    pkg: 'main',
73
-    type: 'building',
74
-  },
75
   {
75
   {
76
     name: '增值服务',
76
     name: '增值服务',
77
     page: 'pages/index/addedValueService/index',
77
     page: 'pages/index/addedValueService/index',