张延森 4 lat temu
rodzic
commit
4bbff4b0ca

+ 7
- 6
src/layouts/index.jsx Wyświetl plik

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

+ 32
- 14
src/pages/ShouYe/index.jsx Wyświetl plik

@@ -29,9 +29,12 @@ export default function Index (props) {
29 29
     { icon: 'iconxinwen', name: '资讯', id: 4, router: '/pages/ShouYe/ZiXun/index', isTab: false }
30 30
   ])
31 31
   const [BannerList, setBannerList] = useState([])
32
-  const [ActivityList, setActivityList] = useState([])
32
+  // const [ActivityList, setActivityList] = useState([])
33 33
   const [NewsList, setNewsList] = useState([])
34 34
 
35
+  // 宣传位
36
+  const [propagandaList, setPropagandaList] = useState([])
37
+
35 38
   useUserMounted(() => {
36 39
     Init()
37 40
   })
@@ -44,12 +47,19 @@ export default function Index (props) {
44 47
         done()
45 48
       }
46 49
     })
47
-    GetActivityList(() => { // 获取活动列表
50
+
51
+    GetPropagandaList(() => { // 宣传位
48 52
       DownCount += 1
49 53
       if (CheckDownCount(DownCount)) {
50 54
         done()
51 55
       }
52 56
     })
57
+    // GetActivityList(() => { // 获取活动列表
58
+    //   DownCount += 1
59
+    //   if (CheckDownCount(DownCount)) {
60
+    //     done()
61
+    //   }
62
+    // })
53 63
     GetNewsList(() => { // 获取资讯列表
54 64
       DownCount += 1
55 65
       if (CheckDownCount(DownCount)) {
@@ -68,14 +78,22 @@ export default function Index (props) {
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 95
       done()
78
-    })
96
+    }).catch(() => done())
79 97
   }
80 98
 
81 99
   const GetNewsList = (done = () => { }) => { // 获取资讯列表
@@ -183,15 +201,15 @@ export default function Index (props) {
183 201
 
184 202
                   {/* 热门活动 */}
185 203
                   {
186
-                    ActivityList.length > 0 &&
204
+                    propagandaList.length > 0 &&
187 205
                     <view className='HotActivityContainer'>
188 206
                       <view>
189 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 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 213
                         </view>
196 214
                       </view>
197 215
                     </view>

+ 2
- 1
src/pages/WoDe/YeZhuRenZheng/index.jsx Wyświetl plik

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