Ingen beskrivning

index.js.map 8.8KB

1
  1. {"version":3,"file":"index.js","sources":["../../src/components/Payment/assets/icon/popovers_list_huangguan.png","../../src/components/Payment/ConsumeListView/index.tsx"],"sourcesContent":["const img = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAABvklEQVQ4T62UTygEcRTHv29MIsqfk6OL5CYH5aKd9WfjwqxEnBzExYWTCEWJJGove5H8OTA1uwdCrOWAi83ZwUXJiSj5u+Z5s0msmd2SX81h+r33ee/7fW+G8E+H/srhqEcFCjphve1RzcaVK4j3mmoB5YxqQzdOxTji1wE2QZglb2jAEcT7/g4wr0rQugS1OYJ26nOg5nYDr4ZrR7yrl0FBAKBlqjEX3eRLwSXAmidvOJbSI47oF9LVKaCOkNc4/w7kSPOoFBqDwjpp4XA60LUkF8nzbsuERQt4ejtGdsYwiAYTYIV6STOD6UB3EpqXJC0u7zKxz0Mk3Zrj7lOLerJg5T9K+2lWhALiYx8xS9NbDZnUuPXy0wN/hYw3lnbPiNfE7HaSfTAloRqKWkya8WAnMrdmIBqfBqM/BehJAo+gKHMibdMGzUhqKUiZAHGVXJYLwPdpshPnRDRM4fl5+7uKL/0c1WXdOSie5Dh3wZcyoR7SQttO9z+M5MOWEsStFQmsTAoOwVK7qM64d5P6ayKJj9EqHBa5Q4kx2/ujqR1Exnsq493HH2muFN98oNtJ0g7s3Ul5/vwbSab+G+gDqFybE11pYkYAAAAASUVORK5CYII='; export default img;","import React, { Component, MouseEvent } from 'react';\r\nimport classnames from 'classnames';\r\n\r\n// import { DEFAULT_AVATAR } from '@/constants';\r\nimport { addImageProcess } from '../Utils/utils';\r\nimport KingDomPic from '../assets/icon/popovers_list_huangguan.png';\r\n\r\nimport styles from './ConsumeListView.less';\r\n\r\nconst DEFAULT_AVATAR =\r\n '//links-comment.oss-cn-beijing.aliyuncs.com/comment/20180820/Kgka4_oU1.jpeg';\r\n \r\ninterface dataItem {\r\n id?: string|number;\r\n user_avatar?: string;\r\n bill_price?: number;\r\n}\r\n\r\ninterface Props {\r\n isToggle: boolean;\r\n onToggleChange: Function;\r\n onConsumeItemClick: (e: MouseEvent, clickData: any) => any,\r\n dataSource: Array<dataItem>;\r\n listLength: number;\r\n showLength: number; \r\n options: {\r\n avatarSize: number,\r\n avatarMarginLeftAndRight: number,\r\n kingdomWidth: number,\r\n kingdomHeight: number,\r\n kingdomPosition: [number, number],\r\n },\r\n}\r\n\r\nclass ConsumeListView extends Component<Props, {}> {\r\n static defaultProps: Props = {\r\n isToggle: false,\r\n onToggleChange: () => {},\r\n onConsumeItemClick: () => {},\r\n dataSource: [],\r\n listLength: 0,\r\n showLength: 6,\r\n options: {\r\n avatarSize: 36,\r\n avatarMarginLeftAndRight: 6,\r\n kingdomWidth: 24,\r\n kingdomHeight: 22,\r\n kingdomPosition: [-6, -12],\r\n },\r\n }\r\n\r\n renderConsumeItem() {\r\n const {\r\n dataSource,\r\n isToggle,\r\n onConsumeItemClick,\r\n showLength,\r\n listLength,\r\n options,\r\n } = this.props;\r\n const {\r\n kingdomWidth,\r\n kingdomHeight,\r\n kingdomPosition,\r\n avatarSize,\r\n avatarMarginLeftAndRight,\r\n } = options;\r\n\r\n let renderData = dataSource;\r\n if (!isToggle && listLength > showLength) {\r\n renderData = dataSource.slice(0, showLength - 1);\r\n }\r\n\r\n return renderData.map((v: dataItem, i: number) => {\r\n let kingdom = null;\r\n if (i === 0) {\r\n kingdom = (\r\n <img\r\n className={styles.kingdomIcon}\r\n src={KingDomPic}\r\n alt=\"reward top user\"\r\n style={{\r\n width: `${kingdomWidth}px`,\r\n height: `${kingdomHeight}px`,\r\n left: `${kingdomPosition[0]}px`,\r\n top: `${kingdomPosition[1]}px`,\r\n }}\r\n />\r\n );\r\n }\r\n return (\r\n <li\r\n key={v.id}\r\n className={styles.consumeItem}\r\n style={{ margin: `0 ${avatarMarginLeftAndRight}px 10px` }}\r\n >\r\n {kingdom}\r\n <div\r\n className={styles.avatar}\r\n onClick={(e) => onConsumeItemClick(e, v)}\r\n style={{\r\n backgroundImage: `url(${addImageProcess(\r\n v.user_avatar || DEFAULT_AVATAR,\r\n {\r\n small: true,\r\n },\r\n )})`,\r\n width: `${avatarSize}px`,\r\n height: `${avatarSize}px`,\r\n }}\r\n />\r\n <span className={styles.gray}>\r\n {/* {intl.get('bilingually.gift.item', {\r\n nums: v.bill_price / 100,\r\n }) /* {item.num}另币 */}\r\n </span>\r\n </li>\r\n );\r\n });\r\n }\r\n\r\n renderToggleButton() {\r\n const {\r\n isToggle,\r\n onToggleChange,\r\n listLength,\r\n showLength,\r\n options,\r\n } = this.props;\r\n const { avatarSize, avatarMarginLeftAndRight } = options;\r\n\r\n if (listLength <= showLength) {\r\n return null;\r\n }\r\n\r\n return (\r\n <li\r\n onClick={() => onToggleChange()}\r\n className={classnames(styles.toggle, {\r\n [styles.expand]: isToggle,\r\n })}\r\n style={{\r\n width: `${avatarSize}px`,\r\n height: `${avatarSize}px`,\r\n lineHeight: `${avatarSize}px`,\r\n margin: `0 ${avatarMarginLeftAndRight}px 10px`,\r\n }}\r\n />\r\n );\r\n }\r\n\r\n render() {\r\n const { showLength, options } = this.props;\r\n const { avatarSize, avatarMarginLeftAndRight } = options;\r\n return (\r\n <div className={styles.wrapper}>\r\n <ul\r\n className={styles.consumelist}\r\n style={{\r\n width: `calc(${avatarMarginLeftAndRight * 2 +\r\n avatarSize}px * ${showLength})`,\r\n }}\r\n >\r\n {this.renderConsumeItem()}\r\n {this.renderToggleButton()}\r\n </ul>\r\n </div>\r\n );\r\n }\r\n}\r\n\r\nexport default ConsumeListView;\r\n"],"names":["DEFAULT_AVATAR","ConsumeListView","props","dataSource","isToggle","onConsumeItemClick","showLength","listLength","options","kingdomWidth","kingdomHeight","kingdomPosition","avatarSize","avatarMarginLeftAndRight","renderData","slice","map","v","i","kingdom","React","styles","kingdomIcon","KingDomPic","width","height","left","top","id","consumeItem","margin","avatar","e","backgroundImage","addImageProcess","user_avatar","small","gray","onToggleChange","classnames","toggle","expand","lineHeight","wrapper","consumelist","renderConsumeItem","renderToggleButton","Component"],"mappings":";;;;;;;;;;;;;;AAAA,MAAM,GAAG,GAAG,wrBAAwrB,CAAC;;;;;;ACSrsB,IAAMA,cAAc,GAClB,6EADF;;IAyBMC;;;;;;;;;;;;;wCAiBgB;wBAQd,KAAKC,KARS;UAEhBC,UAFgB,eAEhBA,UAFgB;UAGhBC,QAHgB,eAGhBA,QAHgB;UAIhBC,kBAJgB,eAIhBA,kBAJgB;UAKhBC,UALgB,eAKhBA,UALgB;UAMhBC,UANgB,eAMhBA,UANgB;UAOhBC,OAPgB,eAOhBA,OAPgB;UAUhBC,YAVgB,GAedD,OAfc,CAUhBC,YAVgB;UAWhBC,aAXgB,GAedF,OAfc,CAWhBE,aAXgB;UAYhBC,eAZgB,GAedH,OAfc,CAYhBG,eAZgB;UAahBC,UAbgB,GAedJ,OAfc,CAahBI,UAbgB;UAchBC,wBAdgB,GAedL,OAfc,CAchBK,wBAdgB;UAiBdC,UAAU,GAAGX,UAAjB;;UACI,CAACC,QAAD,IAAaG,UAAU,GAAGD,UAA9B,EAA0C;QACxCQ,UAAU,GAAGX,UAAU,CAACY,KAAX,CAAiB,CAAjB,EAAoBT,UAAU,GAAG,CAAjC,CAAb;;;aAGKQ,UAAU,CAACE,GAAX,CAAe,UAACC,CAAD,EAAcC,CAAd,EAA4B;YAC5CC,OAAO,GAAG,IAAd;;YACID,CAAC,KAAK,CAAV,EAAa;UACXC,OAAO,GACLC;YACE,SAAS,EAAEC,MAAM,CAACC,WADpB;YAEE,GAAG,EAAEC,GAFP;YAGE,GAAG,EAAC,iBAHN;YAIE,KAAK,EAAE;cACLC,KAAK,YAAKf,YAAL,OADA;cAELgB,MAAM,YAAKf,aAAL,OAFD;cAGLgB,IAAI,YAAKf,eAAe,CAAC,CAAD,CAApB,OAHC;cAILgB,GAAG,YAAKhB,eAAe,CAAC,CAAD,CAApB;;YATT;;;eAeAS;UACE,GAAG,EAAEH,CAAC,CAACW,E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