Browse Source

dev: WantedModal

Roxas 4 years ago
parent
commit
f0f430b59a

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

110
         goods_id: 2,
110
         goods_id: 2,
111
         num: Number(_this.state.sendValue)
111
         num: Number(_this.state.sendValue)
112
       })).then(function (res) {
112
       })).then(function (res) {
113
-        console.log("res: ", res);
114
-
115
         if (res) {
113
         if (res) {
116
           _this.handleCloseAction();
114
           _this.handleCloseAction();
117
         } else {
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
         goods_id: 2,
117
         goods_id: 2,
118
         num: Number(_this.state.sendValue)
118
         num: Number(_this.state.sendValue)
119
       })).then(function (res) {
119
       })).then(function (res) {
120
-        console.log("res: ", res);
121
-
122
         if (res) {
120
         if (res) {
123
           _this.handleCloseAction();
121
           _this.handleCloseAction();
124
         } else {
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
         num: Number(this.state.sendValue) // 礼物数量
119
         num: Number(this.state.sendValue) // 礼物数量
120
       })
120
       })
121
     ).then((res: any) => {
121
     ).then((res: any) => {
122
-      console.log("res: ", res);
123
       if (res) {
122
       if (res) {
124
         this.handleCloseAction();
123
         this.handleCloseAction();
125
       } else {
124
       } else {
157
           title="超过范围值"
156
           title="超过范围值"
158
           placement="bottom"
157
           placement="bottom"
159
           overlayClassName={styles.outRangeTextTip}
158
           overlayClassName={styles.outRangeTextTip}
160
-          getTooltipContainer={() => this.ModalContentRef && this.ModalContentRef.current}
159
+          getTooltipContainer={() =>
160
+            this.ModalContentRef && this.ModalContentRef.current
161
+          }
161
         >
162
         >
162
           <Input
163
           <Input
163
             ref={this.ModalInputRef}
164
             ref={this.ModalInputRef}
182
             <Popover
183
             <Popover
183
               placement="bottom"
184
               placement="bottom"
184
               trigger="click"
185
               trigger="click"
185
-              getPopupContainer={() => this.ModalContentRef && this.ModalContentRef.current}
186
+              getPopupContainer={() =>
187
+                this.ModalContentRef && this.ModalContentRef.current
188
+              }
186
               overlayStyle={{
189
               overlayStyle={{
187
                 width: "320px"
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
 import { addReadme } from "storybook-readme";
4
 import { addReadme } from "storybook-readme";
5
 import React from "react";
5
 import React from "react";
6
 import AllocWantedModal from "@components/Payment/AllocWantedModal";
6
 import AllocWantedModal from "@components/Payment/AllocWantedModal";
7
-import { Button, Divider } from "antd";
7
+import { Button, Divider, Modal } from "antd";
8
 import WantedPublishView from "@components/Payment/WantedPublishView";
8
 import WantedPublishView from "@components/Payment/WantedPublishView";
9
 import WantedPublishModal from "@components/Payment/WantedPublishModal";
9
 import WantedPublishModal from "@components/Payment/WantedPublishModal";
10
 import WantedPublishPopover from "@components/Payment/WantedPublishPopover";
10
 import WantedPublishPopover from "@components/Payment/WantedPublishPopover";
88
   "WantedPublishPopover And Modal",
88
   "WantedPublishPopover And Modal",
89
   () => {
89
   () => {
90
     const [wanted, setWanted] = React.useState("");
90
     const [wanted, setWanted] = React.useState("");
91
+    const [testModal, setTestModal] = React.useState(false);
91
     return (
92
     return (
92
       <div>
93
       <div>
93
         <div>
94
         <div>
138
           </WantedPublishPopover>
139
           </WantedPublishPopover>
139
         </div>
140
         </div>
140
         <Divider />
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
         {/* 下面用于分割wanted值的渲染,防止Error */}
154
         {/* 下面用于分割wanted值的渲染,防止Error */}
142
         {(wanted => (
155
         {(wanted => (
143
           <div>wanted{wanted}</div>
156
           <div>wanted{wanted}</div>