林凡 il y a 5 ans
Parent
révision
f5480fdd1d
4 fichiers modifiés avec 30 ajouts et 11 suppressions
  1. 1
    1
      package-lock.json
  2. 1
    1
      package.json
  3. 14
    4
      src/pages/person/accessRecord.js
  4. 14
    5
      src/pages/person/index.js

+ 1
- 1
package-lock.json Voir le fichier

@@ -609,7 +609,7 @@
609 609
     },
610 610
     "@tarojs/plugin-sass": {
611 611
       "version": "1.3.25",
612
-      "resolved": "https://registry.npm.taobao.org/@tarojs/plugin-sass/download/@tarojs/plugin-sass-1.3.25.tgz",
612
+      "resolved": "https://registry.npm.taobao.org/@tarojs/plugin-sass/download/@tarojs/plugin-sass-1.3.25.tgz?cache=0&sync_timestamp=1575429381399&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40tarojs%2Fplugin-sass%2Fdownload%2F%40tarojs%2Fplugin-sass-1.3.25.tgz",
613 613
       "integrity": "sha1-8eKTL0aBnae56J9KmFvnCz2s0Kk=",
614 614
       "dev": true,
615 615
       "requires": {

+ 1
- 1
package.json Voir le fichier

@@ -30,7 +30,7 @@
30 30
     "@tarojs/plugin-babel": "1.3.25",
31 31
     "@tarojs/plugin-csso": "1.3.25",
32 32
     "@tarojs/plugin-less": "1.3.25",
33
-    "@tarojs/plugin-sass": "1.3.25",
33
+    "@tarojs/plugin-sass": "^1.3.25",
34 34
     "@tarojs/plugin-uglifyjs": "1.3.25",
35 35
     "@tarojs/webpack-runner": "1.3.25",
36 36
     "@types/react": "^16.4.6",

+ 14
- 4
src/pages/person/accessRecord.js Voir le fichier

@@ -53,12 +53,22 @@ export default class Person extends Component {
53 53
   loadList(pageNumber) {
54 54
     console.log(this.props, "this.props")
55 55
     const { userInfo: { person } } = this.props
56
-    const payload = {
57
-      userId: person.userId,
58
-      pageNumber,
59
-      pageSize: 5
56
+    let payload
57
+    if(person.userId){
58
+      payload = {
59
+        userId: person.userId,
60
+        pageNumber,
61
+        pageSize: 5
62
+      }
63
+    }else{
64
+     payload = {
65
+       userId: Taro.getStorageSync('userId'),
66
+       pageNumber,
67
+       pageSize: 5
68
+     }
60 69
     }
61 70
     getConsulantVisitRecord(payload).then(res => {
71
+
62 72
       const { records, list, total, current, pages } = res || {}
63 73
       const _list = records || list || []
64 74
       const newList = current <= 1 ? _list : this.state.recordList.concat(_list)

+ 14
- 5
src/pages/person/index.js Voir le fichier

@@ -94,13 +94,22 @@ export default class Person extends Component {
94 94
     }
95 95
     else {
96 96
       putRegisterConsultant().then(res => {
97
+        Taro.setStorageSync('userId',res.userId)
98
+        this.loadUserInfo()
99
+
100
+        // this.setState({
101
+        //   consultant:true,
102
+        //   user:{
103
+        //     personType:'CONSULTANT'
104
+        //   }
105
+        // },this.loadUserInfo())
97 106
 
98 107
         // if (res) {
99
-          Taro.showToast({
100
-            title: "匹配成功,请退出小程序重新登录即可",
101
-            icon: "none",
102
-            duration: 3000
103
-          })
108
+          // Taro.showToast({
109
+          //   title: "匹配成功,请退出小程序重新登录即可",
110
+          //   icon: "none",
111
+          //   duration: 3000
112
+          // })
104 113
         // } else {
105 114
         //   Taro.showToast({
106 115
         //     title: "匹配失败,请联系相关管理人员",