huyuguo лет назад: 4
Родитель
Сommit
6f52f6ddb3

+ 274 - 154
app/src/main/java/com/electric/chargingpile/activity/MainMapActivity.java

@ -5145,32 +5145,35 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
5145 5145
        final String poi_wei = JsonUtils.getKeyResult(info, "poi_wei");
5146 5146
        final String fenshi_is = JsonUtils.getKeyResult(info, "fenshi_is");
5147 5147
        final String telephone = JsonUtils.getKeyResult(info, "telephone");
5148
5149 5148
        TextView fenshi_info_textview = findViewById(R.id.fenshi_info_textview);
5149
        fenshi_info_textview.setText("");
5150
5150 5151
        if ("1".equals(fenshi_is)) {
5151 5152
            final String fenshi_info = JsonUtils.getKeyResult(info, "fenshi_info");
5152 5153
            ArrayList<PileData.FenshiInfoBean> fenshiList = (ArrayList<PileData.FenshiInfoBean>) JsonUtils.parseToObjectList(fenshi_info, PileData.FenshiInfoBean.class);
5153
            Calendar calendar = Calendar.getInstance();
5154
            int hours = calendar.get(Calendar.HOUR_OF_DAY);
5155
            int minutes = calendar.get(Calendar.MINUTE);
5156
            int totalMinutes = hours * 60 + minutes;
5157
5158
            for (PileData.FenshiInfoBean bean : fenshiList) {
5159
                if (bean.getStartTotalMinutes() > totalMinutes) {
5160
                    double service_free = 0;
5161
                    double charge_free = 0;
5162
                    try {
5163
                        service_free = Double.valueOf(bean.getService_free());
5164
                        charge_free = Double.valueOf(bean.getCharge_free());
5165
                    } catch (Exception e) {
5166
                        e.printStackTrace();
5154
            if (fenshiList.size() == 1) {
5155
                fenshi_info_textview.setText("全天价格统一");
5156
            } else {
5157
                Calendar calendar = Calendar.getInstance();
5158
                int hours = calendar.get(Calendar.HOUR_OF_DAY);
5159
                int minutes = calendar.get(Calendar.MINUTE);
5160
                int totalMinutes = hours * 60 + minutes;
5161
5162
                for (PileData.FenshiInfoBean bean : fenshiList) {
5163
                    if (bean.getStartTotalMinutes() > totalMinutes) {
5164
                        double service_free = 0;
5165
                        double charge_free = 0;
5166
                        try {
5167
                            service_free = Double.valueOf(bean.getService_free());
5168
                            charge_free = Double.valueOf(bean.getCharge_free());
5169
                        } catch (Exception e) {
5170
                            e.printStackTrace();
5171
                        }
5172
                        fenshi_info_textview.setText(String.format("%s开始 %.2f元/度", bean.getStart(), service_free + charge_free));
5173
                        break;
5167 5174
                    }
5168
                    fenshi_info_textview.setText(String.format("%s开始 %.2f元/度", bean.getStart(), service_free + charge_free));
5169
                    break;
5170 5175
                }
5171 5176
            }
5172
        } else {
5173
            fenshi_info_textview.setText("");
5174 5177
        }
5175 5178
5176 5179
        if (belong_attribute != null && belong_attribute.contains("私人")) {
@ -5638,155 +5641,282 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
5638 5641
        String total_num = JsonUtils.getKeyResult(zhanInfo, "total_num");
5639 5642
        String slow_num = JsonUtils.getKeyResult(zhanInfo, "slow_num");
5640 5643
        String fast_num = JsonUtils.getKeyResult(zhanInfo, "fast_num");
5641
        String remind = JsonUtils.getKeyResult(zhanInfo, "remind");
5644
        String remind = JsonUtils.getKeyResult(zhanInfo, "remind");  // remind 0 正常 2 休息中 other 故障
5642 5645
        final String city = JsonUtils.getKeyResult(zhanInfo, "city");
5643 5646
        final String poi_jing = JsonUtils.getKeyResult(zhanInfo, "poi_jing");
5644 5647
        final String poi_wei = JsonUtils.getKeyResult(zhanInfo, "poi_wei");
5645
5648
        String belongAttribute = JsonUtils.getKeyResult(zhanInfo, "belong_attribute");
5646 5649
5647 5650
        HashMap<String, String> mapp = new HashMap<String, String>();
5648 5651
        mapp.put("type", "导航");
5649 5652
        MobclickAgent.onEvent(context, "0102", mapp);
5650 5653
        mapp.clear();
5651
        if (remind.equals("0")) {
5652
            if (!isAvilible(getApplicationContext(), "com.baidu.BaiduMap") &&
5653
                    !isAvilible(getApplicationContext(), "com.autonavi.minimap")) {
5654
                if (null == center) {
5655
                    ToastUtil.showToast(getApplicationContext(), "请检查您当前网络或定位权限是否开启", Toast.LENGTH_SHORT);
5656
                } else {
5657
                    Intent intent = new Intent(getApplication(), BasicNaviActivity.class);
5658
                    intent.putExtra("start_jing", center.longitude + "");
5659
                    intent.putExtra("start_wei", center.latitude + "");
5660
                    intent.putExtra("stop_jing", ll.longitude + "");
5661
//                    Log.e("123", ll.longitude + "");
5662
                    intent.putExtra("stop_wei", ll.latitude + "");
5663
//                    Log.e("123", ll.latitude + "");
5664
                    startActivity(intent);
5665
                    detailsBack = true;
5666
                    HashMap<String, String> map = new HashMap<String, String>();
5667
                    map.put("Name", zhan_name);
5668
                    map.put("CostWay", charge_cost_way);
5669
                    map.put("City", city);
5670
                    MobclickAgent.onEvent(context, "0033", map);
5671
                    map.clear();
5672
                }
5673
            } else {
5674
                if (center != null) {
5675
                    LayoutInflater inflater1 = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
5676
                    popupWindowView = inflater1.inflate(R.layout.item_selectmap, null);
5677
                    popupWindow = new PopupWindow(popupWindowView,
5678
                            ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT,
5679
                            true);
5680
                    popupWindow.setBackgroundDrawable(new BitmapDrawable());
5681
                    // 设置PopupWindow的弹出和消失效果
5682
                    popupWindow.setAnimationStyle(R.style.popupAnimation);
5683
                    LinearLayout ll_tvTwo = (LinearLayout) popupWindowView.findViewById(R.id.ll_tvTwo);
5684
                    if (!isAvilible(getApplicationContext(), "com.autonavi.minimap")) {
5685
                        ll_tvTwo.setVisibility(View.GONE);
5654
        if (remind.equals("0")) { // 正常显示导航
5655
            if (belongAttribute.contains("私人")) {
5656
                new com.electric.chargingpile.view.AlertDialog(MainMapActivity.this).builder()
5657
                        .setMsg("该站为私人站点,建议\n先联系桩主后再前往")
5658
                        .setPositiveButton("继续", new View.OnClickListener() {
5659
                            @Override
5660
                            public void onClick(View v) {
5661
5662
                                if (!isAvilible(getApplicationContext(), "com.baidu.BaiduMap") && !isAvilible(getApplicationContext(), "com.autonavi.minimap")) {
5663
                                    if (null == center) {
5664
                                        ToastUtil.showToast(getApplicationContext(), "请检查您当前网络或定位权限是否开启", Toast.LENGTH_SHORT);
5665
                                    } else {
5666
                                        Intent intent = new Intent(getApplication(), BasicNaviActivity.class);
5667
                                        intent.putExtra("start_jing", center.longitude + "");
5668
                                        intent.putExtra("start_wei", center.latitude + "");
5669
                                        intent.putExtra("stop_jing", ll.longitude + "");
5670
                                        intent.putExtra("stop_wei", ll.latitude + "");
5671
                                        startActivity(intent);
5672
                                        detailsBack = true;
5673
                                        HashMap<String, String> map = new HashMap<String, String>();
5674
                                        map.put("Name", zhan_name);
5675
                                        map.put("CostWay", charge_cost_way);
5676
                                        map.put("City", city);
5677
                                        MobclickAgent.onEvent(context, "0033", map);
5678
                                        map.clear();
5679
                                    }
5680
                                } else {
5681
                                    if (center != null) {
5682
                                        LayoutInflater inflater1 = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
5683
                                        popupWindowView = inflater1.inflate(R.layout.item_selectmap, null);
5684
                                        popupWindow = new PopupWindow(popupWindowView, ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, true);
5685
                                        popupWindow.setBackgroundDrawable(new BitmapDrawable());
5686
                                        // 设置PopupWindow的弹出和消失效果
5687
                                        popupWindow.setAnimationStyle(R.style.popupAnimation);
5688
                                        LinearLayout ll_tvTwo = (LinearLayout) popupWindowView.findViewById(R.id.ll_tvTwo);
5689
                                        if (!isAvilible(getApplicationContext(), "com.autonavi.minimap")) {
5690
                                            ll_tvTwo.setVisibility(View.GONE);
5691
                                        }
5692
                                        LinearLayout ll_tvOne = (LinearLayout) popupWindowView.findViewById(R.id.ll_tvOne);
5693
                                        if (!isAvilible(getApplicationContext(), "com.baidu.BaiduMap")) {
5694
                                            ll_tvOne.setVisibility(View.GONE);
5695
                                        }
5696
                                        cancleButton = (Button) popupWindowView.findViewById(R.id.cancleButton);
5697
                                        cancleButton.setOnClickListener(new View.OnClickListener() {
5698
                                            @Override
5699
                                            public void onClick(View view) {
5700
                                                popupWindow.dismiss();
5701
                                            }
5702
                                        });
5703
                                        tvThree = (TextView) popupWindowView.findViewById(R.id.tvThree);
5704
                                        tvThree.setOnClickListener(new View.OnClickListener() {
5705
                                            @Override
5706
                                            public void onClick(View v) {
5707
                                                Intent intent = new Intent(getApplication(), BasicNaviActivity.class);
5708
                                                intent.putExtra("start_jing", center.longitude + "");
5709
                                                intent.putExtra("start_wei", center.latitude + "");
5710
                                                intent.putExtra("stop_jing", ll.longitude + "");
5711
                                                intent.putExtra("stop_wei", ll.latitude + "");
5712
                                                startActivity(intent);
5713
                                                detailsBack = true;
5714
                                                popupWindow.dismiss();
5715
                                                HashMap<String, String> map = new HashMap<String, String>();
5716
                                                map.put("Name", zhan_name);
5717
                                                map.put("CostWay", charge_cost_way);
5718
                                                map.put("City", city);
5719
                                                MobclickAgent.onEvent(context, "0033", map);
5720
                                                map.clear();
5721
                                            }
5722
                                        });
5723
                                        tvOne = (TextView) popupWindowView.findViewById(R.id.tvOne);
5724
                                        tvOne.setOnClickListener(new View.OnClickListener() {
5725
                                            @Override
5726
                                            public void onClick(View view) {
5727
                                                Intent intent = null;
5728
                                                int position_jing = poi_jing.length() - poi_jing.indexOf(".") - 1;
5729
                                                int position_wei = poi_wei.length() - poi_wei.indexOf(".") - 1;
5730
                                                if (position_jing > 13 || position_wei > 13) {
5731
                                                    getBaidu1(Double.parseDouble(poi_jing), Double.parseDouble(poi_wei));
5732
                                                } else {
5733
                                                    bd_jing = Double.parseDouble(poi_jing);
5734
                                                    bd_wei = Double.parseDouble(poi_wei);
5735
                                                }
5736
                                                getBaidu(center.longitude, center.latitude);
5737
                                                try {
5738
                                                    String s = "intent://map/direction?" + "origin=" + bd_lat + "," + bd_lon + "&" + "destination=" + bd_wei + "," + bd_jing + "&mode=driving&" + "src=充电桩#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end";
5739
                                                    intent = Intent.getIntent(s);
5740
                                                    detailsBack = true;
5741
                                                    HashMap<String, String> map = new HashMap<String, String>();
5742
                                                    map.put("Name", zhan_name);
5743
                                                    map.put("CostWay", charge_cost_way);
5744
                                                    map.put("City", city);
5745
                                                    MobclickAgent.onEvent(context, "0031", map);
5746
                                                    map.clear();
5747
                                                } catch (URISyntaxException e) {
5748
                                                    e.printStackTrace();
5749
                                                }
5750
                                                startActivity(intent);
5751
                                                popupWindow.dismiss();
5752
5753
                                            }
5754
5755
                                        });
5756
                                        tvTwo = (TextView) popupWindowView.findViewById(R.id.tvTwo);
5757
                                        tvTwo.setOnClickListener(new View.OnClickListener() {
5758
                                            @Override
5759
                                            public void onClick(View view) {
5760
                                                try {
5761
                                                    Intent intent4 = new Intent("android.intent.action.VIEW", android.net.Uri.parse("androidamap://route?sourceApplication=amap&slat=" + center.latitude + "&slon=" + center.longitude + "&sname=我的位置&dlat=" + ll.latitude + "&dlon=" + ll.longitude + "&dname=" + zhan_name + "&dev=0&m=0&t=2"));
5762
                                                    intent4.setPackage("com.autonavi.minimap");
5763
                                                    startActivity(intent4);
5764
                                                    detailsBack = true;
5765
                                                    popupWindow.dismiss();
5766
                                                    HashMap<String, String> map = new HashMap<String, String>();
5767
                                                    map.put("Name", zhan_name);
5768
                                                    map.put("CostWay", charge_cost_way);
5769
                                                    map.put("City", city);
5770
                                                    MobclickAgent.onEvent(context, "0032", map);
5771
                                                    map.clear();
5772
                                                } catch (Exception e) {
5773
                                                    e.printStackTrace();
5774
                                                    Toast.makeText(getApplication(), "请您确认是否安装高德地图APP", Toast.LENGTH_SHORT).show();
5775
                                                }
5776
5777
                                            }
5778
                                        });
5779
                                        popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
5780
                                    } else {
5781
                                        Toast.makeText(getApplication(), "没有定位到您的当前位置", Toast.LENGTH_SHORT).show();
5782
                                    }
5783
                                }
5784
5785
                            }
5786
                        }).setNegativeButton("取消", new View.OnClickListener() {
5787
                    @Override
5788
                    public void onClick(View v) {
5789
5686 5790
                    }
5687
                    LinearLayout ll_tvOne = (LinearLayout) popupWindowView.findViewById(R.id.ll_tvOne);
5688
                    if (!isAvilible(getApplicationContext(), "com.baidu.BaiduMap")) {
5689
                        ll_tvOne.setVisibility(View.GONE);
5791
                }).show();
5792
            } else {
5793
5794
                if (!isAvilible(getApplicationContext(), "com.baidu.BaiduMap") && !isAvilible(getApplicationContext(), "com.autonavi.minimap")) {
5795
                    if (null == center) {
5796
                        ToastUtil.showToast(getApplicationContext(), "请检查您当前网络或定位权限是否开启", Toast.LENGTH_SHORT);
5797
                    } else {
5798
                        Intent intent = new Intent(getApplication(), BasicNaviActivity.class);
5799
                        intent.putExtra("start_jing", center.longitude + "");
5800
                        intent.putExtra("start_wei", center.latitude + "");
5801
                        intent.putExtra("stop_jing", ll.longitude + "");
5802
                        intent.putExtra("stop_wei", ll.latitude + "");
5803
                        startActivity(intent);
5804
                        detailsBack = true;
5805
                        HashMap<String, String> map = new HashMap<String, String>();
5806
                        map.put("Name", zhan_name);
5807
                        map.put("CostWay", charge_cost_way);
5808
                        map.put("City", city);
5809
                        MobclickAgent.onEvent(context, "0033", map);
5810
                        map.clear();
5690 5811
                    }
5691
                    cancleButton = (Button) popupWindowView
5692
                            .findViewById(R.id.cancleButton);
5693
                    cancleButton.setOnClickListener(new View.OnClickListener() {
5694
                        @Override
5695
                        public void onClick(View view) {
5696
//                        Toast.makeText(ZhanDetailsNew.this, "NO", Toast.LENGTH_SHORT).show();
5697
                            popupWindow.dismiss();
5812
                } else {
5813
                    if (center != null) {
5814
                        LayoutInflater inflater1 = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
5815
                        popupWindowView = inflater1.inflate(R.layout.item_selectmap, null);
5816
                        popupWindow = new PopupWindow(popupWindowView, ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT, true);
5817
                        popupWindow.setBackgroundDrawable(new BitmapDrawable());
5818
                        // 设置PopupWindow的弹出和消失效果
5819
                        popupWindow.setAnimationStyle(R.style.popupAnimation);
5820
                        LinearLayout ll_tvTwo = (LinearLayout) popupWindowView.findViewById(R.id.ll_tvTwo);
5821
                        if (!isAvilible(getApplicationContext(), "com.autonavi.minimap")) {
5822
                            ll_tvTwo.setVisibility(View.GONE);
5698 5823
                        }
5699
                    });
5700
                    tvThree = (TextView) popupWindowView.findViewById(R.id.tvThree);
5701
                    tvThree.setOnClickListener(new View.OnClickListener() {
5702
                        @Override
5703
                        public void onClick(View v) {
5704
                            Intent intent = new Intent(getApplication(), BasicNaviActivity.class);
5705
                            intent.putExtra("start_jing", center.longitude + "");
5706
                            intent.putExtra("start_wei", center.latitude + "");
5707
                            intent.putExtra("stop_jing", ll.longitude + "");
5708
                            intent.putExtra("stop_wei", ll.latitude + "");
5709
                            startActivity(intent);
5710
                            detailsBack = true;
5711
                            popupWindow.dismiss();
5712
                            HashMap<String, String> map = new HashMap<String, String>();
5713
                            map.put("Name", zhan_name);
5714
                            map.put("CostWay", charge_cost_way);
5715
                            map.put("City", city);
5716
                            MobclickAgent.onEvent(context, "0033", map);
5717
                            map.clear();
5824
                        LinearLayout ll_tvOne = (LinearLayout) popupWindowView.findViewById(R.id.ll_tvOne);
5825
                        if (!isAvilible(getApplicationContext(), "com.baidu.BaiduMap")) {
5826
                            ll_tvOne.setVisibility(View.GONE);
5718 5827
                        }
5719
                    });
5720
                    tvOne = (TextView) popupWindowView.findViewById(R.id.tvOne);
5721
                    tvOne.setOnClickListener(new View.OnClickListener() {
5722
                        @Override
5723
                        public void onClick(View view) {
5724
                            Intent intent = null;
5725
                            int position_jing = poi_jing.length() - poi_jing.indexOf(".") - 1;
5726
                            int position_wei = poi_wei.length() - poi_wei.indexOf(".") - 1;
5727
                            if (position_jing > 13 || position_wei > 13) {
5728
                                getBaidu1(Double.parseDouble(poi_jing), Double.parseDouble(poi_wei));
5729
                            } else {
5730
                                bd_jing = Double.parseDouble(poi_jing);
5731
                                bd_wei = Double.parseDouble(poi_wei);
5828
                        cancleButton = (Button) popupWindowView.findViewById(R.id.cancleButton);
5829
                        cancleButton.setOnClickListener(new View.OnClickListener() {
5830
                            @Override
5831
                            public void onClick(View view) {
5832
                                popupWindow.dismiss();
5732 5833
                            }
5733
                            getBaidu(center.longitude, center.latitude);
5734
                            try {
5735
                                String s = "intent://map/direction?" +
5736
                                        "origin=" + bd_lat + "," + bd_lon + "&" +
5737
                                        "destination=" + bd_wei + "," + bd_jing +
5738
                                        "&mode=driving&" +
5739
                                        "src=充电桩#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end";
5740
//                                    Log.e("sss", s);
5741
                                intent = Intent.getIntent(s);
5834
                        });
5835
                        tvThree = (TextView) popupWindowView.findViewById(R.id.tvThree);
5836
                        tvThree.setOnClickListener(new View.OnClickListener() {
5837
                            @Override
5838
                            public void onClick(View v) {
5839
                                Intent intent = new Intent(getApplication(), BasicNaviActivity.class);
5840
                                intent.putExtra("start_jing", center.longitude + "");
5841
                                intent.putExtra("start_wei", center.latitude + "");
5842
                                intent.putExtra("stop_jing", ll.longitude + "");
5843
                                intent.putExtra("stop_wei", ll.latitude + "");
5844
                                startActivity(intent);
5742 5845
                                detailsBack = true;
5846
                                popupWindow.dismiss();
5743 5847
                                HashMap<String, String> map = new HashMap<String, String>();
5744 5848
                                map.put("Name", zhan_name);
5745 5849
                                map.put("CostWay", charge_cost_way);
5746 5850
                                map.put("City", city);
5747
                                MobclickAgent.onEvent(context, "0031", map);
5851
                                MobclickAgent.onEvent(context, "0033", map);
5748 5852
                                map.clear();
5749
                            } catch (URISyntaxException e) {
5750
                                e.printStackTrace();
5751 5853
                            }
5752
                            startActivity(intent);
5753
                            popupWindow.dismiss();
5754
5755
                        }
5756
5757
                    });
5758
                    tvTwo = (TextView) popupWindowView.findViewById(R.id.tvTwo);
5759
                    tvTwo.setOnClickListener(new View.OnClickListener() {
5760
                        @Override
5761
                        public void onClick(View view) {
5762
                            try {
5763
                                Intent intent4 = new Intent("android.intent.action.VIEW",
5764
                                        android.net.Uri.parse("androidamap://route?sourceApplication=amap&slat=" + center.latitude + "&slon=" + center.longitude + "&sname=我的位置&dlat=" + ll.latitude + "&dlon=" + ll.longitude + "&dname=" + zhan_name + "&dev=0&m=0&t=2"));
5765
                                intent4.setPackage("com.autonavi.minimap");
5766
                                startActivity(intent4);
5767
                                detailsBack = true;
5854
                        });
5855
                        tvOne = (TextView) popupWindowView.findViewById(R.id.tvOne);
5856
                        tvOne.setOnClickListener(new View.OnClickListener() {
5857
                            @Override
5858
                            public void onClick(View view) {
5859
                                Intent intent = null;
5860
                                int position_jing = poi_jing.length() - poi_jing.indexOf(".") - 1;
5861
                                int position_wei = poi_wei.length() - poi_wei.indexOf(".") - 1;
5862
                                if (position_jing > 13 || position_wei > 13) {
5863
                                    getBaidu1(Double.parseDouble(poi_jing), Double.parseDouble(poi_wei));
5864
                                } else {
5865
                                    bd_jing = Double.parseDouble(poi_jing);
5866
                                    bd_wei = Double.parseDouble(poi_wei);
5867
                                }
5868
                                getBaidu(center.longitude, center.latitude);
5869
                                try {
5870
                                    String s = "intent://map/direction?" + "origin=" + bd_lat + "," + bd_lon + "&" + "destination=" + bd_wei + "," + bd_jing + "&mode=driving&" + "src=充电桩#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end";
5871
                                    intent = Intent.getIntent(s);
5872
                                    detailsBack = true;
5873
                                    HashMap<String, String> map = new HashMap<String, String>();
5874
                                    map.put("Name", zhan_name);
5875
                                    map.put("CostWay", charge_cost_way);
5876
                                    map.put("City", city);
5877
                                    MobclickAgent.onEvent(context, "0031", map);
5878
                                    map.clear();
5879
                                } catch (URISyntaxException e) {
5880
                                    e.printStackTrace();
5881
                                }
5882
                                startActivity(intent);
5768 5883
                                popupWindow.dismiss();
5769
                                HashMap<String, String> map = new HashMap<String, String>();
5770
                                map.put("Name", zhan_name);
5771
                                map.put("CostWay", charge_cost_way);
5772
                                map.put("City", city);
5773
                                MobclickAgent.onEvent(context, "0032", map);
5774
                                map.clear();
5775
                            } catch (Exception e) {
5776
                                e.printStackTrace();
5777
                                Toast.makeText(getApplication(), "请您确认是否安装高德地图APP", Toast.LENGTH_SHORT).show();
5884
5778 5885
                            }
5779 5886
5780
                        }
5781
                    });
5782
                    popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
5783
//                                            startNavi(center, ll);
5784
                } else {
5785
                    Toast.makeText(getApplication(),
5786
                            "没有定位到您的当前位置", Toast.LENGTH_SHORT)
5787
                            .show();
5887
                        });
5888
                        tvTwo = (TextView) popupWindowView.findViewById(R.id.tvTwo);
5889
                        tvTwo.setOnClickListener(new View.OnClickListener() {
5890
                            @Override
5891
                            public void onClick(View view) {
5892
                                try {
5893
                                    Intent intent4 = new Intent("android.intent.action.VIEW", android.net.Uri.parse("androidamap://route?sourceApplication=amap&slat=" + center.latitude + "&slon=" + center.longitude + "&sname=我的位置&dlat=" + ll.latitude + "&dlon=" + ll.longitude + "&dname=" + zhan_name + "&dev=0&m=0&t=2"));
5894
                                    intent4.setPackage("com.autonavi.minimap");
5895
                                    startActivity(intent4);
5896
                                    detailsBack = true;
5897
                                    popupWindow.dismiss();
5898
                                    HashMap<String, String> map = new HashMap<String, String>();
5899
                                    map.put("Name", zhan_name);
5900
                                    map.put("CostWay", charge_cost_way);
5901
                                    map.put("City", city);
5902
                                    MobclickAgent.onEvent(context, "0032", map);
5903
                                    map.clear();
5904
                                } catch (Exception e) {
5905
                                    e.printStackTrace();
5906
                                    Toast.makeText(getApplication(), "请您确认是否安装高德地图APP", Toast.LENGTH_SHORT).show();
5907
                                }
5908
5909
                            }
5910
                        });
5911
                        popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
5912
                    } else {
5913
                        Toast.makeText(getApplication(), "没有定位到您的当前位置", Toast.LENGTH_SHORT).show();
5914
                    }
5788 5915
                }
5916
5789 5917
            }
5918
5919
5790 5920
        } else if (remind.equals("2")) {
5791 5921
            new com.electric.chargingpile.view.AlertDialog(MainMapActivity.this).builder()
5792 5922
                    .setTitle("暂时未营业")
@ -5800,9 +5930,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
5800 5930
                                intent.putExtra("start_jing", center.longitude + "");
5801 5931
                                intent.putExtra("start_wei", center.latitude + "");
5802 5932
                                intent.putExtra("stop_jing", ll.longitude + "");
5803
//                    Log.e("123", ll.longitude + "");
5804 5933
                                intent.putExtra("stop_wei", ll.latitude + "");
5805
//                    Log.e("123", ll.latitude + "");
5806 5934
                                startActivity(intent);
5807 5935
                                detailsBack = true;
5808 5936
                                HashMap<String, String> map = new HashMap<String, String>();
@ -5834,7 +5962,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
5834 5962
                                    cancleButton.setOnClickListener(new View.OnClickListener() {
5835 5963
                                        @Override
5836 5964
                                        public void onClick(View view) {
5837
//                        Toast.makeText(ZhanDetailsNew.this, "NO", Toast.LENGTH_SHORT).show();
5838 5965
                                            popupWindow.dismiss();
5839 5966
                                        }
5840 5967
                                    });
@ -5873,12 +6000,7 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
5873 6000
                                            }
5874 6001
                                            getBaidu(center.longitude, center.latitude);
5875 6002
                                            try {
5876
                                                String s = "intent://map/direction?" +
5877
                                                        "origin=" + bd_lat + "," + bd_lon + "&" +
5878
                                                        "destination=" + bd_wei + "," + bd_jing +
5879
                                                        "&mode=driving&" +
5880
                                                        "src=充电桩#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end";
5881
//                                    Log.e("sss", s);
6003
                                                String s = "intent://map/direction?" + "origin=" + bd_lat + "," + bd_lon + "&" + "destination=" + bd_wei + "," + bd_jing + "&mode=driving&" + "src=充电桩#Intent;scheme=bdapp;package=com.baidu.BaiduMap;end";
5882 6004
                                                intent = Intent.getIntent(s);
5883 6005
                                                detailsBack = true;
5884 6006
                                                HashMap<String, String> map = new HashMap<String, String>();
@ -5892,7 +6014,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
5892 6014
                                            }
5893 6015
                                            startActivity(intent);
5894 6016
                                            popupWindow.dismiss();
5895
5896 6017
                                        }
5897 6018
5898 6019
                                    });
@ -5921,7 +6042,6 @@ public class MainMapActivity extends Activity implements LocationSource, AMapLoc
5921 6042
                                        }
5922 6043
                                    });
5923 6044
                                    popupWindow.showAtLocation(cancleButton, Gravity.CENTER, 0, 0);
5924
//                                            startNavi(center, ll);
5925 6045
                                } else {
5926 6046
                                    ToastUtil.showToast(getApplicationContext(), "请检查您当前网络或定位权限是否开启", Toast.LENGTH_SHORT);
5927 6047
                                }

+ 3 - 6
app/src/main/java/com/electric/chargingpile/activity/RecommendZhanActivity.java

@ -193,7 +193,6 @@ public class RecommendZhanActivity extends Activity implements View.OnClickListe
193 193
        switch (v.getId()) {
194 194
            case R.id.tv_help:
195 195
                Intent intentt = new Intent(getApplication(), RoutePlanSelectAddressActivity.class);
196
//                intentt.putExtra("url", "http://evcharge.cc/cdz/recomment-descr.html");
197 196
                startActivity(intentt);
198 197
                break;
199 198
            case R.id.iv_back:
@ -731,8 +730,7 @@ public class RecommendZhanActivity extends Activity implements View.OnClickListe
731 730
            } else if (i + 1 == 3) {
732 731
                item_zhan_num.setImageResource(R.drawable.re_three);
733 732
                bitmap = BitmapDescriptorFactory.fromResource(R.drawable.icon_recommend_three);
734
                MarkerOptions recommend_marker = new MarkerOptions().position(ll).icon(bitmap)
735
                        .anchor(0.5f, 1.0f).zIndex(3);
733
                MarkerOptions recommend_marker = new MarkerOptions().position(ll).icon(bitmap).anchor(0.5f, 1.0f).zIndex(3);
736 734
                Zhan z = new Zhan();
737 735
                z.setId(3);
738 736
                recommend_marker_three = (Marker) aMap.addMarker(recommend_marker);
@ -886,9 +884,8 @@ public class RecommendZhanActivity extends Activity implements View.OnClickListe
886 884
                @Override
887 885
                public void onClick(View view) {
888 886
                    MobclickAgent.onEvent(getApplicationContext(), "0402");
889
                    Intent intent = new Intent(getApplication(),
890
                            NewZhanDetailsActivity.class);
891
                    intent.putExtra("zhan_id", rz.getZhan_id());
887
                    Intent intent = new Intent(getApplication(), NewZhanDetailsActivity.class);
888
                    intent.putExtra("zhan_id", rz.getId());
892 889
                    startActivity(intent);
893 890
                }
894 891
            });

+ 1 - 1
app/src/main/res/layout/activity_main_map.xml

@ -93,7 +93,7 @@
93 93
                android:background="#f1f1f1"
94 94
                android:ellipsize="end"
95 95
                android:singleLine="true"
96
                android:text="@string/chargingpile_search"
96
                android:text="请输入地址/关键字"
97 97
                android:textColor="@color/ui_68"
98 98
                android:textSize="14sp" />
99 99

+ 1 - 3
app/src/main/res/layout/activity_private_zhuang_info.xml

@ -476,7 +476,6 @@
476 476
                    android:layout_toLeftOf="@+id/imageView2"
477 477
                    android:layout_weight="1"
478 478
                    android:background="@color/white"
479
                    android:editable="true"
480 479
                    android:gravity="center"
481 480
                    android:hint="桩数"
482 481
                    android:inputType="number"
@ -798,10 +797,9 @@
798 797
                    android:layout_marginRight="44px"
799 798
                    android:layout_weight="5"
800 799
                    android:background="@color/white"
801
                    android:editable="true"
802 800
                    android:gravity="center|right"
803 801
                    android:hint="请输入手机号码"
804
                    android:inputType="text"
802
                    android:inputType="number"
805 803
                    android:text=""
806 804
                    android:textColor="@color/ui_62"
807 805
                    android:textColorHint="@color/ui_68"

+ 0 - 6
app/src/main/res/layout/activity_recommend_zhan.xml

@ -156,12 +156,6 @@
156 156
            android:textSize="13sp"
157 157
            android:visibility="gone"/>
158 158
159
160
161
162
163
164
165 159
        <RelativeLayout
166 160
            android:layout_width="match_parent"
167 161
            android:layout_height="36dp"