验证码

master
admin-pc\admin 1 year ago
parent eefb623bc0
commit 15cbb46413

@ -100,6 +100,10 @@
android:name=".ui.activity.vpn.AuthSuccessActivity"
android:exported="false"
android:screenOrientation="portrait" />
<activity
android:name=".ui.activity.WjmmGetVerificationCodeActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden|stateAlwaysHidden" />
<activity
android:name=".MainActivity"
android:exported="false"

@ -3,28 +3,36 @@ package com.rehome.dywoa;
public class Contans {
// public static String IP = "http://192.168.2.91:8601/";
// public static String IP_INTRANET = "http://192.168.2.91:8601/";
// public static String IP_EXTRANET = "http://192.168.2.91:8601/";
public static String IP = "http://192.168.2.115:8601/";
public static String IP_INTRANET = "http://192.168.2.115:8601/";
public static String IP_EXTRANET = "http://192.168.2.115:8601/";
public static String SIS_TOKEN_IP = "https://sis.dywzhny.com.cn/";
public static String BI_TOKEN_IP = "https://bi.dywzhny.com.cn/";
//APP登录接口厂内服务器IP
// public static String IP = "https://app.dywzhny.com.cn/";
// //app内网
// public static String IP_INTRANET = "https://app.dywzhny.com.cn/";
// //app外网
// public static String IP_EXTRANET = "https://app.dywzhny.com.cn/";
// //SIS系统厂内IP
// public static String SIS_TOKEN_IP = "https://sis.dywzhny.com.cn/";
// //BI
// public static String BI_TOKEN_IP = "https://bi.dywzhny.com.cn/";
//APP登录接口厂内服务器IP
public static String IP = "https://app.dywzhny.com.cn/";
//app内网
public static String IP_INTRANET = "https://app.dywzhny.com.cn/";
//app外网
public static String IP_EXTRANET = "https://app.dywzhny.com.cn/";
//SIS系统厂内IP
public static String SIS_TOKEN_IP = "https://sis.dywzhny.com.cn/";
//BI
public static String BI_TOKEN_IP = "https://bi.dywzhny.com.cn/";
//修改密码获取验证码
public static String GETYZMANDCHECKYZMANDMODIFYMIMA = "api/app/sms/sendSms/sendSmsVerificationCodeByChangePwd";
public final static String NETWORK_CHECK_TYPE = "NETWORK_CHECK_TYPE";

@ -0,0 +1,85 @@
package com.rehome.dywoa.bean;
import java.util.List;
public class YzmBean {
/**
* Rows : [{"result":"1","msg":"验证码发送成功!","UserID":"ZH_Admin"}]
* Total : 1
*/
private int Total;
private List<RowsBean> Rows;
public int getTotal() {
return Total;
}
public void setTotal(int Total) {
this.Total = Total;
}
public List<RowsBean> getRows() {
return Rows;
}
public void setRows(List<RowsBean> Rows) {
this.Rows = Rows;
}
public static class RowsBean {
/**
* result : 1
* msg :
* UserID : ZH_Admin
*/
private String result;
private String msg;
private String UserID;
private String token;
private String token_exp;
public String getResult() {
return result;
}
public void setResult(String result) {
this.result = result;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getUserID() {
return UserID;
}
public void setUserID(String UserID) {
this.UserID = UserID;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getToken_exp() {
return token_exp;
}
public void setToken_exp(String token_exp) {
this.token_exp = token_exp;
}
}
}

@ -157,6 +157,16 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
SFUemSDK.getInstance().logout()
showToast(R.string.str_vpn_logout)
}
binding.tvSbcChangePwd.setOnClickListener {
if (TextUtils.isEmpty(binding.etUsername.text.toString())) {
showToast("请先填写用户名/工号")
}else{
val intent = Intent(context, WjmmGetVerificationCodeActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
intent.putExtra("account",binding.etUsername.text.toString())
startActivity(intent)
}
}
}
@SuppressLint("SetTextI18n")
@ -188,12 +198,12 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
if (isApkInDebug(context)) {
//测试
// binding.etUsername.setText("371522")
// binding.etPassword.setText("A000000a")
binding.etUsername.setText("371522")
binding.etPassword.setText("A000000a.")
//ceshi1
binding.etUsername.setText("ceshi1")
binding.etPassword.setText("A000000a")
binding.etPassword.setText("A000000a.")
// binding.etUsername.setText("CY00011")
// binding.etPassword.setText("A000000a")

@ -0,0 +1,211 @@
package com.rehome.dywoa.ui.activity
import android.text.Editable
import android.text.TextUtils
import android.util.Log
import android.view.View
import com.google.gson.Gson
import com.rehome.dywoa.Contans
import com.rehome.dywoa.R
import com.rehome.dywoa.base.BaseActivityOaToolbarViewBinding
import com.rehome.dywoa.bean.YzmBean
import com.rehome.dywoa.databinding.ActivityWjmmGetVerificationCodeBinding
import com.rehome.dywoa.utils.GsonUtils
import com.rehome.dywoa.utils.HttpListener
import com.rehome.dywoa.utils.NohttpUtils
import com.rehome.dywoa.utils.RSAUtils
import com.rehome.dywoa.utils.UiUtlis
import com.yolanda.nohttp.NoHttp
import com.yolanda.nohttp.RequestMethod
import java.util.*
class WjmmGetVerificationCodeActivity :
BaseActivityOaToolbarViewBinding<ActivityWjmmGetVerificationCodeBinding>() {
private var token: String = ""
private var token_exp: String = ""
override fun getViewBinding() = ActivityWjmmGetVerificationCodeBinding.inflate(layoutInflater)
override fun getToolbar() = binding.toolbarView.toolbar
override fun initView() {
initToolbar("修改密码", "") {}
}
override fun initData() {
var account = intent.getStringExtra("account")
if(account!=null){
binding.txGh.setText(account)
}
binding.buttonDjs.setOnClickListener(View.OnClickListener {
if (TextUtils.isEmpty(binding.txGh.text.toString().trim())) {
binding.txGh.error = "没有满足大写、小写、数字、符号"
showToast("请先输入工号!")
} else {
if (TextUtils.isEmpty(
binding.sjh.text.toString().trim()
) || binding.sjh.text.toString().trim().length != 11
) {
binding.sjh.error = "没有满足大写、小写、数字、符号"
showToast("手机号输入不正确")
} else {
binding.buttonDjs.start()
getYzm()
}
}
})
binding.buttonNext.setOnClickListener(View.OnClickListener {
if (TextUtils.isEmpty(binding.txGh.text.toString().trim())) {
binding.txGh.error = "没有满足大写、小写、数字、符号"
showToast("请先输入工号!")
} else if (TextUtils.isEmpty(
binding.sjh.text.toString().trim()
) || binding.sjh.text.toString().trim().length != 11
) {
binding.sjh.error = "没有满足大写、小写、数字、符号"
showToast("手机号输入不正确")
} else if (TextUtils.isEmpty(binding.yzm.text.toString().trim())) {
binding.yzm.error = "没有满足大写、小写、数字、符号"
showToast("请输入验证码")
} else {
checkVerificationCode()
}
})
// binding.txGh.setText("ZHPS_Admin")
// binding.sjh.setText("15307858521")
}
private fun getYzm() {
val json: String = getYzmParam()
val url = Contans.IP + Contans.GETYZMANDCHECKYZMANDMODIFYMIMA
val request = NoHttp.createStringRequest(url, RequestMethod.POST)
request.setDefineRequestBodyForJson(json)
showLog(url)
NohttpUtils.getInstance().add(this, 0, request, object : HttpListener<String?> {
override fun onSucceed(what: Int, response: com.yolanda.nohttp.rest.Response<String?>?) {
val jsonResult = response?.get()
showLog("-----getYzm------")
showLog(jsonResult)
val jsonDecode = RSAUtils.decryptBASE64StrClient(jsonResult)
if (TextUtils.isEmpty(jsonDecode)) {
showToast(UiUtlis.getString(context, R.string.data_error))
} else {
val bean: YzmBean? =
GsonUtils.GsonToBean(jsonDecode, YzmBean::class.java)
showLog(jsonDecode);
if (bean != null && bean.rows != null && bean.rows.size > 0 && bean.rows[0].result == "1") {
showToast(bean.rows[0].msg)
binding.yzm.visibility = View.VISIBLE
binding.verificationCodeLine.visibility = View.VISIBLE
binding.buttonNext.visibility = View.VISIBLE
if(bean.rows[0].token!=null){
token = bean.rows[0].token
}
if(bean.rows[0].token_exp!=null){
token_exp = bean.rows[0].token_exp
}
} else {
if (bean != null) {
showToast(bean.rows[0].msg)
}
}
}
}
override fun onFailed(what: Int, response: com.yolanda.nohttp.rest.Response<String?>?) {
Log.i("login", "onError")
}
}, true, true, "请稍候...")
}
//调用接口检查输入的验证码是否正确
private fun checkVerificationCode() {
val json: String = getCheckYzmParam()
val url = Contans.IP + Contans.GETYZMANDCHECKYZMANDMODIFYMIMA
val request = NoHttp.createStringRequest(url, RequestMethod.POST)
request.setDefineRequestBodyForJson(json)
showLog(url)
NohttpUtils.getInstance().add(this, 0,token, request, object : HttpListener<String?> {
override fun onSucceed(what: Int, response: com.yolanda.nohttp.rest.Response<String?>?) {
val jsonResult = response?.get()
showLog("-----CheckYzm------")
showLog(jsonResult)
val jsonDecode = RSAUtils.decryptBASE64StrClient(jsonResult)
if (TextUtils.isEmpty(jsonDecode)) {
showToast(UiUtlis.getString(context, R.string.data_error))
} else {
val bean: YzmBean? =
GsonUtils.GsonToBean(jsonDecode, YzmBean::class.java)
showLog(jsonDecode);
if (bean != null && bean.rows != null && bean.rows.size > 0 && bean.rows[0].result == "2") {
//验证码正确
// val intent = Intent(
// context,
// WjmmActivity::class.java
// )
// intent.putExtra("gh", binding.txGh.text.toString().trim())
// intent.putExtra("sjh", binding.sjh.text.toString().trim())
// if(!TextUtils.isEmpty(token)){
// intent.putExtra("token", token)
// intent.putExtra("token_exp", token_exp)
// startActivity(intent)
// }else{
// showToast("验证码校验失败")
// }
} else {
if (bean != null) {
showToast(bean.rows[0].msg)
}
}
}
}
override fun onFailed(what: Int, response: com.yolanda.nohttp.rest.Response<String?>?) {
Log.i("login", "onError")
}
}, true, true, "请稍候...")
}
fun getYzmParam(): String {
val param= mutableMapOf<String,String>()
param["account"] = Objects.requireNonNull<Editable>(binding.txGh.text).toString().trim()
val json = Gson().toJson(param)
val jsonEncrypt = RSAUtils.encryptBASE64Str(json)
showLog(json);
showLog(jsonEncrypt)
return jsonEncrypt
}
fun getCheckYzmParam(): String {
val param= mutableMapOf<String,String>()
param["userid"] = Objects.requireNonNull<Editable>(binding.txGh.text).toString().trim()
param["type"] = "3"
param["telphone"] = Objects.requireNonNull<Editable>(binding.sjh.text).toString().trim()
param["verificationcode"] = Objects.requireNonNull<Editable>(binding.yzm.text).toString().trim()
param["token"] = token
param["token_exp"] = token_exp
val json = Gson().toJson(param)
val jsonEncrypt = RSAUtils.encryptBASE64Str(json)
showLog(json);
return jsonEncrypt
}
}

@ -118,6 +118,28 @@ public class NohttpUtils {
mQueue.add(what, request, new HttpResponseListener<T>(mActivity, request, callback, true, true, "加载中..."));
}
/**
*
*
* @param mActivity activity
* @param what
* @param token token
* @param request
* @param callback
* @param canCanel
* @param isLoading
* @param <T>
*/
public <T> void add(Activity mActivity, int what,String token, Request<T> request, HttpListener<T> callback, boolean canCanel, boolean isLoading, String msg) {
if(token!=null){
String credential = "Bearer " + token;
request.addHeader("Authorization", credential);
showLog(request.url(),mActivity);
}
mQueue.add(what, request, new HttpResponseListener<T>(mActivity, request, callback, canCanel, isLoading, msg));
}
public <T> void addNoProgress(Context context, int what, Request<T> request, HttpListener<T> callback) {
if(App.getInstance().getUserInfo()!=null){
if(DataPassUtils.checkCanLoginTokenLong()){

@ -0,0 +1,90 @@
package com.rehome.dywoa.weiget;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import androidx.annotation.Nullable;
import androidx.appcompat.widget.AppCompatTextView;
/**
* author : Android
* github : https://github.com/getActivity/AndroidProject
* time : 2018/10/18
* desc :
*/
public final class CountdownView extends AppCompatTextView implements Runnable {
/** 倒计时秒数 */
private int mTotalSecond = 60;
/** 秒数单位文本 */
private static final String TIME_UNIT = "S";
/** 当前秒数 */
private int mCurrentSecond;
/** 记录原有的文本 */
private CharSequence mRecordText;
public CountdownView(Context context) {
super(context);
}
public CountdownView(Context context, @Nullable AttributeSet attrs) {
super(context, attrs);
}
public CountdownView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
/**
*
*/
public void setTotalTime(int totalTime) {
this.mTotalSecond = totalTime;
}
/**
*
*/
public void start() {
mRecordText = getText();
setEnabled(false);
mCurrentSecond = mTotalSecond;
post(this);
}
/**
*
*/
public void stop() {
setText(mRecordText);
setEnabled(true);
}
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
// 设置点击的属性
setClickable(true);
}
@Override
protected void onDetachedFromWindow() {
// 移除延迟任务,避免内存泄露
removeCallbacks(this);
super.onDetachedFromWindow();
}
@SuppressLint("SetTextI18n")
@Override
public void run() {
if (mCurrentSecond == 0) {
stop();
} else {
mCurrentSecond--;
setText(mCurrentSecond + " " + TIME_UNIT);
postDelayed(this, 1000);
}
}
}

@ -0,0 +1,192 @@
package com.rehome.dywoa.weiget;
import android.content.Context;
import android.content.res.TypedArray;
import android.text.InputFilter;
import android.text.Spanned;
import android.text.TextUtils;
import android.util.AttributeSet;
import androidx.appcompat.widget.AppCompatEditText;
import com.rehome.dywoa.R;
import java.util.regex.Pattern;
/**
* author : Android
* github : https://github.com/getActivity/AndroidProject
* time : 2019/06/29
* desc :
*/
public class RegexEditText extends AppCompatEditText implements InputFilter {
/** 手机号(只能以 1 开头) */
public static final String REGEX_MOBILE = "[1]\\d{0,10}";
/** 中文(普通的中文字符) */
public static final String REGEX_CHINESE = "[\\u4e00-\\u9fa5]*";
/** 英文(大写和小写的英文) */
public static final String REGEX_ENGLISH = "[a-zA-Z]*";
/** 计数(非 0 开头的数字) */
public static final String REGEX_COUNT = "[1-9]\\d*";
/** 用户名(中文、英文、数字) */
public static final String REGEX_NAME = "[[\\u4e00-\\u9fa5]|[a-zA-Z]|\\d]*";
/** 非空格的字符(不能输入空格) */
public static final String REGEX_NONNULL = "\\S+";
/** 正则表达式规则 */
private Pattern mPattern;
public RegexEditText(Context context) {
this(context, null);
}
public RegexEditText(Context context, AttributeSet attrs) {
this(context, attrs, android.R.attr.editTextStyle);
}
public RegexEditText(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
final TypedArray array = context.obtainStyledAttributes(attrs, R.styleable.RegexEditText);
if (array.hasValue(R.styleable.RegexEditText_inputRegex)) {
setInputRegex(array.getString(R.styleable.RegexEditText_inputRegex));
} else {
if (array.hasValue(R.styleable.RegexEditText_regexType)) {
int regexType = array.getInt(R.styleable.RegexEditText_regexType, 0);
switch (regexType) {
case 0x01:
setInputRegex(REGEX_MOBILE);
break;
case 0x02:
setInputRegex(REGEX_CHINESE);
break;
case 0x03:
setInputRegex(REGEX_ENGLISH);
break;
case 0x04:
setInputRegex(REGEX_COUNT);
break;
case 0x05:
setInputRegex(REGEX_NAME);
break;
case 0x06:
setInputRegex(REGEX_NONNULL);
break;
default:
break;
}
}
}
array.recycle();
}
/**
*
*/
public boolean hasInputType(int type) {
return (getInputType() & type) != 0;
}
/**
*
*/
public void addInputType(int type) {
setInputType(getInputType() | type);
}
/**
*
*/
public void removeInputType(int type) {
setInputType(getInputType() & ~type);
}
/**
*
*/
public void setInputRegex(String regex) {
if (TextUtils.isEmpty(regex)) {
return;
}
mPattern = Pattern.compile(regex);
addFilters(this);
}
/**
*
*/
public String getInputRegex() {
if (mPattern == null) {
return null;
}
return mPattern.pattern();
}
/**
*
*/
public void addFilters(InputFilter filter) {
if (filter == null) {
return;
}
final InputFilter[] newFilters;
final InputFilter[] oldFilters = getFilters();
if (oldFilters != null && oldFilters.length > 0) {
newFilters = new InputFilter[oldFilters.length + 1];
// 复制旧数组的元素到新数组中
System.arraycopy(oldFilters, 0, newFilters, 0, oldFilters.length);
newFilters[oldFilters.length] = filter;
} else {
newFilters = new InputFilter[1];
newFilters[0] = filter;
}
super.setFilters(newFilters);
}
/**
* {@link InputFilter}
*
* @param source
* @param start 0
* @param end source-1
* @param dest
* @param destStart 0
* @param destEnd dest-1
* @return
*/
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int destStart, int destEnd) {
if (mPattern != null) {
// 拼接出最终的字符串
String begin = dest.toString().substring(0, destStart);
String over = dest.toString().substring(destStart + (destEnd - destStart), destStart + (dest.toString().length() - begin.length()));
String result = begin + source + over;
// 判断是插入还是删除
if (destStart > destEnd - 1) {
// 如果是插入字符
if (!mPattern.matcher(result).matches()) {
// 如果不匹配就不让这个字符输入
return "";
}
} else {
// 如果是删除字符
if (!mPattern.matcher(result).matches()) {
// 如果不匹配则不让删除(删空操作除外)
if (!"".equals(result)) {
return dest.toString().substring(destStart, destEnd);
}
}
}
}
// 不做任何修改
return source;
}
}

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 禁用状态 -->
<item android:color="@color/white" android:state_enabled="false" />
<!-- 按压状态 -->
<item android:color="@color/white" android:state_pressed="true" />
<!-- 焦点状态 -->
<item android:color="@color/white" android:state_focused="true" />
<!-- 默认状态 -->
<item android:color="@color/colorPrimaryDark" />
</selector>

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 禁用状态 -->
<item android:color="@color/white" android:state_enabled="false" />
<!-- 按压状态 -->
<item android:color="@color/white" android:state_pressed="true" />
<!-- 焦点状态 -->
<item android:color="@color/white" android:state_focused="true" />
<!-- 默认状态 -->
<item android:color="@color/colorAccent" />
</selector>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 默认获取验证码按钮样式 -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 禁用状态 -->
<item android:state_enabled="false">
<shape android:shape="rectangle">
<corners android:radius="30dp" />
<solid android:color="@color/colorButtonDisable" />
</shape>
</item>
<!-- 按压状态 -->
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="30dp" />
<solid android:color="@color/colorAccent" />
</shape>
</item>
<!-- 焦点状态 -->
<item android:state_focused="true">
<shape android:shape="rectangle">
<corners android:radius="30dp" />
<solid android:color="@color/colorAccent"/>
</shape>
</item>
<!-- 默认状态 -->
<item>
<shape android:shape="rectangle">
<corners android:radius="30dp" />
<stroke android:color="@color/colorPrimaryDark"
android:width="1dp"/>
</shape>
</item>
</selector>

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 默认获取验证码按钮样式 -->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 禁用状态 -->
<item android:state_enabled="false">
<shape android:shape="rectangle">
<corners android:radius="30dp" />
<solid android:color="@color/colorButtonDisable" />
</shape>
</item>
<!-- 按压状态 -->
<item android:state_pressed="true">
<shape android:shape="rectangle">
<corners android:radius="30dp" />
<solid android:color="@color/colorAccent" />
</shape>
</item>
<!-- 焦点状态 -->
<item android:state_focused="true">
<shape android:shape="rectangle">
<corners android:radius="30dp" />
<solid android:color="@color/colorAccent"/>
</shape>
</item>
<!-- 默认状态 -->
<item>
<shape android:shape="rectangle">
<corners android:radius="30dp" />
<stroke android:color="@color/colorAccent"
android:width="1dp"/>
</shape>
</item>
</selector>

@ -154,6 +154,18 @@
</LinearLayout>
<TextView
android:id="@+id/tv_sbcChangePwd"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="60dp"
android:gravity="center"
android:text="承包商找回密码"
android:textColor="@color/blue"
android:textSize="16sp"
android:textStyle="normal" />
<TextView
android:id="@+id/tv_vpn"
android:layout_width="100dp"
@ -187,7 +199,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="30dp"
android:layout_marginBottom="20dp"
android:gravity="center"
android:text="版本号1.0.0"
android:textSize="14sp"

@ -0,0 +1,133 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.activity.WjmmGetVerificationCodeActivity">
<include
android:id="@+id/toolbarView"
layout="@layout/layout_base" />
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical"
android:paddingHorizontal="40dp"
tools:layoutAnimation="@null">
<TextView
android:id="@+id/tv_tipTop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="30dp"
android:gravity="start"
android:text="@string/the_first_step_tip_first"
android:textColor="@color/login_title_color"
android:textSize="20sp"
android:textStyle="bold" />
<TextView
android:id="@+id/tv_tipTopDesc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:gravity="start"
android:text="@string/the_first_step_tip_first_desc"
android:textColor="@color/textColor"
android:textSize="14sp"
android:textStyle="bold" />
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/tx_gh"
style="@style/EditTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:hint="请输入工号(必填)"
android:maxLength="20"
android:maxLines="1" />
<View style="@style/HorizontalLineStyle" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<FrameLayout
android:layout_width="0px"
android:layout_height="wrap_content"
android:layout_weight="1">
<com.rehome.dywoa.weiget.RegexEditText
android:id="@+id/sjh"
style="@style/EditTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="输入手机号码(必填)"
android:inputType="textVisiblePassword"
android:maxLines="1"
android:singleLine="true"
app:regexType="mobile" />
<View
style="@style/HorizontalLineStyle"
android:layout_gravity="bottom" />
</FrameLayout>
<com.rehome.dywoa.weiget.CountdownView
android:id="@+id/button_djs"
style="@style/CountdownViewStyle" />
</LinearLayout>
<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/yzm"
style="@style/EditTextStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:hint="@string/common_code_input_hint"
android:inputType="number"
android:maxLength="6"
android:singleLine="true"
android:visibility="gone" />
<View
android:id="@+id/verificationCodeLine"
style="@style/HorizontalLineStyle"
android:visibility="gone" />
<com.rehome.dywoa.weiget.CountdownView
android:id="@+id/buttonNext"
style="@style/CountdownViewBigStyle"
android:layout_marginTop="20dp"
android:visibility="gone" />
<TextView
android:id="@+id/tv_tip"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="40dp"
android:layout_marginTop="30dp"
android:gravity="start"
android:text=""
android:textColor="@color/red"
android:textSize="15sp"
android:textStyle="bold"
android:visibility="gone" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>

@ -41,14 +41,30 @@
<enum name="WXDD" value="6" />
</attr>
</declare-styleable>
<declare-styleable name="BottomLayout">
<attr name="rb1_text" format="string"/>
<attr name="rb2_text" format="string"/>
<attr name="rb3_text" format="string"/>
</declare-styleable>
<!-- 正则表达式编辑框 -->
<declare-styleable name="RegexEditText">
<!-- 正则输入限制 -->
<attr name="inputRegex" format="string" />
<!-- 常用正则类型 -->
<attr name="regexType" >
<!-- 手机号(只能以 1 开头) -->
<enum name="mobile" value="0x01" />
<!-- 中文(普通的中文字符) -->
<enum name="chinese" value="0x02" />
<!-- 英文(大写和小写的英文) -->
<enum name="english" value="0x03" />
<!-- 整数(非 0 开头的数字) -->
<enum name="count" value="0x04" />
<!-- 用户名(中文、英文、数字) -->
<enum name="name" value="0x05" />
<!-- 非空格字符 -->
<enum name="nonnull" value="0x06" />
</attr>
</declare-styleable>

@ -60,4 +60,6 @@
<color name="color_f6">#f6f6f6</color>
<color name="login_bg">#EFF0F2</color>
<color name="logo_color">#5e86e9</color>
<color name="colorButtonDisable">#BBBBBB</color>
<color name="colorLine">#ECECEC</color>
</resources>

@ -96,4 +96,10 @@
<string name="start_tunnel">启动隧道</string>
<string name="stop_tunnel">关闭隧道</string>
<string name="master_slave">主从测试</string>
<string name="the_first_step_tip_first">第一步:获取验证码</string>
<string name="the_first_step_tip_first_desc">重置密码前需提供工号和手机号获取验证码</string>
<string name="the_second_step_tip_title">第二步:重置密码</string>
<string name="the_second_step_tip_desc">密码长度不能小于8位且必须为大小写字母、数字和特殊字符组成</string>
<string name="common_code_input_hint">输入验证码(必填)</string>
<string name="common_code_send">发送验证码</string>
</resources>

@ -203,5 +203,50 @@
<item name="android:textSize">12sp</item>
<item name="android:textColor">@color/black</item>
</style>
<!-- 默认文本框样式 -->
<style name="EditTextStyle">
<item name="android:background">@null</item>
<item name="android:textSize">15sp</item>
<item name="android:textColorHint">#A4A4A4</item>
<item name="android:textColor">#333333</item>
<item name="android:paddingTop">10dp</item>
<item name="android:paddingBottom">10dp</item>
<item name="android:paddingStart">10dp</item>
<item name="android:paddingEnd">10dp</item>
</style>
<!-- 获取验证码样式 -->
<style name="CountdownViewStyle">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:background">@drawable/countdown_selector</item>
<item name="android:layout_marginStart">15dp</item>
<item name="android:layout_marginEnd">15dp</item>
<item name="android:paddingTop">10dp</item>
<item name="android:paddingBottom">10dp</item>
<item name="android:minWidth">90dp</item>
<item name="android:gravity">center</item>
<item name="android:text">@string/common_code_send</item>
<item name="android:textColor">@drawable/countdown_color_selector</item>
<item name="android:textSize">12sp</item>
</style>
<!-- 输入验证码 下一步 -->
<style name="CountdownViewBigStyle">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">match_parent</item>
<item name="android:background">@drawable/countdown_next_selector</item>
<item name="android:paddingTop">10dp</item>
<item name="android:paddingBottom">10dp</item>
<item name="android:minWidth">90dp</item>
<item name="android:gravity">center</item>
<item name="android:text">@string/save</item>
<item name="android:textColor">@drawable/countdown_color_next_selector</item>
<item name="android:textSize">12sp</item>
</style>
<!-- 默认水平分割线样式 -->
<style name="HorizontalLineStyle">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">1px</item>
<item name="android:background">@color/colorLine</item>
</style>
</resources>

Loading…
Cancel
Save