添加‘筛选-点击item的领取任务接口’

This commit is contained in:
md 2021-07-05 17:10:31 +08:00
parent db74ba9dc9
commit 4696a7dd29
8 changed files with 206 additions and 15 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"

View File

@ -59,6 +59,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
private String userqq;
private String userphone;
private String usermailbox;
private String region_id;
@Override
@ -129,7 +130,13 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
// 邮箱匹配结果
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 (TextUtils.isEmpty(userphone) || TextUtils.isEmpty(userqq) || TextUtils.isEmpty(usermailbox)|| TextUtils.isEmpty(region_id)) {
if (region_id == null || region_id.equals("")) {
Toast.makeText(this, "所在地区为空,请重新输入", Toast.LENGTH_SHORT).show();
return;
}
if (!RegexUtil.isPhone(userphone)) {
Toast.makeText(this, "手机号输入错误", Toast.LENGTH_SHORT).show();
return;
@ -160,7 +167,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
.<UserBean>post(HttpInterface.USER_UPDATE)
// 请求的 tag, 主要用于取消对应的请求
.params("pid", "1")
.params("regionId", "530902")//省市区id
.params("regionId", region_id)//省市区id
.params("qq", userqq)//qq号
.tag(this)
.execute(new DialogCallback<UserBean>(UserBean.class) {
@ -221,7 +228,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
&& options3Items.get(options1).size() > 0
&& options3Items.get(options1).get(options2).size() > 0 ?
options3Items.get(options1).get(options2).get(options3) : "";
String region_id = cityItems.get(options1).get(options2).get(options3).getRegion_id();
region_id = cityItems.get(options1).get(options2).get(options3).getRegion_id();
Toast.makeText(UserActivity.this, region_id, Toast.LENGTH_SHORT).show();
String tx = opt1tx + " " + opt2tx + " " + opt3tx;
region.setText(tx);

View File

@ -0,0 +1,89 @@
package com.navinfo.outdoor.bean;
public class ReceivedPoiBean {
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 Integer id;
private String address;
private String telephone;
private String geo;
private Integer type;
private String name;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
public String getTelephone() {
return telephone;
}
public void setTelephone(String telephone) {
this.telephone = telephone;
}
public String getGeo() {
return geo;
}
public void setGeo(String geo) {
this.geo = geo;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
}

View File

@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
import android.os.Bundle;
import android.os.Message;
import android.util.Log;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
@ -12,6 +13,11 @@ import com.navinfo.outdoor.R;
import com.navinfo.outdoor.api.Constant;
import com.navinfo.outdoor.base.BaseDrawerFragment;
import com.navinfo.outdoor.base.BaseFragment;
import com.navinfo.outdoor.bean.GetPriceBean;
import com.navinfo.outdoor.bean.ReceivedPoiBean;
import com.navinfo.outdoor.http.Callback;
import com.navinfo.outdoor.http.HttpInterface;
import com.navinfo.outdoor.http.OkGoBuilder;
import com.navinfo.outdoor.room.PoiEntity;
import org.greenrobot.eventbus.EventBus;
@ -25,6 +31,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
private Button btnBank;
private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe;
private PoiEntity poiEntity;
private Button btnDraw;
public static GatherGetFragment newInstance(Bundle bundle) {
GatherGetFragment fragment = new GatherGetFragment();
@ -92,6 +99,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
tvDescribe = findViewById(R.id.tv_describe);
btnBank = findViewById(R.id.btn_bank);
btnBank.setOnClickListener(this);
btnDraw = findViewById(R.id.btn_draw);
btnDraw.setOnClickListener(this::onClick);
Bundle arguments = getArguments();
if (arguments!=null) {
@ -117,10 +126,52 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
}else {
Toast.makeText(getContext(), "无法采集", Toast.LENGTH_SHORT).show();
}
break;
case R.id.btn_draw:
if (poiEntity!=null){
if (poiEntity.getType()==1) {//poi的领取类型
receivedTaskByNet(HttpInterface.RECEIVED_POI_TASK,poiEntity.getPid()+"");
}else if (poiEntity.getType() == 5){
receivedTaskByNet(HttpInterface.RECEIVED_OTHER_TASK,poiEntity.getPid()+"");
}
}
break;
}
}
/**
* @param url 不同任务类型对应的url
* @param id 任务id
* */
private void receivedTaskByNet(String url, String id) {
showLoadingDialog();
OkGoBuilder.getInstance()
.Builder(getActivity())
.url(url+id)
.method(OkGoBuilder.GET)
.cls(ReceivedPoiBean.class)
.callback(new Callback<ReceivedPoiBean>() {
@Override
public void onSuccess(ReceivedPoiBean response, int id) {
dismissLoadingDialog();
// Toast.makeText(getContext(), "获取成功", Toast.LENGTH_SHORT).show();
Integer PoiId = response.getBody().getId();
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();
}
public static String format5(double value) {
return String.format("%.2f", value).toString();

View File

@ -151,6 +151,14 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
List<PoiEntity> poiEntitiesList = initRoadWord(1);
staySubmitAdapter.setAllRoad(poiEntitiesList);
break;
case 2:
List<PoiEntity> poiEntities1 = initRoadWord(2);
staySubmitAdapter.setAllRoad(poiEntities1);
break;
case 3:
List<PoiEntity> poiEntities2 = initRoadWord(3);
staySubmitAdapter.setAllRoad(poiEntities2);
break;
}
tvStayType.setText(text);
}

View File

@ -100,14 +100,14 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
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()+"");
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");
}
@ -133,6 +133,13 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
break;
case R.id.button:
if (etAllPrice == null) {
Toast.makeText(getContext(), "控件不能为空", Toast.LENGTH_SHORT).show();
return;
}
if (etAllPrice.getText().toString().equals("")) {
Toast.makeText(getContext(), "提现金额不能为空", Toast.LENGTH_SHORT).show();
}
immediatelyPrice();
break;
case R.id.tv_all:

View File

@ -43,9 +43,21 @@ public class HttpInterface {
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";//总资产
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";
//http://172.23.139.4:8004/userPrice/1/userPriceExchange?exchangeMoney=10&payType=1
public static final String USER_PRICE_EXCHANGE = IPm5 + "userPriceExchange";
public static final String IPm6 = "http://172.23.139.4:8003/othertask/1/";
//172.23.139.4:8003/othertask/1/receivedOthertask/5001
public static final String RECEIVED_OTHER_TASK = IPm6 + "receivedOthertask/5001";
public static final String IPm7 = "http://172.23.139.4:8003/poitask/1/";
//172.23.139.4:8003/poitask/1/receivedPoitask/1
public static final String RECEIVED_POI_TASK = IPm7+"receivedPoitask/1";
}

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FF444444"
xmlns:app="http://schemas.android.com/apk/res-auto">
<com.tencent.tencentmap.mapsdk.maps.MapView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/map_picture"/>
<androidx.cardview.widget.CardView
android:layout_width="300dp"
android:layout_height="183dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
android:id="@+id/cd_picture"/>
</androidx.constraintlayout.widget.ConstraintLayout>