xujing 5 jaren geleden
bovenliggende
commit
f1cb0ebbaf

+ 0
- 9
project.config.json.rej Bestand weergeven

@@ -1,9 +0,0 @@
1
-diff a/project.config.json b/project.config.json	(rejected hunks)
2
-@@ -2,6 +2,7 @@
3
- 	"miniprogramRoot": "dist/",
4
- 	"projectname": "mini-chengjiao",
5
- 	"description": "知与行联调",
6
-+	"appid": "wxd9ee3a9480a4e544",
7
- 	"setting": {
8
- 		"urlCheck": false,
9
- 		"es6": false,

+ 2
- 1
src/components/empty-page/index.scss Bestand weergeven

@@ -1,8 +1,9 @@
1 1
 @import "@styles/theme.scss";
2 2
 .empty{
3
-  width:100vw;
3
+  width:100%;
4 4
   height:80vh;
5 5
   display: flex;
6
+  margin:  0 auto;
6 7
   flex-direction: column;
7 8
   justify-content: center;
8 9
   align-items: center;

+ 2
- 2
src/pages/activity/activity.js Bestand weergeven

@@ -4,7 +4,7 @@ import FormIdCollector from '@components/formIdCollector'
4 4
 import './index.scss'
5 5
 import { AtTabs, AtTabsPane } from 'taro-ui'
6 6
 import "taro-ui/dist/style/components/tabs.scss"
7
-import { queryActivityList } from '@services/activity'
7
+// import { queryActivityList } from '@services/activity'
8 8
 import Activity from './index'
9 9
 import News from '../news/index'
10 10
 import { savePoint, updatePoint } from '@services/common'
@@ -39,7 +39,7 @@ export default class active extends Component {
39 39
     })
40 40
   }
41 41
   componentWillMount() {
42
-    if (this.$router.params.projectIndex) {
42
+    if (Taro.getApp().props.projectIndex) {
43 43
       this.setState({
44 44
         current: 1
45 45
       })

+ 10
- 0
src/pages/im/index.js Bestand weergeven

@@ -127,6 +127,7 @@ export default class Chat extends Component {
127 127
 
128 128
       // 获取聊天对象信息
129 129
       fetch({ url: `${API_QUERY_USERINFO_BYID}/${chatting.personId}` }).then(res => {
130
+        console.log(res, "rees")
130 131
         // res 为 person 信息
131 132
         chatting.avatarurl = res.avatarurl
132 133
         chatting.personType = res.personType
@@ -357,6 +358,15 @@ export default class Chat extends Component {
357 358
   sendMessage = (message, messageType = MESSAGETYPE.TEXT) => {
358 359
     const { me, chatting } = this.state
359 360
 
361
+    if (!message || !message.trim()) {
362
+      console.log(message.trim(), "messagemessagemessage")
363
+      // Taro.showToast({
364
+      //   icon: 'none',
365
+      //   title: '不能发空消息哦~'
366
+      // })
367
+      return
368
+    }
369
+  
360 370
     const payload = {
361 371
       sendPerson: me.personId,
362 372
       receivePerson: chatting.personId,

+ 5
- 5
src/pages/person/accessRecord.js Bestand weergeven

@@ -9,7 +9,7 @@ import dayjs from 'dayjs';
9 9
 @connect(state => state.user)
10 10
 export default class Person extends Component {
11 11
   config = {
12
-    navigationBarTitleText: '访问记录'
12
+    navigationBarTitleText: '访客信息'
13 13
   }
14 14
 
15 15
   state = {
@@ -27,13 +27,13 @@ export default class Person extends Component {
27 27
     savePoint({
28 28
       event: 'list',
29 29
       eventType: 'activity',
30
-      propertyName: '访问记录',
30
+      propertyName: '访客信息',
31 31
       data: '{}'
32 32
     }).then(res => {
33 33
       this.setState({
34 34
         recordId: res.recordId
35 35
       })
36
-      console.log('访问记录')
36
+      console.log('访客信息')
37 37
     })
38 38
   }
39 39
   componentWillUnmount() {
@@ -105,7 +105,7 @@ export default class Person extends Component {
105 105
       })
106 106
 
107 107
     }).catch(err => {
108
-      console.log(err, "获取更多访问记录err")
108
+      console.log(err, "获取更多访客信息err")
109 109
       Taro.hideLoading()
110 110
     })
111 111
   }
@@ -146,7 +146,7 @@ export default class Person extends Component {
146 146
           className="wrap"
147 147
           needInit
148 148
           isEmpty={isEmpty}
149
-          emptyText="暂无访问记录~"
149
+          emptyText="暂无访客信息~"
150 150
           hasMore={hasMore}
151 151
           onPullDownRefresh={fn => this.onPullDownRefresh(fn)}
152 152
           onScrollToLower={fn => this.onScrollToLower(fn)}

+ 1
- 1
src/pages/person/customerAnalysis/followUpCustomer/index.js Bestand weergeven

@@ -261,7 +261,7 @@ export default class transactionCustomer extends Taro.Component {
261 261
           <Input class="input" placeholderClass='placeholder' autoFocus onInput={this.changeInput} placeholder="请输入用户名/手机号" />
262 262
           <Button className="btn" onClick={this.searchBtn} >搜索</Button>
263 263
         </View>
264
-        <View style="padding:10px">
264
+        <View style="padding:0 10px 10px 10px">
265 265
           <ListView
266 266
             className="wrap"
267 267
             needInit

+ 1
- 1
src/pages/person/customerAnalysis/index.js Bestand weergeven

@@ -64,7 +64,7 @@ export default class customer extends Taro.Component {
64 64
     const tabList = [{ title: '跟进客户' }, { title: '成交客户' }]
65 65
     const { customerNum, current } = this.state
66 66
     return (
67
-      <AtTabs className="tab-box overflow-tab" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable={false}>
67
+      <AtTabs className="tab-customer" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable={false}>
68 68
         <AtTabsPane current={current} index={0}>
69 69
           <Followup />
70 70
           {/* <View style="padding:10px 20px; display: flex;flex-wrap: wrap;align-content: flex-start;justify-content: space-between;">

+ 29
- 9
src/pages/person/customerAnalysis/index.scss Bestand weergeven

@@ -23,11 +23,6 @@
23 23
 }
24 24
 
25 25
 
26
-
27
-
28
-
29
-
30
-
31 26
 .daily-month{
32 27
   display: flex;
33 28
   align-items: center;
@@ -65,7 +60,7 @@
65 60
     width: 86%;
66 61
     background-color: #fff;
67 62
     box-shadow:0px 4px 12px 0px rgba(0,0,0,0.12);
68
-    margin: 20px auto 10px auto;
63
+    margin: 20px auto 20px auto;
69 64
     border-radius: 44px;
70 65
   }
71 66
   .at-tabs__item{
@@ -91,10 +86,8 @@
91 86
     height: 0!important;
92 87
   }
93 88
 
94
- 
95 89
 }
96 90
 .tab-bar{
97
-  margin-top: 30px;
98 91
   .at-tabs__header{
99 92
     width: 80%;
100 93
     background-color: none;
@@ -108,7 +101,34 @@
108 101
     flex: none;
109 102
     color: #666;
110 103
     font-size: 28px;
111
-    padding: 12px 20px;
104
+    padding: 20px;
105
+  }
106
+  .at-tabs__item--active{
107
+    color: $primary-color;
108
+    background-color: #fff;
109
+  }
110
+  .at-tabs__item-underline{
111
+    height: 4px;
112
+    background-color: $primary-color;
113
+    width: 60%;
114
+    margin-left: 20%;
115
+  }
116
+}
117
+.tab-customer{
118
+  .at-tabs__header{
119
+    width: 80%;
120
+    background-color: none;
121
+    box-shadow:none;
122
+    margin: 0 auto;
123
+    border-radius: 0;
124
+    border: none;
125
+  }
126
+  .at-tabs__item{
127
+    width:50%;
128
+    flex: none;
129
+    color: #666;
130
+    font-size: 28px;
131
+    padding: 20px;
112 132
   }
113 133
   .at-tabs__item--active{
114 134
     color: $primary-color;

+ 1
- 7
src/pages/person/customerAnalysis/transactionCustomer/index.js Bestand weergeven

@@ -1,8 +1,6 @@
1 1
 import Taro, { Component } from '@tarojs/taro';
2
-import Authorize from '@components/authorize'
3 2
 import ListView from '@components/ListView'
4 3
 import './index.scss'
5
-import { savePoint, updatePoint } from '@services/common'
6 4
 import { connect } from '@tarojs/redux'
7 5
 import { queryCustomerList, addFollowRecord } from '@services/person'
8 6
 import { transferImage } from '@utils/tools'
@@ -27,10 +25,6 @@ export default class transactionCustomer extends Taro.Component {
27 25
     pageIndex: 1
28 26
   }
29 27
 
30
-  componentWillUnmount() {
31
-    const { recordId } = this.state
32
-    recordId && updatePoint(recordId)
33
-  }
34 28
   componentDidShow() {
35 29
     Taro.showLoading()
36 30
     this.loadList(1)
@@ -97,7 +91,7 @@ export default class transactionCustomer extends Taro.Component {
97 91
     const { customerList, isEmpty, hasMore } = this.state
98 92
 
99 93
     return (
100
-      <View style="padding:10px">
94
+      <View style="padding:0 10px 10px 10px">
101 95
         <ListView
102 96
           className="wrap"
103 97
           needInit

+ 1
- 1
src/pages/person/menus.js Bestand weergeven

@@ -60,7 +60,7 @@ const menus = [
60 60
       style: '',
61 61
     },
62 62
     {
63
-      name: '访问记录',
63
+      name: '访客信息',
64 64
       url: '/pages/person/accessRecord',
65 65
       icon: icons.accessrecord,
66 66
       extends: undefined,

+ 63
- 44
src/pages/project/h5Page.js Bestand weergeven

@@ -5,7 +5,7 @@ import './index.scss'
5 5
 import { getHFiveDetail } from '@services/user'
6 6
 import ready from '@utils/ready'
7 7
 import { reportClient } from '@services/report'
8
-import { connect, getStore } from '@tarojs/redux'
8
+import { connect } from '@tarojs/redux'
9 9
 import { ROLE_CODE } from '@constants/user'
10 10
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
11 11
 const bgImg = require('@assets/helpgroup/bg.png')
@@ -14,25 +14,32 @@ const bgImg = require('@assets/helpgroup/bg.png')
14 14
 export default class Index extends Component {
15 15
 
16 16
   state = {
17
+    recordId: undefined, // 埋点ID
17 18
     avatarVisible: true,
18 19
     phoneVisible: false,
19 20
     webViewVisible: false,
20
-    pageInfo: {}
21
+    pageInfo: {},
22
+    codeParams: '', // 解析二维码参数
21 23
   }
22 24
 
23
-
24
-
25
+  componentWillUnmount() {
26
+    const { recordId } = this.state
27
+    recordId && updatePoint(recordId)
28
+  }
25 29
   // 埋点
26 30
   success() {
27 31
     const { userInfo: { person } } = this.props
28
-    const consultant = person.personType == ROLE_CODE['CONSULTANT'] ? person.userId : ""
29
-    const firstShare = this.$router.params.firstShare || ""
32
+
33
+    const router = Taro.getStorageSync('router')
34
+    const firstShare = this.$router.params.firstShare || router.query.firstShare || ""
35
+    const consultant = this.$router.params.consultant || router.query.consultant || ""
36
+    const sharePersonId = this.$router.params.sharePersonId || router.query.sharePersonId || ""
30 37
     savePoint({
31 38
       event: 'detail',
32 39
       eventType: 'h5',
33 40
       propertyName: 'h5活动',
34 41
       consultantId: consultant,
35
-      sharePersonId: this.$router.params.sharePersonId,
42
+      sharePersonId: sharePersonId,
36 43
       data: '{"firstShare":"' + firstShare + '"}'
37 44
     }).then(res => {
38 45
       this.setState({
@@ -41,6 +48,7 @@ export default class Index extends Component {
41 48
       console.log('访问记录')
42 49
     })
43 50
   }
51
+  // 分享好友
44 52
   onShareAppMessage = () => {
45 53
     const { pageInfo } = this.state
46 54
     const currentPage = this.currentPageAndParams().join('?')
@@ -50,15 +58,16 @@ export default class Index extends Component {
50 58
       imageUrl: pageInfo.shareImg
51 59
     }
52 60
   }
53
-  getQRCode() {
54
-    const [page, scene] = this.currentPageAndParams()
55
-    const payload = { page, scene }
56
-    return new Promise((resolve) => {
57
-      getMiniQrcode(payload).then(qrCode => {
58
-        this.setState({ qrCode }, resolve)
59
-      })
60
-    })
61
-  }
61
+  // // 生成二维码
62
+  // getQRCode() {
63
+  //   const [page, scene] = this.currentPageAndParams()
64
+  //   const payload = { page, scene }
65
+  //   return new Promise((resolve) => {
66
+  //     getMiniQrcode(payload).then(qrCode => {
67
+  //       this.setState({ qrCode }, resolve)
68
+  //     })
69
+  //   })
70
+  // }
62 71
 
63 72
 
64 73
   currentPageAndParams() {
@@ -82,32 +91,45 @@ export default class Index extends Component {
82 91
     return res
83 92
   }
84 93
   componentWillMount() {
85
-
86 94
     ready.queue(() => {
95
+
96
+      if (this.$router.params.scene) {
97
+        getQrCodeParams(this.$router.params.scene).then((_, codeParams) => {
98
+          this.setState({
99
+            codeParams: codeParams || ''
100
+          })
101
+          console.log(res, "解析二维码返回值")
102
+        })
103
+      }
87 104
       // h5id 、第一个分享人ID、置业顾问ID、分享人ID 
88 105
       getHFiveDetail(this.$router.params.id).then(res => {
89 106
         this.setState({
90 107
           pageInfo: res
91 108
         })
92 109
       })
93
-      const { userInfo: { person, miniAuthorized } } = this.props
110
+      const { userInfo: { person: { avatarurl, phone } } } = this.props
94 111
       console.log(this.props, "this.props")
95
-      // if(person.avatarurl)
96
-      if (miniAuthorized) {
112
+      if (avatarurl && avatarurl.indexOf('wx.qlogo.cn') != -1) {
113
+        console.log(avatarurl, "有头像哦~")
114
+        this.setState({
115
+          avatarVisible: false,
116
+        })
97 117
         // 头像手机号都有
98
-        if (person.phone) {
99
-          this.onAvatarSuccess();
118
+        if (phone) {
119
+
120
+          this.reportClient()
100 121
           this.success()
101 122
           this.setState({
102
-            avatarVisible: false,
103 123
             phoneVisible: false,
104 124
             webViewVisible: true,
105 125
           })
106 126
         } else {
107
-          this.onAvatarSuccess();
127
+          this.setState({
128
+            phoneVisible: true,
129
+          })
108 130
         }
109 131
       } else {
110
-        if (person.phone) {
132
+        if (phone) {
111 133
           this.setState({
112 134
             phoneVisible: false,
113 135
           })
@@ -115,7 +137,6 @@ export default class Index extends Component {
115 137
       }
116 138
     })
117 139
   }
118
-
119 140
   // 授权头像成功
120 141
   onAvatarSuccess() {
121 142
     this.setState({
@@ -126,12 +147,9 @@ export default class Index extends Component {
126 147
   }
127 148
   // 授权用户信息
128 149
   getUserInfo() {
129
-    const { dispatchUpdateUserInfo, extraInfo, miniApp, person, miniAuthorized } = this.props
150
+    const { dispatchUpdateUserInfo } = this.props
130 151
     const sessionKey = Taro.getStorageSync('sessionKey')
131 152
 
132
-    const { dispatch } = getStore()
133
-
134
-    dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp, miniAuthorized } })
135 153
     Taro.showLoading()
136 154
     Taro.getUserInfo({
137 155
       lang: 'zh_CN',
@@ -156,7 +174,7 @@ export default class Index extends Component {
156 174
       }
157 175
     })
158 176
   }
159
-
177
+  // 授权手机号
160 178
   getPhoneNumber(e) {
161 179
     getUserPhone(e, (phoneNumber) => {
162 180
       if (!phoneNumber) {
@@ -167,6 +185,7 @@ export default class Index extends Component {
167 185
       } else {
168 186
         console.log('授权手机成功')
169 187
         this.success()
188
+        this.reportClient()
170 189
         this.setState({
171 190
           phoneVisible: false,
172 191
           webViewVisible: true,
@@ -176,18 +195,18 @@ export default class Index extends Component {
176 195
   }
177 196
   // 报备客户
178 197
   reportClient() {
198
+    const router = Taro.getStorageSync('router')
199
+    const consultant = this.$router.params.consultant || router.query.consultant || ""
179 200
     const {
180
-      cardInfo: { id, projects = [] },
181
-      userInfo: { person: { phone, tel } }
201
+      userInfo: { person: { phone, tel, userId } }
182 202
     } = this.props
183
-    const buildingId = projects[0]
184
-    const realPhone = phoneNumber || phone || tel
185
-    const payload = {
186
-      realtyConsultant: id, //报备人 置业顾问
187
-      buildingId,
188
-      phone: realPhone
189
-    }
190
-    if (person.personId != cardInfo.id) {
203
+
204
+    if (consultant && consultant != userId) {
205
+      const realPhone = phone || tel
206
+      const payload = {
207
+        realtyConsultant: consultant, //报备人 置业顾问
208
+        phone: realPhone
209
+      }
191 210
       reportClient(payload).then(res => {
192 211
         console.log('恭喜您绑定成功')
193 212
       }).catch(err => {
@@ -219,18 +238,18 @@ export default class Index extends Component {
219 238
     )
220 239
   }
221 240
   render() {
222
-    const { pageInfo, webViewVisible, qrCode } = this.state
241
+    const { pageInfo, webViewVisible, codeParams } = this.state
223 242
     const { userInfo: { person } } = this.props
224 243
     const webUrlParams = [
225 244
       `personId=${person.personId}`,
226 245
       `h5id=${this.$router.params.id}`,
227
-      `qrCode=${qrCode}`,
246
+      `codeParams=${encodeURIComponent(codeParams)}`,
228 247
     ].join('&')
229 248
 
230 249
     return (
231 250
       <Block>
232 251
         {this.renderMaskBanner()}
233
-        {webViewVisible && <WebView src={`${pageInfo.h5Address}?${encodeURIComponent(webUrlParams)}`} />}
252
+        {webViewVisible && <WebView src={`${pageInfo.h5Address}?${webUrlParams}`} />}
234 253
       </Block>
235 254
     )
236 255
   }

+ 25
- 6
src/pages/project/index.js Bestand weergeven

@@ -54,9 +54,7 @@ export default class Index extends Component {
54 54
     this.qqmapsdk = new QQMapWX({
55 55
       key: 'TIIBZ-ZJG33-52T3L-Y3X4Q-NWKLV-KUB3B'
56 56
     })
57
-
58 57
     ready.queue(() => {
59
-      this.loadOpenScreenBanner()
60 58
       this.getLocation()
61 59
 
62 60
       savePoint({
@@ -70,8 +68,11 @@ export default class Index extends Component {
70 68
         })
71 69
         console.log('进入首页')
72 70
       })
71
+
73 72
     })
74 73
   }
74
+
75
+
75 76
   toChatList() {
76 77
     // const { dispatch } = getStore()
77 78
     // dispatch({ type: DECREASE_UNREADNUM })
@@ -90,6 +91,7 @@ export default class Index extends Component {
90 91
   componentWillUnmount() {
91 92
     const { recordId } = this.state
92 93
     recordId && updatePoint(recordId)
94
+
93 95
   }
94 96
 
95 97
   getLocation() {
@@ -151,11 +153,16 @@ export default class Index extends Component {
151 153
     this.loadNewsList()
152 154
     this.loadActivityList()
153 155
     this.loadList()
154
-  }
155 156
 
157
+  }
156 158
   loadOpenScreenBanner() {
157
-    const payload = {
158
-      // showPosition: 'index'
159
+    const { curCity } = this.props
160
+
161
+    const payload = {}
162
+    if (curCity.id) {
163
+      payload.cityId = curCity.id
164
+    } else {
165
+
159 166
     }
160 167
     // 获取开屏广告图
161 168
     queryBanners('screen', payload).then(res => {
@@ -171,6 +178,15 @@ export default class Index extends Component {
171 178
       })
172 179
     })
173 180
   }
181
+  componentWillReceiveProps(nextProps) {
182
+    console.log(nextProps.curCity, "curCitycurCitycurCitycurCitycurCity")
183
+    console.log(this.state.maskBanner, "maskBannermaskBannermaskBannermaskBannermaskBanner")
184
+
185
+    if (!this.state.maskBanner && JSON.stringify(nextProps.curCity) != '{}') {
186
+
187
+      this.loadOpenScreenBanner()
188
+    }
189
+  }
174 190
   loadBannerList() {
175 191
     const { curCity } = this.props
176 192
     console.log(this.props, 'this.props')
@@ -462,7 +478,10 @@ export default class Index extends Component {
462 478
   }
463 479
   toNewsList() {
464 480
     Taro.switchTab({
465
-      url: `/pages/activity/activity?projectIndex=1`
481
+      url: `/pages/activity/activity?projectIndex=1`,
482
+      success: res => {
483
+        Taro.getApp().props.projectIndex = 1
484
+      }
466 485
     })
467 486
   }
468 487
 

+ 1
- 1
src/pages/project/index.scss Bestand weergeven

@@ -186,7 +186,7 @@
186 186
     box-shadow:0px 2px 4px 0px rgba(187,156,121,0.22);
187 187
     border-radius:12px;
188 188
     width:690px;
189
-height:172px;
189
+    height:172px;
190 190
     // padding: 0px 20px;
191 191
 
192 192
     .section-content_img{

+ 1
- 1
src/utils/login.js Bestand weergeven

@@ -28,7 +28,7 @@ export default function (payload, callback) {
28 28
         Taro.setStorageSync('token', token)
29 29
         Taro.setStorageSync('sessionKey', sessionKey)
30 30
 
31
-        dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp, miniAuthorized } })
31
+        dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp } })
32 32
 
33 33
         // 用户信息已授权获取成功
34 34
         if (miniAuthorized) {

+ 30
- 0
src/utils/qrcode.js Bestand weergeven

@@ -0,0 +1,30 @@
1
+import { parseQueryString } from './tools'
2
+import { getCodeScene  } from '@services/common'
3
+
4
+/**
5
+ * 获取二维码参数
6
+ * 微信小程序  基础库 2.1.2 开始支持
7
+ * @param {*} scene 场景值
8
+ */
9
+export function getQrCodeParams(sceneID) {
10
+  if (!sceneID) {
11
+    console.error('未解析到二维码场景值')
12
+    return Promise.reject('未解析到二维码场景值')
13
+  }
14
+
15
+  console.log('解析到二维码场景 ID', sceneID)
16
+
17
+  return new Promise((resolve, reject) => {
18
+    getCodeScene(sceneID).then((res) => {
19
+      const data = typeof res === 'string' ? JSON.parse(res) : res
20
+      const params = parseQueryString(data.scene || '')
21
+
22
+      console.log('解析到二维码场景参数: ', params)
23
+
24
+      resolve(params, data.scene)
25
+    }).catch(err => {
26
+      console.error('解析二维码场景参数失败', err)
27
+      reject('解析二维码场景参数失败')
28
+    })
29
+  })
30
+}