浏览代码

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

Your Name 3 年前
父节点
当前提交
936941e104

+ 1
- 1
src/pages/index/activityDetail/index.scss 查看文件

@@ -327,8 +327,8 @@
327 327
             position: relative;
328 328
             overflow: hidden;
329 329
             margin-top: 40px;
330
+            padding: 0 30px;
330 331
             >.Title {
331
-              padding: 0 30px;
332 332
               position: relative;
333 333
               overflow: hidden;
334 334
               text-align: center;

+ 1
- 1
src/pages/index/addedValueService/formData.js 查看文件

@@ -9,7 +9,7 @@ const questions = [
9 9
   },
10 10
   {
11 11
     question: '房屋现状?',
12
-    key: 'status',
12
+    key: 'houseStatus',
13 13
     type: 'checkbox',
14 14
     result: '',
15 15
     resultId: null,

+ 1
- 1
src/pages/index/addedValueService/index.jsx 查看文件

@@ -36,7 +36,7 @@ export default function AddedValueService () {
36 36
     data.map((item) => {
37 37
       if(item.key === 'budget') {
38 38
         params.push({...item, key: 'minPrice', result: item.options[0] * 10000})
39
-        params.push({...item, key: 'maxPrice', result: item.result * 10000})
39
+        params.push({...item, key: 'maxPrice', result: item.result !== '' ? item.result * 10000 : 5000000})
40 40
       } else {
41 41
         if(item.result !== '' || item.resultId !== null) {
42 42
           params.push(item)

+ 50
- 47
src/pages/index/buildingDetail/components/BasicInfo/index.jsx 查看文件

@@ -1,4 +1,4 @@
1
-import { useState } from 'react'
1
+
2 2
 import Taro from '@tarojs/taro'
3 3
 import { ScrollView, Image } from '@tarojs/components'
4 4
 import AuthRole from '@/components/Auth/AuthRole'
@@ -48,41 +48,44 @@ export default function BasicInfo (props) {
48 48
       </view>
49 49
 
50 50
       {/* 项目列表 */}
51
-      <view className='ProjectList'>
52
-        <ScrollView scroll-x>
53
-          {
54
-            (Info.buildingProjectType || []).map((item, index) => (
55
-              <view className='ListItem' key={`List-${index}`}>
56
-                <Image mode='heightFix' src={require('@/assets/buildingDetail-icon4.jpg')} />
57
-                <view>
58
-                  <view>
59
-                    <text>项目类型:</text>
60
-                    <text className='active black'>{item.buildingTypeName}</text>
61
-                  </view>
62
-                  <view>
63
-                    <text>房屋产权:</text>
64
-                    <text className='active'>{item.rightsYear}年</text>
65
-                    <text>装修标准:</text>
66
-                    <text className='active'>{item.decoration || '暂无'}</text>
67
-                  </view>
51
+      {
52
+        (Info.buildingProjectType || []).length > 0 &&
53
+        <view className='ProjectList'>
54
+          <ScrollView scroll-x>
55
+            {
56
+              (Info.buildingProjectType || []).map((item, index) => (
57
+                <view className='ListItem' key={`List-${index}`}>
58
+                  <Image mode='heightFix' src={require('@/assets/buildingDetail-icon4.jpg')} />
68 59
                   <view>
69
-                    <text>项目参考价格:</text>
70
-                    {
71
-                      (item.startPrice || item.endPrice) &&
72
-                      <text className='active'>约{item.startPrice}-{item.endPrice}万/套</text>
73
-                    }
74
-                    {
75
-                      !(item.startPrice || item.endPrice) &&
76
-                      <text className='active'>暂无数据</text>
77
-                    }
60
+                    <view>
61
+                      <text>项目类型:</text>
62
+                      <text className='active black'>{item.buildingTypeName}</text>
63
+                    </view>
64
+                    <view>
65
+                      <text>房屋产权:</text>
66
+                      <text className='active'>{item.rightsYear}年</text>
67
+                      <text>装修标准:</text>
68
+                      <text className='active'>{item.decoration || '暂无'}</text>
69
+                    </view>
70
+                    <view>
71
+                      <text>项目参考价格:</text>
72
+                      {
73
+                        (item.startPrice || item.endPrice) &&
74
+                        <text className='active'>约{item.startPrice}-{item.endPrice}万/套</text>
75
+                      }
76
+                      {
77
+                        !(item.startPrice || item.endPrice) &&
78
+                        <text className='active'>暂无数据</text>
79
+                      }
80
+                    </view>
81
+                    <text className='SaleStatus active'>{item.marketStatus}</text>
78 82
                   </view>
79
-                  <text className='SaleStatus active'>{item.marketStatus}</text>
80 83
                 </view>
81
-              </view>
82
-            ))
83
-          }
84
-        </ScrollView>
85
-      </view>
84
+              ))
85
+            }
86
+          </ScrollView>
87
+        </view>
88
+      }
86 89
 
87 90
       {/* 隔断 */}
88 91
       <view className='CutLine'></view>
@@ -151,20 +154,20 @@ export default function BasicInfo (props) {
151 154
 
152 155
       {/* 围观 */}
153 156
       <view className='Views flex-h'>
154
-          <text>{Info.pvNum || 0}人围观</text>
155
-          <view className='flex-item'>
156
-            {
157
-              (Info?.uvList?.records || []).slice(0, 8).map((item, index) => (
158
-                <view key={`ViewsItem-${index}`}>
159
-                  <Image mode='aspectFill' className='centerLabel' src={item.photoOravatar} />
160
-                </view>
161
-              ))
162
-            }
163
-            {
164
-              (Info?.uvList?.records || []).length > 8 &&
165
-              <text>...</text>
166
-            }
167
-          </view>
157
+        <text>{Info.pvNum || 0}人围观</text>
158
+        <view className='flex-item'>
159
+          {
160
+            (Info?.uvList?.records || []).slice(0, 8).map((item, index) => (
161
+              <view key={`ViewsItem-${index}`}>
162
+                <Image mode='aspectFill' className='centerLabel' src={item.photoOravatar} />
163
+              </view>
164
+            ))
165
+          }
166
+          {
167
+            (Info?.uvList?.records || []).length > 8 &&
168
+            <text>...</text>
169
+          }
170
+        </view>
168 171
       </view>
169 172
 
170 173
       {/* 互动 */}

+ 26
- 25
src/pages/index/buildingDetail/components/DetailBottom/index.jsx 查看文件

@@ -2,15 +2,14 @@ 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'
6
-// import Poster from '@/components/Poster'
7 5
 import { queryActivityList } from '@/services/activity'
8
-import { ROLE_CODE } from '@/constants/user'
9 6
 import './index.scss'
10 7
 
11 8
 export default function DetailBottom (props) {
12 9
   const { Info = {}, onPoster } = props
13 10
 
11
+  const user = useSelector(state => state.user)
12
+
14 13
   // 当前推荐置业
15 14
   const { consultant } = useSelector(s => s.system)
16 15
   // const [showPoster, setShowPoster] = useState(false)
@@ -40,19 +39,27 @@ export default function DetailBottom (props) {
40 39
   }
41 40
 
42 41
   const handleRecommender = () => {
43
-    const params = `buildingId=${Info?.buildingId}&buildingName=${Info?.buildingName}`
42
+    if (user.userInfo.person.personType === 'Realty Consultant') {
43
+      const params = `buildingId=${Info?.buildingId}&buildingName=${Info?.buildingName}`
44 44
 
45
-    Taro.navigateTo({
46
-      url: `/pages/mine/recommendUser/index?${params}`
47
-    })
45
+      Taro.navigateTo({
46
+        url: `/pages/mine/recommendUser/index?${params}`
47
+      })
48
+    } else {
49
+      Taro.showToast({ title: '该功能暂不能为您提供服务', icon: 'none', duration: 2000 })
50
+    }
48 51
   }
49 52
 
50 53
   const handleTuanfang = () => {
51
-    const id = actList[0].dynamicId
54
+    if ((actList || []).length > 0) {
55
+      const id = actList[0].dynamicId
52 56
 
53
-    Taro.navigateTo({
54
-      url: `/pages/index/activityDetail/index?id=${id}`
55
-    })
57
+      Taro.navigateTo({
58
+        url: `/pages/index/activityDetail/index?id=${id}`
59
+      })
60
+    } else {
61
+      Taro.showToast({ title: '该功能暂不能为您提供服务', icon: 'none', duration: 2000 })
62
+    }
56 63
   }
57 64
 
58 65
   useEffect(() => {
@@ -75,20 +82,14 @@ export default function DetailBottom (props) {
75 82
             <Image mode='heightFix' src={require('@/assets/buildingDetail-icon3.png')}></Image>
76 83
             <text>一键海报</text>
77 84
           </view>
78
-          {
79
-            actList.length > 0 && (
80
-              <view className='Item' onClick={handleTuanfang}>
81
-                <Image mode='heightFix' src={require('@/assets/buildingDetail-icon1.png')}></Image>
82
-                <text>一键带看</text>
83
-              </view>
84
-            )
85
-          }
86
-          <AuthRole role={ROLE_CODE.CONSULTANT}>
87
-            <view className='Item' onClick={handleRecommender}>
88
-              <Image mode='heightFix' src={require('@/assets/buildingDetail-icon2.png')}></Image>
89
-              <text>一键推荐</text>
90
-            </view>
91
-          </AuthRole>
85
+          <view className='Item' onClick={handleTuanfang}>
86
+            <Image mode='heightFix' src={require('@/assets/buildingDetail-icon1.png')}></Image>
87
+            <text>一键带看</text>
88
+          </view>
89
+          <view className='Item' onClick={handleRecommender}>
90
+            <Image mode='heightFix' src={require('@/assets/buildingDetail-icon2.png')}></Image>
91
+            <text>一键推荐</text>
92
+          </view>
92 93
         </view>
93 94
         <view className='Btn'>
94 95
           <text onClick={handleChat}>一键咨询</text>

+ 36
- 18
src/pages/index/buildingDetail/index.jsx 查看文件

@@ -92,19 +92,28 @@ export default withLayout((props) => {
92 92
                 </view>
93 93
 
94 94
                 {/* 特价房源 */}
95
-                <view className='SpecialPriceHouse' style={{minHeight: 0}}>
96
-                  <SpecialPriceHouse List={DetailInfo?.specialRoomList}></SpecialPriceHouse>
97
-                </view>
95
+                {
96
+                  (DetailInfo?.specialRoomList || []).length > 0 &&
97
+                  <view className='SpecialPriceHouse' style={{minHeight: 0}}>
98
+                    <SpecialPriceHouse List={DetailInfo?.specialRoomList}></SpecialPriceHouse>
99
+                  </view>
100
+                }
98 101
 
99 102
                 {/* 项目动态 */}
100
-                <view className='ProjectDynamic' style={{minHeight: 0}}>
101
-                  <ProjectDynamic List={DetailInfo?.trendList}></ProjectDynamic>
102
-                </view>
103
+                {
104
+                  (DetailInfo?.trendList || []).length > 0 &&
105
+                  <view className='ProjectDynamic' style={{minHeight: 0}}>
106
+                    <ProjectDynamic List={DetailInfo?.trendList}></ProjectDynamic>
107
+                  </view>
108
+                }
103 109
 
104 110
                 {/* 置业顾问 */}
105
-                <view className='PropertyConsultant' style={{minHeight: 0}}>
106
-                  <PropertyConsultant Info={DetailInfo}></PropertyConsultant>
107
-                </view>
111
+                {
112
+                  (DetailInfo?.consultants || []).length > 0 &&
113
+                  <view className='PropertyConsultant' style={{minHeight: 0}}>
114
+                    <PropertyConsultant Info={DetailInfo}></PropertyConsultant>
115
+                  </view>
116
+                }
108 117
 
109 118
                 {/* 位置及周边 */}
110 119
                 <view className='Periphery' style={{minHeight: 0}}>
@@ -112,9 +121,12 @@ export default withLayout((props) => {
112 121
                 </view>
113 122
 
114 123
                 {/* 户型介绍 */}
115
-                <view className='HouseTypeIntro' style={{minHeight: 0}}>
116
-                  <HouseTypeIntro Info={houseTypeImages}></HouseTypeIntro>
117
-                </view>
124
+                {
125
+                  (houseTypeImages.length || []) > 0 &&
126
+                  <view className='HouseTypeIntro' style={{minHeight: 0}}>
127
+                    <HouseTypeIntro Info={houseTypeImages}></HouseTypeIntro>
128
+                  </view>
129
+                }
118 130
 
119 131
                 {/* 营销活动 */}
120 132
                 <view className='MarketingActivity' style={{minHeight: 0}}>
@@ -122,9 +134,12 @@ export default withLayout((props) => {
122 134
                 </view>
123 135
 
124 136
                 {/* 直播活动 */}
125
-                <view className='LivingActivity' style={{minHeight: 0}}>
126
-                  <LivingActivity Info={DetailInfo}></LivingActivity>
127
-                </view>
137
+                {
138
+                  (DetailInfo?.liveActivityList || []).length > 0 &&
139
+                  <view className='LivingActivity' style={{minHeight: 0}}>
140
+                    <LivingActivity Info={DetailInfo}></LivingActivity>
141
+                  </view>
142
+                }
128 143
 
129 144
                 {/* 新鲜资讯 */}
130 145
                 <view className='News' style={{minHeight: 0}}>
@@ -132,9 +147,12 @@ export default withLayout((props) => {
132 147
                 </view>
133 148
 
134 149
                 {/* 相册 */}
135
-                <view className='Pictures' style={{ display: PictureList.length ? 'block' : 'none' }}>
136
-                  <Pictures List={PictureList}></Pictures>
137
-                </view>
150
+                {
151
+                  (PictureList || []).length > 0 &&
152
+                  <view className='Pictures'>
153
+                    <Pictures List={PictureList}></Pictures>
154
+                  </view>
155
+                }
138 156
 
139 157
                 {/* 免责声明 */}
140 158
                 <Disclaimer />

+ 4
- 2
src/pages/index/helpToFindHouse/index.jsx 查看文件

@@ -48,7 +48,7 @@ export default withLayout(() => {
48 48
     data.map((item) => {
49 49
       if (item.key === 'budget') {
50 50
         params.push({ ...item, key: 'minPrice', result: CurrentDemandId === 2 ? item.options[0] : item.options[0] * 10000 })
51
-        params.push({ ...item, key: 'maxPrice', result: CurrentDemandId === 2 ? item.result : item.result * 10000 })
51
+        params.push({ ...item, key: 'maxPrice', result: CurrentDemandId === 2 ? item.result === '' ? 5000000 : item.result : item.result === '' ? 5000000 : item.result * 10000 })
52 52
       } else {
53 53
         if (item.result !== '' || item.resultId !== null) {
54 54
           params.push(item)
@@ -56,7 +56,9 @@ export default withLayout(() => {
56 56
       }
57 57
     })
58 58
     params.push({ question: '创建人小程序人员', result: user?.userInfo?.person?.personId, key: 'personId' })
59
-    params.push({ question: '意向区域', result: AreaInfo.id, key: 'intentArea' })
59
+    if(CurrentDemandId !== 3) {
60
+      params.push({ question: '意向区域', result: AreaInfo.id, key: 'intentArea' })
61
+    }
60 62
     let payload = {}
61 63
     params.map((item) => {
62 64
       payload[item.key] = item.result || item.resultId

+ 5
- 3
src/pages/mine/addCustomer/index.jsx 查看文件

@@ -62,9 +62,11 @@ export default withLayout((props) => {
62 62
         params = { ...FormData, sex: SexId, intention: BuildingId, realtyConsultant: CardId }
63 63
       }
64 64
       fetch({ url, method: 'post', payload: params }).then(() => {
65
-        Taro.showToast({ title: '添加成功', icon: 'none' })
66
-        Taro.navigateBack({ delta: 1 })
67
-        setCanSubmit(false)
65
+        Taro.showToast({ title: '添加成功', icon: 'none', duration: 2000 })
66
+        setTimeout(() => {
67
+          Taro.navigateBack({ delta: 1 })
68
+          setCanSubmit(false)
69
+        }, 2000)
68 70
       }).catch(() => {
69 71
         setCanSubmit(false)
70 72
       })