浏览代码

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

张延森 3 年前
父节点
当前提交
89404e1c6b

二进制
dist.zip 查看文件


+ 1
- 0
src/constants/api.js 查看文件

74
 export const API_CHAT_READED = resolvePath('chat/message')
74
 export const API_CHAT_READED = resolvePath('chat/message')
75
 export const API_CHAT_UNREADED = resolvePath('chat/unReaded')
75
 export const API_CHAT_UNREADED = resolvePath('chat/unReaded')
76
 
76
 
77
+export const API_CONSULTANT = resolvePath('consultant')
77
 
78
 
78
 // card
79
 // card
79
 export const API_CARDS_LIST = resolvePath('cards')
80
 export const API_CARDS_LIST = resolvePath('cards')

+ 8
- 2
src/pages/chat/chatDetail/index.jsx 查看文件

137
     })
137
     })
138
   }, [PageList, scroll])
138
   }, [PageList, scroll])
139
 
139
 
140
+  const CheckBigImg = (img) => {
141
+    return () => {
142
+      Taro.previewImage({ current: img, urls: [img] })
143
+    }
144
+  }
145
+
140
   return (
146
   return (
141
     <view className='chatDetail flex-v'>
147
     <view className='chatDetail flex-v'>
142
       <view className='flex-item'>
148
       <view className='flex-item'>
171
                                 item.messageType === im.MESSAGETYPE.IMAGE &&
177
                                 item.messageType === im.MESSAGETYPE.IMAGE &&
172
                                 <view className='Message Left Img'>
178
                                 <view className='Message Left Img'>
173
                                   <view>
179
                                   <view>
174
-                                    <Image mode='scaleToFill' src={item.message}></Image>
180
+                                    <Image onClick={CheckBigImg(item.message)} mode='scaleToFill' src={item.message}></Image>
175
                                   </view>
181
                                   </view>
176
                                 </view>
182
                                 </view>
177
                               }
183
                               }
196
                                 item.messageType === im.MESSAGETYPE.IMAGE &&
202
                                 item.messageType === im.MESSAGETYPE.IMAGE &&
197
                                 <view className='Message Right Img'>
203
                                 <view className='Message Right Img'>
198
                                   <view>
204
                                   <view>
199
-                                    <Image mode='scaleToFill' src={item.message}></Image>
205
+                                    <Image onClick={CheckBigImg(item.message)} mode='scaleToFill' src={item.message}></Image>
200
                                   </view>
206
                                   </view>
201
                                 </view>
207
                                 </view>
202
                               }
208
                               }

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

100
     {
100
     {
101
       title: shareContent.shareContentTitle || detail?.title,
101
       title: shareContent.shareContentTitle || detail?.title,
102
       path: `${router.path}?${paramsRef.current}`,
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
     fullTrackData
106
     fullTrackData
106
   );
107
   );

+ 42
- 13
src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.jsx 查看文件

1
 
1
 
2
 import { useState } from 'react'
2
 import { useState } from 'react'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
-import { Image, Block } from '@tarojs/components'
4
+import { Image, Block, ScrollView } from '@tarojs/components'
5
 import { getImgURL } from '@/utils/image'
5
 import { getImgURL } from '@/utils/image'
6
+import ProjectItemCard from '@/components/ProjectItemCard/index'
6
 import '@/assets/css/iconfont.css'
7
 import '@/assets/css/iconfont.css'
7
 import './index.scss'
8
 import './index.scss'
8
 
9
 
9
 export default function SubmitBuyHouseResult (props) {
10
 export default function SubmitBuyHouseResult (props) {
10
   const { List = [], setting, ShowResult = true } = props
11
   const { List = [], setting, ShowResult = true } = props
11
 
12
 
13
+  // const [ShowSorry, setShowSorry] = useState(false)
14
+
12
   const handlePhone = () => {
15
   const handlePhone = () => {
13
     if (!setting?.phone) {
16
     if (!setting?.phone) {
14
       Taro.showToast({
17
       Taro.showToast({
53
                     <text>匹配楼盘</text>
56
                     <text>匹配楼盘</text>
54
                   </view>
57
                   </view>
55
                 </view>
58
                 </view>
56
-                <view className='RecommendBuildingItem' onClick={() => {Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${List[0].buildingId}` })}}>
57
-                  <view>
58
-                    <view className='Img'>
59
-                      <Image mode='aspectFill' src={getImgURL(List[0].poster || List[0].preSalePermit)} className='centerLabel'></Image>
60
-                    </view>
61
-                    <view className='Title flex-h'>
62
-                      <view className='flex-item'>
63
-                        <text>{List[0].name}</text>
64
-                      </view>
65
-                      <view className='Price'><text>{List[0].price}</text></view>
59
+                <view className={List.length === 1 ? 'ScrollViewX active' : 'ScrollViewX'}>
60
+                  <ScrollView scrollX>
61
+                    <view className='ListContainer'>
62
+                      {
63
+                        List.map((item, index) => (
64
+                          <view className='RecommendBuildingItem' key={`item-${index}`} onClick={() => { Taro.navigateTo({ url: `/pages/index/buildingDetail/index?id=${item.buildingId}` }) }}>
65
+                            <view>
66
+                              <view className='Img'>
67
+                                <Image mode='aspectFill' src={getImgURL(item.poster || item.preSalePermit)} className='centerLabel'></Image>
68
+                              </view>
69
+                              <view className='Title flex-h'>
70
+                                <view className='flex-item'>
71
+                                  <text>{item.name}</text>
72
+                                </view>
73
+                                <view className='Price'><text>{item.price}</text></view>
74
+                              </view>
75
+                              <text className='Address'>{item.address}</text>
76
+                            </view>
77
+                          </view>
78
+                        ))
79
+                      }
66
                     </view>
80
                     </view>
67
-                    <text className='Address'>{List[0].address}</text>
68
-                  </view>
81
+                  </ScrollView>
69
                 </view>
82
                 </view>
70
               </view>
83
               </view>
71
             }
84
             }
72
 
85
 
86
+            {
87
+              List.length === 0 &&
88
+              <view className='Recommend Sorry'>
89
+                <view className='Title'>
90
+                  <view>
91
+                    <text>温馨提示</text>
92
+                  </view>
93
+                </view>
94
+                <view className='Tips'>
95
+                  <text>非常抱歉!</text>
96
+                  <text>根据您的需求,目前尚无可推荐的楼盘</text>
97
+                  <text>您可以返回首页浏览更多内容!</text>
98
+                </view>
99
+              </view> 
100
+            }
101
+
73
           </view>
102
           </view>
74
         </view>
103
         </view>
75
       </view>
104
       </view>

+ 122
- 78
src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.scss 查看文件

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

+ 3
- 2
src/pages/index/newsList/index.jsx 查看文件

8
 import './index.scss'
8
 import './index.scss'
9
 import NewsListItem from '../components/NewsListItem/index'
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
   const user = useSelector(state => state.user)
14
   const user = useSelector(state => state.user)
14
   const [PageList, setPageList] = useState([])
15
   const [PageList, setPageList] = useState([])
15
   const [IsPull, setPull] = useState(false)
16
   const [IsPull, setPull] = useState(false)
35
 
36
 
36
   const GetPageList = () => {
37
   const GetPageList = () => {
37
     setHasNextPage(false)
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
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
40
       setPageList(pageNumber === 1 ? res.records || [] : PageList.concat(res.records || []))
40
       setHasNextPage(res.current < res.pages)
41
       setHasNextPage(res.current < res.pages)
41
       setPull(false)
42
       setPull(false)

+ 3
- 1
src/pages/mine/addCustomer/components/BuildingPicker.jsx 查看文件

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

+ 8
- 0
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx 查看文件

20
   const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
20
   const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
21
   const [CanSubmit, setCanSubmit] = useState(false)
21
   const [CanSubmit, setCanSubmit] = useState(false)
22
 
22
 
23
+  useEffect(() => {
24
+    setFormData({ ...Data })
25
+    setSex(Data?.sex - 0 === 1 ? '男' : '女')
26
+    setAge(Data?.age)
27
+    setHouseholdIncome(Data?.householdIncome)
28
+    setEstimatedPurchaseTime(Data?.estimatedPurchaseTime)
29
+  }, [Data])
30
+
23
   useEffect(() => {
31
   useEffect(() => {
24
     if (CanSubmit) {
32
     if (CanSubmit) {
25
       setCanSubmit(false)
33
       setCanSubmit(false)

+ 4
- 0
src/pages/mine/feedBack/index.jsx 查看文件

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

+ 2
- 0
src/pages/mine/index.jsx 查看文件

20
 export default withLayout(() => {
20
 export default withLayout(() => {
21
 
21
 
22
   const user = useSelector(state => state.user)
22
   const user = useSelector(state => state.user)
23
+  const city = useSelector(state => state.city)
23
   const [UserRole, setUserRole] = useState(null) // 1-普通用户 2-经纪人 3-置业顾问 4-驻场管理
24
   const [UserRole, setUserRole] = useState(null) // 1-普通用户 2-经纪人 3-置业顾问 4-驻场管理
24
   const [MenuList, setMenuList] = useState([])
25
   const [MenuList, setMenuList] = useState([])
25
   const { dispatch } = store
26
   const { dispatch } = store
26
 
27
 
27
   useEffect(() => {
28
   useEffect(() => {
28
     if (user?.userInfo?.person?.personId) {
29
     if (user?.userInfo?.person?.personId) {
30
+      console.log(city)
29
       const person = user.userInfo.person
31
       const person = user.userInfo.person
30
       setUserRole(person.personType === ROLE_CODE.CHANNEL_AGENT ? 2 : person.personType === ROLE_CODE.CONSULTANT ? 3 : person.personType === ROLE_CODE.MARKETING ? 4 : 1)
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 查看文件

16
   useEffect(() => {
16
   useEffect(() => {
17
     const payload = {
17
     const payload = {
18
       scene: `id=${person?.personId}&from=${page.type}_share&recommender=${person?.personId}`,
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
     fetch({ url: API_QRCODE, payload, method: 'post' }).then((res) => {
21
     fetch({ url: API_QRCODE, payload, method: 'post' }).then((res) => {
22
       setQrCodeUrl(res)
22
       setQrCodeUrl(res)

+ 1
- 1
src/routes.js 查看文件

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

+ 2
- 1
src/subpackages/pages/consultant/myHomepage/index.config.js 查看文件

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

+ 26
- 12
src/subpackages/pages/consultant/myHomepage/index.jsx 查看文件

1
 import { useState, useEffect } from 'react'
1
 import { useState, useEffect } from 'react'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import withLayout from '@/layout'
3
 import withLayout from '@/layout'
4
-import { ScrollView, Image } from '@tarojs/components'
4
+import { ScrollView, Image, Button } from '@tarojs/components'
5
 import ProjectListItem from '@/components/ProjectListItem/index'
5
 import ProjectListItem from '@/components/ProjectListItem/index'
6
 import { useSelector } from 'react-redux'
6
 import { useSelector } from 'react-redux'
7
 import { fetch } from '@/utils/request'
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
 import { getImgURL } from '@/utils/image'
9
 import { getImgURL } from '@/utils/image'
10
 import useLike from "@/utils/hooks/useLike";
10
 import useLike from "@/utils/hooks/useLike";
11
 import '@/assets/css/iconfont.css'
11
 import '@/assets/css/iconfont.css'
21
   const [PullTimer, setPullTimer] = useState(null)
21
   const [PullTimer, setPullTimer] = useState(null)
22
   const [UserInfo, setUserInfo] = useState({})
22
   const [UserInfo, setUserInfo] = useState({})
23
   const [BuildingInfo, setBuildingInfo] = useState({})
23
   const [BuildingInfo, setBuildingInfo] = useState({})
24
+  const [LikeNum, setLikeNum] = useState(0)
24
 
25
 
25
   const user = useSelector(state => state.user)
26
   const user = useSelector(state => state.user)
26
   const [PersonId, setPersonId] = useState(null)
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
     ...trackData,
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
   useEffect(() => {
47
   useEffect(() => {
34
     if (PersonId !== user.userInfo.person.personId) {
48
     if (PersonId !== user.userInfo.person.personId) {
52
   }, [PersonId])
66
   }, [PersonId])
53
 
67
 
54
   useEffect(() => {
68
   useEffect(() => {
55
-    if (UserInfo.buildingId) {
69
+    if (UserInfo.buildingId && !BuildingInfo.buildingId) {
56
       GetBuildingInfo()
70
       GetBuildingInfo()
57
     }
71
     }
58
   }, [UserInfo])
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
                     <text>{UserInfo.name} {UserInfo.phone}</text>
113
                     <text>{UserInfo.name} {UserInfo.phone}</text>
100
                   </view>
114
                   </view>
101
                   <text onClick={handleFavor} className='iconfont icon-dianzan' style={isSave ? { color: 'red' } : undefined}></text>
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
                 </view>
117
                 </view>
104
                 <view className='Tag'>
118
                 <view className='Tag'>
105
                   <view>
119
                   <view>
134
                 }
148
                 }
135
               </view>
149
               </view>
136
               <text className='iconfont icon-renqi'></text>
150
               <text className='iconfont icon-renqi'></text>
137
-              <text>人气值{UserInfo.hotNum || 999}</text>
151
+              <text>人气值{(UserInfo.hotNum || 0) + 999}</text>
138
             </view>
152
             </view>
139
           </view>
153
           </view>
140
 
154
 
162
               </view>
176
               </view>
163
             </view>
177
             </view>
164
             <view className='Btn'>
178
             <view className='Btn'>
165
-              <text>分享主页</text>
179
+              <Button className='Share' open-type='share'>分享主页</Button>
166
             </view>
180
             </view>
167
           </view>
181
           </view>
168
 
182
 

+ 6
- 1
src/subpackages/pages/consultant/myHomepage/index.scss 查看文件

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

+ 45
- 24
src/subpackages/pages/marketing/changeVisit/index.jsx 查看文件

5
 import { getCardList } from '@/services/card'
5
 import { getCardList } from '@/services/card'
6
 import { fetch } from '@/utils/request'
6
 import { fetch } from '@/utils/request'
7
 import Taro from '@tarojs/taro'
7
 import Taro from '@tarojs/taro'
8
-import { API_SURE_CHIP, API_BUILDING_HOUSE_TYPE, API_SURE_SIGN, API_SURE_BUY } from '@/constants/api'
8
+import { formatDate } from "@/utils/chatDate";
9
+import { API_SURE_CHIP, API_BUILDING_HOUSE_TYPE, API_SURE_SIGN, API_SURE_BUY, API_CUSTOMER_DETAILINFO } from '@/constants/api'
9
 import './index.scss'
10
 import './index.scss'
10
 
11
 
11
 export default withLayout((props) => {
12
 export default withLayout((props) => {
13
   const { router } = props
14
   const { router } = props
14
   const { name, buildingId, type, id, channelId } = router.params
15
   const { name, buildingId, type, id, channelId } = router.params
15
 
16
 
16
-  const RenChouData = {
17
+  const [RenChouData, setRenChouData] = useState({
17
     name,
18
     name,
18
     realtyConsultant: '',
19
     realtyConsultant: '',
19
     remark: '',
20
     remark: '',
20
-  }
21
+  })
21
 
22
 
22
-  const QianYueData = {
23
+  const [QianYueData, setQianYueData] = useState({
23
     name,
24
     name,
24
     realtyConsultant: '',
25
     realtyConsultant: '',
25
     remark: '',
26
     remark: '',
29
     houseType: '',
30
     houseType: '',
30
     price: '',
31
     price: '',
31
     successDate: '',
32
     successDate: '',
32
-  }
33
+  })
33
 
34
 
34
   const [FormData, setFormData] = useState({ ...RenChouData })
35
   const [FormData, setFormData] = useState({ ...RenChouData })
35
 
36
 
48
 
49
 
49
   const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
50
   const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
50
 
51
 
51
-  useEffect(() => {
52
-    if (channelId !== null && channelId !== 'null') {
53
-
54
-    }
55
-  }, [])
56
-
57
   useEffect(() => {
52
   useEffect(() => {
58
     if (buildingId) {
53
     if (buildingId) {
59
       const params = {
54
       const params = {
68
     }
63
     }
69
   }, [buildingId])
64
   }, [buildingId])
70
 
65
 
66
+  useEffect(() => {
67
+    fetch({ url: `${API_CUSTOMER_DETAILINFO}/${id}`, method: 'get' }).then((res) => {
68
+      if(CurrentStatusId - 0 === 3) {
69
+        setFormData({ ...FormData, ...res?.customerPreparatory })
70
+      }
71
+      setRenChouData({ ...RenChouData, ...res?.customerPreparatory })
72
+      if((res.customerSignatory || []).length) {
73
+        let customerSignatory = res.customerSignatory[0]
74
+        customerSignatory.dividendsPer = customerSignatory.dividendsName.substring(customerSignatory.dividendsName.indexOf('|') + 1, customerSignatory.dividendsName.indexOf('%'))
75
+        customerSignatory.dividendsName = customerSignatory.dividendsName.substring(0, customerSignatory.dividendsName.indexOf('|'))
76
+        setQianYueData({...QianYueData, ...customerSignatory})
77
+        HouseTypeList.map((item) => {
78
+          if(item.apartmentId === res.customerSignatory[0].houseType) {
79
+            setCurrentRoomTypeId(item.apartmentId)
80
+          }
81
+        })
82
+        setSuccessDate(res.customerSignatory[0].successDate.substring(0, 10))
83
+      }
84
+      ConsultantList.map((item) => {
85
+        if(item.id === res.customerPreparatory.realtyConsultant) {
86
+          setCurrnetConsultant(item)
87
+        }
88
+      })
89
+    })
90
+  }, [ConsultantList, HouseTypeList])
91
+
71
   useEffect(() => {
92
   useEffect(() => {
72
     if (CurrentStatusId - 0 !== 3 && buildingId) {
93
     if (CurrentStatusId - 0 !== 3 && buildingId) {
73
       fetch({ url: `${API_BUILDING_HOUSE_TYPE}?buildingId=${buildingId}&pageSize=${500}`, method: 'get' }).then((res) => {
94
       fetch({ url: `${API_BUILDING_HOUSE_TYPE}?buildingId=${buildingId}&pageSize=${500}`, method: 'get' }).then((res) => {
76
     }
97
     }
77
   }, [CurrentStatusId, buildingId])
98
   }, [CurrentStatusId, buildingId])
78
 
99
 
100
+  useEffect(() => {
101
+    console.log(FormData)
102
+  }, [FormData])
103
+
79
   const CutStatus = (item) => {
104
   const CutStatus = (item) => {
80
     return () => {
105
     return () => {
81
       setCurrentStatusId(item.id)
106
       setCurrentStatusId(item.id)
82
-      if (item.id === 3) {
107
+      if (item.id - 0 === 3) {
83
         setFormData({ ...RenChouData })
108
         setFormData({ ...RenChouData })
84
-      } else if (item.id === 4) {
109
+      } else if (item.id - 0 === 4) {
85
         setFormData({ ...QianYueData })
110
         setFormData({ ...QianYueData })
86
-      } else if (item.id === 5) {
111
+      } else if (item.id - 0 === 5) {
87
         setFormData({ ...QianYueData })
112
         setFormData({ ...QianYueData })
88
       }
113
       }
89
     }
114
     }
101
   const InputChange = (key, e) => {
126
   const InputChange = (key, e) => {
102
     let resData = { ...FormData }
127
     let resData = { ...FormData }
103
     resData[key] = e.detail.value
128
     resData[key] = e.detail.value
104
-    console.log('---------resData---------', resData)
105
     setFormData({ ...resData })
129
     setFormData({ ...resData })
106
   }
130
   }
107
 
131
 
108
-  console.log('---------FormData---------', FormData)
109
-
110
   const PickerChange = (key, e) => {
132
   const PickerChange = (key, e) => {
111
     let resData = { ...FormData }
133
     let resData = { ...FormData }
112
     if (key === 'realtyConsultant') {
134
     if (key === 'realtyConsultant') {
134
   }
156
   }
135
 
157
 
136
   const ToSubmit = () => {
158
   const ToSubmit = () => {
137
-    // if (!CheckForm()) return false
138
     if (CurrentStatusId === 3) {
159
     if (CurrentStatusId === 3) {
139
       fetch({ url: API_SURE_CHIP, method: 'put', payload: { customerId: id, customerPreparatory: { ...FormData, channelId: channelId === 'null' || channelId === null ? '' : channelId } } }).then(() => {
160
       fetch({ url: API_SURE_CHIP, method: 'put', payload: { customerId: id, customerPreparatory: { ...FormData, channelId: channelId === 'null' || channelId === null ? '' : channelId } } }).then(() => {
140
         Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
161
         Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
176
   const SuccessDateChange = (e) => {
197
   const SuccessDateChange = (e) => {
177
     let resData = { ...FormData }
198
     let resData = { ...FormData }
178
     resData.successDate = new Date(e.detail.value)
199
     resData.successDate = new Date(e.detail.value)
179
-    setFormData(resData.successDate)
200
+    setFormData(resData)
180
     setSuccessDate(e.detail.value)
201
     setSuccessDate(e.detail.value)
181
   }
202
   }
182
 
203
 
233
               <text className='required'>业绩分成人|占比/%</text>
254
               <text className='required'>业绩分成人|占比/%</text>
234
               <view className='FormLine flex-h'>
255
               <view className='FormLine flex-h'>
235
                 <view className='flex-item'>
256
                 <view className='flex-item'>
236
-                  <Input placeholder='请输入业绩分成人' onInput={InputChange.bind(this, 'dividendsName')}></Input>
257
+                  <Input placeholder='请输入业绩分成人' value={FormData.dividendsName} onInput={InputChange.bind(this, 'dividendsName')}></Input>
237
                 </view>
258
                 </view>
238
                 <view className='flex-item'>
259
                 <view className='flex-item'>
239
-                  <Input placeholder='请输入占比%' type='number' onInput={InputChange.bind(this, 'dividendsPer')}></Input>
260
+                  <Input placeholder='请输入占比%' value={FormData.dividendsPer} type='number' onInput={InputChange.bind(this, 'dividendsPer')}></Input>
240
                 </view>
261
                 </view>
241
               </view>
262
               </view>
242
             </Block>
263
             </Block>
272
               <text className='required'>房号</text>
293
               <text className='required'>房号</text>
273
               <view className='FormLine flex-h'>
294
               <view className='FormLine flex-h'>
274
                 <view className='flex-item'>
295
                 <view className='flex-item'>
275
-                  <Input placeholder='请输入房号' onInput={InputChange.bind(this, 'houseInfo')}></Input>
296
+                  <Input placeholder='请输入房号' value={FormData.houseInfo} onInput={InputChange.bind(this, 'houseInfo')}></Input>
276
                 </view>
297
                 </view>
277
               </view>
298
               </view>
278
             </Block>
299
             </Block>
284
               <text className='required'>签约日期</text>
305
               <text className='required'>签约日期</text>
285
               <view className='FormLine flex-h'>
306
               <view className='FormLine flex-h'>
286
                 <view className='flex-item'>
307
                 <view className='flex-item'>
287
-                  <Picker mode='date' value={null} onChange={SuccessDateChange}>{SuccessDate || '请选择开始日期'}</Picker>
308
+                  <Picker mode='date' value={FormData.successDate} onChange={SuccessDateChange}>{SuccessDate || '请选择开始日期'}</Picker>
288
                 </view>
309
                 </view>
289
                 <text className='iconfont icon-jiantoudown'></text>
310
                 <text className='iconfont icon-jiantoudown'></text>
290
               </view>
311
               </view>
297
               <text className='required'>成交金额</text>
318
               <text className='required'>成交金额</text>
298
               <view className='FormLine flex-h'>
319
               <view className='FormLine flex-h'>
299
                 <view className='flex-item'>
320
                 <view className='flex-item'>
300
-                  <Input placeholder='请输入金额' onInput={InputChange.bind(this, 'price')}></Input>
321
+                  <Input placeholder='请输入金额' value={FormData.price} onInput={InputChange.bind(this, 'price')}></Input>
301
                 </view>
322
                 </view>
302
               </view>
323
               </view>
303
             </Block>
324
             </Block>

+ 4
- 2
src/utils/hooks/useLike.js 查看文件

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