添加‘筛选-点击item的领取任务接口’
This commit is contained in:
parent
db74ba9dc9
commit
4696a7dd29
@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion 29
|
compileSdkVersion 29
|
||||||
buildToolsVersion '29.0.2'
|
buildToolsVersion '29.0.2'
|
||||||
//ndkVersion '23.0.7123448'
|
ndkVersion '23.0.7123448'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.navinfo.outdoor"
|
applicationId "com.navinfo.outdoor"
|
||||||
|
@ -59,6 +59,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
private String userqq;
|
private String userqq;
|
||||||
private String userphone;
|
private String userphone;
|
||||||
private String usermailbox;
|
private String usermailbox;
|
||||||
|
private String region_id;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@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,})$");
|
boolean isEmail_matcher = usermailbox.matches( "^[\\w-\\+]+(\\.[\\w]+)*@[\\w-]+(\\.[\\w]+)*(\\.[a-z]{2,})$");
|
||||||
//&& userqq.length() < 11 && userqq.length() > 5
|
//&& 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)) {
|
if (!RegexUtil.isPhone(userphone)) {
|
||||||
Toast.makeText(this, "手机号输入错误", Toast.LENGTH_SHORT).show();
|
Toast.makeText(this, "手机号输入错误", Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
@ -160,7 +167,7 @@ public class UserActivity extends BaseActivity implements View.OnClickListener {
|
|||||||
.<UserBean>post(HttpInterface.USER_UPDATE)
|
.<UserBean>post(HttpInterface.USER_UPDATE)
|
||||||
// 请求的 tag, 主要用于取消对应的请求
|
// 请求的 tag, 主要用于取消对应的请求
|
||||||
.params("pid", "1")
|
.params("pid", "1")
|
||||||
.params("regionId", "530902")//省市区id
|
.params("regionId", region_id)//省市区id
|
||||||
.params("qq", userqq)//qq号
|
.params("qq", userqq)//qq号
|
||||||
.tag(this)
|
.tag(this)
|
||||||
.execute(new DialogCallback<UserBean>(UserBean.class) {
|
.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).size() > 0
|
||||||
&& options3Items.get(options1).get(options2).size() > 0 ?
|
&& options3Items.get(options1).get(options2).size() > 0 ?
|
||||||
options3Items.get(options1).get(options2).get(options3) : "";
|
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();
|
Toast.makeText(UserActivity.this, region_id, Toast.LENGTH_SHORT).show();
|
||||||
String tx = opt1tx + " " + opt2tx + " " + opt3tx;
|
String tx = opt1tx + " " + opt2tx + " " + opt3tx;
|
||||||
region.setText(tx);
|
region.setText(tx);
|
||||||
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,6 +2,7 @@ package com.navinfo.outdoor.fragment;
|
|||||||
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Message;
|
import android.os.Message;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
@ -12,6 +13,11 @@ import com.navinfo.outdoor.R;
|
|||||||
import com.navinfo.outdoor.api.Constant;
|
import com.navinfo.outdoor.api.Constant;
|
||||||
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
import com.navinfo.outdoor.base.BaseDrawerFragment;
|
||||||
import com.navinfo.outdoor.base.BaseFragment;
|
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 com.navinfo.outdoor.room.PoiEntity;
|
||||||
|
|
||||||
import org.greenrobot.eventbus.EventBus;
|
import org.greenrobot.eventbus.EventBus;
|
||||||
@ -25,6 +31,7 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
private Button btnBank;
|
private Button btnBank;
|
||||||
private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe;
|
private TextView tvTitle, tvMoney, tvTime, tvDistance, tvDescribe;
|
||||||
private PoiEntity poiEntity;
|
private PoiEntity poiEntity;
|
||||||
|
private Button btnDraw;
|
||||||
|
|
||||||
public static GatherGetFragment newInstance(Bundle bundle) {
|
public static GatherGetFragment newInstance(Bundle bundle) {
|
||||||
GatherGetFragment fragment = new GatherGetFragment();
|
GatherGetFragment fragment = new GatherGetFragment();
|
||||||
@ -92,6 +99,8 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
tvDescribe = findViewById(R.id.tv_describe);
|
tvDescribe = findViewById(R.id.tv_describe);
|
||||||
btnBank = findViewById(R.id.btn_bank);
|
btnBank = findViewById(R.id.btn_bank);
|
||||||
btnBank.setOnClickListener(this);
|
btnBank.setOnClickListener(this);
|
||||||
|
btnDraw = findViewById(R.id.btn_draw);
|
||||||
|
btnDraw.setOnClickListener(this::onClick);
|
||||||
Bundle arguments = getArguments();
|
Bundle arguments = getArguments();
|
||||||
|
|
||||||
if (arguments!=null) {
|
if (arguments!=null) {
|
||||||
@ -117,10 +126,52 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
|||||||
}else {
|
}else {
|
||||||
Toast.makeText(getContext(), "无法采集", Toast.LENGTH_SHORT).show();
|
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;
|
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) {
|
public static String format5(double value) {
|
||||||
return String.format("%.2f", value).toString();
|
return String.format("%.2f", value).toString();
|
||||||
|
|
||||||
|
@ -151,6 +151,14 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
|||||||
List<PoiEntity> poiEntitiesList = initRoadWord(1);
|
List<PoiEntity> poiEntitiesList = initRoadWord(1);
|
||||||
staySubmitAdapter.setAllRoad(poiEntitiesList);
|
staySubmitAdapter.setAllRoad(poiEntitiesList);
|
||||||
break;
|
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);
|
tvStayType.setText(text);
|
||||||
}
|
}
|
||||||
|
@ -100,14 +100,14 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
tvTotal.setText(userPrice + "");
|
tvTotal.setText(userPrice + "");
|
||||||
tvUnit.setText(canExchangePrice + "");
|
tvUnit.setText(canExchangePrice + "");
|
||||||
tvAlready.setText(response.getBody().getHaveExchangePrice() + "");
|
tvAlready.setText(response.getBody().getHaveExchangePrice() + "");
|
||||||
poiPushMoney.setText(response.getBody().getPoiPushPrice()+"元");
|
poiPushMoney.setText(response.getBody().getPoiPushPrice() + "元");
|
||||||
poiReportMoney.setText(response.getBody().getPoiNonepushPrice()+"元");
|
poiReportMoney.setText(response.getBody().getPoiNonepushPrice() + "元");
|
||||||
roadPushMoney.setText(response.getBody().getRoadPushPrice()+"元");
|
roadPushMoney.setText(response.getBody().getRoadPushPrice() + "元");
|
||||||
roadReportMoney.setText(response.getBody().getRoadNonepushPrice()+"元");
|
roadReportMoney.setText(response.getBody().getRoadNonepushPrice() + "元");
|
||||||
chargingPushMoney.setText(response.getBody().getCsPushPrice()+"元");
|
chargingPushMoney.setText(response.getBody().getCsPushPrice() + "元");
|
||||||
chargingReportMoney.setText(response.getBody().getCsNonepushPrice()+"元");
|
chargingReportMoney.setText(response.getBody().getCsNonepushPrice() + "元");
|
||||||
otherPushMoney.setText(response.getBody().getOtherPushPrice()+"元");
|
otherPushMoney.setText(response.getBody().getOtherPushPrice() + "元");
|
||||||
otherReportMoney.setText(response.getBody().getOtherNonepushPrice()+"元");
|
otherReportMoney.setText(response.getBody().getOtherNonepushPrice() + "元");
|
||||||
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
Log.d("TAG", "onSuccess: " + response.toString() + "tttttttt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,6 +133,13 @@ public class WithdrawFragment extends BaseFragment implements View.OnClickListen
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case R.id.button:
|
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();
|
immediatelyPrice();
|
||||||
break;
|
break;
|
||||||
case R.id.tv_all:
|
case R.id.tv_all:
|
||||||
|
@ -43,9 +43,21 @@ public class HttpInterface {
|
|||||||
public static final String IPm5 = "http://172.23.139.4:8004/userPrice/1/";
|
public static final String IPm5 = "http://172.23.139.4:8004/userPrice/1/";
|
||||||
|
|
||||||
//http://172.23.139.4:8004/userPrice/1/getPrice
|
//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
|
//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 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";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
17
app/src/main/res/layout/picture_mapview.xml
Normal file
17
app/src/main/res/layout/picture_mapview.xml
Normal 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>
|
Loading…
x
Reference in New Issue
Block a user