许静 5 年前
父节点
当前提交
2b7c9aa050

+ 46
- 30
src/pages/activity/editActivity.jsx 查看文件

9
 import XForm, { FieldTypes } from '../../components/XForm';
9
 import XForm, { FieldTypes } from '../../components/XForm';
10
 import Wangedit from '../../components/Wangedit/Wangedit'
10
 import Wangedit from '../../components/Wangedit/Wangedit'
11
 import request from '../../utils/request'
11
 import request from '../../utils/request'
12
-import PosterBottom from '../../assets/bottom.png'
13
 import yinhao from '../../assets/yinhao.png'
12
 import yinhao from '../../assets/yinhao.png'
14
 import ImageUploader from '../../components/XForm/ImageUpload';
13
 import ImageUploader from '../../components/XForm/ImageUpload';
15
 import logo from '../../assets/logo.png';
14
 import logo from '../../assets/logo.png';
16
 import touxiang from '../../assets/touxiang.jpg';
15
 import touxiang from '../../assets/touxiang.jpg';
17
 import poster1 from '../../assets/poster1.png';
16
 import poster1 from '../../assets/poster1.png';
18
 import poster2 from '../../assets/poster2.png';
17
 import poster2 from '../../assets/poster2.png';
18
+import xiaochengxu from '../../assets/xiaochengxu.png'
19
 
19
 
20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
21
 const { TextArea } = Input;
21
 const { TextArea } = Input;
174
     const [imgValue, changeImg] = useState('')
174
     const [imgValue, changeImg] = useState('')
175
     const [posterId, setPosterId] = useState('')
175
     const [posterId, setPosterId] = useState('')
176
 
176
 
177
-    if(dynamicId){
177
+    if (dynamicId) {
178
+      console.log(dynamicId, 'dynamicId')
178
       useEffect(() => {
179
       useEffect(() => {
179
-        request({ ...apis.activity.poster, params: {targetId: dynamicId,targetType: 'activity'} }).then((data) => {
180
-          console.log(data,"2222")
181
-          if(data.length > 0){
180
+        request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
181
+          console.log(data, "2222")
182
+          if (data.length > 0) {
182
             setPosterId(data[0].posterId)
183
             setPosterId(data[0].posterId)
183
             changeImg(data[0].posterImg)
184
             changeImg(data[0].posterImg)
184
             changeTextArea(data[0].posterDescription)
185
             changeTextArea(data[0].posterDescription)
187
         }).catch((err) => {
188
         }).catch((err) => {
188
           message.info(err.msg || err.message)
189
           message.info(err.msg || err.message)
189
         })
190
         })
191
+        getMiniappName()
190
       }, [])
192
       }, [])
193
+    }else{
194
+      getMiniappName()
195
+    }
196
+    // 获取小程序名称
197
+    const [miniappName, setMiniappName] = useState('')
198
+    function getMiniappName() {
199
+      request({ ...apis.building.getMiniappName }).then(res => {
200
+        console.log(res, "0000000000000")
201
+        setMiniappName(res)
202
+      })
191
     }
203
     }
192
 
204
 
193
-    const submitPoster  = () => {
194
-       if(dynamicId){
195
-        if(posterId){
196
-          request({ ...apis.activity.updatePoster, urlData: {id: posterId}, data: {targetId: dynamicId,targetType: 'activity',posterImg: imgValue,posterTitle: inputValue,posterDescription: textAreaValue},}).then((data) => {
205
+    const submitPoster = () => {
206
+      if (dynamicId) {
207
+        if (posterId) {
208
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
197
             message.info("保存成功")
209
             message.info("保存成功")
198
           }).catch((err) => {
210
           }).catch((err) => {
199
             message.info(err.msg || err.message)
211
             message.info(err.msg || err.message)
200
           })
212
           })
201
-         }else{
202
-          request({ ...apis.activity.addPoster, data: {targetId: dynamicId,targetType: 'activity',posterImg: imgValue,posterTitle: inputValue,posterDescription: textAreaValue},}).then((data) => {
213
+        } else {
214
+          request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
203
             setPosterId(data.posterId)
215
             setPosterId(data.posterId)
204
             message.info("保存成功")
216
             message.info("保存成功")
205
           }).catch((err) => {
217
           }).catch((err) => {
206
             message.info(err.msg || err.message)
218
             message.info(err.msg || err.message)
207
           })
219
           })
208
-         }
209
-       }else{
220
+        }
221
+      } else {
210
         message.warn("请先保存基本信息数据")
222
         message.warn("请先保存基本信息数据")
211
-       }
223
+      }
212
     }
224
     }
213
 
225
 
214
     return <div>
226
     return <div>
215
       <div style={{ display: 'flex' }}>
227
       <div style={{ display: 'flex' }}>
216
         <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
228
         <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
217
-          <div style={{ width: '375px', height: '785px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
229
+          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
218
             <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
230
             <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
219
             <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
231
             <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
220
               <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
232
               <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
234
             <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
246
             <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
235
             <p style={{
247
             <p style={{
236
               margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
248
               margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
237
-              display: '-webkit-box', lineClamp: '3', height: '76px',
249
+              display: '-webkit-box', lineClamp: '3', height: '72px',
238
               WebkitLineClamp: '3',
250
               WebkitLineClamp: '3',
239
               WebkitBoxOrient: 'vertical',
251
               WebkitBoxOrient: 'vertical',
240
               overflow: 'hidden',
252
               overflow: 'hidden',
241
               textOverflow: 'ellipsis'
253
               textOverflow: 'ellipsis'
242
             }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
254
             }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
243
-            <img src={PosterBottom} style={{ width: '100%' }} alt="" />
255
+            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
256
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
257
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
258
+              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
259
+            </div>
244
           </div>
260
           </div>
245
           <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
261
           <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
246
         </div>
262
         </div>
273
     const [inputValue, changeInput] = useState('')
289
     const [inputValue, changeInput] = useState('')
274
     const [imgValue, changeImg] = useState('')
290
     const [imgValue, changeImg] = useState('')
275
     const [shareContentId, setShareContentId] = useState('')
291
     const [shareContentId, setShareContentId] = useState('')
276
-    
277
-    if(dynamicId){
292
+
293
+    if (dynamicId) {
278
       useEffect(() => {
294
       useEffect(() => {
279
-        request({ ...apis.activity.shareContent, params: {targetId: dynamicId,targetType: 'activity'},}).then((data) => {
280
-          console.log(data,"2222")
281
-          if(data.length > 0){
295
+        request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' }, }).then((data) => {
296
+          console.log(data, "2222")
297
+          if (data.length > 0) {
282
             setShareContentId(data[0].shareContentId)
298
             setShareContentId(data[0].shareContentId)
283
             changeImg(data[0].shareContentImg)
299
             changeImg(data[0].shareContentImg)
284
             changeInput(data[0].shareContentTitle)
300
             changeInput(data[0].shareContentTitle)
290
     }
306
     }
291
 
307
 
292
     const submitShare = () => {
308
     const submitShare = () => {
293
-      if(dynamicId){
294
-        if(shareContentId){
295
-          request({ ...apis.activity.updateShareContent, urlData: {id: shareContentId},data: {targetId: dynamicId,shareContentType: 'activity',shareContentImg: imgValue,shareContentTitle: inputValue},}).then((data) => {
309
+      if (dynamicId) {
310
+        if (shareContentId) {
311
+          request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
296
             message.info("保存成功")
312
             message.info("保存成功")
297
           }).catch((err) => {
313
           }).catch((err) => {
298
             message.info(err.msg || err.message)
314
             message.info(err.msg || err.message)
299
           })
315
           })
300
-         }else{
301
-          request({ ...apis.activity.addShareContent, data: {targetId: dynamicId,shareContentType: 'activity',shareContentImg: imgValue,shareContentTitle: inputValue},}).then((data) => {
316
+        } else {
317
+          request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue }, }).then((data) => {
302
             setShareContentId(data.shareContentId)
318
             setShareContentId(data.shareContentId)
303
             message.info("保存成功")
319
             message.info("保存成功")
304
           }).catch((err) => {
320
           }).catch((err) => {
305
             message.info(err.msg || err.message)
321
             message.info(err.msg || err.message)
306
           })
322
           })
307
-         }
308
-       }else{
323
+        }
324
+      } else {
309
         message.warn("请先保存基本信息数据")
325
         message.warn("请先保存基本信息数据")
310
-       }
326
+      }
311
     }
327
     }
312
 
328
 
313
     return <div style={{ padding: '20px' }}>
329
     return <div style={{ padding: '20px' }}>

+ 2
- 3
src/pages/building/list/add/components/poster.jsx 查看文件

60
   }
60
   }
61
   // 获取小程序名称
61
   // 获取小程序名称
62
   const [miniappName, setMiniappName] = useState('')
62
   const [miniappName, setMiniappName] = useState('')
63
-  function getMiniappName(currentId) {
63
+  function getMiniappName() {
64
 
64
 
65
     request({ ...apis.building.getMiniappName }).then(res => {
65
     request({ ...apis.building.getMiniappName }).then(res => {
66
     
66
     
116
             overflow: 'hidden',
116
             overflow: 'hidden',
117
             textOverflow: 'ellipsis',
117
             textOverflow: 'ellipsis',
118
           }}>{inputValue || (building.buildingName || '海报标题')}</p>
118
           }}>{inputValue || (building.buildingName || '海报标题')}</p>
119
-          <p style={{ color: '#999', padding: ' 0 20px' }}>约<span style={{ color: '#fd0d0c', fontSize: '24px', marginLeft: '6px' }}>{building.price}</span><span style={{ color: '#fd0d0c', fontSize: '20px' }}>元/m²</span></p>
120
-
119
+          <p style={{ color: '#999', padding: ' 0 20px' }}>约<span style={{ color: '#fd0d0c', fontSize: '24px', marginLeft: '6px' }}>{building.price} </span><span style={{ color: '#fd0d0c', fontSize: '20px' }}>元/m²</span></p>
121
           <img src={yinhao} style={{ width: '30px', marginLeft: '22px' }} alt="" />
120
           <img src={yinhao} style={{ width: '30px', marginLeft: '22px' }} alt="" />
122
           <p style={{
121
           <p style={{
123
             margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
122
             margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',

+ 0
- 1
src/pages/building/list/add/components/share.jsx 查看文件

7
 import XForm, { FieldTypes } from '../../../../../components/XForm';
7
 import XForm, { FieldTypes } from '../../../../../components/XForm';
8
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
8
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
 import request from '../../../../../utils/request'
9
 import request from '../../../../../utils/request'
10
-import PosterBottom from '../../../../../assets/bottom.png'
11
 import yinhao from '../../../../../assets/yinhao.png'
10
 import yinhao from '../../../../../assets/yinhao.png'
12
 import ImageUploader from '../../../../../components/XForm/ImageUpload';
11
 import ImageUploader from '../../../../../components/XForm/ImageUpload';
13
 import logo from '../../../../../assets/logo.png';
12
 import logo from '../../../../../assets/logo.png';

+ 22
- 13
src/pages/news/list/editNewsList.jsx 查看文件

10
 import XForm, { FieldTypes } from '../../../components/XForm';
10
 import XForm, { FieldTypes } from '../../../components/XForm';
11
 import Wangedit from '../../../components/Wangedit/Wangedit'
11
 import Wangedit from '../../../components/Wangedit/Wangedit'
12
 import request from '../../../utils/request'
12
 import request from '../../../utils/request'
13
-import PosterBottom from '../../../assets/bottom.png'
14
 import ImageUploader from '../../../components/XForm/ImageUpload';
13
 import ImageUploader from '../../../components/XForm/ImageUpload';
15
 import logo from '../../../assets/logo.png';
14
 import logo from '../../../assets/logo.png';
16
 import yinhao from '../../../assets/yinhao.png'
15
 import yinhao from '../../../assets/yinhao.png'
17
 import touxiang from '../../../assets/touxiang.jpg';
16
 import touxiang from '../../../assets/touxiang.jpg';
18
 import poster1 from '../../../assets/poster1.png';
17
 import poster1 from '../../../assets/poster1.png';
19
 import poster2 from '../../../assets/poster2.png';
18
 import poster2 from '../../../assets/poster2.png';
19
+import xiaochengxu from '../../../assets/xiaochengxu.png'
20
 
20
 
21
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
21
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
 const { TextArea } = Input;
22
 const { TextArea } = Input;
43
       console.log(err)
43
       console.log(err)
44
       message.info(err.msg || err.message)
44
       message.info(err.msg || err.message)
45
     })
45
     })
46
-
47
-    // request({
48
-    //     url: '/api/admin/taNews/' + newsId,
49
-    //     method: 'GET',
50
-    //     params: { newsId },
51
-    // }).then((data) => {
52
-    //     console.log(data)
53
-    //     setDynamicData(data)
54
-    // })
55
     }
46
     }
56
   }
47
   }
57
 
48
 
145
         }).catch((err) => {
136
         }).catch((err) => {
146
           message.info(err.msg || err.message)
137
           message.info(err.msg || err.message)
147
         })
138
         })
139
+        getMiniappName()
148
       }, [])
140
       }, [])
141
+    }else{
142
+      getMiniappName()
149
     }
143
     }
150
 
144
 
145
+    // 获取小程序名称
146
+  const [miniappName, setMiniappName] = useState('')
147
+  function getMiniappName() {
148
+
149
+    request({ ...apis.building.getMiniappName }).then(res => {
150
+    
151
+      setMiniappName(res)
152
+     
153
+    })
154
+  }
151
     const submitPoster  = () => {
155
     const submitPoster  = () => {
152
        if(newsId){
156
        if(newsId){
153
         if(posterId){
157
         if(posterId){
172
     return <div>
176
     return <div>
173
       <div style={{ display: 'flex' }}>
177
       <div style={{ display: 'flex' }}>
174
         <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
178
         <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
175
-          <div style={{ width: '375px', height: '785px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
179
+          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
176
             <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
180
             <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
177
             <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
181
             <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
178
               <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
182
               <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
192
             <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
196
             <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
193
             <p style={{
197
             <p style={{
194
               margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
198
               margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
195
-              display: '-webkit-box', lineClamp: '3', height: '76px',
199
+              display: '-webkit-box', lineClamp: '3', height: '72px',
196
               WebkitLineClamp: '3',
200
               WebkitLineClamp: '3',
197
               WebkitBoxOrient: 'vertical',
201
               WebkitBoxOrient: 'vertical',
198
               overflow: 'hidden',
202
               overflow: 'hidden',
199
               textOverflow: 'ellipsis'
203
               textOverflow: 'ellipsis'
200
             }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
204
             }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
201
-            <img src={PosterBottom} style={{ width: '100%' }} alt="" />
205
+               <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc',position:'relative' }}>
206
+            <p style={{margin:'0',fontSize:'18px',color:'#888'}}>长按识别小程序码</p>
207
+            <p style={{margin:'0',fontSize:'18px',color:'#888'}}>进入<span style={{margin:'0 5px',fontSize:'18px',color:'#333',fontWeight:'600'}}>{miniappName||'置业V顾问'}</span>报名活动</p>
208
+            <img style={{ width: '80px',position: 'absolute',right:'30px',top:'10px' }} src={xiaochengxu} alt="" />
209
+          </div>
210
+      
202
           </div>
211
           </div>
203
           <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
212
           <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
204
         </div>
213
         </div>