许静 5 years ago
parent
commit
2b7c9aa050

+ 46
- 30
src/pages/activity/editActivity.jsx View File

@@ -9,13 +9,13 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
9 9
 import XForm, { FieldTypes } from '../../components/XForm';
10 10
 import Wangedit from '../../components/Wangedit/Wangedit'
11 11
 import request from '../../utils/request'
12
-import PosterBottom from '../../assets/bottom.png'
13 12
 import yinhao from '../../assets/yinhao.png'
14 13
 import ImageUploader from '../../components/XForm/ImageUpload';
15 14
 import logo from '../../assets/logo.png';
16 15
 import touxiang from '../../assets/touxiang.jpg';
17 16
 import poster1 from '../../assets/poster1.png';
18 17
 import poster2 from '../../assets/poster2.png';
18
+import xiaochengxu from '../../assets/xiaochengxu.png'
19 19
 
20 20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
21 21
 const { TextArea } = Input;
@@ -174,11 +174,12 @@ const Edit = (props) => {
174 174
     const [imgValue, changeImg] = useState('')
175 175
     const [posterId, setPosterId] = useState('')
176 176
 
177
-    if(dynamicId){
177
+    if (dynamicId) {
178
+      console.log(dynamicId, 'dynamicId')
178 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 183
             setPosterId(data[0].posterId)
183 184
             changeImg(data[0].posterImg)
184 185
             changeTextArea(data[0].posterDescription)
@@ -187,34 +188,45 @@ const Edit = (props) => {
187 188
         }).catch((err) => {
188 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 209
             message.info("保存成功")
198 210
           }).catch((err) => {
199 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 215
             setPosterId(data.posterId)
204 216
             message.info("保存成功")
205 217
           }).catch((err) => {
206 218
             message.info(err.msg || err.message)
207 219
           })
208
-         }
209
-       }else{
220
+        }
221
+      } else {
210 222
         message.warn("请先保存基本信息数据")
211
-       }
223
+      }
212 224
     }
213 225
 
214 226
     return <div>
215 227
       <div style={{ display: 'flex' }}>
216 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 230
             <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
219 231
             <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
220 232
               <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
@@ -234,13 +246,17 @@ const Edit = (props) => {
234 246
             <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
235 247
             <p style={{
236 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 250
               WebkitLineClamp: '3',
239 251
               WebkitBoxOrient: 'vertical',
240 252
               overflow: 'hidden',
241 253
               textOverflow: 'ellipsis'
242 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 260
           </div>
245 261
           <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
246 262
         </div>
@@ -273,12 +289,12 @@ const Edit = (props) => {
273 289
     const [inputValue, changeInput] = useState('')
274 290
     const [imgValue, changeImg] = useState('')
275 291
     const [shareContentId, setShareContentId] = useState('')
276
-    
277
-    if(dynamicId){
292
+
293
+    if (dynamicId) {
278 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 298
             setShareContentId(data[0].shareContentId)
283 299
             changeImg(data[0].shareContentImg)
284 300
             changeInput(data[0].shareContentTitle)
@@ -290,24 +306,24 @@ const Edit = (props) => {
290 306
     }
291 307
 
292 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 312
             message.info("保存成功")
297 313
           }).catch((err) => {
298 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 318
             setShareContentId(data.shareContentId)
303 319
             message.info("保存成功")
304 320
           }).catch((err) => {
305 321
             message.info(err.msg || err.message)
306 322
           })
307
-         }
308
-       }else{
323
+        }
324
+      } else {
309 325
         message.warn("请先保存基本信息数据")
310
-       }
326
+      }
311 327
     }
312 328
 
313 329
     return <div style={{ padding: '20px' }}>

+ 2
- 3
src/pages/building/list/add/components/poster.jsx View File

@@ -60,7 +60,7 @@ const Poster = props => {
60 60
   }
61 61
   // 获取小程序名称
62 62
   const [miniappName, setMiniappName] = useState('')
63
-  function getMiniappName(currentId) {
63
+  function getMiniappName() {
64 64
 
65 65
     request({ ...apis.building.getMiniappName }).then(res => {
66 66
     
@@ -116,8 +116,7 @@ const Poster = props => {
116 116
             overflow: 'hidden',
117 117
             textOverflow: 'ellipsis',
118 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 120
           <img src={yinhao} style={{ width: '30px', marginLeft: '22px' }} alt="" />
122 121
           <p style={{
123 122
             margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',

+ 0
- 1
src/pages/building/list/add/components/share.jsx View File

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

+ 22
- 13
src/pages/news/list/editNewsList.jsx View File

@@ -10,13 +10,13 @@ import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
10 10
 import XForm, { FieldTypes } from '../../../components/XForm';
11 11
 import Wangedit from '../../../components/Wangedit/Wangedit'
12 12
 import request from '../../../utils/request'
13
-import PosterBottom from '../../../assets/bottom.png'
14 13
 import ImageUploader from '../../../components/XForm/ImageUpload';
15 14
 import logo from '../../../assets/logo.png';
16 15
 import yinhao from '../../../assets/yinhao.png'
17 16
 import touxiang from '../../../assets/touxiang.jpg';
18 17
 import poster1 from '../../../assets/poster1.png';
19 18
 import poster2 from '../../../assets/poster2.png';
19
+import xiaochengxu from '../../../assets/xiaochengxu.png'
20 20
 
21 21
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22 22
 const { TextArea } = Input;
@@ -43,15 +43,6 @@ const { TextArea } = Input;
43 43
       console.log(err)
44 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,9 +136,22 @@ const { TextArea } = Input;
145 136
         }).catch((err) => {
146 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 155
     const submitPoster  = () => {
152 156
        if(newsId){
153 157
         if(posterId){
@@ -172,7 +176,7 @@ const { TextArea } = Input;
172 176
     return <div>
173 177
       <div style={{ display: 'flex' }}>
174 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 180
             <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
177 181
             <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
178 182
               <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
@@ -192,13 +196,18 @@ const { TextArea } = Input;
192 196
             <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
193 197
             <p style={{
194 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 200
               WebkitLineClamp: '3',
197 201
               WebkitBoxOrient: 'vertical',
198 202
               overflow: 'hidden',
199 203
               textOverflow: 'ellipsis'
200 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 211
           </div>
203 212
           <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
204 213
         </div>