xujing 5 years ago
parent
commit
c3ac42ae99

+ 40
- 11
src/onlineSelling/pages/raiseMoney/index.js View File

16
 import { checkIDCard, isEmpty } from '@/utils/tools'
16
 import { checkIDCard, isEmpty } from '@/utils/tools'
17
 import ContactConsultant from '../../components/ContactConsultant'
17
 import ContactConsultant from '../../components/ContactConsultant'
18
 import RadioList from './RadioList'
18
 import RadioList from './RadioList'
19
+import * as noticeType from '@/constants/common.js'
19
 
20
 
20
 const getRaiseProfile = ({ salesBatchId, raiseRecordId, personId }) => {
21
 const getRaiseProfile = ({ salesBatchId, raiseRecordId, personId }) => {
21
   const queryString = [
22
   const queryString = [
104
 
105
 
105
       // 销售批次已被取消发布
106
       // 销售批次已被取消发布
106
       if (res.status != 1) {
107
       if (res.status != 1) {
107
-        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '销售批次已被取消发布' } })  
108
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '销售批次已被取消发布' } })
108
       }
109
       }
109
 
110
 
110
       // 不在认筹时间内
111
       // 不在认筹时间内
111
       if (!dayjs().isBefore(res.raiseEndTime) || !dayjs().isAfter(res.raiseStartTime)) {
112
       if (!dayjs().isBefore(res.raiseEndTime) || !dayjs().isAfter(res.raiseStartTime)) {
112
-        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '不在认筹时间内' } })  
113
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: '不在认筹时间内' } })
113
       }
114
       }
114
 
115
 
115
       // 请求置业顾问列表
116
       // 请求置业顾问列表
140
     return new Promise((resolve, reject) => {
141
     return new Promise((resolve, reject) => {
141
       queryPreselectionRecord(params).then((res) => {
142
       queryPreselectionRecord(params).then((res) => {
142
         this.setState({ preselectList: res.records })
143
         this.setState({ preselectList: res.records })
143
-        resolve(res.records)        
144
+        resolve(res.records)
144
       }).catch(() => {
145
       }).catch(() => {
145
         resolve([])
146
         resolve([])
146
         // reject()
147
         // reject()
228
               {
229
               {
229
                 !raiseProfile.needPreselection &&
230
                 !raiseProfile.needPreselection &&
230
                 (<View className="addhouse">从 <Text style="color:#F3B82E" onClick={this.gotoHouseSelect.bind(this, 'all')}>房源列表</Text> 中添加其他房源</View>)
231
                 (<View className="addhouse">从 <Text style="color:#F3B82E" onClick={this.gotoHouseSelect.bind(this, 'all')}>房源列表</Text> 中添加其他房源</View>)
231
-              }              
232
+              }
232
               <View className="addhouse">从 <Text style="color:#BB9C79" onClick={this.gotoHouseSelect.bind(this, 'select')}>预选记录</Text> 中添加其他房源</View>
233
               <View className="addhouse">从 <Text style="color:#BB9C79" onClick={this.gotoHouseSelect.bind(this, 'select')}>预选记录</Text> 中添加其他房源</View>
233
             </Block>
234
             </Block>
234
           )
235
           )
555
         this.setState({ record: res })
556
         this.setState({ record: res })
556
         resolve(res)
557
         resolve(res)
557
       }).catch((err) => {
558
       }).catch((err) => {
558
-        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: err.message || err } }) 
559
+        this.setState({ current: 4, failInfo: { title: '认筹失败', desc: err.message || err } })
559
       })
560
       })
560
     })
561
     })
561
   }
562
   }
607
 
608
 
608
   }
609
   }
609
   toRaiseProfile(id) {
610
   toRaiseProfile(id) {
610
-    Taro.navigateTo({
611
-      url: `/onlineSelling/pages/raiseProfile/index?id=${id}`
611
+    const { userInfo: { miniApp: { tpls } } } = this.props
612
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
613
+
614
+    wx.requestSubscribeMessage({
615
+      tmplIds: [tplId],
616
+      success(res) {
617
+      },
618
+      fail(res) {
619
+
620
+      },
621
+      complete() {
622
+        Taro.navigateTo({
623
+          url: `/onlineSelling/pages/raiseProfile/index?id=${id}`
624
+        })
625
+      }
612
     })
626
     })
627
+
613
   }
628
   }
614
   renderResult() {
629
   renderResult() {
615
     const { raiseProfile = {}, record = {}, failInfo } = this.state
630
     const { raiseProfile = {}, record = {}, failInfo } = this.state
641
         {
656
         {
642
           record.raiseRecordId &&
657
           record.raiseRecordId &&
643
           (<View className="look-btn" onClick={() => this.toRaiseProfile(record.raiseRecordId)}>查看认筹单</View>)
658
           (<View className="look-btn" onClick={() => this.toRaiseProfile(record.raiseRecordId)}>查看认筹单</View>)
644
-        }        
659
+        }
645
       </View>
660
       </View>
646
 
661
 
647
     );
662
     );
661
       // 认筹确认
676
       // 认筹确认
662
       case 2:
677
       case 2:
663
         this.makeRaiseRecord().then((res) => {
678
         this.makeRaiseRecord().then((res) => {
664
-          console.log(res, "res")
665
-          this.setState({
666
-            current: current + 1
679
+          const { userInfo: { miniApp: { tpls } } } = this.props
680
+          const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
681
+
682
+          wx.requestSubscribeMessage({
683
+            tmplIds: [tplId],
684
+            success(res) {
685
+            },
686
+            fail(res) {
687
+
688
+            },
689
+            complete() {
690
+              this.setState({
691
+                current: current + 1
692
+              })
693
+            }
667
           })
694
           })
668
         })
695
         })
669
         return;
696
         return;
670
 
697
 
698
+
699
+
671
       // 缴费
700
       // 缴费
672
       case 3:
701
       case 3:
673
         this.makePay().then(() => {
702
         this.makePay().then(() => {

+ 1
- 1
src/onlineSelling/pages/raiseProfile/index.js View File

101
     console.log(this.props, "this.propsthis.propsthis.props")
101
     console.log(this.props, "this.propsthis.propsthis.props")
102
     const { raiseDeatil: { raiseRecordId } } = this.state
102
     const { raiseDeatil: { raiseRecordId } } = this.state
103
     const { user: { userInfo: { miniApp: { tpls } } } } = this.props
103
     const { user: { userInfo: { miniApp: { tpls } } } } = this.props
104
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
104
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
105
 
105
 
106
     wx.requestSubscribeMessage({
106
     wx.requestSubscribeMessage({
107
       tmplIds: [tplId],
107
       tmplIds: [tplId],

+ 1
- 1
src/onlineSelling/pages/records/index.js View File

196
   }
196
   }
197
   toRaiseProfile(id) {
197
   toRaiseProfile(id) {
198
     const { userInfo: { miniApp: { tpls } } } = this.props
198
     const { userInfo: { miniApp: { tpls } } } = this.props
199
-    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true)[0] || {}).tplId
199
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_HOUSE && x.isSubscribe == true)[0] || {}).tplId
200
 
200
 
201
     wx.requestSubscribeMessage({
201
     wx.requestSubscribeMessage({
202
       tmplIds: [tplId],
202
       tmplIds: [tplId],