浏览代码

animation

xujing 5 年前
父节点
当前提交
c562415ba2
共有 3 个文件被更改,包括 54 次插入34 次删除
  1. 29
    24
      src/components/consultant/index.js
  2. 24
    9
      src/components/consultant/index.scss
  3. 1
    1
      src/pages/news/detail/index.js

+ 29
- 24
src/components/consultant/index.js 查看文件

12
         style: {}
12
         style: {}
13
     }
13
     }
14
     handleClick() {
14
     handleClick() {
15
-        this.setState({
16
-            show: false
17
-        })
15
+        setTimeout(() => {
16
+            this.setState({
17
+                show: false
18
+            })
19
+        }, 260)
18
     }
20
     }
19
     handleClickTwo() {
21
     handleClickTwo() {
20
-        this.setState({
21
-            show: true
22
-        })
22
+        setTimeout(() => {
23
+            this.setState({
24
+                show: true
25
+            })
26
+        }, 260)
27
+
23
     }
28
     }
24
     render() {
29
     render() {
25
         const { show } = this.state
30
         const { show } = this.state
26
         return (
31
         return (
27
             <View>
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
                     </View>
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
                 <View>
53
                 <View>
49
                 </View>
54
                 </View>

+ 24
- 9
src/components/consultant/index.scss 查看文件

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

+ 1
- 1
src/pages/news/detail/index.js 查看文件

246
               </ScrollView>
246
               </ScrollView>
247
               
247
               
248
               <Notice></Notice>
248
               <Notice></Notice>
249
-              <BackHomeBtn ></BackHomeBtn>
249
+              <BackHomeBtn style="bottom:160px" ></BackHomeBtn>
250
               {/* <Consultant></Consultant> */}
250
               {/* <Consultant></Consultant> */}
251
 
251
 
252
               <View className="bot-nav flex">
252
               <View className="bot-nav flex">