Bladeren bron

Merge branch 'main' of http://git.ycjcjy.com/marketing/miniapp into main

1002884655 3 jaren geleden
bovenliggende
commit
1c673d3a2d

+ 2
- 2
config/dev.js Bestand weergeven

@@ -3,8 +3,8 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 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 8
     WSS_HOST: '"wss://xlk.njyz.tech"',
9 9
     OSS_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',
10 10
     OSS_FAST_PATH: '"https://zhiyun-image.oss-accelerate.aliyuncs.com/"',

+ 4
- 4
config/prod.js Bestand weergeven

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

+ 4
- 0
src/constants/api.js Bestand weergeven

@@ -255,3 +255,7 @@ export const API_SHARE_INFOLIST = resolvePath('sharePersonInfoList')
255 255
 export const API_BIND_CUSTOMER = resolvePath('judgeBindCustomer')
256 256
 // 消息模板
257 257
 export const API_TEMPLATE_TYPE = resolvePath('template/of/')
258
+
259
+// 品牌商
260
+export const API_BRAND_LIST = resolvePath('brand')
261
+export const API_BRAND_INFO = resolvePath('brand')

+ 41
- 7
src/pages/index/brandDetail/index.jsx Bestand weergeven

@@ -1,14 +1,49 @@
1
-import { useState } from 'react'
1
+import { useEffect, useState } from 'react'
2 2
 import withLayout from '@/layout'
3 3
 import Taro from '@tarojs/taro'
4 4
 import { ScrollView, Image } from '@tarojs/components'
5 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 9
 import '@/assets/css/iconfont.css'
7
-import './index.scss'
8 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 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 47
   return (
13 48
     <view className='brandDetail'>
14 49
       <ScrollView scroll-y>
@@ -16,16 +51,15 @@ export default withLayout(() => {
16 51
 
17 52
           {/* 主图 */}
18 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 55
           </view>
21 56
 
22 57
           {/* 简介 */}
23 58
           <view className='Desc'>
24 59
             <view>
25
-              <Image mode='heightFix' src={null} className='Logo'></Image>
60
+              <Image mode='heightFix' src={getImgURL(brandInfo.brandLogo)} className='Logo'></Image>
26 61
               <view>
27
-                <text>“东原”</text>
28
-                <text>是一家以地产开发、商业运营、物业服务为核心的大型综合企业。始终坚持稳健创进的发展战略,深耕精选,布局全国一线及强二线城市,位列2020中国房地产开发企业TOP44。</text>
62
+                <text>{brandInfo.brandRemark}</text>
29 63
               </view>
30 64
             </view>
31 65
           </view>

+ 5
- 5
src/pages/index/brandDetail/index.scss Bestand weergeven

@@ -47,11 +47,11 @@
47 47
             >text {
48 48
               font-size: 22px;
49 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 Bestand weergeven

@@ -2,14 +2,12 @@ import { useState, useEffect } from 'react';
2 2
 import Taro from '@tarojs/taro';
3 3
 import withLayout from '@/layout';
4 4
 import { ScrollView, View, Block, Image } from '@tarojs/components';
5
+import { queryBrandList } from '@/services/common';
6
+import { getImgURL } from '@/utils/image';
5 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 8
 import './index.scss';
10 9
 
11 10
 export default withLayout(() => {
12
-  const dispatch = useDispatch();
13 11
   const [list, setList] = useState({});
14 12
 
15 13
   useEffect(() => {
@@ -17,26 +15,24 @@ export default withLayout(() => {
17 15
   }, [])
18 16
 
19 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 23
         } else {
26
-          prev[cur.initial] = [cur]
24
+          prev[cur.indexLetter] = [cur]
27 25
         }
28 26
         return prev
29 27
       }, {})
30 28
 
31
-      setList(t)
29
+      setList(lst)
32 30
     })
33 31
   }
34 32
 
35 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,9 +52,9 @@ export default withLayout(() => {
56 52
               <Block key={key}>
57 53
                 <View className='city-initial'>{key}</View>
58 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 58
                   </View>
63 59
                 ))}
64 60
               </Block>

+ 3
- 0
src/pages/index/brandList/index.scss Bestand weergeven

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

+ 1
- 1
src/pages/index/buildingDetail/components/DetailBottom/index.jsx Bestand weergeven

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

+ 4
- 1
src/pages/index/buildingDetail/index.jsx Bestand weergeven

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

+ 1
- 0
src/pages/index/buildingInfo/index.jsx Bestand weergeven

@@ -22,6 +22,7 @@ export default withLayout((props) => {
22 22
       { name: '均价', value: Info.price || '待定', key: '' },
23 23
       { name: '销售状态', value: Info.marketStatus || '待定', key: '' },
24 24
       { name: '开盘日期', value: formateDate(Info.openingDate) || '待定', key: '' },
25
+      { name: '交房时间', value: formateDate(Info.receivedDate) || '待定', key: '' },
25 26
       { name: '楼盘地址', value: Info.address || '暂无', key: '' },
26 27
     ],
27 28
     [

+ 1
- 1
src/pages/index/components/Menu/index.jsx Bestand weergeven

@@ -7,7 +7,7 @@ export default function Menu (props) {
7 7
   const List = [
8 8
     { name: '全部楼盘', id: 1, icon: require('../../../../assets/index-icon9.png'), router: '/pages/index/buildingList/index' },
9 9
     { name: '品牌地产', id: 2, icon: require('../../../../assets/index-icon8.png'), router: '/pages/index/brandList/index' },
10
-    { name: '近期开盘', id: 3, icon: require('../../../../assets/index-icon6.png'), router: `/pages/index/buildingList/index?type=2` },
10
+    { name: '近期开盘', id: 3, icon: require('../../../../assets/index-icon6.png'), router: `/pages/index/buildingList/index?isRecentOpening=1` },
11 11
     { name: '帮我找房', id: 4, icon: require('../../../../assets/index-icon1.png'), router: '/pages/index/helpToFindHouse/index' },
12 12
     { name: '增值服务', id: 5, icon: require('../../../../assets/index-icon16.png'), router: '/pages/index/addedValueService/index' },
13 13
     { name: '地图找房', id: 6, icon: require('../../../../assets/index-icon2.png'), router: '/pages/index/findHouseFromMap/index' },

+ 15
- 0
src/services/common.js Bestand weergeven

@@ -7,6 +7,8 @@ import {
7 7
   API_BURIED_POINT,
8 8
   API_CITY_LIST,
9 9
   API_TEMPLATE_TYPE,
10
+  API_BRAND_LIST,
11
+  API_BRAND_INFO,
10 12
   API_INDEX_ICONS
11 13
 } from "@/constants/api";
12 14
 
@@ -88,3 +90,16 @@ export const queryCityList = () => fetch({ url: API_CITY_LIST });
88 90
  */
89 91
 export const queryMessageTPL = type =>
90 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}`});