|
@@ -1,6 +1,7 @@
|
1
|
1
|
import React, { useEffect, useState } from 'react'
|
2
|
|
-import { Spin, Card, Form, Select, Input, Button, notification } from 'antd'
|
|
2
|
+import { Spin, Card, Form, Select, InputNumber, Button, notification } from 'antd'
|
3
|
3
|
import Wangedit from '@/components/Wangedit/Wangedit';
|
|
4
|
+import ImageUpload from '@/components/XForm/ImageUpload'
|
4
|
5
|
import { fetch, apis } from '@/utils/request';
|
5
|
6
|
|
6
|
7
|
const FormItem = Form.Item
|
|
@@ -45,7 +46,7 @@ const AgentRule = React.forwardRef((props, ref) => {
|
45
|
46
|
|
46
|
47
|
setLoading(true)
|
47
|
48
|
saveAgentRule({ data: { ...(detail || {}), ...values } }).then(res => {
|
48
|
|
- setDetail(res)
|
|
49
|
+ // setDetail(res)
|
49
|
50
|
setLoading(false)
|
50
|
51
|
notification.success({ message: "操作成功" })
|
51
|
52
|
}).catch(() => {
|
|
@@ -64,10 +65,7 @@ const AgentRule = React.forwardRef((props, ref) => {
|
64
|
65
|
clearTimeout(t)
|
65
|
66
|
setLoading(false)
|
66
|
67
|
setDetail(res)
|
67
|
|
- setFieldsValue({
|
68
|
|
- content: (res || {}).content,
|
69
|
|
- status: (res || {}).status,
|
70
|
|
- })
|
|
68
|
+ setFieldsValue(res || {})
|
71
|
69
|
}, 200)
|
72
|
70
|
}).catch(() => {
|
73
|
71
|
setLoading(false)
|
|
@@ -78,6 +76,26 @@ const AgentRule = React.forwardRef((props, ref) => {
|
78
|
76
|
<Card>
|
79
|
77
|
<Spin spinning={loading}>
|
80
|
78
|
<Form {...formItemLayout} onSubmit={handleSubmit}>
|
|
79
|
+ <FormItem label="海报背景" help="建议图片尺寸:640*960px,比例2:3,格式:jpg">
|
|
80
|
+ {
|
|
81
|
+ getFieldDecorator('poster', {
|
|
82
|
+ rules: [{ required: true, message: '请上传海报背景' }],
|
|
83
|
+ })(<ImageUpload />)
|
|
84
|
+ }
|
|
85
|
+ </FormItem>
|
|
86
|
+ <FormItem label="推荐金额" help="推荐经纪人奖励">
|
|
87
|
+ {
|
|
88
|
+ getFieldDecorator('referralFee')(
|
|
89
|
+ <InputNumber
|
|
90
|
+ defaultValue={0}
|
|
91
|
+ min={0}
|
|
92
|
+ style={{ width: '100%' }}
|
|
93
|
+ formatter={value => `¥ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
|
|
94
|
+ parser={value => value.replace(/\¥\s?|(,*)/g, '')}
|
|
95
|
+ />
|
|
96
|
+ )
|
|
97
|
+ }
|
|
98
|
+ </FormItem>
|
81
|
99
|
<FormItem label="规则详情">
|
82
|
100
|
{
|
83
|
101
|
getFieldDecorator('content')(<Wangedit menus={editorMenus} />)
|