|
@@ -1,13 +1,17 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react'
|
2
|
2
|
import Taro, { Current } from '@tarojs/taro'
|
3
|
|
-import { RichText } from '@tarojs/components'
|
|
3
|
+import { RichText, Button } from '@tarojs/components'
|
4
|
4
|
import request, { apis } from '@/utils/request'
|
|
5
|
+import { useModel } from '@/store'
|
|
6
|
+import GetUserPhone from '@/components/GetUserPhone/index'
|
5
|
7
|
import '@/assets/css/reset.less'
|
6
|
8
|
import '@/assets/css/iconfont.less'
|
7
|
9
|
import './index.less'
|
8
|
10
|
|
9
|
11
|
export default function HuoDongDetail (props) {
|
10
|
12
|
|
|
13
|
+ const { user } = useModel('user')
|
|
14
|
+ const [ShowGetUserPhoneLayer, setShowGetUserPhoneLayer] = useState(false)
|
11
|
15
|
const [CurrnetHuoDongId] = useState(Current.router.params.id) // 当前活动id
|
12
|
16
|
const [ActivityDetail, setActivityDetail] = useState(null) // 活动详情
|
13
|
17
|
|
|
@@ -21,8 +25,18 @@ export default function HuoDongDetail (props) {
|
21
|
25
|
})
|
22
|
26
|
}
|
23
|
27
|
|
|
28
|
+ const ToJoin = () => { // 去报名
|
|
29
|
+ const { personId, phone } = user
|
|
30
|
+ const { dynamicId } = ActivityDetail
|
|
31
|
+ console.log(personId, phone, dynamicId)
|
|
32
|
+ }
|
|
33
|
+
|
24
|
34
|
return (
|
25
|
35
|
<view className='HuoDongDetail'>
|
|
36
|
+ {
|
|
37
|
+ ShowGetUserPhoneLayer &&
|
|
38
|
+ <GetUserPhone></GetUserPhone>
|
|
39
|
+ }
|
26
|
40
|
<view className='BannerLayer'></view>
|
27
|
41
|
{
|
28
|
42
|
ActivityDetail !== null &&
|
|
@@ -35,7 +49,7 @@ export default function HuoDongDetail (props) {
|
35
|
49
|
<view className='Info'>
|
36
|
50
|
<view className='MainInfo'>
|
37
|
51
|
<text className='Name'>{ActivityDetail.title}</text>
|
38
|
|
- <text className='Tips'>{ActivityDetail.enlistNum}人已报名</text>
|
|
52
|
+ <text className='Tips'>{ActivityDetail.enlisted}人已报名</text>
|
39
|
53
|
<view className='flex-h'>
|
40
|
54
|
<text>活动时间:</text>
|
41
|
55
|
<view className='flex-item'>{ActivityDetail.startDate}<text>限{ActivityDetail.enlistNum}人</text></view>
|
|
@@ -52,10 +66,10 @@ export default function HuoDongDetail (props) {
|
52
|
66
|
|
53
|
67
|
<view className='Desc'>
|
54
|
68
|
<text>活动介绍</text>
|
55
|
|
- <RichText nodes={null}></RichText>
|
|
69
|
+ <RichText nodes={ActivityDetail.desc}></RichText>
|
56
|
70
|
</view>
|
57
|
71
|
|
58
|
|
- <text className='BottomBtn'>立即参加</text>
|
|
72
|
+ <text className='BottomBtn' onClick={ToJoin}>立即参加</text>
|
59
|
73
|
|
60
|
74
|
</view>
|
61
|
75
|
}
|