Browse Source

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

张延森 3 years ago
parent
commit
89404e1c6b

BIN
dist.zip View File


+ 1
- 0
src/constants/api.js View 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')

+ 8
- 2
src/pages/chat/chatDetail/index.jsx View File

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

+ 2
- 1
src/pages/index/activityDetail/index.jsx View 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
   );

+ 42
- 13
src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.jsx View File

@@ -1,14 +1,17 @@
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
 
9 10
 export default function SubmitBuyHouseResult (props) {
10 11
   const { List = [], setting, ShowResult = true } = props
11 12
 
13
+  // const [ShowSorry, setShowSorry] = useState(false)
14
+
12 15
   const handlePhone = () => {
13 16
     if (!setting?.phone) {
14 17
       Taro.showToast({
@@ -53,23 +56,49 @@ export default function SubmitBuyHouseResult (props) {
53 56
                     <text>匹配楼盘</text>
54 57
                   </view>
55 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 80
                     </view>
67
-                    <text className='Address'>{List[0].address}</text>
68
-                  </view>
81
+                  </ScrollView>
69 82
                 </view>
70 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 102
           </view>
74 103
         </view>
75 104
       </view>

+ 122
- 78
src/pages/index/helpToFindHouse/components/SubmitBuyHouseResult/index.scss View 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,61 @@
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
+          &.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 105
             position: relative;
87 106
             overflow: hidden;
88 107
             &::after {
89
-              content: '';
108
+              content: "";
90 109
               width: 100%;
91 110
               display: block;
92 111
               position: absolute;
@@ -96,7 +115,7 @@
96 115
               background: rgba(0, 0, 0, 0.12);
97 116
               z-index: 1;
98 117
             }
99
-            >view {
118
+            > view {
100 119
               display: block;
101 120
               position: relative;
102 121
               z-index: 2;
@@ -106,7 +125,7 @@
106 125
               text-align: center;
107 126
               font-size: 0;
108 127
               &::after {
109
-                content: '';
128
+                content: "";
110 129
                 width: 100%;
111 130
                 display: block;
112 131
                 position: absolute;
@@ -116,7 +135,7 @@
116 135
                 z-index: 2;
117 136
                 border-bottom: 2px dashed #333;
118 137
               }
119
-              >text {
138
+              > text {
120 139
                 display: inline-block;
121 140
                 position: relative;
122 141
                 z-index: 3;
@@ -129,74 +148,99 @@
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 154
             position: relative;
146 155
             overflow: hidden;
147
-            padding: 0 60px;
148 156
             margin-top: 30px;
149 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 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 View 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 View 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 {

+ 8
- 0
src/pages/mine/components/EditUserDetailBasicInfo/index.jsx View File

@@ -20,6 +20,14 @@ export default function EditUserDetailBasicInfo (props) {
20 20
   const [BuyTimeRange] = useState(['1月以内', '1至3月', '半年以内', '一年以内', '一年以上'])
21 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 31
   useEffect(() => {
24 32
     if (CanSubmit) {
25 33
       setCanSubmit(false)

+ 4
- 0
src/pages/mine/feedBack/index.jsx View 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 View 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 View 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 View 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 View 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 View 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 View 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
       }

+ 45
- 24
src/subpackages/pages/marketing/changeVisit/index.jsx View File

@@ -5,7 +5,8 @@ import '@/assets/css/iconfont.css'
5 5
 import { getCardList } from '@/services/card'
6 6
 import { fetch } from '@/utils/request'
7 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 10
 import './index.scss'
10 11
 
11 12
 export default withLayout((props) => {
@@ -13,13 +14,13 @@ export default withLayout((props) => {
13 14
   const { router } = props
14 15
   const { name, buildingId, type, id, channelId } = router.params
15 16
 
16
-  const RenChouData = {
17
+  const [RenChouData, setRenChouData] = useState({
17 18
     name,
18 19
     realtyConsultant: '',
19 20
     remark: '',
20
-  }
21
+  })
21 22
 
22
-  const QianYueData = {
23
+  const [QianYueData, setQianYueData] = useState({
23 24
     name,
24 25
     realtyConsultant: '',
25 26
     remark: '',
@@ -29,7 +30,7 @@ export default withLayout((props) => {
29 30
     houseType: '',
30 31
     price: '',
31 32
     successDate: '',
32
-  }
33
+  })
33 34
 
34 35
   const [FormData, setFormData] = useState({ ...RenChouData })
35 36
 
@@ -48,12 +49,6 @@ export default withLayout((props) => {
48 49
 
49 50
   const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
50 51
 
51
-  useEffect(() => {
52
-    if (channelId !== null && channelId !== 'null') {
53
-
54
-    }
55
-  }, [])
56
-
57 52
   useEffect(() => {
58 53
     if (buildingId) {
59 54
       const params = {
@@ -68,6 +63,32 @@ export default withLayout((props) => {
68 63
     }
69 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 92
   useEffect(() => {
72 93
     if (CurrentStatusId - 0 !== 3 && buildingId) {
73 94
       fetch({ url: `${API_BUILDING_HOUSE_TYPE}?buildingId=${buildingId}&pageSize=${500}`, method: 'get' }).then((res) => {
@@ -76,14 +97,18 @@ export default withLayout((props) => {
76 97
     }
77 98
   }, [CurrentStatusId, buildingId])
78 99
 
100
+  useEffect(() => {
101
+    console.log(FormData)
102
+  }, [FormData])
103
+
79 104
   const CutStatus = (item) => {
80 105
     return () => {
81 106
       setCurrentStatusId(item.id)
82
-      if (item.id === 3) {
107
+      if (item.id - 0 === 3) {
83 108
         setFormData({ ...RenChouData })
84
-      } else if (item.id === 4) {
109
+      } else if (item.id - 0 === 4) {
85 110
         setFormData({ ...QianYueData })
86
-      } else if (item.id === 5) {
111
+      } else if (item.id - 0 === 5) {
87 112
         setFormData({ ...QianYueData })
88 113
       }
89 114
     }
@@ -101,12 +126,9 @@ export default withLayout((props) => {
101 126
   const InputChange = (key, e) => {
102 127
     let resData = { ...FormData }
103 128
     resData[key] = e.detail.value
104
-    console.log('---------resData---------', resData)
105 129
     setFormData({ ...resData })
106 130
   }
107 131
 
108
-  console.log('---------FormData---------', FormData)
109
-
110 132
   const PickerChange = (key, e) => {
111 133
     let resData = { ...FormData }
112 134
     if (key === 'realtyConsultant') {
@@ -134,7 +156,6 @@ export default withLayout((props) => {
134 156
   }
135 157
 
136 158
   const ToSubmit = () => {
137
-    // if (!CheckForm()) return false
138 159
     if (CurrentStatusId === 3) {
139 160
       fetch({ url: API_SURE_CHIP, method: 'put', payload: { customerId: id, customerPreparatory: { ...FormData, channelId: channelId === 'null' || channelId === null ? '' : channelId } } }).then(() => {
140 161
         Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
@@ -176,7 +197,7 @@ export default withLayout((props) => {
176 197
   const SuccessDateChange = (e) => {
177 198
     let resData = { ...FormData }
178 199
     resData.successDate = new Date(e.detail.value)
179
-    setFormData(resData.successDate)
200
+    setFormData(resData)
180 201
     setSuccessDate(e.detail.value)
181 202
   }
182 203
 
@@ -233,10 +254,10 @@ export default withLayout((props) => {
233 254
               <text className='required'>业绩分成人|占比/%</text>
234 255
               <view className='FormLine flex-h'>
235 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 258
                 </view>
238 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 261
                 </view>
241 262
               </view>
242 263
             </Block>
@@ -272,7 +293,7 @@ export default withLayout((props) => {
272 293
               <text className='required'>房号</text>
273 294
               <view className='FormLine flex-h'>
274 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 297
                 </view>
277 298
               </view>
278 299
             </Block>
@@ -284,7 +305,7 @@ export default withLayout((props) => {
284 305
               <text className='required'>签约日期</text>
285 306
               <view className='FormLine flex-h'>
286 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 309
                 </view>
289 310
                 <text className='iconfont icon-jiantoudown'></text>
290 311
               </view>
@@ -297,7 +318,7 @@ export default withLayout((props) => {
297 318
               <text className='required'>成交金额</text>
298 319
               <view className='FormLine flex-h'>
299 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 322
                 </view>
302 323
               </view>
303 324
             </Block>

+ 4
- 2
src/utils/hooks/useLike.js View 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({