소스 검색

share、chat

xujing 5 년 전
부모
커밋
3daff1f841

+ 4
- 4
config/dev.js 파일 보기

@@ -5,12 +5,12 @@ module.exports = {
5 5
   defineConstants: {
6 6
     // HOST: '"http://47.101.36.130:8085"',//测试
7 7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
8
-    HOST: '"https://dev.jinchengjiaye.com"',//测试
9
-    WSS_HOST: '"wss://dev.jinchengjiaye.com"',
8
+    // HOST: '"https://dev.jinchengjiaye.com"',//测试
9
+    // WSS_HOST: '"wss://dev.jinchengjiaye.com"',
10 10
     // HOST: '"https://lt.pawoma.cn"',
11 11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    // HOST: '"http://192.168.2.51:8080"',
13
-    // WSS_HOST: '"ws://192.168.2.51:8080"',
12
+    HOST: '"http://192.168.2.52:8080"',
13
+    WSS_HOST: '"ws://192.168.2.52:8080"',
14 14
     Version: 'V3.5.5'
15 15
   },
16 16
   weapp: {},

+ 1
- 0
src/pages/person/customerAnalysis/transactionCustomer/index.js 파일 보기

@@ -4,6 +4,7 @@ import './index.scss'
4 4
 import { connect } from '@tarojs/redux'
5 5
 import { queryCustomerList, addFollowRecord } from '@services/person'
6 6
 import { transferImage } from '@utils/tools'
7
+import * as noticeType from '@constants/common.js'
7 8
 
8 9
 const maleImg = require('@assets/person/male.png')
9 10
 const femaleImg = require('@assets/person/female.png')

+ 28
- 36
src/pages/person/myShare/accessRecord.js 파일 보기

@@ -2,7 +2,7 @@ import Taro, { Component } from '@tarojs/taro';
2 2
 import ListView from '@components/ListView'
3 3
 import { connect } from '@tarojs/redux'
4 4
 import './index.scss'
5
-import { getSharePersonInfoList,judgeBindCustomer } from '@services/person'
5
+import { getSharePersonInfoList, judgeBindCustomer, getConsulantVisitRecord } from '@services/person'
6 6
 import { savePoint, updatePoint } from '@services/common'
7 7
 import * as noticeType from '@constants/common.js'
8 8
 import dayjs from 'dayjs';
@@ -53,15 +53,12 @@ export default class Person extends Component {
53 53
       userId: person.userId,
54 54
       targetId: targetId,
55 55
       pageNumber,
56
-      pageSize: 5
56
+      pageSize: 10
57 57
     }
58
-
59
-    getSharePersonInfoList(payload).then(res => {
60
-
58
+    getConsulantVisitRecord(payload).then(res => {
61 59
       const { records, list, total, current, pages } = res || {}
62 60
       const _list = records || list || []
63 61
       const newList = current <= 1 ? _list : this.state.recordList.concat(_list)
64
-      console.log(newList)
65 62
       this.setState({
66 63
         recordList: newList,
67 64
         isEmpty: total == 0 || !res,
@@ -69,7 +66,9 @@ export default class Person extends Component {
69 66
         pageIndex: current >= pages ? pages : current
70 67
       })
71 68
       Taro.hideLoading()
69
+
72 70
     })
71
+
73 72
   }
74 73
   onScrollToLower = async (fn) => {
75 74
     const { pageIndex } = this.state;
@@ -86,17 +85,17 @@ export default class Person extends Component {
86 85
   }
87 86
   handleChatClick(item, e) {
88 87
     e.stopPropagation()
89
-    const { userInfo: { person: { personId, nickname, name }}} = this.props
90
-    const { userInfo: {miniApp:{tpls}}} = this.props
91
-    const tplId=(tpls.filter(x => x.tplType == noticeType.TPL_NOTICE&&x.isSubscribe == true))[0].tplId
88
+    const { userInfo: { person: { personId, nickname, name } } } = this.props
89
+    const { userInfo: { miniApp: { tpls } } } = this.props
90
+    const tplId = (tpls.filter(x => x.tplType == noticeType.TPL_NOTICE && x.isSubscribe == true))[0].tplId
92 91
     wx.requestSubscribeMessage({
93 92
       tmplIds: [tplId],
94
-      success (res) {
93
+      success(res) {
95 94
         Taro.navigateTo({
96 95
           url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.personId}&receiverName=${encodeURIComponent(item.name || item.nickname)}`
97 96
         })
98 97
       },
99
-      fail(res){
98
+      fail(res) {
100 99
         Taro.navigateTo({
101 100
           url: `/pages/im/index?sendId=${personId}&sendName=${encodeURIComponent(name || nickname)}&receiverId=${item.personId}&receiverName=${encodeURIComponent(item.name || item.nickname)}`
102 101
         })
@@ -104,34 +103,27 @@ export default class Person extends Component {
104 103
     })
105 104
   }
106 105
 
107
-  goCustomerDetail(customerId,e){
108
-    e.stopPropagation()
109
-    const { userInfo: { person: { personId }}} = this.props
110
-    const payload = {
111
-      personId: personId,
112
-      customerId: customerId
106
+  goCustomerDetail(item) {
107
+    console.log(item, "item")
108
+
109
+    if (item.myCustomer == 1) {
110
+      Taro.navigateTo({
111
+        url: `/pages/person/customerAnalysis/myCustomer?
112
+          =` + item.customerId
113
+      })
114
+    } else {
115
+      Taro.showToast({
116
+        title: 'TA不是你的客户,无法查看详细信息',
117
+        duration: 2000,
118
+        icon: 'none',
119
+      })
113 120
     }
114
-    judgeBindCustomer(payload).then(res=>{
115
-      if(res.data){
116
-        Taro.navigateTo({
117
-          url: `/pages/person/customerAnalysis/myCustomer?
118
-          =` + customerId
119
-        })
120
-      }else{
121
-        Taro.showToast({
122
-          title: 'TA不是你的客户,无法查看详细信息',
123
-          duration: 3000,
124
-          icon: 'none',
125
-        })
126
-      }
127
-    })
128
-    
121
+
129 122
   }
130 123
 
131 124
   render() {
132 125
     const { isEmpty, hasMore, recordList } = this.state
133 126
     return (
134
-
135 127
       <Block>
136 128
         <ListView
137 129
           className="wrap"
@@ -145,16 +137,16 @@ export default class Person extends Component {
145 137
           <View className='access-page'>
146 138
             {
147 139
               recordList.map(item => (
148
-                <View className='item' key={String(item + 'more')}>
140
+                <View className='item' key={String(item + 'more')} onClick={this.goCustomerDetail.bind(this, item)} >
149 141
                   {item.myCustomer == 1 && <View className="tag">我的客户</View>}
150 142
                   <Image className="touxiang" src={item.avatarurl || require('@assets/default-avatar.png')}></Image>
151 143
                   <View className="info-top">
152
-                    <View onClick={this.goCustomerDetail.bind(this,item.customerId)} className="name">{item.userName || item.nickname || ' '}</View>
144
+                    <View className="name">{item.userName || item.nickname || ' '}</View>
153 145
                     <View style="display: flex;align-items: center;" onClick={this.handleChatClick.bind(this, item)}><Image className="goutong-icon" src={require('@assets/person/zixun.png')}></Image><Text className="goutong">在线沟通</Text></View>
154 146
                   </View>
155 147
                   <View className="activity-time">
156 148
                     {`${dayjs(item.visitTime).format('YYYY-MM-DD HH:mm:ss')}`}
157
-                  </View> 
149
+                  </View>
158 150
                 </View>
159 151
               ))
160 152
             }

+ 19
- 23
src/pages/person/myShare/index.js 파일 보기

@@ -5,11 +5,11 @@ import './index.scss'
5 5
 import { getSharePersonList } from '@services/person'
6 6
 import { savePoint, updatePoint } from '@services/common'
7 7
 import { transferImage } from '@utils/tools'
8
-import dayjs from 'dayjs';
8
+
9 9
 
10 10
 @connect(state => state.user)
11 11
 
12
-export default class Person extends Component {
12
+export default class Person extends Taro.Component {
13 13
   config = {
14 14
     navigationBarTitleText: '我的分享'
15 15
   }
@@ -41,12 +41,7 @@ export default class Person extends Component {
41 41
     recordId && updatePoint(recordId)
42 42
   }
43 43
 
44
-  componentDidShow() {
45
-    Taro.showLoading()
46
-    this.loadList(1)
47
-  }
48 44
   loadList(pageNumber) {
49
-    console.log(this.props, "this.props")
50 45
     const { userInfo: { person } } = this.props
51 46
 
52 47
     let payload
@@ -54,13 +49,13 @@ export default class Person extends Component {
54 49
       payload = {
55 50
         userId: person.userId,
56 51
         pageNumber,
57
-        pageSize: 5
52
+        pageSize: 10
58 53
       }
59 54
     } else {
60 55
       payload = {
61 56
         userId: Taro.getStorageSync('userId'),
62 57
         pageNumber,
63
-        pageSize: 5
58
+        pageSize: 10
64 59
       }
65 60
     }
66 61
     getSharePersonList(payload).then(res => {
@@ -71,7 +66,7 @@ export default class Person extends Component {
71 66
 
72 67
       this.setState({
73 68
         recordList: newList,
74
-        isEmpty: total == 0 || !res,
69
+        isEmpty: total == 0,
75 70
         hasMore: current < pages,
76 71
         pageIndex: current >= pages ? pages : current
77 72
       })
@@ -98,7 +93,6 @@ export default class Person extends Component {
98 93
     })
99 94
   }
100 95
 
101
-
102 96
   renderBuilding(item) {
103 97
     return (
104 98
       <View className="share-item" onClick={this.handleItemClick.bind(this, item.targetId)}>
@@ -174,18 +168,20 @@ export default class Person extends Component {
174 168
         onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
175 169
         onScrollToLower={fn => this.onScrollToLower(fn)}
176 170
       >
177
-        {
178
-          recordList.map(item => (
179
-            <View taroKey={String(item.targetId)} className='share-page'>
180
-              {item.shareType == 'building' && this.renderBuilding(item)}
181
-              {item.shareType == 'h5' && this.renderH5(item)}
182
-              {item.shareType == 'group' && this.renderGroup(item)}
183
-              {item.shareType == 'help' && this.renderHelp(item)}
184
-              {item.shareType == 'news' && this.renderNews(item)}
185
-              {item.shareType == 'activity' && this.renderActivity(item)}
186
-            </View>
187
-          ))
188
-        }
171
+        <View className="list" >
172
+          {
173
+            recordList.map(item => (
174
+              <View key={item.targetId + 'share'} className='share-page'>
175
+                {item.shareType == 'building' && this.renderBuilding(item)}
176
+                {item.shareType == 'h5' && this.renderH5(item)}
177
+                {item.shareType == 'group' && this.renderGroup(item)}
178
+                {item.shareType == 'help' && this.renderHelp(item)}
179
+                {item.shareType == 'news' && this.renderNews(item)}
180
+                {item.shareType == 'activity' && this.renderActivity(item)}
181
+              </View>
182
+            ))
183
+          }
184
+        </View>
189 185
       </ListView>
190 186
     )
191 187
   }

+ 4
- 0
src/pages/person/myShare/index.scss 파일 보기

@@ -1,4 +1,8 @@
1 1
 @import "@styles/theme.scss";
2
+.wrap{
3
+  height: 100vh;
4
+  width: 100%;
5
+}
2 6
 .share-page{
3 7
   padding: 10px 30px;
4 8
   .share-item{

+ 1
- 1
src/pages/project/detail/index.js 파일 보기

@@ -750,7 +750,7 @@ export default class Index extends Component {
750 750
               <ScrollView scrollX>
751 751
                 <View className='photos__type__content' >
752 752
 
753
-                  <View className="around-tab">
753
+                  <View className="around-tab" style="display:flex">
754 754
                     {listimg.map((item, index) => {
755 755
                       const { apartmentName } = item
756 756
                       const buildingImgList = item.buildingImgList

+ 1
- 1
src/services/person.js 파일 보기

@@ -82,7 +82,7 @@ export const getFollowRecord = (payload) => fetch({ url: API_FOLLOW_LIST, payloa
82 82
  */
83 83
 export const addFollowRecord = (payload) => fetch({ url: API_FOLLOW_LIST, payload, method: 'POST' })
84 84
 /**
85
- * 获取访问记录
85
+ * 获取访客信息
86 86
  * @param {*} payload  
87 87
  */
88 88
 export const getConsulantVisitRecord = (payload) => fetch({ url: API_CONSULTANT_VISIT_RECORD, payload })