Ver código fonte

Merge branch 'v4' of http://git.ycjcjy.com/zhiyuxing/miniapp-v3 into v4

许静 5 anos atrás
pai
commit
0a7f38f8a6
4 arquivos alterados com 35 adições e 25 exclusões
  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 Ver arquivo

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

+ 3
- 3
src/pages/card/index.js Ver arquivo

@@ -470,9 +470,9 @@ export default class Index extends Component {
470 470
 
471 471
                 {/* 职位 */}
472 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 476
                 </View>
477 477
 
478 478
                 {/* 人气 */}

+ 15
- 19
src/pages/person/index.js Ver arquivo

@@ -75,21 +75,12 @@ export default class Person extends Component {
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 86
   getRoleName(type) {
@@ -138,6 +129,7 @@ export default class Person extends Component {
138 129
 
139 130
   renderDetail() {
140 131
     const { user, menus, isAgent, consultant, tourist } = this.state
132
+    const showQRCode = user.personType === ROLE_CODE['CONSULTANT'] || ROLE_CODE['ESTATE_AGENT'] || ROLE_CODE['CHANNEL_AGENT']
141 133
     // const isConsultant = user.personType == ROLE_CODE['CONSULTANT']
142 134
     // const isConsultant = user.personType
143 135
     return (
@@ -153,13 +145,17 @@ export default class Person extends Component {
153 145
               </View>
154 146
 
155 147
               <View className="info-text" onClick={this.goPersonDetail}>
156
-                <View className="info-text__name">{user.name ? user.name : user.nickname} {/* <Text className="iconfont icon-more"></Text> */}</View>
148
+                <View className="info-text__name">{user.name ? user.name : user.nickname}</View>
157 149
                 <View className="info-text__intro">积分 {user.points || 0}</View>
158 150
               </View>
159
-              <Navigator url={`/pages/person/spread/index`} className="tuiguang">
160
-                <Image style="width:40px;height:36px" src={require('@assets/mine/tuiguangma.png')} ></Image>
161
-                <View className="info-text__intro" style="margin:4px 0 0 4px">推广码</View>
162
-              </Navigator>
151
+              {
152
+                showQRCode && (
153
+                  <Navigator url={`/pages/person/spread/index`} className="tuiguang">
154
+                    <Image style="width:40px;height:36px" src={require('@assets/mine/tuiguangma.png')} ></Image>
155
+                    <View className="info-text__intro" style="margin:4px 0 0 4px">推广码</View>
156
+                  </Navigator>
157
+                )
158
+              }
163 159
             </View>
164 160
             {/* <View
165 161
               className={`sign__btn ${user.havaSigned && 'signed'}`}

+ 16
- 2
src/pages/person/menus.js Ver arquivo

@@ -28,7 +28,14 @@ const menus = [
28 28
       url: '/pages/agent/index',
29 29
       icon: icons.homepage,
30 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 41
       name: '成为经纪人',
@@ -53,6 +60,13 @@ const menus = [
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 71
       name: '我的活动',
58 72
       url: '/pages/activity/myActivity?from=mine',
@@ -88,7 +102,7 @@ const menus = [
88 102
       url: '/pages/person/profile/index',
89 103
       icon: icons.profile,
90 104
       extends: undefined,
91
-      userTypes: [CUSTOMER, ESTATE_AGENT, CHANNEL_AGENT],
105
+      userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
92 106
     },
93 107
     {
94 108
       name: '兑换记录',