张延森 5 anos atrás
pai
commit
a14db73dd9
2 arquivos alterados com 16 adições e 6 exclusões
  1. 2
    2
      config/dev.js
  2. 14
    4
      src/onlineSelling/pages/raiseMoney/index.js

+ 2
- 2
config/dev.js Ver arquivo

@@ -11,8 +11,8 @@ module.exports = {
11 11
     // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
12 12
     // HOST: '"https://lt.pawoma.cn"',
13 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 16
     OSS_PATH: 'https://njcj.oss-cn-shanghai.aliyuncs.com/',
17 17
     OSS_FAST_PATH: 'https://njcj.oss-accelerate.aliyuncs.com/',
18 18
     Version: 'V3.5.12'

+ 14
- 4
src/onlineSelling/pages/raiseMoney/index.js Ver arquivo

@@ -5,6 +5,7 @@ import RaiseCard from '../../components/RaiseCard'
5 5
 import Statement from '../../components/Statement'
6 6
 import ConsultantItem from '../../components/ConsultantItem/index'
7 7
 import ready from '@/utils/ready'
8
+import dayjs from 'dayjs'
8 9
 import { connect } from '@tarojs/redux'
9 10
 import * as houseActions from '@/actions/house'
10 11
 import NextStep from './NextStep'
@@ -35,7 +36,6 @@ const saveRaiseRecord = (record, raise) => {
35 36
     buildingId: raise.buildingId,
36 37
   }
37 38
 
38
-
39 39
   return fetch({ url: `${apis.API_SAVE_RAISE_RECORD}`, method: 'POST', payload })
40 40
 }
41 41
 
@@ -102,6 +102,16 @@ export default class raiseMoney extends Component {
102 102
 
103 103
       this.setState({ raiseProfile: res, payType, record: res.record || defaultRecord })
104 104
 
105
+      // 销售批次已被取消发布
106
+      if (res.status != 1) {
107
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '销售批次已被取消发布' } })  
108
+      }
109
+
110
+      // 不在认筹时间内
111
+      if (!dayjs().isBefore(res.raiseEndTime) || !dayjs().isAfter(res.raiseStartTime)) {
112
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '不在认筹时间内' } })  
113
+      }
114
+
105 115
       // 请求置业顾问列表
106 116
       if (!house.consultantList || !house.consultantList.length) {
107 117
         this.props.dispatchGetConsultants({
@@ -119,7 +129,7 @@ export default class raiseMoney extends Component {
119 129
       }).then((res2) => {
120 130
         // 如果认筹必须预选
121 131
         if (res.needPreselection && res2.length < 1) {
122
-          this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '请先预选房源' } })  
132
+          this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '需要先预选才能认筹' } })
123 133
         }
124 134
       })
125 135
     })
@@ -485,8 +495,6 @@ export default class raiseMoney extends Component {
485 495
       return Promise.reject()
486 496
     }
487 497
 
488
-    debugger
489
-
490 498
     // 校验手机号
491 499
     if (isEmpty(record.tel) || record.tel.length < 11) {
492 500
       Taro.showToast({
@@ -523,6 +531,8 @@ export default class raiseMoney extends Component {
523 531
         userName: consultant.name,
524 532
       }, raiseProfile).then((res) => {
525 533
         resolve(res)
534
+      }).catch((err) => {
535
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: err.message || err } }) 
526 536
       })
527 537
     })
528 538
   }