张延森 5 anos atrás
pai
commit
8dcd4ebbd8

+ 4
- 4
config/dev.js Ver arquivo

5
   defineConstants: {
5
   defineConstants: {
6
     // HOST: '"http://47.101.36.130:8085"',//测试
6
     // HOST: '"http://47.101.36.130:8085"',//测试
7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8
-    HOST: '"https://dev.pawoma.cn"',//测试
9
-    WSS_HOST: '"wss://dev.pawoma.cn"',
8
+    // HOST: '"https://dev.pawoma.cn"',//测试
9
+    // WSS_HOST: '"wss://dev.pawoma.cn"',
10
     // HOST: '"https://dev.jinchengjiaye.com"',//测试
10
     // HOST: '"https://dev.jinchengjiaye.com"',//测试
11
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
11
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
12
     // HOST: '"https://lt.pawoma.cn"',
12
     // HOST: '"https://lt.pawoma.cn"',
13
     // WSS_HOST: '"wss://lt.pawoma.cn"',
13
     // WSS_HOST: '"wss://lt.pawoma.cn"',
14
-    // HOST: '"http://127.0.0.1:8080"',
15
-    // WSS_HOST: '"ws://127.0.0.1:8080"',
14
+    HOST: '"http://192.168.2.52:8080"',
15
+    WSS_HOST: '"ws://192.168.2.52:8080"',
16
     OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',
16
     OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',
17
     OSS_FAST_PATH: 'https://njcj.oss-accelerate.aliyuncs.com/',
17
     OSS_FAST_PATH: 'https://njcj.oss-accelerate.aliyuncs.com/',
18
     Version: 'V3.5.12'
18
     Version: 'V3.5.12'

+ 1
- 0
src/constants/api.js Ver arquivo

59
 
59
 
60
 export const API_HOUSE_LIST = resolvePath('listHousingResources')
60
 export const API_HOUSE_LIST = resolvePath('listHousingResources')
61
 export const API_PRESELECTION_RECORD = resolvePath('listPreselectionRecord')
61
 export const API_PRESELECTION_RECORD = resolvePath('listPreselectionRecord')
62
+export const API_RAISE_CHECK = resolvePath('check/raise')
62
 export const API_RAISE_PROFILE = resolvePath('taRaise')
63
 export const API_RAISE_PROFILE = resolvePath('taRaise')
63
 export const API_SAVE_RAISE_RECORD = resolvePath('taRaiseRecord')
64
 export const API_SAVE_RAISE_RECORD = resolvePath('taRaiseRecord')
64
 export const API_RATSE_RECORD = resolvePath('taRaiseRecord/list')
65
 export const API_RATSE_RECORD = resolvePath('taRaiseRecord/list')

+ 5
- 3
src/onlineSelling/pages/detail/index.js Ver arquivo

12
 import Statement from '../../components/Statement'
12
 import Statement from '../../components/Statement'
13
 import { View } from '@tarojs/components'
13
 import { View } from '@tarojs/components'
14
 import * as houseActions from '@/actions/house'
14
 import * as houseActions from '@/actions/house'
15
+import { checkRaise } from '@/services/house'
15
 
16
 
16
 @connect(
17
 @connect(
17
   ({ user, house }) => ({ ...user, house }),
18
   ({ user, house }) => ({ ...user, house }),
148
       return;
149
       return;
149
     }
150
     }
150
 
151
 
151
-
152
-    this.props.dispatchAddCart(detail)
153
-    Taro.navigateTo({ url: `/onlineSelling/pages/raiseMoney/index?houseId=${detail.houseId}&salesBatchId=${detail.salesBatchId}` })
152
+    checkRaise([detail.houseId]).then(() => {
153
+      this.props.dispatchAddCart(detail)
154
+      Taro.navigateTo({ url: `/onlineSelling/pages/raiseMoney/index?houseId=${detail.houseId}&salesBatchId=${detail.salesBatchId}` })
155
+    })
154
   }
156
   }
155
 
157
 
156
 
158
 

+ 83
- 78
src/onlineSelling/pages/raiseMoney/index.js Ver arquivo

13
 import Captcha from './Captcha'
13
 import Captcha from './Captcha'
14
 import { raiseOrder, cancelOrder, queryPreselectionRecord } from '@/services/project'
14
 import { raiseOrder, cancelOrder, queryPreselectionRecord } from '@/services/project'
15
 import { getCodeMessage, checkCaptcha } from '@/services/getCode'
15
 import { getCodeMessage, checkCaptcha } from '@/services/getCode'
16
+import { checkRaise } from '@/services/house'
16
 import { checkIDCard, isEmpty } from '@/utils/tools'
17
 import { checkIDCard, isEmpty } from '@/utils/tools'
17
 import ContactConsultant from '../../components/ContactConsultant'
18
 import ContactConsultant from '../../components/ContactConsultant'
18
 import RadioList from './RadioList'
19
 import RadioList from './RadioList'
218
   }
219
   }
219
   renderHouse() {
220
   renderHouse() {
220
     const { house: { raiseCart } } = this.props
221
     const { house: { raiseCart } } = this.props
221
-    const { raiseProfile = {} } = this.state
222
-    const disabled = raiseProfile.houseLockingType === 'auto'
222
+    const { raiseProfile = {}, record } = this.state
223
+    const disabled = raiseProfile.houseLockingType === 'auto' || !!record.raiseRecordId
223
 
224
 
224
     return (
225
     return (
225
       <ScrollView scrollY className="container">
226
       <ScrollView scrollY className="container">
451
     )
452
     )
452
   }
453
   }
453
 
454
 
454
-  checkRaise = () => {
455
-    const { record, raiseProfile, preselectList } = this.state
455
+  validRaise = () => {
456
+    // const { record, raiseProfile, preselectList } = this.state
456
     const { house } = this.props
457
     const { house } = this.props
457
 
458
 
458
     // 当前选中房源
459
     // 当前选中房源
463
       return Promise.reject()
464
       return Promise.reject()
464
     }
465
     }
465
 
466
 
466
-    // 如果要求预选, 预先房源跟当前列表必须一致
467
-    if (raiseProfile.needPreselection) {
468
-      for (let i in houseList) {
469
-        const exists = preselectList.filter(x => x.houseId === houseList[i].houseId)[0]
470
-        if (!exists) {
471
-          Taro.showToast({ title: '需要先预选才能认筹', icon: 'none' })
472
-          return Promise.reject()
473
-        }
474
-      }
475
-    }
476
-
477
-    if (record.raiseRecordId) {
478
-      // 如果认筹单跟预选的房源不一致, 说明是新的认筹
479
-      let found = true
480
-      for (let inx in houseList) {
481
-        const has = (record.taHousingResourcesList || []).filter(x => x.houseId == houseList[inx].houseId)[0]
482
-
483
-        if (!has) {
484
-          found = false;
485
-          break;
486
-        }
487
-      }
488
-
489
-      if (!found) {
490
-        const defaultRecord = this.initRecord()
491
-        this.setState({ record: defaultRecord })
492
-      }
493
-    }
467
+    return new Promise((resolve, reject) => {
468
+      checkRaise(houseList).then(resolve).catch(reject)
469
+    })
494
 
470
 
495
-    return Promise.resolve()
471
+    // // 如果要求预选, 预先房源跟当前列表必须一致
472
+    // if (raiseProfile.needPreselection) {
473
+    //   for (let i in houseList) {
474
+    //     const exists = preselectList.filter(x => x.houseId === houseList[i].houseId)[0]
475
+    //     if (!exists) {
476
+    //       Taro.showToast({ title: '需要先预选才能认筹', icon: 'none' })
477
+    //       return Promise.reject()
478
+    //     }
479
+    //   }
480
+    // }
481
+
482
+    // if (record.raiseRecordId) {
483
+    //   // 如果认筹单跟预选的房源不一致, 说明是新的认筹
484
+    //   let found = true
485
+    //   for (let inx in houseList) {
486
+    //     const has = (record.taHousingResourcesList || []).filter(x => x.houseId == houseList[inx].houseId)[0]
487
+
488
+    //     if (!has) {
489
+    //       found = false;
490
+    //       break;
491
+    //     }
492
+    //   }
493
+
494
+    //   if (!found) {
495
+    //     const defaultRecord = this.initRecord()
496
+    //     this.setState({ record: defaultRecord })
497
+    //   }
498
+    // }
499
+
500
+    // return Promise.resolve()
496
   }
501
   }
497
 
502
 
498
   makeRaiseRecord = () => {
503
   makeRaiseRecord = () => {
615
             resolve()
620
             resolve()
616
           },
621
           },
617
           fail(err) {
622
           fail(err) {
618
-            console.log(err, "errrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr")
619
-
620
             cancelOrder(params).then(res => { })
623
             cancelOrder(params).then(res => { })
621
 
624
 
622
             // 然后
625
             // 然后
683
   }
686
   }
684
 
687
 
685
   nextStep(current) {
688
   nextStep(current) {
686
-    switch (current) {
687
-      // 确认房源
688
-      case 0:
689
-        this.checkRaise().then(() => {
690
-          this.setState({
691
-            current: current + 1
692
-          })
693
-        })
694
-        return;
695
-
696
-      // 认筹确认
697
-      case 2:
698
-        this.makeRaiseRecord().then((res) => {
699
-          const { userInfo: { miniApp: { tpls } } } = this.props
700
-          const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
701
-          const that = this
702
-          wx.requestSubscribeMessage({
703
-            tmplIds: [tplId],
704
-            success(res) {
705
-            },
706
-            fail(res) {
707
-
708
-            },
709
-            complete() {
710
-              that.setState({
711
-                current: current + 1
712
-              })
713
-            }
714
-          })
715
-        })
716
-        return;
717
-
689
+    // 缴费的下一步
690
+    if (current > 3) {
691
+      this.setState({
692
+        current: current + 1
693
+      })
718
 
694
 
695
+      return;
696
+    }
719
 
697
 
720
-      // 缴费
721
-      case 3:
722
-        this.makePay().then(() => {
698
+    this.validRaise().then(() => {
699
+
700
+      switch (current) {
701
+        // 认筹确认
702
+        case 2:
703
+          this.makeRaiseRecord().then((res) => {
704
+            const { userInfo: { miniApp: { tpls } } } = this.props
705
+            const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
706
+            const that = this
707
+            wx.requestSubscribeMessage({
708
+              tmplIds: [tplId],
709
+              success(res) {
710
+              },
711
+              fail(res) {
712
+  
713
+              },
714
+              complete() {
715
+                that.setState({
716
+                  current: current + 1
717
+                })
718
+              }
719
+            })
720
+          })
721
+          return;
722
+
723
+        // 缴费
724
+        case 3:
725
+          this.makePay().then(() => {
726
+            this.setState({
727
+              current: current + 1
728
+            })
729
+          })
730
+          return;
731
+  
732
+        //
733
+        default:
723
           this.setState({
734
           this.setState({
724
             current: current + 1
735
             current: current + 1
725
           })
736
           })
726
-        })
727
-        return;
737
+      }
728
 
738
 
729
-      //
730
-      default:
731
-        this.setState({
732
-          current: current + 1
733
-        })
739
+    })
734
 
740
 
735
-    }
736
   }
741
   }
737
 
742
 
738
   upStep(current) {
743
   upStep(current) {

+ 3
- 0
src/services/house.js Ver arquivo

1
+import { fetch, apis } from '@/utils/request'
2
+
3
+export const checkRaise = houseIdList => fetch({ url: `${apis.API_RAISE_CHECK}?houseIds=${houseIdList.join(',')}`, method: 'GET' })