xujing vor 5 Jahren
Ursprung
Commit
7bf5879eb4

+ 14
- 1
src/onlineSelling/pages/protocol/index.js Datei anzeigen

@@ -3,6 +3,8 @@ import { View, RichText } from '@tarojs/components'
3 3
 import Statement from '../../components/Statement'
4 4
 import ContactConsultant from '../../components/ContactConsultant'
5 5
 import { connect } from '@tarojs/redux'
6
+import { queryRaiseDetail } from '@/services/project'
7
+import dayjs from 'dayjs'
6 8
 
7 9
 import './index.scss'
8 10
 
@@ -13,17 +15,28 @@ export default class Protocol extends Component {
13 15
   }
14 16
 
15 17
   state = {
18
+    raiseDeatil: {}
19
+  }
20
+  componentWillMount() {
21
+    const { id: raiseRecordId } = this.$router.params
22
+    queryRaiseDetail(raiseRecordId).then(res => {
23
+      this.setState({
24
+        raiseDeatil: res.taRaiseRecord || {},
16 25
 
26
+      })
27
+    })
17 28
   }
18 29
 
19 30
   render() {
20 31
     const { buildingId } = this.$router.params
21 32
     const { house } = this.props
33
+    const { raiseDeatil } = this.state
34
+    const payProtocol = house.onlineProtocol.replace('${name}', raiseDeatil.name || '').replace('${idcard}', raiseDeatil.idcard || '').replace('${phone}', raiseDeatil.tel || '').replace('${date}', dayjs(raiseDeatil.createDate).format('YYYY/MM/DD') || '') || ''
22 35
 
23 36
     return (
24 37
       <View className="protocal-box">
25 38
         <View className="content">
26
-          <RichText nodes={house.onlineProtocol} />
39
+          <RichText nodes={payProtocol} />
27 40
         </View>
28 41
         <View className="contact">
29 42
           <ContactConsultant text="如有问题,请联系置业顾问" buildingId={buildingId} />

+ 2
- 1
src/onlineSelling/pages/raiseMoney/index.js Datei anzeigen

@@ -254,13 +254,14 @@ export default class raiseMoney extends Component {
254 254
   }
255 255
   renderAgreement() {
256 256
     const { raiseProfile = {} } = this.state
257
+    const payProtocol = raiseProfile.payProtocol.replace('${name}','').replace('${idcard}','').replace('${phone}','').replace('${date}','')
257 258
 
258 259
     return (
259 260
       <ScrollView scrollY className="container3">
260 261
         <View className="agent-box">
261 262
           <View className="center-title">【线上选房协议】</View>
262 263
           <View className="rich-text">
263
-            <RichText nodes={raiseProfile.payProtocol || ''} />
264
+            <RichText nodes={payProtocol || ''} />
264 265
           </View>
265 266
         </View>
266 267
       </ScrollView >

+ 2
- 1
src/onlineSelling/pages/raiseProfile/index.js Datei anzeigen

@@ -194,9 +194,10 @@ export default class Raise extends Component {
194 194
     const { payProtocol, buildingId } = raiseOrder || {}
195 195
 
196 196
     this.props.dispatchSetOnlineProtocol(payProtocol)
197
+    const { id: raiseRecordId } = this.$router.params
197 198
 
198 199
     Taro.navigateTo({
199
-      url: `/onlineSelling/pages/protocol/index?buildingId=${buildingId}`
200
+      url: `/onlineSelling/pages/protocol/index?buildingId=${buildingId}&id=${raiseRecordId}`
200 201
     })
201 202
   }
202 203