许静 5 anos atrás
pai
commit
72a39c5137

+ 3
- 5
src/components/Wangedit/Wangedit.jsx Ver arquivo

@@ -2,8 +2,6 @@ import React from 'react';
2 2
 import E from 'wangeditor'
3 3
 
4 4
 /**
5
- *
6
- *
7 5
  * @param {*} props
8 6
  * @returns
9 7
  */
@@ -13,14 +11,14 @@ class Wangedit extends React.Component {
13 11
     this.state = {}
14 12
   }
15 13
 
16
-  render () {
14
+  render() {
17 15
     return (
18
-      <div ref="editorElem" style={{textAlign: 'left'}}>
16
+      <div ref="editorElem" style={{ textAlign: 'left' }}>
19 17
       </div>
20 18
     );
21 19
   }
22 20
 
23
-  componentDidMount () {
21
+  componentDidMount() {
24 22
     const elem = this.refs.editorElem
25 23
     const editor = new E(elem)
26 24
     // 使用 onchange 函数监听内容的变化

+ 76
- 15
src/pages/integralMall/editGoods.jsx Ver arquivo

@@ -1,27 +1,88 @@
1
-import React from 'react';
2
-import { Form, Input, Button, Icon, Select } from 'antd';
1
+import React, { useState, useEffect } from 'react';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import styles from '../style/GoodsList.less';
4
+import channels from '../channel/channelList.less';
5
+import router from 'umi/router';
6
+import request from '../../utils/request'
5 7
 
8
+const { TextArea } = Input;
9
+const { Option } = Select;
6 10
 
11
+const header = props => {
7 12
 
8
-/**
9
- *
10
- *
11
- * @param {*} props
12
- * @returns
13
- */
13
+  const [data, setData] = useState({ channelNmae: [], result: [] })
14 14
 
15
+  function goBack(){
16
+    router.push({
17
+      pathname: '/integralMall/GoodsList',
18
+    });
19
+  }
15 20
 
16
-function header(props) {
17
-  const { getFieldDecorator } = props.form
18
-  return (
21
+  function addChannel(params) {
22
+    request({
23
+      url: '/api/admin/channel',
24
+      method: 'POST',
25
+      data: { ...params },
26
+      // eslint-disable-next-line no-shadow
27
+    }).then(data => {
28
+      console.log(data)
29
+      setData(data)
30
+      // eslint-disable-next-line no-unused-expressions
31
+      router.go(-1)
32
+    })
33
+  }
34
+
35
+  function handleSubmit(e) {
36
+    e.preventDefault();
37
+    props.form.validateFields((err, values) => {
38
+      if (!err) {
39
+        console.log('Received values of form: ', values);
40
+        // eslint-disable-next-line max-len
41
+        addChannel({ channelName: values.channelName, channelContact: values.channelContact, contactTel: values.contactTel })
42
+      }
43
+    });
44
+  }
19 45
 
46
+  const { getFieldDecorator } = props.form;
47
+
48
+  return (
20 49
     <>
21
-     <div>编辑商品</div>
50
+      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
51
+        <Form.Item label="商品名称">
52
+          {getFieldDecorator('channelName', {
53
+            rules: [{ message: '请输入商品名称' }],
54
+          })(<Input className={channels.inpuit} />)}
55
+        </Form.Item>
56
+        <Form.Item label="所需积分">
57
+          {getFieldDecorator('channelContact', {
58
+            rules: [{ message: ' 请输入所需积分' }],
59
+          })(<Input className={channels.inpuit} />)}
60
+        </Form.Item>
61
+        <Form.Item label="商品数量">
62
+          {getFieldDecorator('contactTel', {
63
+            rules: [{ message: '请输入商品数量' }],
64
+          })(<Input className={channels.inpuit} />)}
65
+        </Form.Item>
66
+        <Form.Item label="剩余数量">
67
+          {getFieldDecorator('contactTel', {
68
+            rules: [{ message: '请输入剩余数量' }],
69
+          })(<Input className={channels.inpuit} />)}
70
+        </Form.Item>
71
+        <Form.Item label="商品详情">
72
+          <TextArea className={channels.inpuitTxt} rows={8} />
73
+        </Form.Item>
74
+        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
75
+          <Button type="primary" htmlType="submit">
76
+            保存
77
+          </Button>
78
+          <Button className={channels.formButton} onClick={this.goBack} type="primary" htmlType="submit">
79
+            取消
80
+          </Button>
81
+        </Form.Item>
82
+      </Form>
22 83
     </>
23 84
   )
24 85
 }
25
-const WrappedHeader = Form.create({ name: 'header' })(header);
26 86
 
27
-export default WrappedHeader
87
+const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
88
+export default WrappedNormalLoginForm

+ 1
- 1
src/pages/user/login/components/Login/index.jsx Ver arquivo

@@ -118,7 +118,7 @@ class Login extends Component {
118 118
           <div className={styles.con}>
119 119
             <p className={styles.welcome}>Welcome</p>
120 120
             <div className={styles.title}>
121
-              <span style={{fontSize:'18px'}}>ying xiao yun</span>
121
+              <span style={{fontSize:'18px',lineHeight:'18px'}}>ying xiao yun</span>
122 122
               <p className={styles.name}>营销云·系统</p>
123 123
             </div>
124 124
           </div>

+ 5
- 4
src/pages/user/login/components/Login/index.less Ver arquivo

@@ -9,16 +9,17 @@ position: relative;
9 9
     left:50%;
10 10
     top:50%;
11 11
     margin-top: -100px;
12
-    margin-left: -136px;
12
+    margin-left: -150px;
13 13
     text-align: center;
14 14
     height: 200px;
15
-    width: 272px;
15
+    width: 300px;
16 16
     overflow: hidden;
17 17
     .welcome{
18 18
       color: #fff;
19
-      font-size: 60px;
19
+      font-size: 62px;
20 20
       font-style: italic;
21 21
       margin-bottom: 0;
22
+      font-family: initial;
22 23
     }
23 24
     .title{
24 25
       width: 260px;
@@ -29,7 +30,7 @@ position: relative;
29 30
       padding: 14px  20px;
30 31
       margin:  0 auto;
31 32
       .name{
32
-        font-size: 40px;
33
+        font-size: 41px;
33 34
         margin:0; 
34 35
       }
35 36
     }