@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER")
package uni.UNIABF0653;
import io.dcloud.uniapp.*;
import io.dcloud.uniapp.extapi.*;
import io.dcloud.uniapp.framework.*;
import io.dcloud.uniapp.runtime.*;
import io.dcloud.uniapp.vue.*;
import io.dcloud.uniapp.vue.shared.*;
import io.dcloud.unicloud.*;
import io.dcloud.uts.*;
import io.dcloud.uts.Map;
import io.dcloud.uts.Set;
import io.dcloud.uts.UTSAndroid;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.async;
import io.dcloud.uniapp.extapi.navigateTo as uni_navigateTo;
import io.dcloud.uniapp.extapi.showToast as uni_showToast;
open class GenPagesIndexLogin : BasePage {
    constructor(__ins: ComponentInternalInstance) : super(__ins) {}
    @Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
    override fun `$render`(): Any? {
        val _ctx = this;
        val _cache = this.`$`.renderCache;
        val _component_uni_easyinput = resolveEasyComponent("uni-easyinput", GenUniModulesUniEasyinputComponentsUniEasyinputUniEasyinputClass);
        val _component_radio = resolveComponent("radio");
        return createElementVNode("view", utsMapOf("class" to "login-container"), utsArrayOf(
            createElementVNode("view", utsMapOf("class" to "welcome"), utsArrayOf(
                createElementVNode("text", utsMapOf("class" to "welcome-text"), "欢迎登陆车辆合同生成")
            )),
            createElementVNode("view", utsMapOf("class" to "input-container"), utsArrayOf(
                createVNode(_component_uni_easyinput, utsMapOf("prefixIcon" to "person", "class" to "input", "placeholder" to "请输入您的账号", "modelValue" to _ctx.username, "onUpdate:modelValue" to fun(`$event`: String){
                    _ctx.username = `$event`;
                }
                , "inputBorder" to false), null, 8, utsArrayOf(
                    "modelValue",
                    "onUpdate:modelValue"
                )),
                createElementVNode("view", utsMapOf("class" to "underline"))
            )),
            createElementVNode("view", utsMapOf("class" to "input-container"), utsArrayOf(
                createVNode(_component_uni_easyinput, utsMapOf("prefixIcon" to "locked", "class" to "input", "type" to "password", "placeholder" to "请输入您的密码", "modelValue" to _ctx.password, "onUpdate:modelValue" to fun(`$event`: String){
                    _ctx.password = `$event`;
                }
                , "inputBorder" to false), null, 8, utsArrayOf(
                    "modelValue",
                    "onUpdate:modelValue"
                )),
                createElementVNode("view", utsMapOf("class" to "underline"))
            )),
            createElementVNode("view", utsMapOf("class" to "agreement"), utsArrayOf(
                createVNode(_component_radio, utsMapOf("class" to "login-agree", "value" to "r1", "checked" to false, "style" to normalizeStyle(utsMapOf("transform" to "scale(0.7)", "margin-right" to "15px"))), utsMapOf("default" to withSlotCtx(fun(): UTSArray<Any> {
                    return utsArrayOf(
                        "登录即代表同意 "
                    );
                }
                ), "_" to 1), 8, utsArrayOf(
                    "style"
                )),
                createElementVNode("text", utsMapOf("class" to "link", "onClick" to fun(){
                    _ctx.showModal("userAgreement");
                }
                ), "《用户协议》", 8, utsArrayOf(
                    "onClick"
                )),
                createElementVNode("text", utsMapOf("class" to "link"), "与"),
                createElementVNode("text", utsMapOf("class" to "link", "onClick" to fun(){
                    _ctx.showModal("privacyPolicy");
                }
                ), "《隐私政策》", 8, utsArrayOf(
                    "onClick"
                ))
            )),
            createElementVNode("view", utsMapOf("class" to "button_container"), utsArrayOf(
                createElementVNode("button", utsMapOf("class" to "login-button", "onClick" to _ctx.handleLogin), "登陆", 8, utsArrayOf(
                    "onClick"
                ))
            )),
            if (isTrue(_ctx.isModalVisible)) {
                createElementVNode("view", utsMapOf("key" to 0, "class" to "modal"), utsArrayOf(
                    createElementVNode("view", utsMapOf("class" to "modal-content"), utsArrayOf(
                        createElementVNode("view", utsMapOf("class" to "modal-header"), utsArrayOf(
                            createElementVNode("text", null, toDisplayString(_ctx.modalTitle), 1),
                            createElementVNode("text", utsMapOf("class" to "close", "onClick" to _ctx.closeModal), "×", 8, utsArrayOf(
                                "onClick"
                            ))
                        )),
                        createElementVNode("view", utsMapOf("class" to "modal-body"), utsArrayOf(
                            createElementVNode("text", null, toDisplayString(_ctx.modalContent), 1)
                        ))
                    ))
                ));
            } else {
                createCommentVNode("v-if", true);
            }
        ));
    }
    open var username: String by `$data`;
    open var password: String by `$data`;
    open var isModalVisible: Boolean by `$data`;
    open var modalTitle: String by `$data`;
    open var modalContent: String by `$data`;
    @Suppress("USELESS_CAST")
    override fun data(): Map<String, Any?> {
        return utsMapOf("username" to "", "password" to "", "isModalVisible" to false, "modalTitle" to "", "modalContent" to "");
    }
    override fun `$initMethods`() {
        this.handleLogin = fun() {
            if (!this.username || !this.password) {
                uni_showToast(ShowToastOptions(title = "请输入账号和密码", icon = "none"));
                return;
            }
            uni_showToast(ShowToastOptions(title = "登录成功", icon = "success"));
            uni_navigateTo(NavigateToOptions(url = "/pages/home/home"));
        }
        ;
        this.showModal = fun(type) {
            if (type === "userAgreement") {
                this.modalTitle = "用户协议";
                this.modalContent = "这是用户协议内容...";
            } else if (type === "privacyPolicy") {
                this.modalTitle = "隐私政策";
                this.modalContent = "这是隐私政策内容...";
            }
            this.isModalVisible = true;
        }
        ;
        this.closeModal = fun() {
            this.isModalVisible = false;
        }
        ;
    }
    open lateinit var handleLogin: () -> Unit;
    open lateinit var showModal: (type) -> Unit;
    open lateinit var closeModal: () -> Unit;
    companion object {
        val styles: Map<String, Map<String, Map<String, Any>>> by lazy {
            normalizeCssStyles(utsArrayOf(
                styles0
            ), utsArrayOf(
                GenApp.styles
            ))
        };
        val styles0: Map<String, Map<String, Map<String, Any>>>
            get() {
                return utsMapOf("login-container" to padStyleMapOf(utsMapOf("display" to "flex", "flexDirection" to "column", "alignItems" to "center", "paddingTop" to 40, "paddingRight" to 20, "paddingBottom" to 40, "paddingLeft" to 20, "backgroundColor" to "#ffffff")), "welcome" to padStyleMapOf(utsMapOf("height" to "50%", "marginBottom" to 40, "display" to "flex", "alignItems" to "center")), "welcome-text" to padStyleMapOf(utsMapOf("fontSize" to 20, "fontWeight" to "bold", "color" to "#044f7a")), "input-container" to padStyleMapOf(utsMapOf("width" to "100%")), "input" to padStyleMapOf(utsMapOf("width" to "70%", "height" to 40, "fontSize" to 16, "borderWidth" to "medium", "borderStyle" to "none", "borderColor" to "#000000", "outline" to "none", "backgroundColor" to "rgba(0,0,0,0)")), "underline" to padStyleMapOf(utsMapOf("width" to "100%", "height" to 1, "backgroundColor" to "#f2f2f2", "marginTop" to 5)), "agreement" to padStyleMapOf(utsMapOf("fontSize" to 14, "color" to "#666666", "marginBottom" to 20, "display" to "flex", "flexDirection" to "row")), "login-agree" to padStyleMapOf(utsMapOf("fontSize" to "16rpx")), "link" to padStyleMapOf(utsMapOf("color" to "#007aff", "textDecoration" to "underline", "fontSize" to "16rpx")), "button_container" to padStyleMapOf(utsMapOf("width" to "70%", "height" to "40%", "display" to "flex", "alignItems" to "center")), "login-button" to padStyleMapOf(utsMapOf("width" to "70%", "height" to "70rpx", "lineHeight" to "70rpx", "backgroundColor" to "#044f7a", "color" to "#ffffff", "borderWidth" to "medium", "borderStyle" to "none", "borderColor" to "#000000", "borderRadius" to 4, "fontSize" to 16, "position" to "absolute", "top" to "15%", "left" to "20%")), "modal" to padStyleMapOf(utsMapOf("position" to "fixed", "top" to 0, "left" to 0, "width" to "100%", "height" to "100%", "backgroundColor" to "rgba(0,0,0,0.5)", "display" to "flex", "justifyContent" to "center", "alignItems" to "center")), "modal-content" to padStyleMapOf(utsMapOf("width" to "80%", "backgroundColor" to "#ffffff", "borderRadius" to 8, "paddingTop" to 20, "paddingRight" to 20, "paddingBottom" to 20, "paddingLeft" to 20)), "modal-header" to padStyleMapOf(utsMapOf("display" to "flex", "justifyContent" to "space-between", "alignItems" to "center", "fontSize" to 18, "fontWeight" to "bold", "marginBottom" to 15)), "close" to padStyleMapOf(utsMapOf("fontSize" to 24, "cursor" to "pointer")), "modal-body" to padStyleMapOf(utsMapOf("fontSize" to 16, "lineHeight" to 1.5)));
            }
        var inheritAttrs = true;
        var inject: Map<String, Map<String, Any?>> = utsMapOf();
        var emits: Map<String, Any?> = utsMapOf();
        var props = normalizePropsOptions(utsMapOf());
        var propsNeedCastKeys: UTSArray<String> = utsArrayOf();
        var components: Map<String, CreateVueComponent> = utsMapOf();
    }
}
