浏览代码

静态页面

1002884655 3 年前
父节点
当前提交
ec8a69ee1d
共有 2 个文件被更改,包括 51 次插入31 次删除
  1. 18
    2
      src/pages/index/components/HotRecommend/index.jsx
  2. 33
    29
      src/pages/index/components/HotRecommend/index.scss

+ 18
- 2
src/pages/index/components/HotRecommend/index.jsx 查看文件

@@ -2,6 +2,7 @@ import { useState, useEffect } from 'react'
2 2
 import { useSelector } from 'react-redux'
3 3
 import Taro from '@tarojs/taro'
4 4
 import { queryActivityList } from '@/services/activity'
5
+import { Swiper, SwiperItem } from '@tarojs/components'
5 6
 import '@/assets/css/iconfont.css'
6 7
 import './index.scss'
7 8
 
@@ -61,11 +62,26 @@ export default function HotRecommend (props) {
61 62
           }
62 63
         </view>
63 64
         <view className='Content' onClick={toDetail}>
64
-          <view className='flex-h'>
65
+          {/* <view className='flex-h'>
65 66
             <text className='flex-item'>{CurrentContentInfo.title || '暂无活动'}</text>
66 67
             <text onClick={ToMore}>{CurrentId === 'dymic' ? '更多活动' : '更多团房'}</text>
67 68
           </view>
68
-          <text>{CurrentContentInfo.halfTitle}</text>
69
+          <text>{CurrentContentInfo.halfTitle}</text> */}
70
+          <Swiper autoplay interval={5000} vertical>
71
+            {
72
+              list.map((item, index) => (
73
+                <SwiperItem key={`Banner-${index}`}>
74
+                  <view className='swiper-item'>
75
+                    <view className='flex-h'>
76
+                      <text className='flex-item'>{item.title || '暂无活动'}</text>
77
+                      <text onClick={ToMore}>{CurrentId === 'dymic' ? '更多活动' : '更多团房'}</text>
78
+                    </view>
79
+                    <text>{item.halfTitle}</text>
80
+                  </view>
81
+                </SwiperItem>
82
+              ))
83
+            }
84
+          </Swiper>
69 85
         </view>
70 86
       </view>
71 87
     </view>

+ 33
- 29
src/pages/index/components/HotRecommend/index.scss 查看文件

@@ -26,38 +26,42 @@
26 26
     > .Content {
27 27
       box-sizing: border-box;
28 28
       border: 2px solid #eee;
29
-      padding: 20px;
30
-      > .flex-h {
31
-        align-items: center;
32
-        margin-top: 10px;
33
-        > .flex-item {
34
-          font-size: 30px;
35
-          color: #193c83;
36
-          font-weight: bold;
37
-          white-space: nowrap;
38
-          overflow: hidden;
39
-          text-overflow: ellipsis;
40
-          margin-right: 20px;
41
-          & + text {
42
-            font-size: 28px;
29
+      padding: 30px 20px 20px;
30
+      height: 166px;
31
+      position: relative;
32
+      overflow: hidden;
33
+      .swiper-item {
34
+        > .flex-h {
35
+          align-items: center;
36
+          > .flex-item {
37
+            font-size: 30px;
43 38
             color: #193c83;
44
-            line-height: 56px;
45
-            box-sizing: border-box;
46
-            border: 2px solid #193c83;
47
-            border-radius: 30px;
48
-            width: 144px;
49
-            text-align: center;
39
+            font-weight: bold;
40
+            white-space: nowrap;
41
+            overflow: hidden;
42
+            text-overflow: ellipsis;
43
+            margin-right: 20px;
44
+            & + text {
45
+              font-size: 28px;
46
+              color: #193c83;
47
+              line-height: 56px;
48
+              box-sizing: border-box;
49
+              border: 2px solid #193c83;
50
+              border-radius: 30px;
51
+              width: 144px;
52
+              text-align: center;
53
+            }
50 54
           }
51 55
         }
52
-      }
53
-      >text {
54
-        font-size: 26px;
55
-        line-height: 1;
56
-        display: block;
57
-        padding-bottom: 20px;
58
-        margin-top: 6px;
59
-        text-indent: 26px;
60
-        color: #7F7F7F;
56
+        > text {
57
+          font-size: 26px;
58
+          line-height: 1;
59
+          display: block;
60
+          padding-bottom: 20px;
61
+          margin-top: 6px;
62
+          text-indent: 26px;
63
+          color: #7f7f7f;
64
+        }
61 65
       }
62 66
     }
63 67
   }