| | |
| | | import com.yeshi.base.utils.BaseApiUtil; |
| | | import com.yeshi.base.utils.RouteConstant; |
| | | import com.yeshi.base.utils.http.BasicTextHttpResponseHandler; |
| | | import com.yeshi.ec.base.R; |
| | | import com.yeshi.base.R; |
| | | |
| | | @Route(path = RouteConstant.PATH_USER_LOGIN) |
| | | public class LoginActivity extends BaseActivity implements OnClickListener { |
| | |
| | | tv_register.setOnClickListener(this); |
| | | tv_login.setOnClickListener(this); |
| | | findViewById(R.id.tv_user_agreement).setOnClickListener(this); |
| | | findViewById(R.id.tv_privacy).setOnClickListener(this); |
| | | } |
| | | |
| | | @Override |
| | |
| | | if (id == R.id.login_tv_cancel) {// 取消 |
| | | finish(); |
| | | } else if (id == R.id.login_tv_qq) {// QQ登录 |
| | | if (!cb_user_agreement.isChecked()) { |
| | | SingleToast.showToast(LoginActivity.this, "选择同意用户协议与隐私政策后方可登陆"); |
| | | return; |
| | | } |
| | | if (isQQClientAvailable()) { |
| | | loginType = "1"; |
| | | // qq登录逻辑处理 点击登录后需要暂时锁定返回键和返回功能 不然会报错 |
| | |
| | | BrowserActivity.class); |
| | | intent.putExtra("url", getString(R.string.agreement)); |
| | | startActivity(intent); |
| | | } else if (id == R.id.tv_privacy) { |
| | | Intent intent = new Intent(LoginActivity.this, |
| | | BrowserActivity.class); |
| | | intent.putExtra("url", getString(R.string.privacy)); |
| | | startActivity(intent); |
| | | } else if (id == R.id.tv_register) { |
| | | startActivity(new Intent(LoginActivity.this, RegisterActivity.class)); |
| | | } else if (id == R.id.tv_login) { |
| | | if (cb_user_agreement.isChecked()) |
| | | emailLogin(); |
| | | else |
| | | SingleToast.showToast(LoginActivity.this, "选择同意用户协议后方可登陆"); |
| | | if (!cb_user_agreement.isChecked()) { |
| | | SingleToast.showToast(LoginActivity.this, "选择同意用户协议与隐私政策后方可登陆"); |
| | | return; |
| | | } |
| | | emailLogin(); |
| | | } |
| | | } |
| | | |