|
@@ -444,19 +444,33 @@ export default class raiseMoney extends Component {
|
444
|
444
|
}
|
445
|
445
|
|
446
|
446
|
checkRaise = () => {
|
447
|
|
- const { record } = this.state
|
|
447
|
+ const { record, raiseProfile, preselectList } = this.state
|
448
|
448
|
const { house } = this.props
|
449
|
449
|
|
450
|
|
- if (!house.raiseCart.length) {
|
|
450
|
+ // 当前选中房源
|
|
451
|
+ const houseList = house.raiseCart || []
|
|
452
|
+
|
|
453
|
+ if (!houseList.length) {
|
451
|
454
|
Taro.showToast({ title: '请选择房源', icon: 'none' })
|
452
|
455
|
return Promise.reject()
|
453
|
456
|
}
|
454
|
457
|
|
|
458
|
+ // 如果要求预选, 预先房源跟当前列表必须一致
|
|
459
|
+ if (raiseProfile.needPreselection) {
|
|
460
|
+ for (let i in houseList) {
|
|
461
|
+ const exists = preselectList.filter(x => x.houseId === houseList[i].houseId)[0]
|
|
462
|
+ if (!exists) {
|
|
463
|
+ Taro.showToast({ title: '需要先预选才能认筹', icon: 'none' })
|
|
464
|
+ return Promise.reject()
|
|
465
|
+ }
|
|
466
|
+ }
|
|
467
|
+ }
|
|
468
|
+
|
455
|
469
|
if (record.raiseRecordId) {
|
456
|
470
|
// 如果认筹单跟预选的房源不一致, 说明是新的认筹
|
457
|
471
|
let found = true
|
458
|
|
- for (let inx in house.raiseCart) {
|
459
|
|
- const has = (record.taHousingResourcesList || []).filter(x => x.houseId == house.raiseCart[inx].houseId)[0]
|
|
472
|
+ for (let inx in houseList) {
|
|
473
|
+ const has = (record.taHousingResourcesList || []).filter(x => x.houseId == houseList[inx].houseId)[0]
|
460
|
474
|
|
461
|
475
|
if (!has) {
|
462
|
476
|
found = false;
|
|
@@ -589,7 +603,6 @@ export default class raiseMoney extends Component {
|
589
|
603
|
|
590
|
604
|
}
|
591
|
605
|
toRaiseProfile(id) {
|
592
|
|
-
|
593
|
606
|
Taro.navigateTo({
|
594
|
607
|
url: `/onlineSelling/pages/raiseProfile/index?id=${id}`
|
595
|
608
|
})
|