Sfoglia il codice sorgente

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

Your Name 3 anni fa
parent
commit
63e338daf4
41 ha cambiato i file con 1430 aggiunte e 1095 eliminazioni
  1. 4
    4
      config/dev.js
  2. 7
    7
      config/prod.js
  3. 2
    2
      project.config.json
  4. 1
    0
      src/constants/api.js
  5. 1
    1
      src/pages/chat/index.jsx
  6. 1
    1
      src/pages/index/activityDetail/CountDown.jsx
  7. 7
    6
      src/pages/index/activityDetail/index.jsx
  8. 14
    14
      src/pages/index/addedValueService/formData.js
  9. 94
    75
      src/pages/index/addedValueService/index.jsx
  10. 155
    147
      src/pages/index/addedValueService/index.scss
  11. 1
    1
      src/pages/index/buildingAround/index.jsx
  12. 7
    7
      src/pages/index/buildingList/components/FilterForPrice/index.jsx
  13. 1
    0
      src/pages/index/buildingList/index.jsx
  14. 1
    1
      src/pages/index/buildingTakeLook/index.jsx
  15. 1
    1
      src/pages/index/components/ActivityListItem/index.jsx
  16. 29
    26
      src/pages/index/helpToFindHouse/components/BuyHouse/formData.js
  17. 110
    64
      src/pages/index/helpToFindHouse/components/BuyHouse/index.jsx
  18. 153
    126
      src/pages/index/helpToFindHouse/components/BuyHouse/index.scss
  19. 1
    1
      src/pages/index/helpToFindHouse/components/HousePurchasing/formData.js
  20. 89
    63
      src/pages/index/helpToFindHouse/components/HousePurchasing/index.jsx
  21. 154
    127
      src/pages/index/helpToFindHouse/components/HousePurchasing/index.scss
  22. 1
    1
      src/pages/index/helpToFindHouse/components/RentingHouse/formData.js
  23. 112
    86
      src/pages/index/helpToFindHouse/components/RentingHouse/index.jsx
  24. 154
    128
      src/pages/index/helpToFindHouse/components/RentingHouse/index.scss
  25. 25
    21
      src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.jsx
  26. 105
    72
      src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.scss
  27. 73
    30
      src/pages/index/helpToFindHouse/index.jsx
  28. 52
    59
      src/pages/index/helpToFindHouse/index.scss
  29. 3
    2
      src/pages/index/newsList/index.jsx
  30. 3
    1
      src/pages/mine/addCustomer/components/BuildingPicker.jsx
  31. 4
    0
      src/pages/mine/feedBack/index.jsx
  32. 2
    0
      src/pages/mine/index.jsx
  33. 1
    1
      src/pages/mine/myRecommendCode/index.jsx
  34. 1
    1
      src/routes.js
  35. 2
    1
      src/subpackages/pages/consultant/myHomepage/index.config.js
  36. 26
    12
      src/subpackages/pages/consultant/myHomepage/index.jsx
  37. 6
    1
      src/subpackages/pages/consultant/myHomepage/index.scss
  38. 1
    1
      src/subpackages/pages/marketing/components/ResidentListItem/index.jsx
  39. 1
    1
      src/utils/chatDate.js
  40. 4
    2
      src/utils/hooks/useLike.js
  41. 21
    1
      src/utils/image.js

+ 4
- 4
config/dev.js Vedi File

@@ -3,12 +3,12 @@ module.exports = {
3 3
     NODE_ENV: '"development"'
4 4
   },
5 5
   defineConstants: {
6
-    // HOST: '"https://xlk.njyz.tech"',
7
-    HOST: '"https://xlj.newlandsh.com"',
6
+    HOST: '"https://xlk.njyz.tech"',
7
+    // HOST: '"https://www.newhousehold.cn"',
8 8
     // HOST: '"http://127.0.0.1:8567"',
9 9
     WSS_HOST: '"wss://xlk.njyz.tech"',
10
-    OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
11
-    OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
10
+    OSS_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',
11
+    OSS_FAST_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',
12 12
     ICON_FONT: '"https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/css/iconfont.ttf"',
13 13
     Version: '"V0.0.20"'
14 14
   },

+ 7
- 7
config/prod.js Vedi File

@@ -3,14 +3,14 @@ module.exports = {
3 3
     NODE_ENV: '"production"'
4 4
   },
5 5
   defineConstants: {
6
-    // HOST: '"https://xlj.newlandsh.com"', //正式
7
-    // WSS_HOST: '"wss://xlj.newlandsh.com"',
8
-    HOST: '"https://xlk.njyz.tech"', //正式
9
-    WSS_HOST: '"wss://xlk.njyz.tech"',
10
-    OSS_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
11
-    OSS_FAST_PATH: '"https://xlk-assets.oss-accelerate.aliyuncs.com/"',
6
+    HOST: '"https://www.newhousehold.cn"', //正式
7
+    WSS_HOST: '"wss://www.newhousehold.cn"',
8
+    // HOST: '"https://xlk.njyz.tech"', //正式
9
+    // WSS_HOST: '"wss://xlk.njyz.tech"',
10
+    OSS_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',
11
+    OSS_FAST_PATH: '"https://xlk-assets.oss-cn-shanghai.aliyuncs.com/"',
12 12
     ICON_FONT: '"https://yz-websit.oss-cn-hangzhou.aliyuncs.com/xlk/css/iconfont.ttf"',
13
-    Version: '"V0.0.53-20210813"'
13
+    Version: '"V0.0.58-20210819"'
14 14
   },
15 15
   mini: {},
16 16
   h5: {

+ 2
- 2
project.config.json Vedi File

@@ -2,7 +2,7 @@
2 2
 	"miniprogramRoot": "dist/",
3 3
 	"projectname": "miniapp",
4 4
 	"description": "",
5
-	"appid": "wxc96058d57e77f373",
5
+	"appid": "wxe44244d1a5ea3364",
6 6
 	"setting": {
7 7
 		"urlCheck": false,
8 8
 		"es6": false,
@@ -27,7 +27,7 @@
27 27
 			"outputPath": ""
28 28
 		},
29 29
 		"useIsolateContext": true,
30
-		"useCompilerModule": true,
30
+		"useCompilerModule": false,
31 31
 		"userConfirmedUseCompilerModuleSwitch": false
32 32
 	},
33 33
 	"compileType": "miniprogram",

+ 1
- 0
src/constants/api.js Vedi File

@@ -74,6 +74,7 @@ export const API_UPLOAD_IMAGE = resolvePath('image')
74 74
 export const API_CHAT_READED = resolvePath('chat/message')
75 75
 export const API_CHAT_UNREADED = resolvePath('chat/unReaded')
76 76
 
77
+export const API_CONSULTANT = resolvePath('consultant')
77 78
 
78 79
 // card
79 80
 export const API_CARDS_LIST = resolvePath('cards')

+ 1
- 1
src/pages/chat/index.jsx Vedi File

@@ -70,7 +70,7 @@ export default withLayout((props) => {
70 70
                 <view className='flex-item'>
71 71
                   <view className='flex-h'>
72 72
                     <text className='flex-item'>{item.name}</text>
73
-                    <text>{formatDate(item.createDate, 'yyyy/M/d')}</text>
73
+                    <text>{formatDate(item.createDate, 'yyyy/MM/dd')}</text>
74 74
                   </view>
75 75
                   <view className='Msg'>
76 76
                     <text>{item.messageType === 'text' ? item.message : '[图片]'}</text>

+ 1
- 1
src/pages/index/activityDetail/CountDown.jsx Vedi File

@@ -7,7 +7,7 @@ export default (props) => {
7 7
 
8 8
   return (
9 9
     <view className='CountDown'>
10
-      <text>距离结束还有</text>
10
+      <text>距离报名结束还有</text>
11 11
       <text className='Red'>{CountDown[1]||0}</text>
12 12
       <text>天</text>
13 13
       <text className='Number' style={{ marginLeft: '40rpx' }}>{CountDown[2]||0}</text>

+ 7
- 6
src/pages/index/activityDetail/index.jsx Vedi File

@@ -100,7 +100,8 @@ export default withLayout((props) => {
100 100
     {
101 101
       title: shareContent.shareContentTitle || detail?.title,
102 102
       path: `${router.path}?${paramsRef.current}`,
103
-      image: shareContent.shareContentImg || getImgURL(detail?.imgUrl),
103
+      // image: shareContent.shareContentImg || getImgURL(detail?.imgUrl),
104
+      image: '',
104 105
     },
105 106
     fullTrackData
106 107
   );
@@ -164,20 +165,20 @@ export default withLayout((props) => {
164 165
         </view>
165 166
         <text className='Time'>
166 167
           报名截止时间:
167
-          {formatDate(detail.enlistEnd, 'yyyy/M/d')}
168
+          {formatDate(detail.enlistEnd, 'yyyy/MM/dd')}
168 169
         </text>
169 170
         <text className='Name'>{detail.title}</text>
170 171
         <view className='flex-h Address'>
171
-          <text>地址:</text>
172
+          <text>活动地址:</text>
172 173
           <view className='flex-item'>
173 174
             <text>{detail.address}</text>
174 175
           </view>
175 176
         </view>
176 177
         <view className='flex-h Date'>
177
-          <text>时间:</text>
178
+          <text>活动时间:</text>
178 179
           <view className='flex-item'>
179 180
             <text>
180
-              {`${formatDate(detail.startDate, 'yyyy/M/d')} - ${formatDate(detail.endDate, 'yyyy/M/d')}`}
181
+              {`${formatDate(detail.startDate, 'yyyy/MM/dd')} - ${formatDate(detail.endDate, 'yyyy/MM/dd')}`}
181 182
             </text>
182 183
           </view>
183 184
         </view>
@@ -204,7 +205,7 @@ export default withLayout((props) => {
204 205
             </view>
205 206
           </view>
206 207
           <text className='Price'>{detail.groupBuyPrice || '价格待定'}</text>
207
-          <text className='Time'>时间:{formatDate(detail.startDate, 'yyyy/M/d')} - {formatDate(detail.endDate, 'yyyy/M/d')}</text>
208
+          <text className='Time'>活动时间:{formatDate(detail.startDate, 'yyyy/MM/dd')} - {formatDate(detail.endDate, 'yyyy/MM/dd')}</text>
208 209
         </view>
209 210
         <view className='Option'>
210 211
           <view>

+ 14
- 14
src/pages/index/addedValueService/formData.js Vedi File

@@ -15,9 +15,9 @@ const questions = [
15 15
     resultId: null,
16 16
     options: [
17 17
       { name: '毛坯', id: 1 },
18
-      { name: '旧房装修5年以内', id: 2 },
19
-      { name: '旧房装修5-10年', id: 3 },
20
-      { name: '旧房装修10年以上', id: 4 }
18
+      { name: '旧房装修\n5年以内', id: 2 },
19
+      { name: '旧房装修\n5-10年', id: 3 },
20
+      { name: '旧房装修\n10年以上', id: 4 }
21 21
     ]
22 22
   },
23 23
   {
@@ -46,9 +46,9 @@ const questions = [
46 46
     options: [
47 47
       { name: '只做设计', id: 1 },
48 48
       { name: '材料全包', id: 2 },
49
-      { name: '包施工 不包材料', id: 3 },
50
-      { name: '施工包辅材 不包主材', id: 4 },
51
-      { name: '全包(设计/施工/主材..)', id: 5 }
49
+      { name: '包施工\n不包材料', id: 3 },
50
+      { name: '施工包辅材\n不包主材', id: 4 },
51
+      { name: '全包(设计\n/施工/主材..)', id: 5 }
52 52
     ]
53 53
   },
54 54
   {
@@ -93,10 +93,10 @@ const questions = [
93 93
     result: [],
94 94
     resultId: null,
95 95
     options: [
96
-      { name: '设计凸显个性', id: 1, selected: false },
97
-      { name: '智能家居齐全', id: 2, selected: false },
98
-      { name: '强大的收纳功能', id: 3, selected: false },
99
-      { name: '方便清洁和整理', id: 4, selected: false },
96
+      { name: '设计凸显\n个性', id: 1, selected: false },
97
+      { name: '智能家居\n齐全', id: 2, selected: false },
98
+      { name: '强大的\n收纳功能', id: 3, selected: false },
99
+      { name: '方便清洁\n和整理', id: 4, selected: false },
100 100
       { name: '温馨舒适', id: 5, selected: false },
101 101
       { name: '品质生活', id: 6, selected: false },
102 102
       { name: '其他', id: 7, selected: false }
@@ -129,11 +129,11 @@ const questions = [
129 129
     resultId: null,
130 130
     options: [
131 131
       { name: '会', id: 1 },
132
-      { name: '非常实用高效', id: 2 },
133
-      { name: '会选择感兴趣部分', id: 3 },
132
+      { name: '非常实用\n高效', id: 2 },
133
+      { name: '会选择感\n兴趣部分', id: 3 },
134 134
       { name: '不会选择', id: 4 },
135
-      { name: '新奇多过实用', id: 5 },
136
-      { name: '暂时不了解智能家居', id: 6 },
135
+      { name: '新奇多过\n实用', id: 5 },
136
+      { name: '暂时不了解\n智能家居', id: 6 },
137 137
       { name: '其他', id: 7 }
138 138
     ]
139 139
   }

+ 94
- 75
src/pages/index/addedValueService/index.jsx Vedi File

@@ -4,6 +4,7 @@ import { Image, Slider, Textarea, ScrollView } from '@tarojs/components'
4 4
 import { fetch } from '@/utils/request'
5 5
 import { API_HELP_FIND_HOUSE_SUBMIT } from '@/constants/api'
6 6
 import { useSelector } from 'react-redux'
7
+import Taro from '@tarojs/taro'
7 8
 import './index.scss'
8 9
 import questions from './formData'
9 10
 import SubmitBuyHouseResult from '../helpToFindHouse/components/SubmitBuyHouseResult/index'
@@ -36,7 +37,7 @@ export default function AddedValueService () {
36 37
     data.map((item) => {
37 38
       if (item.key === 'budget') {
38 39
         params.push({ ...item, key: 'minPrice', result: item.options[0] * 10000 })
39
-        params.push({ ...item, key: 'maxPrice', result: item.result !== '' ? item.result * 10000 : 5000000 })
40
+        params.push({ ...item, key: 'maxPrice', result: item.result !== '' ? item.result * 10000 : 10000000 })
40 41
       } else {
41 42
         if (item.result !== '' || item.resultId !== null) {
42 43
           params.push(item)
@@ -49,7 +50,7 @@ export default function AddedValueService () {
49 50
       payload[item.key] = item.result || item.resultId
50 51
     })
51 52
     fetch({ url: API_HELP_FIND_HOUSE_SUBMIT, method: 'post', payload: { ...payload, questionnaire: JSON.stringify(params), type: 4 } }).then((res) => {
52
-      setResultList(res.taBuildingList || [])
53
+      setResultList(res?.taBuildingList || [])
53 54
       setShowPopup(true)
54 55
     })
55 56
   }
@@ -90,20 +91,34 @@ export default function AddedValueService () {
90 91
   }
91 92
 
92 93
   const NextStep = () => {
93
-    if (StepId < 4) {
94
-      setStepId(StepId + 1)
95
-    } else {
96
-      let Arr = [...FormData]
97
-      Arr.map((item) => {
98
-        if (item.type === 'checkboxs') {
99
-          item.options.map((subItem) => {
100
-            if (subItem.selected) {
101
-              item.result.push(subItem.name)
102
-            }
103
-          })
94
+    let Bool = true
95
+    let IndexArr = []
96
+    FormData.map((item, index) => {
97
+      if(index >= StepRange[0] && index < StepRange[1]) {
98
+        if(!!item.required && item.result === '') {
99
+          Bool = false
100
+          IndexArr.push(index)
104 101
         }
105
-      })
106
-      SubmitForm(Arr)
102
+      }
103
+    })
104
+    if(Bool) {
105
+      if (StepId < 4) {
106
+        setStepId(StepId + 1)
107
+      } else {
108
+        let Arr = [...FormData]
109
+        Arr.map((item) => {
110
+          if (item.type === 'checkboxs') {
111
+            item.options.map((subItem) => {
112
+              if (subItem.selected) {
113
+                item.result.push(subItem.name)
114
+              }
115
+            })
116
+          }
117
+        })
118
+        SubmitForm(Arr)
119
+      }
120
+    } else {
121
+      Taro.showToast({title: `请选择${FormData[IndexArr[0]].question}`, icon: 'none'})
107 122
     }
108 123
   }
109 124
 
@@ -114,79 +129,83 @@ export default function AddedValueService () {
114 129
   }
115 130
 
116 131
   return (
117
-    <view className='components AddedValueService'>
132
+    <view className='components AddedValueService flex-v'>
118 133
       {
119 134
         ShowPopup &&
120
-        <SubmitBuyHouseResult List={ResultList.slice(0, 1)} ShowResult={false}></SubmitBuyHouseResult>
135
+        <SubmitBuyHouseResult List={ResultList} ShowResult={false}></SubmitBuyHouseResult>
121 136
       }
122
-      <ScrollView scroll-y>
123
-        <view className='PageContent'>
124
-          {
125
-            FormData.map((item, index) => (
126
-              <view className='Step' key={`Form-${index}`}>
127
-                {
128
-                  index >= StepRange[0] && index < StepRange[1] &&
129
-                  <view>
130
-                    <text>{item.question}</text>
137
+      <view className='flex-item'>
138
+        <view>
139
+          <ScrollView scrollY>
140
+            <view className='SubContent'>
141
+              {
142
+                FormData.map((item, index) => (
143
+                  <view className='Step' key={`Form-${index}`}>
131 144
                     {
132
-                      item.type === 'checkboxs' &&
133
-                      <view className='CheckList'>
145
+                      index >= StepRange[0] && index < StepRange[1] &&
146
+                      <view>
147
+                        <text>{item.question}</text>
134 148
                         {
135
-                          item.options.map((subItem, subIndex) => (
136
-                            <view key={`${item.key}-${subIndex}`} className={subItem.selected ? 'active' : ''} onClick={CutCheckboxs(index, subItem, subIndex)}>
137
-                              <text>{subItem.name}</text>
138
-                              <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
139
-                            </view>
140
-                          ))
149
+                          item.type === 'checkboxs' &&
150
+                          <view className='CheckList'>
151
+                            {
152
+                              item.options.map((subItem, subIndex) => (
153
+                                <view key={`${item.key}-${subIndex}`} className={subItem.selected ? 'active' : ''} onClick={CutCheckboxs(index, subItem, subIndex)}>
154
+                                  <text className='centerLabel'>{subItem.name}</text>
155
+                                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
156
+                                </view>
157
+                              ))
158
+                            }
159
+                          </view>
160
+                        }
161
+                        {
162
+                          item.type === 'checkbox' &&
163
+                          <view className='CheckList'>
164
+                            {
165
+                              item.options.map((subItem, subIndex) => (
166
+                                <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
167
+                                  <text className='centerLabel'>{subItem.name}</text>
168
+                                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
169
+                                </view>
170
+                              ))
171
+                            }
172
+                          </view>
173
+                        }
174
+                        {
175
+                          item.type === 'checkbox' && item.remark !== undefined &&
176
+                          <view className='Textarea'>
177
+                            <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { remarkInput(e, index) }} />
178
+                          </view>
141 179
                         }
142
-                      </view>
143
-                    }
144
-                    {
145
-                      item.type === 'checkbox' &&
146
-                      <view className='CheckList'>
147 180
                         {
148
-                          item.options.map((subItem, subIndex) => (
149
-                            <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
150
-                              <text>{subItem.name}</text>
151
-                              <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
181
+                          item.type === 'range' &&
182
+                          <view className='RangeList flex-h'>
183
+                            <view className='flex-item'>
184
+                              <Slider activeColor='#193C83' block-color='#fff' value={item.result - 0} onChange={(e) => { Rangehange(e, index) }} min={item.options[0]} max={item.options[1]} show-value />
152 185
                             </view>
153
-                          ))
186
+                            <text>万</text>
187
+                          </view>
188
+                        }
189
+                        {
190
+                          item.type === 'textarea' &&
191
+                          <view className='Textarea'>
192
+                            <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { textareaInput(e, index) }} />
193
+                          </view>
154 194
                         }
155
-                      </view>
156
-                    }
157
-                    {
158
-                      item.type === 'checkbox' && item.remark !== undefined &&
159
-                      <view className='Textarea'>
160
-                        <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { remarkInput(e, index) }} />
161
-                      </view>
162
-                    }
163
-                    {
164
-                      item.type === 'range' &&
165
-                      <view className='RangeList flex-h'>
166
-                        <view className='flex-item'>
167
-                          <Slider activeColor='#193C83' block-color='#fff' onChange={(e) => { Rangehange(e, index) }} min={item.options[0]} max={item.options[1]} show-value />
168
-                        </view>
169
-                        <text>万</text>
170
-                      </view>
171
-                    }
172
-                    {
173
-                      item.type === 'textarea' &&
174
-                      <view className='Textarea'>
175
-                        <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { textareaInput(e, index) }} />
176 195
                       </view>
177 196
                     }
178 197
                   </view>
179
-                }
180
-              </view>
181
-            ))
182
-          }
183
-
184
-          <view className='Btn'>
185
-            <text className='active' onClick={NextStep}>下一步</text>
186
-            <text onClick={PrevStep}>返回</text>
187
-          </view>
198
+                ))
199
+              }
200
+            </view>
201
+          </ScrollView>
188 202
         </view>
189
-      </ScrollView>
203
+      </view>
204
+
205
+      <view className='Btn'>
206
+        <text className='active' onClick={NextStep}>下一步</text>
207
+        <text onClick={PrevStep}>返回</text>
208
+      </view>
190 209
     </view>
191 210
   )
192 211
 }

+ 155
- 147
src/pages/index/addedValueService/index.scss Vedi File

@@ -1,183 +1,191 @@
1 1
 .components.AddedValueService {
2
-  width: 100%;
3
-  height: 100%;
4 2
   position: relative;
5 3
   overflow: hidden;
6
-  > scroll-view {
7
-    width: 100%;
8
-    height: 100%;
4
+  margin-top: 0 !important;
5
+  z-index: 1;
6
+  height: 100%;
7
+  > .flex-item {
9 8
     position: relative;
10
-    .PageContent {
11
-      position: relative;
9
+    overflow: hidden;
10
+    > view {
11
+      width: 100%;
12
+      position: absolute;
13
+      left: 0;
14
+      top: 0;
15
+      bottom: 0;
12 16
       overflow: hidden;
13
-      padding: 0 30px;
14
-      > .Step {
15
-        position: relative;
16
-        overflow: hidden;
17
-        > view {
17
+      > scroll-view {
18
+        width: 100%;
19
+        height: 100%;
20
+        .SubContent {
18 21
           position: relative;
19 22
           overflow: hidden;
20
-          margin-top: 30px;
21
-          > text {
22
-            display: block;
23
-            font-size: 34px;
24
-            font-weight: bold;
25
-            color: #333;
26
-            line-height: 40px;
27
-            letter-spacing: 4px;
28
-          }
29
-          > view {
23
+          padding: 0 30px 30px;
24
+          >.Step {
30 25
             position: relative;
31 26
             overflow: hidden;
32
-            margin-top: 20px;
33
-          }
34
-          > .Area {
35 27
             > view {
36
-              align-items: center;
37
-              background: #f8f8f8;
38
-              border-radius: 12px;
39
-              padding: 24px 20px;
28
+              position: relative;
29
+              overflow: hidden;
30
+              margin-top: 40px;
40 31
               > text {
41
-                font-size: 26px;
32
+                display: block;
33
+                font-size: 30px;
34
+                font-weight: bold;
42 35
                 color: #333;
43 36
                 line-height: 40px;
44
-                margin-left: 20px;
45
-                &:first-child {
46
-                  margin-left: 0;
47
-                  color: #193c83;
48
-                }
37
+                letter-spacing: 4px;
49 38
               }
50
-            }
51
-          }
52
-          > .Purpose {
53
-            > view {
54
-              align-items: center;
55
-              background: #f8f8f8;
56
-              border-radius: 12px;
57
-              padding: 24px 20px;
58
-              > input {
59
-                font-size: 26px;
60
-                color: #333;
61
-                line-height: 40px;
62
-                display: block;
63
-                width: 100%;
64
-                background: none;
39
+              > view {
40
+                position: relative;
41
+                overflow: hidden;
42
+                margin-top: 30px;
65 43
               }
66
-            }
67
-          }
68
-          > .CheckList {
69
-            font-size: 0;
70
-            margin-top: 0;
71
-            > view {
72
-              display: inline-block;
73
-              vertical-align: middle;
74
-              height: 80px;
75
-              width: 194px;
76
-              box-sizing: border-box;
77
-              border: 2px solid #193c83;
78
-              border-radius: 4px;
79
-              margin-right: 54px;
80
-              position: relative;
81
-              overflow: hidden;
82
-              margin-top: 20px;
83
-              text-align: center;
84
-              &::after {
85
-                content: '';
86
-                display: inline-block;
87
-                vertical-align: middle;
88
-                width: 0;
89
-                height: 100%;
44
+              > .Area {
45
+                > view {
46
+                  align-items: center;
47
+                  background: #f8f8f8;
48
+                  border-radius: 12px;
49
+                  padding: 24px 20px;
50
+                  > text {
51
+                    font-size: 26px;
52
+                    color: #333;
53
+                    line-height: 40px;
54
+                    margin-left: 20px;
55
+                    &:first-child {
56
+                      margin-left: 0;
57
+                      color: #193c83;
58
+                    }
59
+                  }
60
+                }
90 61
               }
91
-              &:nth-child(3n + 3) {
92
-                margin-right: 0;
62
+              > .Purpose {
63
+                > view {
64
+                  align-items: center;
65
+                  background: #f8f8f8;
66
+                  border-radius: 12px;
67
+                  padding: 24px 20px;
68
+                  > input {
69
+                    font-size: 26px;
70
+                    color: #333;
71
+                    line-height: 40px;
72
+                    display: block;
73
+                    width: 100%;
74
+                    background: none;
75
+                  }
76
+                }
93 77
               }
94
-              &.active {
95
-                > image {
96
-                  display: block;
78
+              > .CheckList {
79
+                font-size: 0;
80
+                margin-top: 0;
81
+                > view {
82
+                  display: inline-block;
83
+                  vertical-align: middle;
84
+                  height: 80px;
85
+                  width: 194px;
86
+                  box-sizing: border-box;
87
+                  border: 2px solid #f8f8f8;
88
+                  border-radius: 8px;
89
+                  margin-right: 54px;
90
+                  position: relative;
91
+                  overflow: hidden;
92
+                  margin-top: 20px;
93
+                  background: #f8f8f8;
94
+                  &:nth-child(3n + 3) {
95
+                    margin-right: 0;
96
+                  }
97
+                  &.active {
98
+                    border: 2px solid #193c83;
99
+                    background: #fff;
100
+                    > image {
101
+                      display: block;
102
+                    }
103
+                  }
104
+                  > image {
105
+                    display: none;
106
+                    width: 36px;
107
+                    height: 36px;
108
+                    position: absolute;
109
+                    right: -2px;
110
+                    bottom: -2px;
111
+                  }
112
+                  >text {
113
+                    font-size: 28px;
114
+                    color: #333;
115
+                    line-height: 40px;
116
+                    text-align: center;
117
+                    width: 96%;
118
+                    word-break: break-all;
119
+                  }
97 120
                 }
98 121
               }
99
-              > image {
100
-                display: none;
101
-                width: 36px;
102
-                height: 36px;
103
-                position: absolute;
104
-                right: -2px;
105
-                bottom: -2px;
122
+              > .RangeList {
123
+                align-items: center;
124
+                > text {
125
+                  color: #999;
126
+                  font-size: 28px;
127
+                  transform: translateX(-30px);
128
+                }
106 129
               }
107
-              > text {
108
-                font-size: 30px;
109
-                font-weight: 600;
110
-                color: #333;
111
-                display: inline-block;
112
-                max-width: 96%;
113
-                word-break: break-all;
114
-                line-height: 30px;
115
-                vertical-align: middle;
130
+              > .PriceRange {
131
+                > view {
132
+                  align-items: center;
133
+                  background: #f8f8f8;
134
+                  border-radius: 12px;
135
+                  padding: 24px 0;
136
+                  > view {
137
+                    > input {
138
+                      font-size: 26px;
139
+                      color: #333;
140
+                      line-height: 40px;
141
+                      display: block;
142
+                      width: 100%;
143
+                      background: none;
144
+                      text-align: center;
145
+                    }
146
+                  }
147
+                }
116 148
               }
117
-            }
118
-          }
119
-          > .RangeList {
120
-            align-items: center;
121
-            > text {
122
-              color: #999;
123
-              font-size: 28px;
124
-              transform: translateX(-30px);
125
-            }
126
-          }
127
-          > .PriceRange {
128
-            > view {
129
-              align-items: center;
130
-              background: #f8f8f8;
131
-              border-radius: 12px;
132
-              padding: 24px 0;
133
-              > view {
134
-                > input {
149
+              > .Textarea {
150
+                background: #f8f8f8;
151
+                border-radius: 12px;
152
+                padding: 20px;
153
+                > textarea {
135 154
                   font-size: 26px;
136 155
                   color: #333;
137 156
                   line-height: 40px;
138 157
                   display: block;
139 158
                   width: 100%;
140 159
                   background: none;
141
-                  text-align: center;
142 160
                 }
143 161
               }
144 162
             }
145 163
           }
146
-          > .Textarea {
147
-            background: #f8f8f8;
148
-            border-radius: 12px;
149
-            padding: 20px;
150
-            > textarea {
151
-              font-size: 26px;
152
-              color: #333;
153
-              line-height: 40px;
154
-              display: block;
155
-              width: 100%;
156
-              background: none;
157
-            }
158
-          }
159 164
         }
160 165
       }
161
-      > .Btn {
162
-        padding: 0 30px;
163
-        margin: 150px auto 60px;
164
-        > text {
165
-          display: block;
166
-          text-align: center;
167
-          font-size: 32px;
168
-          line-height: 92px;
169
-          box-sizing: border-box;
170
-          border: 2px solid #193c83;
171
-          color: #193c83;
172
-          border-radius: 92px;
173
-          margin-top: 20px;
174
-          text-indent: 0;
175
-          font-weight: normal;
176
-          &.active {
177
-            background: #193c83;
178
-            color: #fff;
179
-          }
180
-        }
166
+    }
167
+  }
168
+  > .Btn {
169
+    padding: 0 30px 20px;
170
+    background: #fff;
171
+    box-shadow: 0 0 6px 6px rgba(0, 0, 0, 0.03);
172
+    position: relative;
173
+    z-index: 2;
174
+    > text {
175
+      display: block;
176
+      text-align: center;
177
+      font-size: 32px;
178
+      line-height: 92px;
179
+      box-sizing: border-box;
180
+      border: 2px solid #193c83;
181
+      color: #193c83;
182
+      border-radius: 92px;
183
+      margin-top: 20px;
184
+      text-indent: 0;
185
+      font-weight: normal;
186
+      &.active {
187
+        background: #193c83;
188
+        color: #fff;
181 189
       }
182 190
     }
183 191
   }

+ 1
- 1
src/pages/index/buildingAround/index.jsx Vedi File

@@ -14,7 +14,7 @@ export default withLayout((props) => {
14 14
   const [DetailInfo, setDetailInfo] = useState({})
15 15
   const [loc, setLoc] = useState([])
16 16
   const [NavList, setNavList] = useState([])
17
-  const [CurrentNavId, setCurrentNavId] = useState(1)
17
+  const [CurrentNavId, setCurrentNavId] = useState(0)
18 18
   const [List, setList] = useState([])
19 19
   const [OtherList, setOtherList] = useState([])
20 20
   const [markers, setMarkers] = useState([])

+ 7
- 7
src/pages/index/buildingList/components/FilterForPrice/index.jsx Vedi File

@@ -21,13 +21,13 @@ export default function FilterForPrice (props) {
21 21
   ])
22 22
   const [TotalList] = useState([
23 23
     { name: '不限', id: '-' },
24
-    { name: '100万以下', id: '0-1000000' },
25
-    { name: '100-150万', id: '1000000-1500000' },
26
-    { name: '150-200万', id: '1500000-2000000' },
27
-    { name: '200-250万', id: '2000000-2500000' },
28
-    { name: '250-500万', id: '2500000-5000000' },
29
-    { name: '500-1000万', id: '5000000-10000000' },
30
-    { name: '1000万以上', id: '10000000-' },
24
+    { name: '100万以下', id: '0-100' },
25
+    { name: '100-150万', id: '100-150' },
26
+    { name: '150-200万', id: '150-200' },
27
+    { name: '200-250万', id: '200-250' },
28
+    { name: '250-500万', id: '250-500' },
29
+    { name: '500-1000万', id: '500-1000' },
30
+    { name: '1000万以上', id: '1000-' },
31 31
   ])
32 32
   const [CurrentId, setCurrentId] = useState(price || '-')
33 33
 

+ 1
- 0
src/pages/index/buildingList/index.jsx Vedi File

@@ -147,6 +147,7 @@ export default withLayout((props) => {
147 147
     for (let key in e) {
148 148
       Data[key] = e[key]
149 149
     }
150
+    console.log(Data)
150 151
     setFilterData({...Data})
151 152
   }
152 153
 

+ 1
- 1
src/pages/index/buildingTakeLook/index.jsx Vedi File

@@ -59,7 +59,7 @@ export default withLayout((props) => {
59 59
             </view>
60 60
 
61 61
             <view className='CountDown'>
62
-              <text>距离结束还有</text>
62
+              <text>距离报名结束还有</text>
63 63
               <text className='Red'>7</text>
64 64
               <text>天</text>
65 65
               <text className='Number' style={{ marginLeft: '40rpx' }}>7</text>

+ 1
- 1
src/pages/index/components/ActivityListItem/index.jsx Vedi File

@@ -38,7 +38,7 @@ export default function ActivityListItem (props) {
38 38
           <text className={activityStatusDict[data.activityStatus]?.className}>{activityStatusDict[data.activityStatus]?.text}</text>
39 39
         </view>
40 40
         <view className='Time'>
41
-          <text>活动时间:{formatDate(data.startDate, 'yyyy/M/d')} - {formatDate(data.endDate, 'yyyy/M/d')}</text>
41
+          <text>报名时间:{formatDate(data.enlistStart, 'yyyy/MM/dd')} - {formatDate(data.enlistEnd, 'yyyy/MM/dd')}</text>
42 42
         </view>
43 43
       </view>
44 44
     </view>

+ 29
- 26
src/pages/index/helpToFindHouse/components/BuyHouse/formData.js Vedi File

@@ -3,9 +3,9 @@ const questions = [
3 3
     question: '你的购房预算是多少?',
4 4
     key: 'budget',
5 5
     type: 'range',
6
-    result: '',
6
+    result: 300,
7 7
     resultId: null,
8
-    options: [100, 500]
8
+    options: [100, 2000]
9 9
   },
10 10
   {
11 11
     question: '你想购买的是新房还是二手房?',
@@ -20,20 +20,20 @@ const questions = [
20 20
     ]
21 21
   },
22 22
   {
23
-    question: '你想住几居室的房子?',
24
-    key: 'layout',
23
+    question: '你想买多大面积?',
24
+    key: 'area',
25 25
     type: 'checkbox',
26 26
     result: '',
27 27
     resultId: null,
28
+    required: true,
28 29
     options: [
29
-      { name: '一室一厅', id: 1 },
30
-      { name: '二室一厅', id: 2 },
31
-      { name: '二室二厅', id: 3 },
32
-      { name: '三室一厅', id: 4 },
33
-      { name: '三室二厅', id: 5 },
34
-      { name: '四室一厅', id: 6 },
35
-      { name: '四室二厅', id: 7 },
36
-      { name: '五室及以上', id: 8 }
30
+      { name: '60㎡以下', id: 1 },
31
+      { name: '60-90㎡', id: 2 },
32
+      { name: '90-110㎡', id: 3 },
33
+      { name: '110-130㎡', id: 4 },
34
+      { name: '130-150㎡', id: 5 },
35
+      { name: '150-200㎡', id: 6 },
36
+      { name: '200㎡以上', id: 7 }
37 37
     ]
38 38
   },
39 39
   {
@@ -62,8 +62,8 @@ const questions = [
62 62
   {
63 63
     question: '你更注重项目的哪些优势?',
64 64
     key: 'advantage',
65
-    type: 'checkbox',
66
-    result: '',
65
+    type: 'checkboxs',
66
+    result: [],
67 67
     resultId: null,
68 68
     options: [
69 69
       { name: '发展规划', id: 1 },
@@ -76,8 +76,8 @@ const questions = [
76 76
   {
77 77
     question: '你对小区物业管理和社区设施有什么要求?',
78 78
     key: 'facility',
79
-    type: 'checkbox',
80
-    result: '',
79
+    type: 'checkboxs',
80
+    result: [],
81 81
     resultId: null,
82 82
     remark: '',
83 83
     options: [
@@ -87,20 +87,22 @@ const questions = [
87 87
       { name: '会所功能', id: 4 }
88 88
     ]
89 89
   },
90
+  // 不要轻易修改此处的字典设置, 必须要跟 java 端保持一致
90 91
   {
91
-    question: '你想买多大面积?',
92
-    key: 'area',
92
+    question: '你想住几居室的房子?',
93
+    key: 'layout',
93 94
     type: 'checkbox',
94 95
     result: '',
95 96
     resultId: null,
96 97
     options: [
97
-      { name: '60㎡以下', id: 1 },
98
-      { name: '60-90㎡', id: 2 },
99
-      { name: '90-110㎡', id: 3 },
100
-      { name: '110-130㎡', id: 4 },
101
-      { name: '130-150㎡', id: 5 },
102
-      { name: '150-200㎡', id: 6 },
103
-      { name: '200㎡以上', id: 7 }
98
+      { name: '一室一厅', id: 1 },
99
+      { name: '二室一厅', id: 2 },
100
+      { name: '二室二厅', id: 3 },
101
+      { name: '三室一厅', id: 4 },
102
+      { name: '三室二厅', id: 5 },
103
+      { name: '四室一厅', id: 6 },
104
+      { name: '四室二厅', id: 7 },
105
+      { name: '五室及以上', id: 8 }
104 106
     ]
105 107
   },
106 108
   {
@@ -114,7 +116,8 @@ const questions = [
114 116
       { name: '朝南', id: 2 },
115 117
       { name: '朝西', id: 3 },
116 118
       { name: '朝北', id: 4 },
117
-      { name: '南北通透', id: 5 }
119
+      { name: '南北通透', id: 5 },
120
+      { name: '都可以', id: 6 }
118 121
     ]
119 122
   },
120 123
   {

+ 110
- 64
src/pages/index/helpToFindHouse/components/BuyHouse/index.jsx Vedi File

@@ -1,14 +1,14 @@
1 1
 import { useState, useEffect } from 'react'
2 2
 import '@/assets/css/iconfont.css'
3
-import { Image, Slider, Textarea } from '@tarojs/components'
3
+import { Image, Slider, Textarea, ScrollView } from '@tarojs/components'
4
+import Taro from '@tarojs/taro'
4 5
 import './index.scss'
5 6
 import questions from './formData'
6 7
 
7 8
 export default function BuyHouse (props) {
8
-  const { change = () => { }, toSubmit = () => { }, AreaInfo = {}, selectArea = () => {} } = props
9
+  const { children = null, change = () => { }, toSubmit = () => { }, AreaInfo = {}, selectArea = () => { } } = props
9 10
 
10 11
   const [FormData, setFormData] = useState(questions)
11
-
12 12
   const [StepId, setStepId] = useState(1)
13 13
   const [StepRange, setStepRange] = useState([0, 4])
14 14
 
@@ -25,6 +25,14 @@ export default function BuyHouse (props) {
25 25
     change(StepId)
26 26
   }, [StepId])
27 27
 
28
+  const CutCheckboxs = (index, subItem, subIndex) => {
29
+    return () => {
30
+      let newFormData = [...FormData]
31
+      newFormData[index].options[subIndex].selected = !subItem.selected
32
+      setFormData([...newFormData])
33
+    }
34
+  }
35
+
28 36
   const CutCheckbox = (item, index) => {
29 37
     return () => {
30 38
       let newFormData = [...FormData]
@@ -53,10 +61,24 @@ export default function BuyHouse (props) {
53 61
   }
54 62
 
55 63
   const NextStep = () => {
56
-    if (StepId < 4) {
57
-      setStepId(StepId + 1)
64
+    let Bool = true
65
+    let IndexArr = []
66
+    FormData.map((item, index) => {
67
+      if (index >= StepRange[0] && index < StepRange[1]) {
68
+        if (!!item.required && item.result === '') {
69
+          Bool = false
70
+          IndexArr.push(index)
71
+        }
72
+      }
73
+    })
74
+    if (Bool) {
75
+      if (StepId < 4) {
76
+        setStepId(StepId + 1)
77
+      } else {
78
+        toSubmit(FormData)
79
+      }
58 80
     } else {
59
-      toSubmit(FormData)
81
+      Taro.showToast({ title: `请选择${FormData[IndexArr[0]].question}`, icon: 'none' })
60 82
     }
61 83
   }
62 84
 
@@ -67,67 +89,91 @@ export default function BuyHouse (props) {
67 89
   }
68 90
 
69 91
   return (
70
-    <view className='components BuyHouse'>
71
-      {
72
-        FormData.map((item, index) => (
73
-          <view className='Step' key={`Form-${index}`}>
74
-            {
75
-              index >= StepRange[0] && index < StepRange[1] &&
76
-              <view>
77
-                <text>{item.question}</text>
78
-                {
79
-                  item.type === 'checkbox' &&
80
-                  <view className='CheckList'>
92
+    <view className='components BuyHouse flex-v'>
93
+      <view className='flex-item'>
94
+        <view>
95
+          <ScrollView scrollY>
96
+            <view className='SubContent'>
97
+              {
98
+                children
99
+              }
100
+              {
101
+                FormData.map((item, index) => (
102
+                  <view className='Step' key={`Form-${index}`}>
81 103
                     {
82
-                      item.options.map((subItem, subIndex) => (
83
-                        <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
84
-                          {subItem.name}
85
-                          <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
86
-                        </view>
87
-                      ))
104
+                      index >= StepRange[0] && index < StepRange[1] &&
105
+                      <view>
106
+                        <text>{item.question}</text>
107
+                        {
108
+                          item.type === 'checkboxs' &&
109
+                          <view className='CheckList'>
110
+                            {
111
+                              item.options.map((subItem, subIndex) => (
112
+                                <view key={`${item.key}-${subIndex}`} className={subItem.selected ? 'active' : ''} onClick={CutCheckboxs(index, subItem, subIndex)}>
113
+                                  <text>{subItem.name}</text>
114
+                                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
115
+                                </view>
116
+                              ))
117
+                            }
118
+                          </view>
119
+                        }
120
+                        {
121
+                          item.type === 'checkbox' &&
122
+                          <view className='CheckList'>
123
+                            {
124
+                              item.options.map((subItem, subIndex) => (
125
+                                <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
126
+                                  {subItem.name}
127
+                                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
128
+                                </view>
129
+                              ))
130
+                            }
131
+                          </view>
132
+                        }
133
+                        {
134
+                          item.type === 'checkbox' && item.remark !== undefined &&
135
+                          <view className='Textarea'>
136
+                            <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { remarkInput(e, index) }} />
137
+                          </view>
138
+                        }
139
+                        {
140
+                          item.type === 'range' &&
141
+                          <view className='RangeList flex-h'>
142
+                            <view className='flex-item'>
143
+                              <Slider activeColor='#193C83' block-color='#fff' value={item.result - 0} onChange={(e) => { Rangehange(e, index) }} min={item.options[0]} max={item.options[1]} show-value />
144
+                            </view>
145
+                            <text>万</text>
146
+                          </view>
147
+                        }
148
+                        {
149
+                          item.type === 'select' &&
150
+                          <view className='Area'>
151
+                            <view className='flex-h' onClick={selectArea}>
152
+                              {
153
+                                item.key === 'intentArea' &&
154
+                                <text className='iconfont icon-dingwei'></text>
155
+                              }
156
+                              <text>{AreaInfo.name || '不限'}</text>
157
+                              <view className='flex-item'></view>
158
+                              <text className='iconfont icon-jiantoudown'></text>
159
+                            </view>
160
+                          </view>
161
+                        }
162
+                        {
163
+                          item.type === 'textarea' &&
164
+                          <view className='Textarea'>
165
+                            <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { textareaInput(e, index) }} />
166
+                          </view>
167
+                        }
168
+                      </view>
88 169
                     }
89 170
                   </view>
90
-                }
91
-                {
92
-                  item.type === 'checkbox' && item.remark !== undefined &&
93
-                  <view className='Textarea'>
94
-                    <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { remarkInput(e, index) }} />
95
-                  </view>
96
-                }
97
-                {
98
-                  item.type === 'range' &&
99
-                  <view className='RangeList flex-h'>
100
-                    <view className='flex-item'>
101
-                      <Slider activeColor='#193C83' block-color='#fff' onChange={(e) => { Rangehange(e, index) }} min={item.options[0]} max={item.options[1]} show-value />
102
-                    </view>
103
-                    <text>万</text>
104
-                  </view>
105
-                }
106
-                {
107
-                  item.type === 'select' &&
108
-                  <view className='Area'>
109
-                    <view className='flex-h' onClick={selectArea}>
110
-                      {
111
-                        item.key === 'intentArea' &&
112
-                        <text className='iconfont icon-dingwei'></text>
113
-                      }
114
-                      <text>{AreaInfo.name || '不限'}</text>
115
-                      <view className='flex-item'></view>
116
-                      <text className='iconfont icon-jiantoudown'></text>
117
-                    </view>
118
-                  </view>
119
-                }
120
-                {
121
-                  item.type === 'textarea' &&
122
-                  <view className='Textarea'>
123
-                    <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { textareaInput(e, index) }} />
124
-                  </view>
125
-                }
126
-              </view>
127
-            }
128
-          </view>
129
-        ))
130
-      }
171
+                ))
172
+              }
173
+            </view>
174
+          </ScrollView>
175
+        </view>
176
+      </view>
131 177
 
132 178
       <view className='Btn'>
133 179
         <text className='active' onClick={NextStep}>下一步</text>

+ 153
- 126
src/pages/index/helpToFindHouse/components/BuyHouse/index.scss Vedi File

@@ -3,144 +3,171 @@
3 3
   overflow: hidden;
4 4
   margin-top: 0 !important;
5 5
   z-index: 1;
6
-  > .Step {
6
+  height: 100%;
7
+  > .flex-item {
7 8
     position: relative;
8 9
     overflow: hidden;
9 10
     > view {
10
-      position: relative;
11
+      width: 100%;
12
+      position: absolute;
13
+      left: 0;
14
+      top: 0;
15
+      bottom: 0;
11 16
       overflow: hidden;
12
-      margin-top: 36px;
13
-      > text {
14
-        display: block;
15
-        font-size: 34px;
16
-        font-weight: bold;
17
-        color: #333;
18
-        line-height: 40px;
19
-        letter-spacing: 4px;
20
-      }
21
-      > view {
22
-        position: relative;
23
-        overflow: hidden;
24
-        margin-top: 30px;
25
-      }
26
-      > .Area {
27
-        > view {
28
-          align-items: center;
29
-          background: #f8f8f8;
30
-          border-radius: 12px;
31
-          padding: 24px 20px;
32
-          > text {
33
-            font-size: 26px;
34
-            color: #333;
35
-            line-height: 40px;
36
-            margin-left: 20px;
37
-            &:first-child {
38
-              margin-left: 0;
39
-              color: #193c83;
40
-            }
41
-          }
42
-        }
43
-      }
44
-      > .Purpose {
45
-        > view {
46
-          align-items: center;
47
-          background: #f8f8f8;
48
-          border-radius: 12px;
49
-          padding: 24px 20px;
50
-          > input {
51
-            font-size: 26px;
52
-            color: #333;
53
-            line-height: 40px;
54
-            display: block;
55
-            width: 100%;
56
-            background: none;
57
-          }
58
-        }
59
-      }
60
-      > .CheckList {
61
-        font-size: 0;
62
-        margin-top: 0;
63
-        > view {
64
-          display: inline-block;
65
-          vertical-align: middle;
66
-          font-size: 30px;
67
-          font-weight: 600;
68
-          color: #333;
69
-          line-height: 40px;
70
-          padding: 20px 0;
71
-          min-width: 194px;
72
-          box-sizing: border-box;
73
-          white-space: nowrap;
74
-          text-align: center;
75
-          border: 2px solid #193c83;
76
-          border-radius: 4px;
77
-          margin-right: 54px;
17
+      > scroll-view {
18
+        width: 100%;
19
+        height: 100%;
20
+        .SubContent {
78 21
           position: relative;
79 22
           overflow: hidden;
80
-          margin-top: 20px;
81
-          &:nth-child(3n+3) {
82
-            margin-right: 0;
83
-          }
84
-          &.active {
85
-            > image {
86
-              display: block;
87
-            }
88
-          }
89
-          > image {
90
-            display: none;
91
-            width: 36px;
92
-            height: 36px;
93
-            position: absolute;
94
-            right: -2px;
95
-            bottom: -2px;
96
-          }
97
-        }
98
-      }
99
-      >.RangeList {
100
-        align-items: center;
101
-        >text {
102
-          color: #999;
103
-          font-size: 28px;
104
-          transform: translateX(-30px);
105
-        }
106
-      }
107
-      > .PriceRange {
108
-        > view {
109
-          align-items: center;
110
-          background: #f8f8f8;
111
-          border-radius: 12px;
112
-          padding: 24px 0;
113
-          > view {
114
-            > input {
115
-              font-size: 26px;
116
-              color: #333;
117
-              line-height: 40px;
118
-              display: block;
119
-              width: 100%;
120
-              background: none;
121
-              text-align: center;
23
+          padding: 0 30px 30px;
24
+          >.Step {
25
+            position: relative;
26
+            overflow: hidden;
27
+            > view {
28
+              position: relative;
29
+              overflow: hidden;
30
+              margin-top: 40px;
31
+              > text {
32
+                display: block;
33
+                font-size: 30px;
34
+                font-weight: bold;
35
+                color: #333;
36
+                line-height: 40px;
37
+                letter-spacing: 4px;
38
+              }
39
+              > view {
40
+                position: relative;
41
+                overflow: hidden;
42
+                margin-top: 30px;
43
+              }
44
+              > .Area {
45
+                > view {
46
+                  align-items: center;
47
+                  background: #f8f8f8;
48
+                  border-radius: 12px;
49
+                  padding: 24px 20px;
50
+                  > text {
51
+                    font-size: 26px;
52
+                    color: #333;
53
+                    line-height: 40px;
54
+                    margin-left: 20px;
55
+                    &:first-child {
56
+                      margin-left: 0;
57
+                      color: #193c83;
58
+                    }
59
+                  }
60
+                }
61
+              }
62
+              > .Purpose {
63
+                > view {
64
+                  align-items: center;
65
+                  background: #f8f8f8;
66
+                  border-radius: 12px;
67
+                  padding: 24px 20px;
68
+                  > input {
69
+                    font-size: 26px;
70
+                    color: #333;
71
+                    line-height: 40px;
72
+                    display: block;
73
+                    width: 100%;
74
+                    background: none;
75
+                  }
76
+                }
77
+              }
78
+              > .CheckList {
79
+                font-size: 0;
80
+                margin-top: 0;
81
+                > view {
82
+                  display: inline-block;
83
+                  vertical-align: middle;
84
+                  font-size: 28px;
85
+                  color: #333;
86
+                  line-height: 40px;
87
+                  padding: 20px 0;
88
+                  min-width: 156px;
89
+                  box-sizing: border-box;
90
+                  white-space: nowrap;
91
+                  text-align: center;
92
+                  border: 2px solid #f8f8f8;
93
+                  border-radius: 8px;
94
+                  margin-right: 20px;
95
+                  position: relative;
96
+                  overflow: hidden;
97
+                  margin-top: 20px;
98
+                  background: #f8f8f8;
99
+                  &:nth-child(4n + 4) {
100
+                    margin-right: 0;
101
+                  }
102
+                  &.active {
103
+                    border: 2px solid #193c83;
104
+                    background: #fff;
105
+                    > image {
106
+                      display: block;
107
+                    }
108
+                  }
109
+                  > image {
110
+                    display: none;
111
+                    width: 36px;
112
+                    height: 36px;
113
+                    position: absolute;
114
+                    right: -2px;
115
+                    bottom: -2px;
116
+                  }
117
+                }
118
+              }
119
+              > .RangeList {
120
+                align-items: center;
121
+                > text {
122
+                  color: #999;
123
+                  font-size: 28px;
124
+                  transform: translateX(-30px);
125
+                }
126
+              }
127
+              > .PriceRange {
128
+                > view {
129
+                  align-items: center;
130
+                  background: #f8f8f8;
131
+                  border-radius: 12px;
132
+                  padding: 24px 0;
133
+                  > view {
134
+                    > input {
135
+                      font-size: 26px;
136
+                      color: #333;
137
+                      line-height: 40px;
138
+                      display: block;
139
+                      width: 100%;
140
+                      background: none;
141
+                      text-align: center;
142
+                    }
143
+                  }
144
+                }
145
+              }
146
+              > .Textarea {
147
+                background: #f8f8f8;
148
+                border-radius: 12px;
149
+                padding: 20px;
150
+                > textarea {
151
+                  font-size: 26px;
152
+                  color: #333;
153
+                  line-height: 40px;
154
+                  display: block;
155
+                  width: 100%;
156
+                  background: none;
157
+                }
158
+              }
122 159
             }
123 160
           }
124 161
         }
125 162
       }
126
-      >.Textarea {
127
-        background: #f8f8f8;
128
-        border-radius: 12px;
129
-        padding: 20px;
130
-        >textarea {
131
-          font-size: 26px;
132
-          color: #333;
133
-          line-height: 40px;
134
-          display: block;
135
-          width: 100%;
136
-          background: none;
137
-        }
138
-      }
139 163
     }
140 164
   }
141
-  >.Btn {
142
-    padding: 0 30px;
143
-    margin: 74px auto 60px;
165
+  > .Btn {
166
+    padding: 0 30px 20px;
167
+    background: #fff;
168
+    box-shadow: 0 0 6px 6px rgba(0, 0, 0, 0.03);
169
+    position: relative;
170
+    z-index: 2;
144 171
     > text {
145 172
       display: block;
146 173
       text-align: center;

+ 1
- 1
src/pages/index/helpToFindHouse/components/HousePurchasing/formData.js Vedi File

@@ -12,7 +12,7 @@ const questions = [
12 12
     type: 'range',
13 13
     result: '',
14 14
     resultId: null,
15
-    options: [100, 500]
15
+    options: [100, 2000]
16 16
   },
17 17
   {
18 18
     question: '优先选择的房屋类型是?',

+ 89
- 63
src/pages/index/helpToFindHouse/components/HousePurchasing/index.jsx Vedi File

@@ -1,11 +1,12 @@
1 1
 import { useState, useEffect } from 'react'
2 2
 import '@/assets/css/iconfont.css'
3
-import { Image, Slider, Textarea } from '@tarojs/components'
3
+import { Image, Slider, Textarea, ScrollView } from '@tarojs/components'
4
+import Taro from '@tarojs/taro'
4 5
 import './index.scss'
5 6
 import questions from './formData'
6 7
 
7 8
 export default function HousePurchasing (props) {
8
-  const { change = () => { }, toSubmit = () => {}, AreaInfo = {}, selectArea = () => {} } = props
9
+  const { children = null, change = () => { }, toSubmit = () => {}, AreaInfo = {}, selectArea = () => {} } = props
9 10
 
10 11
   const [FormData, setFormData] = useState(questions)
11 12
 
@@ -47,10 +48,24 @@ export default function HousePurchasing (props) {
47 48
   }
48 49
 
49 50
   const NextStep = () => {
50
-    if (StepId < 1) {
51
-      setStepId(StepId + 1)
51
+    let Bool = true
52
+    let IndexArr = []
53
+    FormData.map((item, index) => {
54
+      if(index >= StepRange[0] && index < StepRange[1]) {
55
+        if(!!item.required && item.result === '') {
56
+          Bool = false
57
+          IndexArr.push(index)
58
+        }
59
+      }
60
+    })
61
+    if(Bool) {
62
+      if (StepId < 1) {
63
+        setStepId(StepId + 1)
64
+      } else {
65
+        toSubmit(FormData)
66
+      }
52 67
     } else {
53
-      toSubmit(FormData)
68
+      Taro.showToast({title: `请选择${FormData[IndexArr[0]].question}`, icon: 'none'})
54 69
     }
55 70
   }
56 71
 
@@ -61,67 +76,78 @@ export default function HousePurchasing (props) {
61 76
   }
62 77
 
63 78
   return (
64
-    <view className='components BuyHouse'>
65
-      {
66
-        FormData.map((item, index) => (
67
-          <view className='Step' key={`Form-${index}`}>
68
-            {
69
-              index >= StepRange[0] && index < StepRange[1] &&
70
-              <view>
71
-                <text>{item.question}</text>
72
-                {
73
-                  item.type === 'checkbox' &&
74
-                  <view className='CheckList'>
79
+    <view className='components BuyHouse flex-v'>
80
+      <view className='flex-item'>
81
+        <view>
82
+          <ScrollView scrollY>
83
+            <view className='SubContent'>
84
+              {
85
+                children
86
+              }
87
+              {
88
+                FormData.map((item, index) => (
89
+                  <view className='Step' key={`Form-${index}`}>
75 90
                     {
76
-                      item.options.map((subItem, subIndex) => (
77
-                        <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
78
-                          {subItem.name}
79
-                          <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
80
-                        </view>
81
-                      ))
91
+                      index >= StepRange[0] && index < StepRange[1] &&
92
+                      <view>
93
+                        <text>{item.question}</text>
94
+                        {
95
+                          item.type === 'checkbox' &&
96
+                          <view className='CheckList'>
97
+                            {
98
+                              item.options.map((subItem, subIndex) => (
99
+                                <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
100
+                                  {subItem.name}
101
+                                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
102
+                                </view>
103
+                              ))
104
+                            }
105
+                          </view>
106
+                        }
107
+                        {
108
+                          item.type === 'checkbox' && item.remark !== undefined &&
109
+                          <view className='Textarea'>
110
+                            <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { remarkInput(e, index) }} />
111
+                          </view>
112
+                        }
113
+                        {
114
+                          item.type === 'range' &&
115
+                          <view className='RangeList flex-h'>
116
+                            <view className='flex-item'>
117
+                              <Slider activeColor='#193C83' block-color='#fff' value={item.result - 0} onChange={(e) => { Rangehange(e, index) }} min={item.options[0]} max={item.options[1]} show-value />
118
+                            </view>
119
+                            <text>万</text>
120
+                          </view>
121
+                        }
122
+                        {
123
+                          item.type === 'select' &&
124
+                          <view className='Area'>
125
+                            <view className='flex-h' onClick={selectArea}>
126
+                              {
127
+                                item.key === 'intentArea' &&
128
+                                <text className='iconfont icon-dingwei'></text>
129
+                              }
130
+                              <text>{AreaInfo.name || '不限'}</text>
131
+                              <view className='flex-item'></view>
132
+                              <text className='iconfont icon-jiantoudown'></text>
133
+                            </view>
134
+                          </view>
135
+                        }
136
+                        {
137
+                          item.type === 'textarea' &&
138
+                          <view className='Textarea'>
139
+                            <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { textareaInput(e, index) }} />
140
+                          </view>
141
+                        }
142
+                      </view>
82 143
                     }
83 144
                   </view>
84
-                }
85
-                {
86
-                  item.type === 'checkbox' && item.remark !== undefined &&
87
-                  <view className='Textarea'>
88
-                    <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => {remarkInput(e, index)}} />
89
-                  </view>
90
-                }
91
-                {
92
-                  item.type === 'range' &&
93
-                  <view className='RangeList flex-h'>
94
-                    <view className='flex-item'>
95
-                      <Slider activeColor='#193C83' block-color='#fff' onChange={(e) => { Rangehange(e, index) }} min={item.options[0]} max={item.options[1]} show-value />
96
-                    </view>
97
-                    <text>万</text>
98
-                  </view>
99
-                }
100
-                {
101
-                  item.type === 'select' &&
102
-                  <view className='Area'>
103
-                    <view className='flex-h' onClick={selectArea}>
104
-                      {
105
-                        item.key === 'district' &&
106
-                        <text className='iconfont icon-dingwei'></text>
107
-                      }
108
-                      <text>{AreaInfo.name || '不限'}</text>
109
-                      <view className='flex-item'></view>
110
-                      <text className='iconfont icon-jiantoudown'></text>
111
-                    </view>
112
-                  </view>
113
-                }
114
-                {
115
-                  item.type === 'textarea' &&
116
-                  <view className='Textarea'>
117
-                    <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => {textareaInput(e, index)}} />
118
-                  </view>
119
-                }
120
-              </view>
121
-            }
122
-          </view>
123
-        ))
124
-      }
145
+                ))
146
+              }
147
+            </view>
148
+          </ScrollView>
149
+        </view>
150
+      </view>
125 151
 
126 152
       <view className='Btn'>
127 153
         <text className='active' onClick={NextStep}>下一步</text>

+ 154
- 127
src/pages/index/helpToFindHouse/components/HousePurchasing/index.scss Vedi File

@@ -1,146 +1,173 @@
1
-.components.HousePurchasing {
1
+.components.BuyHouse {
2 2
   position: relative;
3 3
   overflow: hidden;
4 4
   margin-top: 0 !important;
5 5
   z-index: 1;
6
-  > .Step {
6
+  height: 100%;
7
+  > .flex-item {
7 8
     position: relative;
8 9
     overflow: hidden;
9 10
     > view {
10
-      position: relative;
11
+      width: 100%;
12
+      position: absolute;
13
+      left: 0;
14
+      top: 0;
15
+      bottom: 0;
11 16
       overflow: hidden;
12
-      margin-top: 36px;
13
-      > text {
14
-        display: block;
15
-        font-size: 34px;
16
-        font-weight: bold;
17
-        color: #333;
18
-        line-height: 40px;
19
-        letter-spacing: 4px;
20
-      }
21
-      > view {
22
-        position: relative;
23
-        overflow: hidden;
24
-        margin-top: 30px;
25
-      }
26
-      > .Area {
27
-        > view {
28
-          align-items: center;
29
-          background: #f8f8f8;
30
-          border-radius: 12px;
31
-          padding: 24px 20px;
32
-          > text {
33
-            font-size: 26px;
34
-            color: #333;
35
-            line-height: 40px;
36
-            margin-left: 20px;
37
-            &:first-child {
38
-              margin-left: 0;
39
-              color: #193c83;
40
-            }
41
-          }
42
-        }
43
-      }
44
-      > .Purpose {
45
-        > view {
46
-          align-items: center;
47
-          background: #f8f8f8;
48
-          border-radius: 12px;
49
-          padding: 24px 20px;
50
-          > input {
51
-            font-size: 26px;
52
-            color: #333;
53
-            line-height: 40px;
54
-            display: block;
55
-            width: 100%;
56
-            background: none;
57
-          }
58
-        }
59
-      }
60
-      > .CheckList {
61
-        font-size: 0;
62
-        margin-top: 0;
63
-        > view {
64
-          display: inline-block;
65
-          vertical-align: middle;
66
-          font-size: 30px;
67
-          font-weight: 600;
68
-          color: #333;
69
-          line-height: 40px;
70
-          padding: 20px 0;
71
-          min-width: 194px;
72
-          box-sizing: border-box;
73
-          white-space: nowrap;
74
-          text-align: center;
75
-          border: 2px solid #193c83;
76
-          border-radius: 4px;
77
-          margin-right: 54px;
17
+      > scroll-view {
18
+        width: 100%;
19
+        height: 100%;
20
+        .SubContent {
78 21
           position: relative;
79 22
           overflow: hidden;
80
-          margin-top: 20px;
81
-          &:nth-child(3n+3) {
82
-            margin-right: 0;
83
-          }
84
-          &.active {
85
-            > image {
86
-              display: block;
87
-            }
88
-          }
89
-          > image {
90
-            display: none;
91
-            width: 36px;
92
-            height: 36px;
93
-            position: absolute;
94
-            right: -2px;
95
-            bottom: -2px;
96
-          }
97
-        }
98
-      }
99
-      >.RangeList {
100
-        align-items: center;
101
-        >text {
102
-          color: #999;
103
-          font-size: 28px;
104
-          transform: translateX(-30px);
105
-        }
106
-      }
107
-      > .PriceRange {
108
-        > view {
109
-          align-items: center;
110
-          background: #f8f8f8;
111
-          border-radius: 12px;
112
-          padding: 24px 0;
113
-          > view {
114
-            > input {
115
-              font-size: 26px;
116
-              color: #333;
117
-              line-height: 40px;
118
-              display: block;
119
-              width: 100%;
120
-              background: none;
121
-              text-align: center;
23
+          padding: 0 30px 30px;
24
+          >.Step {
25
+            position: relative;
26
+            overflow: hidden;
27
+            > view {
28
+              position: relative;
29
+              overflow: hidden;
30
+              margin-top: 40px;
31
+              > text {
32
+                display: block;
33
+                font-size: 30px;
34
+                font-weight: bold;
35
+                color: #333;
36
+                line-height: 40px;
37
+                letter-spacing: 4px;
38
+              }
39
+              > view {
40
+                position: relative;
41
+                overflow: hidden;
42
+                margin-top: 30px;
43
+              }
44
+              > .Area {
45
+                > view {
46
+                  align-items: center;
47
+                  background: #f8f8f8;
48
+                  border-radius: 12px;
49
+                  padding: 24px 20px;
50
+                  > text {
51
+                    font-size: 26px;
52
+                    color: #333;
53
+                    line-height: 40px;
54
+                    margin-left: 20px;
55
+                    &:first-child {
56
+                      margin-left: 0;
57
+                      color: #193c83;
58
+                    }
59
+                  }
60
+                }
61
+              }
62
+              > .Purpose {
63
+                > view {
64
+                  align-items: center;
65
+                  background: #f8f8f8;
66
+                  border-radius: 12px;
67
+                  padding: 24px 20px;
68
+                  > input {
69
+                    font-size: 26px;
70
+                    color: #333;
71
+                    line-height: 40px;
72
+                    display: block;
73
+                    width: 100%;
74
+                    background: none;
75
+                  }
76
+                }
77
+              }
78
+              > .CheckList {
79
+                font-size: 0;
80
+                margin-top: 0;
81
+                > view {
82
+                  display: inline-block;
83
+                  vertical-align: middle;
84
+                  font-size: 28px;
85
+                  color: #333;
86
+                  line-height: 40px;
87
+                  padding: 20px 0;
88
+                  min-width: 156px;
89
+                  box-sizing: border-box;
90
+                  white-space: nowrap;
91
+                  text-align: center;
92
+                  border: 2px solid #f8f8f8;
93
+                  border-radius: 8px;
94
+                  margin-right: 20px;
95
+                  position: relative;
96
+                  overflow: hidden;
97
+                  margin-top: 20px;
98
+                  background: #f8f8f8;
99
+                  &:nth-child(4n + 4) {
100
+                    margin-right: 0;
101
+                  }
102
+                  &.active {
103
+                    border: 2px solid #193c83;
104
+                    background: #fff;
105
+                    > image {
106
+                      display: block;
107
+                    }
108
+                  }
109
+                  > image {
110
+                    display: none;
111
+                    width: 36px;
112
+                    height: 36px;
113
+                    position: absolute;
114
+                    right: -2px;
115
+                    bottom: -2px;
116
+                  }
117
+                }
118
+              }
119
+              > .RangeList {
120
+                align-items: center;
121
+                > text {
122
+                  color: #999;
123
+                  font-size: 28px;
124
+                  transform: translateX(-30px);
125
+                }
126
+              }
127
+              > .PriceRange {
128
+                > view {
129
+                  align-items: center;
130
+                  background: #f8f8f8;
131
+                  border-radius: 12px;
132
+                  padding: 24px 0;
133
+                  > view {
134
+                    > input {
135
+                      font-size: 26px;
136
+                      color: #333;
137
+                      line-height: 40px;
138
+                      display: block;
139
+                      width: 100%;
140
+                      background: none;
141
+                      text-align: center;
142
+                    }
143
+                  }
144
+                }
145
+              }
146
+              > .Textarea {
147
+                background: #f8f8f8;
148
+                border-radius: 12px;
149
+                padding: 20px;
150
+                > textarea {
151
+                  font-size: 26px;
152
+                  color: #333;
153
+                  line-height: 40px;
154
+                  display: block;
155
+                  width: 100%;
156
+                  background: none;
157
+                }
158
+              }
122 159
             }
123 160
           }
124 161
         }
125 162
       }
126
-      >.Textarea {
127
-        background: #f8f8f8;
128
-        border-radius: 12px;
129
-        padding: 20px;
130
-        >textarea {
131
-          font-size: 26px;
132
-          color: #333;
133
-          line-height: 40px;
134
-          display: block;
135
-          width: 100%;
136
-          background: none;
137
-        }
138
-      }
139 163
     }
140 164
   }
141
-  >.Btn {
142
-    padding: 0 30px;
143
-    margin: 74px auto 60px;
165
+  > .Btn {
166
+    padding: 0 30px 20px;
167
+    background: #fff;
168
+    box-shadow: 0 0 6px 6px rgba(0, 0, 0, 0.03);
169
+    position: relative;
170
+    z-index: 2;
144 171
     > text {
145 172
       display: block;
146 173
       text-align: center;

+ 1
- 1
src/pages/index/helpToFindHouse/components/RentingHouse/formData.js Vedi File

@@ -5,7 +5,7 @@ const questions = [
5 5
     type: 'range',
6 6
     result: '',
7 7
     resultId: null,
8
-    options: [500, 4500]
8
+    options: [500, 20000]
9 9
   },
10 10
   {
11 11
     question: '你的租房偏好?',

+ 112
- 86
src/pages/index/helpToFindHouse/components/RentingHouse/index.jsx Vedi File

@@ -1,11 +1,12 @@
1 1
 import { useState, useEffect } from 'react'
2 2
 import '@/assets/css/iconfont.css'
3
-import { Image, Slider, Textarea } from '@tarojs/components'
3
+import { Image, Slider, Textarea, ScrollView } from '@tarojs/components'
4
+import Taro from '@tarojs/taro'
4 5
 import './index.scss'
5 6
 import questions from './formData'
6 7
 
7 8
 export default function RentingHouse (props) {
8
-  const { change = () => { }, toSubmit = () => { }, AreaInfo = {}, selectArea = () => { } } = props
9
+  const { children = null, change = () => { }, toSubmit = () => { }, AreaInfo = {}, selectArea = () => { } } = props
9 10
 
10 11
   const [FormData, setFormData] = useState(questions)
11 12
 
@@ -57,20 +58,34 @@ export default function RentingHouse (props) {
57 58
   }
58 59
 
59 60
   const NextStep = () => {
60
-    if (StepId < 2) {
61
-      setStepId(StepId + 1)
62
-    } else {
63
-      let Arr = [...FormData]
64
-      Arr.map((item) => {
65
-        if (item.type === 'checkbox') {
66
-          item.options.map((subItem) => {
67
-            if (subItem.selected) {
68
-              item.result.push(subItem.name)
69
-            }
70
-          })
61
+    let Bool = true
62
+    let IndexArr = []
63
+    FormData.map((item, index) => {
64
+      if (index >= StepRange[0] && index < StepRange[1]) {
65
+        if (!!item.required && item.result === '') {
66
+          Bool = false
67
+          IndexArr.push(index)
71 68
         }
72
-      })
73
-      toSubmit(Arr)
69
+      }
70
+    })
71
+    if (Bool) {
72
+      if (StepId < 2) {
73
+        setStepId(StepId + 1)
74
+      } else {
75
+        let Arr = [...FormData]
76
+        Arr.map((item) => {
77
+          if (item.type === 'checkbox') {
78
+            item.options.map((subItem) => {
79
+              if (subItem.selected) {
80
+                item.result.push(subItem.name)
81
+              }
82
+            })
83
+          }
84
+        })
85
+        toSubmit(Arr)
86
+      }
87
+    } else {
88
+      Taro.showToast({ title: `请选择${FormData[IndexArr[0]].question}`, icon: 'none' })
74 89
     }
75 90
   }
76 91
 
@@ -81,80 +96,91 @@ export default function RentingHouse (props) {
81 96
   }
82 97
 
83 98
   return (
84
-    <view className='components BuyHouse'>
85
-      {
86
-        FormData.map((item, index) => (
87
-          <view className='Step' key={`Form-${index}`}>
88
-            {
89
-              index >= StepRange[0] && index < StepRange[1] &&
90
-              <view>
91
-                <text>{item.question}</text>
92
-                {
93
-                  item.type === 'checkbox' &&
94
-                  <view className='CheckList'>
95
-                    {
96
-                      item.options.map((subItem, subIndex) => (
97
-                        <view key={`${item.key}-${subIndex}`} className={subItem.selected ? 'active' : ''} onClick={CutCheckboxs(index, subItem, subIndex)}>
98
-                          {subItem.name}
99
-                          <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
100
-                        </view>
101
-                      ))
102
-                    }
103
-                  </view>
104
-                }
105
-                {
106
-                  item.type === 'radio' &&
107
-                  <view className='CheckList'>
99
+    <view className='components BuyHouse flex-v'>
100
+      <view className='flex-item'>
101
+        <view>
102
+          <ScrollView scrollY>
103
+            <view className='SubContent'>
104
+              {
105
+                children
106
+              }
107
+              {
108
+                FormData.map((item, index) => (
109
+                  <view className='Step' key={`Form-${index}`}>
108 110
                     {
109
-                      item.options.map((subItem, subIndex) => (
110
-                        <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
111
-                          {subItem.name}
112
-                          <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
113
-                        </view>
114
-                      ))
111
+                      index >= StepRange[0] && index < StepRange[1] &&
112
+                      <view>
113
+                        <text>{item.question}</text>
114
+                        {
115
+                          item.type === 'checkbox' &&
116
+                          <view className='CheckList'>
117
+                            {
118
+                              item.options.map((subItem, subIndex) => (
119
+                                <view key={`${item.key}-${subIndex}`} className={subItem.selected ? 'active' : ''} onClick={CutCheckboxs(index, subItem, subIndex)}>
120
+                                  {subItem.name}
121
+                                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
122
+                                </view>
123
+                              ))
124
+                            }
125
+                          </view>
126
+                        }
127
+                        {
128
+                          item.type === 'radio' &&
129
+                          <view className='CheckList'>
130
+                            {
131
+                              item.options.map((subItem, subIndex) => (
132
+                                <view key={`${item.key}-${subIndex}`} className={item.resultId === subItem.id ? 'active' : ''} onClick={CutCheckbox(subItem, index)}>
133
+                                  {subItem.name}
134
+                                  <Image mode='heightFix' src={require('@/assets/findHouse-icon1.png')}></Image>
135
+                                </view>
136
+                              ))
137
+                            }
138
+                          </view>
139
+                        }
140
+                        {
141
+                          item.type === 'radio' && item.remark !== undefined &&
142
+                          <view className='Textarea'>
143
+                            <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { remarkInput(e, index) }} />
144
+                          </view>
145
+                        }
146
+                        {
147
+                          item.type === 'range' &&
148
+                          <view className='RangeList flex-h'>
149
+                            <view className='flex-item'>
150
+                              <Slider activeColor='#193C83' block-color='#fff' onChange={(e) => { Rangehange(e, index) }} min={item.options[0]} max={item.options[1]} show-value />
151
+                            </view>
152
+                            <text>元</text>
153
+                          </view>
154
+                        }
155
+                        {
156
+                          item.type === 'select' &&
157
+                          <view className='Area'>
158
+                            <view className='flex-h' onClick={selectArea}>
159
+                              {
160
+                                item.key === 'district' &&
161
+                                <text className='iconfont icon-dingwei'></text>
162
+                              }
163
+                              <text>{AreaInfo.name || '不限'}</text>
164
+                              <view className='flex-item'></view>
165
+                              <text className='iconfont icon-jiantoudown'></text>
166
+                            </view>
167
+                          </view>
168
+                        }
169
+                        {
170
+                          item.type === 'textarea' &&
171
+                          <view className='Textarea'>
172
+                            <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { textareaInput(e, index) }} />
173
+                          </view>
174
+                        }
175
+                      </view>
115 176
                     }
116 177
                   </view>
117
-                }
118
-                {
119
-                  item.type === 'radio' && item.remark !== undefined &&
120
-                  <view className='Textarea'>
121
-                    <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { remarkInput(e, index) }} />
122
-                  </view>
123
-                }
124
-                {
125
-                  item.type === 'range' &&
126
-                  <view className='RangeList flex-h'>
127
-                    <view className='flex-item'>
128
-                      <Slider activeColor='#193C83' block-color='#fff' onChange={(e) => { Rangehange(e, index) }} min={item.options[0]} max={item.options[1]} show-value />
129
-                    </view>
130
-                    <text>元</text>
131
-                  </view>
132
-                }
133
-                {
134
-                  item.type === 'select' &&
135
-                  <view className='Area'>
136
-                    <view className='flex-h' onClick={selectArea}>
137
-                      {
138
-                        item.key === 'district' &&
139
-                        <text className='iconfont icon-dingwei'></text>
140
-                      }
141
-                      <text>{AreaInfo.name || '不限'}</text>
142
-                      <view className='flex-item'></view>
143
-                      <text className='iconfont icon-jiantoudown'></text>
144
-                    </view>
145
-                  </view>
146
-                }
147
-                {
148
-                  item.type === 'textarea' &&
149
-                  <view className='Textarea'>
150
-                    <Textarea placeholder='请说出您的其他需求,让我们更好的为您服务!' onInput={(e) => { textareaInput(e, index) }} />
151
-                  </view>
152
-                }
153
-              </view>
154
-            }
155
-          </view>
156
-        ))
157
-      }
178
+                ))
179
+              }
180
+            </view>
181
+          </ScrollView>
182
+        </view>
183
+      </view>
158 184
 
159 185
       <view className='Btn'>
160 186
         <text className='active' onClick={NextStep}>下一步</text>

+ 154
- 128
src/pages/index/helpToFindHouse/components/RentingHouse/index.scss Vedi File

@@ -1,147 +1,173 @@
1
-.components.RentingHouse {
1
+.components.BuyHouse {
2 2
   position: relative;
3 3
   overflow: hidden;
4 4
   margin-top: 0 !important;
5 5
   z-index: 1;
6
-  > .Step {
6
+  height: 100%;
7
+  > .flex-item {
7 8
     position: relative;
8 9
     overflow: hidden;
9 10
     > view {
10
-      position: relative;
11
+      width: 100%;
12
+      position: absolute;
13
+      left: 0;
14
+      top: 0;
15
+      bottom: 0;
11 16
       overflow: hidden;
12
-      margin-top: 36px;
13
-      > text {
14
-        display: block;
15
-        font-size: 34px;
16
-        font-weight: bold;
17
-        color: #333;
18
-        line-height: 40px;
19
-        letter-spacing: 4px;
20
-      }
21
-      > view {
22
-        position: relative;
23
-        overflow: hidden;
24
-        margin-top: 30px;
25
-      }
26
-      > .Area {
27
-        > view {
28
-          align-items: center;
29
-          background: #f8f8f8;
30
-          border-radius: 12px;
31
-          padding: 24px 20px;
32
-          > text {
33
-            font-size: 26px;
34
-            color: #333;
35
-            line-height: 40px;
36
-            margin-left: 20px;
37
-            &:first-child {
38
-              margin-left: 0;
39
-              color: #193c83;
40
-            }
41
-          }
42
-        }
43
-      }
44
-      > .Purpose {
45
-        > view {
46
-          align-items: center;
47
-          background: #f8f8f8;
48
-          border-radius: 12px;
49
-          padding: 24px 20px;
50
-          > input {
51
-            font-size: 26px;
52
-            color: #333;
53
-            line-height: 40px;
54
-            display: block;
55
-            width: 100%;
56
-            background: none;
57
-          }
58
-        }
59
-      }
60
-      > .CheckList {
61
-        font-size: 0;
62
-        margin-top: 0;
63
-        > view {
64
-          display: inline-block;
65
-          vertical-align: middle;
66
-          font-size: 30px;
67
-          font-weight: 600;
68
-          color: #333;
69
-          line-height: 40px;
70
-          padding: 20px 0;
71
-          min-width: 194px;
72
-          box-sizing: border-box;
73
-          white-space: nowrap;
74
-          text-align: center;
75
-          border: 2px solid #193c83;
76
-          border-radius: 4px;
77
-          margin-right: 54px;
17
+      > scroll-view {
18
+        width: 100%;
19
+        height: 100%;
20
+        .SubContent {
78 21
           position: relative;
79 22
           overflow: hidden;
80
-          margin-top: 20px;
81
-          &:nth-child(3n+3) {
82
-            margin-right: 0;
83
-          }
84
-          &.active {
85
-            > image {
86
-              opacity: 1;
87
-            }
88
-          }
89
-          > image {
90
-            display: block;
91
-            width: 36px;
92
-            height: 36px;
93
-            position: absolute;
94
-            right: -2px;
95
-            bottom: -2px;
96
-            opacity: 0;
97
-          }
98
-        }
99
-      }
100
-      >.RangeList {
101
-        align-items: center;
102
-        >text {
103
-          color: #999;
104
-          font-size: 28px;
105
-          transform: translateX(-30px);
106
-        }
107
-      }
108
-      > .PriceRange {
109
-        > view {
110
-          align-items: center;
111
-          background: #f8f8f8;
112
-          border-radius: 12px;
113
-          padding: 24px 0;
114
-          > view {
115
-            > input {
116
-              font-size: 26px;
117
-              color: #333;
118
-              line-height: 40px;
119
-              display: block;
120
-              width: 100%;
121
-              background: none;
122
-              text-align: center;
23
+          padding: 0 30px 30px;
24
+          >.Step {
25
+            position: relative;
26
+            overflow: hidden;
27
+            > view {
28
+              position: relative;
29
+              overflow: hidden;
30
+              margin-top: 40px;
31
+              > text {
32
+                display: block;
33
+                font-size: 30px;
34
+                font-weight: bold;
35
+                color: #333;
36
+                line-height: 40px;
37
+                letter-spacing: 4px;
38
+              }
39
+              > view {
40
+                position: relative;
41
+                overflow: hidden;
42
+                margin-top: 30px;
43
+              }
44
+              > .Area {
45
+                > view {
46
+                  align-items: center;
47
+                  background: #f8f8f8;
48
+                  border-radius: 12px;
49
+                  padding: 24px 20px;
50
+                  > text {
51
+                    font-size: 26px;
52
+                    color: #333;
53
+                    line-height: 40px;
54
+                    margin-left: 20px;
55
+                    &:first-child {
56
+                      margin-left: 0;
57
+                      color: #193c83;
58
+                    }
59
+                  }
60
+                }
61
+              }
62
+              > .Purpose {
63
+                > view {
64
+                  align-items: center;
65
+                  background: #f8f8f8;
66
+                  border-radius: 12px;
67
+                  padding: 24px 20px;
68
+                  > input {
69
+                    font-size: 26px;
70
+                    color: #333;
71
+                    line-height: 40px;
72
+                    display: block;
73
+                    width: 100%;
74
+                    background: none;
75
+                  }
76
+                }
77
+              }
78
+              > .CheckList {
79
+                font-size: 0;
80
+                margin-top: 0;
81
+                > view {
82
+                  display: inline-block;
83
+                  vertical-align: middle;
84
+                  font-size: 28px;
85
+                  color: #333;
86
+                  line-height: 40px;
87
+                  padding: 20px 0;
88
+                  min-width: 156px;
89
+                  box-sizing: border-box;
90
+                  white-space: nowrap;
91
+                  text-align: center;
92
+                  border: 2px solid #f8f8f8;
93
+                  border-radius: 8px;
94
+                  margin-right: 20px;
95
+                  position: relative;
96
+                  overflow: hidden;
97
+                  margin-top: 20px;
98
+                  background: #f8f8f8;
99
+                  &:nth-child(4n + 4) {
100
+                    margin-right: 0;
101
+                  }
102
+                  &.active {
103
+                    border: 2px solid #193c83;
104
+                    background: #fff;
105
+                    > image {
106
+                      display: block;
107
+                    }
108
+                  }
109
+                  > image {
110
+                    display: none;
111
+                    width: 36px;
112
+                    height: 36px;
113
+                    position: absolute;
114
+                    right: -2px;
115
+                    bottom: -2px;
116
+                  }
117
+                }
118
+              }
119
+              > .RangeList {
120
+                align-items: center;
121
+                > text {
122
+                  color: #999;
123
+                  font-size: 28px;
124
+                  transform: translateX(-30px);
125
+                }
126
+              }
127
+              > .PriceRange {
128
+                > view {
129
+                  align-items: center;
130
+                  background: #f8f8f8;
131
+                  border-radius: 12px;
132
+                  padding: 24px 0;
133
+                  > view {
134
+                    > input {
135
+                      font-size: 26px;
136
+                      color: #333;
137
+                      line-height: 40px;
138
+                      display: block;
139
+                      width: 100%;
140
+                      background: none;
141
+                      text-align: center;
142
+                    }
143
+                  }
144
+                }
145
+              }
146
+              > .Textarea {
147
+                background: #f8f8f8;
148
+                border-radius: 12px;
149
+                padding: 20px;
150
+                > textarea {
151
+                  font-size: 26px;
152
+                  color: #333;
153
+                  line-height: 40px;
154
+                  display: block;
155
+                  width: 100%;
156
+                  background: none;
157
+                }
158
+              }
123 159
             }
124 160
           }
125 161
         }
126 162
       }
127
-      >.Textarea {
128
-        background: #f8f8f8;
129
-        border-radius: 12px;
130
-        padding: 20px;
131
-        >textarea {
132
-          font-size: 26px;
133
-          color: #333;
134
-          line-height: 40px;
135
-          display: block;
136
-          width: 100%;
137
-          background: none;
138
-        }
139
-      }
140 163
     }
141 164
   }
142
-  >.Btn {
143
-    padding: 0 30px;
144
-    margin: 74px auto 60px;
165
+  > .Btn {
166
+    padding: 0 30px 20px;
167
+    background: #fff;
168
+    box-shadow: 0 0 6px 6px rgba(0, 0, 0, 0.03);
169
+    position: relative;
170
+    z-index: 2;
145 171
     > text {
146 172
       display: block;
147 173
       text-align: center;

+ 25
- 21
src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.jsx Vedi File

@@ -1,8 +1,9 @@
1 1
 
2 2
 import { useState } from 'react'
3 3
 import Taro from '@tarojs/taro'
4
-import { Image, Block } from '@tarojs/components'
4
+import { Image, Block, ScrollView } from '@tarojs/components'
5 5
 import { getImgURL } from '@/utils/image'
6
+import ProjectItemCard from '@/components/ProjectItemCard/index'
6 7
 import '@/assets/css/iconfont.css'
7 8
 import './index.scss'
8 9
 
@@ -46,34 +47,37 @@ export default function SubmitBuyHouseResult (props) {
46 47
 
47 48
             {/* 匹配楼盘 */}
48 49
             {
49
-              !!List.length && ShowResult &&
50
+              List.length > 0 && ShowResult &&
50 51
               <view className='Recommend'>
51 52
                 <view className='Title'>
52 53
                   <view>
53 54
                     <text>匹配楼盘</text>
54 55
                   </view>
55 56
                 </view>
56
-                {
57
-                  List.slice(0, 1).map((item, index) => (
58
-                    <Block key={`ListItem-${index}`}>
59
-                      {/* <view className='PlanTitle'>“方案一”</view> */}
60
-                      <view className='RecommendBuildingItem' onClick={() => {Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${item.buildingId}` })}}>
61
-                        <view>
62
-                          <view className='Img'>
63
-                            <Image mode='aspectFill' src={getImgURL(item.poster || item.preSalePermit)} className='centerLabel'></Image>
64
-                          </view>
65
-                          <view className='Title flex-h'>
66
-                            <view className='flex-item'>
67
-                              <text>{item.name}</text>
57
+                <view className={List.length === 1 ? 'ScrollViewX active' : 'ScrollViewX'}>
58
+                  <ScrollView scrollX>
59
+                    <view className='ListContainer'>
60
+                      {
61
+                        List.map((item, index) => (
62
+                          <view className='RecommendBuildingItem' key={`item-${index}`} onClick={() => { Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${item.buildingId}` }) }}>
63
+                            <view>
64
+                              <view className='Img'>
65
+                                <Image mode='aspectFill' src={getImgURL(item.poster || item.preSalePermit)} className='centerLabel'></Image>
66
+                              </view>
67
+                              <view className='Title flex-h'>
68
+                                <view className='flex-item'>
69
+                                  <text>{item.name}</text>
70
+                                </view>
71
+                                <view className='Price'><text>{item.price}</text></view>
72
+                              </view>
73
+                              <text className='Address'>{item.address}</text>
68 74
                             </view>
69
-                            <view className='Price'><text>{item.price}</text></view>
70 75
                           </view>
71
-                          <text className='Address'>{item.address}</text>
72
-                        </view>
73
-                      </view>
74
-                    </Block>
75
-                  ))
76
-                }
76
+                        ))
77
+                      }
78
+                    </view>
79
+                  </ScrollView>
80
+                </view>
77 81
               </view>
78 82
             }
79 83
 

+ 105
- 72
src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.scss Vedi File

@@ -8,25 +8,25 @@
8 8
   margin: 0 !important;
9 9
   padding: 0 !important;
10 10
   z-index: 100 !important;
11
-  >view {
11
+  > view {
12 12
     width: 100%;
13
-    >view {
13
+    > view {
14 14
       padding: 0 30px;
15 15
       position: relative;
16 16
       overflow: hidden;
17
-      >view {
17
+      > view {
18 18
         position: relative;
19 19
         overflow: hidden;
20 20
         min-height: 80px;
21 21
         background: #fff;
22 22
         border-radius: 24px;
23
-        >.Status {
23
+        > .Status {
24 24
           text-align: center;
25 25
           margin-top: 40px;
26
-          >text {
26
+          > text {
27 27
             font-size: 34px;
28 28
             font-weight: bold;
29
-            color: #193C83;
29
+            color: #193c83;
30 30
             display: block;
31 31
             text-align: center;
32 32
             line-height: 34px;
@@ -38,11 +38,11 @@
38 38
             }
39 39
           }
40 40
         }
41
-        >.Tips {
41
+        > .Tips {
42 42
           position: relative;
43 43
           overflow: hidden;
44 44
           margin-top: 30px;
45
-          >text {
45
+          > text {
46 46
             display: block;
47 47
             text-align: center;
48 48
             font-size: 26px;
@@ -51,42 +51,43 @@
51 51
             white-space: nowrap;
52 52
           }
53 53
         }
54
-        >.Btn {
54
+        > .Btn {
55 55
           padding: 0 80px;
56 56
           position: relative;
57 57
           overflow: hidden;
58 58
           margin-top: 40px;
59 59
           align-items: center;
60 60
           margin-bottom: 60px;
61
-          >text, button {
61
+          > text,
62
+          button {
62 63
             padding: 0;
63 64
             font-size: 30px;
64 65
             line-height: 78px;
65 66
             border-radius: 78px;
66 67
             margin-left: 60px;
67 68
             text-align: center;
68
-            border: 2px solid #193C83;
69
+            border: 2px solid #193c83;
69 70
             box-sizing: border-box;
70
-            color: #193C83;
71
+            color: #193c83;
71 72
             font-weight: bold;
72 73
             &:first-child {
73 74
               margin-left: 0;
74 75
             }
75 76
             &.active {
76
-              background: #193C83;
77
+              background: #193c83;
77 78
               color: #fff;
78 79
             }
79 80
           }
80 81
         }
81
-        >.Recommend {
82
+        > .Recommend {
82 83
           padding: 0 30px;
83 84
           position: relative;
84 85
           overflow: hidden;
85
-          >.Title {
86
+          > .Title {
86 87
             position: relative;
87 88
             overflow: hidden;
88 89
             &::after {
89
-              content: '';
90
+              content: "";
90 91
               width: 100%;
91 92
               display: block;
92 93
               position: absolute;
@@ -96,7 +97,7 @@
96 97
               background: rgba(0, 0, 0, 0.12);
97 98
               z-index: 1;
98 99
             }
99
-            >view {
100
+            > view {
100 101
               display: block;
101 102
               position: relative;
102 103
               z-index: 2;
@@ -106,7 +107,7 @@
106 107
               text-align: center;
107 108
               font-size: 0;
108 109
               &::after {
109
-                content: '';
110
+                content: "";
110 111
                 width: 100%;
111 112
                 display: block;
112 113
                 position: absolute;
@@ -116,7 +117,7 @@
116 117
                 z-index: 2;
117 118
                 border-bottom: 2px dashed #333;
118 119
               }
119
-              >text {
120
+              > text {
120 121
                 display: inline-block;
121 122
                 position: relative;
122 123
                 z-index: 3;
@@ -129,67 +130,99 @@
129 130
               }
130 131
             }
131 132
           }
132
-          >.PlanTitle {
133
-            font-size: 30px;
134
-            font-weight: bold;
135
-            white-space: nowrap;
133
+          > .ScrollViewX {
134
+            width: 100%;
135
+            height: 400px;
136 136
             position: relative;
137 137
             overflow: hidden;
138
-            margin-top: 40px;
139
-            text-align: center;
140
-            >text {
141
-              color: #FC3838;
142
-            }
143
-          }
144
-          >.RecommendBuildingItem {
145
-            position: relative;
146
-            overflow: hidden;
147
-            padding: 0 60px;
148 138
             margin-top: 30px;
149 139
             margin-bottom: 50px;
150
-            >view {
151
-              position: relative;
152
-              overflow: hidden;
153
-              >.Img {
154
-                width: 100%;
155
-                padding-bottom: 60%;
156
-                position: relative;
157
-                overflow: hidden;
158
-                background: #eee;
159
-                >image {
160
-                  width: 100%;
161
-                  height: 100%;
162
-                }
163
-              }
164
-              >.Title {
165
-                align-items: flex-start;
166
-                margin-top: 24px;
167
-                >.flex-item {
168
-                  >text {
169
-                    display: block;
170
-                    font-size: 32px;
171
-                    font-weight: bold;
172
-                    color: #333;
173
-                    line-height: 40px;
140
+            &.active {
141
+              height: 470px;
142
+            }
143
+            > scroll-view {
144
+              width: 100%;
145
+              height: 100%;
146
+              .ListContainer {
147
+                min-width: 100%;
148
+                white-space: nowrap;
149
+                font-size: 0;
150
+                > .RecommendBuildingItem {
151
+                  &:only-child {
152
+                    width: 100%;
153
+                    margin-right: 0;
174 154
                   }
175
-                }
176
-                >.Price {
177
-                  font-size: 22px;
178
-                  font-weight: bold;
179
-                  color: #333;
180
-                  margin-left: 10px;
181
-                  line-height: 40px;
182
-                  >text {
183
-                    color: #FC2C2C;
155
+                  position: relative;
156
+                  overflow: hidden;
157
+                  display: inline-block;
158
+                  vertical-align: middle;
159
+                  width: 500px;
160
+                  margin-right: 30px;
161
+                  > view {
162
+                    position: relative;
163
+                    overflow: hidden;
164
+                    > .Img {
165
+                      width: 100%;
166
+                      padding-bottom: 60%;
167
+                      position: relative;
168
+                      overflow: hidden;
169
+                      background: #eee;
170
+                      > image {
171
+                        width: 100%;
172
+                        height: 100%;
173
+                      }
174
+                    }
175
+                    > .Title {
176
+                      align-items: flex-start;
177
+                      margin-top: 24px;
178
+                      > .flex-item {
179
+                        > text {
180
+                          display: block;
181
+                          font-size: 32px;
182
+                          font-weight: bold;
183
+                          color: #333;
184
+                          line-height: 40px;
185
+                          overflow: hidden;
186
+                          white-space: nowrap;
187
+                          text-overflow: ellipsis;
188
+                        }
189
+                      }
190
+                      > .Price {
191
+                        font-size: 22px;
192
+                        font-weight: bold;
193
+                        color: #333;
194
+                        margin-left: 10px;
195
+                        line-height: 40px;
196
+                        max-width: 50%;
197
+                        overflow: hidden;
198
+                        white-space: nowrap;
199
+                        text-overflow: ellipsis;
200
+                        > text {
201
+                          color: #fc2c2c;
202
+                        }
203
+                      }
204
+                    }
205
+                    > .Address {
206
+                      font-size: 22px;
207
+                      color: #666;
208
+                      line-height: 30px;
209
+                      margin-top: 20px;
210
+                    }
184 211
                   }
185 212
                 }
186 213
               }
187
-              >.Address {
188
-                font-size: 22px;
189
-                color: #666;
190
-                line-height: 30px;
191
-                margin-top: 20px;
192
-              }
214
+            }
215
+          }
216
+          > .PlanTitle {
217
+            font-size: 30px;
218
+            font-weight: bold;
219
+            white-space: nowrap;
220
+            position: relative;
221
+            overflow: hidden;
222
+            margin-top: 40px;
223
+            text-align: center;
224
+            > text {
225
+              color: #fc3838;
193 226
             }
194 227
           }
195 228
         }

+ 73
- 30
src/pages/index/helpToFindHouse/index.jsx Vedi File

@@ -13,7 +13,8 @@ import RentingHouse from './components/RentingHouse/index'
13 13
 import HousePurchasing from './components/HousePurchasing/index'
14 14
 import SubmitBuyHouseResult from './components/SubmitBuyHouseResult/index'
15 15
 
16
-export default withLayout(() => {
16
+export default withLayout((props) => {
17
+  const { city } = props
17 18
 
18 19
   const user = useSelector(state => state.user)
19 20
   const [DemandList] = useState([
@@ -47,27 +48,56 @@ export default withLayout(() => {
47 48
   const submitForm = (data) => {
48 49
     data = data || []
49 50
     let params = []
51
+    let areaResultId;
50 52
     data.map((item) => {
51 53
       if (item.key === 'budget') {
52
-        params.push({ ...item, key: 'minPrice', result: CurrentDemandId === 2 ? item.options[0] : item.options[0] * 10000 })
53
-        params.push({ ...item, key: 'maxPrice', result: CurrentDemandId === 2 ? item.result === '' ? 5000000 : item.result : item.result === '' ? 5000000 : item.result * 10000 })
54
+        // 用户选择 200, 则区间为 [100, 300]
55
+        // 用户选择 300, 则区间为 [200, 400]
56
+        const price = item.result === '' ? 300 : item.result - 0;
57
+        const min = price < 100 ? 100 : price - 100;
58
+        const max = price + 100;
59
+
60
+        params.push({ ...item, key: 'minPrice', result: CurrentDemandId === 2 ? min : min * 10000 })
61
+        params.push({ ...item, key: 'maxPrice', result: CurrentDemandId === 2 ? max : max * 10000 })
54 62
       } else {
63
+        if (CurrentDemandId === 1) {
64
+          if (item.key === 'area') {
65
+            areaResultId = item.resultId
66
+          }
67
+        }
68
+
55 69
         if (item.result !== '' || item.resultId !== null) {
56 70
           params.push(item)
57 71
         }
58 72
       }
59 73
     })
60 74
     params.push({ question: '创建人小程序人员', result: user?.userInfo?.person?.personId, key: 'personId' })
61
-    if(CurrentDemandId !== 3) {
75
+    if (CurrentDemandId !== 3) {
62 76
       params.push({ question: '意向区域', result: AreaInfo.id, key: 'intentArea' })
63 77
     }
64 78
     let payload = {}
65 79
     params.map((item) => {
66 80
       payload[item.key] = item.result || item.resultId
67 81
     })
68
-    fetch({ url: API_HELP_FIND_HOUSE_SUBMIT, method: 'post', payload: { ...payload, questionnaire: JSON.stringify(params), type: CurrentDemandId } }).then((res) => {
69
-      if(CurrentDemandId === 1) {
70
-        setResultList(res.taBuildingList || [])
82
+    fetch({
83
+      url: API_HELP_FIND_HOUSE_SUBMIT,
84
+      method: 'post',
85
+      payload: {
86
+        ...payload,
87
+        questionnaire: JSON.stringify(params),
88
+        type: CurrentDemandId,
89
+        // 只有买房需要智能推荐
90
+        needRecommend: CurrentDemandId === 1,
91
+        cityId: city?.id,
92
+        areaResultId,
93
+      },
94
+    }).then((res) => {
95
+      if (CurrentDemandId === 1) {
96
+        data.map((item) => {
97
+          if(item.key === 'isNew' && item.resultId - 0 !== 2) { // 选择非二手房时显示推荐
98
+            setResultList(res.taBuildingList || [])
99
+          }
100
+        })
71 101
       }
72 102
       setShowPopup(true)
73 103
     })
@@ -77,6 +107,23 @@ export default withLayout(() => {
77 107
     getFeedbackSetting().then((res) => setSetting(res))
78 108
   }, [])
79 109
 
110
+  const TopDom = (
111
+    <view className='DemandContainer'>
112
+      <text>选择您的需求</text>
113
+      <view className='Demand flex-h' style='margin-top: 10px;'>
114
+        {
115
+          DemandList.map((item, index) => (
116
+            <view key={`DemandItem-${index}`} className={CurrentDemandId === item.id ? 'flex-item active' : 'flex-item'} onClick={CutDemandId(item.id)}>
117
+              <Image mode='heightFix' src={item.icon || null}></Image>
118
+              <text>{item.name}</text>
119
+              <text>{item.spell}</text>
120
+            </view>
121
+          ))
122
+        }
123
+      </view>
124
+    </view>
125
+  )
126
+
80 127
   return (
81 128
     <view className='Page helpToFindHouse'>
82 129
 
@@ -87,47 +134,43 @@ export default withLayout(() => {
87 134
         <SubmitBuyHouseResult setting={setting} List={ResultList}></SubmitBuyHouseResult>
88 135
       }
89 136
 
90
-      <ScrollView scroll-y refresher-enabled={false}>
91
-        <view className='PageContent'>
137
+      <view className='PageContent flex-v'>
92 138
 
93
-          {
94
-            ShowDemand &&
95
-            <view>
96
-              <text>选择您的需求</text>
97
-              <view className='Demand flex-h' style='margin-top: 10px;'>
98
-                {
99
-                  DemandList.map((item, index) => (
100
-                    <view key={`DemandItem-${index}`} className={CurrentDemandId === item.id ? 'flex-item active' : 'flex-item'} onClick={CutDemandId(item.id)}>
101
-                      <Image mode='heightFix' src={item.icon || null}></Image>
102
-                      <text>{item.name}</text>
103
-                      <text>{item.spell}</text>
104
-                    </view>
105
-                  ))
106
-                }
107
-              </view>
108
-            </view>
109
-          }
139
+        <view className='flex-item'>
110 140
 
111 141
           {/* 买房 */}
112 142
           {
113 143
             CurrentDemandId === 1 &&
114
-            <BuyHouse change={StepChange} toSubmit={submitForm} AreaInfo={AreaInfo} selectArea={() => { setShowCitysPopup(true) }}></BuyHouse>
144
+            <BuyHouse change={StepChange} toSubmit={submitForm} AreaInfo={AreaInfo} selectArea={() => { setShowCitysPopup(true) }}>
145
+              {
146
+                ShowDemand && TopDom
147
+              }
148
+            </BuyHouse>
115 149
           }
116 150
 
117 151
           {/* 租房 */}
118 152
           {
119 153
             CurrentDemandId === 2 &&
120
-            <RentingHouse change={StepChange} toSubmit={submitForm} AreaInfo={AreaInfo} selectArea={() => { setShowCitysPopup(true) }}></RentingHouse>
154
+            <RentingHouse change={StepChange} toSubmit={submitForm} AreaInfo={AreaInfo} selectArea={() => { setShowCitysPopup(true) }}>
155
+              {
156
+                ShowDemand && TopDom
157
+              }
158
+            </RentingHouse>
121 159
           }
122 160
 
123 161
           {/* 置业 */}
124 162
           {
125 163
             CurrentDemandId === 3 &&
126
-            <HousePurchasing change={StepChange} toSubmit={submitForm} AreaInfo={AreaInfo} selectArea={() => { setShowCitysPopup(true) }}></HousePurchasing>
164
+            <HousePurchasing change={StepChange} toSubmit={submitForm} AreaInfo={AreaInfo} selectArea={() => { setShowCitysPopup(true) }}>
165
+              {
166
+                ShowDemand && TopDom
167
+              }
168
+            </HousePurchasing>
127 169
           }
128 170
 
129 171
         </view>
130
-      </ScrollView>
172
+
173
+      </view>
131 174
 
132 175
     </view>
133 176
   )

+ 52
- 59
src/pages/index/helpToFindHouse/index.scss Vedi File

@@ -4,75 +4,68 @@
4 4
   height: 100%;
5 5
   position: relative;
6 6
   overflow: hidden;
7
-  > scroll-view {
8
-    width: 100%;
9
-    height: 100%;
7
+  >.PageContent {
10 8
     position: relative;
11
-    z-index: 1;
12
-    .PageContent {
9
+    overflow: hidden;
10
+    height: 100vh;
11
+    .DemandContainer {
13 12
       position: relative;
14 13
       overflow: hidden;
15
-      min-height: 100vh;
14
+      &:first-child {
15
+        margin-top: 30px;
16
+      }
17
+      > text {
18
+        display: block;
19
+        font-size: 30px;
20
+        font-weight: bold;
21
+        color: #333;
22
+        line-height: 40px;
23
+        letter-spacing: 4px;
24
+      }
16 25
       > view {
26
+        // padding: 0 30px;
17 27
         position: relative;
18 28
         overflow: hidden;
19
-        &:first-child {
20
-          margin-top: 30px;
21
-        }
22
-        > text {
23
-          display: block;
24
-          font-size: 34px;
25
-          font-weight: bold;
26
-          color: #333;
27
-          line-height: 40px;
28
-          text-indent: 30px;
29
-          letter-spacing: 4px;
30
-        }
29
+      }
30
+      > .Demand {
31
+        align-items: center;
31 32
         > view {
32
-          padding: 0 30px;
33
+          box-sizing: border-box;
34
+          border: 2px solid #333;
35
+          border-radius: 8px;
36
+          margin-left: 30px;
33 37
           position: relative;
34 38
           overflow: hidden;
35
-        }
36
-        > .Demand {
37
-          align-items: center;
38
-          > view {
39
-            box-sizing: border-box;
40
-            border: 2px solid #333;
41
-            border-radius: 8px;
42
-            margin-left: 30px;
43
-            position: relative;
44
-            overflow: hidden;
45
-            padding: 0 20px;
46
-            &:first-child {
47
-              margin-left: 0;
48
-            }
49
-            &.active {
50
-              border-color: #193c83;
51
-              > text {
52
-                color: #193c83;
53
-              }
54
-            }
55
-            > image {
56
-              width: 24px;
57
-              height: 24px;
58
-              display: block;
59
-              margin: 10px auto 0;
60
-            }
39
+          padding: 0 20px;
40
+          &:first-child {
41
+            margin-left: 0;
42
+          }
43
+          &.active {
44
+            border-color: #193c83;
61 45
             > text {
62
-              font-size: 30px;
63
-              line-height: 30px;
64
-              display: block;
65
-              text-align: center;
66
-              margin-top: 10px;
67
-              letter-spacing: 4px;
68
-              &:last-child {
69
-                font-size: 22px;
70
-                font-weight: bold;
71
-                color: #ccc;
72
-                padding: 6px 0;
73
-                border-top: 2px solid #eee;
74
-                letter-spacing: 0;
75
-              }
46
+              color: #193c83;
47
+            }
48
+          }
49
+          > image {
50
+            width: 24px;
51
+            height: 24px;
52
+            display: block;
53
+            margin: 10px auto 0;
54
+          }
55
+          > text {
56
+            font-size: 30px;
57
+            line-height: 30px;
58
+            display: block;
59
+            text-align: center;
60
+            margin-top: 10px;
61
+            letter-spacing: 4px;
62
+            &:last-child {
63
+              font-size: 22px;
64
+              font-weight: bold;
65
+              color: #ccc;
66
+              padding: 6px 0;
67
+              border-top: 2px solid #eee;
68
+              letter-spacing: 0;
76 69
             }
77 70
           }
78 71
         }

+ 3
- 2
src/pages/index/newsList/index.jsx Vedi File

@@ -8,8 +8,9 @@ import { API_NEWS_LIST } from '@/constants/api'
8 8
 import './index.scss'
9 9
 import NewsListItem from '../components/NewsListItem/index'
10 10
 
11
-export default withLayout(() => {
11
+export default withLayout((props) => {
12 12
   
13
+  const { city } = props
13 14
   const user = useSelector(state => state.user)
14 15
   const [PageList, setPageList] = useState([])
15 16
   const [IsPull, setPull] = useState(false)
@@ -35,7 +36,7 @@ export default withLayout(() => {
35 36
 
36 37
   const GetPageList = () => {
37 38
     setHasNextPage(false)
38
-    fetch({ url: API_NEWS_LIST, method: 'get', payload: { pageNumber, pageSize: 10 } }).then((res) => {
39
+    fetch({ url: API_NEWS_LIST, method: 'get', payload: { pageNumber, pageSize: 10, cityId: city.id } }).then((res) => {
39 40
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
40 41
       setHasNextPage(res.current < res.pages)
41 42
       setPull(false)

+ 3
- 1
src/pages/mine/addCustomer/components/BuildingPicker.jsx Vedi File

@@ -1,4 +1,5 @@
1 1
 import { useEffect, useState } from 'react'
2
+import { useSelector } from 'react-redux'
2 3
 import Picker from '@/components/Picker'
3 4
 import { fetch } from '@/utils/request'
4 5
 import { API_GET_AGENT_BUILDINGS, API_ITEMS_LIST } from '@/constants/api'
@@ -7,11 +8,12 @@ import { ROLE_CODE } from '@/constants/user'
7 8
 export default (props) => {
8 9
 
9 10
   const { type = '', change = () => {} } = props
11
+  const city = useSelector(state => state.city)
10 12
   const [dicts, setDicts] = useState([])
11 13
 
12 14
   useEffect(() => {
13 15
     if (type === ROLE_CODE.CUSTOMER) {
14
-      fetch({ url: API_ITEMS_LIST, payload: { pageNumber: 1, pageSize: 1000 } }).then((res) => {
16
+      fetch({ url: API_ITEMS_LIST, payload: { pageNumber: 1, pageSize: 1000, cityId: city.curCity.id } }).then((res) => {
15 17
         setDicts(res.records || [])
16 18
       })
17 19
     } else {

+ 4
- 0
src/pages/mine/feedBack/index.jsx Vedi File

@@ -30,6 +30,10 @@ export default withLayout(() => {
30 30
   }
31 31
 
32 32
   const Submit = () => {
33
+    if(FormData.message === '') {
34
+      Taro.showToast({ title: '请填写问题描述', icon: 'none'})
35
+      return false
36
+    }
33 37
     fetch({ url: API_FEEDBACK_SUBMIT, method: 'post', payload: FormData }).then(() => {
34 38
       Taro.showToast({
35 39
         title: '反馈成功', icon: 'none', complete: () => {

+ 2
- 0
src/pages/mine/index.jsx Vedi File

@@ -20,12 +20,14 @@ const copyRight = `技术支持: 云致科技 @ ${(new Date()).getFullYear()}`
20 20
 export default withLayout(() => {
21 21
 
22 22
   const user = useSelector(state => state.user)
23
+  const city = useSelector(state => state.city)
23 24
   const [UserRole, setUserRole] = useState(null) // 1-普通用户 2-经纪人 3-置业顾问 4-驻场管理
24 25
   const [MenuList, setMenuList] = useState([])
25 26
   const { dispatch } = store
26 27
 
27 28
   useEffect(() => {
28 29
     if (user?.userInfo?.person?.personId) {
30
+      console.log(city)
29 31
       const person = user.userInfo.person
30 32
       setUserRole(person.personType === ROLE_CODE.CHANNEL_AGENT ? 2 : person.personType === ROLE_CODE.CONSULTANT ? 3 : person.personType === ROLE_CODE.MARKETING ? 4 : 1)
31 33
     }

+ 1
- 1
src/pages/mine/myRecommendCode/index.jsx Vedi File

@@ -16,7 +16,7 @@ export default withLayout((props) => {
16 16
   useEffect(() => {
17 17
     const payload = {
18 18
       scene: `id=${person?.personId}&from=${page.type}_share&recommender=${person?.personId}`,
19
-      page: `pages/consultant/myHomepage/index`
19
+      page: `subpackages/pages/consultant/myHomepage/index`
20 20
     }
21 21
     fetch({ url: API_QRCODE, payload, method: 'post' }).then((res) => {
22 22
       setQrCodeUrl(res)

+ 1
- 1
src/routes.js Vedi File

@@ -384,7 +384,7 @@ const routes = [
384 384
     name: '个人主页',
385 385
     page: 'pages/consultant/myHomepage/index',
386 386
     pkg: 'subpackages',
387
-    type: 'mine',
387
+    type: 'card',
388 388
     // auth: ['phone'],
389 389
   },
390 390
   {

+ 2
- 1
src/subpackages/pages/consultant/myHomepage/index.config.js Vedi File

@@ -1,3 +1,4 @@
1 1
 export default {
2
-  navigationBarTitleText: '个人主页'
2
+  navigationBarTitleText: '个人主页',
3
+  enableShareAppMessage: true
3 4
 }

+ 26
- 12
src/subpackages/pages/consultant/myHomepage/index.jsx Vedi File

@@ -1,11 +1,11 @@
1 1
 import { useState, useEffect } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import withLayout from '@/layout'
4
-import { ScrollView, Image } from '@tarojs/components'
4
+import { ScrollView, Image, Button } from '@tarojs/components'
5 5
 import ProjectListItem from '@/components/ProjectListItem/index'
6 6
 import { useSelector } from 'react-redux'
7 7
 import { fetch } from '@/utils/request'
8
-import { API_AGENT_CURRENT, API_ITEMS_DETAIL, API_CARDS_LIST } from '@/constants/api'
8
+import { API_CARDS_UV, API_ITEMS_DETAIL, API_CARDS_LIST } from '@/constants/api'
9 9
 import { getImgURL } from '@/utils/image'
10 10
 import useLike from "@/utils/hooks/useLike";
11 11
 import '@/assets/css/iconfont.css'
@@ -21,14 +21,28 @@ export default withLayout((props) => {
21 21
   const [PullTimer, setPullTimer] = useState(null)
22 22
   const [UserInfo, setUserInfo] = useState({})
23 23
   const [BuildingInfo, setBuildingInfo] = useState({})
24
+  const [LikeNum, setLikeNum] = useState(0)
24 25
 
25 26
   const user = useSelector(state => state.user)
26 27
   const [PersonId, setPersonId] = useState(null)
27 28
 
28
-  const [isSave, handleFavor] = useLike(BuildingInfo?.isSave, {
29
-    id,
29
+  const [isSave, handleFavor] = useLike(UserInfo?.liked, {
30
+    id: id || user.userInfo.person.personId,
30 31
     ...trackData,
31
-  });
32
+    eventType: 'consultant'
33
+  }, () => {
34
+    if(!isSave) {
35
+      AddHotNum()
36
+    }
37
+    const likeNum = isSave ? UserInfo.likeNum - 1 : UserInfo.likeNum + 1
38
+    setLikeNum(likeNum)
39
+  })
40
+
41
+  useEffect(() => {
42
+    if(UserInfo.id) {
43
+      setLikeNum(UserInfo.likeNum)
44
+    }
45
+  }, [UserInfo])
32 46
 
33 47
   useEffect(() => {
34 48
     if (PersonId !== user.userInfo.person.personId) {
@@ -52,14 +66,14 @@ export default withLayout((props) => {
52 66
   }, [PersonId])
53 67
 
54 68
   useEffect(() => {
55
-    if (UserInfo.buildingId) {
69
+    if (UserInfo.buildingId && !BuildingInfo.buildingId) {
56 70
       GetBuildingInfo()
57 71
     }
58 72
   }, [UserInfo])
59 73
 
60
-  const GetUserInfo = () => {
61
-    fetch({ url: API_AGENT_CURRENT, method: 'get' }).then((res) => {
62
-      setUserInfo(res)
74
+  const AddHotNum = () => {
75
+    fetch({ url: API_CARDS_UV + `/${id || PersonId}`, method: 'post' }).then(() => {
76
+      setUserInfo({...UserInfo, hotNum: (UserInfo.hotNum || 0) - 0 + 1})
63 77
     })
64 78
   }
65 79
 
@@ -99,7 +113,7 @@ export default withLayout((props) => {
99 113
                     <text>{UserInfo.name} {UserInfo.phone}</text>
100 114
                   </view>
101 115
                   <text onClick={handleFavor} className='iconfont icon-dianzan' style={isSave ? { color: 'red' } : undefined}></text>
102
-                  <text onClick={handleFavor}>{UserInfo.likeNum || 0}{isSave ? `已点赞` : '赞'}</text>
116
+                  <text onClick={handleFavor}>{LikeNum}{isSave ? `已点赞` : '赞'}</text>
103 117
                 </view>
104 118
                 <view className='Tag'>
105 119
                   <view>
@@ -134,7 +148,7 @@ export default withLayout((props) => {
134 148
                 }
135 149
               </view>
136 150
               <text className='iconfont icon-renqi'></text>
137
-              <text>人气值{UserInfo.hotNum || 999}</text>
151
+              <text>人气值{(UserInfo.hotNum || 0) + 999}</text>
138 152
             </view>
139 153
           </view>
140 154
 
@@ -162,7 +176,7 @@ export default withLayout((props) => {
162 176
               </view>
163 177
             </view>
164 178
             <view className='Btn'>
165
-              <text>分享主页</text>
179
+              <Button className='Share' open-type='share'>分享主页</Button>
166 180
             </view>
167 181
           </view>
168 182
 

+ 6
- 1
src/subpackages/pages/consultant/myHomepage/index.scss Vedi File

@@ -209,7 +209,7 @@
209 209
           }
210 210
           > .Btn {
211 211
             margin-top: 40px;
212
-            > text {
212
+            > button {
213 213
               display: block;
214 214
               text-align: center;
215 215
               font-size: 32px;
@@ -218,6 +218,10 @@
218 218
               color: #333;
219 219
               font-weight: bold;
220 220
               background: #f2f2f2;
221
+              border: none;
222
+              &::after {
223
+                border: none;
224
+              }
221 225
             }
222 226
           }
223 227
         }
@@ -349,6 +353,7 @@
349 353
             line-height: 92px;
350 354
             background: #193c83;
351 355
             border-radius: 92px;
356
+            border: none;
352 357
           }
353 358
         }
354 359
       }

+ 1
- 1
src/subpackages/pages/marketing/components/ResidentListItem/index.jsx Vedi File

@@ -102,7 +102,7 @@ export default function ResidentListItem (props) {
102 102
       <view className='flex-h'>
103 103
         <text>报备时间:</text>
104 104
         <view className='flex-item'>
105
-          <text>{formatDate(data.createDate, 'yyyy/M/d')}</text>
105
+          <text>{formatDate(data.createDate, 'yyyy/MM/dd')}</text>
106 106
         </view>
107 107
       </view>
108 108
       <view className='Opt'>

+ 1
- 1
src/utils/chatDate.js Vedi File

@@ -25,7 +25,7 @@ export function getDateByStr(dtStr) {
25 25
   return new Date(t[0], t[1]-1, t[2], t[3] || 0, t[4] || 0, t[5] || 0)
26 26
 }
27 27
 
28
-//例子 getDateFormat(new Date().valueOf(),true,'yyyy/M/d')
28
+//例子 getDateFormat(new Date().valueOf(),true,'yyyy/MM/dd')
29 29
 export function formatDate(dt, fmt) {
30 30
   if (!dt) return dt;
31 31
 

+ 4
- 2
src/utils/hooks/useLike.js Vedi File

@@ -5,9 +5,9 @@ import { resolvePath } from '@/constants/api'
5 5
 import track from '@/utils/tracking/track'
6 6
 
7 7
 const addLike = (type, id) => fetch({ url: resolvePath(`${type}/like/${id}`),  method: 'POST' })
8
-const cancelLike = (type, id) => fetch({ url: resolvePath(`${type}/like/${id}`),  method: 'POST' })
8
+const cancelLike = (type, id) => fetch({ url: resolvePath(`${type}/like/${id}`),  method: 'DELETE' })
9 9
 
10
-export default function(liked, options = {}) {
10
+export default function(liked, options = {}, callback = () => {}) {
11 11
   const { id, eventType } = options
12 12
   const [isLiked, setIsLiked] = useState(liked)
13 13
 
@@ -21,6 +21,7 @@ export default function(liked, options = {}) {
21 21
           title: '已取消点赞',
22 22
           icon: 'none',
23 23
         })
24
+        callback()
24 25
       })
25 26
     } else {
26 27
       addLike(eventType, id).then(() => {
@@ -29,6 +30,7 @@ export default function(liked, options = {}) {
29 30
           title: '点赞成功',
30 31
           icon: 'none',
31 32
         })
33
+        callback()
32 34
       })
33 35
     }
34 36
     track({

+ 21
- 1
src/utils/image.js Vedi File

@@ -1,14 +1,34 @@
1 1
 
2 2
 import Taro from '@tarojs/taro'
3 3
 import { authorize } from './wxAuth'
4
+
4 5
 // eslint-disable-next-line no-undef
5 6
 const host = HOST;
7
+// eslint-disable-next-line no-undef
8
+const ossPath = OSS_PATH;
9
+
10
+let platform = null;
11
+
12
+function getPlatform() {
13
+  if (!platform) {
14
+    platform = Taro.getSystemInfoSync().platform;
15
+  }
16
+  return platform;
17
+}
6 18
 
7 19
 export function getImgURL(img) {
8 20
   if (!img) return undefined;
9 21
 
10
-  if (img.indexOf('http') === 0) return img;
22
+  if (img.indexOf(ossPath) > -1) {
23
+    const plat = getPlatform();
24
+    if (plat.toLocaleLowerCase().indexOf('ios') > -1) {
25
+      return `${img}?x-oss-process=style/thumb`
26
+    } else {
27
+      return `${img}?x-oss-process=style/webp`
28
+    }
29
+  }
11 30
 
31
+  if (img.indexOf('http') === 0) return img;
12 32
   return `${host}${img}`;
13 33
 }
14 34