Browse Source

animation

xujing 5 years ago
parent
commit
c562415ba2

+ 29
- 24
src/components/consultant/index.js View File

@@ -12,38 +12,43 @@ export default class Index extends Component {
12 12
         style: {}
13 13
     }
14 14
     handleClick() {
15
-        this.setState({
16
-            show: false
17
-        })
15
+        setTimeout(() => {
16
+            this.setState({
17
+                show: false
18
+            })
19
+        }, 260)
18 20
     }
19 21
     handleClickTwo() {
20
-        this.setState({
21
-            show: true
22
-        })
22
+        setTimeout(() => {
23
+            this.setState({
24
+                show: true
25
+            })
26
+        }, 260)
27
+
23 28
     }
24 29
     render() {
25 30
         const { show } = this.state
26 31
         return (
27 32
             <View>
28
-                {show &&
29
-                    <View className="consultant" style={this.props.style} onClick={this.handleClick}  >
30
-                        <Image src={require('@assets/person/left.png')}  className='left-img'></Image>
31
-                        <Image src="http://pic3.zhimg.com/50/v2-55f854baa56381deff541029d51662d0_hd.jpg" className='img'></Image>
32
-                        <View className="text">哈哈哈</View>
33
-                    </View>
34
-                }
35
-                {!show &&
36
-                    <View className="consultant-more" style={this.props.style} >
37
-                         <Image src={require('@assets/person/cancel.png')}  onClick={this.handleClickTwo}className='cancel-img'></Image>
38
-                        <Image src="http://pic3.zhimg.com/50/v2-55f854baa56381deff541029d51662d0_hd.jpg" className='touxiang'></Image>
39
-                        <View className="text">
40
-                            <View className="name">哈哈哈</View>
41
-                            <View className="company">南京橙蕉互动数字科技有限公司</View>
42
-                        </View>
43
-                        <Image src={require('@assets/person/phone.png')} className='phone-img'></Image>
44
-                        <Image src={require('@assets/person/message.png')} className='message-img'></Image>
33
+                {/* {show && */}
34
+                <View className={show ? "consultant show" : "consultant hide"} style={this.props.style} onClick={this.handleClick}  >
35
+                    <Image src={require('@assets/person/left.png')} className='left-img'></Image>
36
+                    <Image src="http://pic3.zhimg.com/50/v2-55f854baa56381deff541029d51662d0_hd.jpg" className='img'></Image>
37
+                    <View className="text">哈哈哈</View>
38
+                </View>
39
+                {/* } */}
40
+                {/* {!show && */}
41
+                <View className={show ? "consultant-more hide " : "consultant-more more-show "} style={this.props.style} >
42
+                    <Image src={require('@assets/person/cancel.png')} onClick={this.handleClickTwo} className='cancel-img'></Image>
43
+                    <Image src="http://pic3.zhimg.com/50/v2-55f854baa56381deff541029d51662d0_hd.jpg" className='touxiang'></Image>
44
+                    <View className="text">
45
+                        <View className="name">哈哈哈</View>
46
+                        <View className="company">南京橙蕉互动数字科技有限公司</View>
45 47
                     </View>
46
-                }
48
+                    <Image src={require('@assets/person/phone.png')} className='phone-img'></Image>
49
+                    <Image src={require('@assets/person/message.png')} className='message-img'></Image>
50
+                </View>
51
+                {/* } */}
47 52
 
48 53
                 <View>
49 54
                 </View>

+ 24
- 9
src/components/consultant/index.scss View File

@@ -1,7 +1,7 @@
1 1
 @import "@styles/theme.scss";
2 2
 .consultant {
3 3
   position: fixed;
4
-  bottom: 140px;
4
+  bottom: 169px;
5 5
   right: 0;
6 6
   height: 84px;
7 7
   background-color: #fff;
@@ -10,12 +10,12 @@
10 10
   z-index: 99;
11 11
   display: flex;
12 12
   align-items: center;
13
-  padding: 0 10px;
13
+ 
14 14
   transition: all 1s;
15 15
   .left-img{
16 16
       width: 18px;
17 17
       height: 34px;
18
-      margin-right: 12px;
18
+      margin: 0 12px;
19 19
   }
20 20
   .img{
21 21
     width: 48px;
@@ -26,13 +26,28 @@
26 26
   .text {
27 27
     color: $primary-color;
28 28
     font-size: 32px;
29
-    margin: 0 10px;
29
+    margin: 0 20px 0 10px;
30 30
   }
31 31
 
32 32
 }
33
-.consultant-more{
33
+    .show{
34
+    opacity: 1;
35
+    width: auto;
36
+    transition: 0.3s all ease-in;
37
+    }
38
+    .hide{
39
+    width: 0;
40
+    opacity: 0;
41
+    transition: 0.3s all ease-in;
42
+    }
43
+    .more-show{
34 44
     width:706px;
35
-    height:142px;
45
+    opacity: 1;
46
+    transition: 0.3s all ease-in;
47
+    }
48
+
49
+.consultant-more{
50
+    height:140px;
36 51
     background:rgba(0,0,0,0.5);
37 52
     border-radius:146px 0px 0px 146px;
38 53
     position: fixed;
@@ -40,11 +55,11 @@
40 55
     right: 0;
41 56
     display: flex;
42 57
     align-items: center;
43
-    padding: 0 16px;
58
+   
44 59
     .cancel-img{
45 60
         width: 36px;
46 61
         height: 36px;
47
-        margin-right: 16px;
62
+        margin: 0 16px;
48 63
       }
49 64
     .touxiang{
50 65
         width: 86px;
@@ -75,6 +90,6 @@
75 90
     .message-img{
76 91
         width:42px;
77 92
         height:42px;
78
-        margin-left: 30px;
93
+        margin: 0 30px;
79 94
     }
80 95
 }

+ 1
- 1
src/pages/news/detail/index.js View File

@@ -246,7 +246,7 @@ export default class NewsDetail extends Component {
246 246
               </ScrollView>
247 247
               
248 248
               <Notice></Notice>
249
-              <BackHomeBtn ></BackHomeBtn>
249
+              <BackHomeBtn style="bottom:160px" ></BackHomeBtn>
250 250
               {/* <Consultant></Consultant> */}
251 251
 
252 252
               <View className="bot-nav flex">