添加"我的"页面提现的接口和添加充电桩的禁用

This commit is contained in:
md 2021-07-02 18:27:18 +08:00
parent c6a76059ae
commit 08fa1cf3bd
26 changed files with 658 additions and 131 deletions

View File

@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion '29.0.2'
// ndkVersion '23.0.7123448'
//ndkVersion '23.0.7123448'
defaultConfig {
applicationId "com.navinfo.outdoor"
@ -52,6 +52,7 @@ dependencies {
implementation 'androidx.navigation:navigation-ui:2.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation files('libs\\jts-1.13.jar')
implementation files('libs\\jts-1.13.jar')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

View File

@ -61,7 +61,6 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
private String usermailbox;
@Override
protected int getLayout() {
return R.layout.activity_user;
@ -126,23 +125,28 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
userphone = etPhone.getText().toString().trim();
userqq = etQq.getText().toString().trim();
usermailbox = etMailbox.getText().toString().trim();
boolean isQQNum_matcher = userqq.matches("[1-9]\\d{4,10}");
boolean isQQNum_matcher = userqq.matches("[1-9][0-9]{4,14}");
// 邮箱匹配结果
boolean isEmail_matcher = usermailbox.matches("^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$");
//
boolean isEmail_matcher = usermailbox.matches( "^[\\w-\\+]+(\\.[\\w]+)*@[\\w-]+(\\.[\\w]+)*(\\.[a-z]{2,})$");
//&& userqq.length() < 11 && userqq.length() > 5
if (TextUtils.isEmpty(userphone) || TextUtils.isEmpty(userqq) || TextUtils.isEmpty(usermailbox)) {
if (!RegexUtil.isPhone(userphone)) {
Toast.makeText(this, "手机号输入错误", Toast.LENGTH_SHORT).show();
return;
}
if (isQQNum_matcher && userqq.length() < 11 && userqq.length() > 5) {
Toast.makeText(this, "QQ号输入错误", Toast.LENGTH_SHORT).show();
if (!userqq.equals("")) {
if (!isQQNum_matcher) {
Toast.makeText(this, "QQ号输入错误", Toast.LENGTH_SHORT).show();
}
return;
}
if (isEmail_matcher) {
Toast.makeText(this, "邮箱格式错误", Toast.LENGTH_SHORT).show();
if (!usermailbox.equals("")){
if (!isEmail_matcher) {
Toast.makeText(this, "邮箱格式错误", Toast.LENGTH_SHORT).show();
}
return;
}
}
netWork();
break;
@ -150,7 +154,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
}
private void netWork() {
showLoadingDialog();
OkGo
// 请求方式和请求url
.<UserBean>post(HttpInterface.USER_UPDATE)

View File

@ -73,7 +73,7 @@ public abstract class BaseActivity extends AppCompatActivity {
return false;
});
//loading样式
View view = LayoutInflater.from(this).inflate(R.layout.loading, null);
View view = LayoutInflater.from(this).inflate(R.layout.loading, null);
alertDialog.setView(view);
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();

View File

@ -18,6 +18,7 @@ import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import com.navinfo.outdoor.R;
import com.kongzue.dialog.interfaces.OnBackClickListener;
import com.kongzue.dialog.v3.WaitDialog;
import com.navinfo.outdoor.R;
@ -72,15 +73,16 @@ public abstract class BaseFragment extends Fragment implements FragmentBackHandl
});
//loading样式
View view = LayoutInflater.from(getActivity()).inflate(R.layout.loading, null);
View view = LayoutInflater.from(getContext()).inflate(R.layout.loading, null);
alertDialog.setView(view);
alertDialog.setCanceledOnTouchOutside(false);
alertDialog.show();
}
public void setLoadingDialogText(String s) {
//给loading 添加文字
TextView view = alertDialog.findViewById(R.id.progressBar_tx);
TextView view = alertDialog.findViewById(R.id.progressBar_tx);
view.setText(s);
}

View File

@ -0,0 +1,161 @@
package com.navinfo.outdoor.bean;
public class GetPriceBean {
private Integer code;
private String message;
private BodyBean body;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public BodyBean getBody() {
return body;
}
public void setBody(BodyBean body) {
this.body = body;
}
public static class BodyBean {
private Double userPrice;
private Double canExchangePrice;
private Double freezingPrice;
private Double haveExchangePrice;
private Double rewardPrice;
private Double poiPushPrice;
private Double poiNonepushPrice;
private Double roadPushPrice;
private Double roadNonepushPrice;
private Double csPushPrice;
private Double csNonepushPrice;
private Double otherPushPrice;
private Double otherNonepushPrice;
private Double leaderPrice;
public Double getUserPrice() {
return userPrice;
}
public void setUserPrice(Double userPrice) {
this.userPrice = userPrice;
}
public Double getCanExchangePrice() {
return canExchangePrice;
}
public void setCanExchangePrice(Double canExchangePrice) {
this.canExchangePrice = canExchangePrice;
}
public Double getFreezingPrice() {
return freezingPrice;
}
public void setFreezingPrice(Double freezingPrice) {
this.freezingPrice = freezingPrice;
}
public Double getHaveExchangePrice() {
return haveExchangePrice;
}
public void setHaveExchangePrice(Double haveExchangePrice) {
this.haveExchangePrice = haveExchangePrice;
}
public Double getRewardPrice() {
return rewardPrice;
}
public void setRewardPrice(Double rewardPrice) {
this.rewardPrice = rewardPrice;
}
public Double getPoiPushPrice() {
return poiPushPrice;
}
public void setPoiPushPrice(Double poiPushPrice) {
this.poiPushPrice = poiPushPrice;
}
public Double getPoiNonepushPrice() {
return poiNonepushPrice;
}
public void setPoiNonepushPrice(Double poiNonepushPrice) {
this.poiNonepushPrice = poiNonepushPrice;
}
public Double getRoadPushPrice() {
return roadPushPrice;
}
public void setRoadPushPrice(Double roadPushPrice) {
this.roadPushPrice = roadPushPrice;
}
public Double getRoadNonepushPrice() {
return roadNonepushPrice;
}
public void setRoadNonepushPrice(Double roadNonepushPrice) {
this.roadNonepushPrice = roadNonepushPrice;
}
public Double getCsPushPrice() {
return csPushPrice;
}
public void setCsPushPrice(Double csPushPrice) {
this.csPushPrice = csPushPrice;
}
public Double getCsNonepushPrice() {
return csNonepushPrice;
}
public void setCsNonepushPrice(Double csNonepushPrice) {
this.csNonepushPrice = csNonepushPrice;
}
public Double getOtherPushPrice() {
return otherPushPrice;
}
public void setOtherPushPrice(Double otherPushPrice) {
this.otherPushPrice = otherPushPrice;
}
public Double getOtherNonepushPrice() {
return otherNonepushPrice;
}
public void setOtherNonepushPrice(Double otherNonepushPrice) {
this.otherNonepushPrice = otherNonepushPrice;
}
public Double getLeaderPrice() {
return leaderPrice;
}
public void setLeaderPrice(Double leaderPrice) {
this.leaderPrice = leaderPrice;
}
}
}

View File

@ -0,0 +1,23 @@
package com.navinfo.outdoor.bean;
public class UserPriceExchangeBean {
private Integer code;
private String message;
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}

View File

@ -92,6 +92,7 @@ public class CapacityEvaluationFragment extends BaseFragment implements View.OnC
}
private void initNewWork() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid","1");
httpParams.put("pageNum","1");

View File

@ -84,6 +84,7 @@ public class CapacityEvaluationFragment2 extends BaseFragment implements View.On
}
private void initNetWorks(boolean b) {
showLoadingDialog();
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.MSG_LISt)

View File

@ -88,6 +88,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
}
private void initNetWorks(boolean b) {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("id", "11");
OkGoBuilder.getInstance()
@ -180,6 +181,7 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
}
private void initExamSubmit() throws JSONException {
showLoadingDialog();
Map<String, Object> map = new HashMap<>();
map.put("examId",examId);
map.put("answerList",examBeans);
@ -225,45 +227,5 @@ public class CapacityMeasurementFragment extends BaseFragment implements View.On
Log.d("TAG", "onError: " + response.message());
}
});
// OkGoBuilder.getInstance()
// .Builder(getActivity())
// .url(HttpInterface.EXAM_SUBMIT)
// .method(OkGoBuilder.POST)
// .cls(ExamSubmitBean.class)
// .json(json)
// .callback(new Callback<ExamSubmitBean>() {
// @Override
// public void onSuccess(ExamSubmitBean response, int id) {
// dismissLoadingDialog();
// Log.d("TAG", "onSuccess: " + response.toString() + "sssssssssssss");
// if (response.getBody().equals("0")) {
// MessageDialog.show((AppCompatActivity) getActivity(), "提示", "不通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
// @Override
// public boolean onClick(BaseDialog baseDialog, View v) {
// // Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
// return false;
// }
// });
// } else {
// MessageDialog.show((AppCompatActivity) getActivity(), "提示", "通过", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
// @Override
// public boolean onClick(BaseDialog baseDialog, View v) {
// // Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
// return false;
// }
// });
// }
//
// //Toast.makeText(getActivity(), response.getMsg() + "", Toast.LENGTH_SHORT).show();
// }
//
// @Override
// public void onError(Throwable e, int id) {
// dismissLoadingDialog();
// Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_SHORT).show();
// Log.d("TAG", "onError: " + e.getMessage());
// }
// }).build();
}
}

View File

@ -507,8 +507,25 @@ public class ChargingPileFragment extends BaseDrawerFragment implements View.OnC
private void disables() {
checkBoxLife.setEnabled(false);
editNameContent.setEnabled(false);
editDescribe.setEnabled(false);
btnSaveLocal.setEnabled(false);
checkButton1.setEnabled(false);//开放状态1
checkButton2.setEnabled(false);//开放状态2
checkButton3.setEnabled(false);//开放状态3
checkButton4.setEnabled(false);//开放状态4
checkButton5.setEnabled(false);//开放状态5
checkButton6.setEnabled(false);//开放状态6
spinnerType.setEnabled(false);//充电地面层
rlPanorama.setEnabled(false);//全景照片
rlCoding.setEnabled(false);//充电桩编码
spinnerScutcheon.setEnabled(false);//设备标牌下拉框
rlEquipment.setEnabled(false);//(蓝色色)设备标牌
rlFacility.setEnabled(false);//(白色)设备标牌
spinnerStake.setEnabled(false);//桩可用状态
rlUsable.setEnabled(false);//(蓝色)可用状态
rlAvailable.setEnabled(false);//(白色)可用状态
rlParking.setEnabled(false);//(蓝色)停车位编号
rlNumber.setEnabled(false);//(白色)停车位编号
editDescribe.setEnabled(false);//任务描述
btnSaveLocal.setEnabled(false);//保存
}
@Override

View File

@ -429,6 +429,7 @@ public class ChargingStationFragment extends BaseDrawerFragment implements View.
ivElse.setEnabled(false);
editDescribe.setEnabled(false);
btnSaveLocal.setEnabled(false);
linearChargingPile.setEnabled(false);
}
@Override

View File

@ -60,6 +60,7 @@ public class EventPrefectureFragment extends BaseFragment implements View.OnClic
}
private void initNetwork() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1");
httpParams.put("pageNum", "1");

View File

@ -154,13 +154,13 @@ public class GatheringFragment extends BaseFragment implements View.OnClickListe
}
private void gatheringNetWork() {
showLoadingDialog();
gatheringList = new ArrayList<>();
File gatheringFile = new File(gatheringPath);
if (!gatheringFile.exists()) {
Toast.makeText(getContext(), "身份证照片不能为空", Toast.LENGTH_SHORT).show();
return;
}
gatheringList.add(gatheringFile);
String etBankAccount = etBankNum.getText().toString().trim();
if (etBankAccount == null || etBankAccount.equals("")) {

View File

@ -56,6 +56,7 @@ public class IssueFragment extends BaseFragment implements View.OnClickListener
}
private void initNetWork(boolean b) {
showLoadingDialog();
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.listTaskExplain)

View File

@ -70,6 +70,7 @@ public class MessageFragment extends BaseFragment implements View.OnClickListene
});
}
private void initNetwork() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1");
httpParams.put("pageNum", "1");

View File

@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
@ -16,6 +17,11 @@ import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.activity.UserActivity;
import com.navinfo.outdoor.base.BaseFragment;
import com.navinfo.outdoor.bean.GetPriceBean;
import com.navinfo.outdoor.bean.MeasureBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
/**
* 我的Fragment
@ -70,6 +76,33 @@ public class MineFragment extends BaseFragment implements View.OnClickListener{
rlAbout.setOnClickListener(this::onClick);
btnQuit = findViewById(R.id.btn_quit);
btnQuit.setOnClickListener(this::onClick);
initNetWork();
}
private void initNetWork() {
showLoadingDialog();
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.GET_PRICE)
.method(OkGoBuilder.GET)
.cls(GetPriceBean.class)
.callback(new Callback<GetPriceBean>() {
@Override
public void onSuccess(GetPriceBean response, int id) {
dismissLoadingDialog();
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
Double userPrice = response.getBody().getUserPrice();
tvMoney.setText(userPrice+"");
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
// Toast.makeText(getContext(), "获取失败"+e.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + e.getMessage());
}
}).build();
}
@Override

View File

@ -154,7 +154,7 @@ public class RoadFragment extends BaseDrawerFragment implements View.OnClickList
}
}
}
//禁用控件
private void disables() throws JSONException {
etRoadName.setEnabled(false);
rgType.setEnabled(false);

View File

@ -95,6 +95,7 @@ public class TaskExplainFragment extends BaseFragment implements View.OnClickLis
}
private void initNetWork() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1");
httpParams.put("pageNum", "1");

View File

@ -93,6 +93,7 @@ public class TaskExplainFragment2 extends BaseFragment implements View.OnClickLi
}
private void initNetWork2(boolean b) {
showLoadingDialog();
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.listTaskExplain)

View File

@ -96,6 +96,7 @@ public class TaskPrefectureFragment extends BaseFragment implements View.OnClick
}
private void initNetwork() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("fid", "1");
httpParams.put("pageNum", "1");

View File

@ -82,6 +82,7 @@ import com.tencent.tencentmap.mapsdk.maps.model.Polyline;
import com.tencent.tencentmap.mapsdk.maps.model.PolylineOptions;
import com.vividsolutions.jts.geom.Geometry;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;

View File

@ -33,6 +33,8 @@ import org.greenrobot.eventbus.EventBus;
import java.io.File;
import java.util.ArrayList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static android.app.Activity.RESULT_OK;
@ -118,20 +120,29 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
Toast.makeText(getContext(), "姓名不能为空,请输入姓名", Toast.LENGTH_SHORT).show();
return;
}
if (etNamePhone.getText().toString() == null || etNamePhone.getText().toString().equals("")) {
Toast.makeText(getContext(), "身份证号不能为空,请输入身份证号", Toast.LENGTH_SHORT).show();
if (!checkNum(etNamePhone.getText().toString().trim())) {
Toast.makeText(getContext(), "身份证错误,请重新输入", Toast.LENGTH_SHORT).show();
return;
}
// if (takePhoneList.size()<=0) {
// Toast.makeText(getContext(), "身份证照不能为空", Toast.LENGTH_SHORT).show();
// return;
// }
nameAuthentication();
break;
}
}
public boolean checkNum(String text) {
Pattern patternSfzhm1 = Pattern
.compile("^[1-9]\\d{7}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}$");
Pattern patternSfzhm2 = Pattern
.compile("^[1-9]\\d{5}[1-9]\\d{3}((0\\d)|(1[0-2]))(([0|1|2]\\d)|3[0-1])\\d{3}([0-9]|X)$");
Matcher matcherSfzhm1 = patternSfzhm1.matcher(text);
Matcher matcherSfzhm2 = patternSfzhm2.matcher(text);
if(!matcherSfzhm1.find() && !matcherSfzhm2.find())
return false;
else return true;
}
private void nameAuthentication() {
showLoadingDialog();
takePhoneList = new ArrayList<>();
File takePhotoFile1 = new File(takePhotoPath1);
@ -147,10 +158,6 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
attestationName = etAttestationName.getText().toString().trim();
String namePhone = etNamePhone.getText().toString().trim();
// Message obtain = Message.obtain();
// obtain.what = Constant.USER_ATTESTATION_NAME;
// obtain.obj = attestationName;
// EventBus.getDefault().post(obtain);
OkGo
// 请求方式和请求url
@ -174,6 +181,7 @@ public class UserAttestationFragment extends BaseFragment implements View.OnClic
@Override
public boolean onClick(BaseDialog baseDialog, View v) {
// Toast.makeText(getContext(), "点击了确定", Toast.LENGTH_SHORT).show();
//传值给持卡人
Constant.USER_ATTESTATION_NAME=attestationName;
return false;
}

View File

@ -2,22 +2,43 @@ package com.navinfo.outdoor.fragment;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import com.lzy.okgo.model.HttpParams;
import com.navinfo.outdoor.R;
import com.navinfo.outdoor.activity.FragmentManagement;
import com.navinfo.outdoor.base.BaseFragment;
import com.navinfo.outdoor.bean.GetPriceBean;
import com.navinfo.outdoor.bean.UserPriceExchangeBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
/**
* 提现页面的fragment
*/
public class WithdrawFragment extends BaseFragment implements View.OnClickListener{
public class WithdrawFragment extends BaseFragment implements View.OnClickListener {
private ImageView ivWithDraw;
private TextView tvText;
private TextView tvAll ,tvUnit,tvAlready,tvTotal;
private TextView tvAll, tvUnit, tvAlready, tvTotal;
private Button btWithdraw;
private Double canExchangePrice;
private EditText etAllPrice;
private TextView poiPushMoney;
private TextView poiReportMoney;
private TextView roadPushMoney;
private TextView roadReportMoney;
private TextView chargingPushMoney;
private TextView chargingReportMoney;
private TextView otherPushMoney;
private TextView otherReportMoney;
public static WithdrawFragment newInstance(Bundle bundle) {
WithdrawFragment fragment = new WithdrawFragment();
@ -43,23 +64,109 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
tvTotal = findViewById(R.id.tv_total);//总资产
tvAll = findViewById(R.id.tv_all);
tvAll.setOnClickListener(this::onClick);
etAllPrice = findViewById(R.id.et_allPrice);
ivWithDraw = findViewById(R.id.iv_withdraw);
ivWithDraw.setOnClickListener(this);
tvText = findViewById(R.id.tv_text);
tvText.setOnClickListener(this::onClick);
btWithdraw = findViewById(R.id.button);
btWithdraw.setOnClickListener(this::onClick);
poiPushMoney = (TextView) findViewById(R.id.poi_push_money);
poiReportMoney = (TextView) findViewById(R.id.poi_report_money);
roadPushMoney = (TextView) findViewById(R.id.road_push_money);
roadReportMoney = (TextView) findViewById(R.id.road_report_money);
chargingPushMoney = (TextView) findViewById(R.id.charging_push_money);
chargingReportMoney = (TextView) findViewById(R.id.charging_report_money);
otherPushMoney = (TextView) findViewById(R.id.other_push_money);
otherReportMoney = (TextView) findViewById(R.id.other_report_money);
initNetWork();
}
private void initNetWork() {
showLoadingDialog();
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.GET_PRICE)
.method(OkGoBuilder.GET)
.cls(GetPriceBean.class)
.callback(new Callback<GetPriceBean>() {
@Override
public void onSuccess(GetPriceBean response, int id) {
dismissLoadingDialog();
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
Double userPrice = response.getBody().getUserPrice();
canExchangePrice = response.getBody().getCanExchangePrice();
tvTotal.setText(userPrice + "");
tvUnit.setText(canExchangePrice + "");
tvAlready.setText(response.getBody().getHaveExchangePrice() + "");
poiPushMoney.setText(response.getBody().getPoiPushPrice()+"");
poiReportMoney.setText(response.getBody().getPoiNonepushPrice()+"");
roadPushMoney.setText(response.getBody().getRoadPushPrice()+"");
roadReportMoney.setText(response.getBody().getRoadNonepushPrice()+"");
chargingPushMoney.setText(response.getBody().getCsPushPrice()+"");
chargingReportMoney.setText(response.getBody().getCsNonepushPrice()+"");
otherPushMoney.setText(response.getBody().getOtherPushPrice()+"");
otherReportMoney.setText(response.getBody().getOtherNonepushPrice()+"");
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
// Toast.makeText(getContext(), "获取失败" + e.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + e.getMessage());
}
}).build();
}
@Override
public void onClick(View v) {
switch (v.getId()){
switch (v.getId()) {
case R.id.iv_withdraw:
getActivity().finish();
break;
case R.id.tv_text:
Intent intentText = new Intent(getActivity(), FragmentManagement.class);
intentText.putExtra("tag",26);
intentText.putExtra("tag", 26);
startActivity(intentText);
break;
case R.id.button:
immediatelyPrice();
break;
case R.id.tv_all:
etAllPrice.setText(canExchangePrice + "");
break;
}
}
private void immediatelyPrice() {
showLoadingDialog();
HttpParams httpParams = new HttpParams();
httpParams.put("exchangeMoney", "10");
httpParams.put("payType", "1");
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(HttpInterface.USER_PRICE_EXCHANGE)
.method(OkGoBuilder.GET)
.cls(UserPriceExchangeBean.class)
.params(httpParams)
.callback(new Callback<UserPriceExchangeBean>() {
@Override
public void onSuccess(UserPriceExchangeBean response, int id) {
dismissLoadingDialog();
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
}
@Override
public void onError(Throwable e, int id) {
dismissLoadingDialog();
Toast.makeText(getContext(), "兑换失败" + e.getMessage(), Toast.LENGTH_SHORT).show();
Log.d("TAG", "onError: " + e.getMessage());
}
}).build();
}
}

View File

@ -38,4 +38,14 @@ public class HttpInterface {
//172.23.139.4:8003/m4/task/1/getList
public static final String TASK_LIST = IPM3 + "/task/1/getList"; //任务搜索
public static final String IPm5 = "http://172.23.139.4:8004/userPrice/1/";
//http://172.23.139.4:8004/userPrice/1/getPrice
public static final String GET_PRICE= IPm5+"getPrice";//总资产
//http://172.23.139.4:8004/userPrice/1/userPriceExchange?exchangeMoney=10&payType=1
public static final String USER_PRICE_EXCHANGE = IPm5+"userPriceExchange";
}

View File

@ -49,55 +49,6 @@
app:layout_constraintTop_toTopOf="parent" />
<!-- <LinearLayout-->
<!-- android:id="@+id/ll_iv"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_gravity="bottom"-->
<!-- android:orientation="horizontal"-->
<!-- android:padding="16dp"-->
<!-- android:weightSum="4"-->
<!-- app:layout_constraintBottom_toBottomOf="parent">-->
<!-- <Space-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="1dp"-->
<!-- android:layout_weight="1" />-->
<!-- <LinearLayout-->
<!-- android:id="@+id/ll_caiji"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:gravity="center"-->
<!-- android:background="#50FFFFFF"-->
<!-- android:orientation="horizontal"-->
<!-- android:layout_marginBottom="20dp"-->
<!-- app:layout_constraintBottom_toBottomOf="parent">-->
<!-- <Button-->
<!-- android:id="@+id/capuretVideo"-->
<!-- android:layout_width="100dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="开始采集"-->
<!-- android:layout_marginRight="10dp"-->
<!-- style="@style/user_data_style"/>-->
<!-- <Button-->
<!-- android:layout_width="100dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="结束采集"-->
<!-- android:layout_marginLeft="10dp"-->
<!-- android:background="@drawable/uploding_shape"-->
<!-- android:textColor="@color/colorBlue"/>-->
<!-- <ImageButton-->
<!-- android:id="@+id/capturePicture"-->
<!-- android:layout_width="56dp"-->
<!-- android:layout_height="56dp"-->
<!-- android:visibility="gone"-->
<!-- android:background="?attr/selectableItemBackgroundBorderless"-->
<!-- app:srcCompat="@drawable/ic_photo" />-->
<!-- </LinearLayout>-->
<Button
android:id="@+id/capuretVideo"
android:layout_width="100dp"

View File

@ -1,9 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
xmlns:app="http://schemas.android.com/apk/res-auto">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/rl_withdraw"
android:layout_width="match_parent"
@ -154,6 +160,7 @@
android:textStyle="bold" />
<EditText
android:id="@+id/et_allPrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
@ -234,11 +241,11 @@
<ImageView
android:id="@+id/image_poi"
android:layout_width="50dp"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="2dp"
android:background="@drawable/icon_task_specification" />
android:background="@drawable/poi_square" />
<TextView
android:layout_width="wrap_content"
@ -246,11 +253,12 @@
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_toRightOf="@id/image_poi"
android:text="POI"
android:text="POI推送积分"
android:textColor="#333"
android:textSize="18sp" />
<TextView
android:id="@+id/poi_push_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
@ -265,29 +273,67 @@
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F1F0F0" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/image_poi_report"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="2dp"
android:background="@drawable/poi_square" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="20dp"
android:layout_toRightOf="@id/image_poi_report"
android:text="POI上报任务积分"
android:textColor="#333"
android:textSize="18sp" />
<TextView
android:id="@+id/poi_report_money"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:gravity="center_vertical"
android:text="+¥0.0"
android:textColor="#333"
android:textSize="18sp" />
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F1F0F0" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/image_way"
android:layout_width="50dp"
android:layout_height="match_parent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="2dp"
android:background="@drawable/icon_task_specification" />
android:background="@drawable/road_square" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="道路"
android:text="道路推送积分"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/image_way"
android:textColor="#333"
android:textSize="18sp" />
<TextView
android:id="@+id/road_push_money"
android:layout_width="wrap_content"
android:gravity="center_vertical"
android:layout_alignParentRight="true"
@ -298,5 +344,197 @@
android:textSize="18sp"
/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F1F0F0" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/image_way_report"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="2dp"
android:background="@drawable/road_square" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="道路上报任务积分"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/image_way_report"
android:textColor="#333"
android:textSize="18sp" />
<TextView
android:id="@+id/road_report_money"
android:layout_width="wrap_content"
android:gravity="center_vertical"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:text="+¥0.0"
android:textColor="#333"
android:textSize="18sp"
/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F1F0F0" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/image_charging"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="2dp"
android:background="@drawable/charge_square" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="充电站推送积分"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/image_charging"
android:textColor="#333"
android:textSize="18sp" />
<TextView
android:id="@+id/charging_push_money"
android:layout_width="wrap_content"
android:gravity="center_vertical"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:text="+¥0.0"
android:textColor="#333"
android:textSize="18sp"
/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F1F0F0" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/image_charge_report"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="2dp"
android:background="@drawable/charge_square" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="道路上报任务积分"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/image_charge_report"
android:textColor="#333"
android:textSize="18sp" />
<TextView
android:id="@+id/charging_report_money"
android:layout_width="wrap_content"
android:gravity="center_vertical"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:text="+¥0.0"
android:textColor="#333"
android:textSize="18sp"
/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F1F0F0" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/image_other"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="2dp"
android:background="@drawable/push_qingbao" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="其他推送积分"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/image_other"
android:textColor="#333"
android:textSize="18sp" />
<TextView
android:id="@+id/other_push_money"
android:layout_width="wrap_content"
android:gravity="center_vertical"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:text="+¥0.0"
android:textColor="#333"
android:textSize="18sp"
/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F1F0F0" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical">
<ImageView
android:id="@+id/image_other_report"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_margin="2dp"
android:background="@drawable/push_qingbao" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="其他上报任务积分"
android:layout_marginLeft="20dp"
android:layout_centerVertical="true"
android:layout_toRightOf="@id/image_other_report"
android:textColor="#333"
android:textSize="18sp" />
<TextView
android:id="@+id/other_report_money"
android:layout_width="wrap_content"
android:gravity="center_vertical"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_height="wrap_content"
android:text="+¥0.0"
android:textColor="#333"
android:textSize="18sp"
/>
</RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#F1F0F0" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</ScrollView>