张延森 3 years ago
parent
commit
ea1e66d500

+ 2
- 2
config/dev.js View File

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"https://xlk.njyz.tech"',
7
-    // HOST: '"http://127.0.0.1:8081"',
6
+    // HOST: '"https://xlk.njyz.tech"',
7
+    HOST: '"http://127.0.0.1:8081"',
8
     WSS_HOST: '"wss://xlk.njyz.tech"',
8
     WSS_HOST: '"wss://xlk.njyz.tech"',
9
     OSS_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
9
     OSS_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
10
     OSS_FAST_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
10
     OSS_FAST_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',

+ 4
- 4
config/prod.js View File

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

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

250
 export const API_BIND_CUSTOMER = resolvePath('judgeBindCustomer')
250
 export const API_BIND_CUSTOMER = resolvePath('judgeBindCustomer')
251
 // 消息模板
251
 // 消息模板
252
 export const API_TEMPLATE_TYPE = resolvePath('template/of/')
252
 export const API_TEMPLATE_TYPE = resolvePath('template/of/')
253
+
254
+// 品牌商
255
+export const API_BRAND_LIST = resolvePath('brand')
256
+export const API_BRAND_INFO = resolvePath('brand')

+ 41
- 7
src/pages/index/brandDetail/index.jsx View File

1
-import { useState } from 'react'
1
+import { useEffect, useState } from 'react'
2
 import withLayout from '@/layout'
2
 import withLayout from '@/layout'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
 import { ScrollView, Image } from '@tarojs/components'
4
 import { ScrollView, Image } from '@tarojs/components'
5
 import ProjectListItem from '@/components/ProjectListItem/index'
5
 import ProjectListItem from '@/components/ProjectListItem/index'
6
+import { queryBrandInfo } from '@/services/common';
7
+import { getItemList } from '@/services/item';
8
+import { getImgURL } from '@/utils/image'
6
 import '@/assets/css/iconfont.css'
9
 import '@/assets/css/iconfont.css'
7
-import './index.scss'
8
 import ColumnTitle from '../components/ColumnTitle/index'
10
 import ColumnTitle from '../components/ColumnTitle/index'
11
+import './index.scss'
12
+
13
+export default withLayout((props) => {
14
+  const { router } = props
15
+  const { id } = router.params
9
 
16
 
10
-export default withLayout(() => {
11
   const [ProjectList, setProjectList] = useState([{}, {}])
17
   const [ProjectList, setProjectList] = useState([{}, {}])
18
+  const [brandInfo, setBrandInfo] = useState({})
19
+
20
+  const getList = (params) => {
21
+    Taro.showLoading()
22
+    getItemList({
23
+      brandId: id,
24
+      ...(params || {}),
25
+    }).then((res) => {
26
+      const { records } = res
27
+      setProjectList(records || {})
28
+      Taro.hideLoading()
29
+    }).catch((err) => {
30
+      console.error(err)
31
+      Taro.hideLoading()
32
+    })
33
+  }
34
+
35
+  useEffect(() => {
36
+    if (id) {
37
+      queryBrandInfo(id).then((res) => {
38
+        setBrandInfo(res || {})
39
+      }).catch((err) => {
40
+        console.error(err)
41
+      })
42
+
43
+      getList({ pageNumber: 1 })
44
+    }
45
+  }, [id])
46
+
12
   return (
47
   return (
13
     <view className='brandDetail'>
48
     <view className='brandDetail'>
14
       <ScrollView scroll-y>
49
       <ScrollView scroll-y>
16
 
51
 
17
           {/* 主图 */}
52
           {/* 主图 */}
18
           <view className='Top'>
53
           <view className='Top'>
19
-            <Image mode='scaleToFill' src={null} className='centerLabel'></Image>
54
+            <Image mode='scaleToFill' src={getImgURL(brandInfo.brandImg)} className='centerLabel'></Image>
20
           </view>
55
           </view>
21
 
56
 
22
           {/* 简介 */}
57
           {/* 简介 */}
23
           <view className='Desc'>
58
           <view className='Desc'>
24
             <view>
59
             <view>
25
-              <Image mode='heightFix' src={null} className='Logo'></Image>
60
+              <Image mode='heightFix' src={getImgURL(brandInfo.brandLogo)} className='Logo'></Image>
26
               <view>
61
               <view>
27
-                <text>“东原”</text>
28
-                <text>是一家以地产开发、商业运营、物业服务为核心的大型综合企业。始终坚持稳健创进的发展战略,深耕精选,布局全国一线及强二线城市,位列2020中国房地产开发企业TOP44。</text>
62
+                <text>{brandInfo.brandRemark}</text>
29
               </view>
63
               </view>
30
             </view>
64
             </view>
31
           </view>
65
           </view>

+ 5
- 5
src/pages/index/brandDetail/index.scss View File

47
             >text {
47
             >text {
48
               font-size: 22px;
48
               font-size: 22px;
49
               line-height: 48px;
49
               line-height: 48px;
50
-              &:first-child {
51
-                font-size: 48px;
52
-                font-weight: bold;
53
-                line-height: 1;
54
-              }
50
+              // &:first-child {
51
+              //   font-size: 48px;
52
+              //   font-weight: bold;
53
+              //   line-height: 1;
54
+              // }
55
             }
55
             }
56
           }
56
           }
57
         }
57
         }

+ 14
- 18
src/pages/index/brandList/index.jsx View File

2
 import Taro from '@tarojs/taro';
2
 import Taro from '@tarojs/taro';
3
 import withLayout from '@/layout';
3
 import withLayout from '@/layout';
4
 import { ScrollView, View, Block, Image } from '@tarojs/components';
4
 import { ScrollView, View, Block, Image } from '@tarojs/components';
5
+import { queryBrandList } from '@/services/common';
6
+import { getImgURL } from '@/utils/image';
5
 import '@/assets/css/iconfont.css';
7
 import '@/assets/css/iconfont.css';
6
-import { queryCityList } from '@/services/common';
7
-import { dispatchCitySelected } from '@/actions/city';
8
-import { useDispatch } from 'react-redux';
9
 import './index.scss';
8
 import './index.scss';
10
 
9
 
11
 export default withLayout(() => {
10
 export default withLayout(() => {
12
-  const dispatch = useDispatch();
13
   const [list, setList] = useState({});
11
   const [list, setList] = useState({});
14
 
12
 
15
   useEffect(() => {
13
   useEffect(() => {
17
   }, [])
15
   }, [])
18
 
16
 
19
   function initData () {
17
   function initData () {
20
-    queryCityList().then((cityList) => {
21
-      console.log(`ttt`, cityList)
22
-      const t = cityList.reduce((prev, cur) => {
23
-        if (prev[cur.initial]) {
24
-          prev[cur.initial].push(cur)
18
+    queryBrandList({ pageSize: 500 }).then((res) => {
19
+      const { records } = res
20
+      const lst = (records || []).reduce((prev, cur) => {
21
+        if (prev[cur.indexLetter]) {
22
+          prev[cur.indexLetter].push(cur)
25
         } else {
23
         } else {
26
-          prev[cur.initial] = [cur]
24
+          prev[cur.indexLetter] = [cur]
27
         }
25
         }
28
         return prev
26
         return prev
29
       }, {})
27
       }, {})
30
 
28
 
31
-      setList(t)
29
+      setList(lst)
32
     })
30
     })
33
   }
31
   }
34
 
32
 
35
   function handleSelected (item) {
33
   function handleSelected (item) {
36
-    dispatchCitySelected(item)(dispatch).then(() => {
37
-      Taro.navigateBack({
38
-        delta: 1,
39
-      })
34
+    Taro.navigateTo({
35
+      url: `/pages/index/brandDetail/index?id=${item.brandId}`,
40
     })
36
     })
41
   }
37
   }
42
 
38
 
56
               <Block key={key}>
52
               <Block key={key}>
57
                 <View className='city-initial'>{key}</View>
53
                 <View className='city-initial'>{key}</View>
58
                 {list[key].map((item) => (
54
                 {list[key].map((item) => (
59
-                  <View key={item.id} className='city-item' onClick={() => handleSelected(item)}>
60
-                    <Image mode='heightFix' src={null}></Image>
61
-                    <text>{item.shortname}</text>
55
+                  <View key={item.brandId} className='city-item' onClick={() => handleSelected(item)}>
56
+                    <Image mode='heightFix' src={getImgURL(item.brandLogo)}></Image>
57
+                    <text>{item.brandName}</text>
62
                   </View>
58
                   </View>
63
                 ))}
59
                 ))}
64
               </Block>
60
               </Block>

+ 3
- 0
src/pages/index/brandList/index.scss View File

14
   .city-item {
14
   .city-item {
15
     padding: 30px 50px;
15
     padding: 30px 50px;
16
     background: white;
16
     background: white;
17
+
17
     >image {
18
     >image {
18
       width: auto;
19
       width: auto;
19
       height: 44px;
20
       height: 44px;
20
       margin-right: 10px;
21
       margin-right: 10px;
22
+      vertical-align: middle;
21
     }
23
     }
22
     >text {
24
     >text {
23
       font-size: 34px;
25
       font-size: 34px;
24
       font-weight: bold;
26
       font-weight: bold;
27
+      vertical-align: middle;
25
     }
28
     }
26
   }
29
   }
27
 }
30
 }

+ 1
- 1
src/pages/index/buildingDetail/components/DetailBottom/index.jsx View File

2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import { useSelector } from 'react-redux'
3
 import { useSelector } from 'react-redux'
4
 import { Image } from '@tarojs/components'
4
 import { Image } from '@tarojs/components'
5
-import AuthRole from '@/components/auth/AuthRole'
5
+import AuthRole from '@/components/Auth/AuthRole'
6
 // import Poster from '@/components/Poster'
6
 // import Poster from '@/components/Poster'
7
 import { queryActivityList } from '@/services/activity'
7
 import { queryActivityList } from '@/services/activity'
8
 import { ROLE_CODE } from '@/constants/user'
8
 import { ROLE_CODE } from '@/constants/user'

+ 4
- 1
src/pages/index/buildingDetail/index.jsx View File

64
 
64
 
65
   }, [id, router.path])
65
   }, [id, router.path])
66
 
66
 
67
+  // 户型图
68
+  const houseTypeImages = (DetailInfo?.buildingApartment || []).filter(x => x.apartmentType === 'apart')
69
+
67
   return (
70
   return (
68
     <view className='Page buildingDetail flex-v'>
71
     <view className='Page buildingDetail flex-v'>
69
       <view className='flex-item'>
72
       <view className='flex-item'>
110
 
113
 
111
                 {/* 户型介绍 */}
114
                 {/* 户型介绍 */}
112
                 <view className='HouseTypeIntro' style={{minHeight: 0}}>
115
                 <view className='HouseTypeIntro' style={{minHeight: 0}}>
113
-                  <HouseTypeIntro Info={DetailInfo?.buildingApartment}></HouseTypeIntro>
116
+                  <HouseTypeIntro Info={houseTypeImages}></HouseTypeIntro>
114
                 </view>
117
                 </view>
115
 
118
 
116
                 {/* 营销活动 */}
119
                 {/* 营销活动 */}

+ 15
- 0
src/services/common.js View File

7
   API_BURIED_POINT,
7
   API_BURIED_POINT,
8
   API_CITY_LIST,
8
   API_CITY_LIST,
9
   API_TEMPLATE_TYPE,
9
   API_TEMPLATE_TYPE,
10
+  API_BRAND_LIST,
11
+  API_BRAND_INFO,
10
   API_INDEX_ICONS
12
   API_INDEX_ICONS
11
 } from "@/constants/api";
13
 } from "@/constants/api";
12
 
14
 
88
  */
90
  */
89
 export const queryMessageTPL = type =>
91
 export const queryMessageTPL = type =>
90
   fetch({ url: `${API_TEMPLATE_TYPE}/${type}` });
92
   fetch({ url: `${API_TEMPLATE_TYPE}/${type}` });
93
+
94
+
95
+/**
96
+ * 获取品牌房企列表
97
+ * @param {*}
98
+ */
99
+export const queryBrandList = (params) => fetch({ url: API_BRAND_LIST, params });
100
+
101
+/**
102
+ * 获取品牌房企列表
103
+ * @param {*}
104
+ */
105
+ export const queryBrandInfo = (id) => fetch({ url: `${API_BRAND_INFO}/${id}`});