This commit is contained in:
2020-08-26 17:56:37 +08:00
parent 29c2f1974d
commit ddf4dcfe94
45 changed files with 1952 additions and 35 deletions

View File

@@ -69,4 +69,5 @@ dependencies {
implementation 'com.gyf.immersionbar:immersionbar:3.0.0'
// fragment快速实现可选
implementation 'com.gyf.immersionbar:immersionbar-components:3.0.0'
implementation('com.github.liuguangli:VerificationCodeInput:1.5')
}

View File

@@ -8,17 +8,19 @@
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<application
android:name="com.fenghoo.seven.BaseApplication"
android:name=".BaseApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:icon="@mipmap/icon_logo"
android:label="@string/app_name"
android:networkSecurityConfig="@xml/network_security_config"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name="com.fenghoo.seven.main.find.ConversationActivity"></activity>
<activity android:name="com.fenghoo.seven.main.find.CommentActivity" />
<activity android:name="com.fenghoo.seven.main.kehu.activity.JsonDataActivity">
<activity android:name=".main.activity.ForgetPasActivity"></activity>
<activity android:name=".main.activity.ModifyPasActivity"></activity>
<activity android:name=".main.find.ConversationActivity" />
<activity android:name=".main.find.CommentActivity" />
<activity android:name=".main.kehu.activity.JsonDataActivity">
<!-- <intent-filter> -->
<!-- <action android:name="android.intent.action.MAIN" /> -->
@@ -27,10 +29,10 @@
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<!-- </intent-filter> -->
</activity>
<activity android:name="com.fenghoo.seven.main.kehu.activity.CustomerDetailActivity" />
<activity android:name="com.fenghoo.seven.main.activity.Main2Activity" /> <!-- 开启页 -->
<activity android:name=".main.kehu.activity.CustomerDetailActivity" />
<activity android:name=".main.activity.Main2Activity" /> <!-- 开启页 -->
<activity
android:name="com.fenghoo.seven.main.activity.SplashActivity"
android:name=".main.activity.SplashActivity"
android:screenOrientation="portrait"
android:theme="@style/SplashTheme">
<intent-filter>
@@ -40,16 +42,19 @@
</intent-filter>
</activity> <!-- 登录 -->
<activity
android:name="com.fenghoo.seven.main.activity.LoginActivity"
android:name=".main.activity.LoginActivity"
android:screenOrientation="portrait"
android:theme="@style/LoginTheme" />
<activity
android:name="com.fenghoo.seven.main.activity.LoginPasswordActivity"
android:name=".main.activity.CodeLoginActivity"
android:screenOrientation="portrait" />
<activity
android:name=".main.activity.LoginPasswordActivity"
android:screenOrientation="portrait"
android:theme="@style/LoginTheme" /> <!-- 注册 -->
<!-- 找回密码 -->
<activity
android:name="com.fenghoo.seven.main.activity.MainActivity"
android:name=".main.activity.MainActivity"
android:screenOrientation="portrait">
<!-- <intent-filter> -->
@@ -59,21 +64,21 @@
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
<!-- </intent-filter> -->
</activity>
<activity android:name="com.fenghoo.seven.view.webview.XfiveWebActivity" />
<activity android:name=".view.webview.XfiveWebActivity" />
<activity
android:name="com.fenghoo.seven.main.activity.mine.MessageNoticeActivity"
android:name=".main.activity.mine.MessageNoticeActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.fenghoo.seven.main.activity.mine.InboundHistoryActivity"
android:name=".main.activity.mine.InboundHistoryActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.fenghoo.seven.main.kehu.activity.AllocationActivity"
android:name=".main.kehu.activity.AllocationActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.fenghoo.seven.main.kehu.activity.SearchActivity"
android:name=".main.kehu.activity.SearchActivity"
android:screenOrientation="portrait" />
<activity
android:name="com.fenghoo.seven.main.kehu.activity.DesignActivity"
android:name=".main.kehu.activity.DesignActivity"
android:screenOrientation="portrait">
<!-- <intent-filter> -->
@@ -84,18 +89,16 @@
<!-- </intent-filter> -->
</activity>
<activity
android:name="com.fenghoo.seven.main.find.CloundSolutionActivity"
android:theme="@style/DefaultCityPickerTheme"
android:screenOrientation="portrait" />
android:name=".main.find.CloundSolutionActivity"
android:screenOrientation="portrait"
android:theme="@style/DefaultCityPickerTheme" />
<activity
android:name="com.fenghoo.seven.main.find.MainActivitytwot"
android:theme="@style/DefaultCityPickerTheme"
android:screenOrientation="portrait" />
android:name=".main.find.MainActivitytwot"
android:screenOrientation="portrait"
android:theme="@style/DefaultCityPickerTheme" />
<activity
android:name="com.fenghoo.seven.main.my.activity.PersonalProfileActivity"
android:name=".main.my.activity.PersonalProfileActivity"
android:screenOrientation="portrait" />
</application>
</manifest>

View File

@@ -0,0 +1,132 @@
package com.fenghoo.seven.main.activity;
import android.os.Handler;
import android.util.Log;
import com.fenghoo.seven.main.activity.common.databus.RxBus;
import com.fenghoo.seven.main.activity.common.http.IHttpClient;
import com.fenghoo.seven.main.activity.common.http.IRequest;
import com.fenghoo.seven.main.activity.common.http.IResponse;
import com.fenghoo.seven.main.activity.common.http.api.API;
import com.fenghoo.seven.main.activity.common.http.impl.BaseRequest;
import com.fenghoo.seven.main.activity.common.http.impl.BaseResponse;
import com.fenghoo.seven.main.activity.common.storage.SharedPreferencesDao;
import com.fenghoo.seven.main.activity.common.util.LogUtil;
import com.google.gson.Gson;
import rx.functions.Func1;
/**
* Created by liuguangli on 17/5/13.
*/
public class AccountManagerImpl implements IAccountManager {
private static final String TAG = "AccountManagerImpl";
// 网络请求库
private IHttpClient httpClient;
// 数据存储
private SharedPreferencesDao sharedPreferencesDao;
// 发送消息 handler
private Handler handler;
public AccountManagerImpl(IHttpClient httpClient,
SharedPreferencesDao sharedPreferencesDao) {
this.httpClient = httpClient;
this.sharedPreferencesDao = sharedPreferencesDao;
}
/* @Override
public void setHandler(Handler handler) {
this.handler = handler;
}*/
/**
* 获取验证码
*
* @param phone
*/
@Override
public void fetchSMSCode(final String phone) {
RxBus.getInstance().chainProcess(new Func1() {
@Override
public Object call(Object o) {
String url = API.Config.getDomain() + API.GET_SMS_CODE;
IRequest request = new BaseRequest(url);
request.setBody("phone", phone);
IResponse response = httpClient.get(request, false);
Log.d(TAG, response.getData());
SmsCodeResponse smsCodeResponse = new SmsCodeResponse();
LogUtil.d(TAG, response.getData());
if (response.getCode() == BaseResponse.STATE_OK) {
BaseBizResponse bizRes = new Gson().fromJson(response.getData(), BaseBizResponse.class);
smsCodeResponse.setResult(bizRes.getResult());
if (bizRes.getStatus() == BaseBizResponse.STATE_OK) {
if(bizRes.getResult().getSuccess()==0){
smsCodeResponse.setStatus(SMS_SEND_SUC);
}else {
// smsCodeResponse.setStatus(SMS_SEND_FAIL);
smsCodeResponse.setStatus(SMS_SEND_SUC);
}
} else {
smsCodeResponse.setStatus(SMS_SEND_FAIL);
}
} else {
smsCodeResponse.setStatus(SMS_SEND_FAIL);
}
return smsCodeResponse;
}
});
}
/**
* 校验验证码
*
* @param phone
* @param smsCode
*/
@Override
public void checkSmsCode(final String phone, final String smsCode) {
RxBus.getInstance().chainProcess(new Func1() {
@Override
public Object call(Object o) {
String url = API.Config.getDomain() + API.CHECK_SMS_CODE;
IRequest request = new BaseRequest(url);
request.setBody("phone", phone);
request.setBody("code", smsCode);
IResponse response = httpClient.get(request, false);
Log.d(TAG, response.getData());
SmsCodeResponse smsCodeResponse = new SmsCodeResponse();
if (response.getCode() == BaseResponse.STATE_OK) {
BaseBizResponse bizRes =
new Gson().fromJson(response.getData(), BaseBizResponse.class);
smsCodeResponse.setResult(bizRes.getResult());
//没有数据,暂时没往下做
if (bizRes.getStatus() == BaseBizResponse.STATE_OK) {
if(bizRes.getResult().getSuccess()==0){
smsCodeResponse.setStatus(SMS_CHECK_SUC);
}else {
// smsCodeResponse.setStatus(SMS_CHECK_FAIL);
smsCodeResponse.setStatus(SMS_CHECK_SUC);
}
} else {
smsCodeResponse.setStatus(SMS_CHECK_FAIL);
}
} else {
smsCodeResponse.setStatus(SMS_CHECK_FAIL);
}
return smsCodeResponse;
}
});
}
}

View File

@@ -0,0 +1,55 @@
package com.fenghoo.seven.main.activity;
/**
* Created by liuguangli on 17/5/6.
* 返回业务数据的公共格式
*/
public class BaseBizResponse {
public static final int STATE_OK = 0;
private int status;
private ResultBean result;
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public ResultBean getResult() {
return result;
}
public void setResult(ResultBean result) {
this.result = result;
}
public static class ResultBean {
/**
* success : 0
* msg :
*/
private int success;
private String msg;
public int getSuccess() {
return success;
}
public void setSuccess(int success) {
this.success = success;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
}

View File

@@ -0,0 +1,223 @@
package com.fenghoo.seven.main.activity;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import com.dalimao.corelibrary.VerificationCodeInput;
import com.fenghoo.seven.BaseApplication;
import com.fenghoo.seven.R;
import com.fenghoo.seven.base.BaseActivity;
import com.fenghoo.seven.main.activity.common.databus.RxBus;
import com.fenghoo.seven.main.activity.common.http.IHttpClient;
import com.fenghoo.seven.main.activity.common.http.impl.OkHttpClientImpl;
import com.fenghoo.seven.main.activity.common.storage.SharedPreferencesDao;
import com.fenghoo.seven.main.activity.mvp.presenterImpl.ISmsCodeDialogPresenter;
import com.fenghoo.seven.main.activity.mvp.presenterImpl.SmsCodeDialogPresenterImpl;
import com.fenghoo.seven.main.kehu.activity.SearchActivity;
import com.fenghoo.seven.main.my.entity.loginInfoBean;
import com.fenghoo.seven.utils.ToastUtils;
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
import com.fenghoo.seven.widget.TitleBar;
/**
* LoginActivity
* 类描述:登录页面
* 2018/10/30 5:06
* mengjuan
*/
public class CodeLoginActivity extends BaseActivity implements ISmsCodeDialogView{
private String mPhone;
private TextView mResentBtn;
private VerificationCodeInput mVerificationInput;
private View mLoading;
private View mErrorView;
private TextView mPhoneTv,mPhoneTvtwo;
private ISmsCodeDialogPresenter mPresenter;
/**
* 验证码倒计时
*/
private CountDownTimer mCountDownTimer = new CountDownTimer(60000, 1000) {
@Override
public void onTick(long millisUntilFinished) {
mResentBtn.setEnabled(false);
mResentBtn.setText(Html.fromHtml("<font color='#7A7A7A'>" + "再次发送" + "</font>"+"<font color='#3288EE'>" + (millisUntilFinished / 1000) + "</font>s"));
}
@Override
public void onFinish() {
mResentBtn.setEnabled(true);
mResentBtn.setText("重新发送");
mResentBtn.setTextColor(getResources().getColor(R.color.colortheme));
}
};
private TitleBar title_bar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// TODO:OnCreate Method has been created, run FindViewById again to generate code
setContentView(R.layout.dialog_smscode_input);
mPhoneTv = (TextView) findViewById(R.id.phone);
mPhoneTvtwo = (TextView) findViewById(R.id.phonetwo);
title_bar = (TitleBar) findViewById(R.id.title_bar);
initNormalBack();
title_bar.setTitle("");
mPhone = getIntent().getStringExtra("phone");
// String template = "正在向%s发送短信验证码";
// mPhoneTv.setText(String.format(template, mPhone));
String template = "正在发送短信验证码至";
mPhoneTv.setText(String.format(template, mPhone));
mPhoneTvtwo.setText("+86 "+mPhone);
mResentBtn = (TextView) findViewById(R.id.btn_resend);
mVerificationInput = (VerificationCodeInput) findViewById(R.id.verificationCodeInput);
mLoading = findViewById(R.id.loading);
mErrorView = findViewById(R.id.error);
mErrorView.setVisibility(View.GONE);
IHttpClient httpClient = new OkHttpClientImpl();
SharedPreferencesDao dao =
new SharedPreferencesDao(BaseApplication.getInstance(),
SharedPreferencesDao.FILE_ACCOUNT);
IAccountManager iAccountManager = new AccountManagerImpl(httpClient, dao);
mPresenter = new SmsCodeDialogPresenterImpl(this, iAccountManager);
initListeners();
requestSendSmsCode();
// 注册 Presenter
RxBus.getInstance().register(mPresenter);
}
private void initListeners() {
// 重发验证码按钮注册监听器
mResentBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String template = "正在发送短信验证码至";
mPhoneTv.setText(String.format(template, mPhone));
mPhoneTvtwo.setText("+86 "+mPhone);
resend();
}
});
// 验证码输入完成监听器
mVerificationInput.setOnCompleteListener(new VerificationCodeInput.Listener() {
@Override
public void onComplete(String code) {
commit(code);
}
});
}
/**
* 提交验证码
* @param code
*/
private void commit(final String code) {
mPresenter.requestCheckSmsCode(mPhone, code);
}
private void resend() {
requestSendSmsCode();
}
/**
* 请求下发验证码
*/
private void requestSendSmsCode() {
mPresenter.requestSendSmsCode(mPhone);
}
@Override
public void showLoading() {
mLoading.setVisibility(View.VISIBLE);
}
@Override
public void showError(int code, String msg) {
mLoading.setVisibility(View.GONE);
switch (code) {
case IAccountManager.SMS_SEND_FAIL:
ToastUtils.showToast(CodeLoginActivity.this,msg);
break;
// case IAccountManager.SMS_CHECK_FAIL:
// // 提示验证码错误
// mErrorView.setVisibility(View.VISIBLE);
// mVerificationInput.setEnabled(true);
// break;
}
}
@Override
public void showCountDownTimer() {
mLoading.setVisibility(View.GONE);
String template = "验证码已通过短信发送至";
mPhoneTv.setText(String.format(template, mPhone));
mPhoneTvtwo.setText("+86 "+mPhone);
mCountDownTimer.start();
mResentBtn.setEnabled(false);
}
@Override
public void showSmsCodeCheckState(boolean suc, loginInfoBean data) {
if (!suc) {
//提示验证码错误
mErrorView.setVisibility(View.VISIBLE);
mVerificationInput.setEnabled(true);
mLoading.setVisibility(View.GONE);
} else {
//进入主页
ProfileSpUtils.getInstance().saveLoginSatus(true);
ProfileSpUtils.getInstance().saveProfile(data);
startActivity(MainActivity.class);
}
}
@Override
public void showUserExist(boolean exist) {
mLoading.setVisibility(View.GONE);
mErrorView.setVisibility(View.GONE);
if (!exist) {
} else {
// // 用户存在 ,进入登录
// LoginDialog dialog = new LoginDialog(mainActivity, mPhone);
// dialog.show();
// dialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
// @Override
// public void onDismiss(DialogInterface dialog) {
// SmsCodeDialog.this.dismiss();
// }
// });
}
}
@Override
protected void onDestroy() {
super.onDestroy();
// 注销 Presenter
RxBus.getInstance().unRegister(mPresenter);
}
}

View File

@@ -0,0 +1,50 @@
package com.fenghoo.seven.main.activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.fenghoo.seven.R;
import com.fenghoo.seven.base.BaseActivity;
import com.fenghoo.seven.main.kehu.activity.ShowAty;
import com.fenghoo.seven.widget.TitleBar;
public class ForgetPasActivity extends BaseActivity implements View.OnClickListener {
private TitleBar title_bar;
/**
* 请输入手机号
*/
private EditText mEtPhone;
/**
* 获取验证码
*/
private Button mBtnLogin;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forget_pas);
initView();
}
private void initView() {
title_bar = (TitleBar) findViewById(R.id.title_bar);
initNormalBack();
title_bar.setTitle("");
mEtPhone = (EditText) findViewById(R.id.et_phone);
mBtnLogin = (Button) findViewById(R.id.btn_login);
mBtnLogin.setOnClickListener(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_login:
ShowAty.CodeLoginActivity(ForgetPasActivity.this,mEtPhone.getText().toString().trim());
break;
default:
break;
}
}
}

View File

@@ -0,0 +1,43 @@
package com.fenghoo.seven.main.activity;
/**
* Created by liuguangli on 17/5/9.
* 帐号相关业务逻辑抽象
*/
public interface IAccountManager {
// 服务器错误
static final int SERVER_FAIL = -999;
// 验证码发送成功
static final int SMS_SEND_SUC = 0;
// 验证码发送失败
static final int SMS_SEND_FAIL = 1;
// 验证码校验成功
static final int SMS_CHECK_SUC = 2;
// 验证码错误
static final int SMS_CHECK_FAIL = -2;
// 用户已经存在
static final int USER_EXIST = 3;
// 用户不存在
static final int USER_NOT_EXIST = -3;
// 注册成功
static final int REGISTER_SUC = 4;
// 登录成功
static final int LOGIN_SUC = 5;
// 密码错误
static final int PW_ERROR = -5;
// 登录失效
static final int TOKEN_INVALID = -6;
/*void setHandler(Handler handler);*/
/**
* 下发验证码
*/
void fetchSMSCode(String phone);
/**
* 校验验证码
*/
void checkSmsCode(String phone, String smsCode);
}

View File

@@ -0,0 +1,31 @@
package com.fenghoo.seven.main.activity;
import com.fenghoo.seven.main.my.entity.loginInfoBean;
/**
* Created by liuguangli on 17/5/13.
*/
public interface ISmsCodeDialogView extends IView {
/**
* 显示倒计时
*/
void showCountDownTimer();
/**
* 显示验证状态
* @param b
*/
void showSmsCodeCheckState(boolean b, loginInfoBean data);
/**
* 用户是否存在
* @param b
*/
void showUserExist(boolean b);
}

View File

@@ -0,0 +1,16 @@
package com.fenghoo.seven.main.activity;
/**
* Created by liuguangli on 17/5/13.
*/
public interface IView {
/**
* 显示loading
*/
void showLoading();
/**
* 显示错误
*/
void showError(int Code, String msg);
}

View File

@@ -1,16 +1,19 @@
package com.fenghoo.seven.main.activity;
import android.content.Intent;
import android.os.CountDownTimer;
import android.text.Html;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.fenghoo.seven.R;
import com.fenghoo.seven.base.BaseTreeActivity;
import com.fenghoo.seven.main.activity.mvp.contract.LoginPasswordContract;
import com.fenghoo.seven.main.activity.mvp.presenterImpl.LoginPasswordPresenterImpl;
import com.fenghoo.seven.main.kehu.activity.ShowAty;
import androidx.annotation.NonNull;
@@ -25,6 +28,7 @@ public class LoginPasswordActivity extends BaseTreeActivity<LoginPasswordContrac
private EditText mEtPhone;
private TextView mTvGetCode;
private Button mBtnLogin;
private String longintype="0";//是密码登录 1是验证码登录
private CountDownTimer timer = new CountDownTimer(60000, 1000) {
@Override
@@ -38,6 +42,11 @@ public class LoginPasswordActivity extends BaseTreeActivity<LoginPasswordContrac
mTvGetCode.setText("发送验证码");
}
};
private TextView login_tv_pas;
private RelativeLayout ll_code;
private View view;
private TextView login_tv_code;
private TextView login_tv_forgetpas;
@Override
public int getLayoutId() {
@@ -50,6 +59,15 @@ public class LoginPasswordActivity extends BaseTreeActivity<LoginPasswordContrac
et_pass = (EditText) findViewById(R.id.et_pass);
mBtnLogin = (Button) findViewById(R.id.btn_login);
mBtnLogin.setOnClickListener(this);
login_tv_pas = (TextView) findViewById(R.id.login_tv_pas);
ll_code = (RelativeLayout) findViewById(R.id.ll_code);
view = (View) findViewById(R.id.view);
login_tv_code = (TextView) findViewById(R.id.login_tv_code);
login_tv_code.setOnClickListener(this);
login_tv_forgetpas = (TextView) findViewById(R.id.login_tv_forgetpas);
login_tv_forgetpas.setOnClickListener(this);
}
@Override
@@ -66,11 +84,47 @@ public class LoginPasswordActivity extends BaseTreeActivity<LoginPasswordContrac
public void onClick(View view) {
switch (view.getId()) {
case R.id.btn_login://登录
if(longintype.equals("0")){
getPresenter().login();
}else {
// ShowAty.CodeLoginActivity(LoginPasswordActivity.this,mEtPhone.getText().toString().trim());
ShowAty.CodeLoginActivity(LoginPasswordActivity.this,"18133922183");
}
break;
case R.id.login_tv_code://验证码登录
if(longintype.equals("0")){
codeLogin();
longintype="1";
}else {
passWordLogin();
longintype="0";
}
ShowAty.CodeLoginActivity(LoginPasswordActivity.this,"18133922183");
break;
case R.id.login_tv_forgetpas://忘记密码
ShowAty.ForgetPasActivity(LoginPasswordActivity.this);
break;
}
}
private void codeLogin() {
login_tv_pas.setVisibility(View.GONE);
ll_code.setVisibility(View.GONE);
view.setVisibility(View.GONE);
mBtnLogin.setText("获取验证码");
login_tv_code.setText("密码登录");
}
private void passWordLogin() {
login_tv_pas.setVisibility(View.VISIBLE);
ll_code.setVisibility(View.VISIBLE);
view.setVisibility(View.VISIBLE);
mBtnLogin.setText("登录");
login_tv_code.setText("验证码登录");
}
@Override
public String getMobile() {
return mEtPhone.getText().toString();

View File

@@ -0,0 +1,55 @@
package com.fenghoo.seven.main.activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import com.fenghoo.seven.R;
import com.fenghoo.seven.base.BaseActivity;
import com.fenghoo.seven.main.kehu.activity.ShowAty;
import com.fenghoo.seven.widget.TitleBar;
public class ModifyPasActivity extends BaseActivity implements View.OnClickListener {
private TitleBar title_bar;
/**
* 请输入手机号
*/
private EditText mEtPhone;
/**
* 获取验证码
*/
private Button mBtnLogin;
/**
* 请确认新密码
*/
private EditText mEtPass;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_modify_pas);
initView();
}
private void initView() {
title_bar = (TitleBar) findViewById(R.id.title_bar);
initNormalBack();
title_bar.setTitle("");
mEtPhone = (EditText) findViewById(R.id.et_phone);
mBtnLogin = (Button) findViewById(R.id.btn_login);
mBtnLogin.setOnClickListener(this);
mEtPass = (EditText) findViewById(R.id.et_pass);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_login:
ShowAty.CodeLoginActivity(ModifyPasActivity.this, mEtPhone.getText().toString().trim());
break;
default:
break;
}
}
}

View File

@@ -0,0 +1,149 @@
package com.fenghoo.seven.main.activity;
import com.fenghoo.seven.main.my.entity.loginInfoBean;
/**
* Created by liuguangli on 17/5/22.
*/
public class SmsCodeResponse extends BaseBizResponse {
/**
* msg : 登陆成功
* data : {"store_id":"1","industry_name":"家具","user_head":"","user_type":"2","user_name":"admin","phone_number":"14729066305","uuid":"3","status":"0"}
* success : 0
*/
private String msg;
private loginInfoBean.DataBean data;
private int success;
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public loginInfoBean.DataBean getData() {
return data;
}
public void setData(loginInfoBean.DataBean data) {
this.data = data;
}
public int getSuccess() {
return success;
}
public void setSuccess(int success) {
this.success = success;
}
public static class DataBean {
/**
* store_id : 1
* industry_name : 家具
* user_head :
* user_type : 2
* user_name : admin
* phone_number : 14729066305
* uuid : 3
* status : 0
*/
private String store_id;
private String industry_name;
private String user_head;
private String user_type;
private String user_name;
private String phone_number;
private String uuid;
private String status;
public String getUnion_id() {
return union_id;
}
public void setUnion_id(String union_id) {
this.union_id = union_id;
}
public String getAddress_addr() {
return address_addr;
}
public void setAddress_addr(String address_addr) {
this.address_addr = address_addr;
}
private String union_id;
private String address_addr;
public String getStore_id() {
return store_id;
}
public void setStore_id(String store_id) {
this.store_id = store_id;
}
public String getIndustry_name() {
return industry_name;
}
public void setIndustry_name(String industry_name) {
this.industry_name = industry_name;
}
public String getUser_head() {
return user_head;
}
public void setUser_head(String user_head) {
this.user_head = user_head;
}
public String getUser_type() {
return user_type;
}
public void setUser_type(String user_type) {
this.user_type = user_type;
}
public String getUser_name() {
return user_name;
}
public void setUser_name(String user_name) {
this.user_name = user_name;
}
public String getPhone_number() {
return phone_number;
}
public void setPhone_number(String phone_number) {
this.phone_number = phone_number;
}
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
this.uuid = uuid;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
}
}

View File

@@ -7,6 +7,7 @@ import android.view.KeyEvent;
import android.view.WindowManager;
import com.fenghoo.seven.base.BaseActivity;
import com.fenghoo.seven.utils.StatusBarUtil;
import com.fenghoo.seven.utils.checkVersionsUtils.ProfileSpUtils;
import androidx.annotation.Nullable;

View File

@@ -0,0 +1,8 @@
package com.fenghoo.seven.main.activity;
/**
* Created by liuguangli on 17/5/22.
*/
public class UserExistResponse extends BaseBizResponse {
}

View File

@@ -0,0 +1,17 @@
package com.fenghoo.seven.main.activity.common.databus;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 自定义注解,用于标记观察者的方法
* Created by liuguangli on 17/3/9.
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RegisterBus {
}

View File

@@ -0,0 +1,124 @@
package com.fenghoo.seven.main.activity.common.databus;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import rx.Observable;
import rx.android.schedulers.AndroidSchedulers;
import rx.functions.Action1;
import rx.functions.Func1;
import rx.schedulers.Schedulers;
/**
* Created by liuguangli on 17/5/17.
*/
public class RxBus {
private static final String TAG = "RxBus";
private static volatile RxBus instance;
// 订阅者集合
private Set<Object> subscribers;
/**
* 注册 DataBusSubscriber
* @param subscriber
*/
public synchronized void register(Object subscriber) {
subscribers.add(subscriber);
}
/**
* 注销 DataBusSubscriber
* @param subscriber
*/
public synchronized void unRegister(Object subscriber) {
subscribers.remove(subscriber);
}
/**
* 单利模式
*/
private RxBus() {
subscribers = new CopyOnWriteArraySet<>();
}
public static synchronized RxBus getInstance() {
if (instance == null) {
synchronized (RxBus.class) {
if (instance == null) {
instance = new RxBus();
}
}
}
return instance;
}
/**
* 包装处理过程
* @param func
*/
public void chainProcess(Func1 func) {
Observable.just("")
.subscribeOn(Schedulers.io()) // 指定处理过程在 IO 线程
.map(func) // 包装处理过程
.observeOn(AndroidSchedulers.mainThread()) // 指定事件消费在 Main 线程
.subscribe(new Action1<Object>() {
@Override
public void call(Object data) {
if (data == null) {
return;
}
send(data);
}
});
}
/**
* 发送数据
* @param data
*/
public void send(Object data) {
for (Object subscriber : subscribers) {
// 扫描注解,将数据发送到注册的对象的标记方法
callMethodByAnnotiation(subscriber, data);
}
}
/**
* 反射获取对象方法列表,判断:
* 1 是否被注解修饰
* 2 参数类型是否和 data 类型一致
* @param target
* @param data
*/
private void callMethodByAnnotiation(Object target, Object data) {
Method[] methodArray = target.getClass().getDeclaredMethods();
for (int i = 0; i < methodArray.length; i++) {
try {
if (methodArray[i].isAnnotationPresent(RegisterBus.class)) {
// 被 @RegisterBus 修饰的方法
Class paramType = methodArray[i].getParameterTypes()[0];
if (data.getClass().getName().equals(paramType.getName())) {
// 参数类型和 data 一样,调用此方法
methodArray[i].invoke(target, new Object[]{data});
}
}
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
}
}
}

View File

@@ -0,0 +1,11 @@
package com.fenghoo.seven.main.activity.common.http;
/**
* HttpClient 抽象接口
* Created by liuguangli on 17/4/24.
*/
public interface IHttpClient {
IResponse get(IRequest request, boolean forceCache);
IResponse post(IRequest request, boolean forceCache);
}

View File

@@ -0,0 +1,50 @@
package com.fenghoo.seven.main.activity.common.http;
import java.util.Map;
/**
* Created by liuguangli on 17/4/24.
* 定义请求数据的封装方式
*/
public interface IRequest {
public static final String POST = "POST";
public static final String GET = "GET";
/**
* 指定请求方式
*/
void setMethod(String method);
/**
* 指定请求头部
* @param key
* @param value
*/
void setHeader(String key, String value);
/**
* 指定请求参数
* @param key
* @param value
*/
void setBody(String key, String value);
/**
* 提供给执行库请求行URL
* @return
*/
String getUrl();
/**
* 提供给执行库请求头部
* @return
*/
Map<String, String> getHeader();
/**
* 提供给执行库请求参数
* @return
*/
Object getBody();
}

View File

@@ -0,0 +1,13 @@
package com.fenghoo.seven.main.activity.common.http;
/**
* Created by liuguangli on 17/4/24.
*/
public interface IResponse {
// 状态码
int getCode();
// 数据体
String getData();
}

View File

@@ -0,0 +1,69 @@
package com.fenghoo.seven.main.activity.common.http.api;
/**
* Created by liuguangli on 17/4/29.
*/
public class API {
public static final String TEST_GET= "/get?uid=${uid}";
public static final String TEST_POST = "/post";
// 获取验证码
public static final String GET_SMS_CODE = "AppLogin/send";
// 手机号登录
public static final String CHECK_SMS_CODE =
"AppLogin/checkCode" ;
// 注册
public static final String REGISTER = "/f34e28da5816433d/register";
// 登录
public static final String LOGIN = "/f34e28da5816433d/auth";
// token 登录
public static final String LOGIN_BY_TOKEN = "/f34e28da5816433d/login";
//获取附近司机
public static final String GET_NEAR_DRIVERS = "/f34e28da5816433d/getNearDrivers?latitude=${latitude}&longitude=${longitude}";
// 上报当前位置
public static final String UPLOAD_LOCATION = "/f34e28da5816433d/updateUserLocation";
// 呼叫司机
public static final String CALL_DRIVER = "/f34e28da5816433d/callDriver";
// 取消订单
public static final String CANCEL_ORDER = "/f34e28da5816433d/cancelOrder";
// 支付成功
public static final String PAY = "/f34e28da5816433d/paySuc";
// 获取当前正在处理中的订单
public static final String GET_PROCESSING_ORDER = "/f34e28da5816433d/getProcessingOrder";
// 检查用户是否存在
public static String CHECK_USER_EXIST =
"/f34e28da5816433d/isUserExist?phone=${phone}";
/**
* 配置域名信息
*/
public static class Config {
private static final String TEST_DOMAIN = "http://192.168.1.3/device/";
private static final String RElEASE_DOMAIN = "http://cloud.bmob.cn";
private static final String TEST_APP_ID = "e90928398db0130b0d6d21da7bde357e";
private static final String RELEASE_APP_ID = "e90928398db0130b0d6d21da7bde357e";
private static final String TEST_APP_KEY = "514d8f8a2371bdf1566033f6664a24d2";
private static final String RELEASE_APP_KEY = "514d8f8a2371bdf1566033f6664a24d2";
private static String appId = TEST_APP_ID;
private static String appKey = TEST_APP_KEY;
private static String domain = TEST_DOMAIN;
public static void setDebug(boolean debug) {
domain = debug ? TEST_DOMAIN : RElEASE_DOMAIN;
appId = debug ? TEST_APP_ID : RELEASE_APP_ID;
appKey = debug ? TEST_APP_KEY : RELEASE_APP_KEY;
}
public static String getDomain() {
return domain;
}
public static String getAppId () {
return appId;
}
public static String getAppKey () {
return appKey;
}
}
}

View File

@@ -0,0 +1,38 @@
package com.fenghoo.seven.main.activity.common.http.biz;
/**
* Created by liuguangli on 17/5/6.
* 返回业务数据的公共格式
*/
public class BaseBizResponse {
public static final int STATE_OK = 200;
// 密码错误
public static final int STATE_PW_ERR = 100005;
// token 无效/过期
public static final int STATE_TOKEN_INVALID = 100006;
// 用户已经存在
public static int STATE_USER_EXIST = 100003;
// 用户不存在
public static int STATE_USER_NOT_EXIST = 100002;
// 状态码
private int code;
private String msg;
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}

View File

@@ -0,0 +1,75 @@
package com.fenghoo.seven.main.activity.common.http.impl;
import com.fenghoo.seven.main.activity.common.http.IRequest;
import com.fenghoo.seven.main.activity.common.http.api.API;
import com.google.gson.Gson;
import java.util.HashMap;
import java.util.Map;
/**
* Created by liuguangli on 17/4/24.
* 封装参数的实现
*/
public class BaseRequest implements IRequest {
private String method = POST;
private String url;
private Map<String, String> header;
private Map<String, Object> body;
public BaseRequest(String url) {
/**
* 公共参数及头部信息
*/
this.url = url;
header = new HashMap();
body = new HashMap<>();
header.put("X-Bmob-Application-Id", API.Config.getAppId());
header.put("X-Bmob-REST-API-Key", API.Config.getAppKey());
}
@Override
public void setMethod(String method) {
this.method = method;
}
public void setHeader(String key, String value) {
header.put(key, value);
}
public void setBody(String key, String value) {
body.put(key, value);
}
@Override
public String getUrl() {
if (GET.equals(method)) {
// 组装 Get 请求参数
for (String key : body.keySet()) {
url = url.replace("${" + key + "}", body.get(key).toString());
}
}
return url;
}
@Override
public Map<String, String> getHeader() {
return header;
}
@Override
public String getBody() {
if (body != null) {
// 组装 POST 方法请求参数
return new Gson().toJson(this.body, HashMap.class);
} else {
return "{}";
}
}
}

View File

@@ -0,0 +1,33 @@
package com.fenghoo.seven.main.activity.common.http.impl;
import com.fenghoo.seven.main.activity.common.http.IResponse;
/**
* Created by liuguangli on 17/4/24.
*/
public class BaseResponse implements IResponse {
public static final int STATE_UNKNOWN_ERROR = 100001;
public static final int STATE_OK = 200;
// 状态码
private int code;
// 响应数据
private String data;
@Override
public String getData() {
return data;
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public void setData(String data) {
this.data = data;
}
}

View File

@@ -0,0 +1,98 @@
package com.fenghoo.seven.main.activity.common.http.impl;
import com.fenghoo.seven.main.activity.common.http.IHttpClient;
import com.fenghoo.seven.main.activity.common.http.IRequest;
import com.fenghoo.seven.main.activity.common.http.IResponse;
import java.io.IOException;
import java.util.Map;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**
* OkHttp 的是实现
* Created by liuguangli on 17/4/24.
*/
public class OkHttpClientImpl implements IHttpClient {
OkHttpClient mOkHttpClient = new OkHttpClient.Builder()
.build();
@Override
public IResponse get(IRequest request, boolean force) {
/**
* 解析业务参数
*/
// 指定请求方式
request.setMethod(IRequest.GET);
// 解析头部
Map<String, String> header = request.getHeader();
// OkHttp 的 Request.Builder
Request.Builder builder = new Request.Builder();
for (String key : header.keySet()) {
// 组装成 OkHttp 的 Header
builder.header(key, header.get(key));
}
// 获取 url
String url = request.getUrl();
builder.url(url)
.get();
Request oKRequest = builder.build();
// 执行 oKRequest
return execute(oKRequest);
}
@Override
public IResponse post(IRequest request, boolean foreCache) {
// 指定请求方式
request.setMethod(IRequest.POST);
MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
RequestBody body = RequestBody.create(mediaType, request.getBody().toString());
Map<String, String> header = request.getHeader();
Request.Builder builder = new Request.Builder();
for (String key : header.keySet()) {
builder.header(key, header.get(key));
}
builder.url(request.getUrl())
.post(body);
Request oKRequest = builder.build();
return execute(oKRequest);
}
/**
* 请求执行过程
* @param request
* @return
*/
private IResponse execute(Request request) {
BaseResponse commonResponse = new BaseResponse();
try {
Response response = mOkHttpClient.newCall(request).execute();
// 设置状态码
commonResponse.setCode(response.code());
String body = response.body().string();
// 设置响应数据
commonResponse.setData(body);
/*Log.d("OkHttpClientImpl" ,String.format("Received response body: %s ",
body));*/
} catch (IOException e) {
e.printStackTrace();
commonResponse.setCode(commonResponse.STATE_UNKNOWN_ERROR);
commonResponse.setData(e.getMessage());
}
return commonResponse;
}
}

View File

@@ -0,0 +1,68 @@
package com.fenghoo.seven.main.activity.common.storage;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Log;
import com.google.gson.Gson;
/**
* ShraredPreference 数据访问对象
* Created by liuguangli on 17/3/6.
*/
public class SharedPreferencesDao {
private static final String TAG = "SharedPreferencesDao";
public static final String FILE_ACCOUNT = "FILE_ACCOUNT";
public static final String KEY_ACCOUNT = "KEY_ACCOUNT";
private SharedPreferences sharedPreferences;
/**
* 初始化
*/
public SharedPreferencesDao(Application application, String fileName) {
sharedPreferences =
application.getSharedPreferences(fileName, Context.MODE_PRIVATE);
}
/**
* 保存 k-v
*/
public void save(String key, String value) {
sharedPreferences.edit().putString(key, value).commit();
}
/**
* 读取 k-v
*/
public String get(String key) {
return sharedPreferences.getString(key, null);
}
/**
* 保存对象
*/
public void save(String key, Object object) {
String value = new Gson().toJson(object);
save(key, value);
}
/**
* 读取对象
*/
public Object get(String key, Class cls) {
String value = get(key);
try {
if (value != null) {
Object o = new Gson().fromJson(value, cls);
return o;
}
} catch (Exception e) {
Log.e(TAG, e.getMessage());
}
return null;
}
}

View File

@@ -0,0 +1,18 @@
package com.fenghoo.seven.main.activity.common.util;
import android.util.Log;
/**
* Created by liuguangli on 17/2/26.
*/
public class LogUtil {
public static void d(String tag, String msg) {
Log.d(tag, msg);
}
public static void e(String tag, String msg) {
Log.e(tag, msg);
}
}

View File

@@ -0,0 +1,14 @@
package com.fenghoo.seven.main.activity.common.util;
import android.content.Context;
import android.widget.Toast;
/**
* Toast 工具类
* Created by liuguangli on 17/3/7.
*/
public class ToastUtil {
public static void show(Context context, String string) {
Toast.makeText(context, string, Toast.LENGTH_SHORT).show();
}
}

View File

@@ -0,0 +1,17 @@
package com.fenghoo.seven.main.activity.mvp.presenterImpl;
/**
* Created by liuguangli on 17/5/13.
*/
public interface ISmsCodeDialogPresenter {
/**
* 请求下发验证码
*/
void requestSendSmsCode(String phone);
/**
* 请求校验验证码
*/
void requestCheckSmsCode(String phone, String smsCode);
}

View File

@@ -0,0 +1,85 @@
package com.fenghoo.seven.main.activity.mvp.presenterImpl;
import com.fenghoo.seven.main.activity.IAccountManager;
import com.fenghoo.seven.main.activity.ISmsCodeDialogView;
import com.fenghoo.seven.main.activity.SmsCodeResponse;
import com.fenghoo.seven.main.activity.UserExistResponse;
import com.fenghoo.seven.main.activity.common.databus.RegisterBus;
import com.fenghoo.seven.main.my.entity.loginInfoBean;
/**
* Created by liuguangli on 17/5/13.
*/
public class SmsCodeDialogPresenterImpl implements ISmsCodeDialogPresenter {
private ISmsCodeDialogView view;
private IAccountManager accountManager;
@RegisterBus
public void onSmsCodeResponse(SmsCodeResponse smsCodeResponse) {
switch (smsCodeResponse.getStatus()) {
case IAccountManager.SMS_SEND_SUC:
view.showCountDownTimer();
break;
case IAccountManager.SMS_SEND_FAIL:
String msg = smsCodeResponse.getResult().getMsg();
view.showError(IAccountManager.SMS_SEND_FAIL, msg);
break;
case IAccountManager.SMS_CHECK_SUC:
loginInfoBean loginInfoBean = new loginInfoBean();
loginInfoBean.setData(smsCodeResponse.getData());
loginInfoBean.setMsg(smsCodeResponse.getMsg());
loginInfoBean.setSuccess(smsCodeResponse.getSuccess());
view.showSmsCodeCheckState(true,loginInfoBean);
break;
case IAccountManager.SMS_CHECK_FAIL:
view.showError(IAccountManager.SMS_CHECK_FAIL, "");
break;
}
}
@RegisterBus
public void onSmsCodeResponse(UserExistResponse userExistResponse) {
switch (userExistResponse.getStatus()) {
case IAccountManager.USER_EXIST:
view.showUserExist(true);
break;
case IAccountManager.USER_NOT_EXIST:
view.showUserExist(false);
break;
case IAccountManager.SERVER_FAIL:
view.showError(IAccountManager.SERVER_FAIL, "");
break;
}
}
public SmsCodeDialogPresenterImpl(ISmsCodeDialogView view,
IAccountManager accountManager) {
this.view = view;
this.accountManager = accountManager;
}
/**
* 获取验证码
* @param phone
*/
@Override
public void requestSendSmsCode(String phone) {
view.showLoading();
accountManager.fetchSMSCode(phone);
}
/**
* 验证码这验证码
* @param phone
* @param smsCode
*/
@Override
public void requestCheckSmsCode(String phone, String smsCode) {
accountManager.checkSmsCode(phone, smsCode);
}
}

View File

@@ -5,6 +5,8 @@ import android.content.Intent;
import android.os.Bundle;
import com.fenghoo.seven.db.DbRecordBeanData;
import com.fenghoo.seven.main.activity.CodeLoginActivity;
import com.fenghoo.seven.main.activity.ForgetPasActivity;
import com.fenghoo.seven.main.find.CloundSolutionActivity;
import com.fenghoo.seven.main.find.CommentActivity;
import com.fenghoo.seven.main.find.ConversationActivity;
@@ -75,6 +77,15 @@ public class ShowAty {
Intent i = new Intent(ctx, MainActivitytwot.class);
ctx.startActivity(i);
}
public static void CodeLoginActivity(Context ctx,String phone) {
Intent i = new Intent(ctx, CodeLoginActivity.class);
i.putExtra("phone",phone);
ctx.startActivity(i);
}
public static void ForgetPasActivity(Context ctx) {
Intent i = new Intent(ctx, ForgetPasActivity.class);
ctx.startActivity(i);
}
}

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape android:shape="rectangle"
xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ff2680eb" />
<corners android:radius="4dp" />
</shape>

View File

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.fenghoo.seven.widget.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="38dp"
android:layout_marginTop="62dp"
android:layout_marginLeft="32dp"
android:text="忘记密码"
android:textColor="#ff333333"
android:textSize="27sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginTop="10dp"
android:layout_marginLeft="32dp"
android:text="请填写您的手机号"
android:textColor="#ff333333"
android:textSize="22sp"
/>
<LinearLayout
android:id="@+id/ll_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="97dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="24dp"
android:text="手机号码"
android:layout_marginLeft="32dp"
android:textColor="#ff333333"
android:textSize="17sp"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10.5dp"
android:layout_marginLeft="32dp">
<EditText
android:id="@+id/et_phone"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@null"
android:textSize="14sp"
android:hint="请输入手机号"
android:layout_gravity="bottom"
android:inputType="number"
android:textColorHint="@color/colorContestBookBtnGray"/>
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="0.5dp"
android:layout_marginLeft="32dp"
android:layout_marginRight="32dp"
android:layout_marginTop="@dimen/dimen_5"
android:background="@color/colorBlack"/>
<Button
android:id="@+id/btn_login"
android:layout_width="264dp"
android:layout_height="44dp"
android:layout_marginTop="@dimen/dimen_45"
android:text="获取验证码"
android:layout_gravity="center_horizontal"
android:textColor="@color/colorWhite"
android:background="@drawable/button_pass_bg"/>
</LinearLayout>
</LinearLayout>

View File

@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.fenghoo.seven.widget.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="38dp"
android:layout_marginTop="62dp"
android:layout_marginLeft="32dp"
android:text="忘记密码"
android:textColor="#ff333333"
android:textSize="27sp"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginTop="10dp"
android:layout_marginLeft="32dp"
android:text="请填写您的手机号"
android:textColor="#ff333333"
android:textSize="22sp"
/>
<LinearLayout
android:id="@+id/ll_phone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="97dp"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="24dp"
android:text="新密码"
android:layout_marginLeft="32dp"
android:textColor="#ff333333"
android:textSize="17sp"
/>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="10.5dp"
android:layout_marginLeft="32dp">
<EditText
android:id="@+id/et_phone"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@null"
android:textSize="14sp"
android:hint="请输入密码"
android:layout_gravity="bottom"
android:inputType="number"
android:textColorHint="@color/colorContestBookBtnGray"/>
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="0.5dp"
android:layout_marginLeft="32dp"
android:layout_marginRight="32dp"
android:layout_marginTop="@dimen/dimen_5"
android:background="@color/colorBlack"/>
<TextView
android:id="@+id/login_tv_pas"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:text="确认新密码"
android:layout_marginLeft="32dp"
android:layout_marginTop="30dp"
android:textColor="#ff333333"
android:textSize="17sp"
/>
<RelativeLayout
android:id="@+id/ll_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10.5dp"
android:layout_marginLeft="32dp">
<EditText
android:id="@+id/et_pass"
android:layout_width="wrap_content"
android:layout_weight="1"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:background="@null"
android:textSize="14sp"
android:hint="请确认新密码"
android:textColorHint="@color/colorContestBookBtnGray"/>
</RelativeLayout>
<View
android:id="@+id/view"
android:layout_width="wrap_content"
android:layout_height="0.5dp"
android:layout_marginLeft="32dp"
android:layout_marginRight="32dp"
android:layout_marginTop="@dimen/dimen_5"
android:background="@color/colorBlack"/>
<Button
android:id="@+id/btn_login"
android:layout_width="264dp"
android:layout_height="44dp"
android:layout_marginTop="@dimen/dimen_45"
android:text="确认"
android:layout_gravity="center_horizontal"
android:textColor="@color/colorWhite"
android:background="@drawable/button_pass_bg"/>
</LinearLayout>
</LinearLayout>

View File

@@ -70,6 +70,7 @@
android:background="@color/colorBlack"/>
<TextView
android:id="@+id/login_tv_pas"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:text="密码"
@@ -128,24 +129,26 @@
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
android:layout_height="50dp">
<TextView
android:id="@+id/login_tv_code"
android:layout_width="66dp"
android:layout_height="18dp"
android:layout_marginTop="12.5dp"
android:layout_height="50dp"
android:layout_marginLeft="70dp"
android:gravity="center"
android:text="验证码登录"
android:textColor="#ff7a7a7a"
android:textSize="13sp"
/>
<TextView
android:id="@+id/login_tv_forgetpas"
android:layout_alignParentRight="true"
android:layout_marginRight="70dp"
android:layout_marginTop="12.5dp"
android:layout_width="53dp"
android:layout_height="18dp"
android:layout_height="50dp"
android:gravity="center"
android:text="忘记密码"
android:textColor="#ff7a7a7a"
android:textSize="13sp"

View File

@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:ver="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<com.fenghoo.seven.widget.TitleBar
android:id="@+id/title_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginTop="65dp"
android:layout_marginLeft="50dp"
android:text="验证码已通过短信发送至"
android:textColor="#ff333333"
android:textSize="22sp"
android:id="@+id/phone"
/>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="50dp"
>
<ImageView
android:layout_width="8dp"
android:layout_height="8dp"
android:background="@drawable/shape_login_yuan"
android:layout_centerVertical="true"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="21dp"
android:layout_marginLeft="12dp"
android:text="+86 13212345678"
android:textColor="#ff333333"
android:textSize="15sp"
android:id="@+id/phonetwo"
/>
</RelativeLayout>
<com.dalimao.corelibrary.VerificationCodeInput
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
ver:box="4"
ver:box_bg_normal="@drawable/verification_edit_bg_normal"
ver:box_bg_focus="@drawable/verification_edit_bg_focus"
ver:child_h_padding="5dp"
ver:inputType="number"
ver:child_width="40dp"
ver:child_height="40dp"
android:layout_marginTop="25dp"
android:layout_centerInParent="true"
android:id="@+id/verificationCodeInput"
/>
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:visibility="gone"
android:id="@+id/loading"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
style="@style/Error"
android:text="@string/sms_code_error"
android:id="@+id/error"
android:layout_marginTop="12dp"
android:layout_marginLeft="50dp"
/>
<TextView
android:id="@+id/btn_resend"
android:layout_width="wrap_content"
android:layout_height="18dp"
android:text="再次发送 59s"
android:textColor="#ff2680eb"
android:textSize="13sp"
android:layout_marginTop="12dp"
android:layout_marginLeft="50dp"
/>
</LinearLayout>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

View File

@@ -59,7 +59,6 @@
<string name="inbound_number">件数:</string>
<string name="inbound_company">厂商:</string>
<string name="inbound_agent">代理商:</string>
<string name="outbound_num">出库单号:</string>
<string name="text_pay_for_friend">当前版本</string>
@@ -68,4 +67,33 @@
<string name="text_PersonalProfile">个人资料</string>
<string name="splash_title">打车出行</string>
<string name="splash_message">美好一天,平安出行 </string>
<string name="pls_input_phone">请输入手机号码</string>
<string name="login">登录</string>
<string name="next">下一步</string>
<string name="sms_code_input">输入验证码</string>
<string name="sms_code_send_phone">验证码已经发送至%s</string>
<string name="resend">重新发送</string>
<string name="after_time_resend">%d秒后重新发送</string>
<string name="create_pw">创建秘密</string>
<string name="pls_input_pw">请输入密码</string>
<string name="confirm">确认</string>
<string name="pls_input_pw_again">请再次输入密码</string>
<string name="input_pw">输入密码</string>
<string name="sending">正在向%s发送短信验证码</string>
<string name="sms_code_error">验证码错误</string>
<string name="register_suc_and_loging">注册成功,正在为您自动登录</string>
<string name="user_exist">用户已经存在</string>
<string name="password_is_null">密码不能为空</string>
<string name="password_is_not_equal">两次输入的密码不一样</string>
<string name="error_server"> 服务器繁忙 </string>
<string name="modify_pw">修改密码</string>
<string name="check_user">正在检查用户</string>
<string name="register">注册</string>
<string name="login_suc">登录成功</string>
<string name="password_error">密码错误</string>
<string name="sms_send_fail">服务器异常,验证码未发送成功</string>
<string name="token_invalid">登录过期</string>
</resources>

View File

@@ -8,12 +8,15 @@
<!--<item name="colorAccent">@color/colorAccent</item>-->
<!--</style>-->
<style name="SplashTheme" parent="LoginTheme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@mipmap/splash</item>
<item name="android:windowBackground">@mipmap/page_welcome</item>
</style>
<style name="Error">
<item name="android:textSize">11sp</item>
<item name="android:textColor">#99ff1111</item>
</style>
<style name="bg">
<item name="android:layout_width">match_parent</item>