zhoulisen 5 anos atrás
pai
commit
b0a34fd3c4

+ 12
- 8
src/pages/activity/drainage/components/RedPacket.jsx Ver arquivo

@@ -38,7 +38,11 @@ function RedPacket(props) {
38 38
         e.preventDefault();
39 39
         props.form.validateFields((err, values) => {
40 40
             if (!err) {
41
+                values.budget *= 100
42
+                values.minPacket *= 100
43
+                values.maxPacket *= 100
41 44
                 console.log(values, '------222-------')
45
+                // values
42 46
                 updateRedPacket(values)
43 47
             }
44 48
         },
@@ -62,20 +66,20 @@ function RedPacket(props) {
62 66
             <Row style={{ marginBottom: '40px' }}>
63 67
                 <Col span={8} style={{ paddingRight: '30px' }}>
64 68
                     <div className={Styles.redHeader}>
65
-                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>账户余额/元</span><span className={Styles.redHeaderTopNum}>{data.availableBalance/100}</span></div>
69
+                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>账户余额/元</span><span className={Styles.redHeaderTopNum}>{data.availableBalance / 100 || 0}</span></div>
66 70
                         <div className={Styles.redHeaderBottom}> <Navigate onClick={() => toRecharge()}>去充值</Navigate></div>
67 71
                     </div>
68 72
                 </Col>
69 73
                 <Col span={8} style={{ padding: '0 10px' }}>
70 74
                     <div className={Styles.redHeader}>
71 75
                         {/* packetSendedNum */}
72
-                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包总数量/个</span><span className={Styles.redHeaderTopNum}>{data.sendNum/100}</span></div>
76
+                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包总数量/个</span><span className={Styles.redHeaderTopNum}>{data.sendNum / 100 || 0}</span></div>
73 77
                         <div className={Styles.redHeaderBottom}><Navigate onClick={() => props.toDetail()}>查看详情</Navigate></div>
74 78
                     </div>
75 79
                 </Col>
76 80
                 <Col span={8} style={{ paddingLeft: '30px' }}>
77 81
                     <div className={Styles.redHeader}>
78
-                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包金额/元</span><span className={Styles.redHeaderTopNum}>{data.sendTotalAmount/100}</span></div>
82
+                        <div className={Styles.redHeaderTop}><span className={Styles.redHeaderTopText}>已发送红包金额/元</span><span className={Styles.redHeaderTopNum}>{data.sendTotalAmount / 100 || 0}</span></div>
79 83
                         <div className={Styles.redHeaderBottom}><Navigate onClick={() => props.toDetail(1)}>查看详情</Navigate></div>
80 84
                     </div>
81 85
                 </Col>
@@ -83,7 +87,7 @@ function RedPacket(props) {
83 87
             <Form labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
84 88
                 <Form.Item label="本次红包预算/元">
85 89
                     {getFieldDecorator('budget', {
86
-                        initialValue: data.budget,
90
+                        initialValue: data.budget / 100,
87 91
                         // rules: [
88 92
                         //     {
89 93
                         //         type: 'number', message: '123'
@@ -96,14 +100,14 @@ function RedPacket(props) {
96 100
                 </Form.Item>
97 101
                 <Form.Item label="单个红包金额范围/元">
98 102
                     {getFieldDecorator('minPacket', {
99
-                        initialValue: data.minPacket || 3,
103
+                        initialValue: data.minPacket / 100 || 3,
100 104
                     })(
101
-                        <InputNumber min={1} max={1000} />,
105
+                        <InputNumber min={1} max={199} />,
102 106
                     )}~
103 107
                      {getFieldDecorator('maxPacket', {
104
-                        initialValue: data.maxPacket || 3,
108
+                        initialValue: data.maxPacket / 100 || 3,
105 109
                     })(
106
-                        <InputNumber min={1} max={1000} />,
110
+                        <InputNumber min={1} max={199} />,
107 111
                     )}
108 112
                 </Form.Item>
109 113
                 <Form.Item label="发放红包个数上限">

+ 3
- 3
src/pages/funds/accountfunds/components/Basic.jsx Ver arquivo

@@ -34,7 +34,7 @@ function Basic(props) {
34 34
         console.log(e, '123123')
35 35
         if (e) {
36 36
 
37
-            request({ ...apis.funds.saveOrder, data: { amount: e } }).then(data => {
37
+            request({ ...apis.funds.saveOrder, data: { amount: e * 100 } }).then(data => {
38 38
                 setAmount(data)
39 39
                 showModal('pay')
40 40
             }).catch(err => {
@@ -93,7 +93,7 @@ function Basic(props) {
93 93
             //   buildingId: rowData.buildingId,
94 94
             //   salesBatchId: rowData.salesBatchId,
95 95
         })
96
-        
96
+
97 97
     }
98 98
 
99 99
 
@@ -162,7 +162,7 @@ function Basic(props) {
162 162
             >
163 163
                 {title === '线上充值' && <Recharge value={e => handleOkRecharge(e)}></Recharge>}
164 164
                 {title === '申请退款' && <Refund balance={data.availableBalance / 100 || 0} value={e => handleOkRefund(e)}></Refund>}
165
-                {title === '扫码支付' && visible && <Pay amount={amount} visible={visible} value={e => handleOkRepay(e)}></Pay>}
165
+                {title === '扫码支付' && <Pay amount={amount} visible={visible} value={e => handleOkRepay(e)}></Pay>}
166 166
                 {title === '联系我们' && <Contact></Contact>}
167 167
 
168 168
             </Modal>

+ 17
- 14
src/pages/funds/accountfunds/components/Pay.jsx Ver arquivo

@@ -1,4 +1,4 @@
1
-import React, { useState, useEffect } from 'react';
1
+import React, { useState, useEffect, useMemo } from 'react';
2 2
 import { Button, Input, Row, Col, message } from 'antd';
3 3
 import QRCode from 'qrcode.react';
4 4
 import Styles from './styles.less';
@@ -7,16 +7,10 @@ import request from '../../../../utils/request';
7 7
 
8 8
 const Recharge = props => {
9 9
 
10
-    const { amount, visible } = props
11
-    console.log(amount, visible, 'amount')
10
+    const { amount } = props
11
+    console.log(amount, 'amount')
12 12
     const { orderInfo } = amount
13 13
     console.log(orderInfo, 'orderInfo')
14
-    useEffect(() => {
15
-        getByInfo
16
-        // setTimeout(() => { getByInfo() }, 1000)
17
-    }, [])
18
-
19
-
20 14
     const getByInfo = setInterval(() => {
21 15
 
22 16
 
@@ -26,15 +20,15 @@ const Recharge = props => {
26 20
 
27 21
                 // clearInterval(getByInfo)
28 22
                 // props.value()
29
-                if (!visible) { clearInterval(getByInfo) }
23
+                // if (!visible) { clearInterval(getByInfo) }
30 24
             } else if (data.tradingStatus === 'success') {
31 25
                 mmessage.info('充值成功')
32
-                
26
+
33 27
                 props.value('success')
34 28
                 clearInterval(getByInfo)
35 29
             } else {
36 30
                 mmessage.info('充值失败')
37
-                
31
+
38 32
                 props.value('fail')
39 33
                 clearInterval(getByInfo)
40 34
             }
@@ -47,6 +41,15 @@ const Recharge = props => {
47 41
     }, 1000)
48 42
 
49 43
 
44
+    useEffect(() => {
45
+        console.log(props.visible, 'props.visible')
46
+
47
+        return () => clearInterval(getByInfo);
48
+        // setTimeout(() => { getByInfo() }, 1000)
49
+    }, [props.visible])
50
+
51
+
52
+
50 53
     // {
51 54
     //     request({ ...apis.funds.getByInfo, params: { orderId: orderInfo.orderId } }).then(data => {
52 55
     //         if (data.tradingStatus === 'processing') {
@@ -78,7 +81,7 @@ const Recharge = props => {
78 81
     return (
79 82
         <>
80 83
             <div style={{ fontSize: '18px', fontWeight: '400', color: '#333333' }}>
81
-                <span onClick={props.value}>充值金额{amount.amount}元</span><span style={{ marginLeft: '80px' }}>微信商户手续费率{amount.mchPayRate}</span><span style={{ marginLeft: '80px' }}>手续费{amount.serviceFee}元</span>
84
+                <span onClick={props.value}>充值金额{amount.amount / 100 || 0}元</span><span style={{ marginLeft: '80px' }}>微信商户手续费率{amount.mchPayRate}</span><span style={{ marginLeft: '80px' }}>手续费{amount.serviceFee / 100 || 0}元</span>
82 85
                 {/* <img src="" alt="" width:/> */}
83 86
             </div>
84 87
             <div style={{ height: '278px', borderRadius: '12px', border: '1px solid rgba(218,218,218,1', margin: '40px 0', display: 'flex' }}>
@@ -92,7 +95,7 @@ const Recharge = props => {
92 95
                 </div>
93 96
                 <div className={Styles.boxRight}>
94 97
                     <div className={Styles.child}>
95
-                        <p style={{ lineHeight: '43px', height: '43px', marginBottom: '5px' }}><span style={{ fontSize: '32px', fontWeight: '600', color: '#EF273A' }}>¥{amount.realAmount}</span><span style={{ marginLeft: '5px' }}>应付金额</span></p>
98
+                        <p style={{ lineHeight: '43px', height: '43px', marginBottom: '5px' }}><span style={{ fontSize: '32px', fontWeight: '600', color: '#EF273A' }}>¥{amount.realAmount / 100 || 0}</span><span style={{ marginLeft: '5px' }}>应付金额</span></p>
96 99
                         <p>仅支持微信支付</p>
97 100
                     </div>
98 101
 

+ 1
- 1
src/pages/funds/accountfunds/components/RechargeOrder.jsx Ver arquivo

@@ -109,7 +109,7 @@ function RechargeOrder(props) {
109 109
             dataIndex: 'certificateUrlList',
110 110
             key: 'certificateUrlList',
111 111
             align: 'center',
112
-            render: (x, row) => <>{`${row.certificateUrlList == null ? '' :<Navigate onClick={() => openImg(x)}>查看</Navigate> }`}</>,
112
+            render: (x, row) => <>{row.certificateUrlList == null ? '' : <Navigate onClick={() => openImg(x)}>查看</Navigate>}</>,
113 113
         },
114 114
         {
115 115
             title: '充值状态',

+ 68
- 4
src/pages/h5SampleManager/h5Sample/addH5.jsx Ver arquivo

@@ -8,12 +8,10 @@ import request from '../../../utils/request';
8 8
 import AuthButton from '@/components/AuthButton';
9 9
 import ImageUploader from '../../../components/XForm/ImageUpload';
10 10
 
11
-const { Option } = Select;
12
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
13
-
14
-
15 11
 const header = props => {
16 12
     const sampleId = props.location.query.id;
13
+
14
+    const [visible, setVisible] = useState(false)
17 15
     // const sampleName = props.location.query.sampleName;
18 16
     // const [sampleData, setSampleData] = useState({})
19 17
 
@@ -53,6 +51,8 @@ const header = props => {
53 51
                 request({ ...apis.activity.addtaDrainage, data: { ...values } }).then(data => {
54 52
                     message.info('操作成功')
55 53
 
54
+
55
+
56 56
                 }).catch(err => {
57 57
                     message.error(err.msg || err.message)
58 58
                 })
@@ -68,6 +68,55 @@ const header = props => {
68 68
         });
69 69
     }
70 70
 
71
+    function disabledDate(current) {
72
+        // Can not select days before today and today 
73
+        console.log(current, 'current')
74
+        // return current && current < moment().startOf('day');
75
+        return current < moment().add(-1, 'd');
76
+    }
77
+
78
+    function disabledDateTime(current) {
79
+        // Can not select days before today and today 
80
+        console.log(current, 'disabledDateTime')
81
+        return current && current < moment();
82
+    }
83
+
84
+    const disabledHours = () => {
85
+        const hours = [];
86
+        for (let i = 0; i < moment().hour(); i++) {
87
+            hours.push(i);
88
+        }
89
+        return hours;
90
+    };
91
+
92
+    const disabledMinutes = currentDate => {
93
+        const currentMinute = moment().minute();
94
+        const currentHour = moment(currentDate).hour();
95
+        const minutes = [];
96
+        if (currentHour === moment().hour()) {
97
+            for (let i = 0; i < currentMinute; i++) {
98
+                minutes.push(i);
99
+            }
100
+        }
101
+        return minutes;
102
+    };
103
+
104
+    const disabledTime = dateTime => {
105
+        if (moment(dateTime).isBefore(moment(), 'day')) {
106
+            return {
107
+                disabledHours: () => [],
108
+                disabledMinutes: () => [],
109
+            };
110
+        }
111
+
112
+        if (moment(dateTime).isSame(moment(), 'day')) {
113
+            return {
114
+                disabledHours: () => disabledHours(dateTime),
115
+                disabledMinutes: () => disabledMinutes(dateTime),
116
+            };
117
+        }
118
+    };
119
+
71 120
     const { getFieldDecorator } = props.form;
72 121
 
73 122
     return (
@@ -92,6 +141,8 @@ const header = props => {
92 141
                     })(
93 142
                         <DatePicker
94 143
                             showTime={{ format: 'HH:mm:ss' }}
144
+                            disabledDate={disabledDate}
145
+                            disabledTime={disabledTime}
95 146
                         />,
96 147
                     )}
97 148
                 </Form.Item>
@@ -130,6 +181,19 @@ const header = props => {
130 181
             <Button onClick={() => router.go(-1)}>取消</Button>
131 182
                 </Form.Item>
132 183
             </Form>
184
+            {/* <Button onClick={() => setVisible(true)}>234</Button> */}
185
+            <Modal
186
+                title="新增成功"
187
+                visible={visible}
188
+                // onOk={handleOk}
189
+                // confirmLoading={confirmLoading}
190
+                onCancel={() => setVisible(false)}
191
+                footer={null}
192
+            // width="1000px"
193
+            // maskClosable={false}
194
+            >
195
+                建议修改内容以适合您的项目,若有红包等需要消费的内容,请到资金管理中查看余额是否充足
196
+            </Modal>
133 197
         </>
134 198
     )
135 199
 }

+ 4
- 4
src/pages/h5SampleManager/h5Sample/detail.jsx Ver arquivo

@@ -121,11 +121,11 @@ const header = props => {
121 121
         </Form.Item>
122 122
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
123 123
           <div style={{ margin: '0.16rem 0 0.06rem' }}>
124
-            <AuthButton name="admin.h5Sample.activity.add" noRight={null}>
124
+            {!!demandData.h5TemplateId && <AuthButton name="admin.h5Sample.activity.add" noRight={null}>
125 125
               <Button type="primary" onClick={toAddH5(sampleId)} style={{ marginRight: '20px' }}>
126 126
                 创建H5活动
127 127
               </Button>
128
-            </AuthButton>
128
+            </AuthButton>}
129 129
             <Button type="primary" onClick={toDetail(sampleId)} style={{ marginRight: '20px' }}>
130 130
               提交需求
131 131
           </Button>
@@ -135,13 +135,13 @@ const header = props => {
135 135
           </div>
136 136
         </Form.Item>
137 137
         <div style={{ position: 'fixed', right: '0.4rem', bottom: '6%' }}>
138
-          <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between', marginBottom: '20px' }}>样例可直接使用 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
138
+          {!!demandData.h5TemplateId && <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between', marginBottom: '20px' }}>样例可直接使用 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
139 139
             <AuthButton name="admin.h5Sample.activity.add" noRight={null}>
140 140
               <Button type="primary" onClick={toAddH5(sampleId)} >
141 141
                 创建H5活动
142 142
               </Button>
143 143
             </AuthButton>
144
-          </div>
144
+          </div>}
145 145
           <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between' }}>我想办类似活动 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
146 146
             <Button type="primary" onClick={toDetail(sampleId)} >
147 147
               提交需求