修改13日的bug

This commit is contained in:
md
2021-08-13 15:39:41 +08:00
parent 3863f6e1ad
commit 2f3b1cbeae
54 changed files with 168 additions and 129 deletions

View File

@@ -42,6 +42,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
private Button btnLogin;
private SharedPreferences navInfo;
private SharedPreferences.Editor navInfoEditor;
private TextView tvStatement;
@Override
public void onStart() {
@@ -51,6 +52,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
}
}
@Override
protected int getLayout() {
return R.layout.activity_login;
@@ -64,12 +66,13 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
@Subscribe
public void onEvent(Message data) {
if (data.what == Constant.REGISTER_WORD) {
if ((boolean)data.obj){
etLoginName.setText(Constant.USER_NAME);
etLoginPaw.setText(Constant.PASS_WORD);
if ((boolean) data.obj) {
etLoginName.setText(Constant.USER_NAME);
etLoginPaw.setText(Constant.PASS_WORD);
}
}
}
@Override
protected void initView() {
super.initView();
@@ -77,19 +80,21 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
navInfo = getSharedPreferences("navInfo", Context.MODE_PRIVATE);
tvRegister = findViewById(R.id.tv_register);
etLoginName = findViewById(R.id.et_login_name);
etLoginPaw = findViewById(R.id.et_login_paw);
etLoginPaw = findViewById(R.id.et_login_paw);
tvForgetPaw = findViewById(R.id.tv_forget_paw);
btnLogin = findViewById(R.id.btn_login);
btnLogin = findViewById(R.id.btn_login);
btnLogin.setOnClickListener(this::onClick);
tvStatement = findViewById(R.id.tv_statement);
tvStatement.setOnClickListener(this::onClick);
tvRegister.setOnClickListener(this);
tvForgetPaw.setOnClickListener(this);
String user_name = navInfo.getString("user_name", null);
if (user_name!=null&&!user_name.equals("")){
if (user_name != null && !user_name.equals("")) {
etLoginName.setText(user_name);
}
String pass_word = navInfo.getString("pass_word", null);
if (pass_word!=null&&!pass_word.equals("")){
etLoginPaw.setText(pass_word);
if (pass_word != null && !pass_word.equals("")) {
etLoginPaw.setText(pass_word);
}
}
@@ -108,16 +113,20 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
break;
case R.id.btn_login:
String name = etLoginName.getText().toString().trim();
if (name == null||name.equals("")) {
if (name == null || name.equals("")) {
Toast.makeText(this, "请输入账号", Toast.LENGTH_SHORT).show();
return;
}
String paw = etLoginPaw.getText().toString().trim();
if (paw == null||paw.equals("")) {
if (paw == null || paw.equals("")) {
Toast.makeText(this, "请输入密码", Toast.LENGTH_SHORT).show();
return;
}
initLogIn(name,paw);
initLogIn(name, paw);
break;
case R.id.tv_statement:
break;
}
}
@@ -125,11 +134,11 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
private void initLogIn(String name, String paw) {
try {
HttpParams httpParams = new HttpParams();
httpParams.put("username",name);
long time=System.currentTimeMillis();
httpParams.put("password",Base64.desEncrypt(time + Md5Util.toMD5(paw)));
httpParams.put("grant_type","password");
httpParams.put("datetime",time);
httpParams.put("username", name);
long time = System.currentTimeMillis();
httpParams.put("password", Base64.desEncrypt(time + Md5Util.toMD5(paw)));
httpParams.put("grant_type", "password");
httpParams.put("datetime", time);
showLoadingDialog();
OkGoBuilder.getInstance().Builder(this)
.url(HttpInterface.USER_LOGIN_OAUTH_TOKEN)
@@ -140,31 +149,33 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
public void onSuccess(LoginOauthTokenBean response, int id) {
dismissLoadingDialog();
if (response.getCode()==200){
if (response.getCode() == 200) {
LoginOauthTokenBean.BodyBean body = response.getBody();
navInfoEditor.putString("access_token",body.getAccess_token());
navInfoEditor.putString("refresh_token",body.getRefresh_token());
navInfoEditor.putString("userId",body.getUserId());
navInfoEditor.putString("access_token", body.getAccess_token());
navInfoEditor.putString("refresh_token", body.getRefresh_token());
navInfoEditor.putString("userId", body.getUserId());
navInfoEditor.commit();
if (body.getUserId()!=null&&!body.getUserId().equals("")){
if (body.getUserId() != null && !body.getUserId().equals("")) {
Constant.initRootFolder(body.getUserId());
}
Constant.ACCESS_TOKEN=body.getAccess_token();
Constant.REFRESH_TOKEN=body.getRefresh_token();
Constant.USERID=body.getUserId();
Constant.PASS_WORD=paw;
Constant.ACCESS_TOKEN = body.getAccess_token();
Constant.REFRESH_TOKEN = body.getRefresh_token();
Constant.USERID = body.getUserId();
Constant.PASS_WORD = paw;
initGetUserInfo();//获取用户信息
Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
}else {
Toast.makeText(LoginActivity.this, "登录成功", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(LoginActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
dismissLoadingDialog();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
Toast.makeText(LoginActivity.this, e.getMessage()+"", Toast.LENGTH_SHORT).show();
Toast.makeText(LoginActivity.this, e.getMessage() + "", Toast.LENGTH_SHORT).show();
}
});
} catch (Exception e) {
@@ -183,50 +194,50 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
@Override
public void onSuccess(UserDetailBean response, int id) {
dismissLoadingDialog();
if (response.getCode()==200){
if (response.getCode() == 200) {
UserDetailBean.BodyBean body = response.getBody();
if (body!=null){
navInfoEditor.putString("username",body.getUsername());
Constant.USER_NAME=body.getUsername();
navInfoEditor.putString("mobile",body.getMobile());
Constant.MOBILE=body.getMobile();
navInfoEditor.putInt("sex",body.getSex());//0:女 1
Constant.SEX=body.getSex();
navInfoEditor.putString("qq",body.getQq());
Constant.QQ=body.getQq();
navInfoEditor.putString("wechat",body.getWechat());
Constant.WECHAT=body.getWechat();
if (body != null) {
navInfoEditor.putString("username", body.getUsername());
Constant.USER_NAME = body.getUsername();
navInfoEditor.putString("mobile", body.getMobile());
Constant.MOBILE = body.getMobile();
navInfoEditor.putInt("sex", body.getSex());//0:女 1
Constant.SEX = body.getSex();
navInfoEditor.putString("qq", body.getQq());
Constant.QQ = body.getQq();
navInfoEditor.putString("wechat", body.getWechat());
Constant.WECHAT = body.getWechat();
UserDetailBean.BodyBean.UserBankcardBean userBankcard = body.getUserBankcard();
if (userBankcard!=null){//存储银行卡信息
navInfoEditor.putString("bankAccount",userBankcard.getBankAccount());//银行卡编号
Constant.BANKACCOUNT=userBankcard.getBankAccount();
navInfoEditor.putString("idNumber",userBankcard.getIdNumber());//银行卡账号
Constant.ID_NUMBER=userBankcard.getIdNumber();
if (userBankcard != null) {//存储银行卡信息
navInfoEditor.putString("bankAccount", userBankcard.getBankAccount());//银行卡编号
Constant.BANKACCOUNT = userBankcard.getBankAccount();
navInfoEditor.putString("idNumber", userBankcard.getIdNumber());//银行卡账号
Constant.ID_NUMBER = userBankcard.getIdNumber();
}
UserDetailBean.BodyBean.UserAuthBean userAuth = body.getUserAuth();
if (userAuth!=null){//存储身份证信息
navInfoEditor.putString("name",userAuth.getName());//身份证姓名
Constant.NAME=userAuth.getName();
navInfoEditor.putString("idnum",userAuth.getIdnum());//身份证号码
Constant.ID_NUM=userAuth.getIdnum();
navInfoEditor.putInt("auditstatus",userAuth.getAuditstatus());//审核状态
Constant.AUDITSTATUS=userAuth.getAuditstatus();
navInfoEditor.putString("auditmsg",userAuth.getAuditmsg());//审核信息
Constant.AUDITMSG=userAuth.getAuditmsg();
if (userAuth != null) {//存储身份证信息
navInfoEditor.putString("name", userAuth.getName());//身份证姓名
Constant.NAME = userAuth.getName();
navInfoEditor.putString("idnum", userAuth.getIdnum());//身份证号码
Constant.ID_NUM = userAuth.getIdnum();
navInfoEditor.putInt("auditstatus", userAuth.getAuditstatus());//审核状态
Constant.AUDITSTATUS = userAuth.getAuditstatus();
navInfoEditor.putString("auditmsg", userAuth.getAuditmsg());//审核信息
Constant.AUDITMSG = userAuth.getAuditmsg();
}
navInfoEditor.commit();
}
Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
startActivity(intent);
finish();
}else {
} else {
Toast.makeText(LoginActivity.this, response.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
dismissLoadingDialog();
Toast.makeText(LoginActivity.this, e.getMessage(), Toast.LENGTH_SHORT).show();
}
});
@@ -238,6 +249,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
public void onConfigurationChanged(@NonNull Configuration newConfig) {
super.onConfigurationChanged(newConfig);
}
@Override
public void onDestroy() {
if (EventBus.getDefault().isRegistered(this))//加上判断

View File

@@ -0,0 +1,16 @@
package com.navinfo.outdoor.activity;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import com.navinfo.outdoor.R;
public class StatementActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_statement);
}
}

View File

@@ -48,6 +48,7 @@ public class PoiTaskAdapter extends RecyclerView.Adapter<PoiTaskAdapter.ViewHold
}else if (listBean.getAuditStatus() == -1){
holder.tvAuditStatus.setText("待审核");
}
holder.tvMany.setText("¥0.0");
}

View File

@@ -37,6 +37,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
private ImageView ivEvaluationTaskFinish;
private XRecyclerView capacityEvaluationRecycler;
private CapacityEvaluationAdapter capacityEvaluationAdapter;
private int capacityPage = 1;
public static CapacityEvaluationFragment newInstance(Bundle bundle) {
@@ -61,8 +62,8 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
capacityEvaluationRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
capacityEvaluationRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
//取消上拉加载,刷新功能
capacityEvaluationRecycler.setPullRefreshEnabled(false);
capacityEvaluationRecycler.setLoadingMoreEnabled(false);
// capacityEvaluationRecycler.setPullRefreshEnabled(false);
// capacityEvaluationRecycler.setLoadingMoreEnabled(false);
capacityEvaluationAdapter = new CapacityEvaluationAdapter(getActivity());
capacityEvaluationRecycler.setAdapter(capacityEvaluationAdapter);
capacityEvaluationRecycler.getDefaultFootView().setNoMoreHint("加载成功");
@@ -97,8 +98,8 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
private void initNewWork() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1");
httpParams.put("pageNum", "1");
httpParams.put("fid", "4");
httpParams.put("pageNum", capacityPage);
httpParams.put("pageSize", "10");
OkGoBuilder.getInstance()
.Builder(getActivity())
@@ -111,6 +112,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
public void onSuccess(TaskPrefectureBean response, int id) {
dismissLoadingDialog();
capacityEvaluationAdapter.setCapacityList(response.getBody().getList());
capacityPage++;
Log.d("TAG", "onSuccess: " + response.getMessage() + "sssssssssssss");
}

View File

@@ -38,6 +38,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
private XRecyclerView eventRecycler;
private List<TaskPrefectureBean.BodyBean.ListBean> taskExplainBean;
private EventPrefectureAdapter eventPrefectureAdapter;
private int eventPage = 1;
public static EventPrefectureFragment newInstance(Bundle bundle) {
@@ -63,12 +64,12 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
private void initNetwork() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1");
httpParams.put("pageNum", "1");
httpParams.put("pageSize", "10");
httpParams.put("fid", "2");
httpParams.put("pageNum", eventPage);
httpParams.put("pageSize", "20");
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.MSG_LISt)
.url(HttpInterface.LIST_EVENT)
.cls(TaskPrefectureBean.class)
.params(httpParams)
.token(Constant.ACCESS_TOKEN)
@@ -78,6 +79,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
dismissLoadingDialog();
eventPrefectureAdapter.setDataBeans(taskPrefectureBean.getBody().getList());
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage() + "sssssssssssss");
eventPage++;
//initEventPrefecture(eventPrefectureBean,b);
}
@@ -142,8 +144,8 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
eventRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
eventRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
//取消上拉加载,刷新功能。
eventRecycler.setPullRefreshEnabled(false);
eventRecycler.setLoadingMoreEnabled(false);
// eventRecycler.setPullRefreshEnabled(false);
// eventRecycler.setLoadingMoreEnabled(false);
eventPrefectureAdapter = new EventPrefectureAdapter(getActivity());
eventRecycler.setAdapter(eventPrefectureAdapter);
eventRecycler.getDefaultFootView().setNoMoreHint("已全部加载完毕");

View File

@@ -87,7 +87,7 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
private void initNetwork() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1");
httpParams.put("fid", "5");
httpParams.put("pageNum", "1");
httpParams.put("pageSize", "10");
OkGoBuilder.getInstance()

View File

@@ -77,9 +77,9 @@ public class PoiTaskFragment extends BaseFragment implements View.OnClickListene
ivPoiTaskFinish.setOnClickListener(this::onClick);
poiTaskXrv = (XRecyclerView) findViewById(R.id.poiTask_xrv);
poiTaskXrv.setLayoutManager(new LinearLayoutManager(getActivity()));
poiTaskXrv.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
poiTaskXrv.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
poiTaskXrv.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
poiTaskXrv.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.VERTICAL));
poiTaskXrv.setLoadingListener(new XRecyclerView.LoadingListener() {
@Override
public void onRefresh() {

View File

@@ -35,6 +35,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
private XRecyclerView taskExplainRecycle;
private TaskExplainAdapter taskExplainAdapter;
private int taskPage = 1;
public static TaskExplainFragment newInstance(Bundle bundle) {
@@ -62,8 +63,8 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
taskExplainRecycle.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
taskExplainRecycle.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
//取消上啦加载下拉刷新
taskExplainRecycle.setPullRefreshEnabled(false);
taskExplainRecycle.setLoadingMoreEnabled(false);
// taskExplainRecycle.setPullRefreshEnabled(false);
// taskExplainRecycle.setLoadingMoreEnabled(false);
taskExplainAdapter = new TaskExplainAdapter(getActivity());
taskExplainRecycle.setAdapter(taskExplainAdapter);
taskExplainRecycle.getDefaultFootView().setNoMoreHint("加载完毕");
@@ -98,12 +99,12 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
private void initNetWork() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1");
httpParams.put("pageNum", "1");
httpParams.put("pageSize", "10");
httpParams.put("fid", "3");
httpParams.put("pageNum", taskPage);
httpParams.put("pageSize", "20");
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.MSG_LISt)
.url(HttpInterface.LIST_TASK_EXPLAIN)
.cls(TaskPrefectureBean.class)
.params(httpParams)
.token(Constant.ACCESS_TOKEN)
@@ -112,6 +113,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
public void onSuccess(TaskPrefectureBean response, int id) {
dismissLoadingDialog();
taskExplainAdapter.setExplainList(response.getBody().getList());
taskPage++;
Log.d("TAG", "onSuccess: " + response.getMessage() + "");
}

View File

@@ -39,6 +39,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
private XRecyclerView taskRecycler;
private List<TaskPrefectureBean.BodyBean.ListBean> dataBeanList;
private TaskPrefectureAdapter taskPrefectureAdapter;
private int taskPage = 1;
public static TaskPrefectureFragment newInstance(Bundle bundle) {
@@ -63,8 +64,8 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
taskRecycler.setRefreshProgressStyle(ProgressStyle.BallSpinFadeLoader);
taskRecycler.setLoadingMoreProgressStyle(ProgressStyle.BallRotate);
//取消上拉加载,刷新功能。
taskRecycler.setPullRefreshEnabled(false);
taskRecycler.setLoadingMoreEnabled(false);
// taskRecycler.setPullRefreshEnabled(false);
// taskRecycler.setLoadingMoreEnabled(false);
taskPrefectureAdapter = new TaskPrefectureAdapter(getActivity());
taskRecycler.setAdapter(taskPrefectureAdapter);
taskRecycler.getDefaultFootView().setNoMoreHint("已全部加载完毕");
@@ -100,11 +101,11 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1");
httpParams.put("pageNum", "1");
httpParams.put("pageNum", taskPage);
httpParams.put("pageSize", "20");
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.MSG_LISt)
.url(HttpInterface.LIST_TASK)
.cls(TaskPrefectureBean.class)
.params(httpParams)
.token(Constant.ACCESS_TOKEN)
@@ -113,6 +114,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
public void onSuccess(TaskPrefectureBean taskPrefectureBean, int id) {
dismissLoadingDialog();
taskPrefectureAdapter.setDataBeans(taskPrefectureBean.getBody().getList());
taskPage++;
Log.d("TAG", "onSuccess: " + taskPrefectureBean.getMessage() + "");
//initTaskSpecification(taskSpecificationBean,start);
}

View File

@@ -598,7 +598,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
otherMarker.setClickable(true);
break;
case 6://面状任务
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bg);
BitmapDescriptor Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_bg1);
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f)
.flat(true)
.clockwise(false));
@@ -707,7 +707,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
} else if (poiEntity.getType() == 5) {
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_bag);
} else if (poiEntity.getType() == 6) {
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bag);
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_bag);
}
if (bigMarker == null) {
bigMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(descriptor).alpha(0.9f)
@@ -901,9 +901,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
case 6://面状任务
BitmapDescriptor Descriptor = null;
if (poiEntity.getTaskStatus() == 1) {
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.poi_video_bg);
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_facet_bg1);
} else {
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_other_have_bag);
Descriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayfacet);
}
Marker planarMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(Descriptor).alpha(0.9f)
.clockwise(false)