Browse Source

dev: 重构部分代码

1. ConsumeListView
2. PayPlatformOptions
Roxas 4 years ago
parent
commit
24fbe15365

+ 0
- 7
.kiwi/config.json View File

@@ -1,7 +0,0 @@
1
-{
2
-  "srcLang": "zh_CN",
3
-  "distLangs": [
4
-    "en_US"
5
-  ],
6
-  "googleApiKey": ""
7
-}

+ 0
- 7
.kiwi/en_US/index.ts View File

@@ -1,7 +0,0 @@
1
-import priceOptions from './priceOptions';
2
-import payplatformoption from './payplatformoption';
3
-
4
-export default Object.assign({}, {
5
-  priceOptions,
6
-  payplatformoption,
7
-});

+ 0
- 3
.kiwi/en_US/payplatformoption.ts View File

@@ -1,3 +0,0 @@
1
-export default {
2
-  "platform": "支付平台"
3
-}

+ 0
- 5
.kiwi/en_US/priceOptions.ts View File

@@ -1,5 +0,0 @@
1
-export default {
2
-  "index": {
3
-    "others": "Others"
4
-  }
5
-}

+ 0
- 7
.kiwi/zh_CN/index.ts View File

@@ -1,7 +0,0 @@
1
-import priceOptions from './priceOptions';
2
-import payplatformoption from './payplatformoption';
3
-
4
-export default Object.assign({}, {
5
-  priceOptions,
6
-  payplatformoption,
7
-});

+ 0
- 3
.kiwi/zh_CN/payplatformoption.ts View File

@@ -1,3 +0,0 @@
1
-export default {
2
-  platform: '支付平台',
3
-};

+ 0
- 5
.kiwi/zh_CN/priceOptions.ts View File

@@ -1,5 +0,0 @@
1
-export default {
2
-  index: {
3
-    others: '其他金额',
4
-  },
5
-};

+ 7
- 0
.yarnrc View File

@@ -0,0 +1,7 @@
1
+registry "https://registry.npm.taobao.org"
2
+sass_binary_site "https://npm.taobao.org/mirrors/node-sass/"
3
+phantomjs_cdnurl "http://cnpmjs.org/downloads"
4
+electron_mirror "https://npm.taobao.org/mirrors/electron/"
5
+sqlite3_binary_host_mirror "https://foxgis.oss-cn-shanghai.aliyuncs.com/"
6
+profiler_binary_host_mirror "https://npm.taobao.org/mirrors/node-inspector/"
7
+chromedriver_cdnurl "https://cdn.npm.taobao.org/dist/chromedriver"

+ 16
- 10
src/components/Payment/Common/ConsumeListView/index.tsx View File

@@ -1,4 +1,4 @@
1
-import React, { Component } from 'react';
1
+import React, { Component, MouseEvent } from 'react';
2 2
 import classnames from 'classnames';
3 3
 
4 4
 // import { DEFAULT_AVATAR } from '@/constants';
@@ -9,17 +9,20 @@ import styles from './ConsumeListView.less';
9 9
 
10 10
 const DEFAULT_AVATAR =
11 11
   '//links-comment.oss-cn-beijing.aliyuncs.com/comment/20180820/Kgka4_oU1.jpeg';
12
+  
13
+interface dataItem {
14
+  id?: string|number;
15
+  user_avatar?: string;
16
+  bill_price?: number;
17
+}
12 18
 
13
-type Props = {
19
+interface Props {
14 20
   isToggle: boolean;
15 21
   onToggleChange: Function;
16
-  dataSource: Array<{
17
-    id?: string|number;
18
-    user_avatar?: string;
19
-    bill_price?: number;
20
-  }>;
22
+  onConsumeItemClick: (e: MouseEvent, clickData: any) => any,
23
+  dataSource: Array<dataItem>;
21 24
   listLength: number;
22
-  showLength: number;
25
+  showLength: number; 
23 26
   options: {
24 27
     avatarSize: number,
25 28
     avatarMarginLeftAndRight: number,
@@ -29,10 +32,11 @@ type Props = {
29 32
   },
30 33
 }
31 34
 
32
-class ConsumeListView extends Component<Props> {
35
+class ConsumeListView extends Component<Props, {}> {
33 36
   static defaultProps: Props = {
34 37
     isToggle: false,
35 38
     onToggleChange: () => {},
39
+    onConsumeItemClick: () => {},
36 40
     dataSource: [],
37 41
     listLength: 0,
38 42
     showLength: 6,
@@ -49,6 +53,7 @@ class ConsumeListView extends Component<Props> {
49 53
     const {
50 54
       dataSource,
51 55
       isToggle,
56
+      onConsumeItemClick,
52 57
       showLength,
53 58
       listLength,
54 59
       options,
@@ -66,7 +71,7 @@ class ConsumeListView extends Component<Props> {
66 71
       renderData = dataSource.slice(0, showLength - 1);
67 72
     }
68 73
 
69
-    return renderData.map((v, i) => {
74
+    return renderData.map((v: dataItem, i: number) => {
70 75
       let kingdom = null;
71 76
       if (i === 0) {
72 77
         kingdom = (
@@ -92,6 +97,7 @@ class ConsumeListView extends Component<Props> {
92 97
           {kingdom}
93 98
           <div
94 99
             className={styles.avatar}
100
+            onClick={(e) => onConsumeItemClick(e, v)}
95 101
             style={{
96 102
               backgroundImage: `url(${addImageProcess(
97 103
                 v.user_avatar || DEFAULT_AVATAR,

+ 7
- 7
src/components/Payment/Common/PayPlatformOptions/PayPlatformOptions.less View File

@@ -14,11 +14,11 @@
14 14
   font-weight: 400;
15 15
   color: #616A79;
16 16
 }
17
-.payment-method-box {
17
+.payChannelBox {
18 18
   padding: 20px 10px 10px 10px;
19 19
   text-align: center;
20 20
 
21
-  .payment-method {
21
+  .paymentImage {
22 22
       display: inline-block;
23 23
       margin: 0;
24 24
       width: 60%;
@@ -32,7 +32,7 @@
32 32
       }
33 33
   }
34 34
 
35
-  .payitem {
35
+  .payChannelBlock {
36 36
       display: flex;
37 37
       justify-content: center;
38 38
       align-items: center;
@@ -51,7 +51,7 @@
51 51
         height: 36px;
52 52
         line-height: 36px;
53 53
         
54
-        .payment-method {
54
+        .paymentImage {
55 55
           margin: 0;
56 56
         }
57 57
       }
@@ -77,7 +77,7 @@
77 77
 
78 78
   &.mobile {
79 79
       padding: 8px 10px 10px 8px;
80
-      .payitem {
80
+      .payChannelBlock {
81 81
           display: inline-flex;
82 82
           flex-direction: column;
83 83
           justify-content: space-around;
@@ -91,7 +91,7 @@
91 91
               border-color: #1790FF;
92 92
           }
93 93
 
94
-          .payment-method {
94
+          .paymentImage {
95 95
               display: inline-block;
96 96
               width: 34px;
97 97
               height: 34px;
@@ -101,7 +101,7 @@
101 101
 }
102 102
 
103 103
 @media (max-width: 768px) {
104
-  .payitem {
104
+  .payChannelBlock {
105 105
       cursor: pointer;
106 106
       border: 1px solid transparent;
107 107
       &.active {

+ 365
- 184
src/components/Payment/Common/PayPlatformOptions/index.tsx View File

@@ -17,6 +17,11 @@ type PAY_CHANNEL_VALUE =
17 17
   | "ALI_WAP"
18 18
   | "WX_WAP"
19 19
   | "WX_NATIVE";
20
+
21
+type PAY_CHANNEL_CATEGORY_VALUE = "Alipay" | "Wechat" | "Paypal";
22
+
23
+interface PAY_CHANNEL_TEXT { zh: string; en: string }
24
+interface PAY_CHANNEL_IMAGE { desktop: any; mobile: any }
20 25
 interface PAY_CHANNEL_TYPE {
21 26
   PAYPAL: PAY_CHANNEL_VALUE;
22 27
   ALI_WEB: PAY_CHANNEL_VALUE;
@@ -25,13 +30,29 @@ interface PAY_CHANNEL_TYPE {
25 30
   WX_NATIVE: PAY_CHANNEL_VALUE;
26 31
 }
27 32
 
33
+interface PAY_CHANNEL_CATEGORY {
34
+  ALI: PAY_CHANNEL_CATEGORY_VALUE,
35
+  WX: PAY_CHANNEL_CATEGORY_VALUE,
36
+  PAYPAL: PAY_CHANNEL_CATEGORY_VALUE,
37
+}
38
+
28 39
 interface Props {
29
-  payitem: PAY_CHANNEL_VALUE;
30
-  onPayItemChange: (value: PAY_CHANNEL_VALUE) => void;
40
+  payChannel: PAY_CHANNEL_VALUE;
41
+  onPayChannelChange: (value: PAY_CHANNEL_VALUE) => void;
31 42
   isMobile: boolean;
32 43
   size: "small" | "normal" | "large";
33 44
   withTitle: boolean;
34
-  titleTxt?: string;
45
+  titleText?: string;
46
+  locale: "zh" | "en";
47
+}
48
+
49
+interface PayPlatformBlockProps {
50
+  isMobile: boolean;
51
+  isActive: boolean;
52
+  size: "small" | "normal" | "large";
53
+  onClick: any;
54
+  image: PAY_CHANNEL_IMAGE;
55
+  text: PAY_CHANNEL_TEXT;
35 56
   locale: "zh" | "en";
36 57
 }
37 58
 
@@ -43,192 +64,352 @@ export const PAY_CHANNEL: PAY_CHANNEL_TYPE = {
43 64
   WX_NATIVE: "WX_NATIVE"
44 65
 };
45 66
 
46
-class PayPlatformOptions extends PureComponent<Props, {}> {
47
-  render() {
48
-    const {
49
-      payitem,
50
-      onPayItemChange,
51
-      isMobile = false,
52
-      size = "normal",
53
-      withTitle = true,
54
-      titleTxt,
55
-      locale = "zh"
56
-    } = this.props;
57
-
58
-    let titleDOM = null;
59
-    if (withTitle) {
60
-      const titleResult = titleTxt || locale === 'zh' ? '支付方式' : 'Payment';
61
-      titleDOM = (
62
-        <div className={styles.label}>
63
-          {titleResult}
64
-        </div>
65
-      );
66
-    }
67
+export const PAY_CHANNEL_CATEGORY: PAY_CHANNEL_CATEGORY = {
68
+  ALI: "Alipay",
69
+  WX: "Wechat",
70
+  PAYPAL: "Paypal",
71
+}
67 72
 
68
-    if (isMobile) {
69
-      return (
70
-        <div>
71
-          {titleDOM}
72
-          <div
73
-            className={classnames(styles["payment-method-box"], {
74
-              [styles.mobile]: isMobile
75
-            })}
76
-          >
77
-            <div className={styles.flexContainer}>
78
-              <div className={styles.flexItem}>
79
-                <div
80
-                  className={classnames(
81
-                    {
82
-                      [styles.payitem]: true,
83
-                      [styles.active]: payitem === PAY_CHANNEL.ALI_WEB,
84
-                      ...exportStyleSizeClass(styles, size),
85
-                    },
86
-                    styles[locale]
87
-                  )}
88
-                  onClick={() => {
89
-                    onPayItemChange(PAY_CHANNEL.ALI_WEB);
90
-                  }}
91
-                >
92
-                  <img
93
-                    src={mobileIconAlipay}
94
-                    alt="alipay"
95
-                    className={styles["payment-method"]}
96
-                  />
97
-                  <div className={styles.platformName}>
98
-                    支付宝
99
-                  </div>
100
-                </div>
101
-              </div>
102
-              <div className={styles.flexItem}>
103
-                <div
104
-                  className={classnames(
105
-                    {
106
-                      [styles.payitem]: true,
107
-                      [styles.active]: payitem === PAY_CHANNEL.WX_NATIVE,
108
-                      ...exportStyleSizeClass(styles, size),
109
-                    },
110
-                    styles[locale]
111
-                  )}
112
-                  onClick={() => {
113
-                    onPayItemChange(PAY_CHANNEL.WX_NATIVE);
114
-                  }}
115
-                >
116
-                  <img
117
-                    src={mobileIconWechatpay}
118
-                    alt="wechatpay"
119
-                    className={styles["payment-method"]}
120
-                  />
121
-                  <div className={styles.platformName}>
122
-                    微信
123
-                  </div>
124
-                </div>
125
-              </div>
126
-              <div className={styles.flexItem}>
127
-                <div
128
-                  className={classnames(
129
-                    {
130
-                      [styles.payitem]: true,
131
-                      [styles.active]: payitem === PAY_CHANNEL.PAYPAL,
132
-                      ...exportStyleSizeClass(styles, size),
133
-                    },
134
-                    styles[locale]
135
-                  )}
136
-                  onClick={() => {
137
-                    onPayItemChange(PAY_CHANNEL.PAYPAL);
138
-                  }}
139
-                >
140
-                  <img
141
-                    src={mobileIconPaypal}
142
-                    alt="paypal"
143
-                    className={styles["payment-method"]}
144
-                  />
145
-                  <div className={styles.platformName}>
146
-                    Paypal
147
-                  </div>
148
-                </div>
149
-              </div>
150
-            </div>
151
-          </div>
152
-        </div>
153
-      );
154
-    }
73
+const PAY_CHANNEL_INSTANCE: Array<{
74
+  image: PAY_CHANNEL_IMAGE;
75
+  text: PAY_CHANNEL_TEXT;
76
+  key: PAY_CHANNEL_CATEGORY_VALUE;
77
+}> = [
78
+  {
79
+    image: {
80
+      desktop: iconAlipay,
81
+      mobile: mobileIconAlipay,
82
+    },
83
+    text: {
84
+      zh: "支付宝",
85
+      en: "Alipay"
86
+    },
87
+    key: PAY_CHANNEL_CATEGORY.ALI,
88
+  },
89
+  {
90
+    image: {
91
+      desktop: iconWechatpay,
92
+      mobile: mobileIconWechatpay,
93
+    },
94
+    text: {
95
+      zh: "微信",
96
+      en: "WeChat",
97
+    },
98
+    key: PAY_CHANNEL_CATEGORY.WX,
99
+  },
100
+  {
101
+    image: {
102
+      desktop: iconPaypal,
103
+      mobile: mobileIconPaypal,
104
+    },
105
+    text: {
106
+      zh: "PayPal",
107
+      en: "PayPal",
108
+    },
109
+    key: PAY_CHANNEL_CATEGORY.PAYPAL,
110
+  }
111
+];
155 112
 
113
+const PayPlatformBlock = ({
114
+  isMobile = false,
115
+  isActive = false,
116
+  size = "normal",
117
+  onClick,
118
+  text,
119
+  image,
120
+  locale = "zh"
121
+}: PayPlatformBlockProps) => {
122
+  const showText = text[locale];
123
+  if (isMobile) {
156 124
     return (
157
-      <div>
158
-        {titleDOM}
159
-        <div className={styles["payment-method-box"]}>
160
-          <div className={styles.flexContainer}>
161
-            <div className={styles.flexItem}>
162
-              <div
163
-                className={classnames(
164
-                  {
165
-                    [styles.payitem]: true,
166
-                    [styles.active]: payitem === PAY_CHANNEL.ALI_WEB,
167
-                    ...exportStyleSizeClass(styles, size),
168
-                  },
169
-                  styles[locale]
170
-                )}
171
-                onClick={() => {
172
-                  onPayItemChange(PAY_CHANNEL.ALI_WEB);
173
-                }}
174
-              >
175
-                <span className={styles["payment-method-before"]} />
176
-                <img
177
-                  src={iconAlipay}
178
-                  alt="alipay"
179
-                  className={styles["payment-method"]}
180
-                />
181
-              </div>
182
-            </div>
183
-            <div className={styles.flexItem}>
184
-              <div
185
-                className={classnames(
186
-                  {
187
-                    [styles.payitem]: true,
188
-                    [styles.active]: payitem === PAY_CHANNEL.WX_NATIVE,
189
-                    ...exportStyleSizeClass(styles, size),
190
-                  },
191
-                  styles[locale]
192
-                )}
193
-                onClick={() => {
194
-                  onPayItemChange(PAY_CHANNEL.WX_NATIVE);
195
-                }}
196
-              >
197
-                <span className={styles["payment-method-before"]} />
198
-                <img
199
-                  src={iconWechatpay}
200
-                  alt="wechatpay"
201
-                  className={styles["payment-method"]}
202
-                />
203
-              </div>
204
-            </div>
205
-            <div className={styles.flexItem}>
206
-              <div
207
-                className={classnames(
208
-                  {
209
-                    [styles.payitem]: true,
210
-                    [styles.active]: payitem === PAY_CHANNEL.PAYPAL,
211
-                    ...exportStyleSizeClass(styles, size),
212
-                  },
213
-                  styles[locale]
214
-                )}
215
-                onClick={() => {
216
-                  onPayItemChange(PAY_CHANNEL.PAYPAL);
217
-                }}
218
-              >
219
-                <span className={styles["payment-method-before"]} />
220
-                <img
221
-                  src={iconPaypal}
222
-                  alt="paypal"
223
-                  className={styles["payment-method"]}
224
-                />
225
-              </div>
226
-            </div>
227
-          </div>
125
+      <div className={styles.flexItem}>
126
+        <div
127
+          className={classnames(
128
+            styles.payChannelBlock,
129
+            {
130
+              [styles.active]: isActive,
131
+              ...exportStyleSizeClass(styles, size)
132
+            },
133
+            styles[locale]
134
+          )}
135
+          onClick={onClick}
136
+        >
137
+          <img src={image.mobile} alt={showText} className={styles.paymentImage} />
138
+          <div className={styles.platformName}>{showText}</div>
228 139
         </div>
229 140
       </div>
230 141
     );
231 142
   }
232
-}
233 143
 
234
-export default PayPlatformOptions;
144
+  return (
145
+    <div className={styles.flexItem}>
146
+      <div
147
+        className={classnames(
148
+          styles.payChannelBlock,
149
+          {
150
+            [styles.active]: isActive,
151
+            ...exportStyleSizeClass(styles, size)
152
+          },
153
+          styles[locale]
154
+        )}
155
+        onClick={onClick}
156
+      >
157
+        <span className={styles["payment-method-before"]} />
158
+        <img src={image.desktop} alt={showText} className={styles.paymentImage} />
159
+      </div>
160
+    </div>
161
+  );
162
+};
163
+
164
+const PayPlatformOptions = ({
165
+  payChannel,
166
+  onPayChannelChange,
167
+  size = "normal",
168
+  isMobile = false,
169
+  withTitle = true,
170
+  titleText,
171
+  locale = "zh"
172
+}: Props) => {
173
+  let titleDOM = null;
174
+  let payListDOM = [
175
+    {
176
+      valueKey: PAY_CHANNEL.ALI_WEB,
177
+      categoryKey: PAY_CHANNEL_CATEGORY.ALI,
178
+    },
179
+    {
180
+      valueKey: PAY_CHANNEL.WX_NATIVE,
181
+      categoryKey: PAY_CHANNEL_CATEGORY.WX,
182
+    },
183
+    {
184
+      valueKey: PAY_CHANNEL.PAYPAL,
185
+      categoryKey: PAY_CHANNEL_CATEGORY.PAYPAL,
186
+    },
187
+  ].map(v => {
188
+    const { valueKey, categoryKey } = v;
189
+    const targetInstance = PAY_CHANNEL_INSTANCE.find(ins => ins.key === categoryKey);
190
+    if (targetInstance) {
191
+      const { text, image } = targetInstance;
192
+      return (
193
+        <PayPlatformBlock
194
+          {...{ isMobile, locale, size }}
195
+          onClick={() => onPayChannelChange(valueKey)}
196
+          isActive={valueKey === payChannel}
197
+          text={text}
198
+          image={image}
199
+        />
200
+      )
201
+    }
202
+  });
203
+  if (withTitle) {
204
+    titleDOM = (
205
+      <div className={styles.label}>
206
+        {titleText || locale === "zh" ? "支付方式" : "Payment"}
207
+      </div>
208
+    );
209
+  }
210
+
211
+  return (
212
+    <div>
213
+      {titleDOM}
214
+      <div
215
+        className={classnames(styles.payChannelBox, {
216
+          [styles.mobile]: isMobile
217
+        })}
218
+      >
219
+        <div className={styles.flexContainer}>
220
+          <div className={styles.flexItem}></div>
221
+        </div>
222
+      </div>
223
+    </div>
224
+  );
225
+};
226
+
227
+// class PayPlatformOptions extends PureComponent<Props, {}> {
228
+//   render() {
229
+//     const {
230
+//       payitem,
231
+//       onPayItemChange,
232
+//       isMobile = false,
233
+//       size = "normal",
234
+//       withTitle = true,
235
+//       titleTxt,
236
+//       locale = "zh"
237
+//     } = this.props;
238
+
239
+//     let titleDOM = null;
240
+//     if (withTitle) {
241
+//       const titleResult = titleTxt || locale === 'zh' ? '支付方式' : 'Payment';
242
+//       titleDOM = (
243
+//         <div className={styles.label}>
244
+//           {titleResult}
245
+//         </div>
246
+//       );
247
+//     }
248
+
249
+//     if (isMobile) {
250
+//       return (
251
+//         <div>
252
+//           {titleDOM}
253
+//           <div
254
+//             className={classnames(styles["payment-method-box"], {
255
+//               [styles.mobile]: isMobile
256
+//             })}
257
+//           >
258
+//             <div className={styles.flexContainer}>
259
+//               <div className={styles.flexItem}>
260
+//                 <div
261
+//                   className={classnames(
262
+//                     {
263
+//                       [styles.payitem]: true,
264
+//                       [styles.active]: payitem === PAY_CHANNEL.ALI_WEB,
265
+//                       ...exportStyleSizeClass(styles, size),
266
+//                     },
267
+//                     styles[locale]
268
+//                   )}
269
+//                   onClick={() => {
270
+//                     onPayItemChange(PAY_CHANNEL.ALI_WEB);
271
+//                   }}
272
+//                 >
273
+//                   <img
274
+//                     src={mobileIconAlipay}
275
+//                     alt="alipay"
276
+//                     className={styles["payment-method"]}
277
+//                   />
278
+//                   <div className={styles.platformName}>
279
+//                     支付宝
280
+//                   </div>
281
+//                 </div>
282
+//               </div>
283
+//               <div className={styles.flexItem}>
284
+//                 <div
285
+//                   className={classnames(
286
+//                     {
287
+//                       [styles.payitem]: true,
288
+//                       [styles.active]: payitem === PAY_CHANNEL.WX_NATIVE,
289
+//                       ...exportStyleSizeClass(styles, size),
290
+//                     },
291
+//                     styles[locale]
292
+//                   )}
293
+//                   onClick={() => {
294
+//                     onPayItemChange(PAY_CHANNEL.WX_NATIVE);
295
+//                   }}
296
+//                 >
297
+//                   <img
298
+//                     src={mobileIconWechatpay}
299
+//                     alt="wechatpay"
300
+//                     className={styles["payment-method"]}
301
+//                   />
302
+//                   <div className={styles.platformName}>
303
+//                     微信
304
+//                   </div>
305
+//                 </div>
306
+//               </div>
307
+//               <div className={styles.flexItem}>
308
+//                 <div
309
+//                   className={classnames(
310
+//                     {
311
+//                       [styles.payitem]: true,
312
+//                       [styles.active]: payitem === PAY_CHANNEL.PAYPAL,
313
+//                       ...exportStyleSizeClass(styles, size),
314
+//                     },
315
+//                     styles[locale]
316
+//                   )}
317
+//                   onClick={() => {
318
+//                     onPayItemChange(PAY_CHANNEL.PAYPAL);
319
+//                   }}
320
+//                 >
321
+//                   <img
322
+//                     src={mobileIconPaypal}
323
+//                     alt="paypal"
324
+//                     className={styles["payment-method"]}
325
+//                   />
326
+//                   <div className={styles.platformName}>
327
+//                     Paypal
328
+//                   </div>
329
+//                 </div>
330
+//               </div>
331
+//             </div>
332
+//           </div>
333
+//         </div>
334
+//       );
335
+//     }
336
+
337
+//     return (
338
+//       <div>
339
+//         {titleDOM}
340
+//         <div className={styles["payment-method-box"]}>
341
+//           <div className={styles.flexContainer}>
342
+//             <div className={styles.flexItem}>
343
+//               <div
344
+//                 className={classnames(
345
+//                   {
346
+//                     [styles.payitem]: true,
347
+//                     [styles.active]: payitem === PAY_CHANNEL.ALI_WEB,
348
+//                     ...exportStyleSizeClass(styles, size),
349
+//                   },
350
+//                   styles[locale]
351
+//                 )}
352
+//                 onClick={() => {
353
+//                   onPayItemChange(PAY_CHANNEL.ALI_WEB);
354
+//                 }}
355
+//               >
356
+//                 <span className={styles["payment-method-before"]} />
357
+//                 <img
358
+//                   src={iconAlipay}
359
+//                   alt="alipay"
360
+//                   className={styles["payment-method"]}
361
+//                 />
362
+//               </div>
363
+//             </div>
364
+//             <div className={styles.flexItem}>
365
+//               <div
366
+//                 className={classnames(
367
+//                   {
368
+//                     [styles.payitem]: true,
369
+//                     [styles.active]: payitem === PAY_CHANNEL.WX_NATIVE,
370
+//                     ...exportStyleSizeClass(styles, size),
371
+//                   },
372
+//                   styles[locale]
373
+//                 )}
374
+//                 onClick={() => {
375
+//                   onPayItemChange(PAY_CHANNEL.WX_NATIVE);
376
+//                 }}
377
+//               >
378
+//                 <span className={styles["payment-method-before"]} />
379
+//                 <img
380
+//                   src={iconWechatpay}
381
+//                   alt="wechatpay"
382
+//                   className={styles["payment-method"]}
383
+//                 />
384
+//               </div>
385
+//             </div>
386
+//             <div className={styles.flexItem}>
387
+//               <div
388
+//                 className={classnames(
389
+//                   {
390
+//                     [styles.payitem]: true,
391
+//                     [styles.active]: payitem === PAY_CHANNEL.PAYPAL,
392
+//                     ...exportStyleSizeClass(styles, size),
393
+//                   },
394
+//                   styles[locale]
395
+//                 )}
396
+//                 onClick={() => {
397
+//                   onPayItemChange(PAY_CHANNEL.PAYPAL);
398
+//                 }}
399
+//               >
400
+//                 <span className={styles["payment-method-before"]} />
401
+//                 <img
402
+//                   src={iconPaypal}
403
+//                   alt="paypal"
404
+//                   className={styles["payment-method"]}
405
+//                 />
406
+//               </div>
407
+//             </div>
408
+//           </div>
409
+//         </div>
410
+//       </div>
411
+//     );
412
+//   }
413
+// }
414
+
415
+export default PayPlatformOptions;

+ 2
- 1
stories/Payment.stories.tsx View File

@@ -1,4 +1,4 @@
1
-import React from 'react';
1
+import React, { MouseEvent } from 'react';
2 2
 import { storiesOf } from '@storybook/react';
3 3
 import { action } from '@storybook/addon-actions';
4 4
 import { withInfo } from "@storybook/addon-info";
@@ -174,6 +174,7 @@ stories.add(
174 174
     return <ConsumeListView
175 175
       isToggle={toggle}
176 176
       onToggleChange={() => setToggle(!toggle)}
177
+      onConsumeItemClick={(e: MouseEvent, clickData: any) => { console.log(clickData); }}
177 178
       dataSource={consumeData}
178 179
       listLength={consumeData.length}
179 180
       showLength={number("showLength", 5)}