|
@@ -25,7 +25,8 @@ import WaitPayInfoView from "@/components/Payment/WaitPayInfoView";
|
25
|
25
|
import WaitPayInfoViewDoc from "@components/Payment/WaitPayInfoView/README.md";
|
26
|
26
|
import AllocWantedModal from "@/components/Payment/AllocWantedModal";
|
27
|
27
|
import WantedPublishView from "@/components/Payment/WantedPublishView";
|
28
|
|
-import WantedPublishPopover from '@/components/Payment/WantedPublishPopover';
|
|
28
|
+import WantedPublishPopover from "@/components/Payment/WantedPublishPopover";
|
|
29
|
+import WantedPublishModal from "@/components/Payment/WantedPublishModal";
|
29
|
30
|
import { formatMoney } from "@components/Payment/Utils/utils";
|
30
|
31
|
|
31
|
32
|
import { consumeList } from "./data/consumeList.json";
|
|
@@ -126,7 +127,11 @@ stories.add(
|
126
|
127
|
<div style={{ width: text("style_width", "auto") }}>
|
127
|
128
|
<PriceOptions
|
128
|
129
|
price={price}
|
129
|
|
- rowMode={select("rowMode", { single: 'single', multi: 'multi' }, "single")}
|
|
130
|
+ rowMode={select(
|
|
131
|
+ "rowMode",
|
|
132
|
+ { single: "single", multi: "multi" },
|
|
133
|
+ "single"
|
|
134
|
+ )}
|
130
|
135
|
onPriceChange={v => setPrice(v)}
|
131
|
136
|
size={select(
|
132
|
137
|
"size",
|
|
@@ -185,9 +190,9 @@ stories.add(
|
185
|
190
|
console.log(args);
|
186
|
191
|
}}
|
187
|
192
|
sendGiftData={{
|
188
|
|
- answerId: text("answerId", '1'),
|
189
|
|
- questionId: text("questionId", '1'),
|
190
|
|
- toUserId: text("toUserId", '1')
|
|
193
|
+ answerId: text("answerId", "1"),
|
|
194
|
+ questionId: text("questionId", "1"),
|
|
195
|
+ toUserId: text("toUserId", "1")
|
191
|
196
|
}}
|
192
|
197
|
handleVisibleChange={visiable => {
|
193
|
198
|
console.log(visiable);
|
|
@@ -210,78 +215,100 @@ stories.add(
|
210
|
215
|
return (
|
211
|
216
|
<>
|
212
|
217
|
<WantedPublishView
|
213
|
|
- type={select("type", {
|
214
|
|
- POP: "pop",
|
215
|
|
- Modal: 'modal',
|
216
|
|
- }, "pop")}
|
|
218
|
+ type={select(
|
|
219
|
+ "type",
|
|
220
|
+ {
|
|
221
|
+ POP: "pop",
|
|
222
|
+ Modal: "modal"
|
|
223
|
+ },
|
|
224
|
+ "pop"
|
|
225
|
+ )}
|
217
|
226
|
wrapperClass="test_wrapper"
|
218
|
227
|
current_wanted={currentWanted}
|
219
|
228
|
InputWantedValueChange={(value: any) => setCurrentWanted(value)}
|
220
|
229
|
InputWantedOnBlur={(blurValue: any) => setCurrentWanted(blurValue)}
|
221
|
230
|
InputWantedClear={() => setCurrentWanted(0)}
|
222
|
|
- InputWantedPressEnter={(enterValue: any) => setCurrentWanted(enterValue)}
|
223
|
|
- CloseFunction={() => { console.log("Close Button"); }}
|
|
231
|
+ InputWantedPressEnter={(enterValue: any) =>
|
|
232
|
+ setCurrentWanted(enterValue)
|
|
233
|
+ }
|
|
234
|
+ CloseFunction={() => {
|
|
235
|
+ console.log("Close Button");
|
|
236
|
+ }}
|
224
|
237
|
/>
|
225
|
238
|
<Divider />
|
226
|
|
- <div>
|
227
|
|
- currentWanted: {currentWanted}
|
228
|
|
- </div>
|
|
239
|
+ <div>currentWanted: {currentWanted}</div>
|
229
|
240
|
</>
|
230
|
|
- )
|
|
241
|
+ );
|
231
|
242
|
},
|
232
|
243
|
{
|
233
|
244
|
info: { inline: true },
|
234
|
245
|
notes: "A very simple example of addon notes"
|
235
|
246
|
}
|
236
|
|
-)
|
|
247
|
+);
|
237
|
248
|
|
238
|
249
|
stories.add(
|
239
|
|
- "WantedPublishPopover",
|
|
250
|
+ "WantedPublishPopover And Modal",
|
240
|
251
|
() => {
|
241
|
|
- const [wanted, setWanted] = React.useState('');
|
|
252
|
+ const [wanted, setWanted] = React.useState("");
|
242
|
253
|
return (
|
243
|
254
|
<div>
|
244
|
|
- <WantedPublishPopover
|
245
|
|
- popoverConfig={{
|
246
|
|
- placement: select("popoverConfigPlacement", {
|
247
|
|
- Undefined: undefined,
|
248
|
|
- Left: "left",
|
249
|
|
- Right: "right",
|
250
|
|
- Top: "top",
|
251
|
|
- Bottom: "bottom",
|
252
|
|
- TopLeft: "topLeft",
|
253
|
|
- TopRight: "topRight",
|
254
|
|
- BottomLeft: "bottomLeft",
|
255
|
|
- BottomRight: "bottomRight",
|
256
|
|
- LeftTop: "leftTop",
|
257
|
|
- LeftBottom: "leftBottom",
|
258
|
|
- RightTop: "rightTop",
|
259
|
|
- RightBottom: "rightBottom",
|
260
|
|
- }, undefined),
|
261
|
|
- trigger: select("popoverConfigTrigger", {
|
262
|
|
- Undefined: undefined,
|
263
|
|
- Hover: "hover",
|
264
|
|
- Click: "click",
|
265
|
|
- Focus: "focus",
|
266
|
|
- ContextMenu: "contextMenu",
|
267
|
|
- }, undefined),
|
268
|
|
- }}
|
269
|
|
- handleConfirm={(value: any) => {
|
270
|
|
- setWanted(value);
|
271
|
|
- }}
|
272
|
|
- >
|
273
|
|
- <Button>HoverIt{wanted}</Button>
|
274
|
|
- </WantedPublishPopover>
|
|
255
|
+ <div>
|
|
256
|
+ <WantedPublishModal>
|
|
257
|
+ <div>ModalClick</div>
|
|
258
|
+ </WantedPublishModal>
|
|
259
|
+ </div>
|
|
260
|
+ <Divider />
|
|
261
|
+ <div>
|
|
262
|
+ <WantedPublishPopover
|
|
263
|
+ popoverConfig={{
|
|
264
|
+ placement: select(
|
|
265
|
+ "popoverConfigPlacement",
|
|
266
|
+ {
|
|
267
|
+ Undefined: undefined,
|
|
268
|
+ Left: "left",
|
|
269
|
+ Right: "right",
|
|
270
|
+ Top: "top",
|
|
271
|
+ Bottom: "bottom",
|
|
272
|
+ TopLeft: "topLeft",
|
|
273
|
+ TopRight: "topRight",
|
|
274
|
+ BottomLeft: "bottomLeft",
|
|
275
|
+ BottomRight: "bottomRight",
|
|
276
|
+ LeftTop: "leftTop",
|
|
277
|
+ LeftBottom: "leftBottom",
|
|
278
|
+ RightTop: "rightTop",
|
|
279
|
+ RightBottom: "rightBottom"
|
|
280
|
+ },
|
|
281
|
+ undefined
|
|
282
|
+ ),
|
|
283
|
+ trigger: select(
|
|
284
|
+ "popoverConfigTrigger",
|
|
285
|
+ {
|
|
286
|
+ Undefined: undefined,
|
|
287
|
+ Hover: "hover",
|
|
288
|
+ Click: "click",
|
|
289
|
+ Focus: "focus",
|
|
290
|
+ ContextMenu: "contextMenu"
|
|
291
|
+ },
|
|
292
|
+ undefined
|
|
293
|
+ )
|
|
294
|
+ }}
|
|
295
|
+ handleConfirm={(value: any) => {
|
|
296
|
+ setWanted(value);
|
|
297
|
+ }}
|
|
298
|
+ >
|
|
299
|
+ <Button>HoverIt{wanted}</Button>
|
|
300
|
+ </WantedPublishPopover>
|
|
301
|
+ </div>
|
275
|
302
|
<Divider />
|
276
|
303
|
{/* 下面用于分割wanted值的渲染,防止Error */}
|
277
|
|
- {
|
278
|
|
- ((wanted) => <div>wanted{wanted}</div>)(wanted)
|
279
|
|
- }
|
|
304
|
+ {(wanted => (
|
|
305
|
+ <div>wanted{wanted}</div>
|
|
306
|
+ ))(wanted)}
|
280
|
307
|
</div>
|
281
|
|
- )
|
|
308
|
+ );
|
282
|
309
|
},
|
283
|
310
|
{
|
284
|
311
|
info: { inline: true },
|
285
|
312
|
notes: "A very simple example of addon notes"
|
286
|
313
|
}
|
287
|
|
-)
|
|
314
|
+);
|