Bez popisu

index.js.map 8.9KB

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=\";\n export default img;","import React, { Component, MouseEvent } from 'react';\nimport classnames from 'classnames';\n\n// import { DEFAULT_AVATAR } from '@/constants';\nimport { addImageProcess } from '../Utils/utils';\nimport KingDomPic from '../assets/icon/popovers_list_huangguan.png';\n\nimport styles from './ConsumeListView.less';\n\nconst DEFAULT_AVATAR =\n '//links-comment.oss-cn-beijing.aliyuncs.com/comment/20180820/Kgka4_oU1.jpeg';\n \ninterface dataItem {\n id?: string|number;\n user_avatar?: string;\n bill_price?: number;\n}\n\ninterface Props {\n isToggle: boolean;\n onToggleChange: Function;\n onConsumeItemClick: (e: MouseEvent, clickData: any) => any,\n dataSource: Array<dataItem>;\n listLength: number;\n showLength: number; \n options: {\n avatarSize: number,\n avatarMarginLeftAndRight: number,\n kingdomWidth: number,\n kingdomHeight: number,\n kingdomPosition: [number, number],\n },\n}\n\nclass ConsumeListView extends Component<Props, {}> {\n static defaultProps: Props = {\n isToggle: false,\n onToggleChange: () => {},\n onConsumeItemClick: () => {},\n dataSource: [],\n listLength: 0,\n showLength: 6,\n options: {\n avatarSize: 36,\n avatarMarginLeftAndRight: 6,\n kingdomWidth: 24,\n kingdomHeight: 22,\n kingdomPosition: [-6, -12],\n },\n }\n\n renderConsumeItem() {\n const {\n dataSource,\n isToggle,\n onConsumeItemClick,\n showLength,\n listLength,\n options,\n } = this.props;\n const {\n kingdomWidth,\n kingdomHeight,\n kingdomPosition,\n avatarSize,\n avatarMarginLeftAndRight,\n } = options;\n\n let renderData = dataSource;\n if (!isToggle && listLength > showLength) {\n renderData = dataSource.slice(0, showLength - 1);\n }\n\n return renderData.map((v: dataItem, i: number) => {\n let kingdom = null;\n if (i === 0) {\n kingdom = (\n <img\n className={styles.kingdomIcon}\n src={KingDomPic}\n alt=\"reward top user\"\n style={{\n width: `${kingdomWidth}px`,\n height: `${kingdomHeight}px`,\n left: `${kingdomPosition[0]}px`,\n top: `${kingdomPosition[1]}px`,\n }}\n />\n );\n }\n return (\n <li\n key={v.id}\n className={styles.consumeItem}\n style={{ margin: `0 ${avatarMarginLeftAndRight}px 10px` }}\n >\n {kingdom}\n <div\n className={styles.avatar}\n onClick={(e) => onConsumeItemClick(e, v)}\n style={{\n backgroundImage: `url(${addImageProcess(\n v.user_avatar || DEFAULT_AVATAR,\n {\n small: true,\n },\n )})`,\n width: `${avatarSize}px`,\n height: `${avatarSize}px`,\n }}\n />\n <span className={styles.gray}>\n {/* {intl.get('bilingually.gift.item', {\n nums: v.bill_price / 100,\n }) /* {item.num}另币 */}\n </span>\n </li>\n );\n });\n }\n\n renderToggleButton() {\n const {\n isToggle,\n onToggleChange,\n listLength,\n showLength,\n options,\n } = this.props;\n const { avatarSize, avatarMarginLeftAndRight } = options;\n\n if (listLength <= showLength) {\n return null;\n }\n\n return (\n <li\n onClick={() => onToggleChange()}\n className={classnames(styles.toggle, {\n [styles.expand]: isToggle,\n })}\n style={{\n width: `${avatarSize}px`,\n height: `${avatarSize}px`,\n lineHeight: `${avatarSize}px`,\n margin: `0 ${avatarMarginLeftAndRight}px 10px`,\n }}\n />\n );\n }\n\n render() {\n const { showLength, options } = this.props;\n const { avatarSize, avatarMarginLeftAndRight } = options;\n return (\n <div className={styles.wrapper}>\n <ul\n className={styles.consumelist}\n style={{\n width: `calc(${avatarMarginLeftAndRight * 2 +\n avatarSize}px * ${showLength})`,\n }}\n >\n {this.renderConsumeItem()}\n {this.renderToggleButton()}\n </ul>\n </div>\n );\n }\n}\n\nexport default ConsumeListView;\n"],"names":["img","DEFAULT_AVATAR","ConsumeListView","props","dataSource","isToggle","onConsumeItemClick","showLength","listLength","options","kingdomWidth","kingdomHeight","kingdomPosition","avatarSize","avatarMarginLeftAndRight","renderData","slice","map","v","i","kingdom","React","createElement","className","styles","kingdomIcon","src","KingDomPic","alt","style","width","height","left","top","key","id","consumeItem","margin","avatar","onClick","e","backgroundImage","addImageProcess","user_avatar","small","gray","onToggleChange","classnames","toggle","expand","lineHeight","wrapper","consumelist","renderConsumeItem","renderToggleButton","Component","defaultProps"],"mappings":";;;;;;;;AAAA,IAAMA,GAAG,GAAG,wrBAAZ;;;;;;;;;;;;;;;ACSA,IAAMC,cAAc,GAClB,6EADF;;IAyBMC;;;;;;;;;;;;;wCAiBa;wBAQX,KAAKC;UANPC,UAFa,eAEbA;UACAC,QAHa,eAGbA;UACAC,kBAJa,eAIbA;UACAC,UALa,eAKbA;UACAC,UANa,eAMbA;UACAC,OAPa,eAObA;UAGAC,YAVa,GAeXD,OAfW,CAUbC;UACAC,aAXa,GAeXF,OAfW,CAWbE;UACAC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