Browse Source

feat:更新代码

jinx 4 years ago
parent
commit
b464df6115
33 changed files with 3850 additions and 3567 deletions
  1. 5 4
      apps/RealtorEasier/apis/house.js
  2. 2 1
      apps/RealtorEasier/app.js
  3. 120 47
      apps/RealtorEasier/components/chat-input/chat-input.js
  4. 3 0
      apps/RealtorEasier/components/detail-components/detail-scroll/detail-scroll.js
  5. 13 6
      apps/RealtorEasier/components/detail-components/detail-scroll/detail-scroll.wxml
  6. 1 0
      apps/RealtorEasier/components/detail-components/detail-scroll/detail-scroll.wxss
  7. 2 0
      apps/RealtorEasier/libs/im-sdk/interface/i-im-handler.js
  8. 2 0
      apps/RealtorEasier/libs/im-sdk/sdk/web-socket-handler-imp.js
  9. 1 0
      apps/RealtorEasier/libs/interface/i-im-handler.js
  10. 1 1
      apps/RealtorEasier/modules/chat-page/word.wxml
  11. 1 2
      apps/RealtorEasier/pages/chat/chat.json
  12. 1 1
      apps/RealtorEasier/pages/chat/chat.wxml
  13. 3 2
      apps/RealtorEasier/pages/chat/im-operator.js
  14. 1 0
      apps/RealtorEasier/pages/chat/msg-manager.js
  15. 47 25
      apps/RealtorEasier/pages/chat/msg-type/vrcard-manager.js
  16. 2814 2817
      apps/RealtorEasier/pages/city/json/cities.js
  17. 515 516
      apps/RealtorEasier/pages/city/json/states.js
  18. 1 1
      apps/RealtorEasier/pages/index/index.wxml
  19. 24 8
      apps/RealtorEasier/pages/index/index.wxss
  20. 84 43
      apps/RealtorEasier/pages/web/web.js
  21. 1 0
      apps/RealtorEasier/utils/imSend.js
  22. 1 1
      apps/RealtorEasier/utils/socket-handle.js
  23. 1 1
      apps/agent/apis/agent.js
  24. 125 45
      apps/agent/components/chat-input/chat-input.js
  25. 12 5
      apps/agent/components/detail-components/detail-scroll/detail-scroll.wxml
  26. 1 1
      apps/agent/modules/chat-page/word.wxml
  27. 1 0
      apps/agent/pages/chat/chat.js
  28. 3 2
      apps/agent/pages/chat/im-operator.js
  29. 49 25
      apps/agent/pages/chat/msg-type/vrcard-manager.js
  30. 10 10
      apps/agent/pages/client-detail/client-detail.js
  31. 1 1
      apps/agent/pages/client-detail/client-detail.wxml
  32. 3 1
      apps/agent/pages/my/my.js
  33. 1 1
      apps/agent/pages/web/web.js

+ 5 - 4
apps/RealtorEasier/apis/house.js

@@ -50,16 +50,17 @@ export default {
     return request.post('user/house/share/add', {house_id, sale_type})
   },
   // 根据场景获取经纪人
-  getAgencyByScene (scene) {
-    return request.get('house/getAgencyId', {scene_code: scene})
+  getAgencyByScene (scene,house_id) {
+    return request.get('house/getAgencyId', {scene_code: scene,house_id:house_id})
   },
   
   getRecommendHouse ({ page_num=1, page_size=10}) {
     return request.get('house/recommend', { page_num, page_size })
   },
 
-  getHouseByScene (scene) {
-    return request.get('house/getByScene', {scene_code: scene})
+  getHouseByScene (house_id) {
+    // return request.get('house/getByScene', {scene_code: scene})
+    return request.get('house/getByScene', {house_id: house_id})
   },
 
   /* 向openApi发送数据

+ 2 - 1
apps/RealtorEasier/app.js

@@ -171,7 +171,8 @@ App({
     // city: '定位中...', // 默认进入首页的地址
     // city: '洛杉矶', // 默认进入首页的地址
     // city: '洛杉矶', // 默认进入首页的地址
-    city: 'Los Angeles',
+    // city: 'Los Angeles',
+    city: 'Los Angeles',
     // city: 'test',
     // 默认进入首页的地址
     // cityId: '3392', // 默认进入首页的地址

+ 120 - 47
apps/RealtorEasier/components/chat-input/chat-input.js

@@ -1,16 +1,20 @@
-const MIN_VOICE_TIME = 1, MAX_VOICE_TIME = 60, START_TIME_DOWN = 54, status = {
-    START: 1,
-    SUCCESS: 2,
-    CANCEL: 3,
-    SHORT: 4,
-    FAIL: 5,
-    UNAUTH: 6
-}, EVENT = {
-    EXTRA_CLICK: 'extraClickEvent',
-    EXTRA_ITEM_CLICK: 'extraItemClickEvent',
-    VOICE_RECORD: 'voiceRecordEvent',
-    SEND_MESSAGE: 'sendMessageEvent'
-};
+const MIN_VOICE_TIME = 1,
+    MAX_VOICE_TIME = 60,
+    START_TIME_DOWN = 54,
+    status = {
+        START: 1,
+        SUCCESS: 2,
+        CANCEL: 3,
+        SHORT: 4,
+        FAIL: 5,
+        UNAUTH: 6
+    },
+    EVENT = {
+        EXTRA_CLICK: 'extraClickEvent',
+        EXTRA_ITEM_CLICK: 'extraItemClickEvent',
+        VOICE_RECORD: 'voiceRecordEvent',
+        SEND_MESSAGE: 'sendMessageEvent'
+    };
 Component({
     properties: {
         minVoiceTime: {
@@ -46,7 +50,9 @@ Component({
         timer: -1,
         singleVoiceTimeCount: 0,
         textMessage: '',
-        voiceObj: {moveToCancel: false},
+        voiceObj: {
+            moveToCancel: false
+        },
         extraObj: {
             chatInputShowExtra: false,
             chatInputExtraArr: []
@@ -66,9 +72,11 @@ Component({
         }
     },
     methods: {
-       
+
         getRecordStatus() {
-            return {...status};
+            return {
+                ...status
+            };
         },
         closeExtraView() {
             this.setData({
@@ -80,7 +88,9 @@ Component({
             this.setData({
                 'extraObj.chatInputShowExtra': isShow
             }, () => {
-                this.triggerEvent(EVENT.EXTRA_CLICK, {isShow}, {});
+                this.triggerEvent(EVENT.EXTRA_CLICK, {
+                    isShow
+                }, {});
             });
         },
         _change$input$way$event() {
@@ -89,23 +99,37 @@ Component({
                 'extraObj.chatInputShowExtra': false
             });
         },
-        _triggerVoiceRecordEvent({status, dataset}) {
-            this.triggerEvent(EVENT.VOICE_RECORD, {recordStatus: status, ...dataset}, {});
+        _triggerVoiceRecordEvent({
+            status,
+            dataset
+        }) {
+            this.triggerEvent(EVENT.VOICE_RECORD, {
+                recordStatus: status,
+                ...dataset
+            }, {});
         },
         _long$click$voice$btn(e) {
-            if ('send$voice$btn' === e.currentTarget.id) {//长按时需要打开录音功能,开始录音
+            if ('send$voice$btn' === e.currentTarget.id) { //长按时需要打开录音功能,开始录音
                 this._checkRecordAuth(() => {
-                    const {maxVoiceTime, singleVoiceTimeCount} = this.data;
-                    this.setData({//调出取消弹窗
+                    const {
+                        maxVoiceTime,
+                        singleVoiceTimeCount
+                    } = this.data;
+                    this.setData({ //调出取消弹窗
                         'voiceObj.showCancelSendVoicePart': true,
                         'voiceObj.timeDownNum': maxVoiceTime - singleVoiceTimeCount,
                         'voiceObj.status': 'start',
                         'voiceObj.startStatus': 1,
                         'voiceObj.moveToCancel': false
                     }, () => {
-                        this._triggerVoiceRecordEvent({status: status.START});
+                        this._triggerVoiceRecordEvent({
+                            status: status.START
+                        });
+                    });
+                    this.recorderManager.start({
+                        duration: 60000,
+                        format: this.data.format
                     });
-                    this.recorderManager.start({duration: 60000, format: this.data.format});
                 }, (res) => {
                     //录音失败
                     console.error('录音拒绝授权');
@@ -115,7 +139,9 @@ Component({
                         'voiceObj.status': 'end',
                         'voiceObj.showCancelSendVoicePart': false
                     });
-                    this._triggerVoiceRecordEvent({status: status.UNAUTH});
+                    this._triggerVoiceRecordEvent({
+                        status: status.UNAUTH
+                    });
 
                     wx.showModal({
                         title: '您未授权语音功能',
@@ -146,7 +172,10 @@ Component({
         _dealVoiceLongClickEventWithHighVersion() {
             this.recorderManager.onStart(() => {
                 this.data.singleVoiceTimeCount = 0;
-                const {_startTimeDown, maxVoiceTime} = this.data;
+                const {
+                    _startTimeDown,
+                    maxVoiceTime
+                } = this.data;
                 //设置定时器计时60秒
                 this.data.timer = setInterval(() => {
                     const voiceTimeCount = ++this.data.singleVoiceTimeCount;
@@ -169,7 +198,12 @@ Component({
         _send$voice$move$event(e) {
             if ('send$voice$btn' === e.currentTarget.id) {
                 console.log(this.data)
-                const {windowHeight, voiceObj, tabBarHeight, cancelLineYPosition} = this.data,
+                const {
+                    windowHeight,
+                    voiceObj,
+                    tabBarHeight,
+                    cancelLineYPosition
+                } = this.data,
                     y = windowHeight + tabBarHeight - e.touches[0].clientY;
                 if (y > cancelLineYPosition) {
                     if (!voiceObj.moveToCancel) {
@@ -178,7 +212,7 @@ Component({
                         });
                     }
                 } else {
-                    if (voiceObj.moveToCancel) {//如果移出了该区域
+                    if (voiceObj.moveToCancel) { //如果移出了该区域
                         this.setData({
                             'voiceObj.moveToCancel': false
                         })
@@ -189,13 +223,17 @@ Component({
         },
         _send$voice$move$end$event(e) {
             if ('send$voice$btn' === e.currentTarget.id) {
-                const {singleVoiceTimeCount, minVoiceTime, timer} = this.data;
-                if (singleVoiceTimeCount < minVoiceTime) {//语音时间太短
+                const {
+                    singleVoiceTimeCount,
+                    minVoiceTime,
+                    timer
+                } = this.data;
+                if (singleVoiceTimeCount < minVoiceTime) { //语音时间太短
                     this.setData({
                         'voiceObj.status': 'short'
                     });
                     this._delayDismissCancelView();
-                } else {//语音时间正常
+                } else { //语音时间正常
                     this.setData({
                         'voiceObj.showCancelSendVoicePart': false,
                         'voiceObj.status': 'end'
@@ -206,7 +244,10 @@ Component({
             }
         },
         _initVoiceData() {
-            const {windowWidth, windowHeight} = this.data, width = windowWidth / 2.6;
+            const {
+                windowWidth,
+                windowHeight
+            } = this.data, width = windowWidth / 2.6;
             this.setData({
                 'inputStatus': 'text',
                 'windowHeight': windowHeight,
@@ -246,7 +287,9 @@ Component({
             this.setData({
                 textMessage: ''
             }, () => {
-                this.triggerEvent(EVENT.SEND_MESSAGE, {value: e.detail.value});
+                this.triggerEvent(EVENT.SEND_MESSAGE, {
+                    value: e.detail.value
+                });
                 this.data.inputValueEventTemp = '';
             });
         },
@@ -268,39 +311,65 @@ Component({
             }, () => {
 
                 if (!!this.data.inputValueEventTemp) {
-                    this.triggerEvent(EVENT.SEND_MESSAGE, {value: this.data.inputValueEventTemp});
-                    this.data.inputValueEventTemp = '';
+                    this.triggerEvent(EVENT.SEND_MESSAGE, {
+                        value: this.data.inputValueEventTemp
+                    });
+                    this.setData({
+                        inputValueEventTemp: '',
+                        textMessage: '',
+                    })
+                    // this.data.inputValueEventTemp = '';
                 }
             });
         },
         _chatInput$getValue$event(e) {
-            const {detail: {value: textMessage}} = e;
+            const {
+                detail: {
+                    value: textMessage
+                }
+            } = e;
             this.data.inputValueEventTemp = textMessage;
             this.setData({
                 textMessage
             })
         },
         _chatInput$extra$item$click$event(e) {
-            const {currentTarget: {dataset}} = e;
-            
-            this.triggerEvent(EVENT.EXTRA_ITEM_CLICK, {...dataset}, {});
+            const {
+                currentTarget: {
+                    dataset
+                }
+            } = e;
+
+            this.triggerEvent(EVENT.EXTRA_ITEM_CLICK, {
+                ...dataset
+            }, {});
         },
 
         _setVoiceListener() {
             this.recorderManager.onStop((res) => {
                 console.log(res, this.data.voiceObj.status);
-                if (this.data.voiceObj.status === 'short') {//录音时间太短或者移动到了取消录音区域, 则取消录音
-                    this._triggerVoiceRecordEvent({status: status.SHORT});
+                if (this.data.voiceObj.status === 'short') { //录音时间太短或者移动到了取消录音区域, 则取消录音
+                    this._triggerVoiceRecordEvent({
+                        status: status.SHORT
+                    });
                     return;
                 } else if (this.data.voiceObj.moveToCancel) {
-                    this._triggerVoiceRecordEvent({status: status.CANCEL});
+                    this._triggerVoiceRecordEvent({
+                        status: status.CANCEL
+                    });
                     return;
                 }
                 console.log('录音成功');
-                this._triggerVoiceRecordEvent({status: status.SUCCESS, dataset: res});
+                this._triggerVoiceRecordEvent({
+                    status: status.SUCCESS,
+                    dataset: res
+                });
             });
             this.recorderManager.onError((res) => {
-                this._triggerVoiceRecordEvent({status: status.FAIL, dataset: res});
+                this._triggerVoiceRecordEvent({
+                    status: status.FAIL,
+                    dataset: res
+                });
             });
         },
 
@@ -313,7 +382,8 @@ Component({
                             success: (res) => {
                                 // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                                 console.log('同意', res);
-                            }, fail: res => {
+                            },
+                            fail: res => {
                                 console.log('拒绝', res);
                                 cbError && cbError();
                             }
@@ -328,7 +398,10 @@ Component({
     lifetimes: {
         created() {
             this.recorderManager = wx.getRecorderManager();
-            const {windowHeight, windowWidth} = wx.getSystemInfoSync();
+            const {
+                windowHeight,
+                windowWidth
+            } = wx.getSystemInfoSync();
             if (!windowHeight || !windowWidth) {
                 console.error('没有获取到手机的屏幕尺寸:windowWidth', windowWidth, 'windowHeight', windowHeight);
                 return;
@@ -356,4 +429,4 @@ Component({
 //     setTextMessageListener: setTextMessageListener,
 //     setExtraButtonClickListener: setExtraButtonClickListener,
 //     VRStatus: status
-// };
+// };

+ 3 - 0
apps/RealtorEasier/components/detail-components/detail-scroll/detail-scroll.js

@@ -318,6 +318,7 @@ Component({
     },
     // 发送房屋卡片
     sendVrMsg(room_id, is_vr_invite) {
+     
       const {
         house
       } = this.data
@@ -348,6 +349,8 @@ Component({
       content,
       msgType
     }) {
+     
+      console.log(this.properties.agent_user.agency_user_id)
       let defaultContent = {
         fromId: app.globalData.userinfo.user_id,
         fromName: app.globalData.userinfo.phone,

+ 13 - 6
apps/RealtorEasier/components/detail-components/detail-scroll/detail-scroll.wxml

@@ -1,6 +1,7 @@
 <detail-banner imglist="{{house.detail_images}}" vrLink="{{house.vrLink}}" bind:onlineWatch="onlineWatch"
     bind:toVrHouse="toVrHouse" />
-<scroll-view class="contanerbox" scroll-y="true" wx:if="{{house.house_id}}">
+<!-- <scroll-view class="contanerbox" scroll-y="true" wx:if="{{house.house_id}}"> -->
+<view class="contanerbox" wx:if="{{house.house_id}}">
     <view class="house-info padding-container">
         <view class="tab-list">
             <view class="tab-item" wx:for="{{house.tags}}" wx:key="index">{{ item }}</view>
@@ -74,7 +75,13 @@
             <view class="location-item">
                 <text class="location-label">位置:</text>
                 <!-- <text class="location-value">{{ house.city + house.estate_name }}</text> -->
-                <text class="location-value">{{house.address + ' ' +house.city   }}</text>
+                <!-- <text class="location-value">{{house.address + ' ' +house.city   }}</text> -->
+                <text class="location-value">
+                    <text>{{house.address}}</text><text wx:if="{{house.city}}"> ,</text>
+                    <text>{{house.city}}</text><text wx:if="{{house.province}}"> ,</text>
+                    <text>{{house.province}}</text><text wx:if="{{house.postcode}}"> ,</text>
+                    <text>{{house.postcode}}</text>
+                </text>
             </view>
             <view class="location-item" wx:if="{{!isAgency}}">
                 <text class="location-label">学校信息:</text>
@@ -130,8 +137,8 @@
         </view>
     </view>
 
-  <!-- 免责声明 -->
-  <view class=" padding-container" wx:if="{{house.ancillaryFacility.length>0}}">
+    <!-- 免责声明 -->
+    <view class=" padding-container">
         <view class="location-text-info border-btn">
             <view class="detail-title m-t-32">免责声明
             </view>
@@ -140,10 +147,10 @@
             </view>
         </view>
     </view>
-    <view class="padding-container">
+    <view class="padding-container" wx:if="{{recommendList.length>0}}">
         <view class="detail-title m-t-32">推荐房源({{recommendList.length}})</view>
         <view class="house-list">
             <house-item wx:for="{{recommendList}}" wx:key="id" house="{{item}}" />
         </view>
     </view>
-</scroll-view>
+</view>

+ 1 - 0
apps/RealtorEasier/components/detail-components/detail-scroll/detail-scroll.wxss

@@ -185,6 +185,7 @@
 .location-label {
   color: #A3A4A5;
 }
+
 .location-link {
   color: #1FE4DC;
 }

+ 2 - 0
apps/RealtorEasier/libs/im-sdk/interface/i-im-handler.js

@@ -29,8 +29,10 @@ export default class IIMHandler {
         
         return new Promise((resolve, reject) => {
             if (this._isLogin) {
+               
                 return this._sendMsgImp({content, success: resolve, fail: reject});
             } else {
+              
                 this._msgQueue.push({content, resolve, reject});
             }
         });

+ 2 - 0
apps/RealtorEasier/libs/im-sdk/sdk/web-socket-handler-imp.js

@@ -25,6 +25,7 @@ export default class WebSocketHandlerImp extends IIMHandler {
      * @param options 建立连接时需要的配置信息,这里是传入的url,即你的服务端地址,端口号不是必需的。
      */
     createConnection({options = this.options}) {
+        console.log( options.url)
         this._socket = wx.connectSocket({
             url: options.url,
             header: {
@@ -63,6 +64,7 @@ export default class WebSocketHandlerImp extends IIMHandler {
         console.log('重新连接')
     }
     _sendMsgImp({content, success, fail}) {
+       
         console.log(content, 'content')
         this._socket.send({
             data: JSON.stringify(content),

+ 1 - 0
apps/RealtorEasier/libs/interface/i-im-handler.js

@@ -29,6 +29,7 @@ export default class IIMHandler {
         
         return new Promise((resolve, reject) => {
             if (this._isLogin) {
+               
                 return this._sendMsgImp({content, success: resolve, fail: reject});
             } else {
                 this._msgQueue.push({content, resolve, reject});

+ 1 - 1
apps/RealtorEasier/modules/chat-page/word.wxml

@@ -33,7 +33,7 @@
         </block>
         <!-- vr带房卡片 -->
         <block wx:if="{{msgType==='vr'}}">
-            <view class="chat-item-vr" bindtap="vrCardClickEvent"  data-vrLink="{{vr_link}}" data-house="{{house_id}}">
+            <view class="chat-item-vr" bindtap="vrCardClickEvent" data-enable="{{enable}}"  data-vrLink="{{vr_link}}" data-house="{{house_id}}">
                 <image  src="{{image_url}}" mode="aspectFill" />
                 <view class="vr-intro">
                     <view class="chat-item-name">{{ house_name }}</view>

+ 1 - 2
apps/RealtorEasier/pages/chat/chat.json

@@ -3,6 +3,5 @@
     "chat-input": "../../components/chat-input/chat-input",
     "home-header-nav": "/components/home-header-nav/home-header-nav"
   },
-  "navigationBarTitleText": "会话页面",
-  "navigationStyle": "custom"
+  "navigationBarTitleText": "会话页面"
 }

+ 1 - 1
apps/RealtorEasier/pages/chat/chat.wxml

@@ -6,7 +6,7 @@
         scroll-y="true"
         scroll-top="{{scrollTopVal}}"
         bindtap="resetInputStatus">
-<home-header-nav titleText="{{toName}}" showLeft="{{true}}"></home-header-nav>
+<!-- <home-header-nav titleText="{{toName}}" showLeft="{{true}}"></home-header-nav> -->
 
     <block wx:for="{{chatItems}}" wx:key="{{id}}">
         <template is="chat-item"

+ 3 - 2
apps/RealtorEasier/pages/chat/im-operator.js

@@ -75,7 +75,7 @@ export default class IMOperator {
         };
     }
 
-    createNormalChatItem({type = IMOperator.TextType, content = '', isMy = true, duration, msgType, sendTime=fotmatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')} = {}) {
+    createNormalChatItem({type = IMOperator.TextType, content = '', isMy = true, enable,duration, msgType, sendTime=fotmatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')} = {}) {
         if (!content) return;
         const currentTimestamp = Date.now();
         const time = dealChatTime(sendTime, this._latestTImestamp);
@@ -93,7 +93,8 @@ export default class IMOperator {
             isPlaying: false,//语音是否正在播放,
             msgType,
             toId: arguments[0].toId,
-            fromId: arguments[0].fromId
+            fromId: arguments[0].fromId,
+            enable
         };
         if (type !== IMOperator.TextType) {
             obj.saveKey = content;//saveKey是存储文件时的key

+ 1 - 0
apps/RealtorEasier/pages/chat/msg-manager.js

@@ -7,6 +7,7 @@ export default class MsgManager extends MsgTypeManager {
     }
 
     showMsg({msg}) {
+        
         this.getMsgManager({type: msg.msgType}).showMsg({msg});
     }
 

+ 47 - 25
apps/RealtorEasier/pages/chat/msg-type/vrcard-manager.js

@@ -1,34 +1,56 @@
 export default class VrCardManager {
-    constructor(page) {
-        this._page = page
-        this._page.vrCardClickEvent = function (e) {
-          const { vrlink, house } = e.currentTarget.dataset
-          if (vrlink) {
-            wx.navigateTo({
-              url: `/pages/web/web?house_id=${house}&vr_link=${vrlink}&is_auto=1`,
-            })
-          } else {
-            wx.navigateTo({
-              url: `/pages/detail/detail?house_id=${house}`,
-            })
-          }
-          
+  constructor(page) {
+    this._page = page
+    this._page.vrCardClickEvent = function (e) {
+      const {
+        vrlink,
+        house,
+        enable
+      } = e.currentTarget.dataset
+      if (enable == 0) {
+        wx.showToast({
+          title: '该房源已删除',
+          icon: 'none',
+        })
+        return
+      } else {
+        if (vrlink) {
+          wx.navigateTo({
+            url: `/pages/web/web?house_id=${house}&vr_link=${vrlink}&is_auto=1`,
+          })
+        } else {
+          wx.navigateTo({
+            url: `/pages/detail/detail?house_id=${house}`,
+          })
         }
+      }
+
     }
+  }
 
-    async sendOneMsg({content, type}) {
-      const { itemIndex } = await this._page.UI.showItemForMoment(this._page.imOperator.createNormalChatItem({
-          type,
-          content
-      }));
-     await this._page.sendMsg({
-          content: this._page.imOperator.createChatItemContent({type, content}),
-          itemIndex
-      });
+  async sendOneMsg({
+    content,
+    type
+  }) {
+    const {
+      itemIndex
+    } = await this._page.UI.showItemForMoment(this._page.imOperator.createNormalChatItem({
+      type,
+      content
+    }));
+    await this._page.sendMsg({
+      content: this._page.imOperator.createChatItemContent({
+        type,
+        content
+      }),
+      itemIndex
+    });
   }
-  showMsg({msg}) {
+  showMsg({
+    msg
+  }) {
     //UI类是用于管理UI展示的类。
     msg = Object.assign(msg, JSON.parse(msg.content))
     this._page.UI.updateViewWhenReceive(msg);
-}
+  }
 }

File diff suppressed because it is too large
+ 2814 - 2817
apps/RealtorEasier/pages/city/json/cities.js


File diff suppressed because it is too large
+ 515 - 516
apps/RealtorEasier/pages/city/json/states.js


+ 1 - 1
apps/RealtorEasier/pages/index/index.wxml

@@ -3,7 +3,7 @@
 
     <view class="search-w-left">
         <text class="cuIcon-search"></text>
-        <input class="search-input" type="text" bindinput="searchHouse"   placeholder="请输入地区街道/房产名称" bindconfirm="bindconfirm"
+        <input class="search-input" type="text" bindinput="searchHouse"   placeholder="地区街道/房产名称" bindconfirm="bindconfirm"
                confirm-type="search" />
     </view>
     <view class="action" bindtap="CitySelect">

+ 24 - 8
apps/RealtorEasier/pages/index/index.wxss

@@ -9,21 +9,25 @@
   line-height: 80rpx;
   /* margin-bottom: 66rpx; */
 }
+
 .search-w-left {
   display: flex;
   flex: 1;
 }
+
 .search-w-left .cuIcon-search {
   width: 54rpx;
   text-align: right;
   margin-right: 12rpx;
 }
+
 .search-input {
   height: 80rpx;
   line-height: 80rpx;
   flex: 1;
   position: relative;
 }
+
 .search-input::after {
   content: '';
   display: block;
@@ -34,11 +38,13 @@
   right: 0;
   top: 22rpx;
 }
+
 .action {
-  padding: 0 36rpx 0 34rpx;
+  padding: 0 10rpx 0 10rpx;
   display: flex;
   align-items: center;
-  max-width: 230rpx;
+  /* max-width: 230rpx; */
+  max-width: 320rpx;
   min-width: 158rpx;
   display: flex;
   align-items: center;
@@ -49,6 +55,7 @@
   height: 30rpx;
   margin-right: 10rpx;
 }
+
 .action view {
   /* display:-webkit-box;
   -webkit-box-orient:vertical;
@@ -57,12 +64,15 @@
   overflow: hidden;
   word-break: break-all;
   flex: 1; */
-  max-width: 150rpx;
-  white-space:nowrap;
+  /* max-width: 150rpx; */
+  /* max-width: 120rpx; */
+  max-width: 310rpx;
+  white-space: nowrap;
   overflow: hidden;
   text-overflow: ellipsis;
 }
-.icon-list{
+
+.icon-list {
   display: flex;
   box-sizing: border-box;
   flex-direction: row;
@@ -71,10 +81,11 @@
   width: 100%;
   margin: 0 0 8px;
   align-items: flex-end;
-  box-shadow:0px 8px 8px #F5F5F5;
+  box-shadow: 0px 8px 8px #F5F5F5;
   padding: 0 40rpx 20rpx;
 }
-.icon-list image{
+
+.icon-list image {
   width: 60rpx;
   height: 60rpx;
   border-radius: 50%;
@@ -82,7 +93,8 @@
   align-self: center;
   box-sizing: border-box;
 }
-.icon-item{
+
+.icon-item {
   display: flex;
   flex-direction: column;
   font-size: 30rpx;
@@ -90,6 +102,7 @@
   position: relative;
   line-height: 42rpx;
 }
+
 .icon-item .line {
   width: 40rpx;
   height: 2px;
@@ -99,11 +112,13 @@
   margin-left: -20rpx;
   display: none;
 }
+
 .icon-item.is-active {
   color: #1FE4DC;
   font-size: 40rpx;
   line-height: 56rpx;
 }
+
 .icon-item.is-active .line {
   display: block;
 }
@@ -112,6 +127,7 @@
   position: fixed;
   top: 0;
 }
+
 .house-list {
   padding: 0 48rpx 0 44rpx;
   background: #fff;

+ 84 - 43
apps/RealtorEasier/pages/web/web.js

@@ -1,5 +1,7 @@
 import * as SocketHandle from '../../utils/socket-handle'
-import { getQueryString } from './../../utils/tools'
+import {
+  getQueryString
+} from './../../utils/tools'
 import HouseApi from './../../apis/house'
 import ImSend from './../../utils/imSend'
 import ImApi from './../../apis/im'
@@ -42,7 +44,10 @@ Page({
    * 生命周期函数--监听页面加载
    */
   onLoad: function (options) {
-    let { vr_link } = options
+    console.log(options)
+    let {
+      vr_link
+    } = options
     vr_link = decodeURIComponent(vr_link)
     // vr_link = vr_link.replace('https://test.4dkankan.com', 'http://127.0.0.1:8081')
     // console.log(vr_link)
@@ -55,18 +60,20 @@ Page({
     }
     this.setData({
       socketOpts: opts,
-      url: `${vr_link}&room_id=${opts.roomId}${options.is_auto? `&vr=1` : ''}`,
+      house_id: options.house_id || '',
+      
+      url: `${vr_link}&room_id=${opts.roomId}${options.is_auto? `&vr=1` : ''}&house_id=${options.house_id}`,
       // url: `http://192.168.0.77:8080/realtor-easier.html?m=t-lB3Dg4N&appname=realtor-easier&room_id=10508354bb8bbe62ad21624264392186&room_id=10508354bb8bbe62ad21624264392186&vr=1&role=customer&user_id=100269d2526bdb38c9d1623317318008`,
       room_id: opts.roomId,
-      house_id: options.house_id || '',
       vr_link: vr_link,
-      
+
     })
     console.log(this.data.url)
     this.scene = getQueryString(vr_link, 'm')
-    this.getHouseDetail(this.scene)
+    // this.getHouseDetail(this.scene)
+    this.getHouseDetail(this.data.house_id)
     this.socket = SocketHandle.initSocket(this, opts)
-    HouseApi.getAgencyByScene(this.scene).then(agency => {
+    HouseApi.getAgencyByScene(this.scene,this.data.house_id).then(agency => {
       this.agency = agency.data
     })
     this.roomId = opts.roomId
@@ -82,7 +89,7 @@ Page({
       this.code = res.code
     })
   },
-  loginSuccess () {
+  loginSuccess() {
     console.log('success')
     this.setData({
       showLogin: false
@@ -94,7 +101,7 @@ Page({
   //     url: `${this.data.url}&role=customer&user_id=${app.globalData.userinfo.user_id}${this.hasSend ? `&vr=1` : ''}`
   //   })
   // },
-  onUnload () {
+  onUnload() {
     this.socket.disconnect()
   },
   countLiveUrl(user_id) {
@@ -117,13 +124,16 @@ Page({
       this.hasSend = true
     }
   },
-  createLivePull({persons, roomId}) {
+  createLivePull({
+    persons,
+    roomId
+  }) {
     let arr = []
     persons.forEach(item => {
       arr.push(this.countLiveUrl(item.userId))
       console.log(this.countLiveUrl(item.userId))
     })
-    
+
     this.setData({
       pullUrl: arr
     })
@@ -131,28 +141,38 @@ Page({
   someoneLeave() {
     this.trtcRoomContext && this.trtcRoomContext.exitRoom()
   },
-  sendVrCard () {
-    HouseApi.getAgencyByScene(this.scene).then(agency => {
-      this.getHouseDetail(this.scene).then(house => {
+  sendVrCard() {
+    
+    HouseApi.getAgencyByScene(this.scene,this.data.house_id).then(agency => {
+      // this.getHouseDetail(this.scene).then(house => { //原来是传scene
+      this.getHouseDetail(this.data.house_id).then(house => {
         ImApi.addFriend(agency.data.agency_user_id).finally(() => {
           ImSend.sendVrMsg(this.data.house, this.data.room_id, agency.data.agency_user_id, true)
         })
       })
-      
+
     })
   },
-  getHouseDetail (scene) {
-    return HouseApi.getHouseByScene(scene).then(res => {
+  // getHouseDetail (scene) { //原来是传scene
+  getHouseDetail(house_id) {
+    // return HouseApi.getHouseByScene(scene).then(res => {
+      console.log()
+    return HouseApi.getHouseByScene(house_id).then(res => {
       let house = res.data
-      house.detail_images = JSON.parse(house.detail_images)
-      this.setData({
-        house
-      })
-      return res
+      try {
+        house.detail_images = JSON.parse(house.detail_images)
+        this.setData({
+          house
+        })
+        return res
+      } catch (err) {
+
+      }
+
     })
   },
   onShareAppMessage: function (res) {
-    var path =`/pages/web/web?house_id=${this.data.house_id}&vr_link=${encodeURIComponent(this.data.vr_link)}`;
+    var path = `/pages/web/web?house_id=${this.data.house_id}&vr_link=${encodeURIComponent(this.data.vr_link)}`;
     var arr = this.data.house.detail_images;
     var imageurl = arr[0];
     return {
@@ -160,47 +180,61 @@ Page({
       path: path,
       imageUrl: imageurl, // 分享的封面图
       success: () => {
-        
+
         // 转发成功
       },
-      fail: function(err) {
+      fail: function (err) {
         console.log(err)
         app.ShowModel('网络错误', '转发失败~');
         // 转发失败
       }
     }
   },
-  bindmessage (e) {
+  bindmessage(e) {
     const img_url = e.detail.data[0]
     getApp().globalData.shared_img = img_url
   },
-  hideLogin () {
+  hideLogin() {
     this.setData({
       showLogin: false
     })
   },
-  changeDelegetionStatus () {
+  changeDelegetionStatus() {
     this.setData({
       delegationShow: !this.data.delegationShow
     })
   },
-  bindgetphonenumber (e) {
+  bindgetphonenumber(e) {
     e.detail.wx_code = this.code
     e.detail.user_id = getApp().globalData.userinfo.user_id
     e.detail.agency_user_id = this.agency.agency_user_id
-    
+
     UserApi.delegation(e.detail).then(res => {
       console.log(res, res.code == 0, 'res')
       if (res.code == 0) {
-        this.socket.emit('getJson', { content: {action: {name: 'delegation', role: 'customer'}}})
+        this.socket.emit('getJson', {
+          content: {
+            action: {
+              name: 'delegation',
+              role: 'customer'
+            }
+          }
+        })
         this.changeDelegetionStatus()
       } else {
         wx.login().then(res => {
           this.code = res.code
           e.detail.wx_code = this.code
           UserApi.delegation(e.detail).then(res => {
-            this.socket.emit('getJson', { content: {action: {name: 'delegation', role: 'customer'}}})
-          this.changeDelegetionStatus()
+            this.socket.emit('getJson', {
+              content: {
+                action: {
+                  name: 'delegation',
+                  role: 'customer'
+                }
+              }
+            })
+            this.changeDelegetionStatus()
           })
         })
       }
@@ -209,7 +243,14 @@ Page({
         this.code = res.code
         e.detail.wx_code = this.code
         UserApi.delegation(e.detail).then(res => {
-          this.socket.emit('getJson', { content: {action: {name: 'delegation', role: 'customer'}}})
+          this.socket.emit('getJson', {
+            content: {
+              action: {
+                name: 'delegation',
+                role: 'customer'
+              }
+            }
+          })
           this.changeDelegetionStatus()
         })
       })
@@ -227,11 +268,11 @@ Page({
         userID: user.userId, // 用户 ID,可以由您的帐号系统指定
         userSig: user.sig, // 身份签名,相当于登录密码的作用
         template: 'custom', // 画面排版模式
-        debugMode:true,
+        debugMode: true,
       }
     }, () => {
       this.trtcRoomContext = this.selectComponent('#trtcroom')
-      let EVENT =this.trtcRoomContext.EVENT
+      let EVENT = this.trtcRoomContext.EVENT
       console.log(EVENT)
       if (this.trtcRoomContext) {
         this.publishLocalAudio()
@@ -244,7 +285,7 @@ Page({
         })
 
         // 监听远端用户的音频流的变更事件
-       this.trtcRoomContext.on(EVENT.REMOTE_AUDIO_ADD, (event) => {
+        this.trtcRoomContext.on(EVENT.REMOTE_AUDIO_ADD, (event) => {
           // 订阅(即播放)远端用户的音频流
           let userID = event.data.userID
           // console.log('&&&&&&&&&&&')
@@ -252,30 +293,30 @@ Page({
           // wx.showToast({
           //   title: '订阅',
           // })
-         this.trtcRoomContext.subscribeRemoteAudio({
+          this.trtcRoomContext.subscribeRemoteAudio({
             userID: userID
           })
         })
         // this.trtcRoomContext.on(EVENT.LOCAL_AUDIO_VOLUME_UPDATE, event => {
         //   console.log(event)
         // })
-       this.trtcRoomContext.enterRoom({
+        this.trtcRoomContext.enterRoom({
           roomID: this.roomId
         }).then(() => {
-        
+
           console.log('成功进入房间')
           console.log(this.roomId)
         }).catch((res) => {
-         
+
           console.error('room joinRoom 进房失败:', res)
         })
       }
     })
   },
-  unpublishLocalAudio () {
+  unpublishLocalAudio() {
     this.trtcRoomContext && this.trtcRoomContext.unpublishLocalAudio()
   },
-  publishLocalAudio () {
+  publishLocalAudio() {
     this.trtcRoomContext && this.trtcRoomContext.publishLocalAudio()
     // wx.showToast({
     //   title: '推流',

+ 1 - 0
apps/RealtorEasier/utils/imSend.js

@@ -12,6 +12,7 @@ export default {
       vr_link: is_vr_invite ? `${house.vrLink}${encodeURIComponent(`&room_id=${room_id}`)}` : '',
       house_id: house.house_id
     }
+   
     return this.sendMsg({content, msgType: 'vr', toId})
   },
   // 发送文字

+ 1 - 1
apps/RealtorEasier/utils/socket-handle.js

@@ -13,7 +13,7 @@ export function initSocket(page, options) {
     roomId: '',
     isClient: true
   }
-
+  
   io = socket_io(IM_HOST, {
     path: '/vr-node',
     query: Object.assign(defaultOpts, options)

+ 1 - 1
apps/agent/apis/agent.js

@@ -10,7 +10,7 @@ export default {
   // 客户详情
   // fetchCustomerDetail ({ agency_user_id, user_id }) {
   fetchCustomerDetail ({ id  }) {
-    return request.get('agency/customer/detail', { id })
+    return request.get('agency/customer/detailxc', { id })
   },
   // 获取客源列表
   fetchCustomers (data) {

+ 125 - 45
apps/agent/components/chat-input/chat-input.js

@@ -1,16 +1,20 @@
-const MIN_VOICE_TIME = 1, MAX_VOICE_TIME = 60, START_TIME_DOWN = 54, status = {
-    START: 1,
-    SUCCESS: 2,
-    CANCEL: 3,
-    SHORT: 4,
-    FAIL: 5,
-    UNAUTH: 6
-}, EVENT = {
-    EXTRA_CLICK: 'extraClickEvent',
-    EXTRA_ITEM_CLICK: 'extraItemClickEvent',
-    VOICE_RECORD: 'voiceRecordEvent',
-    SEND_MESSAGE: 'sendMessageEvent'
-};
+const MIN_VOICE_TIME = 1,
+    MAX_VOICE_TIME = 60,
+    START_TIME_DOWN = 54,
+    status = {
+        START: 1,
+        SUCCESS: 2,
+        CANCEL: 3,
+        SHORT: 4,
+        FAIL: 5,
+        UNAUTH: 6
+    },
+    EVENT = {
+        EXTRA_CLICK: 'extraClickEvent',
+        EXTRA_ITEM_CLICK: 'extraItemClickEvent',
+        VOICE_RECORD: 'voiceRecordEvent',
+        SEND_MESSAGE: 'sendMessageEvent'
+    };
 Component({
     properties: {
         minVoiceTime: {
@@ -46,7 +50,9 @@ Component({
         timer: -1,
         singleVoiceTimeCount: 0,
         textMessage: '',
-        voiceObj: {moveToCancel: false},
+        voiceObj: {
+            moveToCancel: false
+        },
         extraObj: {
             chatInputShowExtra: false,
             chatInputExtraArr: []
@@ -67,7 +73,9 @@ Component({
     },
     methods: {
         getRecordStatus() {
-            return {...status};
+            return {
+                ...status
+            };
         },
         closeExtraView() {
             this.setData({
@@ -79,7 +87,9 @@ Component({
             this.setData({
                 'extraObj.chatInputShowExtra': isShow
             }, () => {
-                this.triggerEvent(EVENT.EXTRA_CLICK, {isShow}, {});
+                this.triggerEvent(EVENT.EXTRA_CLICK, {
+                    isShow
+                }, {});
             });
         },
         _change$input$way$event() {
@@ -88,23 +98,37 @@ Component({
                 'extraObj.chatInputShowExtra': false
             });
         },
-        _triggerVoiceRecordEvent({status, dataset}) {
-            this.triggerEvent(EVENT.VOICE_RECORD, {recordStatus: status, ...dataset}, {});
+        _triggerVoiceRecordEvent({
+            status,
+            dataset
+        }) {
+            this.triggerEvent(EVENT.VOICE_RECORD, {
+                recordStatus: status,
+                ...dataset
+            }, {});
         },
         _long$click$voice$btn(e) {
-            if ('send$voice$btn' === e.currentTarget.id) {//长按时需要打开录音功能,开始录音
+            if ('send$voice$btn' === e.currentTarget.id) { //长按时需要打开录音功能,开始录音
                 this._checkRecordAuth(() => {
-                    const {maxVoiceTime, singleVoiceTimeCount} = this.data;
-                    this.setData({//调出取消弹窗
+                    const {
+                        maxVoiceTime,
+                        singleVoiceTimeCount
+                    } = this.data;
+                    this.setData({ //调出取消弹窗
                         'voiceObj.showCancelSendVoicePart': true,
                         'voiceObj.timeDownNum': maxVoiceTime - singleVoiceTimeCount,
                         'voiceObj.status': 'start',
                         'voiceObj.startStatus': 1,
                         'voiceObj.moveToCancel': false
                     }, () => {
-                        this._triggerVoiceRecordEvent({status: status.START});
+                        this._triggerVoiceRecordEvent({
+                            status: status.START
+                        });
+                    });
+                    this.recorderManager.start({
+                        duration: 60000,
+                        format: this.data.format
                     });
-                    this.recorderManager.start({duration: 60000, format: this.data.format});
                 }, (res) => {
                     //录音失败
                     console.error('录音拒绝授权');
@@ -114,7 +138,9 @@ Component({
                         'voiceObj.status': 'end',
                         'voiceObj.showCancelSendVoicePart': false
                     });
-                    this._triggerVoiceRecordEvent({status: status.UNAUTH});
+                    this._triggerVoiceRecordEvent({
+                        status: status.UNAUTH
+                    });
 
                     wx.showModal({
                         title: '您未授权语音功能',
@@ -145,7 +171,10 @@ Component({
         _dealVoiceLongClickEventWithHighVersion() {
             this.recorderManager.onStart(() => {
                 this.data.singleVoiceTimeCount = 0;
-                const {_startTimeDown, maxVoiceTime} = this.data;
+                const {
+                    _startTimeDown,
+                    maxVoiceTime
+                } = this.data;
                 //设置定时器计时60秒
                 this.data.timer = setInterval(() => {
                     const voiceTimeCount = ++this.data.singleVoiceTimeCount;
@@ -167,7 +196,12 @@ Component({
         },
         _send$voice$move$event(e) {
             if ('send$voice$btn' === e.currentTarget.id) {
-                const {windowHeight, voiceObj, tabBarHeight, cancelLineYPosition} = this.data,
+                const {
+                    windowHeight,
+                    voiceObj,
+                    tabBarHeight,
+                    cancelLineYPosition
+                } = this.data,
                     y = windowHeight + tabBarHeight - e.touches[0].clientY;
                 if (y > cancelLineYPosition) {
                     if (!voiceObj.moveToCancel) {
@@ -176,7 +210,7 @@ Component({
                         });
                     }
                 } else {
-                    if (voiceObj.moveToCancel) {//如果移出了该区域
+                    if (voiceObj.moveToCancel) { //如果移出了该区域
                         this.setData({
                             'voiceObj.moveToCancel': false
                         })
@@ -187,13 +221,17 @@ Component({
         },
         _send$voice$move$end$event(e) {
             if ('send$voice$btn' === e.currentTarget.id) {
-                const {singleVoiceTimeCount, minVoiceTime, timer} = this.data;
-                if (singleVoiceTimeCount < minVoiceTime) {//语音时间太短
+                const {
+                    singleVoiceTimeCount,
+                    minVoiceTime,
+                    timer
+                } = this.data;
+                if (singleVoiceTimeCount < minVoiceTime) { //语音时间太短
                     this.setData({
                         'voiceObj.status': 'short'
                     });
                     this._delayDismissCancelView();
-                } else {//语音时间正常
+                } else { //语音时间正常
                     this.setData({
                         'voiceObj.showCancelSendVoicePart': false,
                         'voiceObj.status': 'end'
@@ -204,7 +242,10 @@ Component({
             }
         },
         _initVoiceData() {
-            const {windowWidth, windowHeight} = this.data, width = windowWidth / 2.6;
+            const {
+                windowWidth,
+                windowHeight
+            } = this.data, width = windowWidth / 2.6;
             this.setData({
                 'inputStatus': 'text',
                 'windowHeight': windowHeight,
@@ -241,12 +282,16 @@ Component({
             })
         },
         _chatInput$send$text$message(e) {
+
             this.setData({
                 textMessage: ''
             }, () => {
-                this.triggerEvent(EVENT.SEND_MESSAGE, {value: e.detail.value});
+                this.triggerEvent(EVENT.SEND_MESSAGE, {
+                    value: e.detail.value
+                });
                 this.data.inputValueEventTemp = '';
             });
+
         },
         _chatInput$bind$blur$event() {
             setTimeout(() => {
@@ -260,43 +305,74 @@ Component({
             });
         },
         _chatInput$send$text$message02() {
+
             this.setData({
                 textMessage: '',
                 'inputType': 'none'
             }, () => {
+
                 if (!!this.data.inputValueEventTemp) {
-                    this.triggerEvent(EVENT.SEND_MESSAGE, {value: this.data.inputValueEventTemp});
-                    this.data.inputValueEventTemp = '';
+
+                    this.triggerEvent(EVENT.SEND_MESSAGE, {
+                        value: this.data.inputValueEventTemp
+                    });
+                    this.setData({
+                        inputValueEventTemp: '',
+                        textMessage: '',
+                    })
+                    // this.data.inputValueEventTemp = '';
                 }
             });
+
         },
         _chatInput$getValue$event(e) {
-            const {detail: {value: textMessage}} = e;
+
+            const {
+                detail: {
+                    value: textMessage
+                }
+            } = e;
             this.data.inputValueEventTemp = textMessage;
             this.setData({
                 textMessage
             })
         },
         _chatInput$extra$item$click$event(e) {
-            const {currentTarget: {dataset}} = e;
-            this.triggerEvent(EVENT.EXTRA_ITEM_CLICK, {...dataset}, {});
+            const {
+                currentTarget: {
+                    dataset
+                }
+            } = e;
+            this.triggerEvent(EVENT.EXTRA_ITEM_CLICK, {
+                ...dataset
+            }, {});
         },
 
         _setVoiceListener() {
             this.recorderManager.onStop((res) => {
                 console.log(res, this.data.voiceObj.status);
-                if (this.data.voiceObj.status === 'short') {//录音时间太短或者移动到了取消录音区域, 则取消录音
-                    this._triggerVoiceRecordEvent({status: status.SHORT});
+                if (this.data.voiceObj.status === 'short') { //录音时间太短或者移动到了取消录音区域, 则取消录音
+                    this._triggerVoiceRecordEvent({
+                        status: status.SHORT
+                    });
                     return;
                 } else if (this.data.voiceObj.moveToCancel) {
-                    this._triggerVoiceRecordEvent({status: status.CANCEL});
+                    this._triggerVoiceRecordEvent({
+                        status: status.CANCEL
+                    });
                     return;
                 }
                 console.log('录音成功');
-                this._triggerVoiceRecordEvent({status: status.SUCCESS, dataset: res});
+                this._triggerVoiceRecordEvent({
+                    status: status.SUCCESS,
+                    dataset: res
+                });
             });
             this.recorderManager.onError((res) => {
-                this._triggerVoiceRecordEvent({status: status.FAIL, dataset: res});
+                this._triggerVoiceRecordEvent({
+                    status: status.FAIL,
+                    dataset: res
+                });
             });
         },
 
@@ -309,7 +385,8 @@ Component({
                             success: (res) => {
                                 // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                                 console.log('同意', res);
-                            }, fail: res => {
+                            },
+                            fail: res => {
                                 console.log('拒绝', res);
                                 cbError && cbError();
                             }
@@ -324,7 +401,10 @@ Component({
     lifetimes: {
         created() {
             this.recorderManager = wx.getRecorderManager();
-            const {windowHeight, windowWidth} = wx.getSystemInfoSync();
+            const {
+                windowHeight,
+                windowWidth
+            } = wx.getSystemInfoSync();
             if (!windowHeight || !windowWidth) {
                 console.error('没有获取到手机的屏幕尺寸:windowWidth', windowWidth, 'windowHeight', windowHeight);
                 return;
@@ -352,4 +432,4 @@ Component({
 //     setTextMessageListener: setTextMessageListener,
 //     setExtraButtonClickListener: setExtraButtonClickListener,
 //     VRStatus: status
-// };
+// };

+ 12 - 5
apps/agent/components/detail-components/detail-scroll/detail-scroll.wxml

@@ -1,6 +1,7 @@
 <detail-banner imglist="{{house.detail_images}}" vrLink="{{house.vrLink}}" bind:onlineWatch="onlineWatch"
     bind:toVrHouse="toVrHouse" />
-<scroll-view class="contanerbox" scroll-y="true" wx:if="{{house.house_id}}">
+<!-- <scroll-view class="contanerbox" scroll-y="false" wx:if="{{house.house_id}}"> -->
+<view class="contanerbox" wx:if="{{house.house_id}}">
     <view class="house-info padding-container">
         <view class="tab-list">
             <view class="tab-item" wx:for="{{house.tags}}" wx:key="index">{{ item }}</view>
@@ -73,7 +74,13 @@
             <view class="location-item">
                 <text class="location-label">位置:</text>
                 <!-- <text class="location-value">{{ house.city + house.estate_name }}</text> -->
-                <text class="location-value">{{ house.address + ' ' + house.city }}</text>
+                <!-- <text class="location-value">{{ house.address + ' ' + house.city }}</text> -->
+                <text class="location-value">
+                    <text>{{house.address}}</text><text wx:if="{{house.city}}"> ,</text>
+                    <text>{{house.city}}</text><text wx:if="{{house.province}}"> ,</text>
+                    <text>{{house.province}}</text><text wx:if="{{house.postcode}}"> ,</text>
+                    <text>{{house.postcode}}</text>
+                </text>
             </view>
             <view class="location-item" wx:if="{{!isAgency}}">
                 <text class="location-label">学校信息:</text>
@@ -130,7 +137,7 @@
     </view>
 
     <!-- 免责声明 -->
-    <view class=" padding-container" wx:if="{{house.ancillaryFacility.length>0}}">
+    <view class=" padding-container">
         <view class="location-text-info border-btn">
             <view class="detail-title m-t-32">免责声明
             </view>
@@ -139,10 +146,10 @@
             </view>
         </view>
     </view>
-    <view class="padding-container">
+    <view class="padding-container" wx:if="{{recommendList.length>0}}">
         <view class="detail-title m-t-32">推荐房源({{recommendList.length}})</view>
         <view class="house-list">
             <house-item wx:for="{{recommendList}}" wx:key="id" house="{{item}}" />
         </view>
     </view>
-</scroll-view>
+</view>

+ 1 - 1
apps/agent/modules/chat-page/word.wxml

@@ -33,7 +33,7 @@
         </block>
         <!-- vr带房卡片 -->
         <block wx:if="{{msgType==='vr'}}">
-            <view class="chat-item-vr" bindtap="vrCardClickEvent"  data-vrLink="{{vr_link}}" data-house="{{house_id}}">
+            <view class="chat-item-vr" bindtap="vrCardClickEvent" data-enable="{{enable}}"  data-vrLink="{{vr_link}}" data-house="{{house_id}}">
                 <image  src="{{image_url}}" mode="aspectFill" />
                 <view class="vr-intro">
                     <view class="chat-item-name">{{ house_name }}</view>

+ 1 - 0
apps/agent/pages/chat/chat.js

@@ -64,6 +64,7 @@ Page({
         this.chatInput = this.selectComponent('#chatInput');
     },
     onSendMessageEvent(e) {
+        
         let content = e.detail.value;
         this.msgManager.sendMsg({type: 'TYPE_ONE', msgType: IMOperator.TextType, content,  toId: this.data.toId, fromId: getApp().globalData.userinfo.user_id});
     },

+ 3 - 2
apps/agent/pages/chat/im-operator.js

@@ -75,7 +75,7 @@ export default class IMOperator {
         };
     }
 
-    createNormalChatItem({type = IMOperator.TextType, content = '', isMy = true, duration, msgType, sendTime=fotmatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')} = {}) {
+    createNormalChatItem({type = IMOperator.TextType, content = '', isMy = true, enable,duration, msgType, sendTime=fotmatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')} = {}) {
         if (!content) return;
         const currentTimestamp = Date.now();
         const time = dealChatTime(sendTime, this._latestTImestamp);
@@ -93,7 +93,8 @@ export default class IMOperator {
             isPlaying: false,//语音是否正在播放,
             msgType,
             toId: arguments[0].toId,
-            fromId: arguments[0].fromId
+            fromId: arguments[0].fromId,
+            enable
         };
         if (type !== IMOperator.TextType) {
             obj.saveKey = content;//saveKey是存储文件时的key

+ 49 - 25
apps/agent/pages/chat/msg-type/vrcard-manager.js

@@ -1,34 +1,58 @@
 export default class VrCardManager {
-    constructor(page) {
-        this._page = page
-        this._page.vrCardClickEvent = function (e) {
-          const { vrlink, house } = e.currentTarget.dataset
-          if (vrlink) {
-            wx.navigateTo({
-              url: `/pages/web/web?house_id=${house}&vr_link=${vrlink}&is_auto=1`,
-            })
-          } else {
-            wx.navigateTo({
-              url: `/pages/detail/detail?house_id=${house}`,
-            })
-          }
-          
+  constructor(page) {
+    console.log(page)
+    this._page = page
+    this._page.vrCardClickEvent = function (e) {
+      const {
+        vrlink,
+        house,
+        enable
+      } = e.currentTarget.dataset
+      if (enable==0) {
+        wx.showToast({
+          title: '该房源已删除',
+          icon: 'none',
+        })
+        return
+      } else {
+        if (vrlink) {
+          wx.navigateTo({
+            url: `/pages/web/web?house_id=${house}&vr_link=${vrlink}&is_auto=1`,
+          })
+        } else {
+          wx.navigateTo({
+            url: `/pages/detail/detail?house_id=${house}`,
+          })
         }
+      }
+
+
     }
+  }
 
-    async sendOneMsg({content, type}) {
-      const { itemIndex } = await this._page.UI.showItemForMoment(this._page.imOperator.createNormalChatItem({
-          type,
-          content
-      }));
-     await this._page.sendMsg({
-          content: this._page.imOperator.createChatItemContent({type, content}),
-          itemIndex
-      });
+  async sendOneMsg({
+    content,
+    type
+  }) {
+    const {
+      itemIndex
+    } = await this._page.UI.showItemForMoment(this._page.imOperator.createNormalChatItem({
+      type,
+      content
+    }));
+    await this._page.sendMsg({
+      content: this._page.imOperator.createChatItemContent({
+        type,
+        content
+      }),
+      itemIndex
+    });
   }
-  showMsg({msg}) {
+  showMsg({
+    msg
+  }) {
     //UI类是用于管理UI展示的类。
     msg = Object.assign(msg, JSON.parse(msg.content))
     this._page.UI.updateViewWhenReceive(msg);
-}
+  }
 }

+ 10 - 10
apps/agent/pages/client-detail/client-detail.js

@@ -9,21 +9,21 @@ Page({
   data: {
     agent_user:{},
     clientInfo:[
-      {
-        key:'客户编号',
-        id:'user_id',
-        val:'50643540'
-      },
+      // {
+      //   key:'客户编号',
+      //   id:'user_id',
+      //   val:'50643540'
+      // },
       {
         key:'委托时间',
         id:'createTime',
         val:'2020.04.14'
       },
-      {
-        key:'维护进度',
-        id:'',
-        val:'暂无'
-      }
+      // {
+      //   key:'维护进度',
+      //   id:'',
+      //   val:'暂无'
+      // }
     ],
     demand:[
       {

+ 1 - 1
apps/agent/pages/client-detail/client-detail.wxml

@@ -7,7 +7,7 @@
         <view class="ic-top">
           <view><text class="subtxt">{{agent_user.user_name}}</text>{{agent_user.user_gender==="M"?'男':'女'}}</view>
           <view>
-            <text wx:for="{{3}}" class="star iconfont iconcus_star"></text>
+            <text wx:for="{{agent_user.user_wish}}" class="star iconfont iconcus_star"></text>
           </view>
         </view>
         <view class="ic-middle">

+ 3 - 1
apps/agent/pages/my/my.js

@@ -99,7 +99,9 @@ Page({
         wx.getSetting({
             withSubscriptions: true,
             success: (setting) => {
-                if (setting.subscriptionsSetting.itemSettings && setting.subscriptionsSetting.itemSettings['GApxDrE3tPhysRxHEmGHRn-0mvNJXqtZ4znZ8PJnQ8Q']) {
+            
+                // if (setting.subscriptionsSetting.itemSettings && setting.subscriptionsSetting.itemSettings['GApxDrE3tPhysRxHEmGHRn-0mvNJXqtZ4znZ8PJnQ8Q']) {
+                if (setting.subscriptionsSetting.itemSettings && setting.subscriptionsSetting.itemSettings['zWTBJFpALA3KR3qx1keYJCzJdVtRjFbxrnOJc_Htn-g']) {
                     this.setData({
                         cu_items: [{
                                 title: '我关注的房源',

+ 1 - 1
apps/agent/pages/web/web.js

@@ -61,7 +61,7 @@ Page({
   onShow() {
     if (app.globalData.token && !getQueryString(this.data.url, 'user_id')) {
       this.setData({
-        url: `${this.data.url}&role=agent&user_id=${app.globalData.userinfo.user_id}`
+        url: `${this.data.url}&role=agent&user_id=${app.globalData.userinfo.user_id}&house_id=${this.data.house_id}`
       })
     }
   },