修改结束领取的接口
This commit is contained in:
parent
a7cd05e749
commit
bb76d48bdf
@ -86,7 +86,6 @@ public class Constant {
|
||||
public static final int EVENT_STAY_REFRESH = 44; // 刷新记录页面
|
||||
|
||||
public static final int EVENT_WORK_HOME = 45; //切换到寻宝
|
||||
public static final int EVENT_WORK_UNPOLYGON = 46; //面妆任务点立即采集
|
||||
public static String USER_ATTESTATION_NAME; //实名认证姓名 银行卡
|
||||
public static int NUMBER = 200; //任务个数
|
||||
public static int LIMIT_TTPE = -1; //权限类型,普通任务-0,专属任务-1
|
||||
|
@ -131,22 +131,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
if (poiEntity.getDist() != null) {
|
||||
tvDistance.setText("距离:" + format5(Double.valueOf(poiEntity.getDist()) / 1000) + "km");
|
||||
}
|
||||
|
||||
if (poiEntity.getTaskStatus() < 2) {
|
||||
double latitude = Constant.currentLocation.getLatitude();
|
||||
double longitude = Constant.currentLocation.getLongitude();
|
||||
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
||||
LatLng endLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
|
||||
double v = GeometryTools.distanceToDouble(startLatLng, endLatLng);
|
||||
if (v > 5000) {
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
int taskStatus = poiEntity.getTaskStatus();
|
||||
initViewByTaskStatus(taskStatus);
|
||||
@ -190,29 +174,22 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
switch (v.getId()) {
|
||||
case R.id.btn_cancel_get://结束领取
|
||||
if (poiEntity != null) {
|
||||
int type = poiEntity.getType();
|
||||
if (type == 6) {
|
||||
initUnPolygonTask(HttpInterface.UNRECEIVED_POLYGON_TASK, poiEntity.getTaskId(), poiEntity);
|
||||
} else {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiDao.deletePoiEntity(poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
btnGetTask.setVisibility(View.VISIBLE);
|
||||
btnCancelGet.setVisibility(View.GONE);
|
||||
btnGather.setVisibility(View.VISIBLE);
|
||||
btnFinishGather.setVisibility(View.GONE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
initEndReceiveTask(HttpInterface.UN_RECEIVED_TASK, poiEntity.getTaskId(), poiEntity);
|
||||
}
|
||||
break;
|
||||
case R.id.btn_get_task://领取任务
|
||||
if (poiEntity.getTaskStatus() < 2) {
|
||||
double latitude = Constant.currentLocation.getLatitude();
|
||||
double longitude = Constant.currentLocation.getLongitude();
|
||||
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
||||
LatLng endLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
|
||||
double geometry = GeometryTools.distanceToDouble(startLatLng, endLatLng);
|
||||
if (geometry > 5000) {
|
||||
Toast.makeText(getActivity(), "作业不在领取范围内,无法领取", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (poiEntity != null) {
|
||||
int type = poiEntity.getType();
|
||||
if (type == 6) {//面状任务的领取类型
|
||||
@ -231,6 +208,17 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
break;
|
||||
case R.id.btn_gather://立即采集
|
||||
if (poiEntity.getTaskStatus() < 2) {
|
||||
double latitude = Constant.currentLocation.getLatitude();
|
||||
double longitude = Constant.currentLocation.getLongitude();
|
||||
LatLng startLatLng = new LatLng(latitude, longitude); //用户当前位置
|
||||
LatLng endLatLng = new LatLng(Double.valueOf(poiEntity.getY()), Double.valueOf(poiEntity.getX()));
|
||||
double geometry = GeometryTools.distanceToDouble(startLatLng, endLatLng);
|
||||
if (geometry > 5000) {
|
||||
Toast.makeText(getActivity(), "作业不在领取范围内,无法领取", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (poiEntity != null) {
|
||||
int type = poiEntity.getType();
|
||||
if (type == 6) {
|
||||
@ -458,10 +446,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
if (aBoolean) {
|
||||
initCompleteTask(HttpInterface.COMPLETE, GatherGetFragment.this.poiEntity.getTaskId(), true, polygonEntity);
|
||||
}
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = false;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -480,18 +464,22 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
}
|
||||
|
||||
/**
|
||||
* @param url 面妆任务结束领取
|
||||
* @param url 所以类型的结束领取
|
||||
* @param poiEntity
|
||||
*/
|
||||
private void initUnPolygonTask(String url, int taskId, PoiEntity poiEntity) {
|
||||
private void initEndReceiveTask(String url, int taskId, PoiEntity poiEntity) {
|
||||
if (taskId == 0) {
|
||||
Toast.makeText(getContext(), "无此任务", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
showLoadingDialog();
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("taskIds",taskId);
|
||||
httpParams.put("auditIds","");
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(url + "/" + taskId)
|
||||
.url(url)
|
||||
.params(httpParams)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(UnPolygonTaskBean.class)
|
||||
.callback(new Callback<UnPolygonTaskBean>() {
|
||||
@ -502,15 +490,12 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
poiDao.deleteFormTaskID(taskId);
|
||||
poiDao.deletePoiEntity(poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Log.d("TAG", "run: "+response.getMessage());
|
||||
initViewByTaskStatus(0);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = false;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -554,16 +539,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void run() {
|
||||
InsertAndUpdateUtils.getInstance().insertOrUpdate(getContext(), poiEntity);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initViewByTaskStatus(1);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
@ -603,16 +578,6 @@ public class GatherGetFragment extends BaseFragment implements View.OnClickListe
|
||||
@Override
|
||||
public void run() {
|
||||
poiDao.deleteFormTaskID(taskId);
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
initViewByTaskStatus(0);
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.EVENT_WORK_UNPOLYGON;
|
||||
obtain.obj = true;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
|
||||
|
@ -23,11 +23,16 @@ import com.kongzue.dialog.util.BaseDialog;
|
||||
import com.kongzue.dialog.util.DialogSettings;
|
||||
import com.kongzue.dialog.v3.BottomMenu;
|
||||
import com.kongzue.dialog.v3.MessageDialog;
|
||||
import com.lzy.okgo.model.HttpParams;
|
||||
import com.navinfo.outdoor.R;
|
||||
import com.navinfo.outdoor.activity.FragmentManagement;
|
||||
import com.navinfo.outdoor.adapter.StaySubmitAdapter;
|
||||
import com.navinfo.outdoor.api.Constant;
|
||||
import com.navinfo.outdoor.base.BaseFragment;
|
||||
import com.navinfo.outdoor.bean.UnPolygonTaskBean;
|
||||
import com.navinfo.outdoor.http.Callback;
|
||||
import com.navinfo.outdoor.http.HttpInterface;
|
||||
import com.navinfo.outdoor.http.OkGoBuilder;
|
||||
import com.navinfo.outdoor.room.PoiDao;
|
||||
import com.navinfo.outdoor.room.PoiDatabase;
|
||||
import com.navinfo.outdoor.room.PoiEntity;
|
||||
@ -38,6 +43,7 @@ import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -197,8 +203,7 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "是否删除", "确定", "取消").setOkButton(new OnDialogButtonClickListener() {
|
||||
@Override
|
||||
public boolean onClick(BaseDialog baseDialog, View v) {
|
||||
staySubmitAdapter.setAllCheckedDelete();
|
||||
// refreshData();
|
||||
initRequest(staySubmitAdapter.getAllRoad());
|
||||
return false;
|
||||
}
|
||||
});
|
||||
@ -225,6 +230,72 @@ public class StaySubmitFragment extends BaseFragment implements View.OnClickList
|
||||
}
|
||||
}
|
||||
|
||||
private void initRequest(List<PoiEntity> allRoad) {
|
||||
showLoadingDialog();
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ArrayList<PoiEntity> poiEntities = new ArrayList<>();
|
||||
synchronized (allRoad) {
|
||||
Iterator iterator = allRoad.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
PoiEntity poiEntity = (PoiEntity) iterator.next();
|
||||
if (poiEntity.isChecked()) {
|
||||
poiEntities.add(poiEntity);
|
||||
}
|
||||
}
|
||||
;
|
||||
}
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
String taskIds = "";
|
||||
String auditIds = "";
|
||||
for (int i = 0; i < poiEntities.size(); i++) {
|
||||
if (poiEntities.get(i).getTaskStatus() == 2) {
|
||||
taskIds += poiEntities.get(i).getTaskId()+",";
|
||||
} else if (poiEntities.get(i).getTaskStatus() == 3) {
|
||||
auditIds += poiEntities.get(i).getBodyId()+",";
|
||||
}
|
||||
}
|
||||
if (taskIds!=null&&!taskIds.equals("")){
|
||||
taskIds = taskIds.substring(0,taskIds.length() - 1);
|
||||
}
|
||||
if (auditIds!=null&&!auditIds.equals("")){
|
||||
auditIds = auditIds.substring(0,auditIds.length() - 1);
|
||||
}
|
||||
HttpParams httpParams = new HttpParams();
|
||||
httpParams.put("taskIds", taskIds);
|
||||
httpParams.put("auditIds", auditIds);
|
||||
OkGoBuilder.getInstance()
|
||||
.Builder(getActivity())
|
||||
.url(HttpInterface.UN_RECEIVED_TASK)
|
||||
.params(httpParams)
|
||||
.method(OkGoBuilder.GET)
|
||||
.cls(UnPolygonTaskBean.class)
|
||||
.callback(new Callback<UnPolygonTaskBean>() {
|
||||
@Override
|
||||
public void onSuccess(UnPolygonTaskBean response, int id) {
|
||||
dismissLoadingDialog();
|
||||
if (response.getCode()==200){
|
||||
staySubmitAdapter.setAllCheckedDelete();
|
||||
}
|
||||
Toast.makeText(getContext(), response.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e, int id) {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getContext(), e.getMessage() + "", Toast.LENGTH_SHORT).show();
|
||||
|
||||
}
|
||||
}).build();
|
||||
}
|
||||
});
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
public void refreshData() {
|
||||
|
||||
if (roadEntities == null) {
|
||||
|
@ -145,7 +145,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
bitmapDescriptor3 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||
bitmapDescriptor4 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||
bitmapDescriptor5 = BitmapDescriptorFactory.fromResource(R.mipmap.datouzhen);
|
||||
|
||||
EventBus.getDefault().register(this);
|
||||
//fragment 管理器
|
||||
supportFragmentManager = getActivity().getSupportFragmentManager();
|
||||
@ -164,15 +163,13 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
ivMessage.setOnClickListener(this::onClick);
|
||||
treasureMap = (MapView) findViewById(R.id.treasure_map);
|
||||
tencentMap = treasureMap.getMap();
|
||||
|
||||
// if (getClass().getCanonicalName().equals("PioFragment")){
|
||||
// ivMessage.setVisibility(View.VISIBLE);
|
||||
// }else {
|
||||
// ivMessage.setVisibility(View.GONE);
|
||||
// }
|
||||
cbMapType = (CheckBox) findViewById(R.id.cb_map_type);
|
||||
|
||||
// sliding_layout.setScrollableViewHelper(new NestedScrollableViewHelper());
|
||||
// sliding_layout.setScrollableViewHelper(new NestedScrollableViewHelper());
|
||||
//地图转换
|
||||
cbMapType.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
@ -217,7 +214,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
@Override
|
||||
public void onMapLoaded() {
|
||||
if (Constant.currentLocation != null) {
|
||||
|
||||
// 地图中心点位置设置为当前用户所在位置
|
||||
CameraUpdate cameraSigma =
|
||||
CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||
@ -232,11 +228,8 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
// 移动到当前位置后,开始请求地图数据
|
||||
initList(Constant.currentLocation);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
public void onCancel() {}
|
||||
});
|
||||
}else {
|
||||
dismissLoadingDialog();
|
||||
@ -255,7 +248,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (markerPile != null) {
|
||||
markerPile.remove();
|
||||
}
|
||||
|
||||
if (bigMarker != null) {
|
||||
bigMarker.setVisible(false);
|
||||
}
|
||||
@ -325,14 +317,12 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}else {
|
||||
Toast.makeText(getActivity(), "数据为空", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// 设置地图宽高为屏幕的宽高
|
||||
int[] widtHeight = DensityUtil.getDeviceInfo(getActivity());
|
||||
treasureMap.getLayoutParams().width = widtHeight[0];
|
||||
@ -370,7 +360,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
.params("pageNum", "1")
|
||||
.params("type", task_type)
|
||||
.params("isExclusive", limit_type)
|
||||
// .client(new OkHttpClient())
|
||||
// .client(new OkHttpClient())
|
||||
.execute(new DialogCallback<JobSearchBean>(JobSearchBean.class) {
|
||||
@Override
|
||||
public void onSuccess(Response<JobSearchBean> response) {
|
||||
@ -433,7 +423,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
latLng.setLatitude(y);
|
||||
latLng.setLongitude(x);
|
||||
}
|
||||
/* if (latPolygon != null && latPolygon.size() > 0) {
|
||||
/* if (latPolygon != null && latPolygon.size() > 0) {
|
||||
latLng = latPolygon.get(0);
|
||||
}*/
|
||||
}
|
||||
@ -506,7 +496,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
obtain.obj = body;
|
||||
EventBus.getDefault().post(obtain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Response<JobSearchBean> response) {
|
||||
super.onError(response);
|
||||
@ -573,9 +562,9 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
latLng.setLatitude(y);
|
||||
latLng.setLongitude(x);
|
||||
}
|
||||
/* if (latPolygon != null && latPolygon.size() > 0) {
|
||||
latLng = latPolygon.get(0);
|
||||
}*/
|
||||
/* if (latPolygon != null && latPolygon.size() > 0) {
|
||||
latLng = latPolygon.get(0);
|
||||
}*/
|
||||
}
|
||||
BitmapDescriptor descriptor = null;
|
||||
if (poiEntity.getType()==1){
|
||||
@ -591,7 +580,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}else if (poiEntity.getType()==6){
|
||||
descriptor = BitmapDescriptorFactory.fromResource(R.drawable.marker_poi_bag);
|
||||
}
|
||||
|
||||
if (bigMarker == null) {
|
||||
bigMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(descriptor).alpha(0.9f)
|
||||
.flat(true)
|
||||
@ -698,7 +686,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}else {
|
||||
poiDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graypoi);
|
||||
}
|
||||
|
||||
Marker poiMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(poiDescriptor).alpha(0.9f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
@ -707,8 +694,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
poiMarker.setTitle(poiEntity.getName() + "");
|
||||
poiMarker.setTag(poiEntity);
|
||||
removablesLocality.add(poiMarker);
|
||||
|
||||
|
||||
break;
|
||||
case 2://充电站
|
||||
BitmapDescriptor chargeDescriptor = null;
|
||||
@ -717,7 +702,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}else {
|
||||
chargeDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.graycharge);
|
||||
}
|
||||
|
||||
Marker stationMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(chargeDescriptor).alpha(0.9f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
@ -750,7 +734,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}else {
|
||||
roadDescriptor = BitmapDescriptorFactory.fromResource(R.drawable.grayroad);
|
||||
}
|
||||
|
||||
Marker roadMarker = tencentMap.addMarker(new MarkerOptions(latLng).icon(roadDescriptor).alpha(0.9f)
|
||||
.flat(true)
|
||||
.clockwise(false));
|
||||
@ -794,7 +777,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Message obtain = Message.obtain();
|
||||
obtain.what = Constant.JOB_SEARCH_POI_WORD;
|
||||
obtain.obj = allTaskStatus;
|
||||
@ -877,7 +859,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
case 5:
|
||||
DialogSettings.style = DialogSettings.STYLE.STYLE_KONGZUE;
|
||||
MessageDialog.show((AppCompatActivity) getContext(), "提示", "你其他页面还有未提交完的数据", "确定").setOkButton(new OnDialogButtonClickListener() {
|
||||
@ -894,7 +875,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
}
|
||||
});
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1053,7 +1033,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (view != null) {
|
||||
initHeader(view);
|
||||
}
|
||||
|
||||
} else if (data.what == Constant.MAIN_REMOVE) {//// 控制主界面各个header移除
|
||||
if ((boolean) data.obj) {
|
||||
dragView.removeAllViews();
|
||||
@ -1148,22 +1127,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (gatherGetFragment != null) {
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
}
|
||||
} else if (data.what == Constant.EVENT_WORK_UNPOLYGON) {//面妆任务点击立即采集或者结束采集需要回到寻宝界面
|
||||
if ((boolean) data.obj) {
|
||||
setMainButtonVisiable(View.VISIBLE);
|
||||
frameLayout.setVisibility(View.GONE);
|
||||
fragmentTransaction.remove(gatherGetFragment);
|
||||
if (bigMarker != null) {
|
||||
bigMarker.setVisible(false);
|
||||
}
|
||||
for (int i = 0; i < removablesMarker.size(); i++) {
|
||||
removablesMarker.get(i).remove();
|
||||
}
|
||||
removablesMarker.clear();
|
||||
Toast.makeText(getActivity(), "不在作业范围", Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
frameLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1188,7 +1151,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (otherFragment != null) {
|
||||
fragmentTransaction.remove(otherFragment);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -1206,9 +1168,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
ivMessage.setVisibility(visiable);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void initPoiMarker(LatLng latLng) {
|
||||
LatLng mapCenterPoint = getMapCenterPoint();
|
||||
CameraUpdate cameraSigma = CameraUpdateFactory.newCameraPosition(new CameraPosition(
|
||||
@ -1225,15 +1184,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (markerPoi != null) {
|
||||
markerPoi.setFixingPoint(screenPosition.x, screenPosition.y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
public void onCancel() {}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initPileMarker(LatLng latLng) {
|
||||
@ -1252,15 +1206,10 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
if (markerPile != null) {
|
||||
markerPile.setFixingPoint(screenPosition.x, screenPosition.y);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
|
||||
}
|
||||
public void onCancel() {}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void initCheckedPileMarker(int poiWord) {
|
||||
@ -1429,7 +1378,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_road, "道路"));
|
||||
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_chongdianzhuang, "充电站"));
|
||||
itemList.add(new ShareDialog.Item(getContext(), R.drawable.push_qingbao, "其他"));
|
||||
|
||||
Bundle bundle = new Bundle();
|
||||
PoiEntity poiEntity = new PoiEntity();
|
||||
// 上报时以当前用户位置为准
|
||||
@ -1437,7 +1385,7 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
ToastUtil.showShort(getContext(), "无法获取当前位置,请检查GPS是否打开!");
|
||||
return;
|
||||
}
|
||||
// LatLng mapCenterPoint = getMapCenterPoint();
|
||||
// LatLng mapCenterPoint = getMapCenterPoint();
|
||||
LatLng newPoiLatLng = new LatLng(Constant.currentLocation.getLatitude(), Constant.currentLocation.getLongitude());
|
||||
poiEntity.setX(newPoiLatLng.getLongitude() + "");
|
||||
poiEntity.setY(newPoiLatLng.getLatitude() + "");
|
||||
@ -1481,7 +1429,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
initList(Constant.currentLocation);
|
||||
FilterFragment filterFragment = FilterFragment.newInstance(new Bundle());
|
||||
showSlidingFragment(filterFragment);
|
||||
|
||||
break;
|
||||
case R.id.iv_message:
|
||||
Intent messageIntent = new Intent(getContext(), FragmentManagement.class);
|
||||
@ -1503,7 +1450,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
} else if (type == 5) {
|
||||
markerPoi = tencentMap.addMarker(new MarkerOptions(latLng).icon(bitmapDescriptor5).zIndex(2));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1522,7 +1468,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
private void showSlidingFragment(BaseDrawerFragment fragment) {
|
||||
fragmentTransaction = supportFragmentManager.beginTransaction();
|
||||
int[] deviceInfo = DensityUtil.getDeviceInfo(getActivity());
|
||||
|
||||
sliding_layout.setPanelHeight(deviceInfo[1] / 2);
|
||||
sliding_layout.setPanelState(SlidingUpPanelLayout.PanelState.COLLAPSED);
|
||||
fragmentTransaction.add(R.id.scroll_view, fragment, fragment.getClass().getName());
|
||||
@ -1532,7 +1477,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
fragmentTransaction.hide(filterFragment);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(fragment instanceof ChargingStationFragment)) {
|
||||
ChargingStationFragment chargingStationFragment = (ChargingStationFragment) supportFragmentManager.findFragmentByTag(ChargingStationFragment.class.getName());
|
||||
if (chargingStationFragment != null) {
|
||||
@ -1566,7 +1510,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
* 检查网络状态
|
||||
*/
|
||||
private void checkNetWork() {
|
||||
|
||||
if (NetWorkUtils.iConnected(getContext())) { // 当前网络可用
|
||||
checkMyLocation();
|
||||
} else { // 当前网络不可用
|
||||
@ -1579,7 +1522,6 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
* 检查所需权限
|
||||
*/
|
||||
private void checkMyLocation() {
|
||||
|
||||
// 1.判断是否拥有定位的权限
|
||||
// 1.1 拥有权限进行相应操作
|
||||
// 1.2 没有权限申请权限
|
||||
@ -1587,23 +1529,19 @@ public class TreasureFragment extends BaseFragment implements View.OnClickListen
|
||||
// 1.2.1.1 用户给予权限进行相应操作
|
||||
// 1.2.1.2 用户没有给予权限 作出相应提示
|
||||
// 1.2.2 某些5.0权限的手机执行相应操作
|
||||
|
||||
XXPermissions.with(this)
|
||||
.permission(Permission.ACCESS_COARSE_LOCATION)
|
||||
.request(new OnPermissionCallback() {
|
||||
|
||||
@Override
|
||||
public void onGranted(List<String> permissions, boolean all) {
|
||||
if (all) {
|
||||
//建立定位
|
||||
initLocation();
|
||||
|
||||
} else {
|
||||
dismissLoadingDialog();
|
||||
Toast.makeText(getActivity(), "申请权限失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied(List<String> permissions, boolean never) {
|
||||
if (never) {
|
||||
|
@ -92,13 +92,17 @@ public class HttpInterface {
|
||||
//172.23.139.4:8001/m4/userAuth/add
|
||||
public static final String USER_AUTH_ADD = IPm7 + "/userAuth/add"; //实名认证
|
||||
|
||||
|
||||
/**
|
||||
* 面状任务
|
||||
*/
|
||||
public static final String RECEIVED_POLYGON_TASK = IPm6 + "polygonTask/1/receivedPolygontask"; //任务领取
|
||||
public static final String UNRECEIVED_POLYGON_TASK = IPm6 + "polygonTask/1/unReceivedPolygontask";//结束领取
|
||||
public static final String COMPLETE = IPm6 + "polygonTask/1/complete";//任务采集
|
||||
public static final String SUBMIT_POLYGON_TASK = IPm6 + "polygonTask/1/submitPolygontask";//结束采集
|
||||
|
||||
|
||||
public static final String IPm8 = "http://172.23.139.4:8003/m4/";
|
||||
//http://172.23.139.4:8003/m4/task/1/unReceivedTask?taskIds=&auditIds=214,278
|
||||
public static final String UN_RECEIVED_TASK = IPm8 + "task/1/unReceivedTask";//所以类型的结束领取
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user