1002884655 4 年 前
コミット
36f191a083

+ 43
- 0
src/components/ProjectListItem/index.jsx ファイルの表示

@@ -0,0 +1,43 @@
1
+import React, { useState, useEffect } from 'react'
2
+import './index.scss'
3
+
4
+export default function ProjectListItem (props) {
5
+  const { Data = {} } = props
6
+  return (
7
+    <view className='components ProjectListItem flex-h'>
8
+      <view className='Img'>
9
+        <view>
10
+          {
11
+            Data.img &&
12
+            <Image mode='aspectFill' className='centerLabel' src={Data.img || null} />
13
+          }
14
+        </view>
15
+      </view>
16
+      <view className='flex-item'>
17
+        <view className='Name flex-h'>
18
+          <view className='flex-item'>
19
+            <text>楼盘名称</text>
20
+          </view>
21
+          <text>约</text>
22
+          <text>20000m²</text>
23
+        </view>
24
+        <text className='Address'>楼盘地址sdsdsdsdsds</text>
25
+        <view className='Tags'>
26
+          <text>标签1</text>
27
+          <text>标签2</text>
28
+          <text>标签3</text>
29
+        </view>
30
+        <view className='ShareInfo'>
31
+          {/* <text className='iconfont'></text> */}
32
+          <text>3次分享</text>
33
+          <view className='Users'>
34
+            <view></view>
35
+            <view></view>
36
+            <view></view>
37
+          </view>
38
+          <text>...9人围观</text>
39
+        </view>
40
+      </view>
41
+    </view>
42
+  )
43
+}

+ 111
- 0
src/components/ProjectListItem/index.scss ファイルの表示

@@ -0,0 +1,111 @@
1
+.components.ProjectListItem {
2
+  > .Img {
3
+    width: 260px;
4
+    position: relative;
5
+    overflow: hidden;
6
+    margin-right: 20px;
7
+    > view {
8
+      width: 100%;
9
+      padding-bottom: 62%;
10
+      background: #ccc;
11
+      position: relative;
12
+      overflow: hidden;
13
+      > image {
14
+        width: 100%;
15
+        height: 100%;
16
+      }
17
+    }
18
+  }
19
+  > .flex-item {
20
+    > .Name {
21
+      align-items: center;
22
+      > .flex-item {
23
+        margin-right: 10px;
24
+        > text {
25
+          display: block;
26
+          font-size: 28px;
27
+          font-weight: bold;
28
+          color: #000;
29
+          line-height: 40px;
30
+          white-space: nowrap;
31
+          overflow: hidden;
32
+          text-overflow: ellipsis;
33
+        }
34
+      }
35
+      > text {
36
+        font-size: 24px;
37
+        line-height: 40px;
38
+        color: #000;
39
+        &:last-child {
40
+          color: red;
41
+        }
42
+      }
43
+    }
44
+    > .Address {
45
+      display: block;
46
+      font-size: 24px;
47
+      color: #666;
48
+      line-height: 40px;
49
+      white-space: nowrap;
50
+      overflow: hidden;
51
+      text-overflow: ellipsis;
52
+    }
53
+    > .Tags {
54
+      font-size: 0;
55
+      white-space: nowrap;
56
+      > text {
57
+        display: inline-block;
58
+        vertical-align: middle;
59
+        font-size: 24px;
60
+        padding: 0 10px;
61
+        line-height: 36px;
62
+        background: orangered;
63
+        color: #333;
64
+        margin-right: 10px;
65
+      }
66
+    }
67
+    > .ShareInfo {
68
+      font-size: 0;
69
+      white-space: nowrap;
70
+      margin-top: 10px;
71
+      > text {
72
+        display: inline-block;
73
+        vertical-align: middle;
74
+        font-size: 24px;
75
+        color: #333;
76
+        line-height: 40px;
77
+        margin-left: 10px;
78
+        &:first-child {
79
+          margin-left: 0;
80
+        }
81
+      }
82
+      > .Users {
83
+        display: inline-block;
84
+        vertical-align: middle;
85
+        font-size: 0;
86
+        white-space: nowrap;
87
+        margin-left: 30px;
88
+        > view {
89
+          display: inline-block;
90
+          vertical-align: middle;
91
+          width: 40px;
92
+          height: 40px;
93
+          background: #ccc;
94
+          border-radius: 100%;
95
+          margin-left: -10px;
96
+          position: relative;
97
+          &:nth-child(1) {
98
+            z-index: 1;
99
+            margin-left: 0;
100
+          }
101
+          &:nth-child(2) {
102
+            z-index: 2;
103
+          }
104
+          &:nth-child(3) {
105
+            z-index: 3;
106
+          }
107
+        }
108
+      }
109
+    }
110
+  }
111
+}

+ 19
- 1
src/pages/index/components/IndexColumnTitle/index.scss ファイルの表示

@@ -1,3 +1,21 @@
1 1
 .components.IndexColumnTitle {
2 2
   align-items: center;
3
-}
3
+  padding: 0 30px;
4
+  margin-top: 30px;
5
+  > text {
6
+    font-size: 32px;
7
+    font-weight: bold;
8
+    color: #000;
9
+    line-height: 40px;
10
+  }
11
+  > .More {
12
+    white-space: nowrap;
13
+    font-size: 0;
14
+    > text {
15
+      display: inline-block;
16
+      vertical-align: middle;
17
+      font-size: 24px;
18
+      line-height: 40px;
19
+    }
20
+  }
21
+}

+ 27
- 0
src/pages/index/components/IndexHotActivity/index.jsx ファイルの表示

@@ -0,0 +1,27 @@
1
+import React, { useState, useEffect } from 'react'
2
+import './index.scss'
3
+import { ScrollView, Image } from '@tarojs/components'
4
+
5
+export default function IndexHotActivity (props) {
6
+  const { List = [] } = props
7
+  return (
8
+    <view className='components IndexHotActivity'>
9
+      <ScrollView scroll-x={true}>
10
+        <view className='Content'>
11
+          {
12
+            List.map((item, index) => (
13
+              <view className={`IndexHotActivity-${index}`}>
14
+                <view>
15
+                  {
16
+                    item.img &&
17
+                    <Image mode='aspectFill' className='centerLabel' src={item.img || null} />
18
+                  }
19
+                </view>
20
+              </view>
21
+            ))
22
+          }
23
+        </view>
24
+      </ScrollView>
25
+    </view>
26
+  )
27
+}

+ 30
- 0
src/pages/index/components/IndexHotActivity/index.scss ファイルの表示

@@ -0,0 +1,30 @@
1
+.components.IndexHotActivity {
2
+  margin-top: 30px;
3
+  .Content {
4
+    position: relative;
5
+    font-size: 0;
6
+    white-space: nowrap;
7
+    > view {
8
+      display: inline-block;
9
+      vertical-align: middle;
10
+      margin-right: 30px;
11
+      width: calc((100vw - 90px) / 2);
12
+      position: relative;
13
+      &:first-child {
14
+        margin-left: 30px;
15
+      }
16
+      > view {
17
+        width: 100%;
18
+        position: relative;
19
+        overflow: hidden;
20
+        padding-bottom: 56.25%;
21
+        background: #ccc;
22
+        height: 0;
23
+        > image {
24
+          width: 100%;
25
+          height: 100%;
26
+        }
27
+      }
28
+    }
29
+  }
30
+}

+ 11
- 0
src/pages/index/index.jsx ファイルの表示

@@ -5,6 +5,8 @@ import IndexBanner from './components/IndexBanner/index'
5 5
 import IndexMenu from './components/IndexMenu/index'
6 6
 import SubBanner from './components/SubBanner/index'
7 7
 import IndexColumnTitle from './components/IndexColumnTitle/index'
8
+import IndexHotActivity from './components/IndexHotActivity/index'
9
+import ProjectListItem from '../../components/ProjectListItem/index'
8 10
 import { ScrollView } from '@tarojs/components'
9 11
 
10 12
 export default withLayout((props) => {
@@ -13,6 +15,7 @@ export default withLayout((props) => {
13 15
   const [BannerList, setBannerList] = useState(['', '', ''])
14 16
   const [MenuList, setMenuList] = useState(['', '', '', '', '', '', '', '', '', ''])
15 17
   const [SubBannerList, setSubBannerList] = useState(['', '', ''])
18
+  const [ProjectList, setProjectList] = useState(['', '', ''])
16 19
   const [IsPull, setPull] = useState(false)
17 20
   const [PullTimer, setPullTimer] = useState(null)
18 21
 
@@ -63,6 +66,7 @@ export default withLayout((props) => {
63 66
           {/* hot activity */}
64 67
           <view className='HotActivity'>
65 68
             <IndexColumnTitle Name='热门活动'></IndexColumnTitle>
69
+            <IndexHotActivity List={['', '', '']}></IndexHotActivity>
66 70
           </view>
67 71
 
68 72
           {/* all project */}
@@ -73,6 +77,13 @@ export default withLayout((props) => {
73 77
                 <text>地图找房</text>
74 78
               </view>
75 79
             </IndexColumnTitle>
80
+            <view className='ProjectList'>
81
+              {
82
+                ProjectList.map((item, index) => (
83
+                  <ProjectListItem Data={item} key={`ProjectListItem-${index}`}></ProjectListItem>
84
+                ))
85
+              }
86
+            </view>
76 87
           </view>
77 88
 
78 89
           {/* bottom */}

+ 33
- 0
src/pages/index/index.scss ファイルの表示

@@ -61,6 +61,39 @@
61 61
           }
62 62
         }
63 63
       }
64
+      > .AllProject {
65
+        .ToMap {
66
+          margin-left: 20px;
67
+          font-size: 0;
68
+          white-space: nowrap;
69
+          > text {
70
+            font-size: 24px;
71
+            line-height: 40px;
72
+            display: inline-block;
73
+            vertical-align: middle;
74
+          }
75
+        }
76
+        > .ProjectList {
77
+          padding: 0 30px;
78
+          position: relative;
79
+          overflow: hidden;
80
+          > view {
81
+            margin-top: 30px;
82
+          }
83
+        }
84
+      }
85
+      > .PageBottom {
86
+        text-align: center;
87
+        font-size: 0;
88
+        white-space: nowrap;
89
+        > text {
90
+          display: inline-block;
91
+          font-size: 28px;
92
+          color: #666;
93
+          line-height: 40px;
94
+          margin: 20px auto;
95
+        }
96
+      }
64 97
     }
65 98
   }
66 99
 }