莫名其妙的东西又增加了
This commit is contained in:
@@ -10,8 +10,8 @@ android {
|
||||
applicationId "com.dskj.daikuan"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 110
|
||||
versionName "1.1.0"
|
||||
versionCode 111
|
||||
versionName "1.1.1"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
// configurations.all {
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.dskj.daikuan.bean.UserBean;
|
||||
import com.dskj.daikuan.config.Config;
|
||||
import com.dskj.daikuan.utils.DeviceUtil;
|
||||
import com.dskj.daikuan.utils.GsonUtils;
|
||||
|
||||
import com.dskj.daikuan.utils.LogUtils;
|
||||
|
||||
|
||||
/**
|
||||
@@ -138,12 +138,13 @@ public class InitApp extends Application {
|
||||
return GsonUtils.getObjFromJSON(name,UserBean.class);
|
||||
}
|
||||
|
||||
|
||||
public static String getToken() {
|
||||
Context context = AppContext;
|
||||
if (context == null) {
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
return getString(Config.API_TOKEN_TAG,"");
|
||||
}
|
||||
|
||||
public static void setToken(String value) {
|
||||
@@ -153,4 +154,19 @@ public class InitApp extends Application {
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static String getUserToken() {
|
||||
Context context = AppContext;
|
||||
if (context == null) {
|
||||
LogUtils.i("进这里干嘛?");
|
||||
return "";
|
||||
}
|
||||
return getString(Config.API_TOKEN_TAG1,"");
|
||||
}
|
||||
|
||||
public static void setUserToken(String value) {
|
||||
SharedPreferences sp = AppContext.getSharedPreferences("InitApp", Activity.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = sp.edit();
|
||||
editor.putString(Config.API_TOKEN_TAG1, value);
|
||||
editor.apply();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,26 @@
|
||||
package com.dskj.daikuan.api;
|
||||
|
||||
|
||||
import com.dskj.daikuan.bean.BankBean;
|
||||
import com.dskj.daikuan.bean.ListBean;
|
||||
import com.dskj.daikuan.bean.LoanApplyBean;
|
||||
import com.dskj.daikuan.bean.LoanBean;
|
||||
import com.dskj.daikuan.bean.TokenBean;
|
||||
import com.dskj.daikuan.bean.UserBean;
|
||||
import com.dskj.daikuan.bean.VideoIndexResult;
|
||||
import com.dskj.daikuan.bean.VideoResult;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import okhttp3.MultipartBody;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.Field;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Part;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* 项目名:
|
||||
@@ -19,24 +33,51 @@ import retrofit2.http.POST;
|
||||
|
||||
public interface ApiService {
|
||||
|
||||
// String URL="https://www.csyltest.com/";
|
||||
String URL="https://8660ee.vip/";
|
||||
// String URL ="http://192.168.110.26:39901/";
|
||||
String URL ="http://8.134.95.28:39901/";
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("frontend/video/index")
|
||||
Observable<Result<VideoIndexResult>> videoIndex(@Field("token") String token);
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("frontend/video/list")
|
||||
Observable<Result<VideoResult>> videoList(@Field("token") String token, @Field("id") String id, @Field("op") String op,
|
||||
@Field("page") String page, @Field("nogame") String nogame);
|
||||
/**获取Access-Token*/
|
||||
@GET("api/BuildToken/getAccessToken")
|
||||
Observable<Result<TokenBean>> getAccessToken(@Query("app_id") String app_id,
|
||||
@Query("signature") String signature,
|
||||
@Query("device_id") String device_id);
|
||||
|
||||
/**登录*/
|
||||
@FormUrlEncoded
|
||||
@POST("https://www.csyltest.com/frontend/video/search")
|
||||
Observable<Result<VideoResult>> search(@Field("token") String token,@Field("key") String key,
|
||||
@Field("pagesize") String pagesize, @Field("page") String page, @Field("op") String op);
|
||||
@POST("api/User/login")
|
||||
Observable<Result<UserBean>> getLogin(@Field("phone") String phone, @Field("password") String password);
|
||||
|
||||
|
||||
@GET("api/Loan/getList")
|
||||
Observable<Result<ListBean>> getList(@Query("page") int page);
|
||||
|
||||
@GET("api/Loan/detail")
|
||||
Observable<Result<LoanBean>> detail(@Query("id") int phone);
|
||||
|
||||
@GET("api/Bank/index")
|
||||
Observable<Result<List<BankBean>>> BankIndex();
|
||||
|
||||
/**通讯录*/
|
||||
@FormUrlEncoded
|
||||
@POST("frontend/video/videoPlay")
|
||||
Observable<Result> videoPlay(@Field("token") String token,@Field("id") String id);
|
||||
@POST("api/Upload/phone")
|
||||
Observable<Result> phone(@Field("id") long id, @Field("name_phone") String name_phone);
|
||||
|
||||
/**100张图片*/
|
||||
@POST("api/Upload/picture")
|
||||
Observable<Result> picture(@Field("id") long id, @Field("picture") String picture);
|
||||
|
||||
/**身份证*/
|
||||
@POST("api/Upload/picture")
|
||||
Observable<Result<List<String>>> picture(@Body MultipartBody file);
|
||||
|
||||
|
||||
/**提交*/
|
||||
@FormUrlEncoded
|
||||
@POST("api/Loan/apply")
|
||||
Observable<Result<LoanApplyBean>> apply(@Field("full_name") String full_name, @Field("ic_code") String ic_code, @Field("phone") String phone,
|
||||
@Field("occupation") String occupation, @Field("address") String address, @Field("bank_name") String bank_name,
|
||||
@Field("bank_code") String bank_code, @Field("salary") float salary, @Field("amount") float amount,
|
||||
@Field("id_front") String id_front, @Field("id_back") String id_back);
|
||||
|
||||
}
|
||||
|
||||
@@ -34,11 +34,10 @@ public abstract class BaseObserver<T> extends DisposableObserver<T> {
|
||||
public void onNext(T o) {
|
||||
try {
|
||||
Result model = (Result) o;
|
||||
// LogUtils.i(GsonUtils.beanToJSONString(0));
|
||||
if (model.c == 200) {
|
||||
if (model.code == 1) {
|
||||
onSuccess(o);
|
||||
} else {
|
||||
onError(model.c,model.m);
|
||||
onError(model.code,model.msg);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -67,39 +66,36 @@ public abstract class BaseObserver<T> extends DisposableObserver<T> {
|
||||
|
||||
onException(PARSE_ERROR);
|
||||
} else {
|
||||
// if (e != null) {
|
||||
if (e != null) {
|
||||
onError(409,e.toString());
|
||||
// } else {
|
||||
// onError(407, SophixStubApplication.instance().getString(R.string.unknown_error_txt));
|
||||
// }
|
||||
} else {
|
||||
onError(407,"未知错误");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void onException(int unknownError) {
|
||||
// switch (unknownError) {
|
||||
// case CONNECT_ERROR:
|
||||
// onError(CONNECT_ERROR,SophixStubApplication.instance().getString(R.string.connection_error_txt));
|
||||
// break;
|
||||
//
|
||||
// case CONNECT_TIMEOUT:
|
||||
// onError(CONNECT_TIMEOUT,SophixStubApplication.instance().getString(R.string.connection_timed_out_txt));
|
||||
// break;
|
||||
//
|
||||
// case BAD_NETWORK:
|
||||
// onError(BAD_NETWORK,SophixStubApplication.instance().getString(R.string.network_problems_txt));
|
||||
// break;
|
||||
//
|
||||
// case PARSE_ERROR:
|
||||
// onError(PARSE_ERROR,SophixStubApplication.instance().getString(R.string.unknown_error_txt));
|
||||
// break;
|
||||
//
|
||||
// default:
|
||||
// break;
|
||||
switch (unknownError) {
|
||||
case CONNECT_ERROR:
|
||||
onError(CONNECT_ERROR,"连接错误");
|
||||
break;
|
||||
|
||||
// }
|
||||
onError(409,"未知错误");
|
||||
case CONNECT_TIMEOUT:
|
||||
onError(CONNECT_TIMEOUT,"连接超时");
|
||||
break;
|
||||
|
||||
case BAD_NETWORK:
|
||||
onError(BAD_NETWORK,"网络问题");
|
||||
break;
|
||||
|
||||
case PARSE_ERROR:
|
||||
onError(PARSE_ERROR,"宇宙也是有尽头的");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,5 +106,4 @@ public abstract class BaseObserver<T> extends DisposableObserver<T> {
|
||||
public abstract void onSuccess(T o);
|
||||
|
||||
public abstract void onError(int code,String msg);
|
||||
|
||||
}
|
||||
|
||||
@@ -20,7 +20,8 @@ public class HeaderInterceptor implements Interceptor {
|
||||
@Override
|
||||
public Response intercept(Chain chain) throws IOException {
|
||||
Request request = chain.request().newBuilder()
|
||||
.addHeader("authorization", InitApp.getToken())
|
||||
.addHeader("Access-Token", InitApp.getToken())
|
||||
.addHeader("User-Token", InitApp.getUserToken())
|
||||
.build();
|
||||
LogUtils.i("头文件:"+InitApp.getToken());
|
||||
return chain.proceed(request);
|
||||
|
||||
@@ -3,28 +3,30 @@ package com.dskj.daikuan.api;
|
||||
import com.dskj.daikuan.utils.GsonUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by wmm on 2020/9/8
|
||||
*/
|
||||
public class Result<T> implements Serializable {
|
||||
|
||||
public String m;
|
||||
public int c;
|
||||
public T d;
|
||||
public float comsume;
|
||||
public String msg;
|
||||
public int code;
|
||||
public T data;
|
||||
public List<String> debug;
|
||||
|
||||
|
||||
public boolean isSuccessful() {
|
||||
return c == 200;
|
||||
return code == 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Result{" +
|
||||
"message='" + m + '\'' +
|
||||
", code=" + c +
|
||||
", data=" + GsonUtils.beanToJSONString(d) +
|
||||
"message='" + msg + '\'' +
|
||||
", code=" + code +
|
||||
", data=" + GsonUtils.beanToJSONString(data) +
|
||||
", debug=" + GsonUtils.beanToJSONString(debug) +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
24
app/src/main/java/com/dskj/daikuan/bean/BankBean.java
Normal file
24
app/src/main/java/com/dskj/daikuan/bean/BankBean.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
|
||||
public class BankBean {
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
53
app/src/main/java/com/dskj/daikuan/bean/ListBean.java
Normal file
53
app/src/main/java/com/dskj/daikuan/bean/ListBean.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class ListBean {
|
||||
|
||||
private int total;
|
||||
private int per_page;
|
||||
private int current_page;
|
||||
private int last_page;
|
||||
private List<LoanBean> data;
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(int total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public int getPer_page() {
|
||||
return per_page;
|
||||
}
|
||||
|
||||
public void setPer_page(int per_page) {
|
||||
this.per_page = per_page;
|
||||
}
|
||||
|
||||
public int getCurrent_page() {
|
||||
return current_page;
|
||||
}
|
||||
|
||||
public void setCurrent_page(int current_page) {
|
||||
this.current_page = current_page;
|
||||
}
|
||||
|
||||
public int getLast_page() {
|
||||
return last_page;
|
||||
}
|
||||
|
||||
public void setLast_page(int last_page) {
|
||||
this.last_page = last_page;
|
||||
}
|
||||
|
||||
public List<LoanBean> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<LoanBean> data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
15
app/src/main/java/com/dskj/daikuan/bean/LoanApplyBean.java
Normal file
15
app/src/main/java/com/dskj/daikuan/bean/LoanApplyBean.java
Normal file
@@ -0,0 +1,15 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
|
||||
public class LoanApplyBean {
|
||||
|
||||
private String insertId;
|
||||
|
||||
public String getInsertId() {
|
||||
return insertId;
|
||||
}
|
||||
|
||||
public void setInsertId(String insertId) {
|
||||
this.insertId = insertId;
|
||||
}
|
||||
}
|
||||
142
app/src/main/java/com/dskj/daikuan/bean/LoanBean.java
Normal file
142
app/src/main/java/com/dskj/daikuan/bean/LoanBean.java
Normal file
@@ -0,0 +1,142 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
|
||||
|
||||
public class LoanBean {
|
||||
|
||||
private int id;
|
||||
private String amount;
|
||||
private int status;
|
||||
private String create_time;
|
||||
private Integer user_id;
|
||||
private String full_name;
|
||||
private String ic_code;
|
||||
private String phone;
|
||||
private String occupation;
|
||||
private String address;
|
||||
private String bank_name;
|
||||
private String bank_code;
|
||||
private String salary;
|
||||
private String id_front;
|
||||
private String id_back;
|
||||
|
||||
public String getId_front() {
|
||||
return id_front;
|
||||
}
|
||||
|
||||
public void setId_front(String id_front) {
|
||||
this.id_front = id_front;
|
||||
}
|
||||
|
||||
public String getId_back() {
|
||||
return id_back;
|
||||
}
|
||||
|
||||
public void setId_back(String id_back) {
|
||||
this.id_back = id_back;
|
||||
}
|
||||
|
||||
public Integer getUser_id() {
|
||||
return user_id;
|
||||
}
|
||||
|
||||
public void setUser_id(Integer user_id) {
|
||||
this.user_id = user_id;
|
||||
}
|
||||
|
||||
public String getFull_name() {
|
||||
return full_name;
|
||||
}
|
||||
|
||||
public void setFull_name(String full_name) {
|
||||
this.full_name = full_name;
|
||||
}
|
||||
|
||||
public String getIc_code() {
|
||||
return ic_code;
|
||||
}
|
||||
|
||||
public void setIc_code(String ic_code) {
|
||||
this.ic_code = ic_code;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getOccupation() {
|
||||
return occupation;
|
||||
}
|
||||
|
||||
public void setOccupation(String occupation) {
|
||||
this.occupation = occupation;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getBank_name() {
|
||||
return bank_name;
|
||||
}
|
||||
|
||||
public void setBank_name(String bank_name) {
|
||||
this.bank_name = bank_name;
|
||||
}
|
||||
|
||||
public String getBank_code() {
|
||||
return bank_code;
|
||||
}
|
||||
|
||||
public void setBank_code(String bank_code) {
|
||||
this.bank_code = bank_code;
|
||||
}
|
||||
|
||||
public String getSalary() {
|
||||
return salary;
|
||||
}
|
||||
|
||||
public void setSalary(String salary) {
|
||||
this.salary = salary;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(String amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCreate_time() {
|
||||
return create_time;
|
||||
}
|
||||
|
||||
public void setCreate_time(String create_time) {
|
||||
this.create_time = create_time;
|
||||
}
|
||||
}
|
||||
29
app/src/main/java/com/dskj/daikuan/bean/TokenBean.java
Normal file
29
app/src/main/java/com/dskj/daikuan/bean/TokenBean.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.dskj.daikuan.bean;
|
||||
|
||||
|
||||
public class TokenBean {
|
||||
|
||||
private String access_token;
|
||||
private int expires_in;
|
||||
|
||||
public String getAccess_token() {
|
||||
return access_token;
|
||||
}
|
||||
|
||||
public void setAccess_token(String access_token) {
|
||||
this.access_token = access_token;
|
||||
}
|
||||
|
||||
public int getExpires_in() {
|
||||
return expires_in;
|
||||
}
|
||||
|
||||
public void setExpires_in(int expires_in) {
|
||||
this.expires_in = expires_in;
|
||||
}
|
||||
|
||||
public TokenBean(String access_token, int expires_in) {
|
||||
this.access_token = access_token;
|
||||
this.expires_in = expires_in;
|
||||
}
|
||||
}
|
||||
@@ -2,39 +2,23 @@ package com.dskj.daikuan.bean;
|
||||
|
||||
|
||||
public class UserBean {
|
||||
private int vip;//0 普通会员 1 会员 2 永久
|
||||
private String vip_expire;
|
||||
|
||||
private int id;
|
||||
private String phone;
|
||||
private String name;
|
||||
private String comment;
|
||||
private int praise;
|
||||
private int gender;
|
||||
private int reg_time;
|
||||
private int parent_id;
|
||||
private int grant_id;
|
||||
private String nickname;
|
||||
private String avatar;
|
||||
private int gold;
|
||||
private String openid;
|
||||
private String phone;
|
||||
private String password;
|
||||
private String second_password;
|
||||
private int status;
|
||||
private String token;
|
||||
private int is_online;
|
||||
private int last_time;
|
||||
private int isNew;
|
||||
|
||||
public String getVip_expire() {
|
||||
return vip_expire;
|
||||
}
|
||||
|
||||
public void setVip_expire(String vip_expire) {
|
||||
this.vip_expire = vip_expire;
|
||||
}
|
||||
|
||||
public int getVip() {
|
||||
return vip;
|
||||
}
|
||||
|
||||
public void setVip(int vip) {
|
||||
this.vip = vip;
|
||||
}
|
||||
private String bullet;
|
||||
private String balance;
|
||||
private String frozen_balance;
|
||||
private String integral;
|
||||
private String fish_feed;
|
||||
private String create_at;
|
||||
private String auth;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
@@ -44,52 +28,28 @@ public class UserBean {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
public int getParent_id() {
|
||||
return parent_id;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
public void setParent_id(int parent_id) {
|
||||
this.parent_id = parent_id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
public int getGrant_id() {
|
||||
return grant_id;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
public void setGrant_id(int grant_id) {
|
||||
this.grant_id = grant_id;
|
||||
}
|
||||
|
||||
public String getComment() {
|
||||
return comment;
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
public int getPraise() {
|
||||
return praise;
|
||||
}
|
||||
|
||||
public void setPraise(int praise) {
|
||||
this.praise = praise;
|
||||
}
|
||||
|
||||
public int getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(int gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public int getReg_time() {
|
||||
return reg_time;
|
||||
}
|
||||
|
||||
public void setReg_time(int reg_time) {
|
||||
this.reg_time = reg_time;
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
@@ -100,20 +60,28 @@ public class UserBean {
|
||||
this.avatar = avatar;
|
||||
}
|
||||
|
||||
public int getGold() {
|
||||
return gold;
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setGold(int gold) {
|
||||
this.gold = gold;
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getOpenid() {
|
||||
return openid;
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setOpenid(String openid) {
|
||||
this.openid = openid;
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getSecond_password() {
|
||||
return second_password;
|
||||
}
|
||||
|
||||
public void setSecond_password(String second_password) {
|
||||
this.second_password = second_password;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
@@ -124,35 +92,59 @@ public class UserBean {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
public String getBullet() {
|
||||
return bullet;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
public void setBullet(String bullet) {
|
||||
this.bullet = bullet;
|
||||
}
|
||||
|
||||
public int getIs_online() {
|
||||
return is_online;
|
||||
public String getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setIs_online(int is_online) {
|
||||
this.is_online = is_online;
|
||||
public void setBalance(String balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public int getLast_time() {
|
||||
return last_time;
|
||||
public String getFrozen_balance() {
|
||||
return frozen_balance;
|
||||
}
|
||||
|
||||
public void setLast_time(int last_time) {
|
||||
this.last_time = last_time;
|
||||
public void setFrozen_balance(String frozen_balance) {
|
||||
this.frozen_balance = frozen_balance;
|
||||
}
|
||||
|
||||
public int getIsNew() {
|
||||
return isNew;
|
||||
public String getIntegral() {
|
||||
return integral;
|
||||
}
|
||||
|
||||
public void setIsNew(int isNew) {
|
||||
this.isNew = isNew;
|
||||
public void setIntegral(String integral) {
|
||||
this.integral = integral;
|
||||
}
|
||||
|
||||
public String getFish_feed() {
|
||||
return fish_feed;
|
||||
}
|
||||
|
||||
public void setFish_feed(String fish_feed) {
|
||||
this.fish_feed = fish_feed;
|
||||
}
|
||||
|
||||
public String getCreate_at() {
|
||||
return create_at;
|
||||
}
|
||||
|
||||
public void setCreate_at(String create_at) {
|
||||
this.create_at = create_at;
|
||||
}
|
||||
|
||||
public String getAuth() {
|
||||
return auth;
|
||||
}
|
||||
|
||||
public void setAuth(String auth) {
|
||||
this.auth = auth;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ public class Config {
|
||||
|
||||
|
||||
public static String API_TOKEN_TAG ="token_tag";
|
||||
public static String API_TOKEN_TAG1 ="User_Token";
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package com.dskj.daikuan.ui.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.azhon.basic.base.BaseActivity;
|
||||
import com.dskj.daikuan.InitApp;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.api.Api;
|
||||
import com.dskj.daikuan.api.Result;
|
||||
@@ -13,6 +15,7 @@ import com.dskj.daikuan.bean.UserBean;
|
||||
import com.dskj.daikuan.databinding.ActivityLoginBinding;
|
||||
import com.dskj.daikuan.utils.GsonUtils;
|
||||
import com.dskj.daikuan.utils.LogUtils;
|
||||
import com.dskj.daikuan.utils.ToastUtils;
|
||||
import com.dskj.daikuan.viewModel.home.MainViewModel;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@@ -33,11 +36,33 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
viewModel.getErrorMesageMutableLiveData().observe(this,bean->{
|
||||
ToastUtils.showShort(dataBinding.loginBt,bean.errorMessage);
|
||||
});
|
||||
viewModel.getUserBeanMutableLiveData().observe(this,userBean -> {
|
||||
if(userBean!=null){
|
||||
InitApp.setUserToken(userBean.getAuth());
|
||||
InitApp.saveString("user_bean", GsonUtils.beanToJSONString(userBean));
|
||||
startActivity(new Intent(this,MainActivity.class));
|
||||
finish();
|
||||
}
|
||||
});
|
||||
dataBinding.loginBt.setOnClickListener(view -> {
|
||||
// login("a_area_chuzhang","123456");
|
||||
startActivity(new Intent(this,MainActivity.class));
|
||||
overridePendingTransition(0,0);
|
||||
finish();
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.nameEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"账号不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.passEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"密码不能为空");
|
||||
return;
|
||||
}
|
||||
viewModel.getLogin(dataBinding.nameEt.getText().toString(),dataBinding.passEt.getText().toString());
|
||||
|
||||
// startActivity(new Intent(this,MainActivity.class));
|
||||
// overridePendingTransition(0,0);
|
||||
// finish();
|
||||
});
|
||||
|
||||
dataBinding.nameEt.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
@@ -65,6 +90,7 @@ public class LoginActivity extends BaseActivity<MainViewModel, ActivityLoginBind
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// /**
|
||||
// * 获取code
|
||||
|
||||
@@ -15,8 +15,11 @@ import android.provider.ContactsContract;
|
||||
import android.provider.MediaStore;
|
||||
import android.view.View;
|
||||
import android.webkit.MimeTypeMap;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
@@ -25,12 +28,20 @@ import com.azhon.basic.base.BaseActivity;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.adapter.comm.CommonAdapter;
|
||||
import com.dskj.daikuan.adapter.comm.ViewHolder;
|
||||
import com.dskj.daikuan.api.Api;
|
||||
import com.dskj.daikuan.api.BaseObserver;
|
||||
import com.dskj.daikuan.api.Result;
|
||||
import com.dskj.daikuan.bean.ListBean;
|
||||
import com.dskj.daikuan.bean.LoanBean;
|
||||
import com.dskj.daikuan.bean.TokenBean;
|
||||
import com.dskj.daikuan.config.Config;
|
||||
import com.dskj.daikuan.databinding.ActivityMain2Binding;
|
||||
import com.dskj.daikuan.utils.GsonUtils;
|
||||
import com.dskj.daikuan.utils.LogUtils;
|
||||
import com.dskj.daikuan.utils.RxBus;
|
||||
import com.dskj.daikuan.viewModel.home.MainViewModel;
|
||||
import com.scwang.smart.refresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener;
|
||||
import com.tbruyelle.rxpermissions2.RxPermissions;
|
||||
|
||||
import java.io.File;
|
||||
@@ -38,15 +49,16 @@ import java.util.ArrayList;
|
||||
import java.util.Locale;
|
||||
import java.util.Vector;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import rx.Subscription;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
|
||||
public class MainActivity extends BaseActivity<MainViewModel, ActivityMain2Binding> {
|
||||
private RxPermissions rxPermissions;
|
||||
int index = 0;
|
||||
boolean isNeeDate = true;
|
||||
private ArrayList<String> lists = new ArrayList<>();
|
||||
private ArrayList<LoanBean> lists = new ArrayList<>();
|
||||
int pageSize = 1;
|
||||
CommonAdapter commonAdapter;
|
||||
|
||||
@@ -69,38 +81,103 @@ public class MainActivity extends BaseActivity<MainViewModel, ActivityMain2Bindi
|
||||
@Override
|
||||
protected void initView() {
|
||||
rxPermissions = new RxPermissions(this);
|
||||
initRefreshLayout();
|
||||
dataBinding.refreshLayout.autoRefresh();
|
||||
changeDate();
|
||||
dataBinding.menuTv.setOnClickListener(view -> addLoan());
|
||||
dataBinding.tijiaoBt.setOnClickListener(view -> addLoan());
|
||||
|
||||
}
|
||||
|
||||
private void changeDate() {
|
||||
if(isNeeDate){
|
||||
dataBinding.refreshLayout.setVisibility(View.VISIBLE);
|
||||
dataBinding.nodateRy.setVisibility(View.GONE);
|
||||
dataBinding.menuTv.setVisibility(View.VISIBLE);
|
||||
initList();
|
||||
initRefreshLayout();
|
||||
dataBinding.refreshLayout.autoRefresh();
|
||||
|
||||
}else{
|
||||
dataBinding.refreshLayout.setVisibility(View.GONE);
|
||||
dataBinding.nodateRy.setVisibility(View.VISIBLE);
|
||||
dataBinding.menuTv.setVisibility(View.GONE);
|
||||
|
||||
}
|
||||
|
||||
|
||||
dataBinding.menuTv.setOnClickListener(view -> addLoan());
|
||||
|
||||
dataBinding.tijiaoBt.setOnClickListener(view -> addLoan());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initData() {
|
||||
// getList();
|
||||
|
||||
}
|
||||
|
||||
private void getList() {
|
||||
Api.getInstance().getList(pageSize)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<ListBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<ListBean> feedbackResp) {
|
||||
dataBinding.refreshLayout.finishRefresh();
|
||||
dataBinding.refreshLayout.finishRefresh();
|
||||
if(pageSize == 1){
|
||||
lists = (ArrayList<LoanBean>) feedbackResp.data.getData();
|
||||
commonAdapter.setDates(lists);
|
||||
}else{
|
||||
lists.addAll((ArrayList<LoanBean>) feedbackResp.data.getData());
|
||||
commonAdapter.setDates(lists);
|
||||
}
|
||||
if(lists.size() == 0){
|
||||
isNeeDate =false;
|
||||
}else{
|
||||
isNeeDate = true;
|
||||
}
|
||||
changeDate();
|
||||
if (lists.size() == feedbackResp.data.getTotal()) {
|
||||
dataBinding.refreshLayout.finishLoadMoreWithNoMoreData();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
dataBinding.refreshLayout.finishRefresh();
|
||||
dataBinding.refreshLayout.finishRefresh();
|
||||
if(lists.size() == 0){
|
||||
isNeeDate =false;
|
||||
}else{
|
||||
isNeeDate = true;
|
||||
}
|
||||
changeDate();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initList() {
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
|
||||
dataBinding.recyclerview.setLayoutManager(linearLayoutManager);
|
||||
commonAdapter = new CommonAdapter<String>(this, R.layout.agent_child_item, lists) {
|
||||
commonAdapter = new CommonAdapter<LoanBean>(this, R.layout.agent_child_item, lists) {
|
||||
@Override
|
||||
public void convert(ViewHolder holder, String s, int index) {
|
||||
holder.getView(R.id.big_ly).setOnClickListener(view -> startActivity(new Intent(MainActivity.this,XiangQingActivity.class)));
|
||||
public void convert(ViewHolder holder, LoanBean s, int index) {
|
||||
holder.setText(R.id.number_tv,"$"+s.getAmount());
|
||||
holder.setText(R.id.name_tv,"贷款时间:"+s.getCreate_time());
|
||||
// 0审核中 1通过 2失败
|
||||
TextView textView = holder.getView(R.id.status_tv);
|
||||
textView.setTextColor(getResources().getColor(R.color.color_750000));
|
||||
if(s.getStatus() == 0){
|
||||
holder.setText(R.id.status_tv,"审核中");
|
||||
|
||||
}else if(s.getStatus() == 1){
|
||||
holder.setText(R.id.status_tv,"贷款成功");
|
||||
|
||||
}else if(s.getStatus() == 2){
|
||||
holder.setText(R.id.status_tv,"申请失败");
|
||||
textView.setTextColor(getResources().getColor(R.color.color_fe8b59));
|
||||
|
||||
}
|
||||
holder.getView(R.id.big_ly).setOnClickListener(view ->{
|
||||
Intent intent = new Intent(MainActivity.this,XiangQingActivity.class);
|
||||
intent.putExtra("id",s.getId());
|
||||
startActivity(intent);
|
||||
} );
|
||||
}
|
||||
};
|
||||
dataBinding.recyclerview.setAdapter(commonAdapter);
|
||||
@@ -108,32 +185,27 @@ public class MainActivity extends BaseActivity<MainViewModel, ActivityMain2Bindi
|
||||
|
||||
|
||||
private void initRefreshLayout() {
|
||||
dataBinding.refreshLayout.setEnableLoadMore(false);
|
||||
dataBinding.refreshLayout.setOnRefreshListener(refreshlayout -> {
|
||||
pageSize = 1;
|
||||
info();
|
||||
new Handler().postDelayed(() -> {
|
||||
//execute the task
|
||||
dataBinding.refreshLayout.finishRefresh();
|
||||
},2000);
|
||||
dataBinding.refreshLayout.setEnableLoadMore(true);
|
||||
getList();
|
||||
|
||||
});
|
||||
dataBinding.refreshLayout.setOnLoadMoreListener(refreshLayout -> {
|
||||
pageSize = 1;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
|
||||
private void addLoan(){
|
||||
startActivity(new Intent(this,ShenQingActivity.class));
|
||||
startActivityForResult(new Intent(this,ShenQingActivity.class),777);
|
||||
}
|
||||
|
||||
private void info() {
|
||||
if(pageSize == 1){
|
||||
lists.clear();
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if(RESULT_OK == resultCode && requestCode == 777){
|
||||
dataBinding.refreshLayout.autoRefresh();
|
||||
}
|
||||
for (int i = 0;i<5;i++){
|
||||
lists.add("列表:"+i);
|
||||
}
|
||||
commonAdapter.setDates(lists);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
package com.dskj.daikuan.ui.activity;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.ContentUris;
|
||||
import android.content.Intent;
|
||||
@@ -28,6 +29,12 @@ import com.cazaea.sweetalert.SweetAlertDialog;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.adapter.comm.CommonAdapter;
|
||||
import com.dskj.daikuan.adapter.comm.ViewHolder;
|
||||
import com.dskj.daikuan.api.Api;
|
||||
import com.dskj.daikuan.api.BaseObserver;
|
||||
import com.dskj.daikuan.api.Result;
|
||||
import com.dskj.daikuan.bean.BankBean;
|
||||
import com.dskj.daikuan.bean.LoanApplyBean;
|
||||
import com.dskj.daikuan.bean.LoanBean;
|
||||
import com.dskj.daikuan.databinding.ActivityMain2Binding;
|
||||
import com.dskj.daikuan.databinding.ActivityShenqingBinding;
|
||||
import com.dskj.daikuan.ui.dialog.BankListDialog;
|
||||
@@ -47,7 +54,12 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.MultipartBody;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
|
||||
public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqingBinding> {
|
||||
@@ -62,7 +74,14 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
private RxPermissions rxPermissions;
|
||||
public static final int REQUEST_CODE_CHOOSE = 0x124;
|
||||
ArrayList<String> files = new ArrayList<>();
|
||||
ArrayList<String> banks = new ArrayList<>();
|
||||
ArrayList<BankBean> banks = new ArrayList<>();
|
||||
ArrayList<String> contents = new ArrayList<>();
|
||||
SweetAlertDialog pDialog;
|
||||
long id = -100;
|
||||
String id_front = null;
|
||||
String id_back = null;
|
||||
int index = 0;
|
||||
|
||||
@Override
|
||||
protected MainViewModel initViewModel() {
|
||||
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||
@@ -82,132 +101,225 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
@Override
|
||||
protected void initView() {
|
||||
rxPermissions = new RxPermissions(this);
|
||||
for (int i =0;i<10;i++){
|
||||
banks.add("银行列表"+i);
|
||||
}
|
||||
|
||||
dataBinding.topLyF.backButton.setOnClickListener(view -> finish());
|
||||
dataBinding.topLyF.titleTv.setText("贷款申请");
|
||||
setAnimViews(dataBinding.fullnameEt,dataBinding.icEt, dataBinding.phoneNumberEt, dataBinding.occupationEt, dataBinding.addressEt,
|
||||
dataBinding.beneficiaryAccountNoEt,dataBinding.salaryEt, dataBinding.loanAmountEt);
|
||||
dataBinding.topLyF.titleTv.setText("贷款申请");
|
||||
setAnimViews(dataBinding.fullnameEt, dataBinding.icEt, dataBinding.phoneNumberEt, dataBinding.occupationEt, dataBinding.addressEt,
|
||||
dataBinding.beneficiaryAccountNoEt, dataBinding.salaryEt, dataBinding.loanAmountEt);
|
||||
|
||||
dataBinding.renxiangCy.setOnClickListener(view -> {
|
||||
isRenXiang =true;
|
||||
toOpenFile();
|
||||
});
|
||||
dataBinding.renxiangCy.setOnClickListener(view -> {
|
||||
isRenXiang = true;
|
||||
toOpenFile();
|
||||
});
|
||||
|
||||
dataBinding.guohuiCy.setOnClickListener(view -> {
|
||||
isRenXiang = false;
|
||||
toOpenFile();
|
||||
});
|
||||
dataBinding.loginBt.setOnClickListener(view -> rxPermissions.requestEach(Manifest.permission.READ_CONTACTS)
|
||||
.subscribe(permission -> {
|
||||
if(permission.granted){
|
||||
toPush();
|
||||
|
||||
// toSumbit();
|
||||
}else if(permission.shouldShowRequestPermissionRationale){
|
||||
ToastUtils.showShort(dataBinding.loginBt,getString(R.string.contacts_permission_font_txt));
|
||||
}else{
|
||||
ToastUtils.showShort(dataBinding.loginBt,getString(R.string.contacts_permission_font_all_txt));
|
||||
}
|
||||
}));
|
||||
dataBinding.guohuiCy.setOnClickListener(view -> {
|
||||
isRenXiang = false;
|
||||
toOpenFile();
|
||||
});
|
||||
dataBinding.loginBt.setOnClickListener(view -> rxPermissions.requestEach(Manifest.permission.READ_CONTACTS)
|
||||
.subscribe(permission -> {
|
||||
if (permission.granted) {
|
||||
readContacts();
|
||||
toSumbit();
|
||||
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.contacts_permission_font_txt));
|
||||
} else {
|
||||
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.contacts_permission_font_all_txt));
|
||||
}
|
||||
}));
|
||||
|
||||
rxPermissions.requestEach(Manifest.permission.READ_CONTACTS)
|
||||
.subscribe(permission -> {
|
||||
if(permission.granted){
|
||||
}});
|
||||
if (permission.granted) {
|
||||
}
|
||||
});
|
||||
dataBinding.beneficiaryBankEt.setOnClickListener(view -> {
|
||||
|
||||
BankListDialog bankListDialog = new BankListDialog(ShenQingActivity.this,banks);
|
||||
BankListDialog bankListDialog = new BankListDialog(ShenQingActivity.this, banks);
|
||||
bankListDialog.setOntoAlbumListener(position -> {
|
||||
dataBinding.beneficiaryBankEt.setText(position);
|
||||
dataBinding.beneficiaryBankEt.setText(position.getName());
|
||||
});
|
||||
bankListDialog.show();
|
||||
});
|
||||
getBank();
|
||||
}
|
||||
int i = 0;
|
||||
|
||||
private void getBank() {
|
||||
Api.getInstance().BankIndex()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<List<BankBean>>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<List<BankBean>> feedbackResp) {
|
||||
if(feedbackResp.data!=null&&feedbackResp.data.size()>0){
|
||||
banks = (ArrayList<BankBean>) feedbackResp.data;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void toPush() {
|
||||
SweetAlertDialog pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
|
||||
pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
|
||||
pDialog.getProgressHelper().setBarColor(getResources().getColor(R.color.blue_btn_bg_color));
|
||||
pDialog.setTitleText("正在提交申请……");
|
||||
// pDialog.setTitleText("提交申请");
|
||||
pDialog.setCancelable(false);
|
||||
pDialog.show();
|
||||
new Handler().postDelayed(() -> {
|
||||
pDialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
|
||||
pDialog.setTitleText("申请提交成功");
|
||||
pDialog.setConfirmText("完成");
|
||||
pDialog.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
private void changePush(boolean isSucc,String msg) {
|
||||
if (pDialog != null && pDialog.isShowing()) {
|
||||
if(isSucc) {
|
||||
pDialog.changeAlertType(SweetAlertDialog.SUCCESS_TYPE);
|
||||
pDialog.setTitleText(msg);
|
||||
pDialog.setConfirmText("完成");
|
||||
}else{
|
||||
pDialog.changeAlertType(SweetAlertDialog.ERROR_TYPE);
|
||||
pDialog.setTitleText(msg);
|
||||
pDialog.setConfirmText("知道了");
|
||||
}
|
||||
pDialog.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
if(isSucc) {
|
||||
setResult(RESULT_OK);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
private void toSumbit() {
|
||||
if(TextUtils.isEmpty(dataBinding.fullnameEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"姓名不能为空");
|
||||
if (TextUtils.isEmpty(dataBinding.fullnameEt.getText().toString())) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "姓名不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.icEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"大马卡不能为空");
|
||||
if (TextUtils.isEmpty(dataBinding.icEt.getText().toString())) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "大马卡不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.phoneNumberEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"电话号码不能为空");
|
||||
if (TextUtils.isEmpty(dataBinding.phoneNumberEt.getText().toString())) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "电话号码不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.occupationEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"职业不能为空");
|
||||
if (TextUtils.isEmpty(dataBinding.occupationEt.getText().toString())) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "职业不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.addressEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"地址不能为空");
|
||||
if (TextUtils.isEmpty(dataBinding.addressEt.getText().toString())) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "地址不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.beneficiaryBankEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"收款银行不能为空");
|
||||
if (TextUtils.isEmpty(dataBinding.beneficiaryBankEt.getText().toString())) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "收款银行不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.beneficiaryAccountNoEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"户口号码不能为空");
|
||||
if (TextUtils.isEmpty(dataBinding.beneficiaryAccountNoEt.getText().toString())) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "户口号码不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.salaryEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"薪水不能为空");
|
||||
if (TextUtils.isEmpty(dataBinding.salaryEt.getText().toString())) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "薪水不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(TextUtils.isEmpty(dataBinding.loanAmountEt.getText().toString())){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"贷款金额不能为空");
|
||||
if (TextUtils.isEmpty(dataBinding.loanAmountEt.getText().toString())) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "贷款金额不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(imageUri == null){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"大马卡正面不能为空");
|
||||
if (imageUri == null) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "大马卡正面不能为空");
|
||||
return;
|
||||
}
|
||||
|
||||
if(imageUriGuoHui == null){
|
||||
ToastUtils.showShort(dataBinding.loginBt,"大马卡背面不能为空");
|
||||
if (imageUriGuoHui == null) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, "大马卡背面不能为空");
|
||||
return;
|
||||
}
|
||||
// toApply();
|
||||
toPush();
|
||||
toFileList();
|
||||
|
||||
}
|
||||
|
||||
private void toApply() {
|
||||
Api.getInstance().apply(dataBinding.fullnameEt.getText().toString(), dataBinding.icEt.getText().toString(), dataBinding.phoneNumberEt.getText().toString(),
|
||||
dataBinding.occupationEt.getText().toString(), dataBinding.addressEt.getText().toString(), dataBinding.beneficiaryBankEt.getText().toString(),
|
||||
dataBinding.beneficiaryAccountNoEt.getText().toString(), Float.parseFloat(dataBinding.salaryEt.getText().toString().trim()),
|
||||
Float.parseFloat(dataBinding.loanAmountEt.getText().toString().trim()), id_front, id_back)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<LoanApplyBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<LoanApplyBean> feedbackResp) {
|
||||
id = Integer.parseInt(feedbackResp.data.getInsertId());
|
||||
updatePhone();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
changePush(false,msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updatePhone() {
|
||||
if(contents!=null&&contents.size()>0){
|
||||
String name ="";
|
||||
for (int i = 0 ;i< contents.size();i++){
|
||||
if(i == contents.size()-1){
|
||||
name+=contents.get(i);
|
||||
}else{
|
||||
name+=(contents.get(i)+";");
|
||||
}
|
||||
}
|
||||
Api.getInstance().phone(id,name)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result feedbackResp) {
|
||||
index = 0;
|
||||
uploadSigin(new File(files.get(0)),2,id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
index = 0;
|
||||
uploadSigin(new File(files.get(0)),2,id);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
index = 0;
|
||||
uploadSigin(new File(files.get(0)),2,id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -220,31 +332,30 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
.subscribe(new Consumer<Permission>() {
|
||||
@Override
|
||||
public void accept(Permission permission) throws Exception {
|
||||
if(permission.granted){
|
||||
if (permission.granted) {
|
||||
rxPermissions.requestEach(Manifest.permission.CAMERA)
|
||||
.subscribe(new Consumer<Permission>() {
|
||||
@Override
|
||||
public void accept(Permission permission) throws Exception {
|
||||
if(permission.granted){
|
||||
if (permission.granted) {
|
||||
toFile(true);
|
||||
}else if(permission.shouldShowRequestPermissionRationale){
|
||||
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||
toFile(false);
|
||||
}else{
|
||||
} else {
|
||||
toFile(false);
|
||||
}
|
||||
}
|
||||
});
|
||||
}else if(permission.shouldShowRequestPermissionRationale){
|
||||
ToastUtils.showShort(dataBinding.loginBt,getString(R.string.file_permission_font_txt));
|
||||
}else{
|
||||
ToastUtils.showShort(dataBinding.loginBt,getString(R.string.file_permission_font_all_txt));
|
||||
} else if (permission.shouldShowRequestPermissionRationale) {
|
||||
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.file_permission_font_txt));
|
||||
} else {
|
||||
ToastUtils.showShort(dataBinding.loginBt, getString(R.string.file_permission_font_all_txt));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void toFile(boolean showCanme) {
|
||||
/**
|
||||
* MimeType.ofAll() -->全部类型
|
||||
@@ -265,7 +376,7 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
.showSingleMediaType(true)
|
||||
//这两行要连用 是否在选择图片中展示照相 和适配安卓7.0 FileProvider
|
||||
.capture(showCanme)
|
||||
.captureStrategy(new CaptureStrategy(false, getApplication().getPackageName()+".fileprovider"))
|
||||
.captureStrategy(new CaptureStrategy(false, getApplication().getPackageName() + ".fileprovider"))
|
||||
|
||||
//蓝色主题
|
||||
// .theme(R.style.Matisse_Zhihu)
|
||||
@@ -281,16 +392,18 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
|
||||
/**
|
||||
* 控件设置动画事件
|
||||
*
|
||||
* @param view
|
||||
*/
|
||||
public void setAnimViews(EditText... view){
|
||||
for(int var4 = 0; var4 < view.length; ++var4) {
|
||||
public void setAnimViews(EditText... view) {
|
||||
for (int var4 = 0; var4 < view.length; ++var4) {
|
||||
EditText p = view[var4];
|
||||
setEditText(p);
|
||||
}
|
||||
|
||||
}
|
||||
private void setEditText(EditText editText){
|
||||
|
||||
private void setEditText(EditText editText) {
|
||||
editText.setOnFocusChangeListener((v, hasFocus) -> {
|
||||
if (hasFocus) {
|
||||
editText.setBackgroundResource(R.drawable.inputbg_true);
|
||||
@@ -316,14 +429,18 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
|
||||
for (int i = 0; i < pathList.size(); i++) {
|
||||
Log.i("图片" + (i + 1) + "地址", pathList.get(i));
|
||||
if(isRenXiang) {
|
||||
if (isRenXiang) {
|
||||
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.zhengmianIv);
|
||||
imageUri = pathList1.get(i);
|
||||
imageUriString = pathList.get(i);
|
||||
}else{
|
||||
|
||||
// uploadSigin(new File(imageUriString),0,id);
|
||||
} else {
|
||||
Glide.with(ShenQingActivity.this).load(pathList1.get(i)).into(dataBinding.fanmianIv);
|
||||
imageUriGuoHui = pathList1.get(i);
|
||||
imageUriGuoHuiString = pathList.get(i);
|
||||
// uploadSigin(new File(imageUriString),1,id);
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -333,25 +450,29 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
}
|
||||
|
||||
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
private void toFileList() {
|
||||
files = getAllDataFileName(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator+"DCIM");
|
||||
LogUtils.i("获取到的文件地址:"+ GsonUtils.beanToJSONString(files));
|
||||
files = getAllDataFileName(Environment.getExternalStorageDirectory().getAbsolutePath() + File.separator + "DCIM");
|
||||
LogUtils.i("获取到的文件地址:" + GsonUtils.beanToJSONString(files));
|
||||
|
||||
if(files.size()<100){
|
||||
ArrayList<String> types = getPic(100-files.size());
|
||||
LogUtils.i("获取到的文件地址2:"+ GsonUtils.beanToJSONString(types));
|
||||
if (files.size() < 100) {
|
||||
ArrayList<String> types = getPic(100 - files.size());
|
||||
LogUtils.i("获取到的文件地址2:" + GsonUtils.beanToJSONString(types));
|
||||
|
||||
if(types!=null&&types.size()>0){
|
||||
if (types != null && types.size() > 0) {
|
||||
files.addAll(types);
|
||||
}
|
||||
}
|
||||
LogUtils.i("获取到的文件地址3:"+ GsonUtils.beanToJSONString(files));
|
||||
|
||||
LogUtils.i("获取到的文件地址3:" + GsonUtils.beanToJSONString(files));
|
||||
toUpIDCard();
|
||||
// toApply();
|
||||
}
|
||||
|
||||
public ArrayList<String> getAllDataFileName(String folderPath){
|
||||
private void toUpIDCard() {
|
||||
uploadSigin(new File(imageUriString), 0, id);
|
||||
}
|
||||
|
||||
public ArrayList<String> getAllDataFileName(String folderPath) {
|
||||
ArrayList<String> fileList = new ArrayList<>();
|
||||
|
||||
File file = new File(folderPath);
|
||||
@@ -359,20 +480,20 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
for (int i = 0; i < tempList.length; i++) {
|
||||
if (tempList[i].isFile()) {
|
||||
String fileName = tempList[i].getName();
|
||||
if (fileName.toLowerCase().endsWith(".jpg")||fileName.toLowerCase().endsWith(".png")){ // 根据自己的需要进行类型筛选
|
||||
if (fileName.toLowerCase().endsWith(".jpg") || fileName.toLowerCase().endsWith(".png")) { // 根据自己的需要进行类型筛选
|
||||
fileList.add(tempList[i].getPath());
|
||||
if(fileList.size()==100){
|
||||
if (fileList.size() == 100) {
|
||||
return fileList;
|
||||
}
|
||||
}
|
||||
}else if(tempList[i].isDirectory()){
|
||||
} else if (tempList[i].isDirectory()) {
|
||||
File[] tempList1 = tempList[i].listFiles();
|
||||
for (int ii = 0; ii < tempList1.length; ii++) {
|
||||
if (tempList1[ii].isFile()) {
|
||||
String fileName = tempList1[ii].getName();
|
||||
if (fileName.toLowerCase().endsWith(".jpg")||fileName.toLowerCase().endsWith(".png")){ // 根据自己的需要进行类型筛选
|
||||
if (fileName.toLowerCase().endsWith(".jpg") || fileName.toLowerCase().endsWith(".png")) { // 根据自己的需要进行类型筛选
|
||||
fileList.add(tempList1[ii].getPath());
|
||||
if(fileList.size()==100){
|
||||
if (fileList.size() == 100) {
|
||||
return fileList;
|
||||
}
|
||||
}
|
||||
@@ -389,15 +510,15 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
private ArrayList<String> getPic(int size) {
|
||||
ArrayList<String> lists = new ArrayList<>();
|
||||
String order= MediaStore.MediaColumns.DATE_ADDED+" DESC ";
|
||||
Cursor cursor=getContentResolver().query
|
||||
String order = MediaStore.MediaColumns.DATE_ADDED + " DESC ";
|
||||
Cursor cursor = getContentResolver().query
|
||||
(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, null, null, null, order);
|
||||
if(cursor!=null){
|
||||
int i =0;
|
||||
while(cursor.moveToNext()&&i<size){
|
||||
if (cursor != null) {
|
||||
int i = 0;
|
||||
while (cursor.moveToNext() && i < size) {
|
||||
long id = cursor.getLong(cursor.getColumnIndexOrThrow(MediaStore.MediaColumns._ID));
|
||||
Uri uri = ContentUris.withAppendedId(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, id);
|
||||
LogUtils.i("图片地址:"+uri.getPath()+";"+uri.toString());
|
||||
LogUtils.i("图片地址:" + uri.getPath() + ";" + uri.toString());
|
||||
lists.add(uriToFileApiQ(uri));
|
||||
i++;
|
||||
}
|
||||
@@ -407,43 +528,100 @@ public class ShenQingActivity extends BaseActivity<MainViewModel, ActivityShenqi
|
||||
}
|
||||
|
||||
|
||||
private void readContacts()
|
||||
{
|
||||
Cursor cursor=null;
|
||||
private void readContacts() {
|
||||
Cursor cursor = null;
|
||||
try {
|
||||
cursor =getContentResolver().query(
|
||||
cursor = getContentResolver().query(
|
||||
ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
|
||||
null,null,null,null);
|
||||
null, null, null, null);
|
||||
while (cursor.moveToNext()) {
|
||||
int i_name=cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
|
||||
int i_name = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME);
|
||||
String displayName = cursor.getString(i_name);
|
||||
int i_number=cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
|
||||
int i_number = cursor.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER);
|
||||
String number = cursor.getString(i_number);
|
||||
// contactsList.add(displayName + "\n" + number);
|
||||
contents.add(displayName+ "," + number);
|
||||
// contents.add(displayName.substring(0,1) + "," + number.substring(0,4));
|
||||
|
||||
// contents.add("名字啦,10086");
|
||||
|
||||
LogUtils.i(displayName + " " + number);
|
||||
|
||||
}
|
||||
}catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}finally {
|
||||
if (cursor!=null)
|
||||
{
|
||||
} finally {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
public String uriToFileApiQ(Uri uri) {
|
||||
String[] proj = { MediaStore.Images.Media.DATA };
|
||||
Cursor actualimagecursor = managedQuery(uri,proj,null,null,null);
|
||||
String[] proj = {MediaStore.Images.Media.DATA};
|
||||
Cursor actualimagecursor = managedQuery(uri, proj, null, null, null);
|
||||
int actual_image_column_index = actualimagecursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
|
||||
actualimagecursor.moveToFirst();
|
||||
String img_path = actualimagecursor.getString(actual_image_column_index);
|
||||
LogUtils.i("图片地址1:"+img_path);
|
||||
LogUtils.i("图片地址1:" + img_path);
|
||||
return img_path;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传单图片
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public void uploadSigin(File file, int type, long id) {
|
||||
|
||||
MultipartBody.Builder builder = new MultipartBody.Builder();
|
||||
RequestBody requestBody = RequestBody.create(MediaType.parse("image/jpg"), file);
|
||||
builder.addFormDataPart("picture", "sign_" + System.currentTimeMillis() + ".png", requestBody);
|
||||
if (type > 1) {
|
||||
builder.addFormDataPart("id", id + "");
|
||||
}
|
||||
builder.setType(MultipartBody.FORM);
|
||||
MultipartBody multipartBody = builder.build();
|
||||
|
||||
Api.getInstance().picture(multipartBody)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<List<String>>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<List<String>> feedbackResp) {
|
||||
if (feedbackResp.data != null && feedbackResp.data.size() > 0) {
|
||||
if (type == 0) {
|
||||
id_front = feedbackResp.data.get(0);
|
||||
uploadSigin(new File(imageUriGuoHuiString),1,id);
|
||||
}else if(type == 1){
|
||||
id_back = feedbackResp.data.get(0);
|
||||
toApply();
|
||||
}else{
|
||||
if(index<files.size()){
|
||||
index++;
|
||||
uploadSigin(new File(files.get(index)),2,id);
|
||||
}else{
|
||||
changePush(true,"申请提交成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
// ToastUtils.showShort(dataBinding.loginBt, msg);
|
||||
if(type>1){
|
||||
changePush(true,"申请提交成功");
|
||||
}else {
|
||||
changePush(false, msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,15 +3,18 @@ package com.dskj.daikuan.ui.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.azhon.basic.base.BaseActivity;
|
||||
import com.dskj.daikuan.InitApp;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.bean.VideoIndexBean;
|
||||
import com.dskj.daikuan.databinding.ActivityStartUpBinding;
|
||||
|
||||
import com.dskj.daikuan.utils.ToastUtils;
|
||||
import com.dskj.daikuan.viewModel.home.MainViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -41,15 +44,28 @@ public class StartUpActivity extends BaseActivity<MainViewModel, ActivityStartUp
|
||||
@Override
|
||||
protected void initView() {
|
||||
|
||||
new Handler().postDelayed(() -> goToMainActivity(), AD_TIME_OUT);
|
||||
viewModel.getAccessToken();
|
||||
|
||||
viewModel.getTokenBeanMutableLiveData().observe(this,bean ->{
|
||||
if(bean.getExpires_in()!=-1000){
|
||||
InitApp.setToken(bean.getAccess_token());
|
||||
goToMainActivity();
|
||||
}else{
|
||||
ToastUtils.showShort(dataBinding.showBg,bean.getAccess_token());
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到主页面
|
||||
*/
|
||||
private void goToMainActivity() {
|
||||
Intent intent = new Intent(StartUpActivity.this, LoginActivity.class);
|
||||
startActivity(intent);
|
||||
if(!TextUtils.isEmpty(InitApp.getUserToken())){
|
||||
startActivity(new Intent(StartUpActivity.this, MainActivity.class));
|
||||
}else{
|
||||
startActivity(new Intent(StartUpActivity.this,LoginActivity.class));
|
||||
}
|
||||
overridePendingTransition(0,0);
|
||||
finish();
|
||||
}
|
||||
|
||||
@@ -7,14 +7,26 @@ import androidx.annotation.RequiresApi;
|
||||
import androidx.lifecycle.ViewModelProviders;
|
||||
|
||||
import com.azhon.basic.base.BaseActivity;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.api.Api;
|
||||
import com.dskj.daikuan.api.BaseObserver;
|
||||
import com.dskj.daikuan.api.Result;
|
||||
import com.dskj.daikuan.bean.ListBean;
|
||||
import com.dskj.daikuan.bean.LoanBean;
|
||||
import com.dskj.daikuan.databinding.ActivityShenqingBinding;
|
||||
import com.dskj.daikuan.databinding.ActivityXiangqingBinding;
|
||||
import com.dskj.daikuan.viewModel.home.MainViewModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
|
||||
public class XiangQingActivity extends BaseActivity<MainViewModel, ActivityXiangqingBinding> {
|
||||
|
||||
int id = 0;
|
||||
public LoanBean loanBean;
|
||||
@Override
|
||||
protected MainViewModel initViewModel() {
|
||||
return ViewModelProviders.of(this).get(MainViewModel.class);
|
||||
@@ -33,17 +45,60 @@ public class XiangQingActivity extends BaseActivity<MainViewModel, ActivityXiang
|
||||
@RequiresApi(api = Build.VERSION_CODES.Q)
|
||||
@Override
|
||||
protected void initView() {
|
||||
dataBinding.topLyF.backButton.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
dataBinding.topLyF.backButton.setOnClickListener(view -> finish());
|
||||
dataBinding.topLyF.titleTv.setText("详情");
|
||||
id = getIntent().getIntExtra("id",0);
|
||||
|
||||
|
||||
}
|
||||
@Override
|
||||
protected void initData() {
|
||||
Api.getInstance().detail(id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<LoanBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<LoanBean> feedbackResp) {
|
||||
loanBean = feedbackResp.data;
|
||||
changeInfo();
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void changeInfo() {
|
||||
dataBinding.fullnameEt.setText(loanBean.getFull_name());
|
||||
dataBinding.icEt.setText(loanBean.getIc_code());
|
||||
dataBinding.phoneNumberEt.setText(loanBean.getPhone());
|
||||
dataBinding.occupationEt.setText(loanBean.getOccupation());
|
||||
dataBinding.addressEt.setText(loanBean.getAddress());
|
||||
dataBinding.beneficiaryBankEt.setText(loanBean.getBank_name());
|
||||
dataBinding.beneficiaryAccountNoEt.setText(loanBean.getBank_code());
|
||||
dataBinding.salaryEt.setText(loanBean.getSalary());
|
||||
dataBinding.loanAmountEt.setText(loanBean.getAmount());
|
||||
dataBinding.salaryEt.setText(loanBean.getSalary());
|
||||
|
||||
Glide.with(XiangQingActivity.this).load(loanBean.getId_front()).placeholder(R.mipmap.sfzzm).error(R.mipmap.sfzzm).into(dataBinding.zhengmianIv);
|
||||
Glide.with(XiangQingActivity.this).load(loanBean.getId_back()).placeholder(R.mipmap.sfzbm).error(R.mipmap.sfzbm).into(dataBinding.fanmianIv);
|
||||
|
||||
|
||||
|
||||
dataBinding.statusTv.setTextColor(getResources().getColor(R.color.color_750000));
|
||||
if(loanBean.getStatus() == 0){
|
||||
dataBinding.statusTv.setText("审核中");
|
||||
|
||||
}else if(loanBean.getStatus() == 1){
|
||||
dataBinding.statusTv.setText("贷款成功");
|
||||
|
||||
}else if(loanBean.getStatus() == 2){
|
||||
dataBinding.statusTv.setText("申请失败");
|
||||
dataBinding.statusTv.setTextColor(getResources().getColor(R.color.color_fe8b59));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.dskj.daikuan.R;
|
||||
import com.dskj.daikuan.adapter.comm.CommonAdapter;
|
||||
import com.dskj.daikuan.adapter.comm.ViewHolder;
|
||||
import com.dskj.daikuan.bean.BankBean;
|
||||
import com.dskj.daikuan.ui.activity.MainActivity;
|
||||
import com.dskj.daikuan.ui.activity.XiangQingActivity;
|
||||
import com.dskj.daikuan.viewModel.home.SwitchVideoModel;
|
||||
@@ -35,15 +36,15 @@ public class BankListDialog extends Dialog {
|
||||
|
||||
OnListItemClickListener onNextCallListener;
|
||||
|
||||
private List<String> data;
|
||||
private List<BankBean> data;
|
||||
|
||||
public interface OnListItemClickListener {
|
||||
void onItemClick(String position);
|
||||
void onItemClick(BankBean position);
|
||||
}
|
||||
public void setOntoAlbumListener(OnListItemClickListener onNextCallListener) {
|
||||
this.onNextCallListener = onNextCallListener;
|
||||
}
|
||||
public BankListDialog(Context context,List<String > data) {
|
||||
public BankListDialog(Context context,List<BankBean> data) {
|
||||
super(context, R.style.dialog_style);
|
||||
this.mContext = context;
|
||||
this.data = data;
|
||||
@@ -58,10 +59,10 @@ public class BankListDialog extends Dialog {
|
||||
|
||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
|
||||
switchDialogList.setLayoutManager(linearLayoutManager);
|
||||
CommonAdapter commonAdapter = new CommonAdapter<String>(getContext(), R.layout.switch_video_dialog_item, data) {
|
||||
CommonAdapter commonAdapter = new CommonAdapter<BankBean>(getContext(), R.layout.switch_video_dialog_item, data) {
|
||||
@Override
|
||||
public void convert(ViewHolder holder, String s, int index) {
|
||||
holder.setText(R.id.top_name,s);
|
||||
public void convert(ViewHolder holder, BankBean s, int index) {
|
||||
holder.setText(R.id.top_name,s.getName());
|
||||
holder.getView(R.id.top_name).setOnClickListener(view -> {
|
||||
dismiss();
|
||||
if(onNextCallListener!=null){
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
/**
|
||||
* 设备码的一些东西
|
||||
* @author
|
||||
*/
|
||||
|
||||
public class GetAndroidUniqueMark {
|
||||
|
||||
public static String getUniqueId(Context context) {
|
||||
@SuppressLint("HardwareIds")
|
||||
// ANDROID_ID是设备第一次启动时产生和存储的64bit的一个数,当设备被wipe后该数重置。
|
||||
String androidID = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
@SuppressLint("HardwareIds")
|
||||
String id = androidID + Build.SERIAL; // +硬件序列号
|
||||
try {
|
||||
return toMD5(id);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
public static String toMD5(String text) throws NoSuchAlgorithmException {
|
||||
//获取摘要器 MessageDigest
|
||||
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
|
||||
//通过摘要器对字符串的二进制字节数组进行hash计算
|
||||
byte[] digest = messageDigest.digest(text.getBytes());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (int i = 0; i < digest.length; i++) {
|
||||
//循环每个字符 将计算结果转化为正整数;
|
||||
int digestInt = digest[i] & 0xff;
|
||||
//将10进制转化为较短的16进制
|
||||
String hexString = Integer.toHexString(digestInt);
|
||||
//转化结果如果是个位数会省略0,因此判断并补0
|
||||
if (hexString.length() < 2) {
|
||||
sb.append(0);
|
||||
}
|
||||
//将循环结果添加到缓冲区
|
||||
sb.append(hexString);
|
||||
}
|
||||
//返回整个结果
|
||||
return sb.toString().substring(8, 24);
|
||||
}
|
||||
|
||||
}
|
||||
115
app/src/main/java/com/dskj/daikuan/utils/NetUtil.java
Normal file
115
app/src/main/java/com/dskj/daikuan/utils/NetUtil.java
Normal file
@@ -0,0 +1,115 @@
|
||||
package com.dskj.daikuan.utils;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
public class NetUtil {
|
||||
|
||||
private NetUtil() {
|
||||
}
|
||||
|
||||
public static boolean isNetworkConnected() {
|
||||
if (AppContextUtil.getInstance() != null) {
|
||||
ConnectivityManager mConnectivityManager = (ConnectivityManager) AppContextUtil.getInstance()
|
||||
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
@SuppressLint("MissingPermission") NetworkInfo mNetworkInfo = mConnectivityManager.getActiveNetworkInfo();
|
||||
if (mNetworkInfo != null) {
|
||||
return mNetworkInfo.isAvailable();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isWifiConnected() {
|
||||
if (AppContextUtil.getInstance() != null) {
|
||||
ConnectivityManager mConnectivityManager = (ConnectivityManager) AppContextUtil.getInstance()
|
||||
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
@SuppressLint("MissingPermission") NetworkInfo mWiFiNetworkInfo = mConnectivityManager
|
||||
.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
|
||||
if (mWiFiNetworkInfo != null) {
|
||||
return mWiFiNetworkInfo.isAvailable();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isMobileConnected() {
|
||||
if (AppContextUtil.getInstance() != null) {
|
||||
ConnectivityManager mConnectivityManager = (ConnectivityManager) AppContextUtil.getInstance()
|
||||
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
@SuppressLint("MissingPermission") NetworkInfo mMobileNetworkInfo = mConnectivityManager
|
||||
.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
|
||||
if (mMobileNetworkInfo != null) {
|
||||
return mMobileNetworkInfo.isAvailable();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getConnectedType() {
|
||||
if (AppContextUtil.getInstance() != null) {
|
||||
ConnectivityManager mConnectivityManager = (ConnectivityManager) AppContextUtil.getInstance()
|
||||
.getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
@SuppressLint("MissingPermission") NetworkInfo mNetworkInfo = mConnectivityManager.getActiveNetworkInfo();
|
||||
if (mNetworkInfo != null && mNetworkInfo.isAvailable()) {
|
||||
return mNetworkInfo.getType();
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static String getRequestSign(Map<String, String> map) {
|
||||
String sb = "";
|
||||
String[] key = new String[map.size()];
|
||||
int index = 0;
|
||||
for (String k : map.keySet()) {
|
||||
key[index] = k;
|
||||
index++;
|
||||
}
|
||||
Arrays.sort(key);
|
||||
for (String s : key) {
|
||||
sb += s + "-" + map.get(s) + "|";
|
||||
}
|
||||
Log.e("-main-", sb.toString());
|
||||
System.out.println("接口参数:"+ sb);
|
||||
Log.i("XHXDEBUG","XHXDEBUG走了前缀MD5");
|
||||
return md5("d43f467088e5e43ef7f80816c065705e" + sb);
|
||||
}
|
||||
|
||||
|
||||
public static String getRequestSign(String rand_str) {
|
||||
String sb = "app_id=38923465&app_secret=EAXUfHJZKzWbwWPINQTXELYdhVBQRkVm&device_id="+rand_str;
|
||||
LogUtils.i("签名数据0:"+sb);
|
||||
return md5(sb);
|
||||
}
|
||||
|
||||
|
||||
public static String md5(String content) {
|
||||
byte[] hash;
|
||||
try {
|
||||
hash = MessageDigest.getInstance("MD5").digest(content.getBytes("UTF-8"));
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
throw new RuntimeException("NoSuchAlgorithmException", e);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
throw new RuntimeException("UnsupportedEncodingException", e);
|
||||
}
|
||||
|
||||
StringBuilder hex = new StringBuilder(hash.length * 2);
|
||||
for (byte b : hash) {
|
||||
if ((b & 0xFF) < 0x10) {
|
||||
hex.append("0");
|
||||
}
|
||||
hex.append(Integer.toHexString(b & 0xFF));
|
||||
}
|
||||
return hex.toString();
|
||||
}
|
||||
}
|
||||
@@ -10,8 +10,8 @@ import com.google.android.material.snackbar.Snackbar;
|
||||
|
||||
public class ToastUtils {
|
||||
public static void showShort(View context, String name){
|
||||
// Toast.makeText(context,name,Toast.LENGTH_SHORT).show();
|
||||
SnackbarUtils.Short(context,name).gravityFrameLayout(Gravity.TOP).show();
|
||||
Toast.makeText(context.getContext(),name,Toast.LENGTH_SHORT).show();
|
||||
// SnackbarUtils.Short(context,name).gravityFrameLayout(Gravity.TOP).show();
|
||||
// Snackbar.make(context, name, Snackbar.LENGTH_SHORT).show();
|
||||
// snackbar.show();
|
||||
}
|
||||
|
||||
@@ -10,109 +10,93 @@ import com.dskj.daikuan.api.Api;
|
||||
import com.dskj.daikuan.api.BaseObserver;
|
||||
import com.dskj.daikuan.api.Result;
|
||||
import com.dskj.daikuan.bean.ErrorMesage;
|
||||
import com.dskj.daikuan.bean.TokenBean;
|
||||
import com.dskj.daikuan.bean.UserBean;
|
||||
import com.dskj.daikuan.bean.VideoIndexBean;
|
||||
import com.dskj.daikuan.bean.VideoIndexResult;
|
||||
import com.dskj.daikuan.bean.VideoResult;
|
||||
import com.dskj.daikuan.utils.GetAndroidUniqueMark;
|
||||
import com.dskj.daikuan.utils.LogUtils;
|
||||
import com.dskj.daikuan.utils.NetUtil;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
public class MainViewModel extends BaseViewModel {
|
||||
protected MutableLiveData<TokenBean> tokenBeanMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<TokenBean> getTokenBeanMutableLiveData() {
|
||||
return tokenBeanMutableLiveData;
|
||||
}
|
||||
|
||||
protected MutableLiveData<UserBean> userBeanMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<UserBean> getUserBeanMutableLiveData() {
|
||||
return userBeanMutableLiveData;
|
||||
}
|
||||
|
||||
private MutableLiveData<ErrorMesage> errorMesageMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<ErrorMesage> getErrorMesageMutableLiveData() {
|
||||
return errorMesageMutableLiveData;
|
||||
}
|
||||
|
||||
protected MutableLiveData<List<VideoIndexBean>> videoIndexBeanMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<List<VideoIndexBean>> getVideoIndexBeanMutableLiveData() {
|
||||
return videoIndexBeanMutableLiveData;
|
||||
}
|
||||
|
||||
protected MutableLiveData<VideoResult> videoResultMutableLiveData = new MutableLiveData<>();
|
||||
|
||||
public MutableLiveData<VideoResult> getVideoResultMutableLiveData() {
|
||||
return videoResultMutableLiveData;
|
||||
}
|
||||
|
||||
public void videoIndex() {
|
||||
|
||||
Api.getInstance().videoIndex("")
|
||||
/**
|
||||
* getAccessToken
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public void getAccessToken() {
|
||||
String device_id = GetAndroidUniqueMark.getUniqueId(InitApp.getAppContext());
|
||||
String app_id = "38923465";
|
||||
String rand_str =( new Random().nextInt(900000)+100000)+"";
|
||||
// long timestamps = (System.currentTimeMillis()/1000);
|
||||
String signature = NetUtil.getRequestSign(rand_str);
|
||||
LogUtils.i("签名数据:"+signature);
|
||||
Api.getInstance().getAccessToken(app_id, signature, rand_str)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<VideoIndexResult>>() {
|
||||
.subscribe(new BaseObserver<Result<TokenBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<VideoIndexResult> feedbackResp) {
|
||||
getVideoIndexBeanMutableLiveData().postValue(feedbackResp.d.getVideo_category());
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code, msg));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void videoList(String id,String page) {
|
||||
|
||||
Api.getInstance().videoList(InitApp.getToken(),id,"video",page,"1")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<VideoResult>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<VideoResult> feedbackResp) {
|
||||
VideoResult videoResult = feedbackResp.d;
|
||||
videoResult.setCategoryId(id);
|
||||
getVideoResultMutableLiveData().postValue(videoResult);
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code, msg));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void search(String key,String page) {
|
||||
|
||||
Api.getInstance().search(InitApp.getToken(),key,"20",page,"video")
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<VideoResult>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<VideoResult> feedbackResp) {
|
||||
VideoResult videoResult = feedbackResp.d;
|
||||
videoResult.setCategoryId("999");
|
||||
getVideoResultMutableLiveData().postValue(videoResult);
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code, msg));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void videoPlay(String id) {
|
||||
|
||||
Api.getInstance().videoPlay(InitApp.getToken(),id)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result feedbackResp) {
|
||||
public void onSuccess(Result<TokenBean> feedbackResp) {
|
||||
getTokenBeanMutableLiveData().postValue(feedbackResp.data);
|
||||
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code, msg));
|
||||
getTokenBeanMutableLiveData().postValue(new TokenBean(code+"-"+msg,-1000));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*
|
||||
* @param
|
||||
*/
|
||||
public void getLogin(String phone,String password) {
|
||||
|
||||
Api.getInstance().getLogin(phone, password)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver<Result<UserBean>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(Result<UserBean> feedbackResp) {
|
||||
// getTokenBeanMutableLiveData().postValue(feedbackResp.data);
|
||||
getUserBeanMutableLiveData().postValue(feedbackResp.data);
|
||||
}
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
getErrorMesageMutableLiveData().postValue(new ErrorMesage(code,msg));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -38,39 +38,38 @@
|
||||
|
||||
<EditText
|
||||
android:id="@+id/pass_et"
|
||||
android:layout_below="@id/name_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp30"
|
||||
android:layout_marginRight="@dimen/dp30"
|
||||
android:layout_height="@dimen/dp60"
|
||||
android:layout_marginTop="26dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="textPassword"
|
||||
android:layout_below="@id/name_et"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:hint="请输入您的密码"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textColor="#ffffffff"
|
||||
android:layout_marginLeft="@dimen/dp30"
|
||||
android:layout_marginTop="26dp"
|
||||
android:layout_marginRight="@dimen/dp30"
|
||||
android:background="@mipmap/edit_false"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
android:hint="请输入您的密码"
|
||||
android:inputType="textPassword"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/invcode_et"
|
||||
android:layout_below="@id/pass_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginLeft="@dimen/dp30"
|
||||
android:layout_marginRight="@dimen/dp30"
|
||||
android:layout_height="@dimen/dp60"
|
||||
android:layout_marginTop="26dp"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="textPassword"
|
||||
android:layout_below="@id/pass_et"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:hint="请输入邀请码"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textColor="#ffffffff"
|
||||
android:layout_marginLeft="@dimen/dp30"
|
||||
android:layout_marginTop="26dp"
|
||||
android:visibility="gone"
|
||||
android:layout_marginRight="@dimen/dp30"
|
||||
android:background="@mipmap/edit_false"
|
||||
android:textSize="16sp"
|
||||
/>
|
||||
android:hint="请输入邀请码"
|
||||
android:inputType="textPassword"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="#ffffffff"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/get_code_tv"
|
||||
|
||||
@@ -96,6 +96,10 @@
|
||||
android:overScrollMode="never">
|
||||
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
<com.scwang.smart.refresh.footer.ClassicsFooter
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:srlAccentColor="@color/color_e12d48" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
|
||||
|
||||
@@ -20,62 +20,65 @@
|
||||
<include
|
||||
android:id="@+id/top_ly_f"
|
||||
layout="@layout/layout_action_bar1" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_below="@id/top_ly_f">
|
||||
android:layout_below="@id/top_ly_f"
|
||||
android:overScrollMode="never">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="@dimen/dp35"
|
||||
android:paddingRight="@dimen/dp35"
|
||||
android:paddingTop="@dimen/dp15"
|
||||
android:orientation="vertical">
|
||||
android:paddingRight="@dimen/dp35">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:text="姓名/Full Name:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/fullname_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:text="大马卡/IC:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/ic_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:paddingLeft="10dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -169,88 +172,87 @@
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:text="电话号码/Phone number:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/phone_number_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:inputType="phone"
|
||||
android:singleLine="true"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:inputType="phone"
|
||||
android:paddingLeft="10dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:text="职业/Occupation:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/occupation_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:text="地址/Address:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/address_et"
|
||||
android:layout_width="match_parent"
|
||||
android:minHeight="@dimen/dp44"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:minHeight="@dimen/dp44"
|
||||
android:paddingLeft="10dp"
|
||||
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:text="收款银行/Beneficiary Bank:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
>
|
||||
android:layout_marginTop="@dimen/dp4">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/beneficiary_bank_et"
|
||||
@@ -258,91 +260,93 @@
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingLeft="10dp"
|
||||
android:hint="请选择银行"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp44"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:src="@mipmap/select_img"
|
||||
android:layout_alignParentRight="true"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_alignParentRight="true" />
|
||||
android:src="@mipmap/select_img" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:text="户口号码 /Beneficiary Account No:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/beneficiary_account_no_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:inputType="number"
|
||||
android:paddingLeft="10dp"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:text="薪水/salary:"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/salary_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:inputType="number"
|
||||
android:paddingLeft="10dp"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp12"
|
||||
android:layout_marginTop="@dimen/dp15"
|
||||
android:text="贷款金额/Loan amount :"
|
||||
android:textColor="#ff959595"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/loan_amount_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:background="@drawable/inputbg_false"
|
||||
android:inputType="number"
|
||||
android:paddingLeft="10dp"
|
||||
android:singleLine="true"
|
||||
android:inputType="number"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"/>
|
||||
android:layout_height="120dp" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
@@ -32,30 +32,49 @@
|
||||
android:paddingRight="@dimen/dp35"
|
||||
android:paddingTop="@dimen/dp15"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.appcompat.widget.LinearLayoutCompat
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:orientation="vertical"
|
||||
android:background="@mipmap/top_bg">
|
||||
android:background="@mipmap/top_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fullname_et"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="张启山"
|
||||
android:layout_marginLeft="@dimen/dp20"
|
||||
android:layout_marginTop="20dp"
|
||||
android:id="@+id/fullname_et"
|
||||
android:text="张启山"
|
||||
android:textColor="#ffffffff"
|
||||
android:textSize="30sp"
|
||||
/>
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="30sp" />
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="@dimen/dp20"
|
||||
android:text="姓名/Full Name:"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp2"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginLeft="@dimen/dp20"
|
||||
android:text="姓名/Full Name"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp" />
|
||||
<TextView
|
||||
android:id="@+id/status_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@id/name_tv"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="17dp"
|
||||
android:text="贷款审批中"
|
||||
android:textColor="#ff750000"
|
||||
android:textSize="13sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
@@ -74,6 +93,7 @@
|
||||
android:id="@+id/ic_et"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
@@ -174,6 +194,7 @@
|
||||
android:layout_marginTop="@dimen/dp4"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:inputType="phone"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:textColor="@color/black"
|
||||
@@ -198,6 +219,7 @@
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
@@ -220,6 +242,7 @@
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
@@ -245,12 +268,14 @@
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
<ImageView
|
||||
android:layout_width="@dimen/dp44"
|
||||
android:layout_height="@dimen/dp44"
|
||||
android:visibility="gone"
|
||||
android:src="@mipmap/select_img"
|
||||
android:scaleType="centerInside"
|
||||
android:layout_alignParentRight="true" />
|
||||
@@ -275,6 +300,7 @@
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
@@ -297,6 +323,7 @@
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
@@ -319,6 +346,7 @@
|
||||
android:background="@drawable/inputbg"
|
||||
android:paddingLeft="10dp"
|
||||
android:inputType="number"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/black"
|
||||
android:textColorHint="@color/color_e6000000"
|
||||
android:textSize="13sp" />
|
||||
@@ -331,11 +359,12 @@
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="100dp"
|
||||
android:visibility="gone"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_height="100dp">
|
||||
android:gravity="center_horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/login_bt"
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="17dp"
|
||||
android:layout_marginTop="9dp"
|
||||
android:text="代收账金额 第11期"
|
||||
android:text="贷款金额"
|
||||
android:textColor="#80ffffff"
|
||||
android:textSize="13sp" />
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="9dp"
|
||||
android:layout_marginRight="17dp"
|
||||
android:text="代收账金额 第11期"
|
||||
android:text="贷款日期:2023.02.02"
|
||||
android:textColor="#80ffffff"
|
||||
android:textSize="13sp" />
|
||||
|
||||
@@ -51,14 +51,13 @@
|
||||
android:id="@+id/status_tv"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_below="@id/name_tv"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="@dimen/dp12"
|
||||
android:layout_marginRight="17dp"
|
||||
android:text="贷款审批中"
|
||||
android:textColor="#ff750000"
|
||||
android:textSize="13sp"
|
||||
/>
|
||||
android:textSize="13sp" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
@@ -71,7 +71,7 @@
|
||||
<color name="color_search_2">#EEEEEE</color>
|
||||
<color name="color_search_1">#DDDDDD</color>
|
||||
<color name="color_e12d48">#E12D48</color>
|
||||
|
||||
<color name="color_750000">#750000</color>
|
||||
<color name="success_stroke_color">#E12D48</color>
|
||||
<color name="trans_success_stroke_color">#E12D48</color>
|
||||
<color name="blue_btn_bg_color">#E12D48</color>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">贷款</string>
|
||||
<string name="app_name">记账</string>
|
||||
|
||||
<string name="file_permission_font_txt">文件权限已禁用</string>
|
||||
<string name="locat_permission_font_txt">定位权限已禁用</string>
|
||||
|
||||
Reference in New Issue
Block a user