소스 검색

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

Your Name 3 년 전
부모
커밋
2ab705fccb

+ 2
- 0
src/constants/api.js 파일 보기

@@ -14,6 +14,8 @@ export const resolvePath = api => `${host + pathname}/${api}`
14 14
 
15 15
 export const API_CITY_AREA = resolvePath('tdCityList/tdAreaCity') // 城市下区域查询
16 16
 
17
+export const API_BUILDING_HOUSE_TYPE = resolvePath('apartmentList') // 获取楼盘户型
18
+
17 19
 // 客户
18 20
 export const API_SAVE_CUSTOMER_INFO = resolvePath('customerInfo') // 保存客户信息
19 21
 export const API_GET_CUSTOMER_INFO = resolvePath('customerInfo') // 查询客户信息

+ 18
- 0
src/pages/index/courseDetail/index.scss 파일 보기

@@ -108,6 +108,24 @@
108 108
             }
109 109
           }
110 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 129
             >view, button {
112 130
               font-size: 0;
113 131
               white-space: nowrap;

+ 169
- 76
src/pages/mine/changeVisit/index.jsx 파일 보기

@@ -3,36 +3,42 @@ import withLayout from '@/layout'
3 3
 import { ScrollView, Input, Image, Block, Picker } from '@tarojs/components'
4 4
 import '@/assets/css/iconfont.css'
5 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 9
 import './index.scss'
7 10
 
8 11
 export default withLayout((props) => {
9 12
 
10 13
   const { router } = props
11
-  const { name, buildingId, type } = router.params
14
+  const { name, buildingId, type, id, channelId } = router.params
12 15
 
13 16
   const RenChouData = {
14 17
     name,
15 18
     realtyConsultant: '',
16
-    remark: ''
19
+    remark: '',
17 20
   }
18 21
 
19 22
   const QianYueData = {
20 23
     name,
21 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 34
   const [FormData, setFormData] = useState({ ...RenChouData })
32 35
 
33 36
   const [ConsultantList, setConsultantList] = useState([])
37
+  const [HouseTypeList, setHouseTypeList] = useState([])
34 38
   const [CurrnetConsultant, setCurrnetConsultant] = useState({})
35 39
 
40
+  const [SuccessDate, setSuccessDate] = useState(null)
41
+
36 42
   const [StatusList] = useState([
37 43
     { name: '认筹', id: 3 },
38 44
     { name: '签约', id: 4 },
@@ -40,14 +46,14 @@ export default withLayout((props) => {
40 46
   ])
41 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 49
   const [CurrentRoomTypeId, setCurrentRoomTypeId] = useState(null)
50 50
 
51
+  useEffect(() => {
52
+    if (channelId !== null && channelId !== 'null') {
53
+
54
+    }
55
+  }, [])
56
+
51 57
   useEffect(() => {
52 58
     if (buildingId) {
53 59
       const params = {
@@ -62,32 +68,104 @@ export default withLayout((props) => {
62 68
     }
63 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 79
   const CutStatus = (item) => {
66 80
     return () => {
67 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 92
   const CutRoomType = (item) => {
72 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 101
   const InputChange = (key, e) => {
78
-    let resData = FormData
102
+    let resData = { ...FormData }
79 103
     resData[key] = e.detail.value
80
-    setFormData(resData)
104
+    setFormData({ ...resData })
81 105
   }
82 106
 
83 107
   const PickerChange = (key, e) => {
84
-    let resData = FormData
108
+    let resData = { ...FormData }
85 109
     if (key === 'realtyConsultant') {
86 110
       resData[key] = ConsultantList[e.detail.value].id
87 111
       resData.realtyConsultantName = ConsultantList[e.detail.value].name
88 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 171
   return (
@@ -102,7 +180,7 @@ export default withLayout((props) => {
102 180
               <view className='CheckBoxList'>
103 181
                 {
104 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 184
                       <text>{item.name}</text>
107 185
                       {
108 186
                         CurrentStatusId === item.id &&
@@ -115,99 +193,114 @@ export default withLayout((props) => {
115 193
             </view>
116 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 220
             <Block>
121
-              <text className='required'>客户姓名</text>
221
+              <text className='required'>业绩分成人|占比/%</text>
122 222
               <view className='FormLine flex-h'>
123 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 228
                 </view>
126 229
               </view>
127 230
             </Block>
128 231
           }
129 232
 
130 233
           {
131
-            CurrentStatusId === 3 &&
234
+            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
132 235
             <Block>
133
-              <text>归属渠道</text>
236
+              <text className='required'>户型</text>
134 237
               <view className='FormLine flex-h'>
135 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 252
                 </view>
138 253
               </view>
139 254
             </Block>
140 255
           }
141 256
 
142 257
           {
143
-            CurrentStatusId === 3 &&
258
+            (CurrentStatusId === 4 || CurrentStatusId === 5) &&
144 259
             <Block>
145
-              <text className='required'>内场接待</text>
260
+              <text className='required'>房号</text>
146 261
               <view className='FormLine flex-h'>
147 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 264
                 </view>
150 265
               </view>
151 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 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 295
           <text>备注</text>
203 296
           <view className='FormLine flex-h'>
204 297
             <view className='flex-item'>
205
-              <Input placeholder='补充说明(选填)'></Input>
298
+              <Input placeholder='补充说明(选填)' value={FormData.remark} onInput={InputChange.bind(this, 'remark')}></Input>
206 299
             </view>
207 300
           </view>
208 301
 
209 302
           <view className='Btn'>
210
-            <text>提交</text>
303
+            <text onClick={ToSubmit}>提交</text>
211 304
           </view>
212 305
 
213 306
         </view>

+ 5
- 5
src/pages/mine/changeVisit/index.scss 파일 보기

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

+ 1
- 1
src/pages/mine/components/ResidentListItem/index.jsx 파일 보기

@@ -64,7 +64,7 @@ export default function ResidentListItem (props) {
64 64
       <view className='Opt'>
65 65
         {
66 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 70
           data.type === 'report' && data.channelStatus === 3 &&

+ 2
- 0
src/pages/video/index.scss 파일 보기

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

+ 8
- 0
src/pages/video/liveDetail/index.scss 파일 보기

@@ -27,5 +27,13 @@
27 27
     text{
28 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
 }