package com.hongyegroup.cpt_pensonal.ui.fragment

import com.guadou.cs_cptservices.base.fragment.YYBaseVDBFragment
import com.guadou.cs_router.YYRouterService
import com.guadou.lib_baselib.base.vm.EmptyViewModel
import com.guadou.lib_baselib.bean.DataBindingConfig
import com.guadou.lib_baselib.ext.toast
import com.hongyegroup.cpt_pensonal.BR
import com.hongyegroup.cpt_pensonal.R
import com.hongyegroup.cpt_pensonal.databinding.FragmentPensonalSettingBinding

/**
 * 个人用户 首页第四个Tab
 * 个人设置页面
 */
class PensonalSettingFragment : YYBaseVDBFragment<EmptyViewModel, FragmentPensonalSettingBinding>() {

    override fun getDataBindingConfig(): DataBindingConfig {
        return DataBindingConfig(R.layout.fragment_pensonal_setting)
            .addBindingParams(BR.click, ClickProxy())
    }

    override fun startObserve() {

    }

    override fun init() {
        setStatusBarBlackText()

    }

    fun scrollTopRefresh() {

    }

    override fun onHiddenChanged(hidden: Boolean) {
        super.onHiddenChanged(hidden)
        if (!hidden) {
            setStatusBarBlackText()
        }
    }

    /**
     * DataBinding事件处理
     */
    inner class ClickProxy {

        fun gotoResetPasswordPage() {
            YYRouterService.authComponentServer?.startResetPasswordActivity(isFromBusiness = false, isForgot = false)
        }

        fun doLogout() {
            toast("登出")
        }

    }

}