张延森 4 years ago
parent
commit
4bbff4b0ca
3 changed files with 41 additions and 21 deletions
  1. 7
    6
      src/layouts/index.jsx
  2. 32
    14
      src/pages/ShouYe/index.jsx
  3. 2
    1
      src/pages/WoDe/YeZhuRenZheng/index.jsx

+ 7
- 6
src/layouts/index.jsx View File

1
-import React, { useState, useEffect } from 'react'
1
+import React, { useEffect, useState } from 'react'
2
 import Taro, { useDidShow } from '@tarojs/taro'
2
 import Taro, { useDidShow } from '@tarojs/taro'
3
-import { useModel } from '@/store'
4
-import Spin from '@/components/Spin'
5
-import GetUserPhone from '@/components/GetUserPhone/index'
6
-import GetUserIcon from '@/components/GetUserIcon/index'
3
+
7
 import AdvLayer from '@/components/AdvLayer'
4
 import AdvLayer from '@/components/AdvLayer'
5
+import GetUserIcon from '@/components/GetUserIcon/index'
6
+import GetUserPhone from '@/components/GetUserPhone/index'
8
 import RenZhengScreen from '@/components/RenZhengScreen'
7
 import RenZhengScreen from '@/components/RenZhengScreen'
8
+import Spin from '@/components/Spin'
9
 import YeZhuRenZhengPopup from '@/components/YeZhuRenZhengPopup'
9
 import YeZhuRenZhengPopup from '@/components/YeZhuRenZhengPopup'
10
-import useMountTrack from '@/utils/hooks/useMountTrack'
11
 import { getPage } from '@/utils'
10
 import { getPage } from '@/utils'
11
+import { useModel } from '@/store'
12
+import useMountTrack from '@/utils/hooks/useMountTrack'
12
 import './index.less'
13
 import './index.less'
13
 
14
 
14
 const pages = require('../pages')
15
 const pages = require('../pages')

+ 32
- 14
src/pages/ShouYe/index.jsx View File

29
     { icon: 'iconxinwen', name: '资讯', id: 4, router: '/pages/ShouYe/ZiXun/index', isTab: false }
29
     { icon: 'iconxinwen', name: '资讯', id: 4, router: '/pages/ShouYe/ZiXun/index', isTab: false }
30
   ])
30
   ])
31
   const [BannerList, setBannerList] = useState([])
31
   const [BannerList, setBannerList] = useState([])
32
-  const [ActivityList, setActivityList] = useState([])
32
+  // const [ActivityList, setActivityList] = useState([])
33
   const [NewsList, setNewsList] = useState([])
33
   const [NewsList, setNewsList] = useState([])
34
 
34
 
35
+  // 宣传位
36
+  const [propagandaList, setPropagandaList] = useState([])
37
+
35
   useUserMounted(() => {
38
   useUserMounted(() => {
36
     Init()
39
     Init()
37
   })
40
   })
44
         done()
47
         done()
45
       }
48
       }
46
     })
49
     })
47
-    GetActivityList(() => { // 获取活动列表
50
+
51
+    GetPropagandaList(() => { // 宣传位
48
       DownCount += 1
52
       DownCount += 1
49
       if (CheckDownCount(DownCount)) {
53
       if (CheckDownCount(DownCount)) {
50
         done()
54
         done()
51
       }
55
       }
52
     })
56
     })
57
+    // GetActivityList(() => { // 获取活动列表
58
+    //   DownCount += 1
59
+    //   if (CheckDownCount(DownCount)) {
60
+    //     done()
61
+    //   }
62
+    // })
53
     GetNewsList(() => { // 获取资讯列表
63
     GetNewsList(() => { // 获取资讯列表
54
       DownCount += 1
64
       DownCount += 1
55
       if (CheckDownCount(DownCount)) {
65
       if (CheckDownCount(DownCount)) {
68
     })
78
     })
69
   }
79
   }
70
 
80
 
71
-  const GetActivityList = (done = () => { }) => { // 获取活动列表
72
-    setActivityList([])
73
-    request({ ...apis.getActivityList, params: { pageNum: 1, pageSize: 1 } }).then((res) => {
74
-      setActivityList([...res.list])
75
-      done()
76
-    }).catch(() => {
81
+  // const GetActivityList = (done = () => { }) => { // 获取活动列表
82
+  //   setActivityList([])
83
+  //   request({ ...apis.getActivityList, params: { pageNum: 1, pageSize: 1 } }).then((res) => {
84
+  //     setActivityList([...res.list])
85
+  //     done()
86
+  //   }).catch(() => {
87
+  //     done()
88
+  //   })
89
+  // }
90
+
91
+  const GetPropagandaList = (done = () => {}) => {
92
+    setPropagandaList([])
93
+    request({...apis.getIndexAdv, params: {pageNum: 1, pageSize: 1, showType: 'propaganda'}}).then(res => {
94
+      setPropagandaList([...(res || [])])
77
       done()
95
       done()
78
-    })
96
+    }).catch(() => done())
79
   }
97
   }
80
 
98
 
81
   const GetNewsList = (done = () => { }) => { // 获取资讯列表
99
   const GetNewsList = (done = () => { }) => { // 获取资讯列表
183
 
201
 
184
                   {/* 热门活动 */}
202
                   {/* 热门活动 */}
185
                   {
203
                   {
186
-                    ActivityList.length > 0 &&
204
+                    propagandaList.length > 0 &&
187
                     <view className='HotActivityContainer'>
205
                     <view className='HotActivityContainer'>
188
                       <view>
206
                       <view>
189
                         <view className='Title'>
207
                         <view className='Title'>
190
-                          <Text onClick={() => { Taro.navigateTo({ url: '/pages/ShouYe/HuoDong/index' }) }}>热门活动</Text>
191
-                          <Text className='iconfont icongengduo' onClick={() => { Taro.navigateTo({ url: '/pages/ShouYe/HuoDong/index' }) }}></Text>
208
+                          <Text>热门活动</Text>
209
+                          <Text className='iconfont icongengduo'></Text>
192
                         </view>
210
                         </view>
193
-                        <view className='Activity' onClick={() => { Taro.navigateTo({ url: `/pages/HuoDong/HuoDongDetail/index?id=${ActivityList[0].dynamicId}` }) }}>
194
-                          <image className='centerLabel' mode='aspectFill' src={ActivityList[0].imgUrl}></image>
211
+                        <view className='Activity' onClick={() => nav2detail({type: propagandaList[0].contentType, id: propagandaList[0].targetId})}>
212
+                          <image className='centerLabel' mode='aspectFill' src={propagandaList[0].image}></image>
195
                         </view>
213
                         </view>
196
                       </view>
214
                       </view>
197
                     </view>
215
                     </view>

+ 2
- 1
src/pages/WoDe/YeZhuRenZheng/index.jsx View File

176
             roomNoId: Level6List[Level6Value].id,
176
             roomNoId: Level6List[Level6Value].id,
177
             phone: FormData.Phone,
177
             phone: FormData.Phone,
178
             ownerName: FormData.RealName,
178
             ownerName: FormData.RealName,
179
-            idCard: FormData.IdCard
179
+            idCard: FormData.IdCard,
180
+            roleName: CurrentRoleName
180
           }
181
           }
181
         }).then((res) => {
182
         }).then((res) => {
182
           Taro.showToast({ title: '添加认证成功', icon: 'none' })
183
           Taro.showToast({ title: '添加认证成功', icon: 'none' })