"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
var _inheritsLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/inheritsLoose"));
var React = _interopRequireWildcard(require("react"));
require("./index.scss");
var _index2 = _interopRequireDefault(require("../../components/shopComponents/dialog/index"));
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
var ShopButtonSetter = /*#__PURE__*/function (_Component) {
  (0, _inheritsLoose2["default"])(ShopButtonSetter, _Component);
  function ShopButtonSetter(props, context) {
    var _this;
    _this = _Component.call(this, props, context) || this;
    _this.state = {
      // theSendData: {},
    };
    return _this;
  }
  var _proto = ShopButtonSetter.prototype;
  _proto.render = function render() {
    var _this$props = this.props,
      btnText = _this$props.btnText,
      icon = _this$props.icon,
      onChange = _this$props.onChange,
      value = _this$props.value;
    var onClose = function onClose() {
      var Obj = {};
      Obj.visible = !value.visible;
      Obj.data = {
        // shopIDarray: this.state.theSendData
      };
      onChange(Obj);
    };
    var theMessageS = function theMessageS(values) {
      // 传递商品的id数组
      // this.setState({
      //   theSendData: values
      // })
      var Obj = {};
      Obj.visible = !value.visible;
      Obj.data = {
        shopIDarray: values
      };
      onChange(Obj);
    };
    return /*#__PURE__*/React.createElement("div", {
      className: "button-setter"
    }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_index2["default"], {
      visible: value.visible,
      onClose: onClose,
      theMessageS: theMessageS
    })), /*#__PURE__*/React.createElement(_button["default"], {
      onClick: onClose
    }, /*#__PURE__*/React.createElement(_icon["default"], {
      type: icon
    }), btnText));
  };
  return ShopButtonSetter;
}(React.Component);
exports["default"] = ShopButtonSetter;
ShopButtonSetter.displayName = 'ShopButtonSetter';