1007395918@qq.com 5 年之前
父節點
當前提交
ea9c8ba768
共有 5 個檔案被更改,包括 231 行新增138 行删除
  1. 二進制
      src/assets/index/calculator-icon.png
  2. 二進制
      src/assets/index/recommend.png
  3. 0
    133
      src/pages/project/icon.js
  4. 164
    0
      src/pages/project/icons.js
  5. 67
    5
      src/pages/project/index.js

二進制
src/assets/index/calculator-icon.png 查看文件


二進制
src/assets/index/recommend.png 查看文件


+ 0
- 133
src/pages/project/icon.js 查看文件

@@ -1,133 +0,0 @@
1
-import { ROLE_CODE } from '@/constants/user'
2
-
3
-const icons = {
4
-    shop: require('@/assets/index/mall-icon.png'),
5
-    encyclopedia: require('@/assets/index/encyclopedia-icon.png'),
6
-    recommend: require('@/assets/index/recommend-icon.png'),
7
-    map: require('@/assets/index/map-icon.png'),
8
-}
9
-
10
-const DRIFT = ROLE_CODE['DRIFT']
11
-const CUSTOMER = ROLE_CODE['CUSTOMER']
12
-const CONSULTANT = ROLE_CODE['CONSULTANT']
13
-const ESTATE_AGENT = ROLE_CODE['ESTATE_AGENT']
14
-const CHANNEL_AGENT = ROLE_CODE['CHANNEL_AGENT']
15
-
16
-const menus = [
17
-    [
18
-        {
19
-            name: '积分商城',
20
-            url: '/pages/shop/index',
21
-            icon: icons.shop,
22
-            userTypes: [CUSTOMER, CONSULTANT, DRIFT],
23
-            style: '',
24
-            switchTab: true
25
-        },
26
-        {
27
-            name: '房贷计算器',
28
-            url: '/pages/toolKit/index',
29
-            icon: icons.calculator,
30
-            userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
31
-        },
32
-        {
33
-            name: '推荐客户',
34
-            url: `/useless/pages/agent/recommend/index?type=index&cityId=` + this.props.curCity.id
35
-            icon: icons.recommend,
36
-            userTypes: [CUSTOMER, DRIFT],
37
-        },
38
-        {
39
-            name: '地图找房',
40
-            url: '/pages/project/map/index'
41
-            icon: icons.map,
42
-            userTypes: [CUSTOMER, CONSULTANT, DRIFT],
43
-        },
44
-        {
45
-            name: '购房百科',
46
-            url: '/pages/policy/index?from=mine',
47
-            icon: icons.encyclopedia,
48
-            userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
49
-        },
50
-        {
51
-            name: '我的主页',
52
-            url: ({ id }) => `/pages/card/index?id=${id}`,
53
-            icon: icons.homepage,
54
-            userTypes: [CONSULTANT],
55
-            style: '',
56
-        },
57
-        {
58
-            name: '盘客工具',
59
-            url: '/useless/pages/person/customerAnalysis/index',
60
-            icon: icons.customerAnalysis,
61
-            userTypes: [CONSULTANT],
62
-            style: '',
63
-        },
64
-        {
65
-            name: '客户分析',
66
-            url: '/useless/pages/person/customerAnalysis/analysis',
67
-            icon: icons.fenxi,
68
-            userTypes: [CONSULTANT],
69
-            style: '',
70
-        },
71
-        {
72
-            name: '我的分享',
73
-            url: '/pages/person/myShare/index',
74
-            icon: icons.share,
75
-            userTypes: [CONSULTANT],
76
-            style: '',
77
-        },
78
-        {
79
-            name: '推荐客户',
80
-            url: '/useless/pages/agent/client/index',
81
-            icon: icons.recommend,
82
-            userTypes: [CUSTOMER, ESTATE_AGENT, CHANNEL_AGENT],
83
-            style: '',
84
-        },
85
-        {
86
-            name: '我的活动',
87
-            url: '/pages/activity/myActivity?from=mine',
88
-            icon: icons.activities,
89
-            userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
90
-        },
91
-        {
92
-            name: '我的拼团',
93
-            url: '/pages/activity/assemblePage',
94
-            icon: icons.regiment,
95
-            userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
96
-        },
97
-        {
98
-            name: '我的助力',
99
-            url: '/pages/activity/assistancePage',
100
-            icon: icons.help,
101
-            userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
102
-        },
103
-    ],
104
-    [
105
-        {
106
-            name: '我的收藏',
107
-            url: '/pages/person/favorite/index',
108
-            icon: icons.collection,
109
-            userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
110
-        },
111
-        {
112
-            name: '我的资料',
113
-            url: '/useless/pages/person/profile/index',
114
-            icon: icons.profile,
115
-            userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
116
-        },
117
-        {
118
-            name: '兑换记录',
119
-            url: '/useless/pages/shop/record/index',
120
-            icon: icons.exchange,
121
-            userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
122
-        },
123
-        {
124
-            name: '意见反馈',
125
-            url: '/useless/pages/person/feedback/index',
126
-            icon: icons.feedback,
127
-            userTypes: [CUSTOMER, CONSULTANT, ESTATE_AGENT, CHANNEL_AGENT],
128
-        },
129
-    ],
130
-
131
-]
132
-
133
-export { icons, menus }

+ 164
- 0
src/pages/project/icons.js 查看文件

@@ -0,0 +1,164 @@
1
+import { ROLE_CODE } from '@/constants/user'
2
+
3
+const icons = {
4
+    shop: require('@/assets/index/mall-icon.png'),
5
+    encyclopedia: require('@/assets/index/encyclopedia-icon.png'),
6
+    recommend: require('@/assets/index/recommend-icon.png'),
7
+    map: require('@/assets/index/map-icon.png'),
8
+    calculator: require('@/assets/index/calculator-icon.png'),
9
+    Highlyrecommented: require('@/assets/index/recommend.png'),
10
+}
11
+
12
+const DRIFT = ROLE_CODE['DRIFT']
13
+const CUSTOMER = ROLE_CODE['CUSTOMER']
14
+const CONSULTANT = ROLE_CODE['CONSULTANT']
15
+// const ESTATE_AGENT = ROLE_CODE['ESTATE_AGENT']
16
+// const CHANNEL_AGENT = ROLE_CODE['CHANNEL_AGENT']
17
+
18
+const menus = [
19
+
20
+    {
21
+        name: '积分商城',
22
+        url: '/pages/shop/index',
23
+        icon: icons.shop,
24
+        userTypes: [CUSTOMER, CONSULTANT, DRIFT],
25
+        // style: '',
26
+        switchTab: true,
27
+        code: 'integralMall',
28
+    },
29
+    {
30
+        name: '购房百科',
31
+        url: '/pages/policy/index?from=mine',
32
+        icon: icons.encyclopedia,
33
+        userTypes: [CUSTOMER, CONSULTANT],
34
+        code: 'buyingEncyclopedia'
35
+    },
36
+    {
37
+        name: '推荐客户',
38
+        url: '/useless/pages/agent/recommend/index?type=index&cityId=',
39
+        icon: icons.recommend,
40
+        userTypes: [CUSTOMER, DRIFT],
41
+        code: 'refercustomers',
42
+        city: true,
43
+    },
44
+    {
45
+        name: '地图找房',
46
+        url: '/pages/project/map/index',
47
+        icon: icons.map,
48
+        userTypes: [CUSTOMER, CONSULTANT, DRIFT],
49
+        code: 'findRoom'
50
+    },
51
+    {
52
+        name: '重点推荐',
53
+        // url: '/pages/toolKit/index',
54
+        icon: icons.Highlyrecommented,
55
+        userTypes: [CUSTOMER, CONSULTANT],
56
+        code: 'Highlyrecommented'
57
+    },
58
+    {
59
+        name: '房贷计算器',
60
+        url: '/pages/toolKit/index',
61
+        icon: icons.calculator,
62
+        userTypes: [CUSTOMER, CONSULTANT],
63
+        code: 'MortgageCalculator'
64
+    },
65
+
66
+    {
67
+        name: '楼盘列表',
68
+        // url: '/pages/toolKit/index',
69
+        // icon: icons.calculator,
70
+        userTypes: [CUSTOMER, CONSULTANT],
71
+        code: 'PropertyListing'
72
+    },
73
+    {
74
+        name: '活动资讯',
75
+        // url: '/pages/toolKit/index',
76
+        // icon: icons.calculator,
77
+        userTypes: [CUSTOMER, CONSULTANT],
78
+        code: 'EventInformation',
79
+        switchTab: true,
80
+    },
81
+    {
82
+        name: '热门活动',
83
+        // url: '/pages/toolKit/index',
84
+        // icon: icons.calculator,
85
+        userTypes: [CUSTOMER, CONSULTANT],
86
+        code: 'Popularactivities',
87
+        switchTab: true,
88
+    },
89
+    {
90
+        name: '最新资讯',
91
+        // url: '/pages/toolKit/index',
92
+        // icon: icons.calculator,
93
+        userTypes: [CUSTOMER, CONSULTANT],
94
+        code: 'LatestInformation',
95
+        switchTab: true,
96
+    },
97
+    {
98
+        name: '我的客户',
99
+        // url: '/pages/toolKit/index',
100
+        // icon: icons.calculator,
101
+        userTypes: [CUSTOMER, CONSULTANT],
102
+        code: 'Myclient',
103
+    },
104
+    {
105
+        name: '我的活动',
106
+        url: '/pages/activity/myActivity?from=mine',
107
+        icon: icons.activities,
108
+        userTypes: [CUSTOMER, CONSULTANT],
109
+        code: 'MyActivities'
110
+    },
111
+    {
112
+        name: '我的助力',
113
+        url: '/pages/activity/assistancePage',
114
+        icon: icons.help,
115
+        userTypes: [CUSTOMER, CONSULTANT],
116
+        code: 'Myhelp'
117
+    },
118
+    {
119
+        name: '我的拼团',
120
+        url: '/pages/activity/assemblePage',
121
+        icon: icons.regiment,
122
+        userTypes: [CUSTOMER, CONSULTANT],
123
+        code: 'Mygroup'
124
+    },
125
+    {
126
+        name: '我的收藏',
127
+        url: '/pages/person/favorite/index',
128
+        icon: icons.collection,
129
+        userTypes: [CUSTOMER, CONSULTANT],
130
+        code: 'MyFavorites'
131
+    },
132
+    {
133
+        name: '我的资料',
134
+        url: '/useless/pages/person/profile/index',
135
+        icon: icons.profile,
136
+        userTypes: [CUSTOMER, CONSULTANT],
137
+        code: 'MyInformation'
138
+    },
139
+    {
140
+        name: '我的消息',
141
+        url: '/useless/pages/person/profile/index',
142
+        icon: icons.profile,
143
+        userTypes: [CUSTOMER, CONSULTANT],
144
+        code: 'Mymessage'
145
+    },
146
+    {
147
+        name: '兑换记录',
148
+        url: '/useless/pages/shop/record/index',
149
+        icon: icons.exchange,
150
+        userTypes: [CUSTOMER, CONSULTANT],
151
+        code: 'Exchangerecords'
152
+    },
153
+    {
154
+        name: '意见反馈',
155
+        url: '/useless/pages/person/feedback/index',
156
+        icon: icons.feedback,
157
+        userTypes: [CUSTOMER, CONSULTANT],
158
+        code: 'Feedback'
159
+    },
160
+
161
+
162
+]
163
+
164
+export { icons, menus }

+ 67
- 5
src/pages/project/index.js 查看文件

@@ -19,6 +19,7 @@ import { getStore, connect } from '@tarojs/redux'
19 19
 import * as actions from '@/actions/project'
20 20
 import { transferImage } from '@/utils/tools'
21 21
 import Notice from '@/components/Notice'
22
+import { menus } from './icons.js'
22 23
 
23 24
 const bgImg = "https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1578724562550-background.png"
24 25
 // import { getIndexPreloadData } from '@/utils/preload'
@@ -55,6 +56,7 @@ export default class Index extends Component {
55 56
     propagandaBanner: [],
56 57
     newsShow: false,
57 58
     city: null,
59
+    menusList: [],
58 60
   }
59 61
 
60 62
   componentWillMount() {
@@ -68,7 +70,7 @@ export default class Index extends Component {
68 70
       this.loadData({ curCity: city })
69 71
 
70 72
       this.getIndexShareInfo()
71
-
73
+      this.getIndexIcons()
72 74
       savePoint({
73 75
         event: 'index',
74 76
         eventType: 'main',
@@ -83,6 +85,40 @@ export default class Index extends Component {
83 85
     })
84 86
   }
85 87
 
88
+  getIndexIcons() {
89
+    const iconList = [
90
+      { iconName: '积分商城', code: 'integralMall' },
91
+      { iconName: '推荐客户', code: 'refercustomers' },
92
+      { iconName: '购房百科', code: 'buyingEncyclopedia' },
93
+      { iconName: '地图找房', code: 'findRoom' },
94
+
95
+    ]
96
+    const newArr = [];
97
+
98
+    iconList.forEach(item => {
99
+      menus.forEach(menu => {
100
+        if (menu.code == item.code) {
101
+          newArr.push(menu);
102
+        }
103
+      })
104
+    })
105
+    const { userInfo: { person: { personType } } } = this.props
106
+    this.setState({
107
+      menusList: personType == ROLE_CODE['CONSULTANT'] ? newArr.filter(item => item.code != 'refercustomers') : newArr
108
+    })
109
+    //   queryIndexIcons().then(res => {
110
+    //     const [roleSetting, roleName] = this.getRoleName(users.personType)
111
+
112
+    //     this.setState({
113
+    //       users,
114
+    //       phone: users.phone,
115
+    //       icons: icons.map(group => group.filter(x => x.userTypes.indexOf(users.personType) > -1)),
116
+    //       roleName,
117
+    //       ...roleSetting,
118
+    //     })
119
+    //   })
120
+  }
121
+
86 122
   getIndexShareInfo() {
87 123
     getIndexShare().then(res => {
88 124
 
@@ -526,6 +562,25 @@ export default class Index extends Component {
526 562
       url: '/pages/policy/index?from=mine',
527 563
     })
528 564
   }
565
+  toMenuePage(item) {
566
+    if (item.switchTab) {
567
+      Taro.switchTab({
568
+        url: item.url,
569
+      })
570
+      return
571
+    }
572
+    if (item.city) {
573
+      Taro.navigateTo({
574
+        url: item.url + this.props.curCity.id,
575
+      })
576
+      return
577
+    }
578
+
579
+    Taro.navigateTo({
580
+      url: item.url,
581
+    })
582
+
583
+  }
529 584
   handleNewsbannerShow = (visiable) => {
530 585
     this.setState({
531 586
       newsShow: visiable
@@ -533,7 +588,7 @@ export default class Index extends Component {
533 588
   }
534 589
   render() {
535 590
     const { curCity } = this.props
536
-    const { achieve, helpGroupList, propagandaBanner, newsShow } = this.state
591
+    const { achieve, helpGroupList, propagandaBanner, newsShow, menusList } = this.state
537 592
     const { userInfo: { person: { personType, phone } } } = this.props
538 593
     const { unReadNum, userInfo: { person } } = this.props
539 594
     return (
@@ -579,8 +634,15 @@ export default class Index extends Component {
579 634
                 </View>
580 635
               </View>
581 636
               {/* 菜单栏 */}
582
-              <View className="mune-box" style={personType == ROLE_CODE['CONSULTANT'] ? "padding:0 8%" : ""}>
583
-                <View className="mune-item" onClick={this.toShopMallPage}>
637
+              <View className="mune-box" style={menusList.length == 3 ? "padding:0 8%" : ""}>
638
+                {menusList.map((item, ginx) => (
639
+                  <View onClick={() => this.toMenuePage(item)} className="mune-item" key={`menu- ${ginx}`}>
640
+                    <Image className="icon" src={item.icon} ></Image>
641
+                    <View className="mune-text">{item.name}</View>
642
+                  </View>
643
+                ))}
644
+
645
+                {/* <View className="mune-item" onClick={this.toShopMallPage}>
584 646
                   <Image src={require('@/assets/index/mall-icon.png')} className='icon'></Image>
585 647
                   <View className="mune-text">
586 648
                     积分商城
@@ -606,7 +668,7 @@ export default class Index extends Component {
606 668
                   <View className="mune-text">
607 669
                     地图找房
608 670
                 </View>
609
-                </View>
671
+                </View> */}
610 672
               </View>
611 673
               <View style={(newsShow || propagandaBanner.length > 0) ? "border-bottom:20rpx solid #f5f5f5" : ''}>
612 674
                 {/* 展示位轮播图 */}