<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">"use strict";

var _extends = Object.assign || function (target) { for (var i = 1; i &lt; arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

var emailVerifyTimesInterval = void 0;
var initSubmitData = {
    ticketId: "",
    ticketName: "",
    name: "",
    email: "",
    phone: "",
    emailVerifyCode: "", //é‚®ç®±éªŒè¯ç&nbsp;
    discountCode: "" //ä¼˜æƒ&nbsp;ç&nbsp;ï¼›é‚€è¯·ç&nbsp;
};

var TicketWaitForm = React.createClass({ displayName: "TicketWaitForm",
    mixins: [MyReactMixin],
    getInitialState: function getInitialState() {
        var initParam = this.getInitParam();
        return {
            isShowTicketWaitForm: false, //æ˜¯å¦æ˜¾ç¤ºå€™è¡¥è¡¨å•
            submitData: {
                ticketId: "",
                ticketName: "",
                name: "",
                email: "",
                phone: "",
                emailVerifyCode: "", //é‚®ç®±éªŒè¯ç&nbsp;
                discountCode: "" //ä¼˜æƒ&nbsp;ç&nbsp;ï¼›é‚€è¯·ç&nbsp;
            },
            showGetEmailVerifyCode: true, //æ˜¯å¦æ˜¾ç¤ºèŽ·å–éªŒè¯ç&nbsp;
            times: 0 //éªŒè¯ç&nbsp;èŽ·å–æ—¶é—´
        };
    },

    componentDidMount: function componentDidMount() {
        $.subscribe("ticketWaitForm.showTicketWaitForm", this.showTicketWaitForm);
    },

    showTicketWaitForm: function showTicketWaitForm(data) {
        if (data.isTrigger) {
            data = [].slice.call(arguments, 1)[0];
        }
        if (!data || !data.ticketId || !data.ticketName) {
            return;
        }
        this.setState({ isShowTicketWaitForm: true, submitData: data });
    },

    hideTicketWaitForm: function hideTicketWaitForm() {
        this.setState({ isShowTicketWaitForm: false, submitData: _extends({}, initSubmitData), showGetEmailVerifyCode: true, times: 0 });
        if (emailVerifyTimesInterval) {
            clearInterval(emailVerifyTimesInterval);
        }
    },

    editSubmitData: function editSubmitData(variableName, value) {
        var data = this.state.submitData;
        data[variableName] = value;
        this.setState({ submitData: data });
    },

    openTimes: function openTimes() {
        var that = this;
        if (emailVerifyTimesInterval) {
            clearInterval(emailVerifyTimesInterval);
        }
        emailVerifyTimesInterval = setInterval(function () {
            var times = that.state.times - 1;
            that.setState({ times: times });
            if (times === 0) {
                clearInterval(emailVerifyTimesInterval);
                that.setState({ showGetEmailVerifyCode: true });
            }
        }, 1000);
    },

    getEmailVerifyCode: function getEmailVerifyCode() {
        var that = this;
        var _state$submitData = this.state.submitData,
            ticketId = _state$submitData.ticketId,
            ticketName = _state$submitData.ticketName,
            name = _state$submitData.name,
            email = _state$submitData.email,
            phone = _state$submitData.phone,
            emailVerifyCode = _state$submitData.emailVerifyCode;

        if (!email || email === "") {
            alertWarningTips(i18n.common.emailNotNull);
            return;
        }

        $.ajax({
            url: "/api/v2/ticket/" + param.eventId + "/sendTicketWaitEmailCode",
            data: {
                email: email,
                ticketId: ticketId
            },
            async: false,
            dataType: 'json',
            success: function success(result) {
                var retStatus = result.retStatus,
                    respObject = result.respObject;

                if (retStatus == 200) {
                    alertSuccessTips(i18n.common.codeSendSuccess); //éªŒè¯ç&nbsp;å‘é€æˆåŠŸ
                    that.setState({ showGetEmailVerifyCode: false, times: 60 });
                    that.openTimes();
                } else if (retStatus == 201) {
                    if (respObject == 1) {
                        alertWarningTips(i18n.ticketWaitForm.canWaitTipA);
                    } else if (respObject == 2) {
                        alertWarningTips(i18n.ticketWaitForm.canWaitTipB);
                    } else if (respObject == 3) {
                        alertWarningTips(i18n.ticketWaitForm.canWaitTipC);
                    }
                } else {
                    alertWarningTips(result.respObject);
                }
            }
        });
    },

    submitWait: function submitWait() {
        var that = this;
        var _state$submitData2 = this.state.submitData,
            ticketId = _state$submitData2.ticketId,
            name = _state$submitData2.name,
            email = _state$submitData2.email,
            phone = _state$submitData2.phone,
            emailVerifyCode = _state$submitData2.emailVerifyCode,
            discountCode = _state$submitData2.discountCode;

        if (!name || name === "") {
            alertWarningTips(i18n.commonMailingAddress.userNameNotEmpty); //å§“åä¸å¯ä¸ºç©º
            return;
        } else if (!email || email === "") {
            alertWarningTips(i18n.common.emailNotEmptyTip); //é‚®ç®±ä¸èƒ½ä¸ºç©º
            return;
        } else if (!emailVerifyCode || emailVerifyCode === "") {
            alertWarningTips(i18n.common.checkCodeNotEmptyTip); //éªŒè¯ç&nbsp;ä¸èƒ½ä¸ºç©º
            return;
        }
        $.ajax({
            url: "/api/v2/ticket/" + param.eventId + "/addTicketWait",
            data: {
                ticketId: ticketId,
                name: name,
                email: email,
                phone: phone,
                emailVerifyCode: emailVerifyCode,
                discountCode: discountCode
            },
            type: "post",
            async: false,
            dataType: 'json',
            success: function success(result) {
                var retStatus = result.retStatus,
                    respObject = result.respObject;

                if (retStatus == 200) {
                    alertSuccessTips(i18n.attendeePersonal.submittedSuccessfully); //æäº¤æˆåŠŸ
                    that.hideTicketWaitForm();
                } else if (retStatus == 201) {
                    if (respObject == 1) {
                        alertWarningTips(i18n.ticketWaitForm.canWaitTipA);
                    } else if (respObject == 2) {
                        alertWarningTips(i18n.ticketWaitForm.canWaitTipB);
                    } else if (respObject == 3) {
                        alertWarningTips(i18n.ticketWaitForm.canWaitTipC);
                    }
                } else {
                    alertWarningTips(result.respObject);
                }
            }
        });
    },

    render: function render() {
        var _state = this.state,
            isShowTicketWaitForm = _state.isShowTicketWaitForm,
            _state$submitData3 = _state.submitData,
            ticketName = _state$submitData3.ticketName,
            name = _state$submitData3.name,
            email = _state$submitData3.email,
            phone = _state$submitData3.phone,
            emailVerifyCode = _state$submitData3.emailVerifyCode,
            showGetEmailVerifyCode = _state.showGetEmailVerifyCode,
            times = _state.times;

        var that = this;
        return React.createElement(LayerWrapper, { title: i18n.ticketWaitForm.ticketWait, /*é—¨ç¥¨å€™è¡¥*/isShow: isShowTicketWaitForm, hide: that.hideTicketWaitForm }, React.createElement("div", { className: "form_box" }, React.createElement("div", { className: "form_li" }, React.createElement("div", { className: "label_l middle" }, i18n.common.ticket /*é—¨ç¥¨*/), React.createElement("div", { className: "con_l" }, React.createElement("div", { className: "input_box" }, React.createElement("input", { type: "text", className: "input", value: ticketName, disabled: true })))), React.createElement("div", { className: "form_li" }, React.createElement("div", { className: "label_l middle" }, i18n.common.name, /*å§“å*/React.createElement("strong", { className: "error_meg" }, "*")), React.createElement("div", { className: "con_l" }, React.createElement("div", { className: "input_box" }, React.createElement("input", { type: "text", className: "input", value: name, onChange: function onChange(e) {
                that.editSubmitData("name", e.target.value);
            } })))), React.createElement("div", { className: "form_li" }, React.createElement("div", { className: "label_l middle" }, i18n.common.email, /*é‚®ç®±*/React.createElement("strong", { className: "error_meg" }, "*")), React.createElement("div", { className: "con_l" }, React.createElement("div", { className: "input_box" }, React.createElement("input", { type: "text", className: "input", value: email, onChange: function onChange(e) {
                that.editSubmitData("email", e.target.value);
            } })))), React.createElement("div", { className: "form_li" }, React.createElement("div", { className: "label_l middle" }, i18n.common.checkCode, /*éªŒè¯ç&nbsp;*/React.createElement("strong", { className: "error_meg" }, "*")), React.createElement("div", { className: "f_con" }, React.createElement("div", { className: "clearfix" }, React.createElement("div", { className: "col-lg-9" }, React.createElement("div", { className: "input_box" },
        /*"è¯·è¾“å…¥éªŒè¯ç&nbsp;"*/
        React.createElement("input", { type: "text", className: "input", placeholder: i18n.common.inputCode, value: emailVerifyCode, onChange: function onChange(e) {
                that.editSubmitData("emailVerifyCode", e.target.value);
            } }))), React.createElement("div", { className: "col-lg-3" }, React.createElement("span", { className: "button set sms_code_container", onClick: that.getEmailVerifyCode, style: { display: showGetEmailVerifyCode ? "" : 'none' } }, " ", i18n.common.getCode /*èŽ·å–éªŒè¯ç&nbsp;*/), React.createElement("span", { className: "button set sms_code_container", style: { display: showGetEmailVerifyCode ? "none" : '' } }, times + "s"))))), React.createElement("div", { className: "form_li" }, React.createElement("div", { className: "label_l middle" }, i18n.common.phoneNumber /*æ‰‹æœºå·*/), React.createElement("div", { className: "con_l" }, React.createElement("div", { className: "input_box" }, React.createElement("input", { type: "text", className: "input", value: phone, onChange: function onChange(e) {
                that.editSubmitData("phone", e.target.value);
            } })))), React.createElement("div", { className: "form_li form_save text_center" }, React.createElement("a", { href: "javascript:void(0);", className: "button save", onClick: that.submitWait }, i18n.common.submit /*æäº¤*/))));
    }

});

$(function () {
    ReactDOM.render(React.createElement(TicketWaitForm, null), document.getElementById('ticketWaitForm'));
});</pre></body></html>