张延森 5 years ago
parent
commit
a14db73dd9
2 changed files with 16 additions and 6 deletions
  1. 2
    2
      config/dev.js
  2. 14
    4
      src/onlineSelling/pages/raiseMoney/index.js

+ 2
- 2
config/dev.js View File

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'

+ 14
- 4
src/onlineSelling/pages/raiseMoney/index.js View File

5
 import Statement from '../../components/Statement'
5
 import Statement from '../../components/Statement'
6
 import ConsultantItem from '../../components/ConsultantItem/index'
6
 import ConsultantItem from '../../components/ConsultantItem/index'
7
 import ready from '@/utils/ready'
7
 import ready from '@/utils/ready'
8
+import dayjs from 'dayjs'
8
 import { connect } from '@tarojs/redux'
9
 import { connect } from '@tarojs/redux'
9
 import * as houseActions from '@/actions/house'
10
 import * as houseActions from '@/actions/house'
10
 import NextStep from './NextStep'
11
 import NextStep from './NextStep'
35
     buildingId: raise.buildingId,
36
     buildingId: raise.buildingId,
36
   }
37
   }
37
 
38
 
38
-
39
   return fetch({ url: `${apis.API_SAVE_RAISE_RECORD}`, method: 'POST', payload })
39
   return fetch({ url: `${apis.API_SAVE_RAISE_RECORD}`, method: 'POST', payload })
40
 }
40
 }
41
 
41
 
102
 
102
 
103
       this.setState({ raiseProfile: res, payType, record: res.record || defaultRecord })
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
       if (!house.consultantList || !house.consultantList.length) {
116
       if (!house.consultantList || !house.consultantList.length) {
107
         this.props.dispatchGetConsultants({
117
         this.props.dispatchGetConsultants({
119
       }).then((res2) => {
129
       }).then((res2) => {
120
         // 如果认筹必须预选
130
         // 如果认筹必须预选
121
         if (res.needPreselection && res2.length < 1) {
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
       return Promise.reject()
495
       return Promise.reject()
486
     }
496
     }
487
 
497
 
488
-    debugger
489
-
490
     // 校验手机号
498
     // 校验手机号
491
     if (isEmpty(record.tel) || record.tel.length < 11) {
499
     if (isEmpty(record.tel) || record.tel.length < 11) {
492
       Taro.showToast({
500
       Taro.showToast({
523
         userName: consultant.name,
531
         userName: consultant.name,
524
       }, raiseProfile).then((res) => {
532
       }, raiseProfile).then((res) => {
525
         resolve(res)
533
         resolve(res)
534
+      }).catch((err) => {
535
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: err.message || err } }) 
526
       })
536
       })
527
     })
537
     })
528
   }
538
   }