|
@@ -15,13 +15,12 @@ import { getCodeMessage } from '@/services/getCode'
|
15
|
15
|
import { checkIDCard, isEmpty } from '@/utils/tools'
|
16
|
16
|
import ContactConsultant from '../../components/ContactConsultant'
|
17
|
17
|
|
18
|
|
-const getRaiseProfile = ({ salesBatchId, raiseRecordId, personId}) => {
|
|
18
|
+const getRaiseProfile = ({ salesBatchId, raiseRecordId, personId }) => {
|
19
|
19
|
const queryString = [
|
20
|
20
|
`${raiseRecordId ? 'raiseRecordId=' + raiseRecordId : ''}`,
|
21
|
21
|
`${salesBatchId ? 'salesBatchId=' + salesBatchId : ''}`,
|
22
|
22
|
`${personId ? 'personId=' + personId : ''}`,
|
23
|
23
|
].filter(Boolean).join('&')
|
24
|
|
- console.log('----------queryString-------------->', queryString)
|
25
|
24
|
|
26
|
25
|
return fetch({ url: `${apis.API_RAISE_PROFILE}?${queryString}` })
|
27
|
26
|
}
|
|
@@ -81,11 +80,10 @@ export default class raiseMoney extends Component {
|
81
|
80
|
}
|
82
|
81
|
|
83
|
82
|
loadInfo(salesBatchId, raiseRecordId) {
|
84
|
|
- const { house } = this.props
|
|
83
|
+ const { userInfo, house } = this.props
|
|
84
|
+ const { personId } = userInfo.person
|
85
|
85
|
const defaultRecord = this.initRecord()
|
86
|
86
|
|
87
|
|
- console.log('----------this.props------------->', getRaiseProfile)
|
88
|
|
-
|
89
|
87
|
// 请求认筹信息
|
90
|
88
|
getRaiseProfile({ salesBatchId, raiseRecordId, personId }).then(res => {
|
91
|
89
|
this.setState({ raiseProfile: res, record: res.record || defaultRecord })
|
|
@@ -320,15 +318,44 @@ export default class raiseMoney extends Component {
|
320
|
318
|
</ScrollView >
|
321
|
319
|
)
|
322
|
320
|
}
|
323
|
|
-
|
|
321
|
+ toDecimal2 = (x) => {
|
|
322
|
+ var f = parseFloat(x);
|
|
323
|
+ if (isNaN(f)) {
|
|
324
|
+ return false;
|
|
325
|
+ }
|
|
326
|
+ var f = Math.round(x * 100) / 100;
|
|
327
|
+ var s = f.toString();
|
|
328
|
+ var rs = s.indexOf('.');
|
|
329
|
+ if (rs < 0) {
|
|
330
|
+ rs = s.length;
|
|
331
|
+ s += '.';
|
|
332
|
+ }
|
|
333
|
+ while (s.length <= rs + 2) {
|
|
334
|
+ s += '0';
|
|
335
|
+ }
|
|
336
|
+ return s;
|
|
337
|
+ }
|
|
338
|
+ regFenToYuan = (fen) => {
|
|
339
|
+ var num = fen;
|
|
340
|
+ num = fen * 0.01;
|
|
341
|
+ num += '';
|
|
342
|
+ var reg = num.indexOf('.') > -1 ? /(\d{1,3})(?=(?:\d{3})+\.)/g : /(\d{1,3})(?=(?:\d{3})+$)/g;
|
|
343
|
+ num = num.replace(reg, '$1');
|
|
344
|
+ num = this.toDecimal2(num)
|
|
345
|
+ return num
|
|
346
|
+ };
|
324
|
347
|
renderMoney() {
|
|
348
|
+ const { raiseProfile = {} } = this.state
|
|
349
|
+
|
|
350
|
+
|
325
|
351
|
return (
|
326
|
352
|
<ScrollView scrollY className="container2" style="padding:0 30rpx">
|
327
|
353
|
<View className="profile-flex">
|
328
|
354
|
<View className="title">认筹金额</View>
|
329
|
|
- <View className="price">1 元</View>
|
|
355
|
+ <View className="price">{this.regFenToYuan(raiseProfile.raisePrice)}元</View>
|
330
|
356
|
</View>
|
331
|
|
- <View className="center-title">线上选房协议</View>
|
|
357
|
+ <View className="center-title">线上缴费说明</View>
|
|
358
|
+ <RichText nodes={raiseProfile.payDescriptionOnline || ''} />
|
332
|
359
|
</ScrollView >
|
333
|
360
|
)
|
334
|
361
|
}
|
|
@@ -344,17 +371,17 @@ export default class raiseMoney extends Component {
|
344
|
371
|
|
345
|
372
|
if (record.raiseRecordId) {
|
346
|
373
|
// 如果认筹单跟预选的房源不一致, 说明是新的认筹
|
347
|
|
- let found = false
|
|
374
|
+ let found = true
|
348
|
375
|
for (let inx in house.raiseCart) {
|
349
|
|
- const has = (record.taHousingResourcesList || []).filter(x => houseId == house.raiseCart[inx].houseId)[0]
|
|
376
|
+ const has = (record.taHousingResourcesList || []).filter(x => x.houseId == house.raiseCart[inx].houseId)[0]
|
350
|
377
|
|
351
|
|
- if (has) {
|
352
|
|
- found = true;
|
|
378
|
+ if (!has) {
|
|
379
|
+ found = false;
|
353
|
380
|
break;
|
354
|
381
|
}
|
355
|
382
|
}
|
356
|
383
|
|
357
|
|
- if (found) {
|
|
384
|
+ if (!found) {
|
358
|
385
|
const defaultRecord = this.initRecord()
|
359
|
386
|
this.setState({ record: defaultRecord })
|
360
|
387
|
}
|
|
@@ -462,13 +489,14 @@ export default class raiseMoney extends Component {
|
462
|
489
|
})
|
463
|
490
|
|
464
|
491
|
}
|
465
|
|
- toRaiseProfile() {
|
466
|
|
- const id = this.$router.params.raiseRecordId
|
|
492
|
+ toRaiseProfile(id) {
|
|
493
|
+
|
467
|
494
|
Taro.navigateTo({
|
468
|
495
|
url: `/onlineSelling/pages/raiseProfile/index?raiseRecordId=${id}`
|
469
|
496
|
})
|
470
|
497
|
}
|
471
|
498
|
renderResult() {
|
|
499
|
+ const { raiseProfile = {} } = this.state
|
472
|
500
|
return (
|
473
|
501
|
<View className="result">
|
474
|
502
|
<Image className="result-img" src={require('../../assets/success2.png')}></Image>
|
|
@@ -477,9 +505,9 @@ export default class raiseMoney extends Component {
|
477
|
505
|
|
478
|
506
|
<View className="tip" style="margin-bottom:10rpx">详情请查看认筹单</View>
|
479
|
507
|
<View className="tip">支付结果请留意微信支付通知</View>
|
480
|
|
- {/* <ContactConsultant buildingId={buildingId} style=" position: absolute;bottom: 8vh;" /> */}
|
481
|
|
- <ContactConsultant style=" position: absolute;bottom: 11vh;" />
|
482
|
|
- <View className="look-btn" onClick={() => this.toRaiseProfile()}>查看认筹单</View>
|
|
508
|
+ <ContactConsultant buildingId={raiseProfile.buildingId} style=" position: absolute;bottom: 11vh;" />
|
|
509
|
+
|
|
510
|
+ <View className="look-btn" onClick={() => this.toRaiseProfile(raiseProfile.raiseId)}>查看认筹单</View>
|
483
|
511
|
</View>
|
484
|
512
|
|
485
|
513
|
);
|