xujing 5 년 전
부모
커밋
c23efd7c4e

+ 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.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 15
   weapp: {},
16 16
   h5: {}

+ 2
- 2
src/app.js 파일 보기

@@ -42,8 +42,8 @@ class App extends Component {
42 42
     pages: [
43 43
       'pages/project/index',
44 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 47
       'pages/person/customerAnalysis/myCustomer',
48 48
       'pages/person/accessRecord',
49 49
       'pages/shop/index',

+ 18
- 17
src/pages/person/customerAnalysis/index.js 파일 보기

@@ -6,8 +6,9 @@ import "taro-ui/dist/style/components/tabs.scss"
6 6
 import { savePoint, updatePoint } from '@services/common'
7 7
 import { queryMyCustomer } from '@services/person'
8 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 12
 @connect(({ user, city }) => ({ user, city }))
12 13
 export default class customer extends Taro.Component {
13 14
 
@@ -45,7 +46,7 @@ export default class customer extends Taro.Component {
45 46
   handleClick(value) {
46 47
     this.setState({
47 48
       current: value
48
-    }, )
49
+    })
49 50
   }
50 51
   toTransactionCustomer() {
51 52
     Taro.navigateTo({
@@ -59,12 +60,14 @@ export default class customer extends Taro.Component {
59 60
   }
60 61
 
61 62
   render() {
62
-  
63
+
64
+    const tabList = [{ title: '跟进客户' }, { title: '成交客户' }]
63 65
     const { customerNum, current } = this.state
64 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 71
             <View className="my-customer" onClick={this.toFollowUpCustomer} style="border-right:1px solid rgba(0,0,0,0.12)">
69 72
               <Image mode="widthFix" src={require('@assets/person/genjin.png')} className='img'></Image>
70 73
               <View className="name">跟进客户</View>
@@ -75,17 +78,15 @@ export default class customer extends Taro.Component {
75 78
               <View className="name">成交客户</View>
76 79
               <View className="name">{customerNum.clinchSum || 0}人</View>
77 80
             </View>
81
+          </View> */}
82
+        </AtTabsPane>
83
+        <AtTabsPane current={current} index={1} >
84
+          <View >
85
+            <TransactionCustomer />
78 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 파일 보기

@@ -1,17 +1,16 @@
1 1
 import Taro, { Component } from '@tarojs/taro'
2
-import { connect } from '@tarojs/redux'
3 2
 import * as actions from '@actions/user'
4 3
 import getUserPhone from '@utils/getUserPhone'
5 4
 import './index.scss'
6 5
 import { getHFiveDetail } from '@services/user'
7 6
 import ready from '@utils/ready'
8 7
 import { reportClient } from '@services/report'
8
+import { connect, getStore } 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')
12 12
 
13 13
 @connect(state => state.user, { ...actions })
14
-
15 14
 export default class Index extends Component {
16 15
 
17 16
   state = {
@@ -91,10 +90,13 @@ export default class Index extends Component {
91 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 98
         if (person.phone) {
99
+          this.onAvatarSuccess();
98 100
           this.success()
99 101
           this.setState({
100 102
             avatarVisible: false,
@@ -124,8 +126,12 @@ export default class Index extends Component {
124 126
   }
125 127
   // 授权用户信息
126 128
   getUserInfo() {
127
-    const { dispatchUpdateUserInfo } = this.props
129
+    const { dispatchUpdateUserInfo, extraInfo, miniApp, person, miniAuthorized } = this.props
128 130
     const sessionKey = Taro.getStorageSync('sessionKey')
131
+
132
+    const { dispatch } = getStore()
133
+
134
+    dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp, miniAuthorized } })
129 135
     Taro.showLoading()
130 136
     Taro.getUserInfo({
131 137
       lang: 'zh_CN',
@@ -193,7 +199,6 @@ export default class Index extends Component {
193 199
 
194 200
   renderMaskBanner() {
195 201
     const { avatarVisible, phoneVisible, pageInfo } = this.state
196
-
197 202
     return (
198 203
       <View>
199 204
         <Image src={pageInfo.middleImg || bgImg} mode='widthFix' className='bg_img'></Image>
@@ -201,8 +206,8 @@ export default class Index extends Component {
201 206
           {avatarVisible &&
202 207
             <View className="content">
203 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 211
               <Button className="btn" open-type="getUserInfo" lang="zh_CN" onGetUserInfo={this.getUserInfo}>好</Button>
207 212
             </View>
208 213
           }

+ 8
- 4
src/pages/project/index.js 파일 보기

@@ -300,8 +300,12 @@ export default class Index extends Component {
300 300
   }
301 301
 
302 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 311
   redirectTo({ targetId, contentType, buildingId } = {}) {
@@ -457,7 +461,7 @@ export default class Index extends Component {
457 461
     })
458 462
   }
459 463
   toNewsList() {
460
-    Taro.reLaunch({
464
+    Taro.switchTab({
461 465
       url: `/pages/activity/activity?projectIndex=1`
462 466
     })
463 467
   }
@@ -627,7 +631,7 @@ export default class Index extends Component {
627 631
                           newsList.map((list, inx) => {
628 632
                             return (
629 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 635
                                   {list.newsName}
632 636
                                 </View>
633 637
                               </SwiperItem>

+ 3
- 1
src/pages/project/index.scss 파일 보기

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

+ 1
- 0
src/pages/project/swiper/index.scss 파일 보기

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

+ 22
- 16
src/pages/shop/index.js 파일 보기

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

+ 3
- 2
src/utils/login.js 파일 보기

@@ -28,10 +28,11 @@ 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 } })
31
+        dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp, miniAuthorized } })
32 32
 
33 33
         // 用户信息已授权获取成功
34 34
         if (miniAuthorized) {
35
+          console.log(data, "data=============")
35 36
           // 保存用户信息
36 37
           // dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp } })
37 38
           callback && callback(data)
@@ -53,7 +54,7 @@ export default function (payload, callback) {
53 54
         }
54 55
         ready.open()
55 56
 
56
-        console.info('ready status2',ready)
57
+        console.info('ready status2', ready)
57 58
       })
58 59
     }
59 60
   })