1002884655 4 lat temu
rodzic
commit
05417e91b4

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

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

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
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import { useModel } from '@/store'
2
 import { useModel } from '@/store'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
+import { Swiper, SwiperItem } from '@tarojs/components'
4
 import WuYeBaoXiuItem from '@/components/WuYeBaoXiuItem/index'
5
 import WuYeBaoXiuItem from '@/components/WuYeBaoXiuItem/index'
5
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6
 import request, { apis } from '@/utils/request'
7
 import request, { apis } from '@/utils/request'
20
   })
21
   })
21
 
22
 
22
   const GetBanner = (done = () => { }) => { // 获取轮播图
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
       setBannerList([...(res || [])])
25
       setBannerList([...(res || [])])
25
       done()
26
       done()
26
     }).catch(() => {
27
     }).catch(() => {
56
           <view>
57
           <view>
57
             {/* 大图 */}
58
             {/* 大图 */}
58
             <view className='BigImg'>
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
             </view>
73
             </view>
64
 
74
 
65
             {/* 我要报修 */}
75
             {/* 我要报修 */}

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

11
     overflow: hidden;
11
     overflow: hidden;
12
     background: #ccc;
12
     background: #ccc;
13
 
13
 
14
-    >image {
14
+    >view {
15
       width: 100%;
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
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import { useModel } from '@/store'
2
 import { useModel } from '@/store'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
+import { Swiper, SwiperItem } from '@tarojs/components'
4
 import WuYeFuWuItem from '@/components/WuYeFuWuItem/index'
5
 import WuYeFuWuItem from '@/components/WuYeFuWuItem/index'
5
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6
 import request, { apis } from '@/utils/request'
7
 import request, { apis } from '@/utils/request'
13
 export default function WuYeFuWu () {
14
 export default function WuYeFuWu () {
14
 
15
 
15
   const { user } = useModel('user')
16
   const { user } = useModel('user')
16
-  const [newsTypeId, setNewsTypeId] = useState()
17
   const [PageList, setPageList] = useState([])
17
   const [PageList, setPageList] = useState([])
18
   const [BannerList, setBannerList] = useState([])
18
   const [BannerList, setBannerList] = useState([])
19
   const [typeList, setTypeList] = useState([])
19
   const [typeList, setTypeList] = useState([])
26
   }, [])
26
   }, [])
27
 
27
 
28
   const GetBanner = (done = () => { }) => { // 获取轮播图
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
       setBannerList([...(res || [])])
30
       setBannerList([...(res || [])])
31
       done()
31
       done()
32
     }).catch(() => {
32
     }).catch(() => {
47
     setPageList(PageList.concat(e))
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
   return (
50
   return (
83
     <view className='WuYeFuWu'>
51
     <view className='WuYeFuWu'>
84
       <ScrollPageRefresh
52
       <ScrollPageRefresh
90
           <view>
58
           <view>
91
             {/* 大图 */}
59
             {/* 大图 */}
92
             <view className='BigImg'>
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
             </view>
74
             </view>
98
 
75
 
99
             <view className='TypeList'>
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
               <view>
77
               <view>
113
                 <view onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/GongGongFuWu/index` }) }}>
78
                 <view onClick={() => { Taro.navigateTo({ url: `/pages/WuYe/GongGongFuWu/index` }) }}>
114
                   <view className='centerLabel'>
79
                   <view className='centerLabel'>

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

76
     overflow: hidden;
76
     overflow: hidden;
77
     background: #ccc;
77
     background: #ccc;
78
 
78
 
79
-    >image {
79
+    >view {
80
       width: 100%;
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
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import { useModel } from '@/store'
2
 import { useModel } from '@/store'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
+import { Swiper, SwiperItem } from '@tarojs/components'
4
 import WuYeGongGaoItem from '@/components/WuYeGongGaoItem/index'
5
 import WuYeGongGaoItem from '@/components/WuYeGongGaoItem/index'
5
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
6
 import request, { apis } from '@/utils/request'
7
 import request, { apis } from '@/utils/request'
21
   }, [])
22
   }, [])
22
 
23
 
23
   const GetBanner = (done = () => { }) => { // 获取轮播图
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
       setBannerList([...(res || [])])
26
       setBannerList([...(res || [])])
26
       done()
27
       done()
27
     }).catch(() => {
28
     }).catch(() => {
54
           <view>
55
           <view>
55
             {/* 大图 */}
56
             {/* 大图 */}
56
             <view className='BigImg'>
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
             </view>
71
             </view>
62
           </view>
72
           </view>
63
         }
73
         }

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

11
     overflow: hidden;
11
     overflow: hidden;
12
     background: #ccc;
12
     background: #ccc;
13
 
13
 
14
-    >image {
14
+    >view {
15
       width: 100%;
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
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
-import WuYeJiaoFeiItem from '@/components/WuYeJiaoFeiItem/index'
2
+import WuYeBanner from '@/components/WuYeBanner/index'
3
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
3
 import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
4
 import request, { apis } from '@/utils/request'
4
 import request, { apis } from '@/utils/request'
5
 import nav2detail from '@/utils/nav2detail'
5
 import nav2detail from '@/utils/nav2detail'
6
 import Taro from '@tarojs/taro'
6
 import Taro from '@tarojs/taro'
7
+import { Swiper, SwiperItem } from '@tarojs/components'
7
 import { Checkbox, CheckboxGroup } from '@tarojs/components'
8
 import { Checkbox, CheckboxGroup } from '@tarojs/components'
8
 import '@/assets/css/reset.less'
9
 import '@/assets/css/reset.less'
9
 import '@/assets/css/iconfont.less'
10
 import '@/assets/css/iconfont.less'
67
   }
68
   }
68
 
69
 
69
   const GetBanner = (done = () => { }) => { // 获取轮播图
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
       setBannerList([...(res || [])])
72
       setBannerList([...(res || [])])
72
       done()
73
       done()
73
     }).catch(() => {
74
     }).catch(() => {
144
               <view>
145
               <view>
145
                 {/* 大图 */}
146
                 {/* 大图 */}
146
                 <view className='BigImg'>
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
                 </view>
151
                 </view>
152
               </view>
152
               </view>
153
             }
153
             }

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

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