|
@@ -16,6 +16,7 @@ import { useSelector } from 'react-redux';
|
16
|
16
|
import {
|
17
|
17
|
signupActivity,
|
18
|
18
|
queryActivityDetail,
|
|
19
|
+<<<<<<< HEAD
|
19
|
20
|
} from '@/services/activity';
|
20
|
21
|
import { getImgURL } from '@/utils/image';
|
21
|
22
|
import getDateFormat from '@/utils/chatDate';
|
|
@@ -48,6 +49,19 @@ const activityStatusDict = {
|
48
|
49
|
},
|
49
|
50
|
};
|
50
|
51
|
|
|
52
|
+=======
|
|
53
|
+} from "@/services/activity";
|
|
54
|
+import { getImgURL } from "@/utils/image";
|
|
55
|
+import getDateFormat from "@/utils/chatDate";
|
|
56
|
+import useParams from "@/utils/hooks/useParams";
|
|
57
|
+import useShare from "@/utils/hooks/useShare";
|
|
58
|
+import useFavor from "@/utils/hooks/useFavor";
|
|
59
|
+import useStatus from './useStatus'
|
|
60
|
+
|
|
61
|
+import { getDownloadURL, times, transferImage } from "@/utils/tools";
|
|
62
|
+import "./index.scss";
|
|
63
|
+
|
|
64
|
+>>>>>>> 9b71da79c5db94acce0d9ed188d5664b36c36c8c
|
51
|
65
|
export default withLayout((props) => {
|
52
|
66
|
const { router, shareContent, trackData, person, page } = props;
|
53
|
67
|
const { id } = router.params;
|
|
@@ -62,14 +76,18 @@ export default withLayout((props) => {
|
62
|
76
|
|
63
|
77
|
const buildingId = detail?.buildingId;
|
64
|
78
|
|
|
79
|
+ const [btnText, btnDisabled] = useStatus(detail)
|
|
80
|
+
|
65
|
81
|
const getDetail = (params) => {
|
66
|
82
|
Taro.showLoading();
|
67
|
83
|
|
68
|
84
|
queryActivityDetail(params).then((res) => {
|
69
|
|
- const maxperson =
|
70
|
|
- res.maxEnlistByPerson < 100 ? res.maxEnlistByPerson : 100;
|
|
85
|
+ // const maxperson =
|
|
86
|
+ // res.maxEnlistByPerson < 100 ? res.maxEnlistByPerson : 100;
|
71
|
87
|
|
72
|
|
- setSelector(times(maxperson || 1).map((_, i) => `${i + 1}`));
|
|
88
|
+ const maxperson = 10
|
|
89
|
+
|
|
90
|
+ setSelector(times(maxperson).map((_, i) => `${i + 1}`));
|
73
|
91
|
|
74
|
92
|
setDetail(res);
|
75
|
93
|
Taro.hideLoading();
|
|
@@ -155,16 +173,7 @@ export default withLayout((props) => {
|
155
|
173
|
}
|
156
|
174
|
|
157
|
175
|
const handleSignup = () => {
|
158
|
|
- const { isSign } = detail;
|
159
|
|
-
|
160
|
|
- if (isSign) {
|
161
|
|
- Taro.showToast({
|
162
|
|
- icon: 'none',
|
163
|
|
- title: '你已报名成功',
|
164
|
|
- });
|
165
|
|
- return;
|
166
|
|
- }
|
167
|
|
- setCanChoose('block');
|
|
176
|
+ setCanChoose("block");
|
168
|
177
|
};
|
169
|
178
|
|
170
|
179
|
const comfire = () => {
|
|
@@ -188,9 +197,9 @@ export default withLayout((props) => {
|
188
|
197
|
|
189
|
198
|
signupActivity(payload).then(() => {
|
190
|
199
|
Taro.showToast({
|
191
|
|
- title: '报名成功',
|
192
|
|
- })
|
193
|
|
- setSelector('none')
|
|
200
|
+ title: "报名成功",
|
|
201
|
+ });
|
|
202
|
+ setCanChoose('none')
|
194
|
203
|
setTimeout(() => {
|
195
|
204
|
getDetail(id)
|
196
|
205
|
}, 500)
|
|
@@ -405,8 +414,8 @@ export default withLayout((props) => {
|
405
|
414
|
></Image>
|
406
|
415
|
</view>
|
407
|
416
|
|
408
|
|
- {detail.type == 'dymic' && dymic()}
|
409
|
|
- {detail.type == 'house' && house()}
|
|
417
|
+ {detail.type == "dymic" && dymic()}
|
|
418
|
+ {detail.type == "house" && house()}
|
410
|
419
|
<view className='ActivityIntro'>
|
411
|
420
|
<view className='Title'>
|
412
|
421
|
<text>活动介绍</text>
|
|
@@ -419,24 +428,24 @@ export default withLayout((props) => {
|
419
|
428
|
</ScrollView>
|
420
|
429
|
</view>
|
421
|
430
|
</view>
|
422
|
|
- {detail.type == 'dymic' && (
|
|
431
|
+ {detail.type == "dymic" && (
|
423
|
432
|
<view className='PageBottom flex-h'>
|
424
|
|
- <Button className='Share' open-type='share'>
|
|
433
|
+ <button className='Share' open-type='share'>
|
425
|
434
|
<text className='iconfont icon-fenxiang'></text>
|
426
|
435
|
<text>分享</text>
|
427
|
|
- </Button>
|
|
436
|
+ </button>
|
428
|
437
|
<view className='Collect' onClick={handleFavor}>
|
429
|
438
|
<text
|
430
|
439
|
className='iconfont icon-shoucang'
|
431
|
|
- style={isSaved ? { color: 'red' } : undefined}
|
|
440
|
+ style={isSaved ? { color: "red" } : undefined}
|
432
|
441
|
></text>
|
433
|
442
|
<text>{isSaved ? '已收藏' : '收藏'}</text>
|
434
|
443
|
</view>
|
435
|
444
|
<view className='flex-item'></view>
|
436
|
445
|
|
437
|
|
- <text className='Post' onClick={handleSignup}>
|
438
|
|
- {activityStatusDict[detail.activityStatus]?.text}
|
439
|
|
- </text>
|
|
446
|
+ <button disabled={btnDisabled} className='Post' onClick={handleSignup}>
|
|
447
|
+ {btnText}
|
|
448
|
+ </button>
|
440
|
449
|
</view>
|
441
|
450
|
)}
|
442
|
451
|
</view>
|