张延森 5 年前
父节点
当前提交
d2d791fb79
共有 4 个文件被更改,包括 35 次插入25 次删除
  1. 1
    1
      project.config.json
  2. 3
    3
      src/pages/card/index.js
  3. 15
    19
      src/pages/person/index.js
  4. 16
    2
      src/pages/person/menus.js

+ 1
- 1
project.config.json 查看文件

2
 	"miniprogramRoot": "dist/",
2
 	"miniprogramRoot": "dist/",
3
 	"projectname": "mini-chengjiao",
3
 	"projectname": "mini-chengjiao",
4
 	"description": "dev环境",
4
 	"description": "dev环境",
5
-	"appid": "wxda1f84b79b3edeb3",
5
+	"appid": "wxd9ee3a9480a4e544",
6
 	"setting": {
6
 	"setting": {
7
 		"urlCheck": false,
7
 		"urlCheck": false,
8
 		"es6": false,
8
 		"es6": false,

+ 3
- 3
src/pages/card/index.js 查看文件

470
 
470
 
471
                 {/* 职位 */}
471
                 {/* 职位 */}
472
                 <View className='mycard__work'>
472
                 <View className='mycard__work'>
473
-                  <View className='row mycard__work-department'>{cardInfo.department}<Text className='txt'>部门</Text></View>
474
-                  <View className='row mycard__work-position'>{cardInfo.post}<Text className='txt'>职位</Text></View>
475
-                  <View className='row mycard__work-company'>{projectDetail.buildingName}<Text className='txt'>楼盘</Text></View>
473
+                  <View className='row mycard__work-department'>{cardInfo.department || ''}<Text className='txt'>部门</Text></View>
474
+                  <View className='row mycard__work-position'>{cardInfo.post || ''}<Text className='txt'>职位</Text></View>
475
+                  <View className='row mycard__work-company'>{projectDetail.buildingName || ''}<Text className='txt'>楼盘</Text></View>
476
                 </View>
476
                 </View>
477
 
477
 
478
                 {/* 人气 */}
478
                 {/* 人气 */}

+ 15
- 19
src/pages/person/index.js 查看文件

75
     })
75
     })
76
   }
76
   }
77
 
77
 
78
-  toClientPage() {
79
-    const { user: { customerNum } } = this.state
80
-
81
-    if (customerNum <= 0) {
82
-      Taro.showToast({ title: '暂无客户', icon: 'none' })
83
-      return
78
+  redirectTo = (url) => {
79
+    if (typeof url === 'function') {
80
+      Taro.navigateTo({ url: url(this.state.user) })
81
+    } else {
82
+      Taro.navigateTo({ url })
84
     }
83
     }
85
-
86
-    Taro.navigateTo({
87
-      url: '/pages/person/myGuest/index'
88
-    })
89
-  }
90
-
91
-  redirectTo(url) {
92
-    Taro.navigateTo({ url })
93
   }
84
   }
94
 
85
 
95
   getRoleName(type) {
86
   getRoleName(type) {
136
 
127
 
137
   renderDetail() {
128
   renderDetail() {
138
     const { user, menus, isAgent, consultant, tourist } = this.state
129
     const { user, menus, isAgent, consultant, tourist } = this.state
130
+    const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
139
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
131
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
140
     // const isConsultant = user.personType
132
     // const isConsultant = user.personType
141
     return (
133
     return (
151
               </View>
143
               </View>
152
 
144
 
153
               <View className="info-text" onClick={this.goPersonDetail}>
145
               <View className="info-text" onClick={this.goPersonDetail}>
154
-                <View className="info-text__name">{user.name ? user.name : user.nickname} {/* <Text className="iconfont icon-more"></Text> */}</View>
146
+                <View className="info-text__name">{user.name ? user.name : user.nickname}</View>
155
                 <View className="info-text__intro">积分 {user.points || 0}</View>
147
                 <View className="info-text__intro">积分 {user.points || 0}</View>
156
               </View>
148
               </View>
157
-              <Navigator url={`/pages/person/spread/index`} className="tuiguang">
158
-                <Image style="width:40px;height:36px" src={require('@assets/mine/tuiguangma.png')} ></Image>
159
-                <View className="info-text__intro" style="margin:4px 0 0 4px">推广码</View>
160
-              </Navigator>
149
+              {
150
+                showQRCode && (
151
+                  <Navigator url={`/pages/person/spread/index`} className="tuiguang">
152
+                    <Image style="width:40px;height:36px" src={require('@assets/mine/tuiguangma.png')} ></Image>
153
+                    <View className="info-text__intro" style="margin:4px 0 0 4px">推广码</View>
154
+                  </Navigator>
155
+                )
156
+              }
161
             </View>
157
             </View>
162
             {/* <View
158
             {/* <View
163
               className={`sign__btn ${user.havaSigned && 'signed'}`}
159
               className={`sign__btn ${user.havaSigned && 'signed'}`}

+ 16
- 2
src/pages/person/menus.js 查看文件

28
       url: '/pages/agent/index',
28
       url: '/pages/agent/index',
29
       icon: icons.homepage,
29
       icon: icons.homepage,
30
       extends: undefined,
30
       extends: undefined,
31
-      userTypes: [CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
31
+      userTypes: [ESTATE_AGENT, CHANNEL_AGENT],
32
+    },
33
+    {
34
+      name: '我的主页',
35
+      url: ({id}) => `/pages/card/index?id=${id}`,
36
+      icon: icons.homepage,
37
+      extends: undefined,
38
+      userTypes: [CONSULTANT],
32
     },
39
     },
33
     {
40
     {
34
       name: '成为经纪人',
41
       name: '成为经纪人',
53
     },
60
     },
54
   ],
61
   ],
55
   [
62
   [
63
+    {
64
+      name: '我的客户',
65
+      url: '/pages/person/myGuest/index',
66
+      icon: icons.activities,
67
+      extends: undefined,
68
+      userTypes: [CONSULTANT],
69
+    },
56
     {
70
     {
57
       name: '我的活动',
71
       name: '我的活动',
58
       url: '/pages/activity/myActivity?from=mine',
72
       url: '/pages/activity/myActivity?from=mine',
88
       url: '/pages/person/profile/index',
102
       url: '/pages/person/profile/index',
89
       icon: icons.profile,
103
       icon: icons.profile,
90
       extends: undefined,
104
       extends: undefined,
91
-      userTypes: [CUSTOMER, ESTATE_AGENT, CHANNEL_AGENT],
105
+      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
92
     },
106
     },
93
     {
107
     {
94
       name: '兑换记录',
108
       name: '兑换记录',