package com.hongyegroup.cpt_auths.ui

import android.content.Intent
import android.os.Bundle
import com.guadou.cs_cptservices.base.activity.YYBaseVDBActivity
import com.guadou.lib_baselib.base.vm.EmptyViewModel
import com.guadou.lib_baselib.bean.DataBindingConfig
import com.guadou.lib_baselib.utils.CommUtils
import com.guadou.lib_baselib.utils.StatusBarUtils
import com.hongyegroup.cpt_auths.BR
import com.hongyegroup.cpt_auths.R
import com.hongyegroup.cpt_auths.databinding.ActivityChooseAuthBinding

/**
 * 选择角色的页面
 */
class ChooseAuthActivity : YYBaseVDBActivity<EmptyViewModel, ActivityChooseAuthBinding>() {

    companion object {
        fun startInstance() {
            val context = CommUtils.getContext()
            val intent = Intent(context, ChooseAuthActivity::class.java)
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
            context.startActivity(intent)
        }
    }

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

    override fun startObserve() {

    }

    override fun init(savedInstanceState: Bundle?) {

        StatusBarUtils.immersive(this)
        setStatusBarWhiteText()

    }

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

        //普通用户登录
        fun gotoPersonalLoginPage() {
            PensonalLoginActivity.startInstance()
        }

        //商家登录
        fun gotoBusinessLoginPage() {
            BusinessLoginActivity.startInstance()
        }

    }

}