Browse Source

静态页面

1002884655 4 years ago
parent
commit
771c4d00ea

+ 1
- 1
src/app.js View File

43
       success: res => {
43
       success: res => {
44
         if (res.errMsg === 'login:ok') {
44
         if (res.errMsg === 'login:ok') {
45
           request({ ...apis.login, params: { code: res.code, from, recommender, scene } }).then(x => {
45
           request({ ...apis.login, params: { code: res.code, from, recommender, scene } }).then(x => {
46
-            setUser(x.person)
46
+            setUser({...x.person, ShowIndexAdv: false, FirstComing: true})
47
             Taro.setStorage({ key: 'token', data: x.token })
47
             Taro.setStorage({ key: 'token', data: x.token })
48
             Taro.setStorage({ key: 'sessionKey', data: x.sessionKey })
48
             Taro.setStorage({ key: 'sessionKey', data: x.sessionKey })
49
 
49
 

+ 6
- 3
src/components/ScrollPage/index.jsx View File

5
 
5
 
6
 export default function ScrollPage (props) {
6
 export default function ScrollPage (props) {
7
 
7
 
8
-  const { IsPullDown = false, IsPullUp = false, HasMore = true, OnRefresh = () => { }, OnPullUp = () => { } } = props
8
+  const { IsPullDown = false, ListRefresh = true, IsPullUp = false, HasMore = true, OnRefresh = () => { }, OnPullUp = () => { }, RefreshBg = 'none' } = props
9
 
9
 
10
   return (
10
   return (
11
     <view className='ScrollPage'>
11
     <view className='ScrollPage'>
12
-      <scroll-view scroll-y='true' style='height: 100%;' refresher-enabled={true} onrefresherrefresh={OnRefresh} onscrolltolower={OnPullUp} refresher-triggered={IsPullDown} refresher-background='none'>
12
+      <scroll-view scroll-y='true' style='height: 100%;' refresher-enabled={true} onrefresherrefresh={OnRefresh} onscrolltolower={OnPullUp} refresher-triggered={IsPullDown} refresher-background={RefreshBg}>
13
         <view className='ScrollPageContent'>
13
         <view className='ScrollPageContent'>
14
           {
14
           {
15
             props.children
15
             props.children
16
           }
16
           }
17
           <view className='ScrollPageBottom'></view>
17
           <view className='ScrollPageBottom'></view>
18
         </view>
18
         </view>
19
-        <text className='LoadMoreText'>{IsPullUp ? '正在加载更多...' : HasMore ? '上拉加载更多' : '已经到底了~'}</text>
19
+        {
20
+          ListRefresh &&
21
+          <text className='LoadMoreText'>{IsPullUp ? '正在加载更多...' : HasMore ? '上拉加载更多' : '已经到底了~'}</text>
22
+        }
20
       </scroll-view>
23
       </scroll-view>
21
     </view>
24
     </view>
22
   )
25
   )

+ 19
- 11
src/components/ScrollPageRefresh/index.jsx View File

7
 
7
 
8
 export default function ScrollPageRefresh (props) {
8
 export default function ScrollPageRefresh (props) {
9
 
9
 
10
-  const { ApiName = '', ListName = 'records', RequestParams = {}, RequestData = null, RequestUrlData = null, PageSize = 10, Refresh = () => { }, Push = () => { } } = props
10
+  const { ApiName = '', ListRefresh = true, ListName = 'records', RequestParams = {}, RequestData = null, RequestUrlData = null, PageSize = 10, Refresh = () => { }, Push = () => { }, RefreshBg = 'none' } = props
11
   const [IsPullUp, setIsPullUp] = useState(false)
11
   const [IsPullUp, setIsPullUp] = useState(false)
12
   const [IsPullDown, setIsPullDown] = useState(false)
12
   const [IsPullDown, setIsPullDown] = useState(false)
13
   const [HasNextPage, setHasNextPage] = useState(true)
13
   const [HasNextPage, setHasNextPage] = useState(true)
14
   const [PageNum, setPageNum] = useState(1)
14
   const [PageNum, setPageNum] = useState(1)
15
 
15
 
16
   useEffect(() => {
16
   useEffect(() => {
17
-    GetPageList(() => {
18
-      setIsPullDown(false)
19
-      setIsPullUp(false)
20
-    })
17
+    if (ListRefresh) {
18
+      GetPageList(() => {
19
+        setIsPullDown(false)
20
+        setIsPullUp(false)
21
+      })
22
+    }
21
   }, [PageNum])
23
   }, [PageNum])
22
 
24
 
23
   const GetPageList = (done = () => { }) => { // 获取列表
25
   const GetPageList = (done = () => { }) => { // 获取列表
62
 
64
 
63
   const OnRefresh = () => { // 页面下拉刷新
65
   const OnRefresh = () => { // 页面下拉刷新
64
     setIsPullDown(true)
66
     setIsPullDown(true)
65
-    setPageNum(1)
66
-    if (PageNum === 1) {
67
-      GetPageList(() => {
67
+    if (ListRefresh) {
68
+      setPageNum(1)
69
+      if (PageNum === 1) {
70
+        GetPageList(() => {
71
+          setIsPullDown(false)
72
+        })
73
+      } else {
74
+        setPageNum(1)
75
+      }
76
+    } else {
77
+      Refresh(() => {
68
         setIsPullDown(false)
78
         setIsPullDown(false)
69
       })
79
       })
70
-    } else {
71
-      setPageNum(1)
72
     }
80
     }
73
   }
81
   }
74
 
82
 
81
 
89
 
82
   return (
90
   return (
83
     <view className='ScrollPageRefresh'>
91
     <view className='ScrollPageRefresh'>
84
-      <ScrollPage OnRefresh={OnRefresh} IsPullUp={IsPullUp} IsPullDown={IsPullDown} OnPullUp={OnPullUp} HasMore={HasNextPage}>
92
+      <ScrollPage ListRefresh={ListRefresh} OnRefresh={OnRefresh} IsPullUp={IsPullUp} IsPullDown={IsPullDown} OnPullUp={OnPullUp} HasMore={HasNextPage} RefreshBg={RefreshBg}>
85
         {
93
         {
86
           props.children
94
           props.children
87
         }
95
         }

+ 39
- 1
src/layouts/index.jsx View File

1
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import { useModel } from '@/store'
3
 import { useModel } from '@/store'
4
+import { Text } from '@tarojs/components'
4
 import Spin from '@/components/Spin'
5
 import Spin from '@/components/Spin'
5
 import GetUserPhone from '@/components/GetUserPhone/index'
6
 import GetUserPhone from '@/components/GetUserPhone/index'
6
 import GetUserIcon from '@/components/GetUserIcon/index'
7
 import GetUserIcon from '@/components/GetUserIcon/index'
7
 import useMountTrack from '@/utils/hooks/useMountTrack'
8
 import useMountTrack from '@/utils/hooks/useMountTrack'
9
+import request, { apis } from '@/utils/request'
8
 import { getPage } from '@/utils'
10
 import { getPage } from '@/utils'
11
+import './index.less'
9
 
12
 
10
 const pages = require('../pages')
13
 const pages = require('../pages')
11
 
14
 
21
   const [showAuthBasic, setShowAuthBasic] = useState(false)
24
   const [showAuthBasic, setShowAuthBasic] = useState(false)
22
   const [showAuthYeZhu, setShowAuthYeZhu] = useState(false)
25
   const [showAuthYeZhu, setShowAuthYeZhu] = useState(false)
23
   const [showAuthPhone, setShowAuthPhone] = useState(false)
26
   const [showAuthPhone, setShowAuthPhone] = useState(false)
24
-  const { user } = useModel('user')
27
+  const [ShowAdvLayer, setShowAdvLayer] = useState(true)
28
+  const [AdvDetail, setShowAdvDetail] = useState(null)
29
+  const { user, setUser } = useModel('user')
25
 
30
 
26
   const loading = !user || !user.personId
31
   const loading = !user || !user.personId
27
   const isAuthedBasic = user && user.avatarurl && user.nickname
32
   const isAuthedBasic = user && user.avatarurl && user.nickname
33
   const needAuthYeZhu = (page.auth || []).indexOf('yezhu') > -1
38
   const needAuthYeZhu = (page.auth || []).indexOf('yezhu') > -1
34
   const needAuthPhone = (page.auth || []).indexOf('phone') > -1
39
   const needAuthPhone = (page.auth || []).indexOf('phone') > -1
35
 
40
 
41
+  useEffect(() => {
42
+    if (user !== null && user.FirstComing !== undefined && user.FirstComing) {
43
+      request({ ...apis.getIndexAdv, params: { showType: `screen`, showPosition: `index` } }).then((res) => {
44
+        if (res !== null && res.length > 0) {
45
+          setShowAdvDetail(res[0])
46
+          setUser({...user, ShowIndexAdv: true, FirstComing: false})
47
+        }
48
+      })
49
+    }
50
+  }, [user])
51
+
36
   // 埋点
52
   // 埋点
37
   useMountTrack()
53
   useMountTrack()
38
 
54
 
78
     setShowAuthBasic(needShow)
94
     setShowAuthBasic(needShow)
79
   }, [isAuthedBasic, needAuthBasic, isAuthedPhone, isAuthedYeZhu, needAuthYeZhu])
95
   }, [isAuthedBasic, needAuthBasic, isAuthedPhone, isAuthedYeZhu, needAuthYeZhu])
80
 
96
 
97
+  const AdvClick = () => { // 首页弹窗点击事件
98
+    setShowAdvLayer(false)
99
+    if (AdvDetail.contentType === 'news') {
100
+      Taro.navigateTo({ url: `/pages/HuoDong/ZiXunDetail/index?id=${AdvDetail.contentId}` })
101
+    } else if (AdvDetail.contentType === 'tpNews') {
102
+      Taro.navigateTo({ url: `/pages/WuYe/FuWuDetail/index?id=${AdvDetail.contentId}` })
103
+    } else if (AdvDetail.contentType === 'notice') {
104
+      Taro.navigateTo({ url: `/pages/WuYe/GongGaoDetail/index?id=${AdvDetail.contentId}` })
105
+    } else if (AdvDetail.contentType === 'activity') {
106
+      Taro.navigateTo({ url: `/pages/HuoDong/HuoDongDetail/index?id=${AdvDetail.contentId}` })
107
+    }
108
+  }
109
+
81
   return (
110
   return (
82
     <Spin loading={loading}>
111
     <Spin loading={loading}>
112
+
113
+      {/* 广告 */}
114
+      <view className='AdvLayer' style={{ display: user !== null && user.ShowIndexAdv !== undefined && user.ShowIndexAdv ? 'block' : 'none' }}>
115
+        <view className='centerLabel'>
116
+          <image mode='aspectFit' src={AdvDetail !== null ? AdvDetail.image : null} onClick={AdvClick}></image>
117
+          <Text className='iconfont iconguanbi' onClick={() => { setUser({...user, ShowIndexAdv: false}) }}></Text>
118
+        </view>
119
+      </view>
120
+
83
       <GetUserIcon visible={showAuthBasic} onError={err => showError(`授权头像失败: ${err}`)} />
121
       <GetUserIcon visible={showAuthBasic} onError={err => showError(`授权头像失败: ${err}`)} />
84
       <GetUserPhone visible={showAuthPhone} onError={err => showError(`授权手机失败: ${err}`)} />
122
       <GetUserPhone visible={showAuthPhone} onError={err => showError(`授权手机失败: ${err}`)} />
85
       {
123
       {

+ 36
- 0
src/layouts/index.less View File

1
+.AdvLayer {
2
+  width: 100%;
3
+  position: absolute;
4
+  left: 0;
5
+  top: 0;
6
+  bottom: 0;
7
+  z-index: 20000;
8
+  background: rgba(0, 0, 0, 0.8);
9
+
10
+  >view {
11
+    width: 100%;
12
+    height: 100vw;
13
+    overflow: visible;
14
+
15
+    >image {
16
+      width: 60%;
17
+      height: 60%;
18
+      position: relative;
19
+      z-index: 1;
20
+      margin: 0 auto;
21
+      display: block;
22
+    }
23
+
24
+    >text {
25
+      display: inline-block;
26
+      color: #fff;
27
+      font-size: 60px;
28
+      position: absolute;
29
+      left: 50%;
30
+      bottom: -30px;
31
+      transform: translateX(-50%);
32
+      -webkit-transform: translateX(-50%);
33
+      z-index: 2;
34
+    }
35
+  }
36
+}

+ 8
- 31
src/pages/ShouYe/index.jsx View File

1
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import NavHeader from '@/components/NavHeader/index'
2
 import NavHeader from '@/components/NavHeader/index'
3
+import ScrollPageRefresh from '@/components/ScrollPageRefresh/index'
3
 import { Swiper, SwiperItem, Text } from '@tarojs/components'
4
 import { Swiper, SwiperItem, Text } from '@tarojs/components'
4
 import request, { apis } from '@/utils/request'
5
 import request, { apis } from '@/utils/request'
5
 import { useModel } from '@/store'
6
 import { useModel } from '@/store'
13
 export default function Index (props) {
14
 export default function Index (props) {
14
 
15
 
15
   const { user } = useModel('user')
16
   const { user } = useModel('user')
16
-  const [ShowAdvLayer, setShowAdvLayer] = useState(false)
17
-  const [IsPull, setIsPull] = useState(false)
18
   const [OwnerList] = useState([
17
   const [OwnerList] = useState([
19
     { icon: 'iconjiaofei', name: '物业缴费', id: 1, router: '/pages/WuYe/index', isTab: true },
18
     { icon: 'iconjiaofei', name: '物业缴费', id: 1, router: '/pages/WuYe/index', isTab: true },
20
     { icon: 'icontongzhi', name: '物业通知', id: 2, router: '/pages/WuYe/index', isTab: true },
19
     { icon: 'icontongzhi', name: '物业通知', id: 2, router: '/pages/WuYe/index', isTab: true },
31
   const [ActivityList, setActivityList] = useState([])
30
   const [ActivityList, setActivityList] = useState([])
32
   const [NewsList, setNewsList] = useState([])
31
   const [NewsList, setNewsList] = useState([])
33
 
32
 
34
-  // useEffect(() => {
35
-  //   if (user) {
36
-  //     console.log(user, `user`)
37
-  //     OnRefresh()
38
-  //   }
39
-  // }, [user])
40
-
41
   useUserMounted(() => {
33
   useUserMounted(() => {
42
-    OnRefresh()
34
+    Refresh()
43
   })
35
   })
44
 
36
 
45
   const Init = (done = () => { }) => { // 初始化
37
   const Init = (done = () => { }) => { // 初始化
108
     }
100
     }
109
   }
101
   }
110
 
102
 
111
-  const OnRefresh = () => { // 页面下拉刷新
112
-    setIsPull(true)
113
-    Init(() => {
114
-      setIsPull(false)
115
-    })
116
-  }
117
-
118
-  const OnPullUp = () => { // 上拉加载
119
-    // console.log(111)
103
+  const Refresh = (e) => { // 页面下拉刷新
104
+    Init(e)
120
   }
105
   }
121
 
106
 
122
   const OwnerClick = (item) => {
107
   const OwnerClick = (item) => {
135
         <NavHeader BgColor='#f35844' Title='首页'></NavHeader>
120
         <NavHeader BgColor='#f35844' Title='首页'></NavHeader>
136
         <view className='flex-item'>
121
         <view className='flex-item'>
137
 
122
 
138
-          {/* 广告 */}
139
-          <view className='AdvLayer' style={{ display: ShowAdvLayer ? 'block' : 'none' }}>
140
-            <view className='centerLabel'>
141
-              <image mode='aspectFit' src={null}></image>
142
-              <Text className='iconfont iconguanbi'></Text>
143
-            </view>
144
-          </view>
145
-
146
           {/* 正文 */}
123
           {/* 正文 */}
147
           <view className='PageContainer'>
124
           <view className='PageContainer'>
148
-            <scroll-view scroll-y='true' style='height: 100%;' refresher-enabled={true} onscrolltolower={OnPullUp} onrefresherrefresh={OnRefresh} refresher-triggered={IsPull} refresher-background='#f35844'>
125
+            <ScrollPageRefresh ListRefresh={false} Refresh={Refresh} RefreshBg='#f35844'>
149
               <view className='Content'>
126
               <view className='Content'>
150
 
127
 
151
                 {/* 背景图 */}
128
                 {/* 背景图 */}
242
                                 <image mode='aspectFill' src={item.newsImg} className='centerLabel'></image>
219
                                 <image mode='aspectFill' src={item.newsImg} className='centerLabel'></image>
243
                               </view>
220
                               </view>
244
                               <view className='flex-item'>
221
                               <view className='flex-item'>
245
-                                <Text>{item.newsName}</Text>
246
-                                <Text>{item.desc || ''}</Text>
222
+                                <view><Text>{item.newsName}</Text></view>
223
+                                <view><Text>{item.desc || ''}</Text></view>
247
                               </view>
224
                               </view>
248
                             </view>
225
                             </view>
249
                           ))
226
                           ))
257
                 </view>
234
                 </view>
258
 
235
 
259
               </view>
236
               </view>
260
-            </scroll-view>
237
+            </ScrollPageRefresh>
261
           </view>
238
           </view>
262
 
239
 
263
         </view>
240
         </view>

+ 121
- 94
src/pages/ShouYe/index.less View File

3
   height: 100%;
3
   height: 100%;
4
   overflow: hidden;
4
   overflow: hidden;
5
   background: #f8f8f8;
5
   background: #f8f8f8;
6
-  > view {
6
+
7
+  >view {
7
     position: relative;
8
     position: relative;
9
+
8
     &.flex-item {
10
     &.flex-item {
9
       position: relative;
11
       position: relative;
10
       overflow: hidden;
12
       overflow: hidden;
11
-      > .AdvLayer {
12
-        width: 100%;
13
-        position: absolute;
14
-        left: 0;
15
-        top: 0;
16
-        bottom: 0;
17
-        z-index: 2;
18
-        background: rgba(0, 0, 0, 0.8);
19
-        > view {
20
-          width: 100%;
21
-          height: 100vw;
22
-          overflow: visible;
23
-          > image {
24
-            width: 60%;
25
-            height: 60%;
26
-            position: relative;
27
-            z-index: 1;
28
-            margin: 0 auto;
29
-            display: block;
30
-          }
31
-          >text {
32
-            display: inline-block;
33
-            color: #fff;
34
-            font-size: 60px;
35
-            position: absolute;
36
-            left: 50%;
37
-            bottom: -30px;
38
-            transform: translateX(-50%);
39
-            -webkit-transform: translateX(-50%);
40
-            z-index: 2;
41
-          }
42
-        }
43
-      }
44
-      > .PageContainer {
13
+
14
+      >.PageContainer {
45
         width: 100%;
15
         width: 100%;
46
         position: relative;
16
         position: relative;
47
         z-index: 2;
17
         z-index: 2;
48
         height: 100%;
18
         height: 100%;
49
         overflow: hidden;
19
         overflow: hidden;
50
         z-index: 1;
20
         z-index: 1;
21
+
51
         .Content {
22
         .Content {
52
           position: relative;
23
           position: relative;
53
           overflow: hidden;
24
           overflow: hidden;
54
-          > view {
25
+
26
+          >view {
55
             position: relative;
27
             position: relative;
56
             z-index: 2;
28
             z-index: 2;
29
+
57
             &.TopBg {
30
             &.TopBg {
58
               width: 100%;
31
               width: 100%;
59
               position: absolute;
32
               position: absolute;
65
               background-image: linear-gradient(#f35844, #ff8d61);
38
               background-image: linear-gradient(#f35844, #ff8d61);
66
               z-index: 1;
39
               z-index: 1;
67
             }
40
             }
68
-            > .Welcome {
41
+
42
+            >.Welcome {
69
               display: block;
43
               display: block;
70
               font-size: 30px;
44
               font-size: 30px;
71
               color: #fff;
45
               color: #fff;
72
               margin-top: 20px;
46
               margin-top: 20px;
73
               text-indent: 30px;
47
               text-indent: 30px;
74
             }
48
             }
75
-            > .BannerContainer {
49
+
50
+            >.BannerContainer {
76
               padding: 0 30px;
51
               padding: 0 30px;
77
               position: relative;
52
               position: relative;
78
               overflow: hidden;
53
               overflow: hidden;
79
               margin-top: 50px;
54
               margin-top: 50px;
80
-              > view {
55
+
56
+              >view {
81
                 width: 100%;
57
                 width: 100%;
82
                 position: relative;
58
                 position: relative;
83
                 overflow: hidden;
59
                 overflow: hidden;
85
                 background: #f8f8f8;
61
                 background: #f8f8f8;
86
                 border-radius: 24px;
62
                 border-radius: 24px;
87
                 height: 0;
63
                 height: 0;
88
-                > view {
64
+
65
+                >view {
89
                   width: 100%;
66
                   width: 100%;
90
                   position: absolute;
67
                   position: absolute;
91
                   left: 0;
68
                   left: 0;
92
                   top: 0;
69
                   top: 0;
93
                   bottom: 0;
70
                   bottom: 0;
94
                   overflow: hidden;
71
                   overflow: hidden;
95
-                  > .BannerSwiper {
72
+
73
+                  >.BannerSwiper {
96
                     width: 100%;
74
                     width: 100%;
97
                     height: 100%;
75
                     height: 100%;
98
                     position: relative;
76
                     position: relative;
99
                     overflow: hidden;
77
                     overflow: hidden;
100
                     border-radius: 24px;
78
                     border-radius: 24px;
79
+
101
                     .BannerItem {
80
                     .BannerItem {
102
                       width: 100%;
81
                       width: 100%;
103
                       height: 100%;
82
                       height: 100%;
104
                       position: relative;
83
                       position: relative;
105
                       overflow: hidden;
84
                       overflow: hidden;
106
                       border-radius: 24px;
85
                       border-radius: 24px;
107
-                      > image {
86
+
87
+                      image {
108
                         width: 100%;
88
                         width: 100%;
109
                         height: 100%;
89
                         height: 100%;
110
                       }
90
                       }
113
                 }
93
                 }
114
               }
94
               }
115
             }
95
             }
116
-            > .NavContainer {
96
+
97
+            >.NavContainer {
117
               position: relative;
98
               position: relative;
118
               overflow: hidden;
99
               overflow: hidden;
119
               align-items: center;
100
               align-items: center;
120
               padding: 0 30px;
101
               padding: 0 30px;
121
               margin-top: 40px;
102
               margin-top: 40px;
122
-              > view {
103
+
104
+              >view {
123
                 margin-left: 30px;
105
                 margin-left: 30px;
124
                 position: relative;
106
                 position: relative;
125
                 overflow: hidden;
107
                 overflow: hidden;
108
+
126
                 &:first-child {
109
                 &:first-child {
127
                   margin-left: 0;
110
                   margin-left: 0;
128
                 }
111
                 }
112
+
129
                 &:nth-child(1) {
113
                 &:nth-child(1) {
130
-                  > view {
131
-                    > view {
132
-                      > text {
114
+                  >view {
115
+                    >view {
116
+                      >text {
133
                         &:first-child {
117
                         &:first-child {
134
                           color: #ffc412;
118
                           color: #ffc412;
135
                         }
119
                         }
137
                     }
121
                     }
138
                   }
122
                   }
139
                 }
123
                 }
124
+
140
                 &:nth-child(2) {
125
                 &:nth-child(2) {
141
-                  > view {
142
-                    > view {
143
-                      > text {
126
+                  >view {
127
+                    >view {
128
+                      >text {
144
                         &:first-child {
129
                         &:first-child {
145
                           color: #fb3fc8;
130
                           color: #fb3fc8;
146
                         }
131
                         }
148
                     }
133
                     }
149
                   }
134
                   }
150
                 }
135
                 }
136
+
151
                 &:nth-child(3) {
137
                 &:nth-child(3) {
152
-                  > view {
153
-                    > view {
154
-                      > text {
138
+                  >view {
139
+                    >view {
140
+                      >text {
155
                         &:first-child {
141
                         &:first-child {
156
                           color: #fb7820;
142
                           color: #fb7820;
157
                         }
143
                         }
159
                     }
145
                     }
160
                   }
146
                   }
161
                 }
147
                 }
148
+
162
                 &:nth-child(4) {
149
                 &:nth-child(4) {
163
-                  > view {
164
-                    > view {
165
-                      > text {
150
+                  >view {
151
+                    >view {
152
+                      >text {
166
                         &:first-child {
153
                         &:first-child {
167
                           color: #586ff8;
154
                           color: #586ff8;
168
                         }
155
                         }
170
                     }
157
                     }
171
                   }
158
                   }
172
                 }
159
                 }
173
-                > view {
160
+
161
+                >view {
174
                   width: 100%;
162
                   width: 100%;
175
                   padding-bottom: 100%;
163
                   padding-bottom: 100%;
176
                   background: #fff;
164
                   background: #fff;
177
                   position: relative;
165
                   position: relative;
178
                   overflow: hidden;
166
                   overflow: hidden;
179
                   border-radius: 12px;
167
                   border-radius: 12px;
180
-                  > view {
168
+
169
+                  >view {
181
                     width: 100%;
170
                     width: 100%;
182
-                    > text {
171
+
172
+                    >text {
183
                       display: block;
173
                       display: block;
184
                       text-align: center;
174
                       text-align: center;
185
                       line-height: 40px;
175
                       line-height: 40px;
186
                       color: #333;
176
                       color: #333;
187
                       font-size: 26px;
177
                       font-size: 26px;
178
+
188
                       &:first-child {
179
                       &:first-child {
189
                         font-size: 50px;
180
                         font-size: 50px;
190
                         line-height: 60px;
181
                         line-height: 60px;
195
                 }
186
                 }
196
               }
187
               }
197
             }
188
             }
198
-            > .HotActivityContainer {
189
+
190
+            >.HotActivityContainer {
199
               padding: 0 30px;
191
               padding: 0 30px;
200
               position: relative;
192
               position: relative;
201
               overflow: hidden;
193
               overflow: hidden;
202
               margin-top: 30px;
194
               margin-top: 30px;
203
-              > view {
195
+
196
+              >view {
204
                 width: 100%;
197
                 width: 100%;
205
                 position: relative;
198
                 position: relative;
206
                 overflow: hidden;
199
                 overflow: hidden;
207
                 border-radius: 40px;
200
                 border-radius: 40px;
208
                 background: #fff;
201
                 background: #fff;
209
-                > .Title {
202
+
203
+                >.Title {
210
                   font-size: 0;
204
                   font-size: 0;
211
                   white-space: nowrap;
205
                   white-space: nowrap;
212
                   text-align: center;
206
                   text-align: center;
213
                   padding: 30px 0;
207
                   padding: 30px 0;
214
-                  > text {
208
+
209
+                  >text {
215
                     display: inline-block;
210
                     display: inline-block;
216
                     vertical-align: middle;
211
                     vertical-align: middle;
217
                     font-size: 24px;
212
                     font-size: 24px;
218
                     color: #999;
213
                     color: #999;
214
+
219
                     &:first-child {
215
                     &:first-child {
220
                       font-size: 34px;
216
                       font-size: 34px;
221
                       color: #333;
217
                       color: #333;
225
                     }
221
                     }
226
                   }
222
                   }
227
                 }
223
                 }
228
-                > .Activity {
224
+
225
+                >.Activity {
229
                   width: 100%;
226
                   width: 100%;
230
                   padding-bottom: 33.33%;
227
                   padding-bottom: 33.33%;
231
                   position: relative;
228
                   position: relative;
232
                   overflow: hidden;
229
                   overflow: hidden;
233
-                  > image {
230
+
231
+                  >image {
234
                     width: 100%;
232
                     width: 100%;
235
                     height: 100%;
233
                     height: 100%;
236
                   }
234
                   }
237
                 }
235
                 }
238
               }
236
               }
239
             }
237
             }
240
-            > .OwnerContainer {
238
+
239
+            >.OwnerContainer {
241
               padding: 0 30px;
240
               padding: 0 30px;
242
               position: relative;
241
               position: relative;
243
               overflow: hidden;
242
               overflow: hidden;
244
               margin-top: 30px;
243
               margin-top: 30px;
245
-              > view {
244
+
245
+              >view {
246
                 width: 100%;
246
                 width: 100%;
247
                 position: relative;
247
                 position: relative;
248
                 overflow: hidden;
248
                 overflow: hidden;
249
                 border-radius: 40px;
249
                 border-radius: 40px;
250
                 background: #fff;
250
                 background: #fff;
251
-                > .Title {
251
+
252
+                >.Title {
252
                   font-size: 0;
253
                   font-size: 0;
253
                   white-space: nowrap;
254
                   white-space: nowrap;
254
                   text-align: center;
255
                   text-align: center;
255
                   padding: 30px 0;
256
                   padding: 30px 0;
256
-                  > text {
257
+
258
+                  >text {
257
                     display: inline-block;
259
                     display: inline-block;
258
                     vertical-align: middle;
260
                     vertical-align: middle;
259
                     font-size: 24px;
261
                     font-size: 24px;
260
                     color: #999;
262
                     color: #999;
263
+
261
                     &:first-child {
264
                     &:first-child {
262
                       font-size: 34px;
265
                       font-size: 34px;
263
                       color: #333;
266
                       color: #333;
267
                     }
270
                     }
268
                   }
271
                   }
269
                 }
272
                 }
270
-                > .OwnerList {
273
+
274
+                >.OwnerList {
271
                   border-top: 2px solid #f8f8f8;
275
                   border-top: 2px solid #f8f8f8;
272
                   align-items: center;
276
                   align-items: center;
273
                   padding: 30px 0;
277
                   padding: 30px 0;
274
-                  > view {
275
-                    > text {
278
+
279
+                  >view {
280
+                    >text {
276
                       display: block;
281
                       display: block;
277
                       width: 100%;
282
                       width: 100%;
278
                       text-align: center;
283
                       text-align: center;
279
                       font-size: 26px;
284
                       font-size: 26px;
280
                       color: #333;
285
                       color: #333;
281
                       line-height: 40px;
286
                       line-height: 40px;
287
+
282
                       &:first-child {
288
                       &:first-child {
283
                         color: #f35844;
289
                         color: #f35844;
284
                         font-size: 60px;
290
                         font-size: 60px;
290
                 }
296
                 }
291
               }
297
               }
292
             }
298
             }
293
-            > .NewsContainer {
299
+
300
+            >.NewsContainer {
294
               padding: 0 30px;
301
               padding: 0 30px;
295
               position: relative;
302
               position: relative;
296
               overflow: hidden;
303
               overflow: hidden;
297
               margin-top: 30px;
304
               margin-top: 30px;
298
-              > view {
305
+
306
+              >view {
299
                 position: relative;
307
                 position: relative;
300
                 overflow: hidden;
308
                 overflow: hidden;
301
                 background: #fff;
309
                 background: #fff;
302
                 border-radius: 40px;
310
                 border-radius: 40px;
303
-                > .Title {
311
+
312
+                >.Title {
304
                   align-items: center;
313
                   align-items: center;
305
                   padding: 0 20px;
314
                   padding: 0 20px;
306
-                  > text {
315
+
316
+                  >text {
307
                     font-size: 24px;
317
                     font-size: 24px;
308
                     color: #666;
318
                     color: #666;
309
                     line-height: 98px;
319
                     line-height: 98px;
310
                     margin-left: 10px;
320
                     margin-left: 10px;
321
+
311
                     &:first-child {
322
                     &:first-child {
312
                       font-size: 30px;
323
                       font-size: 30px;
313
                       color: #333;
324
                       color: #333;
314
                     }
325
                     }
315
                   }
326
                   }
316
                 }
327
                 }
317
-                > .List {
318
-                  > view {
328
+
329
+                >.List {
330
+                  >view {
319
                     align-items: center;
331
                     align-items: center;
320
                     border-top: 2px solid #f8f8f8;
332
                     border-top: 2px solid #f8f8f8;
321
                     padding: 30px 20px;
333
                     padding: 30px 20px;
322
                     position: relative;
334
                     position: relative;
323
                     overflow: hidden;
335
                     overflow: hidden;
336
+
324
                     &:first-child {
337
                     &:first-child {
325
                       border-top: none;
338
                       border-top: none;
326
                     }
339
                     }
327
-                    > .Img {
340
+
341
+                    >.Img {
328
                       width: 160px;
342
                       width: 160px;
329
                       height: 128px;
343
                       height: 128px;
330
                       position: relative;
344
                       position: relative;
331
                       overflow: hidden;
345
                       overflow: hidden;
332
                       background: #f8f8f8;
346
                       background: #f8f8f8;
333
                       margin-right: 20px;
347
                       margin-right: 20px;
334
-                      > image {
348
+
349
+                      >image {
335
                         width: 100%;
350
                         width: 100%;
336
                         height: 100%;
351
                         height: 100%;
337
                       }
352
                       }
338
                     }
353
                     }
339
-                    > .flex-item {
354
+
355
+                    >.flex-item {
340
                       position: relative;
356
                       position: relative;
341
                       overflow: hidden;
357
                       overflow: hidden;
342
-                      > text {
343
-                        display: block;
344
-                        font-size: 26px;
345
-                        color: #666;
346
-                        line-height: 40px;
358
+
359
+                      >view {
360
+
361
+                        text {
362
+                          display: block;
363
+                          font-size: 26px;
364
+                          color: #666;
365
+                          line-height: 40px;
366
+                        }
367
+
347
                         &:first-child {
368
                         &:first-child {
348
-                          font-size: 30px;
349
-                          color: #333;
350
-                          margin-bottom: 10px;
369
+                          text {
370
+                            font-size: 30px;
371
+                            color: #333;
372
+                            margin-bottom: 10px;
373
+                          }
351
                         }
374
                         }
375
+
352
                         &:last-child {
376
                         &:last-child {
353
-                          white-space: nowrap;
354
-                          overflow: hidden;
355
-                          text-overflow: ellipsis;
377
+                          text {
378
+                            white-space: nowrap;
379
+                            overflow: hidden;
380
+                            text-overflow: ellipsis;
381
+                          }
356
                         }
382
                         }
357
                       }
383
                       }
358
                     }
384
                     }
360
                 }
386
                 }
361
               }
387
               }
362
             }
388
             }
363
-            > .PageBottom {
389
+
390
+            >.PageBottom {
364
               width: 100%;
391
               width: 100%;
365
               height: 30px;
392
               height: 30px;
366
             }
393
             }
369
       }
396
       }
370
     }
397
     }
371
   }
398
   }
372
-}
399
+}

+ 4
- 0
src/utils/api.js View File

1
 const prefix = `${HOST}/api/wx`
1
 const prefix = `${HOST}/api/wx`
2
 
2
 
3
 const $api = {
3
 const $api = {
4
+  getIndexAdv: { // 获取首页广告
5
+    method: 'get',
6
+    url: `${prefix}/extendContent`
7
+  },
4
   getJiFenRecords: { // 获取积分明细
8
   getJiFenRecords: { // 获取积分明细
5
     method: 'get',
9
     method: 'get',
6
     url: `${prefix}/taPointsRecords`
10
     url: `${prefix}/taPointsRecords`