Browse Source

dev: 引入external的antd库提供基本组件支持

Roxas 4 years ago
parent
commit
f7df7ab98a

+ 1
- 0
eslib/Payment/index.js View File

@@ -5,6 +5,7 @@ import '../style-inject.es-1f59c1d0.js';
5 5
 import '../utils-82346768.js';
6 6
 export { default as ConsumeListView } from '../ConsumeListView/index.js';
7 7
 export { default as PayPlatformOptions } from '../PayPlatformOptions/index.js';
8
+import 'antd';
8 9
 export { default as PriceOptions } from '../PriceOptions/index.js';
9 10
 export { default as WaitPayInfoView } from '../WaitPayInfoView/index.js';
10 11
 //# sourceMappingURL=index.js.map

+ 1
- 1
eslib/Payment/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
1
+{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;"}

+ 34
- 1
eslib/PriceOptions/index.js View File

@@ -3,6 +3,7 @@ import React, { useState } from 'react';
3 3
 import { c as classnames } from '../index-7951fb2f.js';
4 4
 import { s as styleInject } from '../style-inject.es-1f59c1d0.js';
5 5
 import { f as formatMoney } from '../utils-82346768.js';
6
+import { Input } from 'antd';
6 7
 
7 8
 var css = ".PriceOptions_options__J-ZSS {\n  padding: 20px 50px;\n  border-bottom: 1px dashed #00000017;\n}\n.PriceOptions_options__J-ZSS p {\n  font-size: 14px;\n  font-weight: 400;\n  color: #616a79;\n  margin-bottom: 20px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a {\n  padding-right: 0;\n  margin-bottom: -12px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2 {\n  background: rgba(243, 243, 243, 0.14);\n  border-radius: 4px;\n  border: 1px solid #cfcfcf;\n  font-size: 14px;\n  font-weight: 600;\n  color: #616a79;\n  display: inline-block;\n  text-align: center;\n  vertical-align: top;\n  height: 30px;\n  width: 70px;\n  line-height: 30px;\n  cursor: pointer;\n  margin: 6px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2.PriceOptions_active__3WyAU {\n  background: rgba(255, 50, 102, 0.1);\n  border-radius: 4px;\n  border: 1px solid #ff3266;\n  color: #616a79;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceInput__1MrVy {\n  display: inline-block;\n  min-width: 70px;\n  width: auto;\n  margin: 6px;\n  text-align: center;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a button {\n  border-top-left-radius: 0;\n  border-bottom-left-radius: 0;\n  height: 30px;\n  width: 50px;\n  vertical-align: top;\n  padding: 0 5px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_rate__QgHQ3 {\n  margin-left: 10px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_rate__QgHQ3 i {\n  margin-right: 5px;\n  color: #1790FF;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl {\n  padding: 0 0 12px 0;\n  border-bottom: none;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl p {\n  margin-bottom: 8px;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl .PriceOptions_infoItem__3IL3a {\n  text-align: center;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2 {\n  border-radius: 6px;\n  height: 32px;\n  width: 72px;\n  margin: 0 0 12px 19px;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2:first-child {\n  margin: 0 0 12px 0px;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl .PriceOptions_infoItem__3IL3a .PriceOptions_priceInput__1MrVy {\n  display: block;\n  width: 254px;\n  border-radius: 6px;\n  height: 32px;\n}\n@media (max-width: 768px) {\n  .PriceOptions_options__J-ZSS {\n    padding: 20px 20px;\n  }\n  .PriceOptions_options__J-ZSS p {\n    font-size: 14px;\n    font-weight: 400;\n    color: #616a79;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a {\n    padding-right: 0;\n    display: flex;\n    flex-direction: column;\n    justify-content: center;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceBtn__Xz4m_ {\n    display: flex;\n    justify-content: space-between;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2 {\n    display: inline-block;\n    background-color: #fff;\n    width: 74px;\n    height: 36px;\n    line-height: 36px;\n    border-radius: 6px;\n    border: 1px solid #cfcfcf;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2.PriceOptions_active__3WyAU {\n    background-color: #fff;\n    color: #FF3266FF;\n    border-radius: 4px;\n    border: 1px solid #ff3266;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceInput__1MrVy {\n    border-radius: 6px;\n    height: 36px;\n    width: auto;\n  }\n}\n";
8 9
 var styles = {"options":"PriceOptions_options__J-ZSS","infoItem":"PriceOptions_infoItem__3IL3a","priceItem":"PriceOptions_priceItem__rJ9o2","active":"PriceOptions_active__3WyAU","priceInput":"PriceOptions_priceInput__1MrVy","rate":"PriceOptions_rate__QgHQ3","small":"PriceOptions_small__2-wzl","priceBtn":"PriceOptions_priceBtn__Xz4m_"};
@@ -13,6 +14,7 @@ var PriceOptions = function PriceOptions(_ref) {
13 14
       onPriceChange = _ref.onPriceChange,
14 15
       _ref$size = _ref.size,
15 16
       _ref$focusScroll = _ref.focusScroll,
17
+      focusScroll = _ref$focusScroll === void 0 ? true : _ref$focusScroll,
16 18
       _ref$withTitle = _ref.withTitle,
17 19
       withTitle = _ref$withTitle === void 0 ? true : _ref$withTitle,
18 20
       _ref$titleText = _ref.titleText,
@@ -42,7 +44,38 @@ var PriceOptions = function PriceOptions(_ref) {
42 44
         setInputStatus(false);
43 45
       }
44 46
     }, formatMoney(item / 100, 0), "\xA5");
45
-  }))));
47
+  })), React.createElement(Input, {
48
+    ref: inputRef,
49
+    onMouseEnter: function onMouseEnter() {
50
+      if (inputStatus && inputRef && inputRef.current) {
51
+        inputRef.current.focus();
52
+        inputRef.current.select();
53
+      }
54
+    },
55
+    suffix: "\xA5",
56
+    className: styles.priceInput,
57
+    value: inputStatus ? price / 100 || "" : "",
58
+    placeholder: "Others",
59
+    onChange: function onChange(e) {
60
+      var n = +e.target.value;
61
+
62
+      if (Number.isNaN(n)) {
63
+        return;
64
+      } // 测试暂时改成1分
65
+
66
+
67
+      onPriceChange(n * 100);
68
+    },
69
+    onClick: function onClick(e) {
70
+      onPriceChange(0);
71
+      setInputStatus(true);
72
+    },
73
+    onFocus: function onFocus(e) {
74
+      if (focusScroll) {
75
+        e.target.scrollIntoView();
76
+      }
77
+    }
78
+  })));
46 79
 };
47 80
 
48 81
 export default PriceOptions;

+ 1
- 1
eslib/PriceOptions/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index.js","sources":["../../src/components/Payment/PriceOptions/index.tsx"],"sourcesContent":["import React, { useState } from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { formatMoney } from \"../Utils/utils\";\r\n\r\nimport styles from \"./PriceOptions.less\";\r\n\r\ninterface Props {\r\n  price: number;\r\n  onPriceChange: (v: number) => void;\r\n  size: \"small\" | \"normal\" | \"large\";\r\n  focusScroll: boolean;\r\n  withTitle: boolean;\r\n  titleText: string;\r\n  inputRef: React.RefObject<any>;\r\n}\r\n\r\nconst PriceOptions = ({\r\n  price,\r\n  onPriceChange,\r\n  size = \"normal\",\r\n  focusScroll = true,\r\n  withTitle = true,\r\n  titleText = \"Price\",\r\n  inputRef\r\n}: Props) => {\r\n  const defaultOptions = [100, 600, 800];\r\n  // 控制是否为其他金额输入情况\r\n  const [inputStatus, setInputStatus] = useState(false);\r\n\r\n  return (\r\n    <div\r\n      className={classnames(styles.options)}\r\n    >\r\n      {withTitle ? (\r\n        <p>\r\n          {titleText}\r\n        </p>\r\n      ) : null}\r\n      <div className={styles.infoItem}>\r\n        <span className={styles.priceBtn}>\r\n          {defaultOptions.map(item => (\r\n            <span\r\n              className={classnames({\r\n                [styles.priceItem]: true,\r\n                [styles.active]: price === item && !inputStatus\r\n              })}\r\n              key={item}\r\n              onClick={() => {\r\n                onPriceChange(item);\r\n                setInputStatus(false);\r\n              }}\r\n            >\r\n              {formatMoney(item/100, 0)}¥\r\n            </span>\r\n          ))}\r\n        </span>\r\n        {/* <Input\r\n          ref={inputRef}\r\n          onMouseEnter={() => {\r\n            if (inputStatus && inputRef && inputRef.current) {\r\n              inputRef.current.focus();\r\n              inputRef.current.select();\r\n            }\r\n          }}\r\n          suffix=\"¥\"\r\n          className={styles.priceInput}\r\n          value={inputStatus ? price / 100 || \"\" : \"\"}\r\n          placeholder=\"Others\"\r\n          onChange={e => {\r\n            const n = +e.target.value;\r\n            if (Number.isNaN(n)) {\r\n              return;\r\n            }\r\n            // 测试暂时改成1分\r\n            onPriceChange(n * 100);\r\n          }}\r\n          onClick={e => {\r\n            onPriceChange(0);\r\n            setInputStatus(true);\r\n          }}\r\n          onFocus={e => {\r\n            if (focusScroll) {\r\n              e.target.scrollIntoView();\r\n            }\r\n          }}\r\n        /> */}\r\n      </div>\r\n    </div>\r\n  );\r\n};\r\n\r\nexport default PriceOptions;\r\n"],"names":["PriceOptions","price","onPriceChange","size","focusScroll","withTitle","titleText","inputRef","defaultOptions","useState","inputStatus","setInputStatus","classnames","styles","options","infoItem","priceBtn","map","item","priceItem","active","formatMoney"],"mappings":";;;;;;;;;;AAgBA,IAAMA,YAAY,GAAG,SAAfA,YAAe,OAQR;MAPXC,KAOW,QAPXA,KAOW;MANXC,aAMW,QANXA,aAMW;uBALXC,IAKW;MALXA,wBACAC,WAIW;MAJXA,sBACAC,SAGW;MAHXA,SAGW,+BAHC,IAGD;4BAFXC,SAEW;MAFXA,SAEW,+BAFC,OAED;MADXC,QACW,QADXA,QACW;MACLC,cAAc,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAvB,CADW;;kBAG2BC,QAAQ,CAAC,KAAD,CAHnC;;MAGJC,WAHI;MAGSC,cAHT;;SAMT;IACE,SAAS,EAAEC,UAAU,CAACC,MAAM,CAACC,OAAR;KAEpBT,SAAS,GACR,+BACGC,SADH,CADQ,GAIN,IAPN,EAQE;IAAK,SAAS,EAAEO,MAAM,CAACE;KACrB;IAAM,SAAS,EAAEF,MAAM,CAACG;KACrBR,cAAc,CAACS,GAAf,CAAmB,UAAAC,IAAI;;;WACtB;MACE,SAAS,EAAEN,UAAU,iDAClBC,MAAM,CAACM,SADW,EACC,IADD,gCAElBN,MAAM,CAACO,MAFW,EAEFnB,KAAK,KAAKiB,IAAV,IAAkB,CAACR,WAFjB,gBADvB;MAKE,GAAG,EAAEQ,IALP;MAME,OAAO,EAAE,mBAAM;QACbhB,aAAa,CAACgB,IAAD,CAAb;QACAP,cAAc,CAAC,KAAD,CAAd;;OAGDU,WAAW,CAACH,IAAI,GAAC,GAAN,EAAW,CAAX,CAXd,SADsB;GAAvB,CADH,CADF,CARF,CADF;CAbF;;;;"}
1
+{"version":3,"file":"index.js","sources":["../../src/components/Payment/PriceOptions/index.tsx"],"sourcesContent":["import React, { useState } from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { Input } from 'antd';\r\nimport { formatMoney } from \"../Utils/utils\";\r\n\r\nimport styles from \"./PriceOptions.less\";\r\n\r\ninterface Props {\r\n  price: number;\r\n  onPriceChange: (v: number) => void;\r\n  size: \"small\" | \"normal\" | \"large\";\r\n  focusScroll: boolean;\r\n  withTitle: boolean;\r\n  titleText: string;\r\n  inputRef: React.RefObject<any>;\r\n}\r\n\r\nconst PriceOptions = ({\r\n  price,\r\n  onPriceChange,\r\n  size = \"normal\",\r\n  focusScroll = true,\r\n  withTitle = true,\r\n  titleText = \"Price\",\r\n  inputRef\r\n}: Props) => {\r\n  const defaultOptions = [100, 600, 800];\r\n  // 控制是否为其他金额输入情况\r\n  const [inputStatus, setInputStatus] = useState(false);\r\n\r\n  return (\r\n    <div\r\n      className={classnames(styles.options)}\r\n    >\r\n      {withTitle ? (\r\n        <p>\r\n          {titleText}\r\n        </p>\r\n      ) : null}\r\n      <div className={styles.infoItem}>\r\n        <span className={styles.priceBtn}>\r\n          {defaultOptions.map(item => (\r\n            <span\r\n              className={classnames({\r\n                [styles.priceItem]: true,\r\n                [styles.active]: price === item && !inputStatus\r\n              })}\r\n              key={item}\r\n              onClick={() => {\r\n                onPriceChange(item);\r\n                setInputStatus(false);\r\n              }}\r\n            >\r\n              {formatMoney(item/100, 0)}¥\r\n            </span>\r\n          ))}\r\n        </span>\r\n        <Input\r\n          ref={inputRef}\r\n          onMouseEnter={() => {\r\n            if (inputStatus && inputRef && inputRef.current) {\r\n              inputRef.current.focus();\r\n              inputRef.current.select();\r\n            }\r\n          }}\r\n          suffix=\"¥\"\r\n          className={styles.priceInput}\r\n          value={inputStatus ? price / 100 || \"\" : \"\"}\r\n          placeholder=\"Others\"\r\n          onChange={e => {\r\n            const n = +e.target.value;\r\n            if (Number.isNaN(n)) {\r\n              return;\r\n            }\r\n            // 测试暂时改成1分\r\n            onPriceChange(n * 100);\r\n          }}\r\n          onClick={e => {\r\n            onPriceChange(0);\r\n            setInputStatus(true);\r\n          }}\r\n          onFocus={e => {\r\n            if (focusScroll) {\r\n              e.target.scrollIntoView();\r\n            }\r\n          }}\r\n        />\r\n      </div>\r\n    </div>\r\n  );\r\n};\r\n\r\nexport default PriceOptions;\r\n"],"names":["PriceOptions","price","onPriceChange","size","focusScroll","withTitle","titleText","inputRef","defaultOptions","useState","inputStatus","setInputStatus","classnames","styles","options","infoItem","priceBtn","map","item","priceItem","active","formatMoney","current","focus","select","priceInput","e","n","target","value","Number","isNaN","scrollIntoView"],"mappings":";;;;;;;;;;;AAiBA,IAAMA,YAAY,GAAG,SAAfA,YAAe,OAQR;MAPXC,KAOW,QAPXA,KAOW;MANXC,aAMW,QANXA,aAMW;uBALXC,IAKW;MALXA,wBACAC,WAIW;MAJXA,WAIW,iCAJG,IAIH;4BAHXC,SAGW;MAHXA,SAGW,+BAHC,IAGD;4BAFXC,SAEW;MAFXA,SAEW,+BAFC,OAED;MADXC,QACW,QADXA,QACW;MACLC,cAAc,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAvB,CADW;;kBAG2BC,QAAQ,CAAC,KAAD,CAHnC;;MAGJC,WAHI;MAGSC,cAHT;;SAMT;IACE,SAAS,EAAEC,UAAU,CAACC,MAAM,CAACC,OAAR;KAEpBT,SAAS,GACR,+BACGC,SADH,CADQ,GAIN,IAPN,EAQE;IAAK,SAAS,EAAEO,MAAM,CAACE;KACrB;IAAM,SAAS,EAAEF,MAAM,CAACG;KACrBR,cAAc,CAACS,GAAf,CAAmB,UAAAC,IAAI;;;WACtB;MACE,SAAS,EAAEN,UAAU,iDAClBC,MAAM,CAACM,SADW,EACC,IADD,gCAElBN,MAAM,CAACO,MAFW,EAEFnB,KAAK,KAAKiB,IAAV,IAAkB,CAACR,WAFjB,gBADvB;MAKE,GAAG,EAAEQ,IALP;MAME,OAAO,EAAE,mBAAM;QACbhB,aAAa,CAACgB,IAAD,CAAb;QACAP,cAAc,CAAC,KAAD,CAAd;;OAGDU,WAAW,CAACH,IAAI,GAAC,GAAN,EAAW,CAAX,CAXd,SADsB;GAAvB,CADH,CADF,EAkBE,oBAAC,KAAD;IACE,GAAG,EAAEX,QADP;IAEE,YAAY,EAAE,wBAAM;UACdG,WAAW,IAAIH,QAAf,IAA2BA,QAAQ,CAACe,OAAxC,EAAiD;QAC/Cf,QAAQ,CAACe,OAAT,CAAiBC,KAAjB;QACAhB,QAAQ,CAACe,OAAT,CAAiBE,MAAjB;;KALN;IAQE,MAAM,EAAC,MART;IASE,SAAS,EAAEX,MAAM,CAACY,UATpB;IAUE,KAAK,EAAEf,WAAW,GAAGT,KAAK,GAAG,GAAR,IAAe,EAAlB,GAAuB,EAV3C;IAWE,WAAW,EAAC,QAXd;IAYE,QAAQ,EAAE,kBAAAyB,CAAC,EAAI;UACPC,CAAC,GAAG,CAACD,CAAC,CAACE,MAAF,CAASC,KAApB;;UACIC,MAAM,CAACC,KAAP,CAAaJ,CAAb,CAAJ,EAAqB;;OAFR;;;MAMbzB,aAAa,CAACyB,CAAC,GAAG,GAAL,CAAb;KAlBJ;IAoBE,OAAO,EAAE,iBAAAD,CAAC,EAAI;MACZxB,aAAa,CAAC,CAAD,CAAb;MACAS,cAAc,CAAC,IAAD,CAAd;KAtBJ;IAwBE,OAAO,EAAE,iBAAAe,CAAC,EAAI;UACRtB,WAAJ,EAAiB;QACfsB,CAAC,CAACE,MAAF,CAASI,cAAT;;;IA5CR,CARF,CADF;CAbF;;;;"}

+ 1
- 0
eslib/index.js View File

@@ -6,6 +6,7 @@ import './test-81795c27.js';
6 6
 import './utils-82346768.js';
7 7
 export { default as ConsumeListView } from './ConsumeListView/index.js';
8 8
 export { default as PayPlatformOptions } from './PayPlatformOptions/index.js';
9
+import 'antd';
9 10
 export { default as PriceOptions } from './PriceOptions/index.js';
10 11
 export { default as WaitPayInfoView } from './WaitPayInfoView/index.js';
11 12
 

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


+ 1
- 0
lib/Payment/index.js View File

@@ -9,6 +9,7 @@ require('../style-inject.es-dcee06b6.js');
9 9
 require('../utils-ed518bfc.js');
10 10
 var ConsumeListView = require('../ConsumeListView/index.js');
11 11
 var PayPlatformOptions = require('../PayPlatformOptions/index.js');
12
+require('antd');
12 13
 var PriceOptions = require('../PriceOptions/index.js');
13 14
 var WaitPayInfoView = require('../WaitPayInfoView/index.js');
14 15
 

+ 1
- 1
lib/Payment/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;"}
1
+{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}

+ 34
- 1
lib/PriceOptions/index.js View File

@@ -10,6 +10,7 @@ var React__default = _interopDefault(React);
10 10
 var index = require('../index-c2424ad4.js');
11 11
 var styleInject_es = require('../style-inject.es-dcee06b6.js');
12 12
 var utils = require('../utils-ed518bfc.js');
13
+var antd = require('antd');
13 14
 
14 15
 var css = ".PriceOptions_options__J-ZSS {\n  padding: 20px 50px;\n  border-bottom: 1px dashed #00000017;\n}\n.PriceOptions_options__J-ZSS p {\n  font-size: 14px;\n  font-weight: 400;\n  color: #616a79;\n  margin-bottom: 20px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a {\n  padding-right: 0;\n  margin-bottom: -12px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2 {\n  background: rgba(243, 243, 243, 0.14);\n  border-radius: 4px;\n  border: 1px solid #cfcfcf;\n  font-size: 14px;\n  font-weight: 600;\n  color: #616a79;\n  display: inline-block;\n  text-align: center;\n  vertical-align: top;\n  height: 30px;\n  width: 70px;\n  line-height: 30px;\n  cursor: pointer;\n  margin: 6px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2.PriceOptions_active__3WyAU {\n  background: rgba(255, 50, 102, 0.1);\n  border-radius: 4px;\n  border: 1px solid #ff3266;\n  color: #616a79;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceInput__1MrVy {\n  display: inline-block;\n  min-width: 70px;\n  width: auto;\n  margin: 6px;\n  text-align: center;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a button {\n  border-top-left-radius: 0;\n  border-bottom-left-radius: 0;\n  height: 30px;\n  width: 50px;\n  vertical-align: top;\n  padding: 0 5px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_rate__QgHQ3 {\n  margin-left: 10px;\n}\n.PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_rate__QgHQ3 i {\n  margin-right: 5px;\n  color: #1790FF;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl {\n  padding: 0 0 12px 0;\n  border-bottom: none;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl p {\n  margin-bottom: 8px;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl .PriceOptions_infoItem__3IL3a {\n  text-align: center;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2 {\n  border-radius: 6px;\n  height: 32px;\n  width: 72px;\n  margin: 0 0 12px 19px;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2:first-child {\n  margin: 0 0 12px 0px;\n}\n.PriceOptions_options__J-ZSS.PriceOptions_small__2-wzl .PriceOptions_infoItem__3IL3a .PriceOptions_priceInput__1MrVy {\n  display: block;\n  width: 254px;\n  border-radius: 6px;\n  height: 32px;\n}\n@media (max-width: 768px) {\n  .PriceOptions_options__J-ZSS {\n    padding: 20px 20px;\n  }\n  .PriceOptions_options__J-ZSS p {\n    font-size: 14px;\n    font-weight: 400;\n    color: #616a79;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a {\n    padding-right: 0;\n    display: flex;\n    flex-direction: column;\n    justify-content: center;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceBtn__Xz4m_ {\n    display: flex;\n    justify-content: space-between;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2 {\n    display: inline-block;\n    background-color: #fff;\n    width: 74px;\n    height: 36px;\n    line-height: 36px;\n    border-radius: 6px;\n    border: 1px solid #cfcfcf;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceItem__rJ9o2.PriceOptions_active__3WyAU {\n    background-color: #fff;\n    color: #FF3266FF;\n    border-radius: 4px;\n    border: 1px solid #ff3266;\n  }\n  .PriceOptions_options__J-ZSS .PriceOptions_infoItem__3IL3a .PriceOptions_priceInput__1MrVy {\n    border-radius: 6px;\n    height: 36px;\n    width: auto;\n  }\n}\n";
15 16
 var styles = {"options":"PriceOptions_options__J-ZSS","infoItem":"PriceOptions_infoItem__3IL3a","priceItem":"PriceOptions_priceItem__rJ9o2","active":"PriceOptions_active__3WyAU","priceInput":"PriceOptions_priceInput__1MrVy","rate":"PriceOptions_rate__QgHQ3","small":"PriceOptions_small__2-wzl","priceBtn":"PriceOptions_priceBtn__Xz4m_"};
@@ -20,6 +21,7 @@ var PriceOptions = function PriceOptions(_ref) {
20 21
       onPriceChange = _ref.onPriceChange,
21 22
       _ref$size = _ref.size,
22 23
       _ref$focusScroll = _ref.focusScroll,
24
+      focusScroll = _ref$focusScroll === void 0 ? true : _ref$focusScroll,
23 25
       _ref$withTitle = _ref.withTitle,
24 26
       withTitle = _ref$withTitle === void 0 ? true : _ref$withTitle,
25 27
       _ref$titleText = _ref.titleText,
@@ -49,7 +51,38 @@ var PriceOptions = function PriceOptions(_ref) {
49 51
         setInputStatus(false);
50 52
       }
51 53
     }, utils.formatMoney(item / 100, 0), "\xA5");
52
-  }))));
54
+  })), React__default.createElement(antd.Input, {
55
+    ref: inputRef,
56
+    onMouseEnter: function onMouseEnter() {
57
+      if (inputStatus && inputRef && inputRef.current) {
58
+        inputRef.current.focus();
59
+        inputRef.current.select();
60
+      }
61
+    },
62
+    suffix: "\xA5",
63
+    className: styles.priceInput,
64
+    value: inputStatus ? price / 100 || "" : "",
65
+    placeholder: "Others",
66
+    onChange: function onChange(e) {
67
+      var n = +e.target.value;
68
+
69
+      if (Number.isNaN(n)) {
70
+        return;
71
+      } // 测试暂时改成1分
72
+
73
+
74
+      onPriceChange(n * 100);
75
+    },
76
+    onClick: function onClick(e) {
77
+      onPriceChange(0);
78
+      setInputStatus(true);
79
+    },
80
+    onFocus: function onFocus(e) {
81
+      if (focusScroll) {
82
+        e.target.scrollIntoView();
83
+      }
84
+    }
85
+  })));
53 86
 };
54 87
 
55 88
 exports.default = PriceOptions;

+ 1
- 1
lib/PriceOptions/index.js.map View File

@@ -1 +1 @@
1
-{"version":3,"file":"index.js","sources":["../../src/components/Payment/PriceOptions/index.tsx"],"sourcesContent":["import React, { useState } from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { formatMoney } from \"../Utils/utils\";\r\n\r\nimport styles from \"./PriceOptions.less\";\r\n\r\ninterface Props {\r\n  price: number;\r\n  onPriceChange: (v: number) => void;\r\n  size: \"small\" | \"normal\" | \"large\";\r\n  focusScroll: boolean;\r\n  withTitle: boolean;\r\n  titleText: string;\r\n  inputRef: React.RefObject<any>;\r\n}\r\n\r\nconst PriceOptions = ({\r\n  price,\r\n  onPriceChange,\r\n  size = \"normal\",\r\n  focusScroll = true,\r\n  withTitle = true,\r\n  titleText = \"Price\",\r\n  inputRef\r\n}: Props) => {\r\n  const defaultOptions = [100, 600, 800];\r\n  // 控制是否为其他金额输入情况\r\n  const [inputStatus, setInputStatus] = useState(false);\r\n\r\n  return (\r\n    <div\r\n      className={classnames(styles.options)}\r\n    >\r\n      {withTitle ? (\r\n        <p>\r\n          {titleText}\r\n        </p>\r\n      ) : null}\r\n      <div className={styles.infoItem}>\r\n        <span className={styles.priceBtn}>\r\n          {defaultOptions.map(item => (\r\n            <span\r\n              className={classnames({\r\n                [styles.priceItem]: true,\r\n                [styles.active]: price === item && !inputStatus\r\n              })}\r\n              key={item}\r\n              onClick={() => {\r\n                onPriceChange(item);\r\n                setInputStatus(false);\r\n              }}\r\n            >\r\n              {formatMoney(item/100, 0)}¥\r\n            </span>\r\n          ))}\r\n        </span>\r\n        {/* <Input\r\n          ref={inputRef}\r\n          onMouseEnter={() => {\r\n            if (inputStatus && inputRef && inputRef.current) {\r\n              inputRef.current.focus();\r\n              inputRef.current.select();\r\n            }\r\n          }}\r\n          suffix=\"¥\"\r\n          className={styles.priceInput}\r\n          value={inputStatus ? price / 100 || \"\" : \"\"}\r\n          placeholder=\"Others\"\r\n          onChange={e => {\r\n            const n = +e.target.value;\r\n            if (Number.isNaN(n)) {\r\n              return;\r\n            }\r\n            // 测试暂时改成1分\r\n            onPriceChange(n * 100);\r\n          }}\r\n          onClick={e => {\r\n            onPriceChange(0);\r\n            setInputStatus(true);\r\n          }}\r\n          onFocus={e => {\r\n            if (focusScroll) {\r\n              e.target.scrollIntoView();\r\n            }\r\n          }}\r\n        /> */}\r\n      </div>\r\n    </div>\r\n  );\r\n};\r\n\r\nexport default PriceOptions;\r\n"],"names":["PriceOptions","price","onPriceChange","size","focusScroll","withTitle","titleText","inputRef","defaultOptions","useState","inputStatus","setInputStatus","React","classnames","styles","options","infoItem","priceBtn","map","item","priceItem","active","formatMoney"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,IAAMA,YAAY,GAAG,SAAfA,YAAe,OAQR;MAPXC,KAOW,QAPXA,KAOW;MANXC,aAMW,QANXA,aAMW;uBALXC,IAKW;MALXA,wBACAC,WAIW;MAJXA,sBACAC,SAGW;MAHXA,SAGW,+BAHC,IAGD;4BAFXC,SAEW;MAFXA,SAEW,+BAFC,OAED;MADXC,QACW,QADXA,QACW;MACLC,cAAc,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAvB,CADW;;kBAG2BC,cAAQ,CAAC,KAAD,CAHnC;;MAGJC,WAHI;MAGSC,cAHT;;SAMTC;IACE,SAAS,EAAEC,gBAAU,CAACC,MAAM,CAACC,OAAR;KAEpBV,SAAS,GACRO,wCACGN,SADH,CADQ,GAIN,IAPN,EAQEM;IAAK,SAAS,EAAEE,MAAM,CAACE;KACrBJ;IAAM,SAAS,EAAEE,MAAM,CAACG;KACrBT,cAAc,CAACU,GAAf,CAAmB,UAAAC,IAAI;;;WACtBP;MACE,SAAS,EAAEC,gBAAU,kEAClBC,MAAM,CAACM,SADW,EACC,IADD,iDAElBN,MAAM,CAACO,MAFW,EAEFpB,KAAK,KAAKkB,IAAV,IAAkB,CAACT,WAFjB,gBADvB;MAKE,GAAG,EAAES,IALP;MAME,OAAO,EAAE,mBAAM;QACbjB,aAAa,CAACiB,IAAD,CAAb;QACAR,cAAc,CAAC,KAAD,CAAd;;OAGDW,iBAAW,CAACH,IAAI,GAAC,GAAN,EAAW,CAAX,CAXd,SADsB;GAAvB,CADH,CADF,CARF,CADF;CAbF;;;;"}
1
+{"version":3,"file":"index.js","sources":["../../src/components/Payment/PriceOptions/index.tsx"],"sourcesContent":["import React, { useState } from \"react\";\r\nimport classnames from \"classnames\";\r\nimport { Input } from 'antd';\r\nimport { formatMoney } from \"../Utils/utils\";\r\n\r\nimport styles from \"./PriceOptions.less\";\r\n\r\ninterface Props {\r\n  price: number;\r\n  onPriceChange: (v: number) => void;\r\n  size: \"small\" | \"normal\" | \"large\";\r\n  focusScroll: boolean;\r\n  withTitle: boolean;\r\n  titleText: string;\r\n  inputRef: React.RefObject<any>;\r\n}\r\n\r\nconst PriceOptions = ({\r\n  price,\r\n  onPriceChange,\r\n  size = \"normal\",\r\n  focusScroll = true,\r\n  withTitle = true,\r\n  titleText = \"Price\",\r\n  inputRef\r\n}: Props) => {\r\n  const defaultOptions = [100, 600, 800];\r\n  // 控制是否为其他金额输入情况\r\n  const [inputStatus, setInputStatus] = useState(false);\r\n\r\n  return (\r\n    <div\r\n      className={classnames(styles.options)}\r\n    >\r\n      {withTitle ? (\r\n        <p>\r\n          {titleText}\r\n        </p>\r\n      ) : null}\r\n      <div className={styles.infoItem}>\r\n        <span className={styles.priceBtn}>\r\n          {defaultOptions.map(item => (\r\n            <span\r\n              className={classnames({\r\n                [styles.priceItem]: true,\r\n                [styles.active]: price === item && !inputStatus\r\n              })}\r\n              key={item}\r\n              onClick={() => {\r\n                onPriceChange(item);\r\n                setInputStatus(false);\r\n              }}\r\n            >\r\n              {formatMoney(item/100, 0)}¥\r\n            </span>\r\n          ))}\r\n        </span>\r\n        <Input\r\n          ref={inputRef}\r\n          onMouseEnter={() => {\r\n            if (inputStatus && inputRef && inputRef.current) {\r\n              inputRef.current.focus();\r\n              inputRef.current.select();\r\n            }\r\n          }}\r\n          suffix=\"¥\"\r\n          className={styles.priceInput}\r\n          value={inputStatus ? price / 100 || \"\" : \"\"}\r\n          placeholder=\"Others\"\r\n          onChange={e => {\r\n            const n = +e.target.value;\r\n            if (Number.isNaN(n)) {\r\n              return;\r\n            }\r\n            // 测试暂时改成1分\r\n            onPriceChange(n * 100);\r\n          }}\r\n          onClick={e => {\r\n            onPriceChange(0);\r\n            setInputStatus(true);\r\n          }}\r\n          onFocus={e => {\r\n            if (focusScroll) {\r\n              e.target.scrollIntoView();\r\n            }\r\n          }}\r\n        />\r\n      </div>\r\n    </div>\r\n  );\r\n};\r\n\r\nexport default PriceOptions;\r\n"],"names":["PriceOptions","price","onPriceChange","size","focusScroll","withTitle","titleText","inputRef","defaultOptions","useState","inputStatus","setInputStatus","React","classnames","styles","options","infoItem","priceBtn","map","item","priceItem","active","formatMoney","Input","current","focus","select","priceInput","e","n","target","value","Number","isNaN","scrollIntoView"],"mappings":";;;;;;;;;;;;;;;;;;AAiBA,IAAMA,YAAY,GAAG,SAAfA,YAAe,OAQR;MAPXC,KAOW,QAPXA,KAOW;MANXC,aAMW,QANXA,aAMW;uBALXC,IAKW;MALXA,wBACAC,WAIW;MAJXA,WAIW,iCAJG,IAIH;4BAHXC,SAGW;MAHXA,SAGW,+BAHC,IAGD;4BAFXC,SAEW;MAFXA,SAEW,+BAFC,OAED;MADXC,QACW,QADXA,QACW;MACLC,cAAc,GAAG,CAAC,GAAD,EAAM,GAAN,EAAW,GAAX,CAAvB,CADW;;kBAG2BC,cAAQ,CAAC,KAAD,CAHnC;;MAGJC,WAHI;MAGSC,cAHT;;SAMTC;IACE,SAAS,EAAEC,gBAAU,CAACC,MAAM,CAACC,OAAR;KAEpBV,SAAS,GACRO,wCACGN,SADH,CADQ,GAIN,IAPN,EAQEM;IAAK,SAAS,EAAEE,MAAM,CAACE;KACrBJ;IAAM,SAAS,EAAEE,MAAM,CAACG;KACrBT,cAAc,CAACU,GAAf,CAAmB,UAAAC,IAAI;;;WACtBP;MACE,SAAS,EAAEC,gBAAU,kEAClBC,MAAM,CAACM,SADW,EACC,IADD,iDAElBN,MAAM,CAACO,MAFW,EAEFpB,KAAK,KAAKkB,IAAV,IAAkB,CAACT,WAFjB,gBADvB;MAKE,GAAG,EAAES,IALP;MAME,OAAO,EAAE,mBAAM;QACbjB,aAAa,CAACiB,IAAD,CAAb;QACAR,cAAc,CAAC,KAAD,CAAd;;OAGDW,iBAAW,CAACH,IAAI,GAAC,GAAN,EAAW,CAAX,CAXd,SADsB;GAAvB,CADH,CADF,EAkBEP,6BAACW,UAAD;IACE,GAAG,EAAEhB,QADP;IAEE,YAAY,EAAE,wBAAM;UACdG,WAAW,IAAIH,QAAf,IAA2BA,QAAQ,CAACiB,OAAxC,EAAiD;QAC/CjB,QAAQ,CAACiB,OAAT,CAAiBC,KAAjB;QACAlB,QAAQ,CAACiB,OAAT,CAAiBE,MAAjB;;KALN;IAQE,MAAM,EAAC,MART;IASE,SAAS,EAAEZ,MAAM,CAACa,UATpB;IAUE,KAAK,EAAEjB,WAAW,GAAGT,KAAK,GAAG,GAAR,IAAe,EAAlB,GAAuB,EAV3C;IAWE,WAAW,EAAC,QAXd;IAYE,QAAQ,EAAE,kBAAA2B,CAAC,EAAI;UACPC,CAAC,GAAG,CAACD,CAAC,CAACE,MAAF,CAASC,KAApB;;UACIC,MAAM,CAACC,KAAP,CAAaJ,CAAb,CAAJ,EAAqB;;OAFR;;;MAMb3B,aAAa,CAAC2B,CAAC,GAAG,GAAL,CAAb;KAlBJ;IAoBE,OAAO,EAAE,iBAAAD,CAAC,EAAI;MACZ1B,aAAa,CAAC,CAAD,CAAb;MACAS,cAAc,CAAC,IAAD,CAAd;KAtBJ;IAwBE,OAAO,EAAE,iBAAAiB,CAAC,EAAI;UACRxB,WAAJ,EAAiB;QACfwB,CAAC,CAACE,MAAF,CAASI,cAAT;;;IA5CR,CARF,CADF;CAbF;;;;"}

+ 1
- 0
lib/index.js View File

@@ -10,6 +10,7 @@ require('./test-029f205d.js');
10 10
 require('./utils-ed518bfc.js');
11 11
 var ConsumeListView = require('./ConsumeListView/index.js');
12 12
 var PayPlatformOptions = require('./PayPlatformOptions/index.js');
13
+require('antd');
13 14
 var PriceOptions = require('./PriceOptions/index.js');
14 15
 var WaitPayInfoView = require('./WaitPayInfoView/index.js');
15 16
 

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


+ 2
- 1
package.json View File

@@ -117,6 +117,7 @@
117 117
   },
118 118
   "peerDependencies": {
119 119
     "react": "^16.12.0",
120
-    "react-dom": "^16.12.0"
120
+    "react-dom": "^16.12.0",
121
+    "antd": "3.19.3"
121 122
   }
122 123
 }

+ 3
- 2
src/components/Payment/PriceOptions/index.tsx View File

@@ -1,5 +1,6 @@
1 1
 import React, { useState } from "react";
2 2
 import classnames from "classnames";
3
+import { Input } from 'antd';
3 4
 import { formatMoney } from "../Utils/utils";
4 5
 
5 6
 import styles from "./PriceOptions.less";
@@ -54,7 +55,7 @@ const PriceOptions = ({
54 55
             </span>
55 56
           ))}
56 57
         </span>
57
-        {/* <Input
58
+        <Input
58 59
           ref={inputRef}
59 60
           onMouseEnter={() => {
60 61
             if (inputStatus && inputRef && inputRef.current) {
@@ -83,7 +84,7 @@ const PriceOptions = ({
83 84
               e.target.scrollIntoView();
84 85
             }
85 86
           }}
86
-        /> */}
87
+        />
87 88
       </div>
88 89
     </div>
89 90
   );

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


+ 6
- 151
stories/Payment.stories.tsx View File

@@ -6,13 +6,15 @@ import { withKnobs, number, boolean, select } from "@storybook/addon-knobs";
6 6
 import { addReadme } from 'storybook-readme';
7 7
 
8 8
 import ConsumeListView from '@/components/Payment/ConsumeListView';
9
-import ConsumeListViewDoc from '@components/Payment/Common/ConsumeListView/README.md';
9
+import ConsumeListViewDoc from '@components/Payment/ConsumeListView/README.md';
10 10
 import PayPlatFormOptions, { PAY_CHANNEL } from '@/components/Payment/PayPlatformOptions';
11
-import PayPlatFormOptionsDoc from '@components/Payment/Common/PayPlatformOptions/README.md';
11
+import PayPlatFormOptionsDoc from '@components/Payment/PayPlatformOptions/README.md';
12 12
 import PriceOptions from '@/components/Payment/PriceOptions';
13
-import PriceOptionsDoc from '@components/Payment/Common/PriceOptions/README.md';
13
+import PriceOptionsDoc from '@components/Payment/PriceOptions/README.md';
14 14
 import WaitPayInfoView from '@/components/Payment/WaitPayInfoView';
15
-import WaitPayInfoViewDoc from '@components/Payment/Common/WaitPayInfoView/README.md';
15
+import WaitPayInfoViewDoc from '@components/Payment/WaitPayInfoView/README.md';
16
+
17
+import { consumeList as consumeData} from './data/consumeList.json';
16 18
 
17 19
 const stories = storiesOf('Payment', module);
18 20
 stories.addDecorator((storyFn) => <div style={{padding: "0px 40px"}}>{storyFn()}</div>)
@@ -20,153 +22,6 @@ stories.addDecorator(withKnobs);
20 22
 stories.addDecorator(withInfo);
21 23
 stories.addDecorator(addReadme);
22 24
 
23
-const consumeData = [
24
-  {
25
-    "id": 69,
26
-    "consume_id": "20190919120838283305719",
27
-    "goods_id": 0,
28
-    "goods_type": 4,
29
-    "num": 9,
30
-    "user_id": 71082,
31
-    "user_nickname": "lydia",
32
-    "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2018/8/26/10adf03c70fb128d546e0d40fea77047.jpg",
33
-    "to_user_id": 1,
34
-    "to_user_nickname": "",
35
-    "to_user_avatar": "",
36
-    "bill_price": 900,
37
-    "ref_id": 0,
38
-    "business_type": 3,
39
-    "created_at": 1568894918,
40
-    "updated_at": 1568894918
41
-  },
42
-  {
43
-    "id": 32,
44
-    "consume_id": "20190802095658644217897",
45
-    "goods_id": 2,
46
-    "goods_type": 1,
47
-    "num": 8,
48
-    "user_id": 2,
49
-    "user_nickname": "jim",
50
-    "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2018/4/6/7d4948f6e9a66789f776b0c69c8d51d9.png",
51
-    "to_user_id": 1,
52
-    "to_user_nickname": "",
53
-    "to_user_avatar": "",
54
-    "bill_price": 800,
55
-    "ref_id": 0,
56
-    "business_type": 3,
57
-    "created_at": 1564739818,
58
-    "updated_at": 1564739818
59
-  },
60
-  {
61
-    "id": 46,
62
-    "consume_id": "20190819131433734083448",
63
-    "goods_id": 2,
64
-    "goods_type": 1,
65
-    "num": 7,
66
-    "user_id": 5,
67
-    "user_nickname": "Chris",
68
-    "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/6/12/a1aec180fbb727cc693c7a2f14812dac.jpg",
69
-    "to_user_id": 1,
70
-    "to_user_nickname": "",
71
-    "to_user_avatar": "",
72
-    "bill_price": 700,
73
-    "ref_id": 0,
74
-    "business_type": 3,
75
-    "created_at": 1566220473,
76
-    "updated_at": 1566220473
77
-  },
78
-  {
79
-    "id": 20,
80
-    "consume_id": "20190729154830503859957",
81
-    "goods_id": 2,
82
-    "goods_type": 1,
83
-    "num": 5,
84
-    "user_id": 217,
85
-    "user_nickname": "Paul",
86
-    "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/12/4/b9221e3176d92c349affc3633a0ec7bf.jpg",
87
-    "to_user_id": 1,
88
-    "to_user_nickname": "",
89
-    "to_user_avatar": "",
90
-    "bill_price": 500,
91
-    "ref_id": 0,
92
-    "business_type": 3,
93
-    "created_at": 1564415310,
94
-    "updated_at": 1564415310
95
-  },
96
-  {
97
-    "id": 127,
98
-    "consume_id": "20191204115927765695546",
99
-    "goods_id": 2,
100
-    "goods_type": 1,
101
-    "num": 1,
102
-    "user_id": 45,
103
-    "user_nickname": "Adam",
104
-    "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/6/12/cbc5208e3a8aba6fcfc2cef2a4d5151d.jpg",
105
-    "to_user_id": 1,
106
-    "to_user_nickname": "",
107
-    "to_user_avatar": "",
108
-    "bill_price": 100,
109
-    "ref_id": 0,
110
-    "business_type": 3,
111
-    "created_at": 1575460767,
112
-    "updated_at": 1575460767
113
-  },
114
-  {
115
-    "id": 71,
116
-    "consume_id": "20190922010906704921621",
117
-    "goods_id": 0,
118
-    "goods_type": 4,
119
-    "num": 1,
120
-    "user_id": 22428,
121
-    "user_nickname": "简单生活",
122
-    "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/9/22/27886bb4305ab56adc0b20018b975dc5.jpg",
123
-    "to_user_id": 1,
124
-    "to_user_nickname": "",
125
-    "to_user_avatar": "",
126
-    "bill_price": 100,
127
-    "ref_id": 0,
128
-    "business_type": 3,
129
-    "created_at": 1569114546,
130
-    "updated_at": 1569114546
131
-  },
132
-  {
133
-    "id": 70,
134
-    "consume_id": "20190920014118872836942",
135
-    "goods_id": 0,
136
-    "goods_type": 4,
137
-    "num": 1,
138
-    "user_id": 70406,
139
-    "user_nickname": "vicky",
140
-    "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/5/5/8a0db661919f926501192eccf13740f1jpg",
141
-    "to_user_id": 1,
142
-    "to_user_nickname": "",
143
-    "to_user_avatar": "",
144
-    "bill_price": 100,
145
-    "ref_id": 0,
146
-    "business_type": 3,
147
-    "created_at": 1568943678,
148
-    "updated_at": 1568943678
149
-  },
150
-  {
151
-    "id": 68,
152
-    "consume_id": "20190917224355248346157",
153
-    "goods_id": 0,
154
-    "goods_type": 4,
155
-    "num": 1,
156
-    "user_id": 71603,
157
-    "user_nickname": "Slate",
158
-    "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/10/19/1cb9f491e90258ba91a189027ef774b7.jpg",
159
-    "to_user_id": 1,
160
-    "to_user_nickname": "",
161
-    "to_user_avatar": "",
162
-    "bill_price": 100,
163
-    "ref_id": 0,
164
-    "business_type": 3,
165
-    "created_at": 1568760235,
166
-    "updated_at": 1568760235
167
-  }
168
-];
169
-
170 25
 stories.add(
171 26
   'ConsumeListView',
172 27
   () => {

+ 148
- 0
stories/data/consumeList.json View File

@@ -0,0 +1,148 @@
1
+{
2
+  "consumeList": [
3
+    {
4
+      "id": 69,
5
+      "consume_id": "20190919120838283305719",
6
+      "goods_id": 0,
7
+      "goods_type": 4,
8
+      "num": 9,
9
+      "user_id": 71082,
10
+      "user_nickname": "lydia",
11
+      "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2018/8/26/10adf03c70fb128d546e0d40fea77047.jpg",
12
+      "to_user_id": 1,
13
+      "to_user_nickname": "",
14
+      "to_user_avatar": "",
15
+      "bill_price": 900,
16
+      "ref_id": 0,
17
+      "business_type": 3,
18
+      "created_at": 1568894918,
19
+      "updated_at": 1568894918
20
+    },
21
+    {
22
+      "id": 32,
23
+      "consume_id": "20190802095658644217897",
24
+      "goods_id": 2,
25
+      "goods_type": 1,
26
+      "num": 8,
27
+      "user_id": 2,
28
+      "user_nickname": "jim",
29
+      "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2018/4/6/7d4948f6e9a66789f776b0c69c8d51d9.png",
30
+      "to_user_id": 1,
31
+      "to_user_nickname": "",
32
+      "to_user_avatar": "",
33
+      "bill_price": 800,
34
+      "ref_id": 0,
35
+      "business_type": 3,
36
+      "created_at": 1564739818,
37
+      "updated_at": 1564739818
38
+    },
39
+    {
40
+      "id": 46,
41
+      "consume_id": "20190819131433734083448",
42
+      "goods_id": 2,
43
+      "goods_type": 1,
44
+      "num": 7,
45
+      "user_id": 5,
46
+      "user_nickname": "Chris",
47
+      "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/6/12/a1aec180fbb727cc693c7a2f14812dac.jpg",
48
+      "to_user_id": 1,
49
+      "to_user_nickname": "",
50
+      "to_user_avatar": "",
51
+      "bill_price": 700,
52
+      "ref_id": 0,
53
+      "business_type": 3,
54
+      "created_at": 1566220473,
55
+      "updated_at": 1566220473
56
+    },
57
+    {
58
+      "id": 20,
59
+      "consume_id": "20190729154830503859957",
60
+      "goods_id": 2,
61
+      "goods_type": 1,
62
+      "num": 5,
63
+      "user_id": 217,
64
+      "user_nickname": "Paul",
65
+      "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/12/4/b9221e3176d92c349affc3633a0ec7bf.jpg",
66
+      "to_user_id": 1,
67
+      "to_user_nickname": "",
68
+      "to_user_avatar": "",
69
+      "bill_price": 500,
70
+      "ref_id": 0,
71
+      "business_type": 3,
72
+      "created_at": 1564415310,
73
+      "updated_at": 1564415310
74
+    },
75
+    {
76
+      "id": 127,
77
+      "consume_id": "20191204115927765695546",
78
+      "goods_id": 2,
79
+      "goods_type": 1,
80
+      "num": 1,
81
+      "user_id": 45,
82
+      "user_nickname": "Adam",
83
+      "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/6/12/cbc5208e3a8aba6fcfc2cef2a4d5151d.jpg",
84
+      "to_user_id": 1,
85
+      "to_user_nickname": "",
86
+      "to_user_avatar": "",
87
+      "bill_price": 100,
88
+      "ref_id": 0,
89
+      "business_type": 3,
90
+      "created_at": 1575460767,
91
+      "updated_at": 1575460767
92
+    },
93
+    {
94
+      "id": 71,
95
+      "consume_id": "20190922010906704921621",
96
+      "goods_id": 0,
97
+      "goods_type": 4,
98
+      "num": 1,
99
+      "user_id": 22428,
100
+      "user_nickname": "简单生活",
101
+      "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/9/22/27886bb4305ab56adc0b20018b975dc5.jpg",
102
+      "to_user_id": 1,
103
+      "to_user_nickname": "",
104
+      "to_user_avatar": "",
105
+      "bill_price": 100,
106
+      "ref_id": 0,
107
+      "business_type": 3,
108
+      "created_at": 1569114546,
109
+      "updated_at": 1569114546
110
+    },
111
+    {
112
+      "id": 70,
113
+      "consume_id": "20190920014118872836942",
114
+      "goods_id": 0,
115
+      "goods_type": 4,
116
+      "num": 1,
117
+      "user_id": 70406,
118
+      "user_nickname": "vicky",
119
+      "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/5/5/8a0db661919f926501192eccf13740f1jpg",
120
+      "to_user_id": 1,
121
+      "to_user_nickname": "",
122
+      "to_user_avatar": "",
123
+      "bill_price": 100,
124
+      "ref_id": 0,
125
+      "business_type": 3,
126
+      "created_at": 1568943678,
127
+      "updated_at": 1568943678
128
+    },
129
+    {
130
+      "id": 68,
131
+      "consume_id": "20190917224355248346157",
132
+      "goods_id": 0,
133
+      "goods_type": 4,
134
+      "num": 1,
135
+      "user_id": 71603,
136
+      "user_nickname": "Slate",
137
+      "user_avatar": "https://links123-images.oss-cn-hangzhou.aliyuncs.com/avatar/2019/10/19/1cb9f491e90258ba91a189027ef774b7.jpg",
138
+      "to_user_id": 1,
139
+      "to_user_nickname": "",
140
+      "to_user_avatar": "",
141
+      "bill_price": 100,
142
+      "ref_id": 0,
143
+      "business_type": 3,
144
+      "created_at": 1568760235,
145
+      "updated_at": 1568760235
146
+    }
147
+  ]
148
+}