|
@@ -224,13 +224,13 @@ const Edit = props => {
|
224
|
224
|
if (dynamicId) {
|
225
|
225
|
console.log(dynamicId, 'dynamicId')
|
226
|
226
|
useEffect(() => {
|
227
|
|
- request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
|
|
227
|
+ request({ ...apis.activity.usedPoster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
|
228
|
228
|
console.log(data, "2222")
|
229
|
|
- if (data.length > 0) {
|
230
|
|
- setPosterId(data[0].posterId)
|
231
|
|
- changeImg(data[0].posterImg)
|
232
|
|
- changeTextArea(data[0].posterDescription)
|
233
|
|
- changeInput(data[0].posterTitle)
|
|
229
|
+ if (data) {
|
|
230
|
+ setPosterId(data.posterId)
|
|
231
|
+ changeImg(data.posterImg)
|
|
232
|
+ changeTextArea(data.posterDescription)
|
|
233
|
+ changeInput(data.posterTitle)
|
234
|
234
|
}
|
235
|
235
|
}).catch((err) => {
|
236
|
236
|
message.info(err.msg || err.message)
|
|
@@ -249,16 +249,24 @@ const Edit = props => {
|
249
|
249
|
})
|
250
|
250
|
}
|
251
|
251
|
|
|
252
|
+ //获取选中的模板
|
|
253
|
+ const [ checkList, setCheckList ] = useState([])
|
|
254
|
+
|
|
255
|
+ const cardChange = (e) => {
|
|
256
|
+ console.log(e,"123")
|
|
257
|
+ setCheckList(e)
|
|
258
|
+ }
|
|
259
|
+
|
252
|
260
|
const submitPoster = () => {
|
253
|
261
|
if (dynamicId) {
|
254
|
262
|
if (posterId) {
|
255
|
|
- request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
|
|
263
|
+ request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue, templateIds: checkList }, }).then((data) => {
|
256
|
264
|
message.info("保存成功")
|
257
|
265
|
}).catch((err) => {
|
258
|
266
|
message.info(err.msg || err.message)
|
259
|
267
|
})
|
260
|
268
|
} else {
|
261
|
|
- request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
|
|
269
|
+ request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue, templateIds: checkList }, }).then((data) => {
|
262
|
270
|
setPosterId(data.posterId)
|
263
|
271
|
message.info("保存成功")
|
264
|
272
|
}).catch((err) => {
|
|
@@ -270,13 +278,6 @@ const Edit = props => {
|
270
|
278
|
}
|
271
|
279
|
}
|
272
|
280
|
|
273
|
|
- const [ checkList, setCheckList ] = useState([2])
|
274
|
|
-
|
275
|
|
- const cardChange = (e) => {
|
276
|
|
- console.log(e,"123")
|
277
|
|
- setCheckList(e)
|
278
|
|
- }
|
279
|
|
-
|
280
|
281
|
return <div>
|
281
|
282
|
<div style={{ display: 'flex' }}>
|
282
|
283
|
<div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
|