|
@@ -9,12 +9,9 @@ import getUserPhone from '@utils/getUserPhone'
|
9
|
9
|
import ready from '@utils/ready'
|
10
|
10
|
import { getDownloadURL } from '@utils/tools'
|
11
|
11
|
import {
|
12
|
|
- // addActivityShareNum,
|
13
|
|
- signupActivity,
|
14
|
|
- favorActivity,
|
15
|
|
- cancelFavorActivity,
|
16
|
|
- queryActivityDetail,
|
17
|
12
|
getHelpDetail,
|
|
13
|
+ createHelpActivity,
|
|
14
|
+ giveFriendHelp,
|
18
|
15
|
} from '@services/activity'
|
19
|
16
|
import {
|
20
|
17
|
getMiniQrcode,
|
|
@@ -25,9 +22,15 @@ import { connect } from '@tarojs/redux'
|
25
|
22
|
|
26
|
23
|
const times = n => n > 0 ? '*'.repeat(n-1).split('*') : []
|
27
|
24
|
|
28
|
|
-const BeforeStart = 0;
|
29
|
|
-const InProcess = 1;
|
30
|
|
-const Finished = 2;
|
|
25
|
+// 活动状态
|
|
26
|
+const ActBeforeStart = 0;
|
|
27
|
+const ActInProcess = 1;
|
|
28
|
+const ActFinished = 2;
|
|
29
|
+
|
|
30
|
+// 发起的助力状态
|
|
31
|
+const HelpInProcess = 1;
|
|
32
|
+const HelpSuccess = 0;
|
|
33
|
+const HelpFailure = 2;
|
31
|
34
|
|
32
|
35
|
const defaultAvatar = require('@assets/agent/banner.png')
|
33
|
36
|
|
|
@@ -48,38 +51,44 @@ export default class Detail extends Component {
|
48
|
51
|
posters: [], // 海报设置
|
49
|
52
|
leftTime: 0, // 剩余时间
|
50
|
53
|
ltTicker: undefined, // 剩余时间计时器
|
51
|
|
- actState: BeforeStart, // 活动状态
|
52
|
|
- isStarter: false, // 是否发起人
|
|
54
|
+ actState: ActBeforeStart, // 活动本身状态
|
|
55
|
+ helpState: HelpInProcess, // 发起助力活动的状态
|
|
56
|
+ isStarter: true, // 是否发起人
|
|
57
|
+ submitting: false, // 是否提交中
|
|
58
|
+ actionSheetVisible: false, // 底部分享好友
|
|
59
|
+ posterVisible: false, // 海报分享
|
|
60
|
+ grantPhoneVisible: false, // 授权电话
|
|
61
|
+ grantAvatarVisible: false, // 授权头像
|
53
|
62
|
}
|
54
|
63
|
|
55
|
64
|
componentWillMount() {
|
56
|
65
|
ready.queue(() => {
|
57
|
|
- const router = Taro.getStorageSync('router')
|
58
|
|
- const id = this.$router.params.id || router.query.id
|
59
|
|
- const initiateId = this.$router.params.initiateId || router.query.initiateId
|
60
|
|
-
|
61
|
|
- this.setState({ id, initiateId }, () => {
|
62
|
|
- this.loadDetail()
|
63
|
|
- })
|
64
|
|
-
|
65
|
|
- const { userInfo: { person: { phone, avatarurl } } } = this.props
|
66
|
|
- if (!phone) {
|
67
|
|
- // todo 授权电话
|
68
|
|
- }
|
69
|
|
-
|
70
|
|
- if (!avatarurl) {
|
71
|
|
- // todo 授权头像
|
|
66
|
+ // 必须先授权电话
|
|
67
|
+ if (this.toggleGrantPhone()) {
|
|
68
|
+ this.initPageData()
|
72
|
69
|
}
|
73
|
70
|
})
|
74
|
71
|
}
|
75
|
72
|
|
76
|
73
|
componentWillUnmount() {
|
77
|
|
- const { recordId } = this.state
|
78
|
|
- recordId && updatePoint(recordId)
|
|
74
|
+ // const { recordId } = this.state
|
|
75
|
+ // recordId && updatePoint(recordId)
|
79
|
76
|
|
80
|
77
|
this.clearTicker()
|
81
|
78
|
}
|
82
|
79
|
|
|
80
|
+ initPageData() {
|
|
81
|
+ if (!this.state.detail.helpActivityId) {
|
|
82
|
+ const router = Taro.getStorageSync('router')
|
|
83
|
+ const id = this.$router.params.id || router.query.id
|
|
84
|
+ const initiateId = this.$router.params.initiateId || router.query.initiateId
|
|
85
|
+
|
|
86
|
+ this.setState({ id, initiateId }, () => {
|
|
87
|
+ this.loadDetail()
|
|
88
|
+ })
|
|
89
|
+ }
|
|
90
|
+ }
|
|
91
|
+
|
83
|
92
|
clearTicker() {
|
84
|
93
|
if (this.state.ltTicker) {
|
85
|
94
|
clearInterval(this.state.ltTicker)
|
|
@@ -87,6 +96,40 @@ export default class Detail extends Component {
|
87
|
96
|
}
|
88
|
97
|
}
|
89
|
98
|
|
|
99
|
+ // 调起授权电话
|
|
100
|
+ toggleGrantPhone() {
|
|
101
|
+ const { userInfo: { person: { phone } } } = this.props
|
|
102
|
+ if (!phone) {
|
|
103
|
+ this.setState({ grantPhoneVisible: true })
|
|
104
|
+ return false
|
|
105
|
+ }
|
|
106
|
+
|
|
107
|
+ return true
|
|
108
|
+ }
|
|
109
|
+
|
|
110
|
+ // 调起授权头像
|
|
111
|
+ toggleGrantAvatar() {
|
|
112
|
+ const { userInfo: { person: { avatarurl } } } = this.props
|
|
113
|
+ if (!avatarurl) {
|
|
114
|
+ this.setState({ grantAvatarVisible: true })
|
|
115
|
+ return false
|
|
116
|
+ }
|
|
117
|
+
|
|
118
|
+ return true
|
|
119
|
+ }
|
|
120
|
+
|
|
121
|
+ toggleActionVisible() {
|
|
122
|
+ this.setState({
|
|
123
|
+ actionSheetVisible: !this.state.actionSheetVisible
|
|
124
|
+ })
|
|
125
|
+ }
|
|
126
|
+
|
|
127
|
+ togglePosterVisible() {
|
|
128
|
+ this.setState({
|
|
129
|
+ posterVisible: !this.state.posterVisible
|
|
130
|
+ })
|
|
131
|
+ }
|
|
132
|
+
|
90
|
133
|
updateLeftTime(startDate, endDate) {
|
91
|
134
|
const st = dayjs(startDate).valueOf()
|
92
|
135
|
const ed = dayjs(endDate).valueOf()
|
|
@@ -99,20 +142,20 @@ export default class Detail extends Component {
|
99
|
142
|
// 活动未开始
|
100
|
143
|
this.setState({
|
101
|
144
|
leftTime: st - nw,
|
102
|
|
- actState: BeforeStart,
|
|
145
|
+ actState: ActBeforeStart,
|
103
|
146
|
})
|
104
|
147
|
} else if (ed > nw) {
|
105
|
148
|
// 活动未结束
|
106
|
149
|
this.setState({
|
107
|
150
|
leftTime: ed - nw,
|
108
|
|
- actState: InProcess,
|
|
151
|
+ actState: ActInProcess,
|
109
|
152
|
})
|
110
|
153
|
} else {
|
111
|
154
|
// 活动已结束
|
112
|
155
|
this.clearTicker()
|
113
|
156
|
this.setState({
|
114
|
157
|
leftTime: 0,
|
115
|
|
- actState: Finished,
|
|
158
|
+ actState: ActFinished,
|
116
|
159
|
})
|
117
|
160
|
}
|
118
|
161
|
}, 1000)
|
|
@@ -135,99 +178,166 @@ export default class Detail extends Component {
|
135
|
178
|
|
136
|
179
|
loadDetail() {
|
137
|
180
|
const { id } = this.state
|
|
181
|
+ const { userInfo } = this.props
|
|
182
|
+
|
138
|
183
|
Taro.showLoading()
|
139
|
184
|
getHelpDetail(id).then(res => {
|
140
|
185
|
this.clearTicker()
|
141
|
186
|
|
142
|
|
- Taro.hideLoading()
|
143
|
|
- const { isSaved, isSign } = res
|
144
|
|
-
|
145
|
|
- // 活动状态分两种
|
146
|
|
- // 一种是活动本身是否在进行中
|
147
|
|
- // 一种是, 某个人发起的助力,是否在进行中
|
148
|
|
- // 发起的助力活动状态, 1 代表进行中, 0 代表成功, 2 代表失败
|
|
187
|
+ const initiateDetail = res.helpInitiateRecord || {}
|
149
|
188
|
|
|
189
|
+ Taro.hideLoading()
|
150
|
190
|
this.setState({
|
151
|
191
|
detail: res.helpActivity,
|
152
|
|
- initiateDetail: res.helpInitiateRecord || {},
|
|
192
|
+ initiateDetail,
|
|
193
|
+ helpState: initiateDetail.status === undefined ? HelpInProcess : initiateDetail.status,
|
153
|
194
|
shares: res.shareContentList || [],
|
154
|
195
|
posters: res.postList || [],
|
155
|
196
|
helpList: res.helpRecordList || [],
|
156
|
197
|
loaded: true,
|
157
|
|
- }, () => {
|
158
|
|
- // const { detail } = this.state
|
159
|
|
- // if (detail.posters[0].posterImg) {
|
160
|
|
- // this.setState({
|
161
|
|
- // posterShow: true
|
162
|
|
- // })
|
163
|
|
- // }
|
164
|
|
- this.updateLeftTime(res.helpActivity.startDate, res.helpActivity.endDate)
|
|
198
|
+ isStarter: !initiateDetail.person_id || userInfo.person.personId === initiateDetail.personId,
|
165
|
199
|
})
|
|
200
|
+
|
|
201
|
+ this.updateLeftTime(res.helpActivity.startDate, res.helpActivity.endDate)
|
166
|
202
|
// WxParse.wxParse('article', 'html', res.desc, this.$scope, 0)
|
167
|
203
|
|
168
|
|
- savePoint({
|
169
|
|
- event: 'detail',
|
170
|
|
- eventType: 'help',
|
171
|
|
- propertyName: '助力详情',
|
172
|
|
- buildingId: res.buildingId,
|
173
|
|
- targetId: res.helpActivityId,
|
174
|
|
- data: '{}'
|
175
|
|
- }).then(res1 => {
|
176
|
|
- this.setState({
|
177
|
|
- recordId: res1.recordId
|
178
|
|
- })
|
179
|
|
- })
|
|
204
|
+ // savePoint({
|
|
205
|
+ // event: 'detail',
|
|
206
|
+ // eventType: 'help',
|
|
207
|
+ // propertyName: '助力详情',
|
|
208
|
+ // buildingId: res.buildingId,
|
|
209
|
+ // targetId: res.helpActivityId,
|
|
210
|
+ // data: '{}'
|
|
211
|
+ // }).then(res1 => {
|
|
212
|
+ // this.setState({
|
|
213
|
+ // recordId: res1.recordId
|
|
214
|
+ // })
|
|
215
|
+ // })
|
180
|
216
|
})
|
181
|
217
|
}
|
182
|
218
|
|
183
|
|
- onShareAppMessage = () => {
|
184
|
|
- const { detail } = this.state
|
|
219
|
+ currentPageAndParams() {
|
|
220
|
+ const { detail, initiateDetail } = this.state
|
185
|
221
|
const { userInfo: { person: { personId } } } = this.props
|
186
|
222
|
|
187
|
|
- // addActivityShareNum(detail.helpActivityId)
|
|
223
|
+ let queryParams = [
|
|
224
|
+ `id=${detail.helpActivityId}`,
|
|
225
|
+ `from=help_share`,
|
|
226
|
+ `recommender=${personId}`
|
|
227
|
+ ]
|
|
228
|
+ if (initiateDetail.helpRecordInitiateId) {
|
|
229
|
+ queryParams.push(`initiateId=${helpRecordInitiateId}`)
|
|
230
|
+ }
|
|
231
|
+
|
|
232
|
+ return [
|
|
233
|
+ 'pages/activity/detail/assistance',
|
|
234
|
+ queryParams.join('&'),
|
|
235
|
+ ]
|
|
236
|
+ }
|
|
237
|
+
|
|
238
|
+ onShareAppMessage = () => {
|
|
239
|
+ const { shares } = this.state
|
|
240
|
+
|
|
241
|
+ if (!shares || !shares.length) {
|
|
242
|
+ Taro.hideShareMenu()
|
|
243
|
+ return {}
|
|
244
|
+ }
|
188
|
245
|
|
189
|
246
|
savePoint({
|
190
|
247
|
event: 'share',
|
191
|
248
|
eventType: 'help',
|
192
|
249
|
propertyName: '助力详情分享',
|
193
|
250
|
data: '{}'
|
194
|
|
- }).then(res => {
|
195
|
|
-
|
196
|
251
|
})
|
|
252
|
+
|
|
253
|
+ const currentPage = this.currentPageAndParams().join('?')
|
197
|
254
|
return {
|
198
|
|
- title: shareContents[0].shareContentTitle,
|
199
|
|
- path: `pages/activity/detail/assistance?id=${detail.helpActivityId}&from=help_share&recommender=${personId}`,//分享地址
|
200
|
|
- // imageUrl: shareContents[0].shareContentImg
|
|
255
|
+ title: shares[0].shareContentTitle,
|
|
256
|
+ path: currentPage,//分享地址
|
|
257
|
+ imageUrl: shares[0].shareContentImg
|
201
|
258
|
}
|
202
|
259
|
}
|
203
|
260
|
|
|
261
|
+ // 助力好友
|
204
|
262
|
handleHelp() {
|
205
|
|
- if (this.state.loaded) return
|
|
263
|
+ if (this.state.submitting) return
|
206
|
264
|
|
207
|
265
|
Taro.showLoading()
|
208
|
|
- this.setState({ loaded: true }, () => {
|
209
|
|
- Taro.hideLoading()
|
210
|
|
- this.setState({ loaded: false })
|
211
|
|
-
|
212
|
|
- // 助力好友
|
213
|
|
- // todo
|
|
266
|
+ this.setState({ submitting: true }, () => {
|
|
267
|
+ const {detail, initiateDetail} = this.state
|
|
268
|
+ const person = this.props.userInfo.person
|
|
269
|
+
|
|
270
|
+ giveFriendHelp({
|
|
271
|
+ buildingId: detail.buildingId,
|
|
272
|
+ helpActivityId: detail.helpActivityId,
|
|
273
|
+ personId: person.personId,
|
|
274
|
+ name: person.name || person.nickname,
|
|
275
|
+ phone: person.tel || person.phone,
|
|
276
|
+ avatarurl: person.avatarurl,
|
|
277
|
+ helpRecordInitiateId: initiateDetail.helpRecordInitiateId,
|
|
278
|
+ }).then(() => {
|
|
279
|
+ Taro.hideLoading()
|
|
280
|
+ this.setState({ submitting: false })
|
|
281
|
+ }).catch(err => {
|
|
282
|
+ console.log('err:', err)
|
|
283
|
+ Taro.hideLoading()
|
|
284
|
+ this.setState({ submitting: false })
|
|
285
|
+ Taro.showToast({
|
|
286
|
+ title: '助力失败',
|
|
287
|
+ icon: 'none'
|
|
288
|
+ })
|
|
289
|
+ })
|
214
|
290
|
})
|
215
|
291
|
}
|
216
|
292
|
|
217
|
|
- handleFavor() {
|
|
293
|
+ // 发起我的助力
|
|
294
|
+ startMine() {
|
|
295
|
+ // 必须授权头像
|
|
296
|
+ if (this.toggleGrantAvatar()) {
|
|
297
|
+ const detail = this.state.detail
|
|
298
|
+ const person = this.props.userInfo.person
|
|
299
|
+
|
|
300
|
+ return new Promise((resolve, reject) => {
|
|
301
|
+ createHelpActivity({
|
|
302
|
+ buildingId: detail.buildingId,
|
|
303
|
+ helpActivityId: detail.helpActivityId,
|
|
304
|
+ personId: person.personId,
|
|
305
|
+ name: person.name || person.nickname,
|
|
306
|
+ phone: person.tel || person.phone,
|
|
307
|
+ avatarurl: person.avatarurl,
|
|
308
|
+ }).then(res => {
|
|
309
|
+ this.setState({ initiateDetail: res }, resolve)
|
|
310
|
+ }).catch(err => {
|
|
311
|
+ console.log('err:', err)
|
|
312
|
+ Taro.showToast({
|
|
313
|
+ title: '发起助力失败',
|
|
314
|
+ icon: 'none'
|
|
315
|
+ })
|
|
316
|
+ reject()
|
|
317
|
+ })
|
|
318
|
+ })
|
|
319
|
+ }
|
|
320
|
+
|
|
321
|
+ return Promise.reject()
|
218
|
322
|
}
|
219
|
323
|
|
220
|
|
- handleGetPhone(e) {
|
221
|
|
- getUserPhone(e, (phoneNumber) => {
|
222
|
|
- if (phoneNumber) {
|
223
|
|
- this.handleSignup()
|
224
|
|
- } else {
|
225
|
|
- Taro.showToast({
|
226
|
|
- title: '报名失败',
|
227
|
|
- icon: 'none'
|
|
324
|
+ // 请求好友助力
|
|
325
|
+ askForHelp() {
|
|
326
|
+ // 必须授权头像
|
|
327
|
+ if (this.toggleGrantAvatar()) {
|
|
328
|
+ const initiateDetail = this.state.initiateDetail
|
|
329
|
+ if (!initiateDetail.helpRecordInitiateId) {
|
|
330
|
+ // 如果是未发起的助力, 先以当前人身份发起
|
|
331
|
+ this.startMine().then(() => {
|
|
332
|
+ this.toggleActionVisible()
|
228
|
333
|
})
|
|
334
|
+ } else {
|
|
335
|
+ this.toggleActionVisible()
|
229
|
336
|
}
|
230
|
|
- })
|
|
337
|
+ }
|
|
338
|
+ }
|
|
339
|
+
|
|
340
|
+ handleFavor() {
|
231
|
341
|
}
|
232
|
342
|
|
233
|
343
|
getPosterData = () => {
|
|
@@ -239,13 +349,11 @@ export default class Detail extends Component {
|
239
|
349
|
}
|
240
|
350
|
|
241
|
351
|
const { userInfo: { person } } = this.props
|
242
|
|
- const { avatarurl, nickname, personId } = person
|
243
|
|
- const { detail: { dynamicId, posters, createDate } } = this.state
|
244
|
|
- const payload = {
|
245
|
|
- "scene": `id=${dynamicId}&from=dynamic_share&recommender=${personId}`,
|
246
|
|
- "page": 'pages/activity/detail/index',
|
247
|
|
- }
|
248
|
|
- debugger
|
|
352
|
+ const { avatarurl, nickname } = person
|
|
353
|
+ const { detail: { posters, createDate } } = this.state
|
|
354
|
+ const [page, scene] = this.currentPageAndParams()
|
|
355
|
+ const payload = { page, scene }
|
|
356
|
+
|
249
|
357
|
const _avatarurl = getDownloadURL(avatarurl, 'avatar');
|
250
|
358
|
getMiniQrcode(payload).then(qrcode => {
|
251
|
359
|
let data = {
|
|
@@ -286,66 +394,6 @@ export default class Detail extends Component {
|
286
|
394
|
})
|
287
|
395
|
}
|
288
|
396
|
|
289
|
|
- handleMoreClick() {
|
290
|
|
- // App.zhuge.track('查看置业顾问列表')
|
291
|
|
- console.log()
|
292
|
|
- Taro.navigateTo({
|
293
|
|
- url: `/pages/card/list/index?buildingId=${this.$router.params.buildingId}`
|
294
|
|
- })
|
295
|
|
- }
|
296
|
|
-
|
297
|
|
- onChange = e => {
|
298
|
|
- this.setState({
|
299
|
|
- selectorChecked: this.state.selector[e.detail.value]
|
300
|
|
- })
|
301
|
|
- }
|
302
|
|
-
|
303
|
|
- onInputText = e => {
|
304
|
|
- this.setState({
|
305
|
|
- inputName: e.detail.value
|
306
|
|
- })
|
307
|
|
- }
|
308
|
|
-
|
309
|
|
- comfire = e => {
|
310
|
|
- const { detail: { buildingId, dynamicId }, isSign, selectorChecked, inputName } = this.state
|
311
|
|
- const { userInfo: { person: { phone, name, nickname, tel } } } = this.props
|
312
|
|
-
|
313
|
|
- if (inputName == '') {
|
314
|
|
- Taro.showToast({
|
315
|
|
- title: '请输入姓名',
|
316
|
|
- icon: 'none'
|
317
|
|
- })
|
318
|
|
- return
|
319
|
|
- }
|
320
|
|
-
|
321
|
|
- const payload = {
|
322
|
|
- buildingId,
|
323
|
|
- dynamicId,
|
324
|
|
- name: inputName,
|
325
|
|
- phone: phone ? phone : tel,
|
326
|
|
- attendNum: selectorChecked
|
327
|
|
- }
|
328
|
|
-
|
329
|
|
- signupActivity(payload).then(res => {
|
330
|
|
- Taro.showToast({
|
331
|
|
- title: '报名成功'
|
332
|
|
- })
|
333
|
|
- this.setState({
|
334
|
|
- isSign: true,
|
335
|
|
- canChoose: 'none'
|
336
|
|
- })
|
337
|
|
- })
|
338
|
|
-
|
339
|
|
- savePoint({
|
340
|
|
- event: 'enlist',
|
341
|
|
- eventType: 'help',
|
342
|
|
- propertyName: '助力详情报名',
|
343
|
|
- data: '{}'
|
344
|
|
- }).then(res => {
|
345
|
|
- console.log('助力详情报名 ')
|
346
|
|
- })
|
347
|
|
- }
|
348
|
|
-
|
349
|
397
|
hideModal() {
|
350
|
398
|
this.setState({
|
351
|
399
|
canChoose: 'none'
|
|
@@ -353,11 +401,22 @@ export default class Detail extends Component {
|
353
|
401
|
}
|
354
|
402
|
|
355
|
403
|
render() {
|
356
|
|
- const { detail, loaded, actState, posterVisible, posterData, isStarter, helpList } = this.state
|
357
|
|
- const { userInfo: { person: { phone, avatarurl } } } = this.props
|
358
|
|
-
|
359
|
|
- const avatar = this.state.initiateId ? this.state.initiateDetail.avatarurl : avatarurl
|
360
|
|
- const initiateInProcess = initiateDetail.status === 1;
|
|
404
|
+ const {
|
|
405
|
+ detail,
|
|
406
|
+ loaded,
|
|
407
|
+ actState,
|
|
408
|
+ posterVisible,
|
|
409
|
+ posterData,
|
|
410
|
+ isStarter,
|
|
411
|
+ helpList,
|
|
412
|
+ helpState,
|
|
413
|
+ actionSheetVisible,
|
|
414
|
+ grantAvatarVisible,
|
|
415
|
+ grantPhoneVisible,
|
|
416
|
+ } = this.state
|
|
417
|
+
|
|
418
|
+ const { userInfo } = this.props
|
|
419
|
+ const avatar = this.state.initiateId ? this.state.initiateDetail.avatarurl : userInfo.person.avatarurl
|
361
|
420
|
|
362
|
421
|
return (
|
363
|
422
|
<Block>
|
|
@@ -370,16 +429,33 @@ export default class Detail extends Component {
|
370
|
429
|
<Notice></Notice>
|
371
|
430
|
<View className="detail-banner">
|
372
|
431
|
<Image mode="widthFix" src={detail.img} className="detail-banner__img"></Image>
|
373
|
|
- <View className="rest-time">
|
374
|
|
- <Text className="row-label">{actState === BeforeStart ? '距活动开始:' : (actState === InProcess ? '活动剩余时间:' : '活动已结束')} </Text>
|
375
|
|
- <Text className="row-content">{actState != Finished ? this.formateLeftTime() : ''}</Text>
|
376
|
|
- </View>
|
|
432
|
+ {
|
|
433
|
+ helpState === HelpInProcess && actState != ActFinished &&
|
|
434
|
+ (
|
|
435
|
+ <View className="rest-time">
|
|
436
|
+ <Text className="row-label">{actState === ActBeforeStart ? '距活动开始:' : (actState === ActInProcess ? '活动剩余时间:' : '活动已结束')} </Text>
|
|
437
|
+ <Text className="row-content">{actState != ActFinished ? this.formateLeftTime() : ''}</Text>
|
|
438
|
+ </View>
|
|
439
|
+ )
|
|
440
|
+ }
|
377
|
441
|
</View>
|
378
|
442
|
<ScrollView
|
379
|
443
|
scrollY
|
380
|
444
|
className="detail-wrap">
|
381
|
445
|
<View className="detail">
|
382
|
446
|
<View class="detail-title">{detail.title}</View>
|
|
447
|
+ {
|
|
448
|
+ helpState === HelpSuccess &&
|
|
449
|
+ (
|
|
450
|
+ <Text>TODO: 助力成功</Text>
|
|
451
|
+ )
|
|
452
|
+ }
|
|
453
|
+ {
|
|
454
|
+ helpState === HelpFailure &&
|
|
455
|
+ (
|
|
456
|
+ <Text>TODO: 助力失败</Text>
|
|
457
|
+ )
|
|
458
|
+ }
|
383
|
459
|
<Image src={avatar} className="my__img"></Image>
|
384
|
460
|
<View className="assistance-text">邀请{detail.personNum}位好友即可赢取大奖</View>
|
385
|
461
|
<View className="assistance-text">{`${detail.enlistNum || 0}/${detail.personNum}`}</View>
|
|
@@ -408,29 +484,51 @@ export default class Detail extends Component {
|
408
|
484
|
</View>
|
409
|
485
|
<View>
|
410
|
486
|
{
|
411
|
|
- actState === BeforeStart &&
|
|
487
|
+ actState === ActBeforeStart &&
|
412
|
488
|
(<Button className="nostart-btn">未开始</Button>)
|
413
|
489
|
}
|
414
|
490
|
{
|
415
|
|
- actState === InProcess && !isStarter &&
|
|
491
|
+ isStarter && actState === ActInProcess && helpState === HelpInProcess &&
|
|
492
|
+ (<Button className="assistance-btn" onClick={this.askForHelp}>邀请好友助力</Button>)
|
|
493
|
+ }
|
|
494
|
+ {
|
|
495
|
+ !isStarter && actState === ActInProcess &&
|
416
|
496
|
(
|
417
|
497
|
<Block>
|
418
|
|
- ()
|
419
|
|
- <Button className="assistance-btn" onClick={this.handleHelp}>立即助力好友</Button>
|
420
|
|
- <Button className="assistance-btn">发起我的助力</Button>
|
|
498
|
+ {
|
|
499
|
+ helpState === HelpInProcess &&
|
|
500
|
+ (<Button className="assistance-btn" onClick={this.handleHelp}>立即助力好友</Button>)
|
|
501
|
+ }
|
|
502
|
+ <Button className="assistance-btn" onClick={this.startMine}>发起我的助力</Button>
|
421
|
503
|
</Block>
|
422
|
504
|
)
|
423
|
505
|
}
|
424
|
|
- <Button disabled={actState != InProcess} className={true ? "assistance-btn" : "nostart-btn"}>{actState === BeforeStart ? '未开始:' : (actState === InProcess ? '邀请好友助力:' : '活动已结束')}</Button>
|
425
|
506
|
</View>
|
426
|
507
|
<View className="assistance-text">活动说明</View>
|
427
|
508
|
<Image src={detail.activityInstructions}style="width:100%"></Image>
|
428
|
509
|
</ScrollView>
|
|
510
|
+
|
|
511
|
+ {
|
|
512
|
+ grantPhoneVisible &&
|
|
513
|
+ <View onSuccess={this.initPageData}>TODO: 授权电话</View>
|
|
514
|
+ }
|
|
515
|
+
|
|
516
|
+ {
|
|
517
|
+ grantAvatarVisible &&
|
|
518
|
+ <View onSuccess={() => {}}>TODO: 授权头像</View>
|
|
519
|
+ }
|
|
520
|
+
|
|
521
|
+ <action-sheet hidden={!actionSheetVisible} bindchange={this.toggleActionVisible}>
|
|
522
|
+ <action-sheet-item open-type="share">
|
|
523
|
+ <Button open-type="share" className='share__friend'>分享给好友</Button>
|
|
524
|
+ </action-sheet-item>
|
|
525
|
+ <action-sheet-item>
|
|
526
|
+ <Button className='creat__img' onClick={this.togglePosterVisible}>发送朋友圈</Button>
|
|
527
|
+ </action-sheet-item>
|
|
528
|
+ <action-sheet-cancel>取消</action-sheet-cancel>
|
|
529
|
+ </action-sheet>
|
429
|
530
|
|
430
|
|
- <View className="chat-entrance" onClick={this.handleMoreClick}>
|
431
|
|
- <Text className="iconfont icon-chat"></Text>
|
432
|
|
- </View>
|
433
|
|
- <BackHomeBtn></BackHomeBtn>
|
|
531
|
+ <BackHomeBtn></BackHomeBtn>
|
434
|
532
|
</View>
|
435
|
533
|
)
|
436
|
534
|
}
|