1007395918@qq.com 5 年之前
父節點
當前提交
6aa3a656bc
共有 4 個文件被更改,包括 248 次插入32 次删除
  1. 164
    0
      src/components/indexMenus/icons.js
  2. 51
    0
      src/components/indexMenus/index.js
  3. 21
    0
      src/components/indexMenus/index.scss
  4. 12
    32
      src/pages/project/index.js

+ 164
- 0
src/components/indexMenus/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/project/highlyRecommented',
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 }

+ 51
- 0
src/components/indexMenus/index.js 查看文件

@@ -0,0 +1,51 @@
1
+import Taro, { Component } from '@tarojs/taro'
2
+// import { queryIndexIcons } from '@/services/common'
3
+// import { menus } from './icons.js'
4
+import { connect } from '@tarojs/redux'
5
+// import { ROLE_CODE } from '@/constants/user'
6
+import './index.scss'
7
+
8
+@connect(
9
+    state => ({ ...state.project, ...state.city, ...state.user, system: state.system })
10
+)
11
+
12
+export default class Menus extends Component {
13
+
14
+    static defaultProps = {
15
+        menusList: []
16
+    }
17
+    componentWillMount() {
18
+        console.log(this.props, "this.propsthis.propsthis.propsthis.propsthis.propsthis.props")
19
+    }
20
+
21
+    toMenuePage(item) {
22
+        if (item.switchTab) {
23
+            Taro.switchTab({
24
+                url: item.url,
25
+            })
26
+            return
27
+        }
28
+        if (item.city) {
29
+            Taro.navigateTo({
30
+                url: item.url + this.props.curCity.id,
31
+            })
32
+            return
33
+        }
34
+        Taro.navigateTo({
35
+            url: item.url,
36
+        })
37
+    }
38
+    render() {
39
+        const { menusList } = this.props
40
+        return (
41
+            <View className="mune-box" >
42
+                {menusList.map((item, ginx) => (
43
+                    <View onClick={() => this.toMenuePage(item)} className="mune-item" key={`menu- ${ginx}`}>
44
+                        <Image className="icon" src={item.icon} ></Image>
45
+                        <View className="mune-text">{item.name}</View>
46
+                    </View>
47
+                ))}
48
+            </View>
49
+        )
50
+    }
51
+}

+ 21
- 0
src/components/indexMenus/index.scss 查看文件

@@ -0,0 +1,21 @@
1
+.mune-box{
2
+    width:690px;
3
+    height:188px;
4
+    background:#fff;
5
+    box-shadow:0px 4px 12px 0px rgba(0,0,0,0.12);
6
+    border-radius:12px;
7
+    display: flex;
8
+    align-items: center;
9
+    justify-content: space-between;
10
+    margin: -94px auto 0 auto;
11
+    position: relative;
12
+    .mune-item{
13
+      text-align: center;
14
+      width: 25%;
15
+      .icon{
16
+        width:84px;
17
+        height:84px;
18
+      }
19
+    }
20
+  }
21
+  

+ 12
- 32
src/pages/project/index.js 查看文件

@@ -20,6 +20,7 @@ import * as actions from '@/actions/project'
20 20
 import { transferImage } from '@/utils/tools'
21 21
 import Notice from '@/components/Notice'
22 22
 import { menus } from './icons.js'
23
+import Menus from '@/components/indexMenus'
23 24
 
24 25
 const bgImg = "https://njcj.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1578724562550-background.png"
25 26
 // import { getIndexPreloadData } from '@/utils/preload'
@@ -91,7 +92,7 @@ export default class Index extends Component {
91 92
       { iconName: '推荐客户', code: 'refercustomers' },
92 93
       { iconName: '购房百科', code: 'buyingEncyclopedia' },
93 94
       { iconName: '地图找房', code: 'findRoom' },
94
-
95
+      
95 96
     ]
96 97
     const newArr = [];
97 98
 
@@ -110,12 +111,7 @@ export default class Index extends Component {
110 111
     //     const [roleSetting, roleName] = this.getRoleName(users.personType)
111 112
 
112 113
     //     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
-    //     })
114
+
119 115
     //   })
120 116
   }
121 117
 
@@ -562,25 +558,7 @@ export default class Index extends Component {
562 558
       url: '/pages/policy/index?from=mine',
563 559
     })
564 560
   }
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 561
 
579
-    Taro.navigateTo({
580
-      url: item.url,
581
-    })
582
-
583
-  }
584 562
   handleNewsbannerShow = (visiable) => {
585 563
     this.setState({
586 564
       newsShow: visiable
@@ -634,15 +612,16 @@ export default class Index extends Component {
634 612
                 </View>
635 613
               </View>
636 614
               {/* 菜单栏 */}
637
-              <View className="mune-box" style={menusList.length == 3 ? "padding:0 8%" : ""}>
615
+              <Menus menusList={menusList}></Menus>
616
+              {/* <View className="mune-box" style={menusList.length == 3 ? "padding:0 8%" : ""}>
638 617
                 {menusList.map((item, ginx) => (
639 618
                   <View onClick={() => this.toMenuePage(item)} className="mune-item" key={`menu- ${ginx}`}>
640 619
                     <Image className="icon" src={item.icon} ></Image>
641 620
                     <View className="mune-text">{item.name}</View>
642 621
                   </View>
643
-                ))}
622
+                ))} */}
644 623
 
645
-                {/* <View className="mune-item" onClick={this.toShopMallPage}>
624
+              {/* <View className="mune-item" onClick={this.toShopMallPage}>
646 625
                   <Image src={require('@/assets/index/mall-icon.png')} className='icon'></Image>
647 626
                   <View className="mune-text">
648 627
                     积分商城
@@ -669,14 +648,15 @@ export default class Index extends Component {
669 648
                     地图找房
670 649
                 </View>
671 650
                 </View> */}
672
-              </View>
673
-              <View style={(newsShow || propagandaBanner.length > 0) ? "border-bottom:20rpx solid #f5f5f5" : ''}>
651
+              {/* </View> */}
652
+              <View style={propagandaBanner.length > 0 ? "border-bottom:20rpx solid #f5f5f5" : ''}>
653
+                {/* <View style={(newsShow || propagandaBanner.length > 0) ? "border-bottom:20rpx solid #f5f5f5" : ''}> */}
674 654
                 {/* 展示位轮播图 */}
675 655
                 {
676 656
                   this.state.visPropagandaBanner && propagandaBanner.length > 0 &&
677 657
                   <View
678 658
                     style={{
679
-                      position: 'relative', padding: '20px 15px 0 15px'
659
+                      position: 'relative', padding: '20px 15px'
680 660
                     }}>
681 661
                     <BannerTwo
682 662
                       style={{
@@ -691,7 +671,7 @@ export default class Index extends Component {
691 671
                   </View>
692 672
                 }
693 673
                 {/* 资讯 */}
694
-                <Newsbanner showNesBox={this.handleNewsbannerShow} cityId={curCity.id} onClick={this.handleNoticeClick} onClickMore={this.toNewsList} />
674
+                {/* <Newsbanner showNesBox={this.handleNewsbannerShow} cityId={curCity.id} onClick={this.handleNoticeClick} onClickMore={this.toNewsList} /> */}
695 675
               </View >
696 676
               {/* 热门活动*/}
697 677
               {