@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER", "SENSELESS_COMPARISON", "NAME_SHADOWING", "UNNECESSARY_NOT_NULL_ASSERTION")
package uni.UNIHelloUniAppX
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 kotlin.properties.Delegates
import io.dcloud.uniapp.extapi.vibrateLong as uni_vibrateLong
import io.dcloud.uniapp.extapi.vibrateShort as uni_vibrateShort
open class GenPagesAPIVibrateVibrate : BasePage {
    constructor(__ins: ComponentInternalInstance, __renderer: String?) : super(__ins, __renderer) {
        onLoad(fun(_: OnLoadOptions) {
            stat_instance.onLoad(this)
        }
        , __ins)
        onPageShow(fun() {
            stat_instance.onShow(this)
        }
        , __ins)
        onPageHide(fun() {
            stat_instance.onHide(this)
        }
        , __ins)
        onUnload(fun() {
            stat_instance.onUnload(this)
        }
        , __ins)
    }
    companion object {
        @Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
        var setup: (__props: GenPagesAPIVibrateVibrate) -> Any? = fun(__props): Any? {
            val __ins = getCurrentInstance()!!
            val _ctx = __ins.proxy as GenPagesAPIVibrateVibrate
            val _cache = __ins.renderCache
            val statusText = ref("等待触发振动")
            fun gen_updateStatus_fn(message: String): Unit {
                statusText.value = message
            }
            val updateStatus = ::gen_updateStatus_fn
            fun gen_getShortTypeLabel_fn(type: ShortType): String {
                when (type) {
                    "light" -> 
                        return "轻振动"
                    "medium" -> 
                        return "中振动"
                    else -> 
                        return "强振动"
                }
            }
            val getShortTypeLabel = ::gen_getShortTypeLabel_fn
            fun gen_callShort_fn(type: ShortType): Unit {
                uni_vibrateShort(VibrateShortOptions(type = type, success = fun(_){
                    updateStatus("" + getShortTypeLabel(type) + "调用成功")
                }
                , fail = fun(err){
                    updateStatus("短振动调用失败：" + err.errMsg)
                }
                ))
            }
            val callShort = ::gen_callShort_fn
            fun gen_callLong_fn(): Unit {
                uni_vibrateLong(VibrateLongOptions(success = fun(_){
                    updateStatus("长振动调用成功")
                }
                , fail = fun(err){
                    updateStatus("长振动调用失败：" + err.errMsg)
                }
                ))
            }
            val callLong = ::gen_callLong_fn
            return fun(): Any? {
                return _cE("scroll-view", _uM("style" to _nS(_uM("flex" to "1", "padding" to "6px"))), _uA(
                    _cE("text", _uM("class" to "uni-h2"), "振动"),
                    _cE("text", _uM("class" to "notice"), "如下情况会导致无法振动：设备电量不足、静音模式、关闭了系统触感"),
                    _cE("text", _uM("class" to "uni-h3"), "短振动 uni.vibrateShort"),
                    _cE("text", _uM("class" to "margin-v"), "短振动支持 `light`、`medium`、`heavy` 三种力度类型。"),
                    _cE("button", _uM("class" to "margin-v", "onClick" to fun(){
                        callShort("light")
                    }
                    ), "轻振动", 8, _uA(
                        "onClick"
                    )),
                    _cE("button", _uM("class" to "margin-v", "onClick" to fun(){
                        callShort("medium")
                    }
                    ), "中振动", 8, _uA(
                        "onClick"
                    )),
                    _cE("button", _uM("class" to "margin-v", "onClick" to fun(){
                        callShort("heavy")
                    }
                    ), "强振动", 8, _uA(
                        "onClick"
                    )),
                    _cE("text", _uM("class" to "uni-h3"), "长振动 uni.vibrateLong"),
                    _cE("button", _uM("onClick" to callLong), "触发长振动"),
                    _cE("text", _uM("class" to "uni-h4"), "最近日志："),
                    _cE("text", _uM("class" to "log-text"), _tD(unref(statusText)), 1)
                ), 4)
            }
        }
        val styles: Map<String, Map<String, Map<String, Any>>> by lazy {
            _nCS(_uA(
                styles0
            ))
        }
        val styles0: Map<String, Map<String, Map<String, Any>>>
            get() {
                return _uM("margin-v" to _pS(_uM("marginTop" to 5, "marginRight" to 0, "marginBottom" to 5, "marginLeft" to 0)), "log-text" to _pS(_uM("paddingTop" to 10, "paddingRight" to 10, "paddingBottom" to 10, "paddingLeft" to 10, "fontSize" to 14, "borderTopWidth" to 1, "borderRightWidth" to 1, "borderBottomWidth" to 1, "borderLeftWidth" to 1, "borderTopStyle" to "solid", "borderRightStyle" to "solid", "borderBottomStyle" to "solid", "borderLeftStyle" to "solid", "borderTopColor" to "#cccccc", "borderRightColor" to "#cccccc", "borderBottomColor" to "#cccccc", "borderLeftColor" to "#cccccc")), "notice" to _pS(_uM("color" to "#550000", "fontSize" to 14, "fontStyle" to "italic")))
            }
        var inheritAttrs = true
        var inject: Map<String, Map<String, Any?>> = _uM()
        var emits: Map<String, Any?> = _uM()
        var props = _nP(_uM())
        var propsNeedCastKeys: UTSArray<String> = _uA()
        var components: Map<String, CreateVueComponent> = _uM()
    }
}
