|
@@ -14,86 +14,86 @@ const list = [
|
14
|
14
|
name: "全部楼盘",
|
15
|
15
|
id: 1,
|
16
|
16
|
icon: require("@/assets/index-icon9.png"),
|
17
|
|
- router: "/pages/index/buildingList/index",
|
|
17
|
+ router: "/pages/index/buildingList/index"
|
18
|
18
|
},
|
19
|
19
|
{
|
20
|
20
|
name: "品牌地产",
|
21
|
21
|
id: 2,
|
22
|
22
|
icon: require("@/assets/index-icon8.png"),
|
23
|
|
- router: "/pages/index/brandList/index",
|
|
23
|
+ router: "/pages/index/brandList/index"
|
24
|
24
|
},
|
25
|
25
|
{
|
26
|
26
|
name: "近期开盘",
|
27
|
27
|
id: 3,
|
28
|
28
|
icon: require("@/assets/index-icon6.png"),
|
29
|
|
- router: `/pages/index/buildingList/index?isRecentOpening=1`,
|
|
29
|
+ router: `/pages/index/buildingList/index?isRecentOpening=1`
|
30
|
30
|
},
|
31
|
31
|
{
|
32
|
32
|
name: "帮我找房",
|
33
|
33
|
id: 4,
|
34
|
34
|
icon: require("@/assets/index-icon1.png"),
|
35
|
|
- router: "/pages/index/helpToFindHouse/index",
|
|
35
|
+ router: "/pages/index/helpToFindHouse/index"
|
36
|
36
|
},
|
37
|
37
|
{
|
38
|
38
|
name: "增值服务",
|
39
|
39
|
id: 5,
|
40
|
40
|
icon: require("@/assets/index-icon16.png"),
|
41
|
|
- router: "/pages/index/addedValueService/index",
|
|
41
|
+ router: "/pages/index/addedValueService/index"
|
42
|
42
|
},
|
43
|
43
|
{
|
44
|
44
|
name: "地图找房",
|
45
|
45
|
id: 6,
|
46
|
46
|
icon: require("@/assets/index-icon2.png"),
|
47
|
|
- router: "/pages/index/findHouseFromMap/index",
|
|
47
|
+ router: "/pages/index/findHouseFromMap/index"
|
48
|
48
|
},
|
49
|
49
|
{
|
50
|
50
|
name: "活动信息",
|
51
|
51
|
id: 7,
|
52
|
52
|
icon: require("@/assets/index-icon5.png"),
|
53
|
|
- router: "/pages/index/activityList/index?type=dymic",
|
|
53
|
+ router: "/pages/index/activityList/index?type=dymic"
|
54
|
54
|
},
|
55
|
55
|
{
|
56
|
56
|
name: "团房信息",
|
57
|
57
|
id: 8,
|
58
|
58
|
icon: require("@/assets/index-icon12.png"),
|
59
|
|
- router: "/pages/index/activityList/index?type=house",
|
|
59
|
+ router: "/pages/index/activityList/index?type=house"
|
60
|
60
|
},
|
61
|
61
|
{
|
62
|
62
|
name: "特价房",
|
63
|
63
|
id: 9,
|
64
|
64
|
icon: require("@/assets/index-icon11.png"),
|
65
|
|
- router: "/pages/index/specialPriceHouse/index",
|
|
65
|
+ router: "/pages/index/specialPriceHouse/index"
|
66
|
66
|
},
|
67
|
67
|
{
|
68
|
68
|
name: "康养",
|
69
|
69
|
id: 10,
|
70
|
70
|
icon: require("@/assets/index-icon7.png"),
|
71
|
|
- miniapp: MINI_KANGYANG,
|
|
71
|
+ miniapp: MINI_KANGYANG
|
72
|
72
|
},
|
73
|
73
|
{
|
74
|
74
|
name: "文旅商办",
|
75
|
75
|
id: 11,
|
76
|
76
|
icon: require("@/assets/index-icon13.png"),
|
77
|
|
- router: `/pages/index/buildingList/index?isCommerce=1`,
|
|
77
|
+ router: `/pages/index/buildingList/index?isCommerce=1`
|
78
|
78
|
},
|
79
|
79
|
{
|
80
|
80
|
name: "资讯",
|
81
|
81
|
id: 12,
|
82
|
82
|
icon: require("@/assets/index-icon15.png"),
|
83
|
|
- router: "/pages/index/newsList/index",
|
|
83
|
+ router: "/pages/index/newsList/index"
|
84
|
84
|
},
|
85
|
85
|
{
|
86
|
86
|
name: "购房百科",
|
87
|
87
|
id: 13,
|
88
|
88
|
icon: require("@/assets/index-icon4.png"),
|
89
|
|
- router: "/pages/index/encyclopediasOfBuyHouse/index",
|
|
89
|
+ router: "/pages/index/encyclopediasOfBuyHouse/index"
|
90
|
90
|
},
|
91
|
91
|
{
|
92
|
92
|
name: "房贷计算",
|
93
|
93
|
id: 14,
|
94
|
94
|
icon: require("@/assets/index-icon3.png"),
|
95
|
|
- router: "/pages/mine/mortgageCalc/index",
|
96
|
|
- },
|
|
95
|
+ router: "/pages/mine/mortgageCalc/index"
|
|
96
|
+ }
|
97
|
97
|
];
|
98
|
98
|
|
99
|
99
|
const brokerList = [
|
|
@@ -101,47 +101,62 @@ const brokerList = [
|
101
|
101
|
name: "我要推荐",
|
102
|
102
|
id: 25,
|
103
|
103
|
icon: require("@/assets/index-icon25.png"),
|
104
|
|
- router: "/pages/mine/addCustomer/index",
|
|
104
|
+ router: "/pages/mine/addCustomer/index"
|
105
|
105
|
},
|
106
|
106
|
{
|
107
|
107
|
name: "我的客户",
|
108
|
108
|
id: 23,
|
109
|
109
|
icon: require("@/assets/index-icon23.png"),
|
110
|
|
- router: "/pages/mine/myCustomer/index",
|
|
110
|
+ router: "/pages/mine/myCustomer/index"
|
111
|
111
|
},
|
112
|
112
|
{
|
113
|
113
|
name: "邀请好友",
|
114
|
114
|
id: 26,
|
115
|
115
|
icon: require("@/assets/index-icon26.png"),
|
116
|
|
- router: "/subpackages/pages/broker/invitation/index",
|
|
116
|
+ router: "/subpackages/pages/broker/invitation/index"
|
117
|
117
|
},
|
118
|
118
|
{
|
119
|
119
|
name: "我的钱包",
|
120
|
120
|
id: 24,
|
121
|
121
|
icon: require("@/assets/index-icon24.png"),
|
122
|
|
- router: "/subpackages/pages/broker/myWallet/index",
|
123
|
|
- },
|
|
122
|
+ router: "/subpackages/pages/broker/myWallet/index"
|
|
123
|
+ }
|
|
124
|
+];
|
|
125
|
+
|
|
126
|
+const customerList = [
|
|
127
|
+ {
|
|
128
|
+ name: "全民经纪人",
|
|
129
|
+ id: 25,
|
|
130
|
+ icon: require("@/assets/index-icon9.png"),
|
|
131
|
+ router: "/subpackages/pages/broker/toBeBroker/index"
|
|
132
|
+ }
|
124
|
133
|
];
|
125
|
134
|
|
126
|
135
|
export default function Menu() {
|
127
|
136
|
const kangyangRef = useRef();
|
128
|
|
- const city = useSelector((state) => state.city);
|
129
|
|
-
|
|
137
|
+ const city = useSelector(state => state.city);
|
|
138
|
+ const person = useSelector(({user})=>user.userInfo?.person)
|
130
|
139
|
const [List, setList] = useState(list);
|
131
|
140
|
|
132
|
141
|
useEffect(() => {
|
133
|
142
|
// 如果是全民经纪人添加专属菜单
|
134
|
143
|
if (city.curCity.shortname === BROKER_CITY) {
|
135
|
|
- setList([...brokerList, ...list]);
|
136
|
|
- } else {
|
|
144
|
+ if(person.personType===ROLE_CODE.BROKER){
|
|
145
|
+ setList([...brokerList, ...list]);
|
|
146
|
+ }else if(person.personType===ROLE_CODE.CUSTOMER){
|
|
147
|
+ setList([...customerList, ...list]);
|
|
148
|
+ }else{
|
|
149
|
+ setList(list);
|
|
150
|
+ }
|
|
151
|
+
|
|
152
|
+ } else {
|
137
|
153
|
setList(list);
|
138
|
154
|
}
|
139
|
155
|
}, [city.curCity.shortname]);
|
140
|
156
|
|
141
|
|
-
|
142
|
157
|
const MenuList = useMemo(() => {
|
143
|
158
|
let Arr = [];
|
144
|
|
- List.map((item) => {
|
|
159
|
+ List.map(item => {
|
145
|
160
|
if (Arr.length) {
|
146
|
161
|
if (Arr[Arr.length - 1].length < 10) {
|
147
|
162
|
Arr[Arr.length - 1].push({ ...item });
|
|
@@ -152,10 +167,10 @@ export default function Menu() {
|
152
|
167
|
Arr.push([{ ...item }]);
|
153
|
168
|
}
|
154
|
169
|
});
|
155
|
|
- return Arr
|
|
170
|
+ return Arr;
|
156
|
171
|
}, [List]);
|
157
|
172
|
|
158
|
|
- const MenuClick = (item) => {
|
|
173
|
+ const MenuClick = item => {
|
159
|
174
|
return () => {
|
160
|
175
|
if (item.router) {
|
161
|
176
|
Taro.navigateTo({ url: item.router });
|
|
@@ -170,7 +185,7 @@ export default function Menu() {
|
170
|
185
|
|
171
|
186
|
useEffect(() => {
|
172
|
187
|
// 获取康养小程序相关
|
173
|
|
- getSystemParsm(MINI_KANGYANG).then((res) => {
|
|
188
|
+ getSystemParsm(MINI_KANGYANG).then(res => {
|
174
|
189
|
if (res && res.paramValue) {
|
175
|
190
|
kangyangRef.current = JSON.parse(res.paramValue);
|
176
|
191
|
}
|