@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.showToast as uni_showToast;
open class GenPagesIndexIndex1 : BasePage {
    constructor(__ins: ComponentInternalInstance) : super(__ins) {}
    @Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
    override fun `$render`(): Any? {
        val _ctx = this;
        val _cache = this.`$`.renderCache;
        val _component_checkbox = resolveComponent("checkbox");
        val _component_label = resolveComponent("label");
        val _component_checkbox_group = resolveComponent("checkbox-group");
        return createElementVNode("view", utsMapOf("class" to "container"), utsArrayOf(
            createElementVNode("view", utsMapOf("class" to "form"), utsArrayOf(
                createElementVNode("input", utsMapOf("class" to "input", "type" to "text", "placeholder" to "请输入您的账号", "modelValue" to _ctx.username, "onInput" to fun(`$event`: InputEvent){
                    _ctx.username = `$event`.detail.value;
                }
                ), null, 40, utsArrayOf(
                    "modelValue",
                    "onInput"
                )),
                createElementVNode("input", utsMapOf("class" to "input", "type" to "password", "placeholder" to "请输入您的密码", "modelValue" to _ctx.password, "onInput" to fun(`$event`: InputEvent){
                    _ctx.password = `$event`.detail.value;
                }
                ), null, 40, utsArrayOf(
                    "modelValue",
                    "onInput"
                )),
                createElementVNode("view", utsMapOf("class" to "agreement"), utsArrayOf(
                    createVNode(_component_checkbox_group, utsMapOf("onChange" to _ctx.handleAgreementChange), utsMapOf("default" to withSlotCtx(fun(): UTSArray<Any> {
                        return utsArrayOf(
                            createVNode(_component_label, null, utsMapOf("default" to withSlotCtx(fun(): UTSArray<Any> {
                                return utsArrayOf(
                                    createVNode(_component_checkbox, utsMapOf("value" to "agree")),
                                    " 阅读并同意《用户协议》和《隐私政策》 "
                                );
                            }
                            ), "_" to 1))
                        );
                    }
                    ), "_" to 1), 8, utsArrayOf(
                        "onChange"
                    ))
                )),
                createElementVNode("button", utsMapOf("class" to "button", "onClick" to _ctx.handleLogin), "登录", 8, utsArrayOf(
                    "onClick"
                ))
            ))
        ));
    }
    open var username: String by `$data`;
    open var password: String by `$data`;
    open var agreed: Boolean by `$data`;
    @Suppress("USELESS_CAST")
    override fun data(): Map<String, Any?> {
        return utsMapOf("username" to "", "password" to "", "agreed" to false);
    }
    override fun `$initMethods`() {
        this.handleAgreementChange = fun(e) {
            this.agreed = e.detail.value.includes("agree");
        }
        ;
        this.handleLogin = fun() {
            if (!this.agreed) {
                uni_showToast(ShowToastOptions(title = "请先同意用户协议和隐私政策", icon = "none"));
                return;
            }
            uni_showToast(ShowToastOptions(title = "登录成功", icon = "success"));
        }
        ;
    }
    open lateinit var handleAgreementChange: (e) -> Unit;
    open lateinit var handleLogin: () -> 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("container" to padStyleMapOf(utsMapOf("display" to "flex", "justifyContent" to "center", "alignItems" to "center", "backgroundColor" to "#f5f5f5")), "form" to padStyleMapOf(utsMapOf("width" to "80%", "backgroundColor" to "#ffffff", "paddingTop" to 20, "paddingRight" to 20, "paddingBottom" to 20, "paddingLeft" to 20, "borderRadius" to 8, "boxShadow" to "0 2px 10px rgba(0, 0, 0, 0.1)")), "input" to padStyleMapOf(utsMapOf("width" to "100%", "height" to 40, "marginBottom" to 15, "paddingTop" to 10, "paddingRight" to 10, "paddingBottom" to 10, "paddingLeft" to 10, "borderWidth" to 1, "borderStyle" to "solid", "borderColor" to "#cccccc", "borderRadius" to 4)), "agreement" to padStyleMapOf(utsMapOf("marginBottom" to 15)), "button" to padStyleMapOf(utsMapOf("width" to "100%", "height" to 40, "backgroundColor" to "#007aff", "color" to "#ffffff", "borderWidth" to "medium", "borderStyle" to "none", "borderColor" to "#000000", "borderRadius" to 4, "fontSize" to 16)));
            }
        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();
    }
}
