package com.wd.workoffice.ui.fg;

import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.wd.workoffice.R;
import com.wd.workoffice.app.WorkBaseFg;
import com.wd.workoffice.ui.activity.user.UserInfoActivity;
import com.wd.workoffice.ui.activity.user.UserPermissionActivity;
import com.wd.workoffice.ui.activity.user.UserSettingActivity;
import com.wd.workoffice.util.UserKeeper;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;


/**
 * author : flexible
 * email : lgd19940421@163.com
 * github: https://github.com/FlexibleXd
 **/
public class MyFragment extends WorkBaseFg {

    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_no)
    TextView tvNo;
    @BindView(R.id.ll_role)
    LinearLayout llRole;
    @BindView(R.id.ll_info)
    LinearLayout llInfo;
    @BindView(R.id.ll_setting)
    LinearLayout llSetting;
    @BindView(R.id.tv_dep)
    TextView tvDep;

    @Override
    protected void initView() {
        ButterKnife.bind(this, getContentView());
        tvNo.setText("员工编号:" + UserKeeper.getInstance().getUserErpId());
        tvName.setText(UserKeeper.getInstance().getUserNickName());
        tvDep.setText(UserKeeper.getInstance().getUserDepName());
    }


    @Override
    protected void initData() {
    }


    @Override
    protected void initEvent() {
    }

    @Override
    protected int layoutId() {
        return R.layout.fg_my;
    }


    @OnClick({R.id.ll_role, R.id.ll_info, R.id.ll_setting})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_role:
                startActivity(UserPermissionActivity.class);
                break;
            case R.id.ll_info:
                startActivity(UserInfoActivity.class);
                break;
            case R.id.ll_setting:
                startActivity(UserSettingActivity.class);
                break;
        }
    }

}
