'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var styleInject_es = require('./style-inject.es-7b2c2b1b.js');
var React = require('react');
var React__default = _interopDefault(React);
var index = require('./index-671ea010.js');

var IMAGE_PROCESS = '?x-oss-process=image/resize,h_350';
var IMAGE_PROCESS_SMALL = '?x-oss-process=image/resize,h_100';
var IMAGE_PROCESS_LARGE = '?x-oss-process=image/resize,h_500';
function addImageProcess(url) {
  var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
    width: '36px',
    height: '36px'
  };

  // 防止重复添加导致的url不正确
  if (url && url.indexOf('x-oss-process') > -1) {
    return url;
  }

  if (options.small) {
    return url + IMAGE_PROCESS_SMALL;
  }

  if (options.large) {
    return url + IMAGE_PROCESS_LARGE;
  }

  if (options.custom) {
    return "".concat(url, "?x-oss-process=image/resize,limit_0,m_fill,w_").concat(options.width, ",h_").concat(options.height);
  }

  return url + IMAGE_PROCESS;
}
function formatMoney(input) {
  var fuzz = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;

  if (isNaN(+input)) {
    return input;
  }

  return (+input).toFixed(fuzz);
}
function exportStyleSizeClass(styles, size) {
  return styleInject_es._defineProperty({}, styles[size], true);
}

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=';

var css = ".ConsumeListView_wrapper__la1cB {\n  display: flex;\n  justify-content: center;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b {\n  padding: 0;\n  margin: 0;\n  display: flex;\n  flex-wrap: wrap;\n  padding-top: 10px;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b li {\n  list-style: none;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_consumeItem__2M0dc {\n  margin: 0 6px 10px;\n  text-align: center;\n  position: relative;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_consumeItem__2M0dc .ConsumeListView_kingdomIcon__YPzT9 {\n  position: absolute;\n  width: 24px;\n  height: 22px;\n  left: -6px;\n  top: -12px;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_consumeItem__2M0dc .ConsumeListView_avatar__AXZJE {\n  margin: 0 auto 4px;\n  width: 36px;\n  height: 36px;\n  background-size: cover;\n  border-radius: 50%;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_consumeItem__2M0dc .ConsumeListView_gray__3h-Ue {\n  color: #9b9b9b;\n  font-size: 12px;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_toggle__31sUD {\n  margin: 0 6px 10px;\n  width: 36px;\n  height: 36px;\n  line-height: 36px;\n  background-color: #ececec;\n  border-radius: 50%;\n  color: #a8adb6;\n  cursor: pointer;\n  background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAACv0lEQVRIS8WXTW8SURSGzzAYNSYCA7SCUEqBioLtohvjD9CN7ozG36AmXfsRafxYN9b+BqNx50r3GjddqEVRRgSRVr4GWmOsERjfOwEzVYa5lAokEwJzznnOe865d+4IxPFRVXVPrVY73Wq1TgmCMIffYbjZ2q4b+E/GfysWi+WZw+F4it+/zMIKvQwAszcajXnYXEIwl1kwdh8JVPC1bLVaF5FE3cjHEFytVs8hyH04jvMAu9gUkexlp9P5uJv/P2DABCi9hbJehUPPinAkpKL8d6H8BpJQ9fbbAjOooigP8H2BIyi3CaAPJUm6qIdvAwN6G0qvcUfswxDK7wB+vePyB9zu6aNdKK9ROioUn+/0XAOz6W02m6kBBolXe1EUxSibdg0MtQn09Sav9yB2UL0A1QmBbQ6VSmWNd50OAu2sc5fL5WVTfAYD9WTQgP34Y9DOClB7D05X+nHcBdslAf19jnKfNAr2cmWVDuzfR7HoFCFTUyaqR8lUhr7/2KITc/Gu9mjrC6a4iLtjRhHfvv9Ea1/L5JLsNBML94Qz6OukTBWlTt5Dbjp2JGgUtsTAW7i713DxqSql0jkqrJfIKdloNhbpCmfQV8k0VZUNOuwZo2gkQFBmFPanKVibRFxpOUefC0VyOmw0E4+QqCt7s8mgH0ipbdKEb5wiIUB7N0UD9yy13l/O5CmbXyfJfpBm49MkihbSoKuA1jdpcsJD4aDfdA5gUDIdrr+jZLIFyuQK5AD8+NEQvXknU63+jUKTPgoGvDxQ1gJtuPpeTkw1U8+mnPU2MuWngN/DBW0bLe14A8mj3x+zX7TS+ryGi6JrMtoGMrItk6VULpcTqPtQHhIQuuB2uxOjfSwy1SM5CHQmYCRHn/azcjSHvQ586Mdb/aIb+oFeD2eHQOxM87j6eoXBBrGMa2evMPoE/sdL22+mI4T0ou1LqAAAAABJRU5ErkJggg==);\n  background-position: center;\n}\n.ConsumeListView_wrapper__la1cB .ConsumeListView_consumelist__sAA2b .ConsumeListView_toggle__31sUD.ConsumeListView_expand__XSb0z {\n  transform: rotate(180deg);\n}\n";
var styles = {"wrapper":"ConsumeListView_wrapper__la1cB","consumelist":"ConsumeListView_consumelist__sAA2b","consumeItem":"ConsumeListView_consumeItem__2M0dc","kingdomIcon":"ConsumeListView_kingdomIcon__YPzT9","avatar":"ConsumeListView_avatar__AXZJE","gray":"ConsumeListView_gray__3h-Ue","toggle":"ConsumeListView_toggle__31sUD","expand":"ConsumeListView_expand__XSb0z"};
styleInject_es.styleInject(css);

var DEFAULT_AVATAR = '//links-comment.oss-cn-beijing.aliyuncs.com/comment/20180820/Kgka4_oU1.jpeg';

var ConsumeListView =
/*#__PURE__*/
function (_Component) {
  styleInject_es._inherits(ConsumeListView, _Component);

  function ConsumeListView() {
    styleInject_es._classCallCheck(this, ConsumeListView);

    return styleInject_es._possibleConstructorReturn(this, styleInject_es._getPrototypeOf(ConsumeListView).apply(this, arguments));
  }

  styleInject_es._createClass(ConsumeListView, [{
    key: "renderConsumeItem",
    value: function renderConsumeItem() {
      var _this$props = this.props,
          dataSource = _this$props.dataSource,
          isToggle = _this$props.isToggle,
          showLength = _this$props.showLength,
          listLength = _this$props.listLength,
          options = _this$props.options;
      var kingdomWidth = options.kingdomWidth,
          kingdomHeight = options.kingdomHeight,
          kingdomPosition = options.kingdomPosition,
          avatarSize = options.avatarSize,
          avatarMarginLeftAndRight = options.avatarMarginLeftAndRight;
      var renderData = dataSource;

      if (!isToggle && listLength > showLength) {
        renderData = dataSource.slice(0, showLength - 1);
      }

      return renderData.map(function (v, i) {
        var kingdom = null;

        if (i === 0) {
          kingdom = React__default.createElement("img", {
            className: styles.kingdomIcon,
            src: img,
            alt: "reward top user",
            style: {
              width: "".concat(kingdomWidth, "px"),
              height: "".concat(kingdomHeight, "px"),
              left: "".concat(kingdomPosition[0], "px"),
              top: "".concat(kingdomPosition[1], "px")
            }
          });
        }

        return React__default.createElement("li", {
          key: v.id,
          className: styles.consumeItem,
          style: {
            margin: "0 ".concat(avatarMarginLeftAndRight, "px 10px")
          }
        }, kingdom, React__default.createElement("div", {
          className: styles.avatar,
          style: {
            backgroundImage: "url(".concat(addImageProcess(v.user_avatar || DEFAULT_AVATAR, {
              small: true
            }), ")"),
            width: "".concat(avatarSize, "px"),
            height: "".concat(avatarSize, "px")
          }
        }), React__default.createElement("span", {
          className: styles.gray
        }));
      });
    }
  }, {
    key: "renderToggleButton",
    value: function renderToggleButton() {
      var _this$props2 = this.props,
          isToggle = _this$props2.isToggle,
          onToggleChange = _this$props2.onToggleChange,
          listLength = _this$props2.listLength,
          showLength = _this$props2.showLength,
          options = _this$props2.options;
      var avatarSize = options.avatarSize,
          avatarMarginLeftAndRight = options.avatarMarginLeftAndRight;

      if (listLength <= showLength) {
        return null;
      }

      return React__default.createElement("li", {
        onClick: function onClick() {
          return onToggleChange();
        },
        className: index.classnames(styles.toggle, styleInject_es._defineProperty({}, styles.expand, isToggle)),
        style: {
          width: "".concat(avatarSize, "px"),
          height: "".concat(avatarSize, "px"),
          lineHeight: "".concat(avatarSize, "px"),
          margin: "0 ".concat(avatarMarginLeftAndRight, "px 10px")
        }
      });
    }
  }, {
    key: "render",
    value: function render() {
      var _this$props3 = this.props,
          showLength = _this$props3.showLength,
          options = _this$props3.options;
      var avatarSize = options.avatarSize,
          avatarMarginLeftAndRight = options.avatarMarginLeftAndRight;
      return React__default.createElement("div", {
        className: styles.wrapper
      }, React__default.createElement("ul", {
        className: styles.consumelist,
        style: {
          width: "calc(".concat(avatarMarginLeftAndRight * 2 + avatarSize, "px * ").concat(showLength, ")")
        }
      }, this.renderConsumeItem(), this.renderToggleButton()));
    }
  }]);

  return ConsumeListView;
}(React.Component);

styleInject_es._defineProperty(ConsumeListView, "defaultProps", {
  isToggle: false,
  onToggleChange: function onToggleChange() {},
  dataSource: [],
  listLength: 0,
  showLength: 6,
  options: {
    avatarSize: 36,
    avatarMarginLeftAndRight: 6,
    kingdomWidth: 24,
    kingdomHeight: 22,
    kingdomPosition: [-6, -12]
  }
});

const img$1 = 'data:image/png;base64, ';

const img$2 = 'data:image/png;base64, ';

const img$3 = 'data:image/png;base64, ';

const img$4 = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAMAAAAPzWOAAAAAM1BMVEVHcEwArfAAq/AArvQAq+4Aqu8Aqu8Ar/QAqu8Aq+8Aqu8ArPAAsf8Aq/AAqu8Aq/AAqu6gIIw3AAAAEHRSTlMAKoAZ9JXXD7o86WoHSaldjgJo7wAAAgBJREFUWMPtmNmShCAMRSHsIMj/f+1oCy4YsB2oeZr7SHWdJsklEgj5iDkteXwlLrVj5JCCl4AdBCozqIy/lqSJYWOH7IeiZOySXCOC2ClY6sJ7IZwRF7vliO6HaNJOq5+2ArZTS5op4dlJ7aSQ2A+J/5A/gcyq0N5xCukWhHypFgRMobyRcl3+l/gtJIizEoRdFu0jxDyWV8UBEP8M0VVBgoiXiS368SbbA0kHycQOiK5G8wKSDudknyFWCwAQQZe/tdvHg8xPZpNAj0oyD5pfvrgfyTZEztPNE9SFDcRVzSQXSFC4tya/+ry1kQOSf6UYZbcdUWCNjeyQ8AG4YFN6wavntlhArFqP6vW7rO85Ms1WsJjA3A3ARXkcfeBViF32gV//tC8bwawrEEHqlx3pyqgYSAziWw2Q03uC6YWzQZpXN4/758Qh6ZTDYxtBOfo7iNvv7oA5R81CJgit5iQzmFwrzvDOTbJN0OrwnI90d+eBophseswneYQ43/+1r0GW8twdy2E6xdIyDjnOHwtXy+8JuOEtMAyyJXAvvQ3zUQrUQsEgEJ4XmfHm/D+sdh7OjXDfPmqqqTUdHlHFRn9U8DTZpajOubwEOuG9A42qWBLOG2r8LPTXE5kVpHt6W+9Tsh8ix4xvQwbJISPtkOF6zJg/5MFhzNPHmEeY7uegH1eE2uqiaqwMAAAAAElFTkSuQmCC';

const img$5 = 'data:image/png;base64,iVBORw0KGgoAAAANS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Nn8NWqEIdLsRRYwEh8yuGf8EAAAAG3RSTlMAVQvuy+eo5PkXKW/Rr4goeETDiZ43us7AS166//BKAAAB4UlEQVRYw6WW25qCMAyEEVoOAitycBdboYrv/4yru4oS0pDK3P9f0gkZ4nmjNmWEK8vK+ivd+55dG7WkLE1scKQYqnF8q1gKNhi8V0ylCJxyYYXUrtlwsJ3BJRtW+QwO+LCCpRMHVtWfmn1X9LHZSN9fTjCYVr4GjlbAvloBz9bCdKiMMXPD4DJ3J7v6TiWk2SdSfVwldrMNDSutZfOCM37XN5211nE7wsoJvtxgLROL2T39ZP2n0LIWNDz8w3GCrwWj65sKNIMMp+ux79LFr/MTFmgGdazCWqIZ1LMKP2AXs40GsIPZ/fUFC2wtDGNM9zmHjmvxevA454hr9oTVLZZBNr/6y4TVO4e1UNcpK9AMwkcEyj6fvJxB/TBDH10jZvejOqOG81UjEmgGmUFz1KIZFLBYgWfQDwtu8Az65rAF/msOYgYbWu6gjPNg33IHHRh1fdsddGC/F8mgJbPDHXEHkWbLCTrPIDkj4rukFGHVwNMPrEUEySN14YO1KAFceZQi2uwdxfq02ZIsvKXNFiQMMshMzY5DEl4wuyDhnF6LloSzFWaDtTDA7NhzgN3MBobl0pIYtq8keZPv9HECNQA+usBHPGB5qgDsu8Chy1pAiemUxQrYzWyviN8l6I/T+wU2HDmgaaHs/gAAAABJRU5ErkJggg==';

var css$1 = ".PayPlatformOptions_flexContainer__1-MCg {\n  display: flex;\n  justify-content: space-around;\n  align-items: center;\n}\n.PayPlatformOptions_label__1E4pz {\n  font-size: 14px;\n  font-weight: 400;\n  color: #616A79;\n}\n.PayPlatformOptions_payment-method-box__Iiao- {\n  padding: 20px 10px 10px 10px;\n  text-align: center;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payment-method__3fVWP {\n  display: inline-block;\n  margin: 0;\n  width: 60%;\n  vertical-align: middle;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payment-method-before__2Lu24 {\n  display: inline-block;\n  height: 100%;\n  vertical-align: middle;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS {\n  display: flex;\n  justify-content: center;\n  align-items: center;\n  cursor: pointer;\n  border: 1px solid transparent;\n  height: 66px;\n  line-height: 66px;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS .PayPlatformOptions_platformName__2VrlA {\n  text-align: center;\n  white-space: nowrap;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_small__kkYKV {\n  width: 88px;\n  height: 36px;\n  line-height: 36px;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_small__kkYKV .PayPlatformOptions_payment-method__3fVWP {\n  margin: 0;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_normal__1LPcR {\n  width: 132px;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_large__3Tz_u {\n  width: 162px;\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_active__3uZ7L {\n  border-radius: 5px;\n  border-color: #1790FF;\n  box-shadow: 0px 2px 6px 0px rgba(163, 163, 163, 0.3);\n}\n.PayPlatformOptions_payment-method-box__Iiao- .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_en__2udua {\n  font-size: 12px;\n}\n.PayPlatformOptions_payment-method-box__Iiao-.PayPlatformOptions_mobile__XZq_G {\n  padding: 8px 10px 10px 8px;\n}\n.PayPlatformOptions_payment-method-box__Iiao-.PayPlatformOptions_mobile__XZq_G .PayPlatformOptions_payitem__2o3qS {\n  display: inline-flex;\n  flex-direction: column;\n  justify-content: space-around;\n  width: 78px;\n  height: 80px;\n  line-height: initial;\n  border: 1px solid transparent;\n}\n.PayPlatformOptions_payment-method-box__Iiao-.PayPlatformOptions_mobile__XZq_G .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_active__3uZ7L {\n  border-radius: 4px;\n  border-color: #1790FF;\n}\n.PayPlatformOptions_payment-method-box__Iiao-.PayPlatformOptions_mobile__XZq_G .PayPlatformOptions_payitem__2o3qS .PayPlatformOptions_payment-method__3fVWP {\n  display: inline-block;\n  width: 34px;\n  height: 34px;\n}\n@media (max-width: 768px) {\n  .PayPlatformOptions_payitem__2o3qS {\n    cursor: pointer;\n    border: 1px solid transparent;\n  }\n  .PayPlatformOptions_payitem__2o3qS.PayPlatformOptions_active__3uZ7L {\n    border-radius: 5px;\n    border-color: #1790FF;\n  }\n}\n";
var styles$1 = {"flexContainer":"PayPlatformOptions_flexContainer__1-MCg","label":"PayPlatformOptions_label__1E4pz","payment-method-box":"PayPlatformOptions_payment-method-box__Iiao-","payment-method":"PayPlatformOptions_payment-method__3fVWP","payment-method-before":"PayPlatformOptions_payment-method-before__2Lu24","payitem":"PayPlatformOptions_payitem__2o3qS","platformName":"PayPlatformOptions_platformName__2VrlA","small":"PayPlatformOptions_small__kkYKV","normal":"PayPlatformOptions_normal__1LPcR","large":"PayPlatformOptions_large__3Tz_u","active":"PayPlatformOptions_active__3uZ7L","en":"PayPlatformOptions_en__2udua","mobile":"PayPlatformOptions_mobile__XZq_G","paymentMethodBox":"PayPlatformOptions_payment-method-box__Iiao-","paymentMethod":"PayPlatformOptions_payment-method__3fVWP","paymentMethodBefore":"PayPlatformOptions_payment-method-before__2Lu24"};
styleInject_es.styleInject(css$1);

var PAY_CHANNEL = {
  PAYPAL: "PAYPAL_PAYPAL",
  // PAYPAL_LIVE
  ALI_WEB: "ALI_WEB",
  ALI_WAP: "ALI_WAP",
  WX_WAP: "WX_WAP",
  WX_NATIVE: "WX_NATIVE"
};

var PayPlatformOptions =
/*#__PURE__*/
function (_PureComponent) {
  styleInject_es._inherits(PayPlatformOptions, _PureComponent);

  function PayPlatformOptions() {
    styleInject_es._classCallCheck(this, PayPlatformOptions);

    return styleInject_es._possibleConstructorReturn(this, styleInject_es._getPrototypeOf(PayPlatformOptions).apply(this, arguments));
  }

  styleInject_es._createClass(PayPlatformOptions, [{
    key: "render",
    value: function render() {
      var _objectSpread5, _objectSpread6, _objectSpread7;

      var _this$props = this.props,
          payitem = _this$props.payitem,
          onPayItemChange = _this$props.onPayItemChange,
          _this$props$isMobile = _this$props.isMobile,
          isMobile = _this$props$isMobile === void 0 ? false : _this$props$isMobile,
          _this$props$size = _this$props.size,
          size = _this$props$size === void 0 ? "normal" : _this$props$size,
          _this$props$withTitle = _this$props.withTitle,
          withTitle = _this$props$withTitle === void 0 ? true : _this$props$withTitle,
          titleTxt = _this$props.titleTxt,
          _this$props$locale = _this$props.locale,
          locale = _this$props$locale === void 0 ? "zh" : _this$props$locale;
      var titleDOM = null;

      if (withTitle) {
        var titleResult = titleTxt || locale === 'zh' ? '支付方式' : 'Payment';
        titleDOM = React__default.createElement("div", {
          className: styles$1.label
        }, titleResult);
      }

      if (isMobile) {
        var _objectSpread2, _objectSpread3, _objectSpread4;

        return React__default.createElement("div", null, titleDOM, React__default.createElement("div", {
          className: index.classnames(styles$1["payment-method-box"], styleInject_es._defineProperty({}, styles$1.mobile, isMobile))
        }, React__default.createElement("div", {
          className: styles$1.flexContainer
        }, React__default.createElement("div", {
          className: styles$1.flexItem
        }, React__default.createElement("div", {
          className: index.classnames(styleInject_es._objectSpread2((_objectSpread2 = {}, styleInject_es._defineProperty(_objectSpread2, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread2, styles$1.active, payitem === PAY_CHANNEL.ALI_WEB), _objectSpread2), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
          onClick: function onClick() {
            onPayItemChange(PAY_CHANNEL.ALI_WEB);
          }
        }, React__default.createElement("img", {
          src: img$4,
          alt: "alipay",
          className: styles$1["payment-method"]
        }), React__default.createElement("div", {
          className: styles$1.platformName
        }, "\u652F\u4ED8\u5B9D"))), React__default.createElement("div", {
          className: styles$1.flexItem
        }, React__default.createElement("div", {
          className: index.classnames(styleInject_es._objectSpread2((_objectSpread3 = {}, styleInject_es._defineProperty(_objectSpread3, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread3, styles$1.active, payitem === PAY_CHANNEL.WX_NATIVE), _objectSpread3), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
          onClick: function onClick() {
            onPayItemChange(PAY_CHANNEL.WX_NATIVE);
          }
        }, React__default.createElement("img", {
          src: img$5,
          alt: "wechatpay",
          className: styles$1["payment-method"]
        }), React__default.createElement("div", {
          className: styles$1.platformName
        }, "\u5FAE\u4FE1"))), React__default.createElement("div", {
          className: styles$1.flexItem
        }, React__default.createElement("div", {
          className: index.classnames(styleInject_es._objectSpread2((_objectSpread4 = {}, styleInject_es._defineProperty(_objectSpread4, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread4, styles$1.active, payitem === PAY_CHANNEL.PAYPAL), _objectSpread4), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
          onClick: function onClick() {
            onPayItemChange(PAY_CHANNEL.PAYPAL);
          }
        }, React__default.createElement("img", {
          src: img$6,
          alt: "paypal",
          className: styles$1["payment-method"]
        }), React__default.createElement("div", {
          className: styles$1.platformName
        }, "Paypal"))))));
      }

      return React__default.createElement("div", null, titleDOM, React__default.createElement("div", {
        className: styles$1["payment-method-box"]
      }, React__default.createElement("div", {
        className: styles$1.flexContainer
      }, React__default.createElement("div", {
        className: styles$1.flexItem
      }, React__default.createElement("div", {
        className: index.classnames(styleInject_es._objectSpread2((_objectSpread5 = {}, styleInject_es._defineProperty(_objectSpread5, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread5, styles$1.active, payitem === PAY_CHANNEL.ALI_WEB), _objectSpread5), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
        onClick: function onClick() {
          onPayItemChange(PAY_CHANNEL.ALI_WEB);
        }
      }, React__default.createElement("span", {
        className: styles$1["payment-method-before"]
      }), React__default.createElement("img", {
        src: img$1,
        alt: "alipay",
        className: styles$1["payment-method"]
      }))), React__default.createElement("div", {
        className: styles$1.flexItem
      }, React__default.createElement("div", {
        className: index.classnames(styleInject_es._objectSpread2((_objectSpread6 = {}, styleInject_es._defineProperty(_objectSpread6, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread6, styles$1.active, payitem === PAY_CHANNEL.WX_NATIVE), _objectSpread6), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
        onClick: function onClick() {
          onPayItemChange(PAY_CHANNEL.WX_NATIVE);
        }
      }, React__default.createElement("span", {
        className: styles$1["payment-method-before"]
      }), React__default.createElement("img", {
        src: img$2,
        alt: "wechatpay",
        className: styles$1["payment-method"]
      }))), React__default.createElement("div", {
        className: styles$1.flexItem
      }, React__default.createElement("div", {
        className: index.classnames(styleInject_es._objectSpread2((_objectSpread7 = {}, styleInject_es._defineProperty(_objectSpread7, styles$1.payitem, true), styleInject_es._defineProperty(_objectSpread7, styles$1.active, payitem === PAY_CHANNEL.PAYPAL), _objectSpread7), exportStyleSizeClass(styles$1, size)), styles$1[locale]),
        onClick: function onClick() {
          onPayItemChange(PAY_CHANNEL.PAYPAL);
        }
      }, React__default.createElement("span", {
        className: styles$1["payment-method-before"]
      }), React__default.createElement("img", {
        src: img$3,
        alt: "paypal",
        className: styles$1["payment-method"]
      }))))));
    }
  }]);

  return PayPlatformOptions;
}(React.PureComponent);

var css$2 = ".PriceOptions_options__iSN_S {\n  padding: 20px 50px;\n  border-bottom: 1px dashed #00000017;\n}\n.PriceOptions_options__iSN_S p {\n  font-size: 14px;\n  font-weight: 400;\n  color: #616a79;\n  margin-bottom: 20px;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD {\n  padding-right: 0;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ {\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__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ.PriceOptions_active__3cl1G {\n  background: rgba(255, 50, 102, 0.1);\n  border-radius: 4px;\n  border: 1px solid #ff3266;\n  color: #616a79;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceInput__2GSDh {\n  display: inline-block;\n  min-width: 70px;\n  width: auto;\n  margin: 6px;\n  text-align: center;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD 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__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_rate__FJSKL {\n  margin-left: 10px;\n}\n.PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_rate__FJSKL i {\n  margin-right: 5px;\n  color: #1790FF;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i {\n  padding: 0 0 12px 0;\n  border-bottom: none;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i p {\n  margin-bottom: 8px;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i .PriceOptions_infoItem__p5iwD {\n  text-align: center;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ {\n  border-radius: 6px;\n  height: 32px;\n  width: 72px;\n  margin: 0 0 12px 19px;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ:first-child {\n  margin: 0 0 12px 0px;\n}\n.PriceOptions_options__iSN_S.PriceOptions_small__3O05i .PriceOptions_infoItem__p5iwD .PriceOptions_priceInput__2GSDh {\n  display: block;\n  width: 254px;\n  border-radius: 6px;\n  height: 32px;\n}\n@media (max-width: 768px) {\n  .PriceOptions_options__iSN_S {\n    padding: 20px 20px;\n  }\n  .PriceOptions_options__iSN_S p {\n    font-size: 14px;\n    font-weight: 400;\n    color: #616a79;\n  }\n  .PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD {\n    padding-right: 0;\n    display: flex;\n    flex-direction: column;\n    justify-content: center;\n  }\n  .PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceBtn__2vdWf {\n    display: flex;\n    justify-content: space-between;\n  }\n  .PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ {\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__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceItem__3ahwJ.PriceOptions_active__3cl1G {\n    background-color: #fff;\n    color: #FF3266FF;\n    border-radius: 4px;\n    border: 1px solid #ff3266;\n  }\n  .PriceOptions_options__iSN_S .PriceOptions_infoItem__p5iwD .PriceOptions_priceInput__2GSDh {\n    border-radius: 6px;\n    height: 36px;\n    width: auto;\n  }\n}\n";
var styles$2 = {"options":"PriceOptions_options__iSN_S","infoItem":"PriceOptions_infoItem__p5iwD","priceItem":"PriceOptions_priceItem__3ahwJ","active":"PriceOptions_active__3cl1G","priceInput":"PriceOptions_priceInput__2GSDh","rate":"PriceOptions_rate__FJSKL","small":"PriceOptions_small__3O05i","priceBtn":"PriceOptions_priceBtn__2vdWf"};
styleInject_es.styleInject(css$2);

var FormattedMessage = function FormattedMessage(_ref) {
  var id = _ref.id;
  return id;
};

var PriceOptions = function PriceOptions(_ref2) {
  var price = _ref2.price,
      onPriceChange = _ref2.onPriceChange,
      _ref2$size = _ref2.size,
      _ref2$focusScroll = _ref2.focusScroll,
      _ref2$withTitle = _ref2.withTitle,
      withTitle = _ref2$withTitle === void 0 ? true : _ref2$withTitle,
      inputRef = _ref2.inputRef;
  var defaultOptions = [100, 600, 800]; // 控制是否为其他金额输入情况

  var _useState = React.useState(false),
      _useState2 = styleInject_es._slicedToArray(_useState, 2),
      inputStatus = _useState2[0],
      setInputStatus = _useState2[1];

  return React__default.createElement("div", {
    className: index.classnames(styles$2.options)
  }, withTitle ? React__default.createElement("p", null, React__default.createElement(FormattedMessage, {
    id: "pay.price.select.text"
  })) : null, React__default.createElement("div", {
    className: styles$2.infoItem,
    style: {
      marginBottom: "-12px"
    }
  }, React__default.createElement("span", {
    className: styles$2.priceBtn
  }, defaultOptions.map(function (item) {
    var _classnames;

    return React__default.createElement("span", {
      className: index.classnames((_classnames = {}, styleInject_es._defineProperty(_classnames, styles$2.priceItem, true), styleInject_es._defineProperty(_classnames, styles$2.active, price === item && !inputStatus), _classnames)),
      key: item,
      onClick: function onClick() {
        onPriceChange(item);
        setInputStatus(false);
      }
    }, React__default.createElement(FormattedMessage, {
      id: "".concat(formatMoney(item / 100, 0), "\xA5")
    }));
  }))));
};

var css$3 = ".WaitPayInfoView_waitingContainer__3wZ0a {\n  display: flex;\n  flex-direction: column;\n  justify-content: center;\n  align-items: center;\n}\n";
var styles$3 = {"waitingContainer":"WaitPayInfoView_waitingContainer__3wZ0a"};
styleInject_es.styleInject(css$3);

const img$7 = 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDhweCIgaGVpZ2h0PSI0M3B4IiB2aWV3Qm94PSIwIDAgNDggNDMiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDUwLjIgKDU1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gICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+';

var Button = function Button() {
  for (var _len = arguments.length, props = new Array(_len), _key = 0; _key < _len; _key++) {
    props[_key] = arguments[_key];
  }

  return React__default.createElement("button", props, "button");
};

var WaitPayInfoView =
/*#__PURE__*/
function (_Component) {
  styleInject_es._inherits(WaitPayInfoView, _Component);

  function WaitPayInfoView() {
    styleInject_es._classCallCheck(this, WaitPayInfoView);

    return styleInject_es._possibleConstructorReturn(this, styleInject_es._getPrototypeOf(WaitPayInfoView).apply(this, arguments));
  }

  styleInject_es._createClass(WaitPayInfoView, [{
    key: "render",
    value: function render() {
      var _this$props = this.props,
          onClickPayed = _this$props.onClickPayed,
          onClickProblem = _this$props.onClickProblem;
      return React__default.createElement("div", {
        className: styles$3.waitingContainer
      }, React__default.createElement("div", {
        className: styles$3.infoIconImgContainer
      }, React__default.createElement("img", {
        src: img$7,
        alt: "info label icon"
      })), React__default.createElement("div", null, React__default.createElement("div", {
        className: styles$3.pay_text
      }, "live.course_info.pay.notification"), React__default.createElement("div", {
        className: styles$3.btn_row
      }, React__default.createElement(Button, {
        className: index.classnames(styles$3.pay_btn, styles$3.btn_default),
        size: "small",
        onClick: function onClick() {
          onClickPayed && onClickPayed();
        }
      }, "live.course_info.pay.payed"), React__default.createElement(Button, {
        className: styles$3.btn_default,
        size: "small",
        style: {
          marginLeft: '16px'
        },
        onClick: function onClick() {
          onClickProblem && onClickProblem();
        }
      }, "live.course_info.pay.help"))));
    }
  }]);

  return WaitPayInfoView;
}(React.Component);

styleInject_es._defineProperty(WaitPayInfoView, "defaultProps", {
  onClickPayed: function onClickPayed() {
    console.log("onClickPayed");
  },
  onClickProblem: function onClickProblem() {
    console.log("onClickProblem");
  }
});

exports.ConsumeListView = ConsumeListView;
exports.PayPlatformOptions = PayPlatformOptions;
exports.PriceOptions = PriceOptions;
exports.WaitPayInfoView = WaitPayInfoView;
//# sourceMappingURL=index-fe1b29d9.js.map
