xujing 5 years ago
parent
commit
c23efd7c4e

+ 4
- 4
config/dev.js View File

5
   defineConstants: {
5
   defineConstants: {
6
     // HOST: '"http://47.101.36.130:8085"',//测试
6
     // HOST: '"http://47.101.36.130:8085"',//测试
7
     // WSS_HOST: '"wss://47.101.36.130:8085"',
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
     // HOST: '"https://lt.pawoma.cn"',
10
     // HOST: '"https://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
-    HOST: '"http://192.168.2.52:8080"',
13
-    WSS_HOST: '"ws://192.168.2.52:8080"',
12
+    // HOST: '"http://192.168.2.52:8080"',
13
+    // WSS_HOST: '"ws://192.168.2.52:8080"',
14
   },
14
   },
15
   weapp: {},
15
   weapp: {},
16
   h5: {}
16
   h5: {}

+ 2
- 2
src/app.js View File

42
     pages: [
42
     pages: [
43
       'pages/project/index',
43
       'pages/project/index',
44
       'pages/project/h5Page',
44
       'pages/project/h5Page',
45
-      'pages/person/customerAnalysis/followUpCustomer/index',
46
-      'pages/person/customerAnalysis/transactionCustomer/index',
45
+      // 'pages/person/customerAnalysis/followUpCustomer/index',
46
+      // 'pages/person/customerAnalysis/transactionCustomer/index',
47
       'pages/person/customerAnalysis/myCustomer',
47
       'pages/person/customerAnalysis/myCustomer',
48
       'pages/person/accessRecord',
48
       'pages/person/accessRecord',
49
       'pages/shop/index',
49
       'pages/shop/index',

+ 18
- 17
src/pages/person/customerAnalysis/index.js View File

6
 import { savePoint, updatePoint } from '@services/common'
6
 import { savePoint, updatePoint } from '@services/common'
7
 import { queryMyCustomer } from '@services/person'
7
 import { queryMyCustomer } from '@services/person'
8
 import { connect } from '@tarojs/redux'
8
 import { connect } from '@tarojs/redux'
9
-import Analysis from './analysis'
10
-
9
+// import Analysis from './analysis'
10
+import Followup from './followUpCustomer'
11
+import TransactionCustomer from './transactionCustomer'
11
 @connect(({ user, city }) => ({ user, city }))
12
 @connect(({ user, city }) => ({ user, city }))
12
 export default class customer extends Taro.Component {
13
 export default class customer extends Taro.Component {
13
 
14
 
45
   handleClick(value) {
46
   handleClick(value) {
46
     this.setState({
47
     this.setState({
47
       current: value
48
       current: value
48
-    }, )
49
+    })
49
   }
50
   }
50
   toTransactionCustomer() {
51
   toTransactionCustomer() {
51
     Taro.navigateTo({
52
     Taro.navigateTo({
59
   }
60
   }
60
 
61
 
61
   render() {
62
   render() {
62
-  
63
+
64
+    const tabList = [{ title: '跟进客户' }, { title: '成交客户' }]
63
     const { customerNum, current } = this.state
65
     const { customerNum, current } = this.state
64
     return (
66
     return (
65
-      // <AtTabs  className="tab-box overflow-tab" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable={false}>
66
-      //    <AtTabsPane current={current} index={0}>
67
-          <View style="padding:10px 20px; display: flex;flex-wrap: wrap;align-content: flex-start;justify-content: space-between;">
67
+      <AtTabs className="tab-box overflow-tab" current={current} tabList={tabList} onClick={this.handleClick.bind(this)} swipeable={false}>
68
+        <AtTabsPane current={current} index={0}>
69
+          <Followup />
70
+          {/* <View style="padding:10px 20px; display: flex;flex-wrap: wrap;align-content: flex-start;justify-content: space-between;">
68
             <View className="my-customer" onClick={this.toFollowUpCustomer} style="border-right:1px solid rgba(0,0,0,0.12)">
71
             <View className="my-customer" onClick={this.toFollowUpCustomer} style="border-right:1px solid rgba(0,0,0,0.12)">
69
               <Image mode="widthFix" src={require('@assets/person/genjin.png')} className='img'></Image>
72
               <Image mode="widthFix" src={require('@assets/person/genjin.png')} className='img'></Image>
70
               <View className="name">跟进客户</View>
73
               <View className="name">跟进客户</View>
75
               <View className="name">成交客户</View>
78
               <View className="name">成交客户</View>
76
               <View className="name">{customerNum.clinchSum || 0}人</View>
79
               <View className="name">{customerNum.clinchSum || 0}人</View>
77
             </View>
80
             </View>
81
+          </View> */}
82
+        </AtTabsPane>
83
+        <AtTabsPane current={current} index={1} >
84
+          <View >
85
+            <TransactionCustomer />
78
           </View>
86
           </View>
79
-      //   </AtTabsPane>
80
-      //   <AtTabsPane current={current} index={1} >
81
-      //     <View >
82
-      //       {
83
-      //         current != 0 && <Analysis></Analysis>
84
-      //       }
85
-      //     </View>
86
-      //   </AtTabsPane>
87
-       
88
-      // </AtTabs>
87
+        </AtTabsPane>
88
+
89
+      </AtTabs>
89
     )
90
     )
90
   }
91
   }
91
 }
92
 }

+ 13
- 8
src/pages/project/h5Page.js View File

1
 import Taro, { Component } from '@tarojs/taro'
1
 import Taro, { Component } from '@tarojs/taro'
2
-import { connect } from '@tarojs/redux'
3
 import * as actions from '@actions/user'
2
 import * as actions from '@actions/user'
4
 import getUserPhone from '@utils/getUserPhone'
3
 import getUserPhone from '@utils/getUserPhone'
5
 import './index.scss'
4
 import './index.scss'
6
 import { getHFiveDetail } from '@services/user'
5
 import { getHFiveDetail } from '@services/user'
7
 import ready from '@utils/ready'
6
 import ready from '@utils/ready'
8
 import { reportClient } from '@services/report'
7
 import { reportClient } from '@services/report'
8
+import { connect, getStore } from '@tarojs/redux'
9
 import { ROLE_CODE } from '@constants/user'
9
 import { ROLE_CODE } from '@constants/user'
10
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
10
 import { getMiniQrcode, savePoint, updatePoint } from '@services/common'
11
 const bgImg = require('@assets/helpgroup/bg.png')
11
 const bgImg = require('@assets/helpgroup/bg.png')
12
 
12
 
13
 @connect(state => state.user, { ...actions })
13
 @connect(state => state.user, { ...actions })
14
-
15
 export default class Index extends Component {
14
 export default class Index extends Component {
16
 
15
 
17
   state = {
16
   state = {
91
           pageInfo: res
90
           pageInfo: res
92
         })
91
         })
93
       })
92
       })
94
-      const { userInfo: { person } } = this.props
95
-      if (person.avatarurl) {
93
+      const { userInfo: { person, miniAuthorized } } = this.props
94
+      console.log(this.props, "this.props")
95
+      // if(person.avatarurl)
96
+      if (miniAuthorized) {
96
         // 头像手机号都有
97
         // 头像手机号都有
97
         if (person.phone) {
98
         if (person.phone) {
99
+          this.onAvatarSuccess();
98
           this.success()
100
           this.success()
99
           this.setState({
101
           this.setState({
100
             avatarVisible: false,
102
             avatarVisible: false,
124
   }
126
   }
125
   // 授权用户信息
127
   // 授权用户信息
126
   getUserInfo() {
128
   getUserInfo() {
127
-    const { dispatchUpdateUserInfo } = this.props
129
+    const { dispatchUpdateUserInfo, extraInfo, miniApp, person, miniAuthorized } = this.props
128
     const sessionKey = Taro.getStorageSync('sessionKey')
130
     const sessionKey = Taro.getStorageSync('sessionKey')
131
+
132
+    const { dispatch } = getStore()
133
+
134
+    dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp, miniAuthorized } })
129
     Taro.showLoading()
135
     Taro.showLoading()
130
     Taro.getUserInfo({
136
     Taro.getUserInfo({
131
       lang: 'zh_CN',
137
       lang: 'zh_CN',
193
 
199
 
194
   renderMaskBanner() {
200
   renderMaskBanner() {
195
     const { avatarVisible, phoneVisible, pageInfo } = this.state
201
     const { avatarVisible, phoneVisible, pageInfo } = this.state
196
-
197
     return (
202
     return (
198
       <View>
203
       <View>
199
         <Image src={pageInfo.middleImg || bgImg} mode='widthFix' className='bg_img'></Image>
204
         <Image src={pageInfo.middleImg || bgImg} mode='widthFix' className='bg_img'></Image>
201
           {avatarVisible &&
206
           {avatarVisible &&
202
             <View className="content">
207
             <View className="content">
203
               <View className="title">授权头像,围观活动</View>
208
               <View className="title">授权头像,围观活动</View>
204
-              <Image className="touxiang" src={require('@assets/default-avatar.png')}></Image>
205
-              <View className="name">用户昵称</View>
209
+              <View className="touxiang"><open-data type="userAvatarUrl"></open-data></View>
210
+              <View className="name"><open-data type="userNickName"></open-data></View>
206
               <Button className="btn" open-type="getUserInfo" lang="zh_CN" onGetUserInfo={this.getUserInfo}>好</Button>
211
               <Button className="btn" open-type="getUserInfo" lang="zh_CN" onGetUserInfo={this.getUserInfo}>好</Button>
207
             </View>
212
             </View>
208
           }
213
           }

+ 8
- 4
src/pages/project/index.js View File

300
   }
300
   }
301
 
301
 
302
   handleBannerClick = (item) => {
302
   handleBannerClick = (item) => {
303
-    console.log(this, "this")
304
-    this.redirectTo(item)
303
+    if (item.contentType != "nothing") {
304
+      this.redirectTo(item)
305
+      console.log(item.targetId, "item.targetId")
306
+    } else {
307
+      console.log(item, "item")
308
+    }
305
   }
309
   }
306
 
310
 
307
   redirectTo({ targetId, contentType, buildingId } = {}) {
311
   redirectTo({ targetId, contentType, buildingId } = {}) {
457
     })
461
     })
458
   }
462
   }
459
   toNewsList() {
463
   toNewsList() {
460
-    Taro.reLaunch({
464
+    Taro.switchTab({
461
       url: `/pages/activity/activity?projectIndex=1`
465
       url: `/pages/activity/activity?projectIndex=1`
462
     })
466
     })
463
   }
467
   }
627
                           newsList.map((list, inx) => {
631
                           newsList.map((list, inx) => {
628
                             return (
632
                             return (
629
                               <SwiperItem key={`img-${inx}`}>
633
                               <SwiperItem key={`img-${inx}`}>
630
-                                <View className="notice-text" onClick={this.handleNoticeClick.bind(this,list)}>
634
+                                <View className="notice-text" onClick={this.handleNoticeClick.bind(this, list)}>
631
                                   {list.newsName}
635
                                   {list.newsName}
632
                                 </View>
636
                                 </View>
633
                               </SwiperItem>
637
                               </SwiperItem>

+ 3
- 1
src/pages/project/index.scss View File

529
       color: #333;
529
       color: #333;
530
     }
530
     }
531
     .touxiang{
531
     .touxiang{
532
+      overflow: hidden;
533
+      display: block;
532
       width: 108px;
534
       width: 108px;
533
       height: 108px;
535
       height: 108px;
536
+      margin: 24px auto 10px ;
534
       border-radius: 50%;
537
       border-radius: 50%;
535
-      margin: 24px 0 10px 0;
536
     }
538
     }
537
     .name{
539
     .name{
538
       font-size: 28px;
540
       font-size: 28px;

+ 1
- 0
src/pages/project/swiper/index.scss View File

11
   // @extend .flex;
11
   // @extend .flex;
12
   // align-items: flex-start;
12
   // align-items: flex-start;
13
   height: 100%;
13
   height: 100%;
14
+  position: relative;
14
   &-item {
15
   &-item {
15
     width: 100%;
16
     width: 100%;
16
     display: flex;
17
     display: flex;

+ 22
- 16
src/pages/shop/index.js View File

40
     points: 0
40
     points: 0
41
   }
41
   }
42
 
42
 
43
-  componentDidShow () {
43
+  componentDidShow() {
44
 
44
 
45
     Taro.showLoading()
45
     Taro.showLoading()
46
     ready.queue(() => {
46
     ready.queue(() => {
53
     Taro.hideLoading()
53
     Taro.hideLoading()
54
   }
54
   }
55
 
55
 
56
-  loadBannerList () {
56
+  loadBannerList() {
57
     const payload = {
57
     const payload = {
58
       showPosition: 'mall',
58
       showPosition: 'mall',
59
       cityId: this.props.curCity.id
59
       cityId: this.props.curCity.id
65
     })
65
     })
66
   }
66
   }
67
 
67
 
68
-  loadList () {
68
+  loadList() {
69
 
69
 
70
 
70
 
71
     Taro.showLoading()
71
     Taro.showLoading()
88
     })
88
     })
89
   }
89
   }
90
 
90
 
91
-  loadGoodsBuilding () {
91
+  loadGoodsBuilding() {
92
     const payload = {
92
     const payload = {
93
 
93
 
94
       cityId: this.props.curCity.id
94
       cityId: this.props.curCity.id
115
     })
115
     })
116
   }
116
   }
117
 
117
 
118
-  handleClick (value) {
118
+  handleClick(value) {
119
 
119
 
120
     this.setState({
120
     this.setState({
121
       current: value
121
       current: value
136
 
136
 
137
   }
137
   }
138
 
138
 
139
-  onViewDetail (item) {
139
+  onViewDetail(item) {
140
     Taro.navigateTo({
140
     Taro.navigateTo({
141
       url: `/pages/shop/detail/index?id=${item.goodsId}`
141
       url: `/pages/shop/detail/index?id=${item.goodsId}`
142
     })
142
     })
143
   }
143
   }
144
 
144
 
145
-  goPointRecords () {
145
+  goPointRecords() {
146
     const { person: { points } } = this.props.userInfo
146
     const { person: { points } } = this.props.userInfo
147
     Taro.navigateTo({
147
     Taro.navigateTo({
148
       url: `/pages/shop/integralDetail/index?points=` + points
148
       url: `/pages/shop/integralDetail/index?points=` + points
149
     })
149
     })
150
   }
150
   }
151
 
151
 
152
-  goPointRule () {
152
+  goPointRule() {
153
     Taro.navigateTo({
153
     Taro.navigateTo({
154
       url: `/pages/shop/rule/index`
154
       url: `/pages/shop/rule/index`
155
     })
155
     })
156
   }
156
   }
157
 
157
 
158
-  handleLocationClick () {
158
+  handleLocationClick() {
159
     Taro.navigateTo({
159
     Taro.navigateTo({
160
       url: `/pages/city/index`
160
       url: `/pages/city/index`
161
     })
161
     })
162
   }
162
   }
163
 
163
 
164
-  doSign () {
164
+  doSign() {
165
     const { user: { id, havaSigned } } = this.state
165
     const { user: { id, havaSigned } } = this.state
166
     if (havaSigned) {
166
     if (havaSigned) {
167
       return
167
       return
183
     })
183
     })
184
   }
184
   }
185
 
185
 
186
-  loadUserInfo () {
186
+  loadUserInfo() {
187
     // debugger
187
     // debugger
188
     queryUserInfo().then(user => {
188
     queryUserInfo().then(user => {
189
       console.log(user, "user")
189
       console.log(user, "user")
196
     })
196
     })
197
   }
197
   }
198
 
198
 
199
-  renderLogin () {
199
+  renderLogin() {
200
     return <Authorize></Authorize>
200
     return <Authorize></Authorize>
201
   }
201
   }
202
   handleBannerClick = (item) => {
202
   handleBannerClick = (item) => {
203
     console.log(this, "this")
203
     console.log(this, "this")
204
     this.redirectTo(item)
204
     this.redirectTo(item)
205
   }
205
   }
206
-  redirectTo ({ targetId, contentType, buildingId } = {}) {
206
+  redirectTo({ targetId, contentType, buildingId } = {}) {
207
     switch (contentType) {
207
     switch (contentType) {
208
       // 项目
208
       // 项目
209
       case 'project':
209
       case 'project':
239
           url: '/pages/news/detail/index?id=' + targetId
239
           url: '/pages/news/detail/index?id=' + targetId
240
         })
240
         })
241
         return;
241
         return;
242
+      // h5
243
+      case 'h5':
244
+        Taro.navigateTo({
245
+          url: '/pages/project/h5Page?id=' + targetId
246
+        })
247
+        return;
242
 
248
 
243
       // 其他
249
       // 其他
244
       case 'others':
250
       case 'others':
248
     }
254
     }
249
   }
255
   }
250
 
256
 
251
-  renderGoods () {
257
+  renderGoods() {
252
     const { goods: { records = [] } } = this.props
258
     const { goods: { records = [] } } = this.props
253
     const { goodsList, goodsBuilding, current } = this.state
259
     const { goodsList, goodsBuilding, current } = this.state
254
 
260
 
330
     )
336
     )
331
   }
337
   }
332
 
338
 
333
-  renderDetail () {
339
+  renderDetail() {
334
     const { user, points } = this.state
340
     const { user, points } = this.state
335
     const { userInfo: { person }, curCity } = this.props
341
     const { userInfo: { person }, curCity } = this.props
336
     const { bannerList = [] } = this.state
342
     const { bannerList = [] } = this.state
389
     );
395
     );
390
   }
396
   }
391
 
397
 
392
-  render () {
398
+  render() {
393
     const { person: { phone, tel } } = this.props.userInfo
399
     const { person: { phone, tel } } = this.props.userInfo
394
 
400
 
395
     return (
401
     return (

+ 3
- 2
src/utils/login.js View File

28
         Taro.setStorageSync('token', token)
28
         Taro.setStorageSync('token', token)
29
         Taro.setStorageSync('sessionKey', sessionKey)
29
         Taro.setStorageSync('sessionKey', sessionKey)
30
 
30
 
31
-        dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp } })
31
+        dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp, miniAuthorized } })
32
 
32
 
33
         // 用户信息已授权获取成功
33
         // 用户信息已授权获取成功
34
         if (miniAuthorized) {
34
         if (miniAuthorized) {
35
+          console.log(data, "data=============")
35
           // 保存用户信息
36
           // 保存用户信息
36
           // dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp } })
37
           // dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp } })
37
           callback && callback(data)
38
           callback && callback(data)
53
         }
54
         }
54
         ready.open()
55
         ready.open()
55
 
56
 
56
-        console.info('ready status2',ready)
57
+        console.info('ready status2', ready)
57
       })
58
       })
58
     }
59
     }
59
   })
60
   })