zlisen 3 år sedan
förälder
incheckning
da97be511c

+ 18
- 0
config/routes.js Visa fil

@@ -201,6 +201,24 @@ export default [
201 201
                 hideInMenu: true,
202 202
                 component: './Live/LiveActivity/add',
203 203
               },
204
+
205
+              {
206
+                path: '/Live/video/List',
207
+                name: '视频',
208
+                component: './Live/video/List',
209
+              },
210
+              {
211
+                path: '/Live/video/Edit',
212
+                name: '编辑视频',
213
+                hideInMenu: true,
214
+                component: './Live/video/Edit',
215
+              },
216
+              // {
217
+              //   path: '/Live/video/add',
218
+              //   name: '新增活动',
219
+              //   hideInMenu: true,
220
+              //   component: './Live/video/add',
221
+              // },
204 222
               
205 223
               // {
206 224
               //   path: '/staff/Staff/Edit',

+ 3
- 3
src/components/Share/index.jsx Visa fil

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react'
2
-import { Button, Form, Input } from 'antd'
2
+import { Button, Form, Input, message } from 'antd'
3 3
 import ImageUpload from '@/components/XForm/ImageUpload'
4 4
 import { fetch, apis } from '@/utils/request'
5 5
 
@@ -33,8 +33,8 @@ const ShareForm = (props) => {
33 33
         return
34 34
       }
35 35
 
36
-      const request = formData.shareContentId ? updateData : saveData
37
-      const urlData = formData.shareContentId ? { id: formData.shareContentId } : undefined
36
+      const request = formData?.shareContentId ? updateData : saveData
37
+      const urlData = formData?.shareContentId ? { id: formData.shareContentId } : undefined
38 38
       const data = {
39 39
         targetId,
40 40
         shareContentType: targetType,

+ 181
- 0
src/pages/Live/video/Edit/index.jsx Visa fil

@@ -0,0 +1,181 @@
1
+import React, { useState, useEffect } from 'react';
2
+import {
3
+  Form,
4
+  Input,
5
+  Button,
6
+  Icon,
7
+  Select,
8
+  Card,
9
+  Radio,
10
+  DatePicker,
11
+  message,
12
+  Upload,
13
+  InputNumber,
14
+} from 'antd';
15
+import { FormattedMessage } from 'umi-plugin-react/locale';
16
+import moment from 'moment';
17
+import router from 'umi/router';
18
+import FileUpload from '@/components/XForm/FileUpload';
19
+import XForm, { FieldTypes, createForm } from '@/components/XForm';
20
+import apis from '@/services/apis';
21
+import BuildSelect2 from '@/components/SelectButton/BuildSelect2';
22
+import LivePlatSelect from '@/components/SelectButton/LivePlatSelect';
23
+import CitySelect3 from '@/components/SelectButton/CitySelect3';
24
+import ImageUpload from '@/components/XForm/ImageUpload';
25
+import request from '@/utils/request';
26
+import Navigate from '@/components/Navigate';
27
+
28
+const { Option } = Select;
29
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
30
+
31
+let cityId = '';
32
+
33
+const header = props => {
34
+  console.log(props);
35
+
36
+  const { id } = props.location.query;
37
+
38
+  const [data, setData] = useState({});
39
+
40
+  // 查询详情
41
+  const getData = () => {
42
+    request({ ...apis.video.getDetail, urlData: { id } }).then(data => {
43
+      data.videoUrl = [data.videoUrl];
44
+      setData(data);
45
+    });
46
+  };
47
+
48
+  useEffect(() => {
49
+    if (id) {
50
+      getData(id);
51
+    }
52
+  }, []);
53
+
54
+  const cancelPage = () => {
55
+    router.go('-1');
56
+  };
57
+
58
+
59
+  function handleSubmit(e) {
60
+    e.preventDefault();
61
+    props.form.validateFields((err, values) => {
62
+      console.log(values, 'values');
63
+      if (!err) {
64
+        values.videoUrl = values?.videoUrl[0];
65
+        if (id) {
66
+          request({
67
+            ...apis.video.updata,
68
+            urlData: { id: id },
69
+            data: values,
70
+          })
71
+            .then(data => {
72
+              message.info('保存成功');
73
+              cancelPage();
74
+            })
75
+            .catch(err => {
76
+              message.info(err.msg || err.message);
77
+            });
78
+        } else {
79
+          request({
80
+            ...apis.video.save,
81
+            data: values,
82
+          })
83
+            .then(data => {
84
+              message.info('保存成功');
85
+              cancelPage();
86
+            })
87
+            .catch(err => {
88
+              message.info(err.msg || err.message);
89
+            });
90
+        }
91
+      }
92
+    });
93
+  }
94
+
95
+  // 视频文件上传前 回调
96
+  const fileUploadBeforeUpload = (file, fileList) => {
97
+    return new Promise((resolve, reject) => {
98
+      if (file.type === 'video/mp4' || file.type === '.mp4') {
99
+        // setVideoImage(true)
100
+        resolve(file);
101
+      } else {
102
+        notification.error({ message: '项目视频,仅支持MP4格式' });
103
+        reject();
104
+      }
105
+    });
106
+  };
107
+
108
+  const { getFieldDecorator } = props.form;
109
+
110
+  return (
111
+    <Card>
112
+      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
113
+        <Form.Item label="所属城市">
114
+          {getFieldDecorator('cityId', {
115
+            initialValue: data.cityId,
116
+            rules: [{ required: true, message: ' 请输入所属城市' }],
117
+          })(<CitySelect3 buildingId={props.form.getFieldValue('buildingId')} />)}
118
+        </Form.Item>
119
+
120
+        <Form.Item label="所属楼盘">
121
+          {getFieldDecorator('buildingId', {
122
+            initialValue: data.buildingId,
123
+          })(<BuildSelect2 cityId={props.form.getFieldValue('cityId')} />)}
124
+        </Form.Item>
125
+
126
+        <Form.Item label="主图" help="建议尺寸:750px*600px,比例5:4,格式:jpg,用于:列表和详情">
127
+          {getFieldDecorator('videImg', {
128
+            initialValue: data.videImg,
129
+            rules: [{ required: true, message: '请上传主图' }],
130
+          })(<ImageUpload />)}
131
+        </Form.Item>
132
+
133
+        <Form.Item label="视频标题">
134
+          {getFieldDecorator('name', {
135
+            initialValue: data.name,
136
+            rules: [{ required: true, message: '请输入视频标题' }],
137
+          })(<Input maxLength={20} placeholder="请输入视频标题" />)}
138
+        </Form.Item>
139
+
140
+        <Form.Item label="简介">
141
+          {getFieldDecorator('remark', {
142
+            initialValue: data.remark,
143
+            rules: [{ required: true, message: '请输入简介' }],
144
+          })(<Input.TextArea row={4} />)}
145
+        </Form.Item>
146
+
147
+        <Form.Item label="视频">
148
+          {getFieldDecorator('videoUrl', {
149
+            initialValue: data.videoUrl || null,
150
+            rules: [{ required: true, message: '请上传视频' }],
151
+          })(
152
+            <FileUpload
153
+              accept=".mp4"
154
+              beforeUpload={fileUploadBeforeUpload}
155
+              //   label="上传视频"
156
+              size={1}
157
+            />,
158
+          )}
159
+        </Form.Item>
160
+
161
+        <Form.Item label="权重">
162
+          {getFieldDecorator('weight', {
163
+            initialValue: data.weight,
164
+            rules: [{ required: true, message: '请设置权重' }],
165
+          })(<InputNumber placeholder="权重越大越靠前" style={{ width: '150px' }} />)}
166
+        </Form.Item>
167
+
168
+        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
169
+          <Button type="primary" htmlType="submit" style={{ marginRight: '20px' }}>
170
+            确定
171
+          </Button>
172
+          <Button onClick={() => router.go(-1)}>取消</Button>
173
+        </Form.Item>
174
+      </Form>
175
+    </Card>
176
+  );
177
+};
178
+
179
+const VideoEdit = Form.create({ name: 'header' })(header);
180
+
181
+export default VideoEdit;

+ 179
- 0
src/pages/Live/video/List/index.jsx Visa fil

@@ -0,0 +1,179 @@
1
+import React, { useState, useEffect, useRef } from 'react';
2
+import {
3
+  Form,
4
+  Input,
5
+  Button,
6
+  Icon,
7
+  Typography,
8
+  message,
9
+  Table,
10
+  Pagination,
11
+  Modal,
12
+  DatePicker,
13
+  Card,
14
+} from 'antd';
15
+import router from 'umi/router';
16
+import moment from 'moment';
17
+import AuthButton from '@/components/AuthButton';
18
+import withActions from '@/components/ActionList';
19
+import EditIcon from '@/components/EditIcon';
20
+import Navigate from '@/components/Navigate';
21
+import apis from '@/services/apis';
22
+import request from '@/utils/request';
23
+import QueryTable from '@/components/QueryTable';
24
+import { getImgURL } from '@/utils/image';
25
+import OperButton from '@/components/OperButton';
26
+
27
+const Video = props => {
28
+  const ref = useRef();
29
+
30
+  // 跳转到编辑
31
+  const toVideoEdit = row => {
32
+    router.push({
33
+      pathname: '/Live/video/Edit',
34
+      query: {
35
+        id: row?.videoId,
36
+      },
37
+    });
38
+  };
39
+
40
+
41
+  const onPublish = row => {
42
+    const buidingStatus = row.status === 1 ? 2 : 1;
43
+    request({ ...apis.video.publish, urlData: { id: row.videoId } })
44
+      .then(() => {
45
+        message.success( '操作成功');
46
+        // setLoading(false);
47
+        ref.current.reload();
48
+      })
49
+      .catch(err => {
50
+        console.error(err);
51
+        message.error( '操作失败');
52
+      });
53
+  };
54
+
55
+  const onDelete = row => {
56
+
57
+    request({ ...apis.video.delete, urlData: { id: row.videoId } })
58
+      .then(() => {
59
+        message.success( '删除成功');
60
+        // setLoading(false);
61
+        ref.current.reload();
62
+      })
63
+      .catch(err => {
64
+        console.error(err);
65
+        message.error( '操作失败');
66
+      });
67
+  };
68
+
69
+  const searchFields = [
70
+    {
71
+      name: 'title',
72
+      label: '视频标题',
73
+      placeholder: '请输入标题',
74
+    },
75
+  ];
76
+
77
+  const columns = [
78
+    {
79
+      title: '视频标题',
80
+      dataIndex: 'name',
81
+      key: 'name',
82
+      align: 'center',
83
+      width: '20%',
84
+      render: (x, row) => (
85
+        <Navigate onClick={() => toVideoEdit(row)}>
86
+          <Typography.Text ellipsis>{x}</Typography.Text>
87
+        </Navigate>
88
+      ),
89
+    },
90
+    {
91
+      title: '视频主图',
92
+      dataIndex: 'videImg',
93
+      key: 'videImg',
94
+      align: 'center',
95
+      render: (x, row) => (
96
+        <img src={getImgURL(x)} width={128} height={72} style={{ borderRadius: '4px' }} alt="" />
97
+      ),
98
+    },
99
+
100
+    {
101
+      title: '阅读人数',
102
+      dataIndex: 'lookNum',
103
+      key: 'lookNum',
104
+      align: 'center',
105
+    },
106
+    {
107
+      title: '归属楼盘',
108
+      dataIndex: 'buildingName',
109
+      key: 'buildingName',
110
+      align: 'center',
111
+    },
112
+
113
+    {
114
+      title: '权重',
115
+      dataIndex: 'weight',
116
+      key: 'weight',
117
+      align: 'center',
118
+    },
119
+    {
120
+      title: '操作',
121
+      dataIndex: 'handle',
122
+      key: 'handle',
123
+      align: 'center',
124
+      render: withActions((x, row) => [
125
+        <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
126
+          <OperButton onClick={() => toVideoEdit(row)}>编辑</OperButton>
127
+          {/* <EditIcon
128
+        type="edit"
129
+        text="编辑"
130
+        onClick={() => toSignupActivityEdit(row.dynamicId, row.count)}
131
+      /> */}
132
+        </AuthButton>,
133
+
134
+        <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
135
+          <OperButton onClick={() => onPublish(row)}>
136
+            {row.isPublish ? '取消发布' : '发布'}
137
+          </OperButton>
138
+          {/* <EditIcon
139
+            type={row.isPublish ? 'cancel' : 'publish'}
140
+            text={row.isPublish ? '取消发布' : '发布'}
141
+            onClick={() => sendOrPublicDynamic(row)}
142
+          /> */}
143
+        </AuthButton>,
144
+
145
+        <AuthButton name="admin.building.delete" noRight={null}>
146
+          <OperButton.Confirm
147
+            title="确认删除?"
148
+            content="删除之后不可恢复"
149
+            onClick={() => onDelete(row)}
150
+          >
151
+            删除
152
+          </OperButton.Confirm>
153
+        </AuthButton>,
154
+      ]),
155
+    },
156
+  ];
157
+
158
+  const actionRender = () => {
159
+    return (
160
+      <Button type="primary" icon="plus" onClick={() => toVideoEdit()}>
161
+        新增
162
+      </Button>
163
+    );
164
+  };
165
+
166
+  return (
167
+    <QueryTable
168
+      ref={ref}
169
+      rowKey="videoId"
170
+      api={apis.video.list}
171
+      searchFields={searchFields}
172
+      columns={columns}
173
+      actionRender={actionRender}
174
+      // onPageChange={(pg) => setPage(pg)}
175
+    />
176
+  );
177
+};
178
+
179
+export default Video;

+ 4
- 23
src/pages/activity/SignupActivity/edit/Basic.jsx Visa fil

@@ -90,7 +90,7 @@ const BasicForm = props => {
90 90
           values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
91 91
         }
92 92
 
93
-        console.log('submit data --->', values);
93
+        values.type = type
94 94
         if (dynamicId) {
95 95
           const checks = checkTime();
96 96
           if (checks != true) {
@@ -103,12 +103,12 @@ const BasicForm = props => {
103 103
             message.info('活动人数必须大于已报名人数');
104 104
             return;
105 105
           }
106
-          values.type = type
106
+          
107 107
           values.dynamicId = dynamicId;
108 108
           request({ ...apis.activity.update, data: values })
109 109
             .then(data => {
110 110
               message.info('保存成功');
111
-              // router.go(-1)
111
+              router.go(-1)
112 112
             })
113 113
             .catch(err => {
114 114
               message.info(err.msg || err.message);
@@ -117,13 +117,7 @@ const BasicForm = props => {
117 117
           request({ ...apis.activity.add, data: { ...values } })
118 118
             .then(data => {
119 119
               message.info('保存成功');
120
-              router.push({
121
-                pathname: '/activity/editActivity',
122
-                query: {
123
-                  dynamicId: data.dynamicId,
124
-                },
125
-              });
126
-              // router.go(-1)
120
+              router.go(-1)
127 121
             })
128 122
             .catch(err => {
129 123
               message.info(err.msg || err.message);
@@ -133,20 +127,7 @@ const BasicForm = props => {
133 127
     });
134 128
   };
135 129
   const changeTime = (value, date) => {
136
-    // console.log(value, data, '-----checkTime---------')
137
-    // console.log(props.form.getFieldsValue(), '--------time1-----------')
138
-    // let datas = data
139
-    // console.log(value, date, datas)
140
-    // datas.signupTime = date
141
-
142
-    // //   data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
143
-
144
-    // console.log(datas,'-------datas--------')
145
-    //   props.form.setFieldsValue(data)
146 130
     setShowSignupTime(date);
147
-    // props.form.setFieldsValue(datas)
148
-    // // form.setFieldsValue
149
-    // console.log('-------1--------')
150 131
   };
151 132
 
152 133
   const { getFieldDecorator } = props.form;

+ 0
- 524
src/pages/activity/SignupActivity/edit/ind.jsx Visa fil

@@ -1,524 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
-
4
-import router from 'umi/router';
5
-import apis from '@/services/apis';
6
-import moment from 'moment';
7
-import BuildSelect from '@/components/SelectButton/BuildSelect2'
8
-import Wangedit from '@/components/Wangedit/Wangedit'
9
-import request from '@/utils/request'
10
-import yinhao from '@/assets/yinhao.png'
11
-import ImageUploader from '@/components/XForm/ImageUpload';
12
-import logo from '@/assets/logo.svg';
13
-import touxiang from '@/assets/touxiang.jpg';
14
-import poster1 from '@/assets/poster1.png';
15
-import poster2 from '@/assets/poster2.png';
16
-import xiaochengxu from '@/assets/xiaochengxu.png'
17
-
18
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
19
-const { TextArea } = Input;
20
-
21
-const formItemLayout = {
22
-  labelCol: { span: 6 },
23
-  wrapperCol: { span: 14 },
24
-};
25
-
26
-const cancelPage = () => {
27
-  router.push({
28
-    pathname: '/activity/ActivityList',
29
-  });
30
-}
31
-
32
-const BasicForm = props => {
33
-  const [isEnlist, setIsEnlist] = useState(1)
34
-  const [activityStatus, setActivityStatus] = useState(1)
35
-  const [disable, setDisable] = useState(false)
36
-  const [data, setData] = useState(1)
37
-  const [showSignupTime, setShowSignupTime] = useState([])
38
-
39
-
40
-  const radioOnChange = e => {
41
-    setIsEnlist(e.target.value)
42
-  }
43
-
44
-  const { dynamicId } = props
45
-
46
-  // 查询详情
47
-  const getDynamicData = dynamicId => {
48
-    request({ ...apis.activity.details, params: { dynamicId } }).then(data => {
49
- 
50
-      data.activityTime = [moment(data.startDate), moment(data.endDate)]
51
-      data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
52
-      // setSignupTime([moment(data.enlistStart), moment(data.enlistEnd)])
53
-      setData(data)
54
-      setIsEnlist(data.isEnlist)
55
-      setActivityStatus(data.activityStatus)
56
-      setDisable(data.activityStatus === 0)
57
-      props.form.setFieldsValue(data)
58
-    })
59
-  }
60
-
61
-  // eslint-disable-next-line react-hooks/rules-of-hooks
62
-  useEffect(() => {
63
-    props.form.setFieldsValue({ isEnlist })
64
-    if (dynamicId) {
65
-      getDynamicData(dynamicId);
66
-    }
67
-  }, [])
68
-  const checkTime = () => {
69
-    function compareDate(dateTime1, dateTime2) {
70
-      return new Date(dateTime1) > new Date(dateTime2)
71
-    }
72
-    // 1)修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)
73
-
74
-    // (2)修改后开始时间<当前时间<修改后结束时间:活动进行中
75
-
76
-    // (3)修改后结束时间<当前时间:活动已结束
77
-    if (showSignupTime[0]) {
78
-      // const date = data.signupTime
79
-      const nowDate = new Date()
80
-      // console.log(compareDate(nowDate, showSignupTime[0]))
81
-      if (compareDate(nowDate, showSignupTime[0])) {
82
-        return true
83
-      } else {
84
-        return '修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)'
85
-      }
86
-    }
87
-    return true
88
-  }
89
-
90
-
91
-  const handleSubmit = e => {
92
-    e.preventDefault();
93
-    props.form.validateFields((err, values) => {
94
-
95
-      if (!err) {
96
-        console.log('Received values of form: ', values);
97
-        const { activityTime, signupTime } = values
98
-        const [startDate, endDate] = activityTime
99
-        values.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
100
-        values.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
101
-        if (signupTime) {
102
-          const [enlistStart, enlistEnd] = signupTime
103
-          values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
104
-          values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
105
-        }
106
-
107
-        console.log('submit data --->', values)
108
-        if (dynamicId) {
109
-          const checks = checkTime()
110
-          if (checks != true) {
111
-            message.info(checks)
112
-            return
113
-          }
114
-          console.log(data.enlistNum,values.personNum,'143')
115
-
116
-          if (data.enlistNum > values.personNum) {
117
-            message.info('活动人数必须大于已报名人数')
118
-            return
119
-          }
120
-
121
-          values.dynamicId = dynamicId
122
-          request({ ...apis.activity.update, data: values }).then(data => {
123
-            message.info('保存成功')
124
-            // router.go(-1)
125
-          }).catch((err) => {
126
-            message.info(err.msg || err.message)
127
-          })
128
-        } else {
129
-          request({ ...apis.activity.add, data: { ...values } }).then((data) => {
130
-            message.info('保存成功')
131
-            router.push({
132
-              pathname: '/activity/editActivity',
133
-              query: {
134
-                dynamicId: data.dynamicId,
135
-              },
136
-            });
137
-            // router.go(-1)
138
-          }).catch((err) => {
139
-            message.info(err.msg || err.message)
140
-          })
141
-        }
142
-      }
143
-    });
144
-  }
145
-  const changeTime = (value, date) => {
146
-    // console.log(value, data, '-----checkTime---------')
147
-    // console.log(props.form.getFieldsValue(), '--------time1-----------')
148
-    // let datas = data
149
-    // console.log(value, date, datas)
150
-    // datas.signupTime = date
151
-
152
-    // //   data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
153
-
154
-    // console.log(datas,'-------datas--------')
155
-    //   props.form.setFieldsValue(data)
156
-    setShowSignupTime(date)
157
-    // props.form.setFieldsValue(datas)
158
-    // // form.setFieldsValue
159
-    // console.log('-------1--------')
160
-  }
161
-
162
-  const { getFieldDecorator } = props.form;
163
-  return (
164
-    <>
165
-      <Form {...formItemLayout} onSubmit={handleSubmit}>
166
-        <Form.Item label="所属项目">
167
-          {getFieldDecorator('buildingId', {
168
-            rules: [
169
-              {
170
-                required: true,
171
-                message: '请选择所属项目',
172
-              },
173
-            ],
174
-          })(<BuildSelect disabled={disable} />)}
175
-        </Form.Item>
176
-        <Form.Item label="活动封面图1" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于:首页推荐/活动列表">
177
-          {getFieldDecorator('listImgUrl', {
178
-            rules: [
179
-              {
180
-                required: true,
181
-                message: '请选择活动封面图1',
182
-              },
183
-            ],
184
-          })(<ImageUploader />)}
185
-        </Form.Item>
186
-        <Form.Item label="活动封面图2" help="建议图片尺寸:750*250,比例3:1,格式:jpg,用于:项目详情页">
187
-          {getFieldDecorator('bannerListImg', {
188
-            rules: [
189
-              {
190
-                required: true,
191
-                message: '请选择活动封面图2',
192
-              },
193
-            ],
194
-          })(<ImageUploader />)}
195
-        </Form.Item>
196
-        <Form.Item label="活动详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:普通活动详情">
197
-          {getFieldDecorator('imgUrl', {
198
-            rules: [
199
-              {
200
-                required: true,
201
-                message: '请选择活动详情主图',
202
-              },
203
-            ],
204
-          })(<ImageUploader />)}
205
-        </Form.Item>
206
-        <Form.Item label="活动标题">
207
-          {getFieldDecorator('title', {
208
-            rules: [
209
-              {
210
-                required: true,
211
-                message: '请输入活动标题',
212
-              },
213
-            ],
214
-          })(<Input />)}
215
-        </Form.Item>
216
-        <Form.Item label="活动时间">
217
-          {getFieldDecorator('activityTime', {
218
-            rules: [
219
-              {
220
-                required: true,
221
-                message: '请选择活动时间',
222
-              },
223
-            ],
224
-          })(<RangePicker format="YYYY-MM-DD HH:mm" />)}
225
-        </Form.Item>
226
-        <Form.Item label="活动地点">
227
-          {getFieldDecorator('address', {
228
-            rules: [
229
-              {
230
-                required: true,
231
-                message: '请输入活动地点',
232
-              },
233
-            ],
234
-          })(<Input />)}
235
-        </Form.Item>
236
-        {/* disabled={activityStatus === 0 ? true : false} */}
237
-        <Form.Item label="活动人数" help="当前活动最多可报名人数">
238
-          {getFieldDecorator('personNum', {
239
-            rules: [
240
-              {
241
-                required: true,
242
-                message: '请输入活动人数',
243
-              },
244
-              // {
245
-              //   min: data.personNum,min={data.personNum || 0}
246
-              //   message: '活动人数必须大于已报名人数',
247
-              // },
248
-            ],
249
-          })(<Input type="number" />)}
250
-        </Form.Item>
251
-        <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
252
-          {getFieldDecorator('maxEnlistByPerson', {
253
-            rules: [
254
-              {
255
-                required: true,
256
-                message: '请输入用户携带人数',
257
-              },
258
-            ],
259
-          })(<Input type="number" min={1} />)}
260
-        </Form.Item>
261
-        <Form.Item label="活动详情">
262
-          {getFieldDecorator('desc')(<Wangedit />)}
263
-        </Form.Item>
264
-        <Form.Item label="报名时间">
265
-          {getFieldDecorator('signupTime', {
266
-            rules: [
267
-              {
268
-                required: true,
269
-                message: '请选择报名时间',
270
-              },
271
-            ],
272
-          })(<RangePicker format="YYYY-MM-DD HH:mm" onChange={changeTime} />)}
273
-        </Form.Item>
274
-        <Form.Item label="权重">
275
-          {getFieldDecorator('heavy', {
276
-
277
-            rules: [
278
-              {
279
-                required: true,
280
-                message: '请输入权重',
281
-              },
282
-            ],
283
-          })(<Input type="number" style={{ width: 80 }} />)}<span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
284
-        </Form.Item>
285
-        <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
286
-          <Button type="primary" htmlType="submit">
287
-            确认
288
-          </Button>
289
-          &nbsp;&nbsp;&nbsp;&nbsp;
290
-          <Button onClick={() => cancelPage()}>
291
-            取消
292
-          </Button>
293
-        </Form.Item>
294
-      </Form>
295
-    </>
296
-  )
297
-}
298
-
299
-const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
300
-
301
-const Poster = props => {
302
-  const { dynamicId } = props
303
-  const [inputValue, changeInput] = useState('')
304
-  const [textAreaValue, changeTextArea] = useState('')
305
-  const [imgValue, changeImg] = useState('')
306
-  const [posterId, setPosterId] = useState('')
307
-
308
-  useEffect(() => {
309
-    if (dynamicId) {
310
-      request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then(data => {
311
-
312
-        if (data.length > 0) {
313
-          setPosterId(data[0].posterId)
314
-          changeImg(data[0].posterImg)
315
-          changeTextArea(data[0].posterDescription)
316
-          changeInput(data[0].posterTitle)
317
-        }
318
-      }).catch(err => {
319
-        message.info(err.msg || err.message)
320
-      })
321
-    }
322
-    // getMiniappName()
323
-  }, [])
324
-  
325
-  // 获取小程序名称
326
-  // const [miniappName, setMiniappName] = useState('')
327
-  // function getMiniappName() {
328
-  //   request({ ...apis.building.getMiniappName }).then(res => {
329
-  //     console.log(res, "0000000000000")
330
-  //     setMiniappName(res)
331
-  //   })
332
-  // }
333
-
334
-  const submitPoster = () => {
335
-    if (dynamicId) {
336
-      if (posterId) {
337
-        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue } }).then(data => {
338
-          message.info('保存成功')
339
-        }).catch(err => {
340
-          message.info(err.msg || err.message)
341
-        })
342
-      } else {
343
-        request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue } }).then(data => {
344
-          setPosterId(data.posterId)
345
-          message.info('保存成功')
346
-        }).catch(err => {
347
-          message.info(err.msg || err.message)
348
-        })
349
-      }
350
-    } else {
351
-      message.warn('请先保存基本信息数据')
352
-    }
353
-  }
354
-
355
-  return <div>
356
-    <div style={{ display: 'flex' }}>
357
-      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
358
-        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
359
-          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
360
-          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
361
-            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
362
-            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
363
-            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
364
-            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
365
-          </div>
366
-          <p style={{
367
-            margin: '10px 20px',
368
-            fontSize: '20px',
369
-            color: '#222',
370
-            fontWeight: '600',
371
-            display: '-webkit-box',
372
-            lineClamp: '3',
373
-            height: '60px',
374
-            WebkitLineClamp: '2',
375
-            WebkitBoxOrient: 'vertical',
376
-            overflow: 'hidden',
377
-            textOverflow: 'ellipsis',
378
-          }}>{inputValue || '海报标题'}</p>
379
-
380
-          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
381
-          <p style={{
382
-            margin: '16px 20px 28px 20px',
383
-            fontSize: '17px',
384
-            color: '#999',
385
-            display: '-webkit-box',
386
-            lineClamp: '3',
387
-            height: '72px',
388
-            WebkitLineClamp: '3',
389
-            WebkitBoxOrient: 'vertical',
390
-            overflow: 'hidden',
391
-            textOverflow: 'ellipsis',
392
-          }}>{textAreaValue || '海报描述'}</p>
393
-          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
394
-            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
395
-            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
396
-            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
397
-          </div>
398
-        </div>
399
-        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
400
-      </div>
401
-
402
-      <div >
403
-        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
404
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
405
-          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
406
-        </div>
407
-        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
408
-        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
409
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
410
-          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
411
-        </div>
412
-        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
413
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
414
-          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
415
-        </div>
416
-
417
-      </div>
418
-    </div>
419
-    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
420
-    <Button onClick={() => cancelPage()}>
421
-      取消
422
-    </Button>
423
-  </div>
424
-}
425
-
426
-const Share = props => {
427
-  const { dynamicId } = props
428
-  const [inputValue, changeInput] = useState('')
429
-  const [imgValue, changeImg] = useState('')
430
-  const [shareContentId, setShareContentId] = useState('')
431
-
432
-  useEffect(() => {
433
-    if (dynamicId) {
434
-      request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' } }).then(data => {
435
-
436
-        if (data.length > 0) {
437
-          setShareContentId(data[0].shareContentId)
438
-          changeImg(data[0].shareContentImg)
439
-          changeInput(data[0].shareContentTitle)
440
-        }
441
-      }).catch(err => {
442
-        message.info(err.msg || err.message)
443
-      })
444
-    }
445
-  }, [dynamicId])
446
-
447
-  const submitShare = () => {
448
-    if (dynamicId) {
449
-      if (shareContentId) {
450
-        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
451
-          message.info('保存成功')
452
-        }).catch(err => {
453
-          message.info(err.msg || err.message)
454
-        })
455
-      } else {
456
-        request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
457
-          setShareContentId(data.shareContentId)
458
-          message.info('保存成功')
459
-        }).catch(err => {
460
-          message.info(err.msg || err.message)
461
-        })
462
-      }
463
-    } else {
464
-      message.warn('请先保存基本信息数据')
465
-    }
466
-  }
467
-
468
-  return <div style={{ padding: '20px' }}>
469
-    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
470
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
471
-      <div>
472
-        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}>
473
-          <img src={logo} style={{ width: '22px', marginRight: '10px' }} alt=""/>橙蕉互动</p>
474
-        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue || '置业V客厅 精准获客平台'}</p>
475
-        <img style={{ width: '200px', height: '160px' }} src={imgValue || poster2} alt="" />
476
-      </div>
477
-    </div>
478
-    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
479
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
480
-      <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
481
-    </div>
482
-    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
483
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
484
-      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
485
-    </div>
486
-    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于活动分享好友</p>
487
-    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
488
-    <Button onClick={() => cancelPage()}>
489
-      取消
490
-    </Button>
491
-  </div>
492
-}
493
-
494
-
495
-/**
496
- *
497
- *
498
- * @param {*} props
499
- * @returns
500
- */
501
-const Edit = props => {
502
-  const [tab, changeTab] = useState('basic')
503
-  const { dynamicId } = props.location.query
504
-
505
-  return (
506
-    <div>
507
-      <div>
508
-        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
509
-          <Radio.Button value="basic">基本信息</Radio.Button>
510
-          <Radio.Button value="poster">海报图片</Radio.Button>
511
-          <Radio.Button value="share">分享设置</Radio.Button>
512
-        </Radio.Group>
513
-      </div>
514
-      <div>
515
-        {tab === 'basic' && <Basic dynamicId={dynamicId} />}
516
-        {tab === 'poster' && <Poster dynamicId={dynamicId}/>}
517
-        {tab === 'share' && <Share dynamicId={dynamicId}/>}
518
-      </div>
519
-    
520
-    </div>
521
-  );
522
-}
523
-
524
-export default Edit

+ 6
- 6
src/pages/activity/SignupActivity/edit/index.jsx Visa fil

@@ -1,9 +1,9 @@
1 1
 import React, { useState } from 'react';
2 2
 import { Radio, Card } from 'antd';
3 3
 import Basic from './Basic';
4
-import Poster from './Poster';
5
-import Share from './Share';
6
-
4
+// import Poster from './Poster';
5
+import Share from '@/components/Share';
6
+import Poster from '@/components/Poster'
7 7
 const type= 'dymic'
8 8
 /**
9 9
  *
@@ -14,7 +14,7 @@ const type= 'dymic'
14 14
 const Edit = props => {
15 15
   const [tab, changeTab] = useState('basic');
16 16
   const { dynamicId } = props.location.query;
17
-
17
+  const target = { id:dynamicId, type: 'activity' }
18 18
   return (
19 19
     <Card>
20 20
       <div>
@@ -26,8 +26,8 @@ const Edit = props => {
26 26
       </div>
27 27
       <div>
28 28
         {tab === 'basic' && <Basic dynamicId={dynamicId} type={type}/>}
29
-        {tab === 'poster' && <Poster dynamicId={dynamicId} />}
30
-        {tab === 'share' && <Share dynamicId={dynamicId} />}
29
+        {tab === 'poster' && <Poster target={target} />}
30
+        {tab === 'share' && <Share target={target} />}
31 31
       </div>
32 32
     </Card>
33 33
   );

+ 0
- 524
src/pages/activity/groupRoomActivity/edit/ind.jsx Visa fil

@@ -1,524 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
-
4
-import router from 'umi/router';
5
-import apis from '@/services/apis';
6
-import moment from 'moment';
7
-import BuildSelect from '@/components/SelectButton/BuildSelect2'
8
-import Wangedit from '@/components/Wangedit/Wangedit'
9
-import request from '@/utils/request'
10
-import yinhao from '@/assets/yinhao.png'
11
-import ImageUploader from '@/components/XForm/ImageUpload';
12
-import logo from '@/assets/logo.svg';
13
-import touxiang from '@/assets/touxiang.jpg';
14
-import poster1 from '@/assets/poster1.png';
15
-import poster2 from '@/assets/poster2.png';
16
-import xiaochengxu from '@/assets/xiaochengxu.png'
17
-
18
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
19
-const { TextArea } = Input;
20
-
21
-const formItemLayout = {
22
-  labelCol: { span: 6 },
23
-  wrapperCol: { span: 14 },
24
-};
25
-
26
-const cancelPage = () => {
27
-  router.push({
28
-    pathname: '/activity/ActivityList',
29
-  });
30
-}
31
-
32
-const BasicForm = props => {
33
-  const [isEnlist, setIsEnlist] = useState(1)
34
-  const [activityStatus, setActivityStatus] = useState(1)
35
-  const [disable, setDisable] = useState(false)
36
-  const [data, setData] = useState(1)
37
-  const [showSignupTime, setShowSignupTime] = useState([])
38
-
39
-
40
-  const radioOnChange = e => {
41
-    setIsEnlist(e.target.value)
42
-  }
43
-
44
-  const { dynamicId } = props
45
-
46
-  // 查询详情
47
-  const getDynamicData = dynamicId => {
48
-    request({ ...apis.activity.details, params: { dynamicId } }).then(data => {
49
- 
50
-      data.activityTime = [moment(data.startDate), moment(data.endDate)]
51
-      data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
52
-      // setSignupTime([moment(data.enlistStart), moment(data.enlistEnd)])
53
-      setData(data)
54
-      setIsEnlist(data.isEnlist)
55
-      setActivityStatus(data.activityStatus)
56
-      setDisable(data.activityStatus === 0)
57
-      props.form.setFieldsValue(data)
58
-    })
59
-  }
60
-
61
-  // eslint-disable-next-line react-hooks/rules-of-hooks
62
-  useEffect(() => {
63
-    props.form.setFieldsValue({ isEnlist })
64
-    if (dynamicId) {
65
-      getDynamicData(dynamicId);
66
-    }
67
-  }, [])
68
-  const checkTime = () => {
69
-    function compareDate(dateTime1, dateTime2) {
70
-      return new Date(dateTime1) > new Date(dateTime2)
71
-    }
72
-    // 1)修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)
73
-
74
-    // (2)修改后开始时间<当前时间<修改后结束时间:活动进行中
75
-
76
-    // (3)修改后结束时间<当前时间:活动已结束
77
-    if (showSignupTime[0]) {
78
-      // const date = data.signupTime
79
-      const nowDate = new Date()
80
-      // console.log(compareDate(nowDate, showSignupTime[0]))
81
-      if (compareDate(nowDate, showSignupTime[0])) {
82
-        return true
83
-      } else {
84
-        return '修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)'
85
-      }
86
-    }
87
-    return true
88
-  }
89
-
90
-
91
-  const handleSubmit = e => {
92
-    e.preventDefault();
93
-    props.form.validateFields((err, values) => {
94
-
95
-      if (!err) {
96
-        console.log('Received values of form: ', values);
97
-        const { activityTime, signupTime } = values
98
-        const [startDate, endDate] = activityTime
99
-        values.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
100
-        values.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
101
-        if (signupTime) {
102
-          const [enlistStart, enlistEnd] = signupTime
103
-          values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
104
-          values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
105
-        }
106
-
107
-        console.log('submit data --->', values)
108
-        if (dynamicId) {
109
-          const checks = checkTime()
110
-          if (checks != true) {
111
-            message.info(checks)
112
-            return
113
-          }
114
-          console.log(data.enlistNum,values.personNum,'143')
115
-
116
-          if (data.enlistNum > values.personNum) {
117
-            message.info('活动人数必须大于已报名人数')
118
-            return
119
-          }
120
-
121
-          values.dynamicId = dynamicId
122
-          request({ ...apis.activity.update, data: values }).then(data => {
123
-            message.info('保存成功')
124
-            // router.go(-1)
125
-          }).catch((err) => {
126
-            message.info(err.msg || err.message)
127
-          })
128
-        } else {
129
-          request({ ...apis.activity.add, data: { ...values } }).then((data) => {
130
-            message.info('保存成功')
131
-            router.push({
132
-              pathname: '/activity/editActivity',
133
-              query: {
134
-                dynamicId: data.dynamicId,
135
-              },
136
-            });
137
-            // router.go(-1)
138
-          }).catch((err) => {
139
-            message.info(err.msg || err.message)
140
-          })
141
-        }
142
-      }
143
-    });
144
-  }
145
-  const changeTime = (value, date) => {
146
-    // console.log(value, data, '-----checkTime---------')
147
-    // console.log(props.form.getFieldsValue(), '--------time1-----------')
148
-    // let datas = data
149
-    // console.log(value, date, datas)
150
-    // datas.signupTime = date
151
-
152
-    // //   data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
153
-
154
-    // console.log(datas,'-------datas--------')
155
-    //   props.form.setFieldsValue(data)
156
-    setShowSignupTime(date)
157
-    // props.form.setFieldsValue(datas)
158
-    // // form.setFieldsValue
159
-    // console.log('-------1--------')
160
-  }
161
-
162
-  const { getFieldDecorator } = props.form;
163
-  return (
164
-    <>
165
-      <Form {...formItemLayout} onSubmit={handleSubmit}>
166
-        <Form.Item label="所属项目">
167
-          {getFieldDecorator('buildingId', {
168
-            rules: [
169
-              {
170
-                required: true,
171
-                message: '请选择所属项目',
172
-              },
173
-            ],
174
-          })(<BuildSelect disabled={disable} />)}
175
-        </Form.Item>
176
-        <Form.Item label="活动封面图1" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于:首页推荐/活动列表">
177
-          {getFieldDecorator('listImgUrl', {
178
-            rules: [
179
-              {
180
-                required: true,
181
-                message: '请选择活动封面图1',
182
-              },
183
-            ],
184
-          })(<ImageUploader />)}
185
-        </Form.Item>
186
-        <Form.Item label="活动封面图2" help="建议图片尺寸:750*250,比例3:1,格式:jpg,用于:项目详情页">
187
-          {getFieldDecorator('bannerListImg', {
188
-            rules: [
189
-              {
190
-                required: true,
191
-                message: '请选择活动封面图2',
192
-              },
193
-            ],
194
-          })(<ImageUploader />)}
195
-        </Form.Item>
196
-        <Form.Item label="活动详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:普通活动详情">
197
-          {getFieldDecorator('imgUrl', {
198
-            rules: [
199
-              {
200
-                required: true,
201
-                message: '请选择活动详情主图',
202
-              },
203
-            ],
204
-          })(<ImageUploader />)}
205
-        </Form.Item>
206
-        <Form.Item label="活动标题">
207
-          {getFieldDecorator('title', {
208
-            rules: [
209
-              {
210
-                required: true,
211
-                message: '请输入活动标题',
212
-              },
213
-            ],
214
-          })(<Input />)}
215
-        </Form.Item>
216
-        <Form.Item label="活动时间">
217
-          {getFieldDecorator('activityTime', {
218
-            rules: [
219
-              {
220
-                required: true,
221
-                message: '请选择活动时间',
222
-              },
223
-            ],
224
-          })(<RangePicker format="YYYY-MM-DD HH:mm" />)}
225
-        </Form.Item>
226
-        <Form.Item label="活动地点">
227
-          {getFieldDecorator('address', {
228
-            rules: [
229
-              {
230
-                required: true,
231
-                message: '请输入活动地点',
232
-              },
233
-            ],
234
-          })(<Input />)}
235
-        </Form.Item>
236
-        {/* disabled={activityStatus === 0 ? true : false} */}
237
-        <Form.Item label="活动人数" help="当前活动最多可报名人数">
238
-          {getFieldDecorator('personNum', {
239
-            rules: [
240
-              {
241
-                required: true,
242
-                message: '请输入活动人数',
243
-              },
244
-              // {
245
-              //   min: data.personNum,min={data.personNum || 0}
246
-              //   message: '活动人数必须大于已报名人数',
247
-              // },
248
-            ],
249
-          })(<Input type="number" />)}
250
-        </Form.Item>
251
-        <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
252
-          {getFieldDecorator('maxEnlistByPerson', {
253
-            rules: [
254
-              {
255
-                required: true,
256
-                message: '请输入用户携带人数',
257
-              },
258
-            ],
259
-          })(<Input type="number" min={1} />)}
260
-        </Form.Item>
261
-        <Form.Item label="活动详情">
262
-          {getFieldDecorator('desc')(<Wangedit />)}
263
-        </Form.Item>
264
-        <Form.Item label="报名时间">
265
-          {getFieldDecorator('signupTime', {
266
-            rules: [
267
-              {
268
-                required: true,
269
-                message: '请选择报名时间',
270
-              },
271
-            ],
272
-          })(<RangePicker format="YYYY-MM-DD HH:mm" onChange={changeTime} />)}
273
-        </Form.Item>
274
-        <Form.Item label="权重">
275
-          {getFieldDecorator('heavy', {
276
-
277
-            rules: [
278
-              {
279
-                required: true,
280
-                message: '请输入权重',
281
-              },
282
-            ],
283
-          })(<Input type="number" style={{ width: 80 }} />)}<span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
284
-        </Form.Item>
285
-        <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
286
-          <Button type="primary" htmlType="submit">
287
-            确认
288
-          </Button>
289
-          &nbsp;&nbsp;&nbsp;&nbsp;
290
-          <Button onClick={() => cancelPage()}>
291
-            取消
292
-          </Button>
293
-        </Form.Item>
294
-      </Form>
295
-    </>
296
-  )
297
-}
298
-
299
-const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
300
-
301
-const Poster = props => {
302
-  const { dynamicId } = props
303
-  const [inputValue, changeInput] = useState('')
304
-  const [textAreaValue, changeTextArea] = useState('')
305
-  const [imgValue, changeImg] = useState('')
306
-  const [posterId, setPosterId] = useState('')
307
-
308
-  useEffect(() => {
309
-    if (dynamicId) {
310
-      request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then(data => {
311
-
312
-        if (data.length > 0) {
313
-          setPosterId(data[0].posterId)
314
-          changeImg(data[0].posterImg)
315
-          changeTextArea(data[0].posterDescription)
316
-          changeInput(data[0].posterTitle)
317
-        }
318
-      }).catch(err => {
319
-        message.info(err.msg || err.message)
320
-      })
321
-    }
322
-    // getMiniappName()
323
-  }, [])
324
-  
325
-  // 获取小程序名称
326
-  // const [miniappName, setMiniappName] = useState('')
327
-  // function getMiniappName() {
328
-  //   request({ ...apis.building.getMiniappName }).then(res => {
329
-  //     console.log(res, "0000000000000")
330
-  //     setMiniappName(res)
331
-  //   })
332
-  // }
333
-
334
-  const submitPoster = () => {
335
-    if (dynamicId) {
336
-      if (posterId) {
337
-        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue } }).then(data => {
338
-          message.info('保存成功')
339
-        }).catch(err => {
340
-          message.info(err.msg || err.message)
341
-        })
342
-      } else {
343
-        request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue } }).then(data => {
344
-          setPosterId(data.posterId)
345
-          message.info('保存成功')
346
-        }).catch(err => {
347
-          message.info(err.msg || err.message)
348
-        })
349
-      }
350
-    } else {
351
-      message.warn('请先保存基本信息数据')
352
-    }
353
-  }
354
-
355
-  return <div>
356
-    <div style={{ display: 'flex' }}>
357
-      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
358
-        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
359
-          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
360
-          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
361
-            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
362
-            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
363
-            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
364
-            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
365
-          </div>
366
-          <p style={{
367
-            margin: '10px 20px',
368
-            fontSize: '20px',
369
-            color: '#222',
370
-            fontWeight: '600',
371
-            display: '-webkit-box',
372
-            lineClamp: '3',
373
-            height: '60px',
374
-            WebkitLineClamp: '2',
375
-            WebkitBoxOrient: 'vertical',
376
-            overflow: 'hidden',
377
-            textOverflow: 'ellipsis',
378
-          }}>{inputValue || '海报标题'}</p>
379
-
380
-          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
381
-          <p style={{
382
-            margin: '16px 20px 28px 20px',
383
-            fontSize: '17px',
384
-            color: '#999',
385
-            display: '-webkit-box',
386
-            lineClamp: '3',
387
-            height: '72px',
388
-            WebkitLineClamp: '3',
389
-            WebkitBoxOrient: 'vertical',
390
-            overflow: 'hidden',
391
-            textOverflow: 'ellipsis',
392
-          }}>{textAreaValue || '海报描述'}</p>
393
-          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
394
-            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
395
-            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
396
-            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
397
-          </div>
398
-        </div>
399
-        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
400
-      </div>
401
-
402
-      <div >
403
-        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
404
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
405
-          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
406
-        </div>
407
-        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
408
-        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
409
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
410
-          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
411
-        </div>
412
-        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
413
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
414
-          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
415
-        </div>
416
-
417
-      </div>
418
-    </div>
419
-    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
420
-    <Button onClick={() => cancelPage()}>
421
-      取消
422
-    </Button>
423
-  </div>
424
-}
425
-
426
-const Share = props => {
427
-  const { dynamicId } = props
428
-  const [inputValue, changeInput] = useState('')
429
-  const [imgValue, changeImg] = useState('')
430
-  const [shareContentId, setShareContentId] = useState('')
431
-
432
-  useEffect(() => {
433
-    if (dynamicId) {
434
-      request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' } }).then(data => {
435
-
436
-        if (data.length > 0) {
437
-          setShareContentId(data[0].shareContentId)
438
-          changeImg(data[0].shareContentImg)
439
-          changeInput(data[0].shareContentTitle)
440
-        }
441
-      }).catch(err => {
442
-        message.info(err.msg || err.message)
443
-      })
444
-    }
445
-  }, [dynamicId])
446
-
447
-  const submitShare = () => {
448
-    if (dynamicId) {
449
-      if (shareContentId) {
450
-        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
451
-          message.info('保存成功')
452
-        }).catch(err => {
453
-          message.info(err.msg || err.message)
454
-        })
455
-      } else {
456
-        request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
457
-          setShareContentId(data.shareContentId)
458
-          message.info('保存成功')
459
-        }).catch(err => {
460
-          message.info(err.msg || err.message)
461
-        })
462
-      }
463
-    } else {
464
-      message.warn('请先保存基本信息数据')
465
-    }
466
-  }
467
-
468
-  return <div style={{ padding: '20px' }}>
469
-    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
470
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
471
-      <div>
472
-        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}>
473
-          <img src={logo} style={{ width: '22px', marginRight: '10px' }} alt=""/>橙蕉互动</p>
474
-        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue || '置业V客厅 精准获客平台'}</p>
475
-        <img style={{ width: '200px', height: '160px' }} src={imgValue || poster2} alt="" />
476
-      </div>
477
-    </div>
478
-    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
479
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
480
-      <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
481
-    </div>
482
-    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
483
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
484
-      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
485
-    </div>
486
-    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于活动分享好友</p>
487
-    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
488
-    <Button onClick={() => cancelPage()}>
489
-      取消
490
-    </Button>
491
-  </div>
492
-}
493
-
494
-
495
-/**
496
- *
497
- *
498
- * @param {*} props
499
- * @returns
500
- */
501
-const Edit = props => {
502
-  const [tab, changeTab] = useState('basic')
503
-  const { dynamicId } = props.location.query
504
-
505
-  return (
506
-    <div>
507
-      <div>
508
-        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
509
-          <Radio.Button value="basic">基本信息</Radio.Button>
510
-          <Radio.Button value="poster">海报图片</Radio.Button>
511
-          <Radio.Button value="share">分享设置</Radio.Button>
512
-        </Radio.Group>
513
-      </div>
514
-      <div>
515
-        {tab === 'basic' && <Basic dynamicId={dynamicId} />}
516
-        {tab === 'poster' && <Poster dynamicId={dynamicId}/>}
517
-        {tab === 'share' && <Share dynamicId={dynamicId}/>}
518
-      </div>
519
-    
520
-    </div>
521
-  );
522
-}
523
-
524
-export default Edit

+ 9
- 6
src/pages/activity/groupRoomActivity/edit/index.jsx Visa fil

@@ -1,8 +1,11 @@
1 1
 import React, { useState } from 'react';
2 2
 import { Radio, Card } from 'antd';
3 3
 import Basic from './Basic';
4
-import Poster from './Poster';
5
-import Share from './Share';
4
+// import Poster from './Poster';
5
+import Share from '@/components/Share';
6
+import Poster from '@/components/Poster'
7
+
8
+const type= 'house'
6 9
 /**
7 10
  *
8 11
  *
@@ -12,7 +15,7 @@ import Share from './Share';
12 15
 const Edit = props => {
13 16
   const [tab, changeTab] = useState('basic');
14 17
   const { dynamicId } = props.location.query;
15
-
18
+  const target = { id:dynamicId, type: 'activity' }
16 19
   return (
17 20
     <Card>
18 21
       <div>
@@ -23,9 +26,9 @@ const Edit = props => {
23 26
         </Radio.Group>
24 27
       </div>
25 28
       <div>
26
-        {tab === 'basic' && <Basic dynamicId={dynamicId} />}
27
-        {tab === 'poster' && <Poster dynamicId={dynamicId} />}
28
-        {tab === 'share' && <Share dynamicId={dynamicId} />}
29
+        {tab === 'basic' && <Basic dynamicId={dynamicId} type={type}/>}
30
+        {tab === 'poster' && <Poster target={target} />}
31
+        {tab === 'share' && <Share target={target} />}
29 32
       </div>
30 33
     </Card>
31 34
   );

+ 12
- 9
src/pages/activity/groupRoomActivity/index.jsx Visa fil

@@ -24,6 +24,8 @@ import apis from '@/services/apis';
24 24
 import request from '@/utils/request';
25 25
 import QueryTable from '@/components/QueryTable';
26 26
 
27
+const type= 'house'
28
+
27 29
 const GroupRoomActivity = props => {
28 30
   const ref = useRef();
29 31
 
@@ -54,9 +56,9 @@ const GroupRoomActivity = props => {
54 56
     },
55 57
   ];
56 58
 
57
-  const toGroupRoomActivityDetail = dynamicId => () => {
59
+  const toSignupActivityDetail = dynamicId => () => {
58 60
     router.push({
59
-      pathname: '/activity/groupRoomActivity/detail',
61
+      pathname: '/activity/SignupActivity/detail',
60 62
       query: {
61 63
         dynamicId,
62 64
       },
@@ -64,9 +66,9 @@ const GroupRoomActivity = props => {
64 66
   };
65 67
 
66 68
   // 跳转到编辑
67
-  const toGroupRoomActivityEdit = dynamicId => {
69
+  const toSignupActivityEdit = dynamicId => {
68 70
     router.push({
69
-      pathname: '/activity/groupRoomActivity/edit',
71
+      pathname: '/activity/SignupActivity/edit',
70 72
       query: {
71 73
         dynamicId,
72 74
       },
@@ -173,7 +175,7 @@ const GroupRoomActivity = props => {
173 175
 
174 176
   const getJoinPeople = dynamicId => () => {
175 177
     router.push({
176
-      pathname: '/activity/groupRoomActivity/registrationRecord',
178
+      pathname: '/activity/SignupActivity/registrationRecord',
177 179
       query: {
178 180
         dynamicId,
179 181
       },
@@ -188,7 +190,7 @@ const GroupRoomActivity = props => {
188 190
       align: 'center',
189 191
       width: '20%',
190 192
       render: (x, row) => (
191
-        <Navigate onClick={toGroupRoomActivityDetail(row.dynamicId)}>
193
+        <Navigate onClick={toSignupActivityDetail(row.dynamicId)}>
192 194
           <Typography.Text ellipsis>{row.title}</Typography.Text>
193 195
         </Navigate>
194 196
       ),
@@ -264,7 +266,7 @@ const GroupRoomActivity = props => {
264 266
           />
265 267
         </AuthButton>,
266 268
 
267
-        // //   <EditIcon type="look" text="查看详情" onClick={toGroupRoomActivityDetail(row.dynamicId)} />,
269
+        // //   <EditIcon type="look" text="查看详情" onClick={toSignupActivityDetail(row.dynamicId)} />,
268 270
 
269 271
         row.activityStatus === 0 ? (
270 272
           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
@@ -295,7 +297,7 @@ const GroupRoomActivity = props => {
295 297
             <EditIcon
296 298
               type="edit"
297 299
               text="编辑"
298
-              onClick={() => toGroupRoomActivityEdit(row.dynamicId, row.count)}
300
+              onClick={() => toSignupActivityEdit(row.dynamicId, row.count)}
299 301
             />
300 302
           </AuthButton>
301 303
         ) : null,
@@ -305,7 +307,7 @@ const GroupRoomActivity = props => {
305 307
 
306 308
   const actionRender = () => {
307 309
     return (
308
-      <Button type="primary" icon="plus" onClick={() => toGroupRoomActivityEdit()}>
310
+      <Button type="primary" icon="plus" onClick={() => toSignupActivityEdit()}>
309 311
         新增
310 312
       </Button>
311 313
     );
@@ -320,6 +322,7 @@ const GroupRoomActivity = props => {
320 322
       columns={columns}
321 323
       postData={data => {
322 324
         data.time && (data.time = `${moment(data.time).format('YYYY-MM-DDT00:00:00.000')}Z`);
325
+        data.type=type
323 326
         return data;
324 327
       }}
325 328
       actionRender={actionRender}

+ 0
- 524
src/pages/activity/lookHouseActivity/edit/ind.jsx Visa fil

@@ -1,524 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
-
4
-import router from 'umi/router';
5
-import apis from '@/services/apis';
6
-import moment from 'moment';
7
-import BuildSelect from '@/components/SelectButton/BuildSelect2'
8
-import Wangedit from '@/components/Wangedit/Wangedit'
9
-import request from '@/utils/request'
10
-import yinhao from '@/assets/yinhao.png'
11
-import ImageUploader from '@/components/XForm/ImageUpload';
12
-import logo from '@/assets/logo.png';
13
-import touxiang from '@/assets/touxiang.jpg';
14
-import poster1 from '@/assets/poster1.png';
15
-import poster2 from '@/assets/poster2.png';
16
-import xiaochengxu from '@/assets/xiaochengxu.png'
17
-
18
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
19
-const { TextArea } = Input;
20
-
21
-const formItemLayout = {
22
-  labelCol: { span: 6 },
23
-  wrapperCol: { span: 14 },
24
-};
25
-
26
-const cancelPage = () => {
27
-  router.push({
28
-    pathname: '/activity/ActivityList',
29
-  });
30
-}
31
-
32
-const BasicForm = props => {
33
-  const [isEnlist, setIsEnlist] = useState(1)
34
-  const [activityStatus, setActivityStatus] = useState(1)
35
-  const [disable, setDisable] = useState(false)
36
-  const [data, setData] = useState(1)
37
-  const [showSignupTime, setShowSignupTime] = useState([])
38
-
39
-
40
-  const radioOnChange = e => {
41
-    setIsEnlist(e.target.value)
42
-  }
43
-
44
-  const { dynamicId } = props
45
-
46
-  // 查询详情
47
-  const getDynamicData = dynamicId => {
48
-    request({ ...apis.activity.details, params: { dynamicId } }).then(data => {
49
- 
50
-      data.activityTime = [moment(data.startDate), moment(data.endDate)]
51
-      data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
52
-      // setSignupTime([moment(data.enlistStart), moment(data.enlistEnd)])
53
-      setData(data)
54
-      setIsEnlist(data.isEnlist)
55
-      setActivityStatus(data.activityStatus)
56
-      setDisable(data.activityStatus === 0)
57
-      props.form.setFieldsValue(data)
58
-    })
59
-  }
60
-
61
-  // eslint-disable-next-line react-hooks/rules-of-hooks
62
-  useEffect(() => {
63
-    props.form.setFieldsValue({ isEnlist })
64
-    if (dynamicId) {
65
-      getDynamicData(dynamicId);
66
-    }
67
-  }, [])
68
-  const checkTime = () => {
69
-    function compareDate(dateTime1, dateTime2) {
70
-      return new Date(dateTime1) > new Date(dateTime2)
71
-    }
72
-    // 1)修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)
73
-
74
-    // (2)修改后开始时间<当前时间<修改后结束时间:活动进行中
75
-
76
-    // (3)修改后结束时间<当前时间:活动已结束
77
-    if (showSignupTime[0]) {
78
-      // const date = data.signupTime
79
-      const nowDate = new Date()
80
-      // console.log(compareDate(nowDate, showSignupTime[0]))
81
-      if (compareDate(nowDate, showSignupTime[0])) {
82
-        return true
83
-      } else {
84
-        return '修改后的开始时间不得大于当前时间(会存在已经成功报名的用户)'
85
-      }
86
-    }
87
-    return true
88
-  }
89
-
90
-
91
-  const handleSubmit = e => {
92
-    e.preventDefault();
93
-    props.form.validateFields((err, values) => {
94
-
95
-      if (!err) {
96
-        console.log('Received values of form: ', values);
97
-        const { activityTime, signupTime } = values
98
-        const [startDate, endDate] = activityTime
99
-        values.startDate = moment(startDate).format('YYYY-MM-DD HH:mm');
100
-        values.endDate = moment(endDate).format('YYYY-MM-DD HH:mm');
101
-        if (signupTime) {
102
-          const [enlistStart, enlistEnd] = signupTime
103
-          values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
104
-          values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
105
-        }
106
-
107
-        console.log('submit data --->', values)
108
-        if (dynamicId) {
109
-          const checks = checkTime()
110
-          if (checks != true) {
111
-            message.info(checks)
112
-            return
113
-          }
114
-          console.log(data.enlistNum,values.personNum,'143')
115
-
116
-          if (data.enlistNum > values.personNum) {
117
-            message.info('活动人数必须大于已报名人数')
118
-            return
119
-          }
120
-
121
-          values.dynamicId = dynamicId
122
-          request({ ...apis.activity.update, data: values }).then(data => {
123
-            message.info('保存成功')
124
-            // router.go(-1)
125
-          }).catch((err) => {
126
-            message.info(err.msg || err.message)
127
-          })
128
-        } else {
129
-          request({ ...apis.activity.add, data: { ...values } }).then((data) => {
130
-            message.info('保存成功')
131
-            router.push({
132
-              pathname: '/activity/editActivity',
133
-              query: {
134
-                dynamicId: data.dynamicId,
135
-              },
136
-            });
137
-            // router.go(-1)
138
-          }).catch((err) => {
139
-            message.info(err.msg || err.message)
140
-          })
141
-        }
142
-      }
143
-    });
144
-  }
145
-  const changeTime = (value, date) => {
146
-    // console.log(value, data, '-----checkTime---------')
147
-    // console.log(props.form.getFieldsValue(), '--------time1-----------')
148
-    // let datas = data
149
-    // console.log(value, date, datas)
150
-    // datas.signupTime = date
151
-
152
-    // //   data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
153
-
154
-    // console.log(datas,'-------datas--------')
155
-    //   props.form.setFieldsValue(data)
156
-    setShowSignupTime(date)
157
-    // props.form.setFieldsValue(datas)
158
-    // // form.setFieldsValue
159
-    // console.log('-------1--------')
160
-  }
161
-
162
-  const { getFieldDecorator } = props.form;
163
-  return (
164
-    <>
165
-      <Form {...formItemLayout} onSubmit={handleSubmit}>
166
-        <Form.Item label="所属项目">
167
-          {getFieldDecorator('buildingId', {
168
-            rules: [
169
-              {
170
-                required: true,
171
-                message: '请选择所属项目',
172
-              },
173
-            ],
174
-          })(<BuildSelect disabled={disable} />)}
175
-        </Form.Item>
176
-        <Form.Item label="活动封面图1" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于:首页推荐/活动列表">
177
-          {getFieldDecorator('listImgUrl', {
178
-            rules: [
179
-              {
180
-                required: true,
181
-                message: '请选择活动封面图1',
182
-              },
183
-            ],
184
-          })(<ImageUploader />)}
185
-        </Form.Item>
186
-        <Form.Item label="活动封面图2" help="建议图片尺寸:750*250,比例3:1,格式:jpg,用于:项目详情页">
187
-          {getFieldDecorator('bannerListImg', {
188
-            rules: [
189
-              {
190
-                required: true,
191
-                message: '请选择活动封面图2',
192
-              },
193
-            ],
194
-          })(<ImageUploader />)}
195
-        </Form.Item>
196
-        <Form.Item label="活动详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:普通活动详情">
197
-          {getFieldDecorator('imgUrl', {
198
-            rules: [
199
-              {
200
-                required: true,
201
-                message: '请选择活动详情主图',
202
-              },
203
-            ],
204
-          })(<ImageUploader />)}
205
-        </Form.Item>
206
-        <Form.Item label="活动标题">
207
-          {getFieldDecorator('title', {
208
-            rules: [
209
-              {
210
-                required: true,
211
-                message: '请输入活动标题',
212
-              },
213
-            ],
214
-          })(<Input />)}
215
-        </Form.Item>
216
-        <Form.Item label="活动时间">
217
-          {getFieldDecorator('activityTime', {
218
-            rules: [
219
-              {
220
-                required: true,
221
-                message: '请选择活动时间',
222
-              },
223
-            ],
224
-          })(<RangePicker format="YYYY-MM-DD HH:mm" />)}
225
-        </Form.Item>
226
-        <Form.Item label="活动地点">
227
-          {getFieldDecorator('address', {
228
-            rules: [
229
-              {
230
-                required: true,
231
-                message: '请输入活动地点',
232
-              },
233
-            ],
234
-          })(<Input />)}
235
-        </Form.Item>
236
-        {/* disabled={activityStatus === 0 ? true : false} */}
237
-        <Form.Item label="活动人数" help="当前活动最多可报名人数">
238
-          {getFieldDecorator('personNum', {
239
-            rules: [
240
-              {
241
-                required: true,
242
-                message: '请输入活动人数',
243
-              },
244
-              // {
245
-              //   min: data.personNum,min={data.personNum || 0}
246
-              //   message: '活动人数必须大于已报名人数',
247
-              // },
248
-            ],
249
-          })(<Input type="number" />)}
250
-        </Form.Item>
251
-        <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
252
-          {getFieldDecorator('maxEnlistByPerson', {
253
-            rules: [
254
-              {
255
-                required: true,
256
-                message: '请输入用户携带人数',
257
-              },
258
-            ],
259
-          })(<Input type="number" min={1} />)}
260
-        </Form.Item>
261
-        <Form.Item label="活动详情">
262
-          {getFieldDecorator('desc')(<Wangedit />)}
263
-        </Form.Item>
264
-        <Form.Item label="报名时间">
265
-          {getFieldDecorator('signupTime', {
266
-            rules: [
267
-              {
268
-                required: true,
269
-                message: '请选择报名时间',
270
-              },
271
-            ],
272
-          })(<RangePicker format="YYYY-MM-DD HH:mm" onChange={changeTime} />)}
273
-        </Form.Item>
274
-        <Form.Item label="权重">
275
-          {getFieldDecorator('heavy', {
276
-
277
-            rules: [
278
-              {
279
-                required: true,
280
-                message: '请输入权重',
281
-              },
282
-            ],
283
-          })(<Input type="number" style={{ width: 80 }} />)}<span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
284
-        </Form.Item>
285
-        <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
286
-          <Button type="primary" htmlType="submit">
287
-            确认
288
-          </Button>
289
-          &nbsp;&nbsp;&nbsp;&nbsp;
290
-          <Button onClick={() => cancelPage()}>
291
-            取消
292
-          </Button>
293
-        </Form.Item>
294
-      </Form>
295
-    </>
296
-  )
297
-}
298
-
299
-const Basic = Form.create({ name: 'BasicForm' })(BasicForm);
300
-
301
-const Poster = props => {
302
-  const { dynamicId } = props
303
-  const [inputValue, changeInput] = useState('')
304
-  const [textAreaValue, changeTextArea] = useState('')
305
-  const [imgValue, changeImg] = useState('')
306
-  const [posterId, setPosterId] = useState('')
307
-
308
-  useEffect(() => {
309
-    if (dynamicId) {
310
-      request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then(data => {
311
-
312
-        if (data.length > 0) {
313
-          setPosterId(data[0].posterId)
314
-          changeImg(data[0].posterImg)
315
-          changeTextArea(data[0].posterDescription)
316
-          changeInput(data[0].posterTitle)
317
-        }
318
-      }).catch(err => {
319
-        message.info(err.msg || err.message)
320
-      })
321
-    }
322
-    // getMiniappName()
323
-  }, [])
324
-  
325
-  // 获取小程序名称
326
-  // const [miniappName, setMiniappName] = useState('')
327
-  // function getMiniappName() {
328
-  //   request({ ...apis.building.getMiniappName }).then(res => {
329
-  //     console.log(res, "0000000000000")
330
-  //     setMiniappName(res)
331
-  //   })
332
-  // }
333
-
334
-  const submitPoster = () => {
335
-    if (dynamicId) {
336
-      if (posterId) {
337
-        request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue } }).then(data => {
338
-          message.info('保存成功')
339
-        }).catch(err => {
340
-          message.info(err.msg || err.message)
341
-        })
342
-      } else {
343
-        request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue } }).then(data => {
344
-          setPosterId(data.posterId)
345
-          message.info('保存成功')
346
-        }).catch(err => {
347
-          message.info(err.msg || err.message)
348
-        })
349
-      }
350
-    } else {
351
-      message.warn('请先保存基本信息数据')
352
-    }
353
-  }
354
-
355
-  return <div>
356
-    <div style={{ display: 'flex' }}>
357
-      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
358
-        <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
359
-          <img style={{ width: '100%', height: '300px' }} src={imgValue || poster1} alt="" />
360
-          <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
361
-            <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
362
-            <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
363
-            <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
364
-            <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
365
-          </div>
366
-          <p style={{
367
-            margin: '10px 20px',
368
-            fontSize: '20px',
369
-            color: '#222',
370
-            fontWeight: '600',
371
-            display: '-webkit-box',
372
-            lineClamp: '3',
373
-            height: '60px',
374
-            WebkitLineClamp: '2',
375
-            WebkitBoxOrient: 'vertical',
376
-            overflow: 'hidden',
377
-            textOverflow: 'ellipsis',
378
-          }}>{inputValue || '海报标题'}</p>
379
-
380
-          <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
381
-          <p style={{
382
-            margin: '16px 20px 28px 20px',
383
-            fontSize: '17px',
384
-            color: '#999',
385
-            display: '-webkit-box',
386
-            lineClamp: '3',
387
-            height: '72px',
388
-            WebkitLineClamp: '3',
389
-            WebkitBoxOrient: 'vertical',
390
-            overflow: 'hidden',
391
-            textOverflow: 'ellipsis',
392
-          }}>{textAreaValue || '海报描述'}</p>
393
-          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
394
-            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
395
-            <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入活动查看详情</p>
396
-            <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
397
-          </div>
398
-        </div>
399
-        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
400
-      </div>
401
-
402
-      <div >
403
-        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
404
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
405
-          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
406
-        </div>
407
-        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
408
-        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
409
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
410
-          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
411
-        </div>
412
-        <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
413
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
414
-          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
415
-        </div>
416
-
417
-      </div>
418
-    </div>
419
-    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
420
-    <Button onClick={() => cancelPage()}>
421
-      取消
422
-    </Button>
423
-  </div>
424
-}
425
-
426
-const Share = props => {
427
-  const { dynamicId } = props
428
-  const [inputValue, changeInput] = useState('')
429
-  const [imgValue, changeImg] = useState('')
430
-  const [shareContentId, setShareContentId] = useState('')
431
-
432
-  useEffect(() => {
433
-    if (dynamicId) {
434
-      request({ ...apis.activity.shareContent, params: { targetId: dynamicId, targetType: 'activity' } }).then(data => {
435
-
436
-        if (data.length > 0) {
437
-          setShareContentId(data[0].shareContentId)
438
-          changeImg(data[0].shareContentImg)
439
-          changeInput(data[0].shareContentTitle)
440
-        }
441
-      }).catch(err => {
442
-        message.info(err.msg || err.message)
443
-      })
444
-    }
445
-  }, [dynamicId])
446
-
447
-  const submitShare = () => {
448
-    if (dynamicId) {
449
-      if (shareContentId) {
450
-        request({ ...apis.activity.updateShareContent, urlData: { id: shareContentId }, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
451
-          message.info('保存成功')
452
-        }).catch(err => {
453
-          message.info(err.msg || err.message)
454
-        })
455
-      } else {
456
-        request({ ...apis.activity.addShareContent, data: { targetId: dynamicId, shareContentType: 'activity', shareContentImg: imgValue, shareContentTitle: inputValue } }).then(data => {
457
-          setShareContentId(data.shareContentId)
458
-          message.info('保存成功')
459
-        }).catch(err => {
460
-          message.info(err.msg || err.message)
461
-        })
462
-      }
463
-    } else {
464
-      message.warn('请先保存基本信息数据')
465
-    }
466
-  }
467
-
468
-  return <div style={{ padding: '20px' }}>
469
-    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
470
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
471
-      <div>
472
-        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}>
473
-          <img src={logo} style={{ width: '22px', marginRight: '10px' }} alt=""/>橙蕉互动</p>
474
-        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue || '置业V客厅 精准获客平台'}</p>
475
-        <img style={{ width: '200px', height: '160px' }} src={imgValue || poster2} alt="" />
476
-      </div>
477
-    </div>
478
-    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
479
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
480
-      <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
481
-    </div>
482
-    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
483
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
484
-      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
485
-    </div>
486
-    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于活动分享好友</p>
487
-    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
488
-    <Button onClick={() => cancelPage()}>
489
-      取消
490
-    </Button>
491
-  </div>
492
-}
493
-
494
-
495
-/**
496
- *
497
- *
498
- * @param {*} props
499
- * @returns
500
- */
501
-const Edit = props => {
502
-  const [tab, changeTab] = useState('basic')
503
-  const { dynamicId } = props.location.query
504
-
505
-  return (
506
-    <div>
507
-      <div>
508
-        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
509
-          <Radio.Button value="basic">基本信息</Radio.Button>
510
-          <Radio.Button value="poster">海报图片</Radio.Button>
511
-          <Radio.Button value="share">分享设置</Radio.Button>
512
-        </Radio.Group>
513
-      </div>
514
-      <div>
515
-        {tab === 'basic' && <Basic dynamicId={dynamicId} />}
516
-        {tab === 'poster' && <Poster dynamicId={dynamicId}/>}
517
-        {tab === 'share' && <Share dynamicId={dynamicId}/>}
518
-      </div>
519
-    
520
-    </div>
521
-  );
522
-}
523
-
524
-export default Edit

+ 9
- 6
src/pages/activity/lookHouseActivity/edit/index.jsx Visa fil

@@ -1,8 +1,11 @@
1 1
 import React, { useState } from 'react';
2 2
 import { Radio, Card } from 'antd';
3 3
 import Basic from './Basic';
4
-import Poster from './Poster';
5
-import Share from './Share';
4
+// import Poster from './Poster';
5
+import Share from '@/components/Share';
6
+import Poster from '@/components/Poster'
7
+
8
+const type= 'look'
6 9
 /**
7 10
  *
8 11
  *
@@ -12,7 +15,7 @@ import Share from './Share';
12 15
 const Edit = props => {
13 16
   const [tab, changeTab] = useState('basic');
14 17
   const { dynamicId } = props.location.query;
15
-
18
+  const target = { id:dynamicId, type: 'activity' }
16 19
   return (
17 20
     <Card>
18 21
       <div>
@@ -23,9 +26,9 @@ const Edit = props => {
23 26
         </Radio.Group>
24 27
       </div>
25 28
       <div>
26
-        {tab === 'basic' && <Basic dynamicId={dynamicId} />}
27
-        {tab === 'poster' && <Poster dynamicId={dynamicId} />}
28
-        {tab === 'share' && <Share dynamicId={dynamicId} />}
29
+        {tab === 'basic' && <Basic dynamicId={dynamicId} type={type}/>}
30
+        {tab === 'poster' && <Poster target={target} />}
31
+        {tab === 'share' && <Share target={target} />}
29 32
       </div>
30 33
     </Card>
31 34
   );

+ 12
- 9
src/pages/activity/lookHouseActivity/index.jsx Visa fil

@@ -24,6 +24,8 @@ import apis from '@/services/apis';
24 24
 import request from '@/utils/request';
25 25
 import QueryTable from '@/components/QueryTable';
26 26
 
27
+const type= 'look'
28
+
27 29
 const LookHouseActivity = props => {
28 30
   const ref = useRef();
29 31
 
@@ -54,9 +56,9 @@ const LookHouseActivity = props => {
54 56
     },
55 57
   ];
56 58
 
57
-  const toLookHouseActivityDetail = dynamicId => () => {
59
+  const toSignupActivityDetail = dynamicId => () => {
58 60
     router.push({
59
-      pathname: '/activity/lookHouseActivity/detail',
61
+      pathname: '/activity/SignupActivity/detail',
60 62
       query: {
61 63
         dynamicId,
62 64
       },
@@ -64,9 +66,9 @@ const LookHouseActivity = props => {
64 66
   };
65 67
 
66 68
   // 跳转到编辑
67
-  const toLookHouseActivityEdit = dynamicId => {
69
+  const toSignupActivityEdit = dynamicId => {
68 70
     router.push({
69
-      pathname: '/activity/lookHouseActivity/edit',
71
+      pathname: '/activity/SignupActivity/edit',
70 72
       query: {
71 73
         dynamicId,
72 74
       },
@@ -173,7 +175,7 @@ const LookHouseActivity = props => {
173 175
 
174 176
   const getJoinPeople = dynamicId => () => {
175 177
     router.push({
176
-      pathname: '/activity/lookHouseActivity/registrationRecord',
178
+      pathname: '/activity/SignupActivity/registrationRecord',
177 179
       query: {
178 180
         dynamicId,
179 181
       },
@@ -188,7 +190,7 @@ const LookHouseActivity = props => {
188 190
       align: 'center',
189 191
       width: '20%',
190 192
       render: (x, row) => (
191
-        <Navigate onClick={toLookHouseActivityDetail(row.dynamicId)}>
193
+        <Navigate onClick={toSignupActivityDetail(row.dynamicId)}>
192 194
           <Typography.Text ellipsis>{row.title}</Typography.Text>
193 195
         </Navigate>
194 196
       ),
@@ -264,7 +266,7 @@ const LookHouseActivity = props => {
264 266
           />
265 267
         </AuthButton>,
266 268
 
267
-        // //   <EditIcon type="look" text="查看详情" onClick={toLookHouseActivityDetail(row.dynamicId)} />,
269
+        // //   <EditIcon type="look" text="查看详情" onClick={toSignupActivityDetail(row.dynamicId)} />,
268 270
 
269 271
         row.activityStatus === 0 ? (
270 272
           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
@@ -295,7 +297,7 @@ const LookHouseActivity = props => {
295 297
             <EditIcon
296 298
               type="edit"
297 299
               text="编辑"
298
-              onClick={() => toLookHouseActivityEdit(row.dynamicId, row.count)}
300
+              onClick={() => toSignupActivityEdit(row.dynamicId, row.count)}
299 301
             />
300 302
           </AuthButton>
301 303
         ) : null,
@@ -305,7 +307,7 @@ const LookHouseActivity = props => {
305 307
 
306 308
   const actionRender = () => {
307 309
     return (
308
-      <Button type="primary" icon="plus" onClick={() => toLookHouseActivityEdit()}>
310
+      <Button type="primary" icon="plus" onClick={() => toSignupActivityEdit()}>
309 311
         新增
310 312
       </Button>
311 313
     );
@@ -320,6 +322,7 @@ const LookHouseActivity = props => {
320 322
       columns={columns}
321 323
       postData={data => {
322 324
         data.time && (data.time = `${moment(data.time).format('YYYY-MM-DDT00:00:00.000')}Z`);
325
+        data.type=type
323 326
         return data;
324 327
       }}
325 328
       actionRender={actionRender}

+ 9
- 17
src/pages/news/list/Edit.jsx Visa fil

@@ -1,25 +1,16 @@
1
-import React, { useMemo, useRef, useEffect, useState } from 'react';
1
+import React from 'react';
2 2
 // import { PageHeaderWrapper } from '@ant-design/pro-layout'
3
-import { Button, notification, Spin, Modal, message, Card, Tabs } from 'antd';
4
-import { router } from 'umi';
5
-import QueryTable from '@/components/QueryTable';
6
-import request from '@/utils/request';
7
-import apis from '@/services/apis';
3
+import { Card, Tabs } from 'antd';
8 4
 import Basic from './compents/Basic'
9
-import Poster from './compents/Poster'
10
-import Share from './compents/Share'
11
-import SelectCity from '@/components/SelectButton/CitySelect';
12
-import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect';
13
-import BuildSelect from '@/components/SelectButton/BuildSelect';
14
-import moment from 'moment';
15
-import OperButton from '@/components/OperButton';
16
-import AuthButton from '@/components/AuthButton';
17
-import withActions from '@/components/ActionList';
5
+import Share from '@/components/Share';
6
+import Poster from '@/components/Poster'
18 7
 
19 8
 const { TabPane } = Tabs;
20 9
 
21 10
 export default props => {
22 11
     const newsId = props.location.query.newsId
12
+
13
+    const target = { id:newsId, type: 'news' }
23 14
 //   const [dynamicData, setDynamicData] = useState({});
24 15
 
25 16
 //   useEffect(() => {
@@ -53,10 +44,11 @@ export default props => {
53 44
         </TabPane>
54 45
 
55 46
         <TabPane tab="海报图片" key="2">
56
-        <Poster newsId={newsId} />
47
+        <Poster target={target} />
48
+      
57 49
         </TabPane>
58 50
         <TabPane tab="分享设置" key="3">
59
-        <Share newsId={newsId} />
51
+        <Share target={target} />
60 52
         </TabPane>
61 53
       </Tabs>
62 54
     </Card>

+ 35
- 1
src/services/apis.js Visa fil

@@ -201,7 +201,6 @@ export default {
201 201
       method: 'DELETE',
202 202
       action: 'admin.marketing.id.delete',
203 203
     },
204
-
205 204
   },
206 205
   buildingType: {
207 206
     getList: {
@@ -2170,4 +2169,39 @@ export default {
2170 2169
       action: 'admin.institution.list.get',
2171 2170
     },
2172 2171
   },
2172
+
2173
+  // 视频
2174
+  video: {
2175
+    list: {
2176
+      method: 'GET',
2177
+      url: `${prefix}/video`,
2178
+      action: 'admin.video.get',
2179
+    },
2180
+    getDetail: {
2181
+      method: 'GET',
2182
+      url: `${prefix}/video/:id`,
2183
+      action: 'admin.video.get.id',
2184
+    },
2185
+    save: {
2186
+      method: 'POST',
2187
+      url: `${prefix}/video`,
2188
+      action: 'admin.video.post',
2189
+    },
2190
+    updata: {
2191
+      method: 'PUT',
2192
+      url: `${prefix}/video/:id`,
2193
+      action: 'admin.video.id.put',
2194
+    },
2195
+    publish: {
2196
+      method: 'PUT',
2197
+      url: `${prefix}/publish/:id`,
2198
+      action: 'admin.publish.id.put',
2199
+    },
2200
+    delete: {
2201
+      method: 'DELETE',
2202
+      url: `${prefix}/video/:id`,
2203
+      action: 'admin.publish.id.put',
2204
+    },
2205
+   
2206
+  },
2173 2207
 };