傅行帆 hace 5 años
padre
commit
cd51ede958
Se han modificado 1 ficheros con 50 adiciones y 18 borrados
  1. 50
    18
      src/pages/activity/editActivity.jsx

+ 50
- 18
src/pages/activity/editActivity.jsx Ver fichero

@@ -16,7 +16,6 @@ import touxiang from '../../assets/touxiang.jpg';
16 16
 import poster1 from '../../assets/poster1.png';
17 17
 import poster2 from '../../assets/poster2.png';
18 18
 import xiaochengxu from '../../assets/xiaochengxu.png'
19
-import PosterCard from '../../components/Cards/PosterCard'
20 19
 
21 20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22 21
 const { TextArea } = Input;
@@ -224,13 +223,13 @@ const Edit = props => {
224 223
     if (dynamicId) {
225 224
       console.log(dynamicId, 'dynamicId')
226 225
       useEffect(() => {
227
-        request({ ...apis.activity.usedPoster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
226
+        request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
228 227
           console.log(data, "2222")
229
-          if (data) {
230
-            setPosterId(data.posterId)
231
-            changeImg(data.posterImg)
232
-            changeTextArea(data.posterDescription)
233
-            changeInput(data.posterTitle)
228
+          if (data.length > 0) {
229
+            setPosterId(data[0].posterId)
230
+            changeImg(data[0].posterImg)
231
+            changeTextArea(data[0].posterDescription)
232
+            changeInput(data[0].posterTitle)
234 233
           }
235 234
         }).catch((err) => {
236 235
           message.info(err.msg || err.message)
@@ -249,24 +248,16 @@ const Edit = props => {
249 248
       })
250 249
     }
251 250
 
252
-    //获取选中的模板
253
-    const [ checkList, setCheckList ] = useState([])
254
-
255
-    const cardChange = (e) => {
256
-      console.log(e,"123")
257
-      setCheckList(e)
258
-    }
259
-
260 251
     const submitPoster = () => {
261 252
       if (dynamicId) {
262 253
         if (posterId) {
263
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue, templateIds: checkList }, }).then((data) => {
254
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
264 255
             message.info("保存成功")
265 256
           }).catch((err) => {
266 257
             message.info(err.msg || err.message)
267 258
           })
268 259
         } else {
269
-          request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue, templateIds: checkList }, }).then((data) => {
260
+          request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
270 261
             setPosterId(data.posterId)
271 262
             message.info("保存成功")
272 263
           }).catch((err) => {
@@ -281,7 +272,48 @@ const Edit = props => {
281 272
     return <div>
282 273
       <div style={{ display: 'flex' }}>
283 274
         <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
284
-           <PosterCard postType="dynamic"  checkedList={checkList} onChange={cardChange} />
275
+          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
276
+            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
277
+            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
278
+              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
279
+              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
280
+              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
281
+              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
282
+            </div>
283
+            <p style={{
284
+              margin: '10px 20px',
285
+              fontSize: '20px',
286
+              color: '#222',
287
+              fontWeight: '600',
288
+              display: '-webkit-box',
289
+              lineClamp: '3',
290
+              height: '60px',
291
+              WebkitLineClamp: '2',
292
+              WebkitBoxOrient: 'vertical',
293
+              overflow: 'hidden',
294
+              textOverflow: 'ellipsis'
295
+            }}>{inputValue ? inputValue : '海报标题'}</p>
296
+
297
+            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
298
+            <p style={{
299
+              margin: '16px 20px 28px 20px',
300
+              fontSize: '17px',
301
+              color: '#999',
302
+              display: '-webkit-box',
303
+              lineClamp: '3',
304
+              height: '72px',
305
+              WebkitLineClamp: '3',
306
+              WebkitBoxOrient: 'vertical',
307
+              overflow: 'hidden',
308
+              textOverflow: 'ellipsis'
309
+            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
310
+            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
311
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
312
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
313
+              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
314
+            </div>
315
+          </div>
316
+          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
285 317
         </div>
286 318
 
287 319
         <div >