"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _react = _interopRequireDefault(require("react"));

var _success = _interopRequireDefault(require("./image/success.png"));

require("./index.css");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

var preCls = "tita-pay-page";

var payPage = function payPage(_ref) {
  var title = _ref.title,
      cardTitle = _ref.cardTitle,
      price = _ref.price,
      qrcode = _ref.qrcode,
      promptMes = _ref.promptMes,
      isSuccessPay = _ref.isSuccessPay,
      successMes = _ref.successMes;

  var renderSuccessCard = function renderSuccessCard() {
    return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("img", {
      className: "".concat(preCls, "__card__success-image"),
      src: _success["default"],
      alt: ""
    }), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(preCls, "__card__success-message")
    }, "\u606D\u559C\u60A8\uFF0C\u652F\u4ED8\u6210\u529F"), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(preCls, "__card__success-promptMes")
    }, successMes));
  };

  var renderCard = function renderCard() {
    return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(preCls, "__card-title")
    }, cardTitle), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(preCls, "__card-price")
    }, price), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(preCls, "__card-qrcode")
    }, /*#__PURE__*/_react["default"].createElement("img", {
      src: qrcode,
      alt: ""
    })), /*#__PURE__*/_react["default"].createElement("div", {
      className: "".concat(preCls, "__card-promptMes")
    }, qrcode ? promptMes : "订单获取失败，请返回重试"));
  };

  return /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls)
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "-layout")
  }, /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "__title")
  }, title), /*#__PURE__*/_react["default"].createElement("div", {
    className: "".concat(preCls, "__card")
  }, isSuccessPay ? renderSuccessCard() : renderCard())));
};

var _default = payPage;
exports["default"] = _default;