Your Name 3 years ago
parent
commit
14069db897
2 changed files with 46 additions and 39 deletions
  1. 1
    1
      src/constants/api.js
  2. 45
    38
      src/pages/mine/myCustomerDetail/index.jsx

+ 1
- 1
src/constants/api.js View File

16
 
16
 
17
 // 客户
17
 // 客户
18
 export const API_SAVE_CUSTOMER_INFO = resolvePath('customerInfo') // 保存客户信息
18
 export const API_SAVE_CUSTOMER_INFO = resolvePath('customerInfo') // 保存客户信息
19
-export const API_GET_CUSTOMER_INFO = resolvePath('customerInfo/') // 查询客户信息
19
+export const API_GET_CUSTOMER_INFO = resolvePath('customerInfo') // 查询客户信息
20
 
20
 
21
 // 获取经纪人绑定楼盘列表
21
 // 获取经纪人绑定楼盘列表
22
 export const API_GET_AGENT_BUILDINGS = resolvePath('buildingChannel/buildings')
22
 export const API_GET_AGENT_BUILDINGS = resolvePath('buildingChannel/buildings')

+ 45
- 38
src/pages/mine/myCustomerDetail/index.jsx View File

5
 import { ScrollView, Image } from '@tarojs/components'
5
 import { ScrollView, Image } from '@tarojs/components'
6
 import Modal from '@/components/Modal'
6
 import Modal from '@/components/Modal'
7
 import { ROLE_CODE } from '@/constants/user'
7
 import { ROLE_CODE } from '@/constants/user'
8
+import { API_CUSTOMER_DETAILINFO } from '@/constants/api'
9
+import { fetch } from '@/utils/request'
8
 import { formatDate } from '@/utils/chatDate'
10
 import { formatDate } from '@/utils/chatDate'
11
+import icon24 from '@/assets/mine-icon24.png'
12
+import icon25 from '@/assets/mine-icon25.png'
9
 import EditUserDetailBasicInfo from '../components/EditUserDetailBasicInfo'
13
 import EditUserDetailBasicInfo from '../components/EditUserDetailBasicInfo'
10
 import useFollow from './hooks/useFollow'
14
 import useFollow from './hooks/useFollow'
11
-import '@/assets/css/iconfont.css'
15
+
12
 import './index.scss'
16
 import './index.scss'
13
 
17
 
14
 const addDays = (dt, days) => {
18
 const addDays = (dt, days) => {
44
 
48
 
45
   useEffect(() => {
49
   useEffect(() => {
46
     if (id) {
50
     if (id) {
47
-      getCustomerDetail(id).then((x) => {
51
+      fetch({ url: `${API_CUSTOMER_DETAILINFO}/${id}` }).then((x) => {
48
         setCustBaseInfo(x || {})
52
         setCustBaseInfo(x || {})
49
       })
53
       })
50
 
54
 
73
                 <view className='Icon'>
77
                 <view className='Icon'>
74
                   <Image mode='aspectFill' src={custBaseInfo.avatarurl || custBaseInfo.picture}></Image>
78
                   <Image mode='aspectFill' src={custBaseInfo.avatarurl || custBaseInfo.picture}></Image>
75
                 </view>
79
                 </view>
76
-                <view className='flex-item'>
80
+                <view className='flex-item' onClick={() => setShowUserEditor(true)}>
77
                   <text>{custBaseInfo.name}</text>
81
                   <text>{custBaseInfo.name}</text>
78
                   <text>{custBaseInfo.phone}</text>
82
                   <text>{custBaseInfo.phone}</text>
79
                 </view>
83
                 </view>
80
-                <text className='iconfont icon-jiantouright' onClick={() => setShowUserEditor(true)}></text>
84
+                <text className='iconfont icon-jiantouright'></text>
81
               </view>
85
               </view>
82
               <view className='Status'>
86
               <view className='Status'>
83
                 {/* <view className='flex-h'>
87
                 {/* <view className='flex-h'>
117
           </view>
121
           </view>
118
 
122
 
119
           {/* 房源订单 */}
123
           {/* 房源订单 */}
120
-          <view className='Order'>
121
-            <view className='Title flex-h'>
122
-              <text>房源订单</text>
123
-            </view>
124
-            <view className='Content'>
125
-              <view>
126
-                <view className='flex-h'>
127
-                  <view className='flex-item'>
128
-                    <text>120万(户型名称)</text>
129
-                  </view>
130
-                  <Image mode='heightFix' src={require('../../../assets/mine-icon25.png')}></Image>
131
-                  <text className='active'>签约</text>
132
-                  <text className='iconfont icon-jiantouright'></text>
124
+          {
125
+            custBaseInfo.customerSignatory?.length > 0 && (
126
+              <view className='Order'>
127
+                <view className='Title flex-h'>
128
+                  <text>房源订单</text>
133
                 </view>
129
                 </view>
134
-                <view className='Info'>
135
-                  <text>建筑面积:117㎡</text>
136
-                  <text>总价:X/单价:XXX</text>
137
-                  <text>套内面积:X</text>
138
-                </view>
139
-              </view>
140
-              <view>
141
-                <view className='flex-h'>
142
-                  <view className='flex-item'>
143
-                    <text>120万(户型名称)</text>
144
-                  </view>
145
-                  <Image mode='heightFix' src={require('../../../assets/mine-icon24.png')}></Image>
146
-                  <text className='active'>到访</text>
147
-                  <text className='iconfont icon-jiantouright'></text>
148
-                </view>
149
-                <view className='Info'>
150
-                  <text>建筑面积:117㎡</text>
151
-                  <text>总价:X/单价:XXX</text>
152
-                  <text>套内面积:X</text>
130
+                <view className='Content'>
131
+                  {
132
+                    custBaseInfo.customerSignatory.map((item) => {
133
+                      const apartment = item.buildingApartment || {}
134
+                      const { apartmentName } = apartment
135
+                      const nameShow = apartmentName ? `(${apartmentName})` : ''
136
+                      const status = item.status === 5 ? '结佣' : '签约'
137
+                      const icon = item.status === 5 ? icon24 : icon25
138
+                      const buildingArea = item.buildingArea ? `${Number(item.buildingArea).toFixed(1)}㎡` : '暂无'
139
+                      const insideArea = item.insideArea ? `${Number(item.insideArea).toFixed(1)}㎡` : '暂无'
140
+
141
+                      return (
142
+                        <view key={item.customerSignatoryId}>
143
+                          <view className='flex-h'>
144
+                            <view className='flex-item'>
145
+                              <text>{`${item.price}${nameShow}`}</text>
146
+                            </view>
147
+                            <Image mode='heightFix' src={icon}></Image>
148
+                            <text className='active'>{status}</text>
149
+                            <text className='iconfont icon-jiantouright'></text>
150
+                          </view>
151
+                          <view className='Info'>
152
+                            <text>{`建筑面积: ${buildingArea}`}</text>
153
+                            <text></text>
154
+                            <text>{`套内面积: ${insideArea}`}</text>
155
+                          </view>
156
+                        </view>
157
+                      )
158
+                    })
159
+                  }
153
                 </view>
160
                 </view>
154
               </view>
161
               </view>
155
-            </view>
156
-          </view>
162
+            )
163
+          }
157
 
164
 
158
           {/* 操作人员 */}
165
           {/* 操作人员 */}
159
           {/* <view className='OptUser'>
166
           {/* <view className='OptUser'>