张延森 5 years ago
parent
commit
01dd0cbbd7

+ 11
- 0
src/onlineSelling/pages/detail/index.js View File

@@ -140,6 +140,17 @@ export default class Index extends Component {
140 140
 
141 141
   toRaiseMoney() {
142 142
     const detail = this.state.houseDetail || {}
143
+
144
+    if (detail.status != 1 || detail.houseLockingStatus == 'locked') {
145
+      Taro.showToast({
146
+        url: '当前房源被锁定或未发布, 不能认筹',
147
+        icon: 'none',
148
+      })
149
+
150
+      return;
151
+    }
152
+
153
+
143 154
     this.props.dispatchAddCart(detail)
144 155
     Taro.navigateTo({ url: `/onlineSelling/pages/raiseMoney/index?houseId=${detail.houseId}&salesBatchId=${detail.salesBatchId}` })
145 156
   }

+ 18
- 5
src/onlineSelling/pages/raiseMoney/index.js View File

@@ -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
     })