张延森 4 年前
父节点
当前提交
a50c89842d

+ 10
- 8
src/pages/carouselFigure/advertisingList.jsx 查看文件

225
 
225
 
226
     <>
226
     <>
227
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
227
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
228
-        <Form.Item>
228
+        {/* <Form.Item>
229
           {getFieldDecorator('cityId')(
229
           {getFieldDecorator('cityId')(
230
             <SelectCity />,
230
             <SelectCity />,
231
           )}
231
           )}
234
           {getFieldDecorator('buildingId')(
234
           {getFieldDecorator('buildingId')(
235
             <BuildSelect />,
235
             <BuildSelect />,
236
           )}
236
           )}
237
-        </Form.Item>
237
+        </Form.Item> */}
238
         <Form.Item>
238
         <Form.Item>
239
           {getFieldDecorator('contentType')(
239
           {getFieldDecorator('contentType')(
240
             <Select style={{ width: '180px' }} placeholder="类型">
240
             <Select style={{ width: '180px' }} placeholder="类型">
241
-              <Option value="project">项目</Option>
241
+              <Option value="notice">公告</Option>
242
+              <Option value="tpNews">服务</Option>
243
+              {/* <Option value="project">项目</Option> */}
242
               <Option value="news">资讯</Option>
244
               <Option value="news">资讯</Option>
243
-              <Option value="activity">报名活动</Option>
244
-              <Option value="help">助力活动</Option>
245
+              <Option value="activity">活动</Option>
246
+              {/* <Option value="help">助力活动</Option>
245
               <Option value="group">拼团活动</Option>
247
               <Option value="group">拼团活动</Option>
246
               <Option value="h5">H5活动</Option>
248
               <Option value="h5">H5活动</Option>
247
               <Option value="live">直播活动</Option>
249
               <Option value="live">直播活动</Option>
248
-              <Option value="salesBatch">在线选房</Option>
250
+              <Option value="salesBatch">在线选房</Option> */}
249
               <Option value="nothing">无</Option>
251
               <Option value="nothing">无</Option>
250
             </Select>,
252
             </Select>,
251
           )}
253
           )}
252
         </Form.Item>
254
         </Form.Item>
253
-        <Form.Item>
255
+        {/* <Form.Item>
254
           {getFieldDecorator('showPosition')(
256
           {getFieldDecorator('showPosition')(
255
             <Select style={{ width: '180px' }} placeholder="发布位置">
257
             <Select style={{ width: '180px' }} placeholder="发布位置">
256
               <Option value="index">首页</Option>
258
               <Option value="index">首页</Option>
257
               <Option value="building">项目</Option>
259
               <Option value="building">项目</Option>
258
             </Select>,
260
             </Select>,
259
           )}
261
           )}
260
-        </Form.Item>
262
+        </Form.Item> */}
261
         <Form.Item>
263
         <Form.Item>
262
           {getFieldDecorator('status')(
264
           {getFieldDecorator('status')(
263
             <Select style={{ width: '180px' }} placeholder="状态">
265
             <Select style={{ width: '180px' }} placeholder="状态">

+ 23
- 8
src/pages/carouselFigure/carouselFigureList.jsx 查看文件

15
 const { Option } = Select;
15
 const { Option } = Select;
16
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
16
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
 
17
 
18
+const ContentTypeDict = {
19
+  'notice': '公告',
20
+  'tpNews': '服务',
21
+  'activity': '活动',
22
+  'news': '资讯',
23
+}
24
+
25
+const PositionDict = {
26
+  'index': '首页',
27
+  'mall': '商城',
28
+  'property': '物业'
29
+}
30
+
18
 const header = (props) => {
31
 const header = (props) => {
19
   const [data, setData] = useState({})
32
   const [data, setData] = useState({})
20
   //   const [page, changePage] = useState({})
33
   //   const [page, changePage] = useState({})
48
       dataIndex: 'image',
61
       dataIndex: 'image',
49
       key: 'image',
62
       key: 'image',
50
       align: 'center',
63
       align: 'center',
51
-      render: (x, row) => <Navigate onClick={toEditCarouse(row.contentId)} ><img src={row.image} className={row.showPosition === 'index' ? styles.imgIndex : row.showPosition === 'mall' ? styles.imgPerfect : ''} /></Navigate>,
64
+      render: (x, row) => <Navigate onClick={toEditCarouse(row.contentId)} ><img src={row.image} style={{width: '128px', height: '64px'}} /></Navigate>,
52
     },
65
     },
53
     // {
66
     // {
54
     //   title: '发布城市',
67
     //   title: '发布城市',
68
       dataIndex: 'contentType',
81
       dataIndex: 'contentType',
69
       key: 'contentType',
82
       key: 'contentType',
70
       align: 'center',
83
       align: 'center',
71
-      render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
72
-        contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无'}</span>
84
+      render: t => ContentTypeDict[t] || '无'
73
     },
85
     },
74
     {
86
     {
75
       title: '发布位置',
87
       title: '发布位置',
76
       dataIndex: 'showPosition',
88
       dataIndex: 'showPosition',
77
       key: 'showPosition',
89
       key: 'showPosition',
78
       align: 'center',
90
       align: 'center',
79
-      render: (showPosition) => <span>{showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : ''}</span>
91
+      render: t => PositionDict[t] || ''
80
     },
92
     },
81
     {
93
     {
82
       title: '发布时间',
94
       title: '发布时间',
231
         <Form.Item>
243
         <Form.Item>
232
           {getFieldDecorator('contentType')(
244
           {getFieldDecorator('contentType')(
233
             <Select style={{ width: '180px' }} placeholder="类型">
245
             <Select style={{ width: '180px' }} placeholder="类型">
246
+              <Option value="notice">公告</Option>
247
+              <Option value="tpNews">服务</Option>
234
               <Option value="activity">活动</Option>
248
               <Option value="activity">活动</Option>
235
-              <Option value="project">项目</Option>
249
+              {/* <Option value="project">项目</Option> */}
236
               <Option value="news">资讯</Option>
250
               <Option value="news">资讯</Option>
237
-              <Option value="help">助力</Option>
251
+              {/* <Option value="help">助力</Option>
238
               <Option value="group">拼团</Option>
252
               <Option value="group">拼团</Option>
239
-              <Option value="h5">H5</Option>
253
+              <Option value="h5">H5</Option> */}
240
               <Option value="nothing">无</Option>
254
               <Option value="nothing">无</Option>
241
               {/* <Option value="other">其他</Option> */}
255
               {/* <Option value="other">其他</Option> */}
242
             </Select>,
256
             </Select>,
245
         <Form.Item>
259
         <Form.Item>
246
           {getFieldDecorator('showPosition')(
260
           {getFieldDecorator('showPosition')(
247
             <Select style={{ width: '180px' }} placeholder="发布位置">
261
             <Select style={{ width: '180px' }} placeholder="发布位置">
248
-              <Option value="mall">积分商城</Option>
249
               <Option value="index">首页</Option>
262
               <Option value="index">首页</Option>
263
+              <Option value="mall">积分商城</Option>
264
+              <Option value="property">物业</Option>
250
             </Select>,
265
             </Select>,
251
           )}
266
           )}
252
         </Form.Item>
267
         </Form.Item>

+ 4
- 0
src/pages/carouselFigure/editAdvertising.jsx 查看文件

283
             label: '资讯',
283
             label: '资讯',
284
             value: 'news'
284
             value: 'news'
285
           },
285
           },
286
+          {
287
+            label: '无',
288
+            value: 'nothing'
289
+          },
286
           // {
290
           // {
287
           //   label: '拼团活动详情',
291
           //   label: '拼团活动详情',
288
           //   value: 'group'
292
           //   value: 'group'

+ 143
- 102
src/pages/carouselFigure/editCarousel.jsx 查看文件

18
 import SelectActivity from './SelectActivity';
18
 import SelectActivity from './SelectActivity';
19
 import SelectH5 from './SelectH5';
19
 import SelectH5 from './SelectH5';
20
 import SelectMall from './SelectMall';
20
 import SelectMall from './SelectMall';
21
+import SelectNotice from './SelectNotice';
22
+import SelectTpNews from './SelectTpNews';
21
 
23
 
22
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
24
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
23
 /**
25
 /**
43
   let isHaveActive=false
45
   let isHaveActive=false
44
   let isCanChoose=true
46
   let isCanChoose=true
45
   let mallVisible = false
47
   let mallVisible = false
48
+  let noticeVisible = false
49
+  let tpNewsVisible = false
46
 
50
 
47
   const setExtraData = (data) => {
51
   const setExtraData = (data) => {
48
     console.log(data, 'data');
52
     console.log(data, 'data');
63
     liveVisible = data.contentType === 'live';
67
     liveVisible = data.contentType === 'live';
64
     h5Visible = data.contentType === 'h5';
68
     h5Visible = data.contentType === 'h5';
65
     mallVisible = data.contentType === 'mall';
69
     mallVisible = data.contentType === 'mall';
70
+    noticeVisible = data.contentType === 'notice';
71
+    tpNewsVisible = data.contentType === 'tpNews';
66
 
72
 
67
     cityId=data.cityId
73
     cityId=data.cityId
68
     buildingId = data.buildingId
74
     buildingId = data.buildingId
92
     locationTypeNews = data.showPosition === 'news';
98
     locationTypeNews = data.showPosition === 'news';
93
     h5Visible = data.contentType === 'h5';
99
     h5Visible = data.contentType === 'h5';
94
     mallVisible = data.contentType === 'mall';
100
     mallVisible = data.contentType === 'mall';
101
+    noticeVisible = data.contentType === 'notice';
102
+    tpNewsVisible = data.contentType === 'tpNews';
95
     console.log(mallVisible, 'locationType');
103
     console.log(mallVisible, 'locationType');
96
   }
104
   }
97
 
105
 
176
             value: 'mall',
184
             value: 'mall',
177
           },
185
           },
178
           {
186
           {
179
-            label: '资讯',
180
-            value: 'news',
187
+            label: '物业',
188
+            value: 'property',
181
           }],
189
           }],
182
           value: data.showPosition,
190
           value: data.showPosition,
183
           rules: [
191
           rules: [
212
         //     { required: true, message: '请选择类型' },
220
         //     { required: true, message: '请选择类型' },
213
         //   ],
221
         //   ],
214
         // },
222
         // },
215
-        {
216
-          label: '标题',
217
-          name: 'title',
218
-          type: FieldTypes.Text,
219
-          value: data.title,
220
-          hidden: true,
221
-          rules: [
222
-            { required: true, message: '请输入标题' },
223
-          ],
224
-        },
225
-        {
226
-          label: '类型',
227
-          name: 'contentType',
228
-          type: FieldTypes.Select,
229
-          hidden: () => !locationTypeIndex,
230
-          dict: [{
231
-            label: '常规活动',
232
-            value: 'activity',
233
-          },
234
-          // {
235
-          //   label: '项目',
236
-          //   value: 'project',
237
-          // },
238
-          {
239
-            label: '资讯',
240
-            value: 'news',
241
-          },
242
-          {
243
-            label: '积分商城',
244
-            value: 'mall',
245
-          },
246
-          // {
247
-          //   label: '其他',
248
-          //   value: 'other',
249
-          // },
250
-          // {
251
-          //   label: '拼团',
252
-          //   value: 'group',
253
-          // },
254
-          // {
255
-          //   label: '助力',
256
-          //   value: 'help',
257
-          // },
258
-          // {
259
-          //   label: 'h5',
260
-          //   value: 'h5',
261
-          // },
262
-          // {
263
-          //   label: '销售批次详情',
264
-          //   value: 'salesBatch',
265
-          // },
266
-          // {
267
-          //   label: '直播活动详情',
268
-          //   value: 'live',
269
-          // }
270
-        ],
271
-          value: data.contentType,
272
-          rules: [
273
-            { required: true, message: '请选择类型' },
274
-          ],
275
-        },
276
-        {
277
-          label: '类型',
278
-          name: 'contentType',
279
-          type: FieldTypes.Select,
280
-          hidden: () => !locationType,
281
-          dict: [
282
-          {
283
-            label: '积分商城',
284
-            value: 'mall',
285
-          },
286
-        ],
287
-          value: data.contentType,
288
-          rules: [
289
-            { required: true, message: '请选择类型' },
290
-          ],
291
-        },
223
+        // {
224
+        //   label: '标题',
225
+        //   name: 'title',
226
+        //   type: FieldTypes.Text,
227
+        //   value: data.title,
228
+        //   hidden: true,
229
+        //   rules: [
230
+        //     { required: true, message: '请输入标题' },
231
+        //   ],
232
+        // },
292
         {
233
         {
293
           label: '类型',
234
           label: '类型',
294
           name: 'contentType',
235
           name: 'contentType',
295
           type: FieldTypes.Select,
236
           type: FieldTypes.Select,
296
-          hidden: () => !locationTypeNews,
237
+          // hidden: () => !locationTypeIndex,
297
           dict: [
238
           dict: [
298
             {
239
             {
299
-              label: '资讯',
300
-              value: 'news',
240
+              label: '公告',
241
+              value: 'notice',
242
+            },
243
+            {
244
+              label: '服务',
245
+              value: 'tpNews',
301
             },
246
             },
302
-        ],
247
+            {
248
+              label: '活动',
249
+              value: 'activity',
250
+            },
251
+            // {
252
+            //   label: '项目',
253
+            //   value: 'project',
254
+            // },
255
+            // {
256
+            //   label: '资讯',
257
+            //   value: 'news',
258
+            // },
259
+            {
260
+              label: '商城',
261
+              value: 'mall',
262
+            },
263
+            {
264
+              label: '无',
265
+              value: 'nothing',
266
+            },
267
+            // {
268
+            //   label: '其他',
269
+            //   value: 'other',
270
+            // },
271
+            // {
272
+            //   label: '拼团',
273
+            //   value: 'group',
274
+            // },
275
+            // {
276
+            //   label: '助力',
277
+            //   value: 'help',
278
+            // },
279
+            // {
280
+            //   label: 'h5',
281
+            //   value: 'h5',
282
+            // },
283
+            // {
284
+            //   label: '销售批次详情',
285
+            //   value: 'salesBatch',
286
+            // },
287
+            // {
288
+            //   label: '直播活动详情',
289
+            //   value: 'live',
290
+            // }
291
+          ],
303
           value: data.contentType,
292
           value: data.contentType,
304
           rules: [
293
           rules: [
305
             { required: true, message: '请选择类型' },
294
             { required: true, message: '请选择类型' },
306
           ],
295
           ],
307
         },
296
         },
297
+        // {
298
+        //   label: '类型',
299
+        //   name: 'contentType',
300
+        //   type: FieldTypes.Select,
301
+        //   hidden: () => !locationType,
302
+        //   dict: [
303
+        //   {
304
+        //     label: '积分商城',
305
+        //     value: 'mall',
306
+        //   },
307
+        // ],
308
+        //   value: data.contentType,
309
+        //   rules: [
310
+        //     { required: true, message: '请选择类型' },
311
+        //   ],
312
+        // },
313
+        // {
314
+        //   label: '类型',
315
+        //   name: 'contentType',
316
+        //   type: FieldTypes.Select,
317
+        //   hidden: () => !locationTypeNews,
318
+        //   dict: [
319
+        //     {
320
+        //       label: '资讯',
321
+        //       value: 'news',
322
+        //     },
323
+        // ],
324
+        //   value: data.contentType,
325
+        //   rules: [
326
+        //     { required: true, message: '请选择类型' },
327
+        //   ],
328
+        // },
308
         {
329
         {
309
           label: '发布活动',
330
           label: '发布活动',
310
           name: 'targetId',
331
           name: 'targetId',
326
           ],
347
           ],
327
         },
348
         },
328
         {
349
         {
329
-          label: '发布资讯',
350
+          label: '发布公告',
330
           name: 'targetId',
351
           name: 'targetId',
331
-          render: <SelectNews buildingId={() => buildingId} />,
332
-          hidden: () => !newsVisible,
352
+          render: <SelectNotice buildingId={() => buildingId} />,
353
+          hidden: () => !noticeVisible,
333
           value: data.targetId,
354
           value: data.targetId,
334
           rules: [
355
           rules: [
335
-            { required: true, message: '请选择发布资讯' },
356
+            { required: true, message: '请选择发布公告' },
336
           ],
357
           ],
337
         },
358
         },
338
         {
359
         {
339
-          label: '发布内容',
340
-          name: 'content',
341
-          render: <Wangedit />,
342
-          value: data.content,
343
-          hidden: () => !contentVisible,
360
+          label: '发布服务',
361
+          name: 'targetId',
362
+          render: <SelectTpNews buildingId={() => buildingId} />,
363
+          hidden: () => !tpNewsVisible,
364
+          value: data.targetId,
344
           rules: [
365
           rules: [
345
-            { required: true, message: '请输入发布内容' },
366
+            { required: true, message: '请选择发布服务' },
346
           ],
367
           ],
347
         },
368
         },
348
         // {
369
         // {
370
+        //   label: '发布资讯',
371
+        //   name: 'targetId',
372
+        //   render: <SelectNews buildingId={() => buildingId} />,
373
+        //   hidden: () => !newsVisible,
374
+        //   value: data.targetId,
375
+        //   rules: [
376
+        //     { required: true, message: '请选择发布资讯' },
377
+        //   ],
378
+        // },
379
+        // {
380
+        //   label: '发布内容',
381
+        //   name: 'content',
382
+        //   render: <Wangedit />,
383
+        //   value: data.content,
384
+        //   hidden: () => !contentVisible,
385
+        //   rules: [
386
+        //     { required: true, message: '请输入发布内容' },
387
+        //   ],
388
+        // },
389
+        // {
349
         //   label: '发布助力',
390
         //   label: '发布助力',
350
         //   name: 'targetId',
391
         //   name: 'targetId',
351
         //   render: <SelectHelp buildingId={() => buildingId} />,
392
         //   render: <SelectHelp buildingId={() => buildingId} />,
409
       ]
450
       ]
410
 
451
 
411
       const handleSubmit = val => {
452
       const handleSubmit = val => {
412
-        console.log(val,"232323")
453
+        // console.log(val,"232323")
413
         val.showType = 'banner'
454
         val.showType = 'banner'
414
-        if(!isHaveActive&&val.targetId) {
415
-          if(!val.contentType){
416
-            val.contentType='h5'
417
-          }
418
-        }
419
-        if(!isHaveActive&&!val.targetId){
420
-          val.contentType=''
421
-        }
455
+        // if(!isHaveActive&&val.targetId) {
456
+        //   if(!val.contentType){
457
+        //     val.contentType='h5'
458
+        //   }
459
+        // }
460
+        // if(!isHaveActive&&!val.targetId){
461
+        //   val.contentType=''
462
+        // }
422
         if (contentId) {
463
         if (contentId) {
423
           request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: contentId }, data: val }).then(data => {
464
           request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: contentId }, data: val }).then(data => {
424
             cancelPage()
465
             cancelPage()

+ 187
- 145
src/pages/carouselFigure/propaganda.jsx 查看文件

16
 import SelectGroup from './SelectGroup';
16
 import SelectGroup from './SelectGroup';
17
 import SelectH5 from './SelectH5';
17
 import SelectH5 from './SelectH5';
18
 import SalesBatchGroup from './SalesBatchGroup';
18
 import SalesBatchGroup from './SalesBatchGroup';
19
+import SelectNotice from './SelectNotice';
20
+import SelectTpNews from './SelectTpNews';
19
 import LiveGroup from './LiveGroup';
21
 import LiveGroup from './LiveGroup';
20
 /**
22
 /**
21
  *
23
  *
32
   let salesBatchVisible = false
34
   let salesBatchVisible = false
33
   let liveVisible = false
35
   let liveVisible = false
34
   let h5Visible = false
36
   let h5Visible = false
37
+  let noticeVisible = false
38
+  let tpNewsVisible = false
35
   let buildingId = ''
39
   let buildingId = ''
36
   let cityId = ''
40
   let cityId = ''
37
   let isHaveActive=false
41
   let isHaveActive=false
54
     salesBatchVisible = data.contentType === 'salesBatch';
58
     salesBatchVisible = data.contentType === 'salesBatch';
55
     liveVisible = data.contentType === 'live';
59
     liveVisible = data.contentType === 'live';
56
     h5Visible = data.contentType === 'h5';
60
     h5Visible = data.contentType === 'h5';
61
+    noticeVisible = data.contentType === 'notice';
62
+    tpNewsVisible = data.contentType === 'tpNews';
57
     cityId=data.cityId
63
     cityId=data.cityId
58
     buildingId = data.buildingId
64
     buildingId = data.buildingId
59
   }
65
   }
60
 
66
 
61
   const setExtraData1 = (data) => {
67
   const setExtraData1 = (data) => {
62
-    console.log(data.buildingId,"data.buildingIddata.buildingId3")
63
-    if(data.contentType=='h5'||data.contentType==''||data.contentType=='nothing' || (data.contentType=='live' && data.buildingId == null)){
64
-       isHaveActive=false
65
-    }else{
66
-       isHaveActive=true
67
-    }
68
+    // console.log(data.buildingId,"data.buildingIddata.buildingId3")
69
+    // if(data.contentType=='h5'||data.contentType==''||data.contentType=='nothing' || (data.contentType=='live' && data.buildingId == null)){
70
+    //    isHaveActive=false
71
+    // }else{
72
+    //    isHaveActive=true
73
+    // }
68
 
74
 
69
     contentVisible = data.contentType === 'other';
75
     contentVisible = data.contentType === 'other';
70
     activityVisible = data.contentType === 'activity';
76
     activityVisible = data.contentType === 'activity';
74
     salesBatchVisible = data.contentType === 'salesBatch';
80
     salesBatchVisible = data.contentType === 'salesBatch';
75
     liveVisible = data.contentType === 'live';
81
     liveVisible = data.contentType === 'live';
76
     h5Visible = data.contentType === 'h5';
82
     h5Visible = data.contentType === 'h5';
83
+    noticeVisible = data.contentType === 'notice';
84
+    tpNewsVisible = data.contentType === 'tpNews';
77
     buildingId = data.buildingId
85
     buildingId = data.buildingId
78
   }
86
   }
79
 
87
 
112
     }
120
     }
113
 
121
 
114
     const fields = [
122
     const fields = [
115
-      {
116
-        label: '是否关联项目',
117
-        name: 'isHaveActive',
118
-        type: FieldTypes.Switch,
119
-        value:isHaveActive,
120
-        hidden: () => !isCanChoose,
121
-        rules: [
122
-          { required: true,message: '是否城市活动' },
123
-        ],
124
-      },
125
-      {
126
-        label: '所属项目',
127
-        name: 'buildingId',
128
-        render: <BuildSelect />,
129
-        value: data.buildingId,
130
-        hidden: () => !isHaveActive,
131
-        rules: [
132
-          { required: true, message: '请选择所属项目' },
133
-        ],
134
-      },
135
-      {
136
-        label: '所属城市',
137
-        name: 'cityId',
138
-        render: <CitySelect />,
139
-        hidden: () => isHaveActive,
140
-        value: data.cityId,
141
-        rules: [
142
-          { required: true, message: '请选择展示城市' },
143
-        ],
144
-      },
123
+      // {
124
+      //   label: '是否关联项目',
125
+      //   name: 'isHaveActive',
126
+      //   type: FieldTypes.Switch,
127
+      //   value:isHaveActive,
128
+      //   hidden: () => !isCanChoose,
129
+      //   rules: [
130
+      //     { required: true,message: '是否城市活动' },
131
+      //   ],
132
+      // },
133
+      // {
134
+      //   label: '所属项目',
135
+      //   name: 'buildingId',
136
+      //   render: <BuildSelect />,
137
+      //   value: data.buildingId,
138
+      //   hidden: () => !isHaveActive,
139
+      //   rules: [
140
+      //     { required: true, message: '请选择所属项目' },
141
+      //   ],
142
+      // },
143
+      // {
144
+      //   label: '所属城市',
145
+      //   name: 'cityId',
146
+      //   render: <CitySelect />,
147
+      //   hidden: () => isHaveActive,
148
+      //   value: data.cityId,
149
+      //   rules: [
150
+      //     { required: true, message: '请选择展示城市' },
151
+      //   ],
152
+      // },
145
       {
153
       {
146
         label: '主图',
154
         label: '主图',
147
         name: 'image',
155
         name: 'image',
148
         type: FieldTypes.ImageUploader,
156
         type: FieldTypes.ImageUploader,
149
         value: data.image,
157
         value: data.image,
150
-        help: '建议图片尺寸:750*188px,比例4:1,格式:jpg,用于:首页宣传位',
158
+        help: '建议图片尺寸:690*230px,比例3:1,格式:jpg,用于:首页宣传位',
151
         rules: [
159
         rules: [
152
           { required: true, message: '请上传图片' },
160
           { required: true, message: '请上传图片' },
153
         ],
161
         ],
154
       },
162
       },
163
+      // {
164
+      //   label: '类型',
165
+      //   name: 'contentType',
166
+      //   type: FieldTypes.Select,
167
+      //   hidden: () => isHaveActive,
168
+      //   dict: [{
169
+      //     label: 'h5',
170
+      //     value: 'h5',
171
+      //   },
172
+      //   {
173
+      //     label: '直播活动详情',
174
+      //     value: 'live',
175
+      //   }],
176
+      //   value: data.contentType,
177
+      //   rules: [
178
+      //     { required: true, message: '请选择类型' },
179
+      //   ],
180
+      // },
181
+      // {
182
+      //   label: '标题',
183
+      //   name: 'title',
184
+      //   type: FieldTypes.Text,
185
+      //   hidden: true,
186
+      //   value: data.title,
187
+      //   rules: [
188
+      //     { required: true, message: '请输入标题' },
189
+      //   ],
190
+      // },
155
       {
191
       {
156
         label: '类型',
192
         label: '类型',
157
         name: 'contentType',
193
         name: 'contentType',
194
+        // hidden: () => !isHaveActive,
158
         type: FieldTypes.Select,
195
         type: FieldTypes.Select,
159
-        hidden: () => isHaveActive,
160
-        dict: [{
161
-          label: 'h5',
162
-          value: 'h5',
163
-        },
164
-        {
165
-          label: '直播活动详情',
166
-          value: 'live',
167
-        }],
168
-        value: data.contentType,
169
-        rules: [
170
-          { required: true, message: '请选择类型' },
171
-        ],
172
-      },
173
-      {
174
-        label: '标题',
175
-        name: 'title',
176
-        type: FieldTypes.Text,
177
-        hidden: true,
178
-        value: data.title,
179
-        rules: [
180
-          { required: true, message: '请输入标题' },
196
+        dict: [
197
+          {
198
+            label: '公告',
199
+            value: 'notice'
200
+          },
201
+          {
202
+            label: '服务',
203
+            value: 'tpNews'
204
+          },
205
+          {
206
+            label: '活动',
207
+            value: 'activity'
208
+          },
209
+          // {
210
+          //   label: '项目',
211
+          //   value: 'project'
212
+          // },
213
+          {
214
+            label: '资讯',
215
+            value: 'news'
216
+          },
217
+          {
218
+            label: '无',
219
+            value: 'nothing'
220
+          },
221
+          // {
222
+          //   label: '拼团',
223
+          //   value: 'group'
224
+          // },
225
+          // {
226
+          //   label: '助力',
227
+          //   value: 'help'
228
+          // },
229
+          // {
230
+          //   label: 'h5',
231
+          //   value: 'h5',
232
+          // },
233
+          // {
234
+          //   label: '销售批次详情',
235
+          //   value: 'salesBatch',
236
+          // },
237
+          // {
238
+          //   label: '直播活动详情',
239
+          //   value: 'live',
240
+          // }
181
         ],
241
         ],
182
-      },
183
-      {
184
-        label: '类型',
185
-        name: 'contentType',
186
-        hidden: () => !isHaveActive,
187
-        type: FieldTypes.Select,
188
-        dict: [{
189
-          label: '常规活动',
190
-          value: 'activity'
191
-        },
192
-        {
193
-          label: '项目',
194
-          value: 'project'
195
-        },
196
-        {
197
-          label: '资讯',
198
-          value: 'news'
199
-        },
200
-        {
201
-          label: '拼团',
202
-          value: 'group'
203
-        },
204
-        {
205
-          label: '助力',
206
-          value: 'help'
207
-        },
208
-        {
209
-          label: 'h5',
210
-          value: 'h5',
211
-        },
212
-        {
213
-          label: '销售批次详情',
214
-          value: 'salesBatch',
215
-        },
216
-        {
217
-          label: '直播活动详情',
218
-          value: 'live',
219
-        }],
220
         value: data.contentType,
242
         value: data.contentType,
221
         rules: [
243
         rules: [
222
           { required: true, message: '请选择类型' },
244
           { required: true, message: '请选择类型' },
243
         ],
265
         ],
244
       },
266
       },
245
       {
267
       {
246
-        label: '发布内容',
247
-        name: 'content',
248
-        render: <Wangedit />,
249
-        value: data.content,
250
-        hidden: () => !contentVisible,
251
-        rules: [
252
-          { required: true, message: '请选择发布内容' },
253
-        ],
254
-      },
255
-      {
256
-        label: '发布助力',
257
-        name: 'targetId',
258
-        render: <SelectHelp buildingId={() => buildingId} />,
259
-        hidden: () => !helpVisible,
260
-        value: data.targetId,
261
-        rules: [
262
-          { required: true, message: '请选择发布助力' },
263
-        ],
264
-      },
265
-      {
266
-        label: '是否发布H5',
267
-        name: 'targetId',
268
-        render: <SelectH5 buildingId={() => buildingId}/>,
269
-        hidden: () => !h5Visible,
270
-        value: data.targetId,
271
-        rules: [
272
-          { required: false, message: '请选择发布H5' },
273
-        ],
274
-      },
275
-      {
276
-        label: '发布拼团',
277
-        name: 'targetId',
278
-        render: <SelectGroup buildingId={() => buildingId} />,
279
-        hidden: () => !groupVisible,
280
-        value: data.targetId,
281
-        rules: [
282
-          { required: true, message: '请选择发布拼团' },
283
-        ],
284
-      },
285
-      {
286
-        label: '发布销售批次',
268
+        label: '发布公告',
287
         name: 'targetId',
269
         name: 'targetId',
288
-        render: <SalesBatchGroup buildingId={() => buildingId} />,
289
-        hidden: () => !salesBatchVisible,
270
+        render: <SelectNotice buildingId={() => buildingId} />,
271
+        hidden: () => !noticeVisible,
290
         value: data.targetId,
272
         value: data.targetId,
291
         rules: [
273
         rules: [
292
-          { required: true, message: '请选择发布销售批次' },
274
+          { required: true, message: '请选择发布公告' },
293
         ],
275
         ],
294
       },
276
       },
295
       {
277
       {
296
-        label: '发布直播活动',
278
+        label: '发布服务',
297
         name: 'targetId',
279
         name: 'targetId',
298
-        render: <LiveGroup buildingId={() => buildingId} />,
299
-        hidden: () => !liveVisible,
280
+        render: <SelectTpNews buildingId={() => buildingId} />,
281
+        hidden: () => !tpNewsVisible,
300
         value: data.targetId,
282
         value: data.targetId,
301
         rules: [
283
         rules: [
302
-          { required: true, message: '请选择发布直播活动' },
284
+          { required: true, message: '请选择发布服务' },
303
         ],
285
         ],
304
       },
286
       },
287
+      // {
288
+      //   label: '发布内容',
289
+      //   name: 'content',
290
+      //   render: <Wangedit />,
291
+      //   value: data.content,
292
+      //   hidden: () => !contentVisible,
293
+      //   rules: [
294
+      //     { required: true, message: '请选择发布内容' },
295
+      //   ],
296
+      // },
297
+      // {
298
+      //   label: '发布助力',
299
+      //   name: 'targetId',
300
+      //   render: <SelectHelp buildingId={() => buildingId} />,
301
+      //   hidden: () => !helpVisible,
302
+      //   value: data.targetId,
303
+      //   rules: [
304
+      //     { required: true, message: '请选择发布助力' },
305
+      //   ],
306
+      // },
307
+      // {
308
+      //   label: '是否发布H5',
309
+      //   name: 'targetId',
310
+      //   render: <SelectH5 buildingId={() => buildingId}/>,
311
+      //   hidden: () => !h5Visible,
312
+      //   value: data.targetId,
313
+      //   rules: [
314
+      //     { required: false, message: '请选择发布H5' },
315
+      //   ],
316
+      // },
317
+      // {
318
+      //   label: '发布拼团',
319
+      //   name: 'targetId',
320
+      //   render: <SelectGroup buildingId={() => buildingId} />,
321
+      //   hidden: () => !groupVisible,
322
+      //   value: data.targetId,
323
+      //   rules: [
324
+      //     { required: true, message: '请选择发布拼团' },
325
+      //   ],
326
+      // },
327
+      // {
328
+      //   label: '发布销售批次',
329
+      //   name: 'targetId',
330
+      //   render: <SalesBatchGroup buildingId={() => buildingId} />,
331
+      //   hidden: () => !salesBatchVisible,
332
+      //   value: data.targetId,
333
+      //   rules: [
334
+      //     { required: true, message: '请选择发布销售批次' },
335
+      //   ],
336
+      // },
337
+      // {
338
+      //   label: '发布直播活动',
339
+      //   name: 'targetId',
340
+      //   render: <LiveGroup buildingId={() => buildingId} />,
341
+      //   hidden: () => !liveVisible,
342
+      //   value: data.targetId,
343
+      //   rules: [
344
+      //     { required: true, message: '请选择发布直播活动' },
345
+      //   ],
346
+      // },
305
       {
347
       {
306
         label: '状态',
348
         label: '状态',
307
         name: 'status',
349
         name: 'status',

+ 28
- 20
src/pages/carouselFigure/propagandaList.jsx 查看文件

15
 const { Option } = Select;
15
 const { Option } = Select;
16
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
16
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
 
17
 
18
+const ContentTypeDict = {
19
+  'notice': '公告',
20
+  'tpNews': '服务',
21
+  'activity': '活动',
22
+  'news': '资讯'
23
+}
24
+
18
 const header = (props) => {
25
 const header = (props) => {
19
   const [data, setData] = useState({})
26
   const [data, setData] = useState({})
20
   //   const [page, changePage] = useState({})
27
   //   const [page, changePage] = useState({})
50
       align: 'center',
57
       align: 'center',
51
       render: (image,row) => <Navigate onClick={toEdit(row.contentId)} ><img src={image} className={styles.propaganda} /></Navigate>,
58
       render: (image,row) => <Navigate onClick={toEdit(row.contentId)} ><img src={image} className={styles.propaganda} /></Navigate>,
52
     },
59
     },
53
-    {
54
-      title: '发布城市',
55
-      dataIndex: 'cityName',
56
-      key: 'cityName',
57
-      align: 'center',
58
-    },
59
-    {
60
-      title: '关联项目',
61
-      dataIndex: 'buildingName',
62
-      key: 'buildingName',
63
-      align: 'center',
64
-      render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
65
-    },
60
+    // {
61
+    //   title: '发布城市',
62
+    //   dataIndex: 'cityName',
63
+    //   key: 'cityName',
64
+    //   align: 'center',
65
+    // },
66
+    // {
67
+    //   title: '关联项目',
68
+    //   dataIndex: 'buildingName',
69
+    //   key: 'buildingName',
70
+    //   align: 'center',
71
+    //   render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
72
+    // },
66
     {
73
     {
67
       title: '关联内容类型',
74
       title: '关联内容类型',
68
       dataIndex: 'contentType',
75
       dataIndex: 'contentType',
69
       key: 'contentType',
76
       key: 'contentType',
70
       align: 'center',
77
       align: 'center',
71
-      render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
72
-        contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无'}</span>
78
+      render: x => ContentTypeDict[x] || '无'
73
     },
79
     },
74
     // {
80
     // {
75
     //   title: '发布位置',
81
     //   title: '发布位置',
219
 
225
 
220
     <>
226
     <>
221
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
227
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
222
-        <Form.Item>
228
+        {/* <Form.Item>
223
           {getFieldDecorator('cityId')(
229
           {getFieldDecorator('cityId')(
224
             <SelectCity />,
230
             <SelectCity />,
225
           )}
231
           )}
228
           {getFieldDecorator('buildingId')(
234
           {getFieldDecorator('buildingId')(
229
             <BuildSelect />,
235
             <BuildSelect />,
230
           )}
236
           )}
231
-        </Form.Item>
237
+        </Form.Item> */}
232
         <Form.Item>
238
         <Form.Item>
233
           {getFieldDecorator('contentType')(
239
           {getFieldDecorator('contentType')(
234
             <Select style={{ width: '180px' }} placeholder="类型">
240
             <Select style={{ width: '180px' }} placeholder="类型">
241
+              <Option value="notice">公告</Option>
242
+              <Option value="tpNews">服务</Option>
235
               <Option value="activity">活动</Option>
243
               <Option value="activity">活动</Option>
236
-              <Option value="project">项目</Option>
244
+              {/* <Option value="project">项目</Option> */}
237
               <Option value="news">资讯</Option>
245
               <Option value="news">资讯</Option>
238
-              <Option value="help">助力</Option>
246
+              {/* <Option value="help">助力</Option>
239
               <Option value="group">拼团</Option>
247
               <Option value="group">拼团</Option>
240
-              <Option value="h5">H5</Option>
248
+              <Option value="h5">H5</Option> */}
241
               <Option value="nothing">无</Option>
249
               <Option value="nothing">无</Option>
242
             </Select>,
250
             </Select>,
243
           )}
251
           )}

+ 28
- 4
src/pages/property/ticket/Detail.jsx 查看文件

1
 import React, { useEffect, useState } from 'react'
1
 import React, { useEffect, useState } from 'react'
2
-import { PageHeader, Descriptions, List, Steps, Row, Col, Rate, Button, Statistic, Modal } from 'antd'
2
+import { PageHeader, Descriptions, List, Steps, Row, Col, Rate, Button, Statistic, Modal, Typography, notification } from 'antd'
3
 import { fetch, fetchList, apis } from '@/utils/request'
3
 import { fetch, fetchList, apis } from '@/utils/request'
4
 import router from 'umi/router'
4
 import router from 'umi/router'
5
 import Prompt from '@/components/Prompt'
5
 import Prompt from '@/components/Prompt'
6
 import Title from './components/Title'
6
 import Title from './components/Title'
7
 import Dispatch from './components/Dispatch'
7
 import Dispatch from './components/Dispatch'
8
+import Price from './components/Price'
8
 
9
 
9
 const TicketTypeDict = {
10
 const TicketTypeDict = {
10
   '0': '投诉',
11
   '0': '投诉',
31
 const getTicketDetail = fetch(apis.ticket.ticketEdit)
32
 const getTicketDetail = fetch(apis.ticket.ticketEdit)
32
 const addDispatch = fetch(apis.ticket.addRecord)
33
 const addDispatch = fetch(apis.ticket.addRecord)
33
 const rejectTicket = fetch(apis.ticket.updateTicketStatus)
34
 const rejectTicket = fetch(apis.ticket.updateTicketStatus)
35
+const updateTicketPrice = fetch(apis.ticket.updateTicketPrice)
34
 
36
 
35
 export default props => {
37
 export default props => {
36
   const [loading, setLoading] = useState(false)
38
   const [loading, setLoading] = useState(false)
67
     })
69
     })
68
   }
70
   }
69
 
71
 
72
+  const handleChangePrice = vals => {
73
+    if (!vals.priceExplain || vals.price === undefined) {
74
+      notification.warn({ message: '请正确填写说明及金额' })
75
+      return
76
+    }
77
+
78
+    const price = Math.floor(vals.price * 100)
79
+    updateTicketPrice({data: {id, price, priceExplain: vals.priceExplain}}).then(res => {
80
+      Modal.success({
81
+        content: '设置费用成功',
82
+        onOk: () => window.location.reload()
83
+      })
84
+    })
85
+  }
86
+
70
   useEffect(() => {
87
   useEffect(() => {
71
     getTicketDetail({data: {id}}).then(res => {
88
     getTicketDetail({data: {id}}).then(res => {
72
       const { recordList } = res || {}
89
       const { recordList } = res || {}
97
           </div>
114
           </div>
98
           <div style={{minWidth: '150px'}}>
115
           <div style={{minWidth: '150px'}}>
99
             {
116
             {
100
-              !ticketData.billInvoiceId || !ticketData.isPay ?
117
+              !ticketData.billInvoiceId ?
101
                 <Button onClick={() => setShowPrompt(true)}>设置费用</Button> :
118
                 <Button onClick={() => setShowPrompt(true)}>设置费用</Button> :
102
-                <Statistic title={<b>费用</b>} prefix="¥" value={ticketData.price || 0} precision={2} />
119
+                <Statistic
120
+                  title={<Typography.Text ellipsis>{ticketData.priceExplain || '费用'}</Typography.Text>}
121
+                  prefix="¥"
122
+                  value={ticketData.price ? (ticketData.price / 100) : 0}
123
+                  precision={2}
124
+                />
103
             }
125
             }
104
-            <Prompt visible={showPrompt} onCancel={() => setShowPrompt(false)} placeholder="请填写金额比如: 100.00"></Prompt>
105
           </div>
126
           </div>
106
         </div>
127
         </div>
107
         {
128
         {
172
         </Steps>
193
         </Steps>
173
       </div>
194
       </div>
174
 
195
 
196
+      {/* 设置缴费金额 */}
197
+      <Price visible={showPrompt} onSubmit={handleChangePrice} onCancel={() => setShowPrompt(false)} />
198
+
175
       {/* 工单分配 */}
199
       {/* 工单分配 */}
176
       <Dispatch visible={showDispatch} userList={ticketData.tpUsersList} onSubmit={handleDispatchTicket} onCancel={() => setShowDispatch(false)} />
200
       <Dispatch visible={showDispatch} userList={ticketData.tpUsersList} onSubmit={handleDispatchTicket} onCancel={() => setShowDispatch(false)} />
177
       {/* 拒绝原因 */}
201
       {/* 拒绝原因 */}

+ 35
- 0
src/pages/property/ticket/components/Price.jsx 查看文件

1
+import React, { useEffect, useState } from 'react'
2
+import { Form, Modal, Button, Input, InputNumber } from 'antd'
3
+
4
+export default Form.create()(props => {
5
+
6
+  const handleSubmit = e => {
7
+    e.preventDefault()
8
+    props.form.validateFields((err, values) => {
9
+      if (!err) {
10
+        props.onSubmit(values)
11
+      }
12
+    })
13
+  }
14
+
15
+  return (
16
+    <Modal  footer={null} maskClosable={false} onCancel={props.onCancel} visible={props.visible}>
17
+      <Form onSubmit={handleSubmit}>
18
+        <Form.Item label="收费说明" required>
19
+          {
20
+            props.form.getFieldDecorator('priceExplain')(<Input placeholder="简要描述即可" />)
21
+          }
22
+        </Form.Item>
23
+        <Form.Item label="收费金额" required>
24
+          {
25
+            props.form.getFieldDecorator('price')(<InputNumber prefix="¥" placeholder="请填写金额比如: 100.00" min={0} style={{width: '100%'}} />)
26
+          }
27
+        </Form.Item>
28
+        <Form.Item>
29
+          <Button type="primary" htmlType="submit">确定</Button>
30
+          <Button onClick={props.onCancel} style={{ marginLeft: '48px' }}>取消</Button>
31
+        </Form.Item>
32
+      </Form>
33
+    </Modal>
34
+  )
35
+})

+ 7
- 1
src/services/ticket_api.js 查看文件

35
       url: `${prefix}/updateTicket`,
35
       url: `${prefix}/updateTicket`,
36
       method: 'post',
36
       method: 'post',
37
       action: 'admin.ticket.update'
37
       action: 'admin.ticket.update'
38
-    }
38
+    },
39
+
40
+    updateTicketPrice: {
41
+      url: `${prefix}/updateTicketPrice`,
42
+      method: 'post',
43
+      action: 'admin.ticket.updatePrice'
44
+    },
39
   }
45
   }
40
 }
46
 }