zhoulisen 5 jaren geleden
bovenliggende
commit
0b24e8baa2

+ 8
- 145
src/pages/activity/drainage/components/Basic.jsx Bestand weergeven

@@ -1,57 +1,34 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Slider, Row, Col, Checkbox, Input, Button, InputNumber, message } from 'antd';
2
+import { Form, Slider, Row, Col, Button, InputNumber, message } from 'antd';
3 3
 import router from 'umi/router';
4 4
 import apis from '../../../../services/apis';
5 5
 import request from '../../../../utils/request';
6 6
 import ImageUploader from './ImageUpload';
7 7
 import Styles from './styles.less';
8
-import Navigate from '@/components/Navigate';
9 8
 import BuildSelect from '../../../../components/SelectButton/BuildSelect2'
9
+import CheckboxGroup from './CheckboxGroup';
10 10
 
11 11
 function Basic(props) {
12 12
 
13 13
     const { id, name } = props
14 14
 
15
-    const [registrationInputValue, setRegistrationInputValue] = useState()
16
-
17
-    const [viewProperty, setViewProperty] = useState(['index'])
18
-    const [productionPoster, setProductionPoster] = useState(['index'])
19
-    // const [registrationForm, setRegistrationForm] = useState([])
20
-    const [inputVisible, setInputVisible] = useState(false)
21
-    // const [registrationFormOption, setregistrationFormOption] = useState([
22
-    //     { label: '姓名', value: 'name' },
23
-    //     { label: '电话', value: 'tel' },
24
-    //     { label: '自定义', value: 'abc' },
25
-    // ])
26
-
27 15
     const [data, setData] = useState({})
28 16
     useEffect(() => {
29 17
         getList();
30
-        console.log(props.id, '2341')
31 18
     }, [])
32 19
     // 查询列表
33 20
 
34 21
     const getList = () => {
35 22
         request({ ...apis.redPacket.detail, urlData: { id } }).then(data => {
36
-            console.log(data, '2341')
37
-            // s.split("==");
38
-            data.buildingShowPos = data.buildingShowPos.split(',')
39
-
40
-            data.buildingSposterShowPoshowPos = (data.posterShowPos).split(',')
41
-            setViewProperty(data.buildingShowPos)
42
-            setProductionPoster(data.posterShowPos)
43
-            console.log(data, '2341')
44 23
             setData(data)
45 24
         })
46 25
     }
47 26
 
48 27
     const updateRedPacket = data => {
49
-        console.log('123123')
50 28
         request({ ...apis.redPacket.update, data: { ...data } }).then(data => {
51 29
             // setData(data)
52
-            console.log('123123')
53 30
             message.success('操作成功')
54
-        }).catch((e) => {
31
+        }).catch(() => {
55 32
             message.error('操作失败')
56 33
         })
57 34
     }
@@ -61,57 +38,13 @@ function Basic(props) {
61 38
         e.preventDefault();
62 39
         props.form.validateFields((err, values) => {
63 40
             if (!err) {
64
-                console.log(values, '------222-------')
65 41
                 values.activityId = id
66
-                // values.name = name
67
-                values.buildingShowPos = values.buildingShowPos.toString()
68
-                values.posterShowPos = values.posterShowPos.toString()
69
-                console.log(values, '------222-------')
70 42
                 updateRedPacket(values)
71 43
             }
72 44
         },
73 45
         )
74 46
     }
75 47
 
76
-    function onViewPropertyChange(checkedValues) {
77
-        console.log('checked = ', checkedValues);
78
-        setViewProperty(checkedValues)
79
-    }
80
-
81
-    function onProductionPoster(checkedValues) {
82
-        console.log('checked = ', checkedValues);
83
-        setProductionPoster(checkedValues)
84
-    }
85
-
86
-    function onRegistrationForm(checkedValues) {
87
-        console.log('checked = ', checkedValues);
88
-        setRegistrationForm(checkedValues)
89
-    }
90
-    // registrationForm
91
-    // function  (value, list) {
92
-    //     return list.filter(f => f == value)
93
-    // }
94
-    function showInput() {
95
-        setInputVisible(!inputVisible)
96
-    }
97
-
98
-    const handleInputChange = e => {
99
-        setRegistrationInputValue(e.target.value)
100
-        // this.setState({ inputValue: e.target.value });
101
-
102
-    };
103
-
104
-    // const handleInputConfirm = () => {
105
-    //     setregistrationFormOption([
106
-    //         { label: '姓名', value: 'name' },
107
-    //         { label: '电话', value: 'tel' },
108
-    //         { label: registrationInputValue, value: 'abc' },
109
-    //     ])
110
-
111
-
112
-    //     setInputVisible(!inputVisible)
113
-    // }
114
-
115 48
     const { getFieldDecorator } = props.form
116 49
 
117 50
     return (
@@ -174,24 +107,19 @@ function Basic(props) {
174 107
                                     <Slider
175 108
                                         min={5}
176 109
                                         max={100}
177
-                                        // value={typeof inputValue === 'number' ? inputValue : 0}
178 110
                                         step={1}
179
-                                    // width="100px"
180
-                                    // style={{ width: '100px' }}
181 111
                                     />,
182 112
                                 )}
183 113
                         </Col>
184 114
                         <Col span={6}>
185 115
                             {getFieldDecorator('topLimitPersons',
186 116
                                 {
187
-                                    // initialValue: data.topLimitPersons,
188 117
                                 })(
189 118
                                     <InputNumber
190 119
                                         min={5}
191 120
                                         max={100}
192 121
                                         style={{ marginLeft: 16 }}
193
-                                    // value={inputValue}
194
-                                    // onChange={this.onChange}
122
+
195 123
                                     />,
196 124
                                 )}
197 125
                         </Col>
@@ -200,23 +128,8 @@ function Basic(props) {
200 128
                 <Form.Item label="查看楼盘按钮">
201 129
                     {getFieldDecorator('buildingShowPos',
202 130
                         {
203
-                            initialValue: viewProperty,
204
-                        })(
205
-                            // <Checkbox.Group options={ViewProperty} defaultValue={['Apple']} onChange={onChange} />,style={viewProperty.indexOf('home') == -1 ? {} : { color: '#EF273A' }}
206
-                            <Checkbox.Group name={Styles.Checkboxs} onChange={onViewPropertyChange} style={{ width: '100%' }}>
207
-                                <Row>
208
-                                    <Col span={6}>
209
-                                        <Checkbox className={viewProperty.indexOf('index') === -1 ? {} : Styles.CheckboxStytle} value="index" >首页</Checkbox>
210
-                                    </Col>
211
-                                    <Col span={6}>
212
-                                        <Checkbox className={viewProperty.indexOf('help') === -1 ? {} : Styles.CheckboxStytle} value="help">助力页</Checkbox>
213
-                                    </Col>
214
-                                    <Col span={6}>
215
-                                        <Checkbox className={viewProperty.indexOf('rule') === -1 ? {} : Styles.CheckboxStytle} value="rule">活动规则页</Checkbox>
216
-                                    </Col>
217
-                                </Row>
218
-                            </Checkbox.Group>,
219
-                        )}
131
+                            initialValue: data.buildingShowPos || 'index',
132
+                        })(<CheckboxGroup />)}
220 133
                 </Form.Item>
221 134
                 <Form.Item label="关联楼盘">
222 135
                     {getFieldDecorator('buildingId',
@@ -228,62 +141,12 @@ function Basic(props) {
228 141
                 </Form.Item>
229 142
                 <Form.Item label="生成海报按钮">
230 143
                     {getFieldDecorator('posterShowPos', {
231
-                        initialValue: productionPoster,
232
-                    })(
233
-                        <Checkbox.Group name={Styles.Checkboxs} onChange={onProductionPoster} style={{ width: '100%' }}>
234
-                            <Row>
235
-                                <Col span={6}>
236
-                                    <Checkbox className={productionPoster.indexOf('index') === -1 ? {} : Styles.CheckboxStytle} value="index" >首页</Checkbox>
237
-                                </Col>
238
-                                <Col span={6}>
239
-                                    <Checkbox className={productionPoster.indexOf('help') === -1 ? {} : Styles.CheckboxStytle} value="help">助力页</Checkbox>
240
-                                </Col>
241
-                                <Col span={6}>
242
-                                    <Checkbox className={productionPoster.indexOf('rule') === -1 ? {} : Styles.CheckboxStytle} value="rule">活动规则页</Checkbox>
243
-                                </Col>
244
-                            </Row>
245
-                        </Checkbox.Group>,
246
-                    )}
144
+                        initialValue: data.posterShowPos || 'index',
145
+                    })(<CheckboxGroup />)}
247 146
                 </Form.Item>
248
-                {/* <Form.Item label="报名表单">
249
-                    {getFieldDecorator('registrationForm')(
250
-                        <Checkbox.Group name={Styles.Checkboxs} onChange={onRegistrationForm} style={{ width: '100%' }}>
251
-                            <Row>
252
-                                {registrationFormOption.map((x, index) => {
253
-                                    return <Col span={6}>
254
-                                        {index !== 2 && (<Checkbox className={registrationForm.indexOf(x.value) === -1 ? {} : Styles.CheckboxStytle} value={x.value} >{x.label} </Checkbox>)}
255
-
256
-                                        {inputVisible && index === 2 && (
257
-                                            <Input
258
-                                                // ref={this.saveInputRef}
259
-                                                type="text"
260
-                                                size="small"
261
-                                                style={{ width: 78 }}
262
-                                                // value={inputValue}
263
-                                                onChange={handleInputChange}
264
-                                                onBlur={handleInputConfirm}
265
-                                                onPressEnter={handleInputConfirm}
266
-                                            />
267
-                                        )}
268
-                                        {!inputVisible && index === 2 && (
269
-                                            <Checkbox className={registrationForm.indexOf(x.value) === -1 ? {} : Styles.CheckboxStytle} value={x.value} >{x.label} </Checkbox>
270
-                                        )}
271
-                                        {!inputVisible && index === 2 && x.label === '自定义' && (
272
-                                            <Navigate onClick={showInput} >
273
-                                                修改
274
-                                            </Navigate>
275
-                                        )}
276
-                                    </Col>
277
-                                })}
278
-                            </Row>
279
-                          
280
-                        </Checkbox.Group>,
281
-                    )}
282
-                </Form.Item> */}
283 147
                 <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
284 148
                     <div style={{ width: '190px' }}>
285 149
                         <Button type="primary" style={{ marginRight: '20px' }} htmlType="submit">保存</Button>
286
-                        {/* <Button onClick={() => router.go(-1)} >取消</Button> */}
287 150
                     </div>
288 151
                 </Form.Item>
289 152
             </Form>

+ 46
- 0
src/pages/activity/drainage/components/CheckboxGroup.jsx Bestand weergeven

@@ -0,0 +1,46 @@
1
+import React from 'react'
2
+import { Checkbox, Row, Col } from 'antd'
3
+import classNames from 'classnames'
4
+
5
+import Styles from './styles.less';
6
+
7
+const DataDict = [
8
+    {
9
+        label: '首页',
10
+        value: 'index',
11
+    },
12
+    {
13
+        label: '助力页',
14
+        value: 'help',
15
+    },
16
+    {
17
+        label: '活动规则页',
18
+        value: 'rule',
19
+    },
20
+]
21
+
22
+export default props => {
23
+    const { value, onChange } = props;
24
+    const vals = (value || '').split(',');
25
+    const handleChange = e => {
26
+        onChange(e.join(','));
27
+    }
28
+
29
+    return (
30
+        <Checkbox.Group className={Styles.Checkboxs} onChange={handleChange} style={{ width: '100%' }} value={vals}>
31
+            <Row>
32
+                {
33
+                    DataDict.map(item => {
34
+                        const key = item.value;
35
+                        return (
36
+                            <Col span={6} key={key}>
37
+                                <Checkbox className={classNames({ [Styles.CheckboxStytle]: vals.indexOf(item.value) > -1 })} value={item.value} >{item.label}</Checkbox>
38
+                            </Col>
39
+                        );
40
+                    })
41
+                }
42
+            </Row>
43
+        </Checkbox.Group>
44
+    );
45
+
46
+}

+ 4
- 4
src/pages/activity/drainage/components/CustomerData.jsx Bestand weergeven

@@ -69,8 +69,8 @@ function CustomerData(props) {
69 69
         },
70 70
         {
71 71
             title: '昵称',
72
-            dataIndex: 'nickName',
73
-            key: 'nickName',
72
+            dataIndex: 'nickname',
73
+            key: 'nickname',
74 74
             align: 'center',
75 75
         },
76 76
         {
@@ -94,8 +94,8 @@ function CustomerData(props) {
94 94
         },
95 95
         {
96 96
             title: '分享人昵称',
97
-            dataIndex: 'sharePersonNickName',
98
-            key: 'sharePersonNickName',
97
+            dataIndex: 'sharePersonName',
98
+            key: 'sharePersonName',
99 99
             align: 'center',
100 100
         },
101 101
         {

+ 32
- 11
src/pages/activity/drainage/components/RedPacket.jsx Bestand weergeven

@@ -89,11 +89,11 @@ function RedPacket(props) {
89 89
                 <Form.Item label="本次红包预算/元">
90 90
                     {getFieldDecorator('budget', {
91 91
                         initialValue: data.budget / 100,
92
-                        // rules: [
93
-                        //     {
94
-                        //         type: 'number', message: '123'
95
-                        //     }
96
-                        // ],
92
+                        rules: [
93
+
94
+                            { required: true, message: '请设置本次红包预算' },
95
+
96
+                        ],
97 97
                     },
98 98
                     )(
99 99
                         <Input type="number" min={0} max={99999} />,
@@ -102,11 +102,17 @@ function RedPacket(props) {
102 102
                 <Form.Item label="单个红包金额范围/元">
103 103
                     {getFieldDecorator('minPacket', {
104 104
                         initialValue: data.minPacket / 100 || 3,
105
+                        rules: [
106
+                            { required: true, message: '请设置最小红包值' },
107
+                        ],
105 108
                     })(
106 109
                         <InputNumber min={1} max={199} />,
107 110
                     )}~
108 111
                      {getFieldDecorator('maxPacket', {
109 112
                         initialValue: data.maxPacket / 100 || 3,
113
+                        rules: [
114
+                            { required: true, message: '请设置最大红包值' },
115
+                        ],
110 116
                     })(
111 117
                         <InputNumber min={1} max={199} />,
112 118
                     )}
@@ -114,17 +120,23 @@ function RedPacket(props) {
114 120
                 <Form.Item label="发放红包个数上限">
115 121
                     {getFieldDecorator('limitPacketNum', {
116 122
                         initialValue: data.limitPacketNum === -1 ? 0 : data.limitPacketNum,
123
+                        rules: [
124
+                            { required: true, message: '请设置发放红包个数上限' },
125
+                        ],
117 126
                     })(
118 127
                         <Input type="number" />,
119 128
                     )}
120 129
                 </Form.Item>
121
-                <Form.Item label="余额或预算不足时提示文案">
130
+                {/* <Form.Item label="余额或预算不足时提示文案">
122 131
                     {getFieldDecorator('insufficientBalanceTip', {
123 132
                         initialValue: data.insufficientBalanceTip || '红包已发送完毕,谢谢您的参与',
133
+                        rules: [
134
+                            { required: true, message: '请设置余额或预算不足时提示文案' },
135
+                        ],
124 136
                     })(
125 137
                         <Input placeholder="红包已发送完毕,谢谢您的参与" />,
126 138
                     )}
127
-                </Form.Item>
139
+                </Form.Item> */}
128 140
                 {/* font-size:22px;
129 141
 font-family:PingFangSC-Medium,PingFang SC;
130 142
 font-weight:500;
@@ -132,9 +144,12 @@ color:rgba(102,102,102,1); */}
132 144
                 <Row>
133 145
                     <Col span={8} style={{ textAlign: 'end', fontSize: '0.13rem', fontWeight: '500', color: 'rgba(102,102,102,1)', padding: '0 0.076rem' }}>配置消息</Col>
134 146
                 </Row>
135
-                <Form.Item label="商名称" >
147
+                <Form.Item label="商名称" >
136 148
                     {getFieldDecorator('mchName', {
137 149
                         initialValue: data.mchName,
150
+                        rules: [
151
+                            { required: true, message: '请设置商户名称' },
152
+                        ],
138 153
                     })(
139 154
                         <Input placeholder="{小程序名}" />,
140 155
                     )}
@@ -142,6 +157,9 @@ color:rgba(102,102,102,1); */}
142 157
                 <Form.Item label="红包祝福语">
143 158
                     {getFieldDecorator('blessing', {
144 159
                         initialValue: data.blessing,
160
+                        rules: [
161
+                            { required: true, message: '请设置红包祝福语' },
162
+                        ],
145 163
                     })(
146 164
                         <Input placeholder="祝您中个大红包!" />,
147 165
                     )}
@@ -149,6 +167,9 @@ color:rgba(102,102,102,1); */}
149 167
                 <Form.Item label="活动名称">
150 168
                     {getFieldDecorator('activityName', {
151 169
                         initialValue: data.activityName,
170
+                        rules: [
171
+                            { required: true, message: '请设置活动名称' },
172
+                        ],
152 173
                     })(
153 174
                         <Input placeholder="{活动标题}" />,
154 175
                     )}
@@ -156,13 +177,13 @@ color:rgba(102,102,102,1); */}
156 177
                 <Form.Item label="备注">
157 178
                     {getFieldDecorator('remark', {
158 179
                         initialValue: data.remark,
180
+                        rules: [
181
+                            { required: true, message: '请设置remark' },
182
+                        ],
159 183
                     })(
160 184
                         <Input placeholder="点我拆红包" />,
161 185
                     )}
162 186
                 </Form.Item>
163
-
164
-
165
-
166 187
                 <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
167 188
                     <div style={{ width: '190px' }}>
168 189
                         <Button type="primary" style={{ marginRight: '20px' }} htmlType="submit">保存</Button>

+ 4
- 2
src/pages/funds/accountfunds/components/RefundOrder.jsx Bestand weergeven

@@ -84,7 +84,7 @@ function RechargeOrder(props) {
84 84
             dataIndex: 'amount',
85 85
             key: 'amount',
86 86
             align: 'center',
87
-        render: (x, row) => <><span>{`${row.amount/100}`}</span></>,
87
+            render: (x, row) => <><span>{`${row.amount / 100}`}</span></>,
88 88
         },
89 89
         {
90 90
             title: '退款创建时间',
@@ -98,6 +98,7 @@ function RechargeOrder(props) {
98 98
             dataIndex: 'auditStatus',
99 99
             key: 'auditStatus',
100 100
             align: 'center',
101
+            // width: '20%',
101 102
             render: (x, row) => <><span>{row.auditStatus == 'checking' ? '已申请' : (row.auditStatus == 'agree' ? '已退款' : '已驳回')}</span></>,
102 103
         },
103 104
         {
@@ -105,6 +106,7 @@ function RechargeOrder(props) {
105 106
             dataIndex: 'auditResult',
106 107
             key: 'auditResult',
107 108
             align: 'center',
109
+            width: '20%',
108 110
         },
109 111
 
110 112
         {
@@ -112,7 +114,7 @@ function RechargeOrder(props) {
112 114
             dataIndex: 'certificateUrlList',
113 115
             key: 'certificateUrlList',
114 116
             align: 'center',
115
-            render: (x, row) => <>{`${row.certificateUrlList == null ? '' :<Navigate onClick={() => openImg(x)}>查看</Navigate> }`}</>,
117
+            render: (x, row) => <>{row.certificateUrlList == null ? '' : <Navigate onClick={() => openImg(x)}>查看</Navigate>}</>,
116 118
         },
117 119
         {
118 120
             title: '操作',

+ 1
- 1
src/pages/h5SampleManager/h5Sample/addH5.jsx Bestand weergeven

@@ -182,7 +182,7 @@ const header = props => {
182 182
                         ]
183 183
                     })(<ImageUploader />)}
184 184
                 </Form.Item>
185
-                <Form.Item label="活动分享语">
185
+                <Form.Item label="活动分享语" help="可使用{name}代表用户昵称。">
186 186
                     {getFieldDecorator('shareTitle', {
187 187
                         // initialValue: formsDate.shareTitle,
188 188
                         rules: [