1002884655 3 лет назад
Родитель
Сommit
070ef3355e
3 измененных файлов: 70 добавлений и 0 удалений
  1. 31
    0
      src/components/Adv/index.jsx
  2. 36
    0
      src/components/Adv/style.scss
  3. 3
    0
      src/pages/index/index.jsx

+ 31
- 0
src/components/Adv/index.jsx Просмотреть файл

@@ -0,0 +1,31 @@
1
+import { useState, useEffect } from 'react'
2
+import { Image } from '@tarojs/components'
3
+import './style.scss'
4
+
5
+export default (props) => {
6
+
7
+  const { show = false } = props
8
+
9
+  const [ShowAdv, setShowAdv] = useState(show)
10
+
11
+  const ImgClick = () => {
12
+
13
+  }
14
+
15
+  const Close = () => {
16
+    setShowAdv(false)
17
+  }
18
+
19
+  return (
20
+    <view className='components Adv' style={{display: ShowAdv ? 'block' : 'none'}}>
21
+      <view className='centerLabel'>
22
+        <view>
23
+          <view className='Img' onClick={ImgClick}>
24
+            <Image mode='scaleToFill' src={null}></Image>
25
+          </view>
26
+          <text className='iconfont icon-guanbi' onClick={Close}></text>
27
+        </view>
28
+      </view>
29
+    </view>
30
+  )
31
+}

+ 36
- 0
src/components/Adv/style.scss Просмотреть файл

@@ -0,0 +1,36 @@
1
+.components.Adv {
2
+  width: 100%;
3
+  position: fixed;
4
+  top: 0;
5
+  left: 0;
6
+  bottom: 0;
7
+  z-index: 1000;
8
+  background: rgba(0, 0, 0, 0.6);
9
+  >view {
10
+    width: 100%;
11
+    >view {
12
+      padding: 0 134px;
13
+      position: relative;
14
+      overflow: hidden;
15
+      text-align: center;
16
+      >.Img {
17
+        width: 100%;
18
+        position: relative;
19
+        overflow: hidden;
20
+        padding-bottom: 150%;
21
+        background: #eee;
22
+        border-radius: 24px;
23
+        >image {
24
+          width: 100%;
25
+          height: 100%;
26
+        }
27
+      }
28
+      >text {
29
+        display: inline-block;
30
+        font-size: 60px;
31
+        color: #fff;
32
+        margin-top: 30px;
33
+      }
34
+    }
35
+  }
36
+}

+ 3
- 0
src/pages/index/index.jsx Просмотреть файл

@@ -4,6 +4,7 @@ import Taro from '@tarojs/taro'
4 4
 import { ScrollView } from '@tarojs/components'
5 5
 import withLayout from '@/layout'
6 6
 import ProjectListItem from '@/components/ProjectListItem/index'
7
+import Adv from '@/components/Adv/index'
7 8
 import { fetch } from '@/utils/request'
8 9
 import { API_BANNER_LIST, API_INDEX_PROJECTS } from '@/constants/api'
9 10
 
@@ -54,6 +55,8 @@ export default withLayout(() => {
54 55
   return (
55 56
     <view className='Page Index'>
56 57
 
58
+      <Adv show></Adv>
59
+
57 60
       <ScrollView scroll-y>
58 61
         <view className='PageContent'>
59 62