xujing преди 5 години
родител
ревизия
2bb1993518
променени са 2 файла, в които са добавени 25 реда и са изтрити 17 реда
  1. 18
    11
      src/onlineSelling/components/ConsultantItem/index.js
  2. 7
    6
      src/onlineSelling/components/ConsultantItem/index.scss

+ 18
- 11
src/onlineSelling/components/ConsultantItem/index.js Целия файл

@@ -4,30 +4,37 @@ import './index.scss'
4 4
 export default function ConsultantItem(props) {
5 5
 
6 6
   const { data = {}, style, type, tips } = props
7
-
7
+  const handleHomepage = (e) => {
8
+    e.stopPropagation()
9
+    if (props.onHomepage) {
10
+      props.onHomepage()
11
+    }
12
+  }
8 13
   return (
9 14
     <Block>
10 15
       {(!data || !data.id) && tips == 'show' && (<View style="margin-top: 20px; text-align: center">暂无数据</View>)}
11 16
       {
12 17
         (data && (data.id || data.consultantPersonId)) &&
13 18
         (
14
-          <View className="card-item" style={style}>
15
-            <View onClick={() => props.onClick && props.onClick(data)}>
19
+          <View className="card-item" style={style} onClick={() => props.onClick && props.onClick(data)}>
20
+
21
+            <View className="flex-info" >
16 22
               <Image src={data.photo || data.avatar} className='avatar' ></Image>
17
-              {
18
-                (data.name || data.userName) &&
19
-                (
23
+              <View>
24
+                {
25
+                  (data.name || data.userName) &&
20 26
                   <View className="name">
21 27
                     {data.name || data.userName}
22 28
                     <Image src={require('@/assets/person/card.png')} className='card' ></Image>
23 29
                     {type == 'raiseProfile' && <View className="tip">您的专属置业顾问</View>}
24 30
                   </View>
25
-                )
26
-              }
27
-              <View className="phone">{data.phone}</View>
31
+                }
32
+                <View className="phone">{data.phone}</View>
33
+              </View>
28 34
             </View>
29
-            {!type && <View className="home" onClick={props.onHomepage}>主页</View>}
30
-            {type == 'raiseProfile' && <View className="contact" onClick={props.contactClick}>联系我<Text className="right-icon"></Text></View>}
35
+
36
+            {!type && <View className="home" onClick={handleHomepage}>主页</View>}
37
+            {type == 'raiseProfile' && <View className="contact" onClick={}>联系我<Text className="right-icon"></Text></View>}
31 38
           </View >
32 39
         )
33 40
       }

+ 7
- 6
src/onlineSelling/components/ConsultantItem/index.scss Целия файл

@@ -12,15 +12,18 @@
12 12
     width:92px;
13 13
     height:92px;
14 14
     border-radius:50%;
15
+    margin-right: 20px;
16
+  }
17
+  .flex-info{
18
+    display: flex;
19
+    align-items: center;
15 20
   }
16 21
   .name{
17 22
     font-size: 32px;
18 23
     color: #333;
19 24
     display: flex;
20 25
     align-items: center;
21
-    position: absolute;
22
-    left: 134px;
23
-    top:30px;
26
+    margin-bottom: 12px;
24 27
     .card{
25 28
       width:48px;
26 29
       height:35px;
@@ -36,14 +39,12 @@
36 39
   .phone{
37 40
     font-size: 28px;
38 41
     color: #666;
39
-    position: absolute;
40
-    left: 134px;
41
-    bottom:30px;
42 42
     font-weight:300;
43 43
   }
44 44
   .home{
45 45
     font-size: 28px;
46 46
     color: #333;
47
+    padding: 40px 24px;
47 48
   }
48 49
   .contact{
49 50
     position: absolute;