|
@@ -101,18 +101,23 @@ const header = props => {
|
101
|
101
|
{row.activityStatus === 0 &&
|
102
|
102
|
<AuthButton name="admin.taShareActivity.finish.put" noRight={null}><span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span></AuthButton>
|
103
|
103
|
}
|
104
|
|
- {row.activityStatus === 0 &&
|
|
104
|
+ {(row.activityStatus === 0 || row.activityStatus === 2)&&
|
105
|
105
|
<AuthButton name="admin.taShareSuccessRecord.get" noRight={null}>
|
106
|
106
|
<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
|
107
|
107
|
</AuthButton>
|
108
|
108
|
}
|
|
109
|
+ {row.activityStatus === 0 &&
|
|
110
|
+ <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
|
|
111
|
+ <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
|
|
112
|
+ </AuthButton>
|
|
113
|
+ }
|
109
|
114
|
{row.activityStatus === 0 &&
|
110
|
115
|
<AuthButton name="admin.taShareActivity.list.get" noRight={null}>
|
111
|
|
- <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{row.weight === 1 ? '取消置顶' : '置顶'}<Icon type="vertical-align-top" className={styles.edit} /></span>
|
|
116
|
+ <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
|
112
|
117
|
<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{row.sort === true ? '取消推荐首页' : '推荐首页'}<Icon type="vertical-align-top" className={styles.edit} /></span>
|
113
|
118
|
</AuthButton>}
|
114
|
119
|
|
115
|
|
- {row.activityStatus === 1 &&
|
|
120
|
+ {(row.activityStatus === 0 || row.activityStatus === 1) &&
|
116
|
121
|
<AuthButton name="admin.taShareActivity.update.put" noRight={null}>
|
117
|
122
|
<span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditActivity(row.groupActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
|
118
|
123
|
</AuthButton>
|
|
@@ -193,21 +198,28 @@ const header = props => {
|
193
|
198
|
})
|
194
|
199
|
}
|
195
|
200
|
|
196
|
|
- //首页推荐
|
197
|
|
- const recommendGroupActivity = (row, code) => () => {
|
198
|
|
- request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, sort: row.sort } }).then((data) => {
|
199
|
|
- console.log(data)
|
|
201
|
+ const sendOrPublicDynamic = row => {
|
|
202
|
+ if (row.status === 1) {
|
|
203
|
+ cancelDynamic(row)
|
|
204
|
+ } else {
|
|
205
|
+ sendDynamic(row)
|
|
206
|
+ }
|
|
207
|
+ }
|
|
208
|
+
|
|
209
|
+ // 取消活动
|
|
210
|
+ const cancelDynamic = row => {
|
|
211
|
+ request({ ...apis.groupActivity.cancel, urlData: { id: row.groupActivityId } }).then(data => {
|
200
|
212
|
message.info('操作成功!')
|
201
|
|
- getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
|
202
|
|
- }).catch((err) => {
|
|
213
|
+ getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
|
|
214
|
+ }).catch(err => {
|
203
|
215
|
console.log(err)
|
204
|
216
|
message.info(err.msg || err.message)
|
205
|
217
|
})
|
206
|
218
|
}
|
207
|
219
|
|
208
|
|
- //发布活动
|
209
|
|
- const sendDynamic = (row) => {
|
210
|
|
- request({ ...apis.activity.send, urlData: { id: row.dynamicId } }).then((data) => {
|
|
220
|
+ // 发布活动
|
|
221
|
+ const sendDynamic = row => {
|
|
222
|
+ request({ ...apis.groupActivity.send, urlData: { id: row.groupActivityId } }).then(data => {
|
211
|
223
|
message.info('操作成功!')
|
212
|
224
|
getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
|
213
|
225
|
}).catch(err => {
|
|
@@ -216,6 +228,18 @@ const header = props => {
|
216
|
228
|
})
|
217
|
229
|
}
|
218
|
230
|
|
|
231
|
+ //首页推荐
|
|
232
|
+ const recommendGroupActivity = (row, code) => () => {
|
|
233
|
+ request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, sort: row.sort } }).then((data) => {
|
|
234
|
+ console.log(data)
|
|
235
|
+ message.info('操作成功!')
|
|
236
|
+ getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
|
|
237
|
+ }).catch((err) => {
|
|
238
|
+ console.log(err)
|
|
239
|
+ message.info(err.msg || err.message)
|
|
240
|
+ })
|
|
241
|
+ }
|
|
242
|
+
|
219
|
243
|
const changePageNum = pageNumber => {
|
220
|
244
|
getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
|
221
|
245
|
}
|