package com.cooleshow.usercenter.ui.activity

import android.os.Bundle
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.launcher.ARouter
import com.cooleshow.base.ext.onClick
import com.cooleshow.base.ui.activity.BaseMvpActivity
import com.cooleshow.base.utils.helper.QMUIStatusBarHelper
import com.cooleshow.provider.router.RouterPath
import com.cooleshow.usercenter.R
import com.cooleshow.usercenter.data.protocol.UserInfo
import com.cooleshow.usercenter.injection.component.DaggerUserComponent
import com.cooleshow.usercenter.injection.module.UserModule
import com.cooleshow.usercenter.presenter.LoginPresenter
import com.cooleshow.usercenter.presenter.view.LoginView
import kotlinx.android.synthetic.main.activity_login.*

@Route(path = RouterPath.UserCenter.PATH_LOGIN)
class LoginActivity : BaseMvpActivity<LoginPresenter>(), LoginView {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        QMUIStatusBarHelper.setStatusBarLightMode(this);
    }

    override fun getLayoutId(): Int {
        return R.layout.activity_login;
    }

    override fun injectComponent() {
        DaggerUserComponent.builder()
            .activityComponent(mActivityComponent)
            .userModule(UserModule())
            .build()
            .inject(this)
        mPresenter.mView = this
    }


    override fun onLoginResult(result: UserInfo) {
        TODO("Not yet implemented")
    }

    override fun initView() {
        tv_login_by_code.onClick {
            ARouter.getInstance().build(RouterPath.UserCenter.PATH_VERIFY_LOGIN).navigation()
        }
//        mForgetPwdTv.onClick{
//            ARouter.getInstance().build(RouterPath.APPCenter.PATH_HOME).navigation()
//        }


    }
}