ソースを参照

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

张延森 5 年 前
コミット
5c7d0522e1
共有5 個のファイルを変更した91 個の追加66 個の削除を含む
  1. バイナリ
      src/assets/poster1.png
  2. バイナリ
      src/assets/poster2.png
  3. バイナリ
      src/assets/touxiang.jpg
  4. 4
    4
      src/components/XForm/ImageUpload.jsx
  5. 87
    62
      src/pages/activity/editActivity.jsx

バイナリ
src/assets/poster1.png ファイルの表示


バイナリ
src/assets/poster2.png ファイルの表示


バイナリ
src/assets/touxiang.jpg ファイルの表示


+ 4
- 4
src/components/XForm/ImageUpload.jsx ファイルの表示

@@ -34,10 +34,10 @@ class ImageUpload extends React.Component {
34 34
     }
35 35
   };
36 36
 
37
-  render () {
37
+  render() {
38 38
     const uploadButton = (
39 39
       <div>
40
-        <Icon style={{ fontSize: '2em', color: '#aaa' }} type={this.state.loading ? "loading" : "plus"} />        
40
+        <Icon style={{ fontSize: '2em', color: '#aaa' }} type={this.state.loading ? "loading" : "plus"} />
41 41
       </div>
42 42
     );
43 43
 
@@ -56,8 +56,8 @@ class ImageUpload extends React.Component {
56 56
         {(this.state.imageUrl || value) ? (
57 57
           <img src={this.state.imageUrl || value} alt="avatar" style={{ width: "100%" }} />
58 58
         ) : (
59
-          uploadButton
60
-        )}
59
+            uploadButton
60
+          )}
61 61
       </Upload>
62 62
     );
63 63
   }

+ 87
- 62
src/pages/activity/editActivity.jsx ファイルの表示

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message } from 'antd';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import moment from 'moment';
@@ -12,8 +12,12 @@ import PosterBottom from '../../assets/bottom.png'
12 12
 import yinhao from '../../assets/yinhao.png'
13 13
 import ImageUploader from '../../components/XForm/ImageUpload';
14 14
 import logo from '../../assets/logo.png';
15
+import touxiang from '../../assets/touxiang.jpg';
16
+import poster1 from '../../assets/poster1.png';
17
+import poster2 from '../../assets/poster2.png';
15 18
 
16 19
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
20
+const { TextArea } = Input;
17 21
 
18 22
 /**
19 23
  *
@@ -22,7 +26,8 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22 26
  * @returns
23 27
  */
24 28
 const Edit = (props) => {
25
-  const [tab, changeTab] = useState('basic')
29
+  const [tab, changeTab] = useState('poster')
30
+  // const [tab, changeTab] = useState('basic')
26 31
   const dynamicId = props.location.query.dynamicId
27 32
   const [dynamicData, setDynamicData] = useState({})
28 33
   if (dynamicId) {
@@ -165,77 +170,97 @@ const Edit = (props) => {
165 170
   }
166 171
 
167 172
   const Poster = (props) => {
173
+    const [inputValue, changeInput] = useState('')
174
+    const [textAreaValue, changeTextArea] = useState('')
175
+    const [imgValue, changeImg] = useState('')
176
+    return <div>
177
+      <div style={{ display: 'flex' }}>
178
+        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
179
+          <div style={{ width: '375px', height: '785px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
180
+            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
181
+            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
182
+              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
183
+              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
184
+              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您阅读</span>
185
+              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
186
+            </div>
187
+            <p style={{
188
+              margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
189
+              display: '-webkit-box', lineClamp: '3', height: '60px',
190
+              WebkitLineClamp: '2',
191
+              WebkitBoxOrient: 'vertical',
192
+              overflow: 'hidden',
193
+              textOverflow: 'ellipsis'
194
+            }}>{inputValue ? inputValue : '海报标题'}</p>
168 195
 
169
-    return <div style={{ display: 'flex' }}>
170
-      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
171
-        <div style={{ width: '375px', height: '785px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
172
-
173
-          <img style={{ width: '100%', height: '300px' }} src="http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg" alt="" />
196
+            <img src={yinhao} style={{ width: '30px', marginLeft: '10px' }} alt="" />
197
+            <p style={{
198
+              margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
199
+              display: '-webkit-box', lineClamp: '3', height: '76px',
200
+              WebkitLineClamp: '3',
201
+              WebkitBoxOrient: 'vertical',
202
+              overflow: 'hidden',
203
+              textOverflow: 'ellipsis'
204
+            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
205
+            <img src={PosterBottom} style={{ width: '100%' }} alt="" />
206
+          </div>
207
+          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
208
+        </div>
174 209
 
175
-          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
176
-            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src="http://img0.imgtn.bdimg.com/it/u=3463541938,2540701974&fm=26&gp=0.jpg" alt="" />
177
-            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
178
-            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您阅读</span>
179
-            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
210
+        <div >
211
+          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
212
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图片</p>
213
+            <ImageUploader onChange={e => changeImg(e)} />
214
+          </div>
215
+          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
216
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
217
+            <Input style={{ width: '20vw' }} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
218
+          </div>
219
+          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
220
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
221
+            <TextArea rows={5} onChange={e => changeTextArea(e.target.value)} />
180 222
           </div>
181
-          <p style={{
182
-            margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
183
-            display: '-webkit-box', lineClamp: '3', height: '60px',
184
-            WebkitLineClamp: '2',
185
-            WebkitBoxOrient: 'vertical',
186
-            overflow: 'hidden',
187
-            textOverflow: 'ellipsis'
188
-          }}>破晓·内容生态下半场的版权到企业高峰论坛会议破晓·内容生态下半场的版权到企业高峰论坛活动</p>
189 223
 
190
-          <img src={yinhao} style={{ width: '30px', marginLeft: '10px' }} alt="" />
191
-          <p style={{
192
-            margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
193
-            display: '-webkit-box', lineClamp: '3', height: '76px',
194
-            WebkitLineClamp: '3',
195
-            WebkitBoxOrient: 'vertical',
196
-            overflow: 'hidden',
197
-            textOverflow: 'ellipsis'
198
-          }}>活动描述:破晓·内容生态下半场的版权到企业高峰论坛活动破晓·内容生态下半场的版权到企业高峰论坛活动破晓·内容生态下半场的版权到企业高峰论坛活动</p>
199
-          <img src={PosterBottom} style={{ width: '100%' }} alt="" />
200 224
         </div>
201
-        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
202 225
       </div>
203
-      <div></div>
226
+      <Button type="primary" onClick={() => router.go(-1)} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
227
+      <Button onClick={() => router.go(-1)}>取消</Button>
204 228
     </div>
229
+
205 230
   }
206 231
 
232
+
233
+
207 234
   const Share = (props) => {
208
-    const fields = [
209
-      {
210
-        label: '分享模板',
211
-        name: 'buildingId',
212
-        render: () => <div style={{ margin: ' 10px 20px' }}>
213
-          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
214
-          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>置业V客厅 精准获客平台</p>
215
-          <img style={{ width: '200px', height: '140px' }} src="http://house.china.com.cn/nanjing/UserFiles/20171124/11070256.jpg" alt="" />
216
-        </div>,
217
-      },
218
-      {
219
-        label: '海报标题',
220
-        name: 'newsTypeName',
221
-        type: FieldTypes.Text,
222
-        value: '',
223
-        rules: [
224
-          { required: true, message: '请输入咨询名称' },
225
-        ]
226
-      },
227
-      {
228
-        label: '类型图',
229
-        name: 'newsTypeImg',
230
-        type: FieldTypes.ImageUploader,
231
-        value: 'newsTypeImg',
232
-      },
233
-    ]
234
-    const handleSubmit = (values) => {
235
+    const [inputValue, changeInput] = useState('')
236
+    const [imgValue, changeImg] = useState('')
237
+    // const changeInputValue = e => {
238
+    //   changeInput(e.target.value)
239
+    // }
235 240
 
236
-    }
237
-    return <div>
238
-      <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
241
+    // const handleSubmit = (values) => {
242
+
243
+    // }
244
+
245
+    return <div style={{ padding: '20px' }}>
246
+      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
247
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
248
+        <div>
249
+          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
250
+          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
251
+          <img style={{ width: '200px', height: '140px' }} src={imgValue ? imgValue : poster2} alt="" />
252
+        </div>
253
+      </div>
254
+      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
255
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
256
+        <Input placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
257
+      </div>
258
+      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
259
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
260
+        <ImageUploader onChange={e => changeImg(e)} />
261
+      </div>
262
+      <Button type="primary" htmlType="submit" style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
263
+      <Button onClick={() => router.go(-1)}>取消</Button>
239 264
     </div>
240 265
   }
241 266