liujq temp20230202 2 vuotta sitten
vanhempi
commit
c573f1f336
1 muutettua tiedostoa jossa 15 lisäystä ja 2 poistoa
  1. 15 2
      src/pagesQa/msg/chat.jsx

+ 15 - 2
src/pagesQa/msg/chat.jsx

@@ -181,7 +181,7 @@ class Index extends Component {
               const { qId } = that.$router.params
               if (qId && res.codeMsg === 'Success') that.sendHandle('house')
               const { eTitle, eId } = that.$router.params
-              if (eId && res.codeMsg === 'Success') that.sendHandle('text', `我刚刚浏览了楼盘:${eTitle},想咨询你一下`)
+              if (eId && res.codeMsg === 'Success') that.sendHandle('estate', `我刚刚浏览了楼盘:${eTitle},想咨询你一下`)
               setTimeout(() => {
                 that.setState({
                   viewId: `item${msgSocketList.length - 1}`
@@ -322,7 +322,7 @@ class Index extends Component {
     const { chatUserObj, uObj } = this.state
     const curItems = msgSocketList.map((item, index) => {
       let tObj = {}
-      if (item.type === 'house') tObj = JSON.parse(item.msg)
+      if (item.type === 'house' || item.type === 'estate') tObj = JSON.parse(item.msg)
       return (
         <View className="sl-item" key={index} id={`item${index}`}>
           {
@@ -340,6 +340,12 @@ class Index extends Component {
                   <View className="sl-text">你好,我想咨询一下 <Navigator url={`/pagesRoom/dtl?id=${tObj.id}`} className="v">#{tObj.name}#</Navigator></View>
                   : ''
                 }
+                {
+                  item.type === 'estate'
+                  ?
+                  <View className="sl-text">我刚刚浏览了楼盘 <Navigator url={`/pagesHouse/indexDtl?id=${tObj.id}`} className="v">#{tObj.name}#</Navigator></View>
+                  : ''
+                }
                 {
                   item.type === 'image'
                   ? 
@@ -399,6 +405,13 @@ class Index extends Component {
         id: qId,
       })
     }
+    if (type === 'estate') {
+      const { eTitle, eId } = that.$router.params
+      msg = JSON.stringify({
+        name: eTitle,
+        id: eId,
+      })
+    }
     if (curMsg && type === 'image') msg = curMsg
     if (typeof(curMsg) === 'string' && type === 'text') msg = curMsg
     if (msg) {