林凡 5 years ago
parent
commit
83347f1c92

+ 1
- 1
config/dev.js View File

11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
11
     // WSS_HOST: '"wss://lt.pawoma.cn"',
12
     // HOST: '"http://192.168.2.51:8080"',
12
     // HOST: '"http://192.168.2.51:8080"',
13
     // WSS_HOST: '"ws://192.168.2.51:8080"',
13
     // WSS_HOST: '"ws://192.168.2.51:8080"',
14
-    Version:'V3.5.2.2_12101'
14
+    Version:'V3.5.2.2_12102'
15
   },
15
   },
16
   weapp: {},
16
   weapp: {},
17
   h5: {}
17
   h5: {}

+ 1
- 1
config/prod.js View File

9
     WSS_HOST: '"wss://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
-    Version:'V3.5.2.2_12101'
12
+    Version:'V3.5.2.2_12102'
13
   },
13
   },
14
   weapp: {},
14
   weapp: {},
15
   h5: {}
15
   h5: {}

+ 0
- 1
src/pages/activity/myActivity.js View File

80
       })
80
       })
81
     }
81
     }
82
 
82
 
83
-
84
   }
83
   }
85
 
84
 
86
   onPullDownRefresh = async (rest) => {
85
   onPullDownRefresh = async (rest) => {

+ 1
- 0
src/pages/person/accessRecord.js View File

53
   loadList(pageNumber) {
53
   loadList(pageNumber) {
54
     console.log(this.props, "this.props")
54
     console.log(this.props, "this.props")
55
     const { userInfo: { person } } = this.props
55
     const { userInfo: { person } } = this.props
56
+
56
     let payload
57
     let payload
57
     if(person.userId){
58
     if(person.userId){
58
       payload = {
59
       payload = {

+ 3
- 1
src/pages/project/h5Page.js View File

159
         }
159
         }
160
       } else {
160
       } else {
161
         Taro.hideLoading()
161
         Taro.hideLoading()
162
+        this.setState({
163
+          avatarVisible: true,
164
+        })
162
         if (phone) {
165
         if (phone) {
163
           this.setState({
166
           this.setState({
164
             phoneVisible: false,
167
             phoneVisible: false,
165
-            avatarVisible: true,
166
           })
168
           })
167
         }
169
         }
168
       }
170
       }

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

17
 import { getStore, connect } from '@tarojs/redux'
17
 import { getStore, connect } from '@tarojs/redux'
18
 import * as actions from '@actions/project'
18
 import * as actions from '@actions/project'
19
 import { transferImage } from '@utils/tools'
19
 import { transferImage } from '@utils/tools'
20
-import QQMapWX from '@lib/qqmap-wx-jssdk.min'
21
 import Notice from '@components/Notice'
20
 import Notice from '@components/Notice'
22
 import Authorize from '@components/authorize'
21
 import Authorize from '@components/authorize'
23
 
22
 
51
   }
50
   }
52
 
51
 
53
   componentWillMount() {
52
   componentWillMount() {
54
-    this.qqmapsdk = new QQMapWX({
55
-      key: 'TIIBZ-ZJG33-52T3L-Y3X4Q-NWKLV-KUB3B'
56
-    })
57
     ready.queue(() => {
53
     ready.queue(() => {
58
       this.getLocation()
54
       this.getLocation()
59
 
55
 
97
   }
93
   }
98
 
94
 
99
   getLocation() {
95
   getLocation() {
96
+    debugger
97
+    console.log('-----this.props-->', this.props)
100
     const { cityList, userInfo: { person: { org } } } = this.props
98
     const { cityList, userInfo: { person: { org } } } = this.props
101
     let defaultCity = cityList.filter(item => {
99
     let defaultCity = cityList.filter(item => {
102
       return item.id == org.defaultCityId
100
       return item.id == org.defaultCityId

+ 21
- 5
src/reducers/user.js View File

1
+import { mergeNotNull } from '@utils/tools'
2
+
1
 import {
3
 import {
2
   USER_INFO,
4
   USER_INFO,
3
   // USER_QUERY_INFO,
5
   // USER_QUERY_INFO,
20
 export default function user(state = INITIAL_STATE, action) {
22
 export default function user(state = INITIAL_STATE, action) {
21
   switch (action.type) {
23
   switch (action.type) {
22
     case USER_INFO: {
24
     case USER_INFO: {
23
-      return {
24
-        ...state,
25
-        userInfo: {
26
-          ...action.payload
25
+      if (!(state.userInfo || {}).person) {
26
+        return {
27
+          ...state,
28
+          userInfo: {
29
+            ...action.payload
30
+          }
31
+        }
32
+      } else {
33
+        const { person } = action.payload || {}
34
+        const newPerson = mergeNotNull(state.userInfo.person, person)
35
+        return {
36
+          ...state,
37
+          userInfo: {
38
+            ...state.userInfo,
39
+            ...action.payload,
40
+            person: newPerson,
41
+          }
27
         }
42
         }
28
       }
43
       }
29
     }
44
     }
41
     //   }
56
     //   }
42
     // }
57
     // }
43
     case UPDATE_USER_INFO: {
58
     case UPDATE_USER_INFO: {
44
-      const { person, extraInfo, miniApp = {} } = state.userInfo
45
       // debugger
59
       // debugger
60
+      const { person, extraInfo, miniApp = {} } = state.userInfo
61
+      
46
       return {
62
       return {
47
         ...state,
63
         ...state,
48
         userInfo: {
64
         userInfo: {

+ 1
- 1
src/utils/login.js View File

27
         const { dispatch } = getStore()
27
         const { dispatch } = getStore()
28
         Taro.setStorageSync('token', token)
28
         Taro.setStorageSync('token', token)
29
         Taro.setStorageSync('sessionKey', sessionKey)
29
         Taro.setStorageSync('sessionKey', sessionKey)
30
-
31
         dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp } })
30
         dispatch({ type: USER_INFO, payload: { extraInfo, person, miniApp } })
32
 
31
 
33
         // 用户信息已授权获取成功
32
         // 用户信息已授权获取成功
52
             })
51
             })
53
           }
52
           }
54
         }
53
         }
54
+
55
         ready.open()
55
         ready.open()
56
 
56
 
57
         console.info('ready status2', ready)
57
         console.info('ready status2', ready)

+ 25
- 0
src/utils/tools.js View File

16
   return n > 0 ? '*'.repeat(n - 1).split('*') : []
16
   return n > 0 ? '*'.repeat(n - 1).split('*') : []
17
 }
17
 }
18
 
18
 
19
+/**
20
+ * 将 b 中不为 null 或者 undefined 的值合并到 a 中
21
+ * @param {*} a 
22
+ * @param {*} b 
23
+ */
24
+export function mergeNotNull(a, b) {
25
+  const bKeys = Object.keys(b || {})
26
+  if (!bKeys.length) {
27
+    return a
28
+  }
29
+
30
+  let res = { ...(a || {}) }
31
+
32
+  bKeys.forEach(k => {
33
+    const v = b[k]
34
+    if (v === null || v === undefined) {
35
+      return
36
+    }
37
+
38
+    res[k] = v
39
+  })
40
+
41
+  return res
42
+}
43
+
19
 /**
44
 /**
20
  * 
45
  * 
21
  * @param {*} img 
46
  * @param {*} img