LoginSuccessActivity.java 3.28 KB
package com.cnlive.strike;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;

import androidx.annotation.Nullable;

import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.cnlive.core.libs.base.frame.activity.BaseActivity;
import com.cnlive.cloud.user.model.LoginSuccessInfo;
import com.cnlive.cloud.user.ui.activity.PersonalDataActivity;
import com.cnlive.cloud.user.util.UserRouterHelper;

@Route(path = "/cloud/user/LoginSuccessActivity")
public class LoginSuccessActivity extends BaseActivity {
    @Autowired(name = "eventType")
    int eventType;//传递类型
    @Autowired(name = "isHasOtherUserInfo")
    boolean isHasOtherUserInfo;//是否有第三方数据
    @Autowired(name = "isChangeUserNickName")
    boolean isChangeUserNickName;//是否修改用户昵称
    @Autowired(name = "nickName")
    String nickName;//用户昵称
    @Autowired(name = "nickName")
    String faceUrl;//用户头像地址
    @Autowired(name = "successInfo")
    LoginSuccessInfo successInfo;//登录成功后需要传递的数据

    @Override
    protected void init(@Nullable Bundle savedInstanceState) {
        super.init(savedInstanceState);
        //不显示默认空视图
        setEnableCreateDefultEmptyView(false);
    }


    @Override
    protected void initView() {
        initAction();
    }

    private void initAction() {
        switch (eventType) {
            case UserRouterHelper.SHOW_MAIN_VIEW://显示主界面
                startActivity(new Intent(me, PersonalDataActivity.class));
                finish();
                break;

            case UserRouterHelper.MODIFY_USER_IMAGE://修改用户头像
                Log.e(TAG, "修改用户头像");
                //todo
//                LoginManager.modifyUserImage(UserService.getUid(this), faceUrl);
                finish();
                break;

            case UserRouterHelper.USER_INVALID://用户失效
                Log.e(TAG, "用户失效");
                //todo
                // UserOfflineUtil.userInvalid(context);
                finish();
            case UserRouterHelper.MODIFY_USER_NAME://修改用户名称
                //todo
                Log.e(TAG, "修改用户名称");
                // LoginManager.modifyUserName( UserService.getUid(context), nickName);

                finish();
                break;
            case UserRouterHelper.COIN_RAIN_ACTION://下金币
                Log.e(TAG, "下金币");
                //todo
//                taskId = getIntent().getExtras().getString("taskId");
//                contentId = getIntent().getExtras().getString("contentId");
//                addtype = getIntent().getExtras().getString("addtype");
//                isDouyin = getIntent().getExtras().getBoolean("isDouyin");
//                if (TextUtils.isEmpty(taskId)) {
//                    taskId = "";
//                }
//                if (TextUtils.isEmpty(contentId)) {
//                    contentId = "";
//                }
//                if (TextUtils.isEmpty(addtype)) {
//                    addtype = "";
//                }
                //CoinRainAction.code(activity, UserService.getUid(activity), taskId,contentId, addtype,isDouyin);

                break;
        }
    }
}