Browse Source

dev: WantedModal

Roxas 4 years ago
parent
commit
f0f430b59a

+ 0
- 2
eslib/AllocWantedModal/index.js View File

@@ -110,8 +110,6 @@ function (_React$Component) {
110 110
         goods_id: 2,
111 111
         num: Number(_this.state.sendValue)
112 112
       })).then(function (res) {
113
-        console.log("res: ", res);
114
-
115 113
         if (res) {
116 114
           _this.handleCloseAction();
117 115
         } else {

+ 1
- 1
eslib/AllocWantedModal/index.js.map
File diff suppressed because it is too large
View File


+ 0
- 2
lib/AllocWantedModal/index.js View File

@@ -117,8 +117,6 @@ function (_React$Component) {
117 117
         goods_id: 2,
118 118
         num: Number(_this.state.sendValue)
119 119
       })).then(function (res) {
120
-        console.log("res: ", res);
121
-
122 120
         if (res) {
123 121
           _this.handleCloseAction();
124 122
         } else {

+ 1
- 1
lib/AllocWantedModal/index.js.map
File diff suppressed because it is too large
View File


+ 6
- 3
src/components/Payment/AllocWantedModal/index.tsx View File

@@ -119,7 +119,6 @@ class AllocWantedModal extends React.Component<
119 119
         num: Number(this.state.sendValue) // 礼物数量
120 120
       })
121 121
     ).then((res: any) => {
122
-      console.log("res: ", res);
123 122
       if (res) {
124 123
         this.handleCloseAction();
125 124
       } else {
@@ -157,7 +156,9 @@ class AllocWantedModal extends React.Component<
157 156
           title="超过范围值"
158 157
           placement="bottom"
159 158
           overlayClassName={styles.outRangeTextTip}
160
-          getTooltipContainer={() => this.ModalContentRef && this.ModalContentRef.current}
159
+          getTooltipContainer={() =>
160
+            this.ModalContentRef && this.ModalContentRef.current
161
+          }
161 162
         >
162 163
           <Input
163 164
             ref={this.ModalInputRef}
@@ -182,7 +183,9 @@ class AllocWantedModal extends React.Component<
182 183
             <Popover
183 184
               placement="bottom"
184 185
               trigger="click"
185
-              getPopupContainer={() => this.ModalContentRef && this.ModalContentRef.current}
186
+              getPopupContainer={() =>
187
+                this.ModalContentRef && this.ModalContentRef.current
188
+              }
186 189
               overlayStyle={{
187 190
                 width: "320px"
188 191
               }}

+ 1
- 1
stats.html
File diff suppressed because it is too large
View File


+ 14
- 1
stories/Wanted.stories.tsx View File

@@ -4,7 +4,7 @@ import { withInfo } from "@storybook/addon-info";
4 4
 import { addReadme } from "storybook-readme";
5 5
 import React from "react";
6 6
 import AllocWantedModal from "@components/Payment/AllocWantedModal";
7
-import { Button, Divider } from "antd";
7
+import { Button, Divider, Modal } from "antd";
8 8
 import WantedPublishView from "@components/Payment/WantedPublishView";
9 9
 import WantedPublishModal from "@components/Payment/WantedPublishModal";
10 10
 import WantedPublishPopover from "@components/Payment/WantedPublishPopover";
@@ -88,6 +88,7 @@ stories.add(
88 88
   "WantedPublishPopover And Modal",
89 89
   () => {
90 90
     const [wanted, setWanted] = React.useState("");
91
+    const [testModal, setTestModal] = React.useState(false);
91 92
     return (
92 93
       <div>
93 94
         <div>
@@ -138,6 +139,18 @@ stories.add(
138 139
           </WantedPublishPopover>
139 140
         </div>
140 141
         <Divider />
142
+        <div onClick={() => setTestModal(true)}>Show Modal</div>
143
+        <Modal
144
+          visible={testModal}
145
+          title="Create a new collection"
146
+          okText="Create"
147
+          onCancel={() => setTestModal(false)}
148
+          onOk={() => setTestModal(true)}
149
+        >
150
+          <WantedPublishModal>
151
+            <div>ModalClick</div>
152
+          </WantedPublishModal>
153
+        </Modal>
141 154
         {/* 下面用于分割wanted值的渲染,防止Error */}
142 155
         {(wanted => (
143 156
           <div>wanted{wanted}</div>