Browse Source

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

Your Name 3 years ago
parent
commit
2ab705fccb

+ 2
- 0
src/constants/api.js View File

14
 
14
 
15
 export const API_CITY_AREA = resolvePath('tdCityList/tdAreaCity') // 城市下区域查询
15
 export const API_CITY_AREA = resolvePath('tdCityList/tdAreaCity') // 城市下区域查询
16
 
16
 
17
+export const API_BUILDING_HOUSE_TYPE = resolvePath('apartmentList') // 获取楼盘户型
18
+
17
 // 客户
19
 // 客户
18
 export const API_SAVE_CUSTOMER_INFO = resolvePath('customerInfo') // 保存客户信息
20
 export const API_SAVE_CUSTOMER_INFO = resolvePath('customerInfo') // 保存客户信息
19
 export const API_GET_CUSTOMER_INFO = resolvePath('customerInfo') // 查询客户信息
21
 export const API_GET_CUSTOMER_INFO = resolvePath('customerInfo') // 查询客户信息

+ 18
- 0
src/pages/index/courseDetail/index.scss View File

108
             }
108
             }
109
           }
109
           }
110
           >.Option {
110
           >.Option {
111
+            >button {
112
+              background: none;
113
+              border: none;
114
+              padding: 0;
115
+              &::after {
116
+                display: none;
117
+              }
118
+              >text {
119
+                display: inline-block;
120
+                vertical-align: middle;
121
+                font-size: 24px;
122
+                margin-left: 10px;
123
+                &:first-child {
124
+                  margin-left: 0;
125
+                  font-size: 30px;
126
+                }
127
+              }
128
+            }
111
             >view, button {
129
             >view, button {
112
               font-size: 0;
130
               font-size: 0;
113
               white-space: nowrap;
131
               white-space: nowrap;

+ 169
- 76
src/pages/mine/changeVisit/index.jsx View File

3
 import { ScrollView, Input, Image, Block, Picker } from '@tarojs/components'
3
 import { ScrollView, Input, Image, Block, Picker } from '@tarojs/components'
4
 import '@/assets/css/iconfont.css'
4
 import '@/assets/css/iconfont.css'
5
 import { getCardList } from '@/services/card'
5
 import { getCardList } from '@/services/card'
6
+import { fetch } from '@/utils/request'
7
+import Taro from '@tarojs/taro'
8
+import { API_SURE_CHIP, API_BUILDING_HOUSE_TYPE, API_SURE_SIGN, API_SURE_BUY } from '@/constants/api'
6
 import './index.scss'
9
 import './index.scss'
7
 
10
 
8
 export default withLayout((props) => {
11
 export default withLayout((props) => {
9
 
12
 
10
   const { router } = props
13
   const { router } = props
11
-  const { name, buildingId, type } = router.params
14
+  const { name, buildingId, type, id, channelId } = router.params
12
 
15
 
13
   const RenChouData = {
16
   const RenChouData = {
14
     name,
17
     name,
15
     realtyConsultant: '',
18
     realtyConsultant: '',
16
-    remark: ''
19
+    remark: '',
17
   }
20
   }
18
 
21
 
19
   const QianYueData = {
22
   const QianYueData = {
20
     name,
23
     name,
21
     realtyConsultant: '',
24
     realtyConsultant: '',
22
-    remark: ''
23
-  }
24
-
25
-  const JieYongData = {
26
-    name,
27
-    realtyConsultant: '',
28
-    remark: ''
25
+    remark: '',
26
+    dividendsName: '',
27
+    dividendsPer: '',
28
+    houseInfo: '',
29
+    houseType: '',
30
+    price: '',
31
+    successDate: '',
29
   }
32
   }
30
 
33
 
31
   const [FormData, setFormData] = useState({ ...RenChouData })
34
   const [FormData, setFormData] = useState({ ...RenChouData })
32
 
35
 
33
   const [ConsultantList, setConsultantList] = useState([])
36
   const [ConsultantList, setConsultantList] = useState([])
37
+  const [HouseTypeList, setHouseTypeList] = useState([])
34
   const [CurrnetConsultant, setCurrnetConsultant] = useState({})
38
   const [CurrnetConsultant, setCurrnetConsultant] = useState({})
35
 
39
 
40
+  const [SuccessDate, setSuccessDate] = useState(null)
41
+
36
   const [StatusList] = useState([
42
   const [StatusList] = useState([
37
     { name: '认筹', id: 3 },
43
     { name: '认筹', id: 3 },
38
     { name: '签约', id: 4 },
44
     { name: '签约', id: 4 },
40
   ])
46
   ])
41
   const [CurrentStatusId, setCurrentStatusId] = useState(3)
47
   const [CurrentStatusId, setCurrentStatusId] = useState(3)
42
 
48
 
43
-  const [RoomTypeList] = useState([
44
-    { name: '二室一厅', id: 1 },
45
-    { name: '三室二厅', id: 2 },
46
-    { name: '三室一厅', id: 3 },
47
-    { name: '四室二厅', id: 4 }
48
-  ])
49
   const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
49
   const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
50
 
50
 
51
+  useEffect(() => {
52
+    if (channelId !== null && channelId !== 'null') {
53
+
54
+    }
55
+  }, [])
56
+
51
   useEffect(() => {
57
   useEffect(() => {
52
     if (buildingId) {
58
     if (buildingId) {
53
       const params = {
59
       const params = {
62
     }
68
     }
63
   }, [buildingId])
69
   }, [buildingId])
64
 
70
 
71
+  useEffect(() => {
72
+    if (CurrentStatusId - 0 !== 3) {
73
+      fetch({ url: `${API_BUILDING_HOUSE_TYPE}?buildingId=${buildingId}&pageSize=${500}`, method: 'get' }).then((res) => {
74
+        setHouseTypeList(res.records || [])
75
+      })
76
+    }
77
+  }, [CurrentStatusId])
78
+
65
   const CutStatus = (item) => {
79
   const CutStatus = (item) => {
66
     return () => {
80
     return () => {
67
       setCurrentStatusId(item.id)
81
       setCurrentStatusId(item.id)
82
+      if (item.id === 3) {
83
+        setFormData({ ...RenChouData })
84
+      } else if (item.id === 4) {
85
+        setFormData({ ...QianYueData })
86
+      } else if (item.id === 5) {
87
+        setFormData({ ...QianYueData })
88
+      }
68
     }
89
     }
69
   }
90
   }
70
 
91
 
71
   const CutRoomType = (item) => {
92
   const CutRoomType = (item) => {
72
     return () => {
93
     return () => {
73
-      setCurrentRoomTypeId(item.id === CurrentRoomTypeId ? null : item.id)
94
+      let resData = { ...FormData }
95
+      resData.houseType = item.apartmentId
96
+      setFormData({ ...resData })
97
+      setCurrentRoomTypeId(item.apartmentId)
74
     }
98
     }
75
   }
99
   }
76
 
100
 
77
   const InputChange = (key, e) => {
101
   const InputChange = (key, e) => {
78
-    let resData = FormData
102
+    let resData = { ...FormData }
79
     resData[key] = e.detail.value
103
     resData[key] = e.detail.value
80
-    setFormData(resData)
104
+    setFormData({ ...resData })
81
   }
105
   }
82
 
106
 
83
   const PickerChange = (key, e) => {
107
   const PickerChange = (key, e) => {
84
-    let resData = FormData
108
+    let resData = { ...FormData }
85
     if (key === 'realtyConsultant') {
109
     if (key === 'realtyConsultant') {
86
       resData[key] = ConsultantList[e.detail.value].id
110
       resData[key] = ConsultantList[e.detail.value].id
87
       resData.realtyConsultantName = ConsultantList[e.detail.value].name
111
       resData.realtyConsultantName = ConsultantList[e.detail.value].name
88
       setCurrnetConsultant(ConsultantList[e.detail.value])
112
       setCurrnetConsultant(ConsultantList[e.detail.value])
89
     }
113
     }
90
-    setFormData(resData)
114
+    setFormData({ ...resData })
115
+  }
116
+
117
+  const CheckForm = () => {
118
+    if (CurrentStatusId === 3) { // 认筹
119
+      if (FormData.name === '') {
120
+        Taro.showToast({ title: '姓名不能为空', icon: 'none', duration: 2000 })
121
+        return false
122
+      }
123
+      if (FormData.realtyConsultant === '') {
124
+        Taro.showToast({ title: '请选择内场接待', icon: 'none', duration: 2000 })
125
+        return false
126
+      }
127
+    } else if (CurrentStatusId === 4) { // 签约
128
+
129
+    }
130
+    return true
131
+  }
132
+
133
+  const ToSubmit = () => {
134
+    // if (!CheckForm()) return false
135
+    if (CurrentStatusId === 3) {
136
+      fetch({ url: API_SURE_CHIP, method: 'put', payload: { customerId: id, customerPreparatory: { ...FormData, channelId: channelId === 'null' || channelId === null ? '' : channelId } } }).then(() => {
137
+        Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
138
+      })
139
+    } else if (CurrentStatusId === 4) {
140
+      let params = {}
141
+      for (let key in FormData) {
142
+        if (key !== 'dividendsName' && key !== 'dividendsPer') {
143
+          params[key] = { ...FormData }[key]
144
+        }
145
+      }
146
+      params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`
147
+      fetch({ url: API_SURE_SIGN, method: 'put', payload: { customerId: id, customerSignatory: { ...params, channelId: channelId === 'null' || channelId === null ? '' : channelId } } }).then(() => {
148
+        Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
149
+      })
150
+    } else if (CurrentStatusId === 5) {
151
+      let params = {}
152
+      for (let key in FormData) {
153
+        if (key !== 'dividendsName' && key !== 'dividendsPer') {
154
+          params[key] = { ...FormData }[key]
155
+        }
156
+      }
157
+      params.dividendsName = `${FormData.dividendsName}|${FormData.dividendsPer}%`
158
+      fetch({ url: API_SURE_BUY, method: 'put', payload: { customerId: id, customerSignatory: { ...params, channelId: channelId === 'null' || channelId === null ? '' : channelId } } }).then(() => {
159
+        Taro.showToast({ title: '修改成功', icon: 'none', duration: 2000 })
160
+      })
161
+    }
162
+  }
163
+
164
+  const SuccessDateChange = (e) => {
165
+    let resData = { ...FormData }
166
+    resData.successDate = new Date(e.detail.value)
167
+    setFormData(resData.successDate)
168
+    setSuccessDate(e.detail.value)
91
   }
169
   }
92
 
170
 
93
   return (
171
   return (
102
               <view className='CheckBoxList'>
180
               <view className='CheckBoxList'>
103
                 {
181
                 {
104
                   StatusList.map((item, index) => (
182
                   StatusList.map((item, index) => (
105
-                    <view key={`StatusItem-${index}`} onClick={CutStatus(item)}>
183
+                    <view key={`StatusItem-${index}`} onClick={CutStatus(item)} style={{ marginRight: index === 2 ? '0px' : '44rpx' }}>
106
                       <text>{item.name}</text>
184
                       <text>{item.name}</text>
107
                       {
185
                       {
108
                         CurrentStatusId === item.id &&
186
                         CurrentStatusId === item.id &&
115
             </view>
193
             </view>
116
           </view>
194
           </view>
117
 
195
 
196
+          <text className='required'>客户姓名</text>
197
+          <view className='FormLine flex-h'>
198
+            <view className='flex-item'>
199
+              <Input placeholder='请输入姓名' disabled={CurrentStatusId === 5} value={FormData.name} onInput={InputChange.bind(this, 'name')}></Input>
200
+            </view>
201
+          </view>
202
+
203
+
204
+          <text>归属渠道</text>
205
+          <view className='FormLine flex-h'>
206
+            <view className='flex-item'>
207
+              <Input placeholder='请输入渠道' disabled value={type === 'customer' ? '-' : ''}></Input>
208
+            </view>
209
+          </view>
210
+
211
+          <text className='required'>内场接待</text>
212
+          <view className='FormLine flex-h'>
213
+            <view className='flex-item'>
214
+              <Picker range-key='name' range={ConsultantList} value={0} onChange={PickerChange.bind(this, 'realtyConsultant')}>{CurrnetConsultant.name || '请选择'}</Picker>
215
+            </view>
216
+          </view>
217
+
118
           {
218
           {
119
-            CurrentStatusId === 3 &&
219
+            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
120
             <Block>
220
             <Block>
121
-              <text className='required'>客户姓名</text>
221
+              <text className='required'>业绩分成人|占比/%</text>
122
               <view className='FormLine flex-h'>
222
               <view className='FormLine flex-h'>
123
                 <view className='flex-item'>
223
                 <view className='flex-item'>
124
-                  <Input placeholder='请输入姓名' value={FormData.name} onInput={InputChange.bind(this, 'name')}></Input>
224
+                  <Input placeholder='请输入业绩分成人' onInput={InputChange.bind(this, 'dividendsName')}></Input>
225
+                </view>
226
+                <view className='flex-item'>
227
+                  <Input placeholder='请输入占比%' type='number' onInput={InputChange.bind(this, 'dividendsPer')}></Input>
125
                 </view>
228
                 </view>
126
               </view>
229
               </view>
127
             </Block>
230
             </Block>
128
           }
231
           }
129
 
232
 
130
           {
233
           {
131
-            CurrentStatusId === 3 &&
234
+            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
132
             <Block>
235
             <Block>
133
-              <text>归属渠道</text>
236
+              <text className='required'>户型</text>
134
               <view className='FormLine flex-h'>
237
               <view className='FormLine flex-h'>
135
                 <view className='flex-item'>
238
                 <view className='flex-item'>
136
-                  <Input placeholder='请输入渠道' disabled value={type === 'customer' ? '-' : ''}></Input>
239
+                  <view className='CheckBoxList'>
240
+                    {
241
+                      HouseTypeList.map((item, index) => (
242
+                        <view key={`RoomTypeItem-${index}`} onClick={CutRoomType(item)}>
243
+                          <text>{item.apartmentName}</text>
244
+                          {
245
+                            CurrentRoomTypeId === item.apartmentId &&
246
+                            <Image mode='widthFix' src={require('@/assets/findHouse-icon1.png')}></Image>
247
+                          }
248
+                        </view>
249
+                      ))
250
+                    }
251
+                  </view>
137
                 </view>
252
                 </view>
138
               </view>
253
               </view>
139
             </Block>
254
             </Block>
140
           }
255
           }
141
 
256
 
142
           {
257
           {
143
-            CurrentStatusId === 3 &&
258
+            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
144
             <Block>
259
             <Block>
145
-              <text className='required'>内场接待</text>
260
+              <text className='required'>房号</text>
146
               <view className='FormLine flex-h'>
261
               <view className='FormLine flex-h'>
147
                 <view className='flex-item'>
262
                 <view className='flex-item'>
148
-                  <Picker range-key='name' range={ConsultantList} value={0} onChange={PickerChange.bind(this, 'realtyConsultant')}>{CurrnetConsultant.name || '请选择'}</Picker>
263
+                  <Input placeholder='请输入房号' onInput={InputChange.bind(this, 'houseInfo')}></Input>
149
                 </view>
264
                 </view>
150
               </view>
265
               </view>
151
             </Block>
266
             </Block>
152
           }
267
           }
153
 
268
 
154
-          <text className='required'>业绩分成人|占比/%</text>
155
-          <view className='FormLine flex-h'>
156
-            <view className='flex-item'>
157
-              <Input placeholder='请输入业绩分成人|占比/%'></Input>
158
-            </view>
159
-          </view>
160
-
161
-          <text className='required'>户型</text>
162
-          <view className='FormLine flex-h'>
163
-            <view className='flex-item'>
164
-              <view className='CheckBoxList'>
165
-                {
166
-                  RoomTypeList.map((item, index) => (
167
-                    <view key={`RoomTypeItem-${index}`} onClick={CutRoomType(item)}>
168
-                      <text>{item.name}</text>
169
-                      {
170
-                        CurrentRoomTypeId === item.id &&
171
-                        <Image mode='widthFix' src={require('../../../assets/findHouse-icon1.png')}></Image>
172
-                      }
173
-                    </view>
174
-                  ))
175
-                }
269
+          {
270
+            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
271
+            <Block>
272
+              <text className='required'>签约日期</text>
273
+              <view className='FormLine flex-h'>
274
+                <view className='flex-item'>
275
+                  <Picker mode='date' value={null} onChange={SuccessDateChange}>{SuccessDate || '请选择开始日期'}</Picker>
276
+                </view>
277
+                <text className='iconfont icon-jiantoudown'></text>
176
               </view>
278
               </view>
177
-            </view>
178
-          </view>
179
-
180
-          <text className='required'>房号</text>
181
-          <view className='FormLine flex-h'>
182
-            <view className='flex-item'>
183
-              <Input placeholder='请输入房号'></Input>
184
-            </view>
185
-          </view>
279
+            </Block>
280
+          }
186
 
281
 
187
-          <text className='required'>签约日期</text>
188
-          <view className='FormLine flex-h'>
189
-            <view className='flex-item'>
190
-              <text>请选择</text>
191
-            </view>
192
-            <text className='iconfont icon-jiantoudown'></text>
193
-          </view>
282
+          {
283
+            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
284
+            <Block>
285
+              <text className='required'>成交金额</text>
286
+              <view className='FormLine flex-h'>
287
+                <view className='flex-item'>
288
+                  <Input placeholder='请输入金额' onInput={InputChange.bind(this, 'price')}></Input>
289
+                </view>
290
+              </view>
291
+            </Block>
292
+          }
194
 
293
 
195
-          <text className='required'>成交金额</text>
196
-          <view className='FormLine flex-h'>
197
-            <view className='flex-item'>
198
-              <Input placeholder='请输入金额'></Input>
199
-            </view>
200
-          </view>
201
 
294
 
202
           <text>备注</text>
295
           <text>备注</text>
203
           <view className='FormLine flex-h'>
296
           <view className='FormLine flex-h'>
204
             <view className='flex-item'>
297
             <view className='flex-item'>
205
-              <Input placeholder='补充说明(选填)'></Input>
298
+              <Input placeholder='补充说明(选填)' value={FormData.remark} onInput={InputChange.bind(this, 'remark')}></Input>
206
             </view>
299
             </view>
207
           </view>
300
           </view>
208
 
301
 
209
           <view className='Btn'>
302
           <view className='Btn'>
210
-            <text>提交</text>
303
+            <text onClick={ToSubmit}>提交</text>
211
           </view>
304
           </view>
212
 
305
 
213
         </view>
306
         </view>

+ 5
- 5
src/pages/mine/changeVisit/index.scss View File

71
             >view {
71
             >view {
72
               display: inline-block;
72
               display: inline-block;
73
               vertical-align: middle;
73
               vertical-align: middle;
74
-              width: 194px;
74
+              min-width: 194px;
75
               font-size: 0;
75
               font-size: 0;
76
               white-space: nowrap;
76
               white-space: nowrap;
77
-              margin-left: 44px;
77
+              margin-right: 44px;
78
               border-radius: 4px;
78
               border-radius: 4px;
79
               border: 2px solid #193C83;
79
               border: 2px solid #193C83;
80
               box-sizing: border-box;
80
               box-sizing: border-box;
82
               text-align: center;
82
               text-align: center;
83
               position: relative;
83
               position: relative;
84
               overflow: hidden;
84
               overflow: hidden;
85
-              &:nth-child(3n + 1) {
86
-                margin-left: 0;
87
-              }
85
+              // &:nth-child(3n + 1) {
86
+              //   margin-left: 0;
87
+              // }
88
               >text {
88
               >text {
89
                 display: inline-block;
89
                 display: inline-block;
90
                 font-size: 30px;
90
                 font-size: 30px;

+ 1
- 1
src/pages/mine/components/ResidentListItem/index.jsx View File

64
       <view className='Opt'>
64
       <view className='Opt'>
65
         {
65
         {
66
           !(data.type === 'report' && data.channelStatus === 3) &&
66
           !(data.type === 'report' && data.channelStatus === 3) &&
67
-          <text className='active' onClick={() => { Taro.navigateTo({ url: `/pages/mine/changeVisit/index?id=${data.id}&name=${data.name}&buildingId=${data.buildingId}&type=${data.type}` }) }}>更新交易</text>
67
+          <text className='active' onClick={() => { Taro.navigateTo({ url: `/pages/mine/changeVisit/index?id=${data.id}&name=${data.name}&buildingId=${data.buildingId}&type=${data.type}&channelId=${data.channelId}` }) }}>更新交易</text>
68
         }
68
         }
69
         {
69
         {
70
           data.type === 'report' && data.channelStatus === 3 &&
70
           data.type === 'report' && data.channelStatus === 3 &&

+ 2
- 0
src/pages/video/index.scss View File

73
         }
73
         }
74
         &:last-child {
74
         &:last-child {
75
           text-align: right;
75
           text-align: right;
76
+          flex: 1;
77
+          -webkit-flex: 1;
76
         }
78
         }
77
         &.active {
79
         &.active {
78
           >text {
80
           >text {

+ 8
- 0
src/pages/video/liveDetail/index.scss View File

27
     text{
27
     text{
28
          color: #ffffff;
28
          color: #ffffff;
29
     }
29
     }
30
+    >button {
31
+      background: none;
32
+      border: none;
33
+      color: #fff;
34
+      &::after {
35
+        display: none;
36
+      }
37
+    }
30
   }
38
   }
31
 }
39
 }