1002884655 4 lat temu
rodzic
commit
05417e91b4

+ 27
- 0
src/components/WuYeBanner/index.jsx Wyświetl plik

@@ -0,0 +1,27 @@
1
+import React, { useState } from 'react'
2
+import { Swiper, SwiperItem } from '@tarojs/components'
3
+import nav2detail from '@/utils/nav2detail'
4
+import '@/assets/css/reset.less'
5
+import '@/assets/css/iconfont.less'
6
+import './index.less'
7
+
8
+export default function WuYeBanner (props) {
9
+
10
+  const { List = [] } = props
11
+
12
+  return (
13
+    <view className='WuYeBanner'>
14
+      <Swiper className='BannerSwiper' autoplay circular indicator-dots indicator-color='rgba(0,0,0,0.4)' indicator-active-color='rgba(255,255,255,0.8)'>
15
+        {
16
+          List.map((item, index) => (
17
+            <SwiperItem className='SwiperItem' key={`Banner-${index}`}>
18
+              <view className='BannerItem' onClick={() => nav2detail({ type: item.contentType, id: item.targetId })}>
19
+                <image mode='aspectFill' src={item.image}></image>
20
+              </view>
21
+            </SwiperItem>
22
+          ))
23
+        }
24
+      </Swiper>
25
+    </view>
26
+  )
27
+}

+ 22
- 0
src/components/WuYeBanner/index.less Wyświetl plik

@@ -0,0 +1,22 @@
1
+.WuYeBanner {
2
+  width: 100%;
3
+  height: 100%;
4
+  position: relative;
5
+  overflow: hidden;
6
+
7
+  .BannerSwiper {
8
+    width: 100%;
9
+    height: 100%;
10
+
11
+    .BannerItem {
12
+      width: 100%;
13
+      height: 100%;
14
+      position: relative;
15
+
16
+      image {
17
+        width: 100%;
18
+        height: 100%;
19
+      }
20
+    }
21
+  }
22
+}

+ 15
- 5
src/components/WuYeBaoXiu/index.jsx Wyświetl plik

@@ -1,6 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import { useModel } from '@/store'
3 3
 import Taro from '@tarojs/taro'
4
+import { Swiper, SwiperItem } from '@tarojs/components'
4 5
 import WuYeBaoXiuItem from '@/components/WuYeBaoXiuItem/index'
5 6
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6 7
 import request, { apis } from '@/utils/request'
@@ -20,7 +21,7 @@ export default function WuYeBaoXiu () {
20 21
   })
21 22
 
22 23
   const GetBanner = (done = () => { }) => { // 获取轮播图
23
-    request({ ...apis.getBanner, params: { showPosition: `property`, showType: 'banner', pageSize: 1 } }).then((res) => {
24
+    request({ ...apis.getBanner, params: { showPosition: `property`, showType: 'banner', pageSize: 5, pageNum: 1 } }).then((res) => {
24 25
       setBannerList([...(res || [])])
25 26
       done()
26 27
     }).catch(() => {
@@ -56,10 +57,19 @@ export default function WuYeBaoXiu () {
56 57
           <view>
57 58
             {/* 大图 */}
58 59
             <view className='BigImg'>
59
-              {
60
-                BannerList.length > 0 &&
61
-                <image mode='aspectFill' src={BannerList[0].image} className='centerLabel' onClick={() => nav2detail({ type: BannerList[0].contentType, id: BannerList[0].targetId })}></image>
62
-              }
60
+              <view>
61
+                <Swiper className='BannerSwiper' autoplay circular indicator-dots indicator-color='rgba(0,0,0,0.4)' indicator-active-color='rgba(255,255,255,0.8)'>
62
+                  {
63
+                    BannerList.map((item, index) => (
64
+                      <SwiperItem className='SwiperItem' key={`Banner-${index}`}>
65
+                        <view className='BannerItem' onClick={() => nav2detail({ type: item.contentType, id: item.targetId })}>
66
+                          <image mode='aspectFill' src={item.image}></image>
67
+                        </view>
68
+                      </SwiperItem>
69
+                    ))
70
+                  }
71
+                </Swiper>
72
+              </view>
63 73
             </view>
64 74
 
65 75
             {/* 我要报修 */}

+ 22
- 2
src/components/WuYeBaoXiu/index.less Wyświetl plik

@@ -11,9 +11,29 @@
11 11
     overflow: hidden;
12 12
     background: #ccc;
13 13
 
14
-    >image {
14
+    >view {
15 15
       width: 100%;
16
-      height: 100%;
16
+      position: absolute;
17
+      left: 0;
18
+      top: 0;
19
+      bottom: 0;
20
+      overflow: hidden;
21
+
22
+      >.BannerSwiper {
23
+        width: 100%;
24
+        height: 100%;
25
+
26
+        .BannerItem {
27
+          width: 100%;
28
+          height: 100%;
29
+          position: relative;
30
+
31
+          image {
32
+            width: 100%;
33
+            height: 100%;
34
+          }
35
+        }
36
+      }
17 37
     }
18 38
   }
19 39
 

+ 15
- 50
src/components/WuYeFuWu/index.jsx Wyświetl plik

@@ -1,6 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import { useModel } from '@/store'
3 3
 import Taro from '@tarojs/taro'
4
+import { Swiper, SwiperItem } from '@tarojs/components'
4 5
 import WuYeFuWuItem from '@/components/WuYeFuWuItem/index'
5 6
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6 7
 import request, { apis } from '@/utils/request'
@@ -13,7 +14,6 @@ import './index.less'
13 14
 export default function WuYeFuWu () {
14 15
 
15 16
   const { user } = useModel('user')
16
-  const [newsTypeId, setNewsTypeId] = useState()
17 17
   const [PageList, setPageList] = useState([])
18 18
   const [BannerList, setBannerList] = useState([])
19 19
   const [typeList, setTypeList] = useState([])
@@ -26,7 +26,7 @@ export default function WuYeFuWu () {
26 26
   }, [])
27 27
 
28 28
   const GetBanner = (done = () => { }) => { // 获取轮播图
29
-    request({ ...apis.getBanner, params: { showPosition: `property`, showType: 'banner', pageNum: 1, pageSize: 1 } }).then((res) => {
29
+    request({ ...apis.getBanner, params: { showPosition: `property`, showType: 'banner', pageNum: 1, pageSize: 5 } }).then((res) => {
30 30
       setBannerList([...(res || [])])
31 31
       done()
32 32
     }).catch(() => {
@@ -47,38 +47,6 @@ export default function WuYeFuWu () {
47 47
     setPageList(PageList.concat(e))
48 48
   }
49 49
 
50
-  const KeepChildren = () => {
51
-    return (
52
-      <view>
53
-        {/* 大图 */}
54
-        <view className='BigImg'>
55
-          {
56
-            BannerList.length > 0 &&
57
-            <image mode='aspectFill' src={BannerList[0].image} className='centerLabel' onClick={() => nav2detail({ type: BannerList[0].contentType, id: BannerList[0].targetId })}></image>
58
-          }
59
-        </view>
60
-
61
-        <view style={{ display: 'flex', justifyContent: 'space-between' }}>
62
-          <IconBlock title='办事指南' />
63
-          <IconBlock title='政策法规' />
64
-        </view>
65
-
66
-        {/* 物业办事指南 */}
67
-        {/* <view className='BanShiZhiNan'>
68
-          <text>物业办事指南</text>
69
-          <view className='flex-h'>
70
-            <view className='Line'><view></view></view>
71
-            <view className='flex-item'>
72
-              <text>1、业主收楼手续办理</text>
73
-              <text>2、物业转名手续办理</text>
74
-              <text>3、业主卡、住户卡办理</text>
75
-            </view>
76
-          </view>
77
-        </view> */}
78
-      </view>
79
-    )
80
-  }
81
-
82 50
   return (
83 51
     <view className='WuYeFuWu'>
84 52
       <ScrollPageRefresh
@@ -90,25 +58,22 @@ export default function WuYeFuWu () {
90 58
           <view>
91 59
             {/* 大图 */}
92 60
             <view className='BigImg'>
93
-              {
94
-                BannerList.length > 0 &&
95
-                <image mode='aspectFill' src={BannerList[0].image} className='centerLabel' onClick={() => nav2detail({ type: BannerList[0].contentType, id: BannerList[0].targetId })}></image>
96
-              }
61
+              <view>
62
+                <Swiper className='BannerSwiper' autoplay circular indicator-dots indicator-color='rgba(0,0,0,0.4)' indicator-active-color='rgba(255,255,255,0.8)'>
63
+                  {
64
+                    BannerList.map((item, index) => (
65
+                      <SwiperItem className='SwiperItem' key={`Banner-${index}`}>
66
+                        <view className='BannerItem' onClick={() => nav2detail({ type: item.contentType, id: item.targetId })}>
67
+                          <image mode='aspectFill' src={item.image}></image>
68
+                        </view>
69
+                      </SwiperItem>
70
+                    ))
71
+                  }
72
+                </Swiper>
73
+              </view>
97 74
             </view>
98 75
 
99 76
             <view className='TypeList'>
100
-              {/* <view>
101
-                <view onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/ShengHuoGuanJia/index` }) }}>
102
-                  <view className='centerLabel'>
103
-                    <view className='Icon'>
104
-                      <text className='iconfont iconguanjia'></text>
105
-                    </view>
106
-                    <view className='Name'>
107
-                      <text>生活管家</text>
108
-                    </view>
109
-                  </view>
110
-                </view>
111
-              </view> */}
112 77
               <view>
113 78
                 <view onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/GongGongFuWu/index` }) }}>
114 79
                   <view className='centerLabel'>

+ 22
- 2
src/components/WuYeFuWu/index.less Wyświetl plik

@@ -76,9 +76,29 @@
76 76
     overflow: hidden;
77 77
     background: #ccc;
78 78
 
79
-    >image {
79
+    >view {
80 80
       width: 100%;
81
-      height: 100%;
81
+      position: absolute;
82
+      left: 0;
83
+      top: 0;
84
+      bottom: 0;
85
+      overflow: hidden;
86
+
87
+      >.BannerSwiper {
88
+        width: 100%;
89
+        height: 100%;
90
+
91
+        .BannerItem {
92
+          width: 100%;
93
+          height: 100%;
94
+          position: relative;
95
+
96
+          image {
97
+            width: 100%;
98
+            height: 100%;
99
+          }
100
+        }
101
+      }
82 102
     }
83 103
   }
84 104
 

+ 15
- 5
src/components/WuYeGongGao/index.jsx Wyświetl plik

@@ -1,6 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import { useModel } from '@/store'
3 3
 import Taro from '@tarojs/taro'
4
+import { Swiper, SwiperItem } from '@tarojs/components'
4 5
 import WuYeGongGaoItem from '@/components/WuYeGongGaoItem/index'
5 6
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6 7
 import request, { apis } from '@/utils/request'
@@ -21,7 +22,7 @@ export default function WuYeGongGao () {
21 22
   }, [])
22 23
 
23 24
   const GetBanner = (done = () => { }) => { // 获取轮播图
24
-    request({ ...apis.getBanner, params: { showPosition: `property`, showType: 'banner', pageNum: 1, pageSize: 1 } }).then((res) => {
25
+    request({ ...apis.getBanner, params: { showPosition: `property`, showType: 'banner', pageNum: 1, pageSize: 5 } }).then((res) => {
25 26
       setBannerList([...(res || [])])
26 27
       done()
27 28
     }).catch(() => {
@@ -54,10 +55,19 @@ export default function WuYeGongGao () {
54 55
           <view>
55 56
             {/* 大图 */}
56 57
             <view className='BigImg'>
57
-              {
58
-                BannerList.length > 0 &&
59
-                <image mode='aspectFill' src={BannerList[0].image} className='centerLabel' onClick={() => nav2detail({ type: BannerList[0].contentType, id: BannerList[0].targetId })}></image>
60
-              }
58
+              <view>
59
+                <Swiper className='BannerSwiper' autoplay circular indicator-dots indicator-color='rgba(0,0,0,0.4)' indicator-active-color='rgba(255,255,255,0.8)'>
60
+                  {
61
+                    BannerList.map((item, index) => (
62
+                      <SwiperItem className='SwiperItem' key={`Banner-${index}`}>
63
+                        <view className='BannerItem' onClick={() => nav2detail({ type: item.contentType, id: item.targetId })}>
64
+                          <image mode='aspectFill' src={item.image}></image>
65
+                        </view>
66
+                      </SwiperItem>
67
+                    ))
68
+                  }
69
+                </Swiper>
70
+              </view>
61 71
             </view>
62 72
           </view>
63 73
         }

+ 22
- 2
src/components/WuYeGongGao/index.less Wyświetl plik

@@ -11,9 +11,29 @@
11 11
     overflow: hidden;
12 12
     background: #ccc;
13 13
 
14
-    >image {
14
+    >view {
15 15
       width: 100%;
16
-      height: 100%;
16
+      position: absolute;
17
+      left: 0;
18
+      top: 0;
19
+      bottom: 0;
20
+      overflow: hidden;
21
+
22
+      >.BannerSwiper {
23
+        width: 100%;
24
+        height: 100%;
25
+
26
+        .BannerItem {
27
+          width: 100%;
28
+          height: 100%;
29
+          position: relative;
30
+
31
+          image {
32
+            width: 100%;
33
+            height: 100%;
34
+          }
35
+        }
36
+      }
17 37
     }
18 38
   }
19 39
 

+ 6
- 6
src/components/WuYeJiaoFei/index.jsx Wyświetl plik

@@ -1,9 +1,10 @@
1 1
 import React, { useState, useEffect } from 'react'
2
-import WuYeJiaoFeiItem from '@/components/WuYeJiaoFeiItem/index'
2
+import WuYeBanner from '@/components/WuYeBanner/index'
3 3
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
4 4
 import request, { apis } from '@/utils/request'
5 5
 import nav2detail from '@/utils/nav2detail'
6 6
 import Taro from '@tarojs/taro'
7
+import { Swiper, SwiperItem } from '@tarojs/components'
7 8
 import { Checkbox, CheckboxGroup } from '@tarojs/components'
8 9
 import '@/assets/css/reset.less'
9 10
 import '@/assets/css/iconfont.less'
@@ -67,7 +68,7 @@ export default function WuYeJiaoFei () {
67 68
   }
68 69
 
69 70
   const GetBanner = (done = () => { }) => { // 获取轮播图
70
-    request({ ...apis.getBanner, params: { showPosition: `property`, showType: 'banner', pageNum: 1, pageSize: 1 } }).then((res) => {
71
+    request({ ...apis.getBanner, params: { showPosition: `property`, showType: 'banner', pageNum: 1, pageSize: 5 } }).then((res) => {
71 72
       setBannerList([...(res || [])])
72 73
       done()
73 74
     }).catch(() => {
@@ -144,10 +145,9 @@ export default function WuYeJiaoFei () {
144 145
               <view>
145 146
                 {/* 大图 */}
146 147
                 <view className='BigImg'>
147
-                  {
148
-                    BannerList.length > 0 &&
149
-                    <image mode='aspectFill' src={BannerList[0].image} className='centerLabel' onClick={() => nav2detail({ type: BannerList[0].contentType, id: BannerList[0].targetId })}></image>
150
-                  }
148
+                  <view>
149
+                    <WuYeBanner List={BannerList}></WuYeBanner>
150
+                  </view>
151 151
                 </view>
152 152
               </view>
153 153
             }

+ 44
- 7
src/components/WuYeJiaoFei/index.less Wyświetl plik

@@ -7,6 +7,7 @@
7 7
   >.flex-item {
8 8
     position: relative;
9 9
     overflow: hidden;
10
+
10 11
     >view {
11 12
       width: 100%;
12 13
       position: absolute;
@@ -14,23 +15,50 @@
14 15
       top: 0;
15 16
       bottom: 0;
16 17
       overflow: hidden;
18
+
17 19
       .BigImg {
18 20
         width: 100%;
19 21
         padding-bottom: 50%;
20 22
         position: relative;
21 23
         overflow: hidden;
22 24
         background: #ccc;
23
-    
24
-        >image {
25
+
26
+        >view {
25 27
           width: 100%;
26
-          height: 100%;
28
+          position: absolute;
29
+          left: 0;
30
+          top: 0;
31
+          bottom: 0;
32
+          overflow: hidden;
33
+
34
+          >.BannerSwiper {
35
+            width: 100%;
36
+            height: 100%;
37
+
38
+            .SwiperItem {
39
+              width: 100%;
40
+              height: 100%;
41
+              position: relative;
42
+            }
43
+
44
+            .BannerItem {
45
+              width: 100%;
46
+              height: 100%;
47
+              position: relative;
48
+
49
+              image {
50
+                width: 100%;
51
+                height: 100%;
52
+              }
53
+            }
54
+          }
27 55
         }
28 56
       }
29
-    
57
+
30 58
       .List {
31 59
         position: relative;
32 60
         overflow: hidden;
33
-    
61
+
34 62
         checkbox {
35 63
           display: block;
36 64
           line-height: 1.4em;
@@ -39,9 +67,11 @@
39 67
           background: #fff;
40 68
           margin-bottom: 30px;
41 69
           padding: 30px;
70
+
42 71
           &:first-child {
43 72
             margin-top: 30px;
44 73
           }
74
+
45 75
           .flex-item {
46 76
             color: #333;
47 77
             font-size: 28px;
@@ -50,19 +80,20 @@
50 80
             text-overflow: ellipsis;
51 81
             margin: 0 20px;
52 82
           }
83
+
53 84
           .Price {
54 85
             color: #F35844;
55 86
             font-size: 28px;
56 87
             font-weight: bold;
57 88
           }
58 89
         }
59
-    
90
+
60 91
         >view {
61 92
           width: 100%;
62 93
           position: relative;
63 94
           overflow: hidden;
64 95
           margin-bottom: 30px;
65
-    
96
+
66 97
           &:first-child {
67 98
             margin-top: 30px;
68 99
           }
@@ -70,23 +101,29 @@
70 101
       }
71 102
     }
72 103
   }
104
+
73 105
   >.PayLine {
74 106
     align-items: center;
75 107
     border-top: 2px solid #eee;
76 108
     background: #fff;
109
+
77 110
     >view {
78 111
       position: relative;
79 112
       overflow: hidden;
80 113
       margin-left: 10px;
114
+
81 115
       &:first-child {
82 116
         margin-left: 30px;
83 117
       }
118
+
84 119
       text {
85 120
         font-size: 28px;
86 121
         color: #333;
87 122
       }
123
+
88 124
       &.Btn {
89 125
         width: 160px;
126
+
90 127
         text {
91 128
           display: block;
92 129
           text-align: center;