Browse Source

完成小桔接入

hy 1 year ago
parent
commit
0ee080c1a8

+ 2 - 1
app/build.gradle

294
    implementation 'cn.jiguang.sdk:jcore:3.2.2'
294
    implementation 'cn.jiguang.sdk:jcore:3.2.2'
295
    //车牌键盘
295
    //车牌键盘
296
    implementation 'com.github.jenly1314:kingkeyboard:1.0.4'
296
    implementation 'com.github.jenly1314:kingkeyboard:1.0.4'
297
297
    // 权限请求框架:https://github.com/getActivity/XXPermissions
298
    implementation 'com.github.getActivity:XXPermissions:16.2'
298
    //极速版 (预计占用 4M 左右空间),主要移除了一些不常用的编解码器
299
    //极速版 (预计占用 4M 左右空间),主要移除了一些不常用的编解码器
299
//    implementation 'com.github.microshow:RxFFmpeg:4.9.0-lite'
300
//    implementation 'com.github.microshow:RxFFmpeg:4.9.0-lite'
300
}
301
}

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

94
                Intent intent1 = new Intent(getApplication(), MyWebViewActivity.class);
94
                Intent intent1 = new Intent(getApplication(), MyWebViewActivity.class);
95
                String web1 = null;
95
                String web1 = null;
96
                try {
96
                try {
97
                    web1 = "https://cdz.evcharge.cc/zhannew/basic/web/index.php/discount/redlist?userid=" + MainApplication.userId + "&token=" + URLEncoder.encode(DES3.encode(token1));
97
                    web1 = MainApplication.url+"/zhannew/basic/web/index.php/discount/redlist?userid=" + MainApplication.userId + "&token=" + URLEncoder.encode(DES3.encode(token1));
98
                } catch (Exception e) {
98
                } catch (Exception e) {
99
                    e.printStackTrace();
99
                    e.printStackTrace();
100
                }
100
                }
109
                Intent intent2 = new Intent(getApplication(), MyWebViewActivity.class);
109
                Intent intent2 = new Intent(getApplication(), MyWebViewActivity.class);
110
                String web2 = null;
110
                String web2 = null;
111
                try {
111
                try {
112
                    web2 = "https://cdz.evcharge.cc/zhannew/basic/web/index.php/discount/powerlist?userid=" + MainApplication.userId + "&token=" + URLEncoder.encode(DES3.encode(token2));
112
                    web2 = MainApplication.url+"/zhannew/basic/web/index.php/discount/powerlist?userid=" + MainApplication.userId + "&token=" + URLEncoder.encode(DES3.encode(token2));
113
                } catch (Exception e) {
113
                } catch (Exception e) {
114
                    e.printStackTrace();
114
                    e.printStackTrace();
115
                }
115
                }
125
                Intent intent3 = new Intent(getApplication(), MyWebViewActivity.class);
125
                Intent intent3 = new Intent(getApplication(), MyWebViewActivity.class);
126
                String web3 = null;
126
                String web3 = null;
127
                try {
127
                try {
128
                    web3 = "https://cdz.evcharge.cc/zhannew/basic/web/index.php/zhaninvoice/index?userid=" + MainApplication.userId + "&token=" + URLEncoder.encode(DES3.encode(token3));
128
                    web3 = MainApplication.url+"/zhannew/basic/web/index.php/zhaninvoice/index?userid=" + MainApplication.userId + "&token=" + URLEncoder.encode(DES3.encode(token3));
129
                } catch (Exception e) {
129
                } catch (Exception e) {
130
                    e.printStackTrace();
130
                    e.printStackTrace();
131
                }
131
                }

+ 0 - 3
app/src/main/java/com/electric/chargingpile/activity/RecommendChargingStationActivity.java

260
        @Override
260
        @Override
261
        public void onBindViewHolder(ViewHolder holder, int position) {
261
        public void onBindViewHolder(ViewHolder holder, int position) {
262
            RecommendZhan recommendZhan = mList.get(position);
262
            RecommendZhan recommendZhan = mList.get(position);
263
            holder.tvLock.setOnClickListener(v->{
264
                LockStatusDialog.newInstart().show(getSupportFragmentManager());
265
            });
266
            holder.station_item.setOnClickListener(new View.OnClickListener() {
263
            holder.station_item.setOnClickListener(new View.OnClickListener() {
267
                @Override
264
                @Override
268
                public void onClick(View v) {
265
                public void onClick(View v) {

+ 19 - 13
app/src/main/java/com/electric/chargingpile/activity/TLDLoadingActivity.java

3
import android.app.Activity;
3
import android.app.Activity;
4
import android.content.Intent;
4
import android.content.Intent;
5
import android.os.Bundle;
5
import android.os.Bundle;
6
import android.util.Log;
6
import android.view.KeyEvent;
7
import android.view.KeyEvent;
7
import android.widget.TextView;
8
import android.widget.TextView;
8
import android.widget.Toast;
9
import android.widget.Toast;
120
                    LogUtils.e("query:" + response);
121
                    LogUtils.e("query:" + response);
121
                    String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
122
                    String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
122
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
123
                    String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
123
                    if ("01".equals(rtnCode)) {
124
                        String data = JsonUtils.getKeyResult(response, "data");
125
                        ChargingBean chargingBean = JsonUtils.parseToObjectBean(data, ChargingBean.class);
126
                        if (chargingBean.getStatus() == 1) {
127
                            MainApplication.isAppStart = true;
128
                            ProfileManager.getInstance().setAppStart(getApplicationContext(), MainApplication.isAppStart);
129
                            Intent intent = new Intent(getApplicationContext(), ChargingStatusActivity.class);
130
                            intent.putExtra(ChargingConstants.ORDERID, orderId);
131
                            startActivity(intent);
124
                    String data = JsonUtils.getKeyResult(response, "data");
125
                    if (rtnCode.equals("1001")){
126
                        checkStartCharging(orderId);
127
                    }else{
128
                        if ("01".equals(rtnCode)) {
129
                            ChargingBean chargingBean = JsonUtils.parseToObjectBean(data, ChargingBean.class);
130
                            if (chargingBean.getStatus() == 1) {
131
                                MainApplication.isAppStart = true;
132
                                ProfileManager.getInstance().setAppStart(getApplicationContext(), MainApplication.isAppStart);
133
                                Intent intent = new Intent(getApplicationContext(), ChargingStatusActivity.class);
134
                                intent.putExtra(ChargingConstants.ORDERID, orderId);
135
                                startActivity(intent);
136
                            } else {
137
                                ToastUtil.showToast(getApplicationContext(), "当前终端无响应,请拔枪重试或更换其他充电桩", Toast.LENGTH_SHORT);
138
                            }
132
                        } else {
139
                        } else {
133
                            ToastUtil.showToast(getApplicationContext(), "当前终端无响应,请拔枪重试或更换其他充电桩", Toast.LENGTH_SHORT);
140
                            ToastUtil.showToast(getApplicationContext(), rtnMsg, Toast.LENGTH_SHORT);
134
                        }
141
                        }
135
                    } else {
136
                        ToastUtil.showToast(getApplicationContext(), rtnMsg, Toast.LENGTH_SHORT);
142
                        finish();
137
                    }
143
                    }
138
                    finish();
144
139
                }
145
                }
140
            }
146
            }
141
        });
147
        });

+ 61 - 2
app/src/main/java/com/electric/chargingpile/adapter/LockAdapter.java

5
import android.view.View;
5
import android.view.View;
6
import android.view.ViewGroup;
6
import android.view.ViewGroup;
7
import android.widget.TextView;
7
import android.widget.TextView;
8
import android.widget.Toast;
8
9
9
import androidx.annotation.NonNull;
10
import androidx.annotation.NonNull;
10
import androidx.recyclerview.widget.RecyclerView;
11
import androidx.recyclerview.widget.RecyclerView;
11
12
12
import com.electric.chargingpile.R;
13
import com.electric.chargingpile.R;
14
import com.electric.chargingpile.data.LocksBean;
13
import com.electric.chargingpile.util.ScreenUtils;
15
import com.electric.chargingpile.util.ScreenUtils;
16
import com.electric.chargingpile.util.ToastUtil;
14
17
15
import org.jetbrains.annotations.NotNull;
18
import org.jetbrains.annotations.NotNull;
16
19
20
import java.util.ArrayList;
21
import java.util.List;
22
17
public class LockAdapter extends RecyclerView.Adapter<LockAdapter.LockHodler> {
23
public class LockAdapter extends RecyclerView.Adapter<LockAdapter.LockHodler> {
18
24
19
    private int mScreenWidth = 0;
25
    private int mScreenWidth = 0;
20
    private Context mContext;
26
    private Context mContext;
27
    private ArrayList<LocksBean> mData = new ArrayList<LocksBean>();
28
29
    public ArrayList<LocksBean> getData() {
30
        return mData;
31
    }
32
33
    public void setData(ArrayList<LocksBean> data) {
34
        mData = data;
35
        notifyDataSetChanged();
36
    }
37
38
    private LockItemOnClickListner mLockItemOnClickListner;
39
40
    public LockItemOnClickListner getLockItemOnClickListner() {
41
        return mLockItemOnClickListner;
42
    }
43
44
    public void setLockItemOnClickListner(LockItemOnClickListner mLockItemOnClickListner) {
45
        this.mLockItemOnClickListner = mLockItemOnClickListner;
46
    }
21
47
22
    public LockAdapter(Context context) {
48
    public LockAdapter(Context context) {
23
        mContext = context;
49
        mContext = context;
39
65
40
    @Override
66
    @Override
41
    public void onBindViewHolder(@NonNull @NotNull LockHodler holder, int position) {
67
    public void onBindViewHolder(@NonNull @NotNull LockHodler holder, int position) {
42
        setStatus(holder.tvStatus,1);
68
        LocksBean itemBean = mData.get(position);
69
        holder.tvOrder.setText(itemBean.getLockNum());
70
        setStatus(holder.tvStatus,itemBean.getLockStatus());
71
        holder.itemView.setOnClickListener(v->{
72
            int lockStatus = itemBean.getLockStatus();
73
            switch (lockStatus){
74
                case 1:
75
                    if (mLockItemOnClickListner!=null){
76
                        mLockItemOnClickListner.itemOnClick(itemBean);
77
                    }
78
                    break;
79
                case 2:
80
                    ToastUtil.showToast(mContext,"地锁正在使用中", Toast.LENGTH_SHORT);
81
82
                    break;
83
                case 3:
84
                    ToastUtil.showToast(mContext,"地锁维修中", Toast.LENGTH_SHORT);
85
                    break;
86
                case 4:
87
                    ToastUtil.showToast(mContext,"地锁已离网", Toast.LENGTH_SHORT);
88
                    break;
89
                case 5:
90
                case 6:
91
                    ToastUtil.showToast(mContext,"地锁状态异常", Toast.LENGTH_SHORT);
92
                    break;
93
                default:
94
                    break;
95
            }
96
        });
43
    }
97
    }
44
98
45
    private void setStatus(TextView textView,int status){
99
    private void setStatus(TextView textView,int status){
62
                textView.setBackgroundResource(R.drawable.bg_status_off_network);
116
                textView.setBackgroundResource(R.drawable.bg_status_off_network);
63
                break;
117
                break;
64
            case 5:
118
            case 5:
119
            case 6:
65
                textView.setText("异常");
120
                textView.setText("异常");
66
                textView.setBackgroundResource(R.drawable.bg_status_off_network);
121
                textView.setBackgroundResource(R.drawable.bg_status_off_network);
67
                break;
122
                break;
73
128
74
    @Override
129
    @Override
75
    public int getItemCount() {
130
    public int getItemCount() {
76
        return 50;
131
        return mData.size();
77
    }
132
    }
78
133
79
    public class LockHodler extends RecyclerView.ViewHolder {
134
    public class LockHodler extends RecyclerView.ViewHolder {
85
            tvOrder = itemView.findViewById(R.id.tvOrder);
140
            tvOrder = itemView.findViewById(R.id.tvOrder);
86
        }
141
        }
87
    }
142
    }
143
144
    public interface LockItemOnClickListner{
145
        void itemOnClick(LocksBean itemBean);
146
    }
88
}
147
}

+ 13 - 1
app/src/main/java/com/electric/chargingpile/fragment/DetailsFragment.java

65
import com.electric.chargingpile.util.Md5Util;
65
import com.electric.chargingpile.util.Md5Util;
66
import com.electric.chargingpile.util.OkHttpUtil;
66
import com.electric.chargingpile.util.OkHttpUtil;
67
import com.electric.chargingpile.util.StringUtils;
67
import com.electric.chargingpile.util.StringUtils;
68
import com.electric.chargingpile.util.ToastUtil;
68
import com.electric.chargingpile.util.Util;
69
import com.electric.chargingpile.util.Util;
69
import com.electric.chargingpile.view.CircleImageView;
70
import com.electric.chargingpile.view.CircleImageView;
70
import com.electric.chargingpile.view.CustomProgressDialog;
71
import com.electric.chargingpile.view.CustomProgressDialog;
71
import com.electric.chargingpile.view.CustomScrollView;
72
import com.electric.chargingpile.view.CustomScrollView;
73
import com.electric.chargingpile.view.LockStatusDialog;
72
import com.github.mikephil.charting.charts.CombinedChart;
74
import com.github.mikephil.charting.charts.CombinedChart;
73
import com.github.mikephil.charting.components.AxisBase;
75
import com.github.mikephil.charting.components.AxisBase;
74
import com.github.mikephil.charting.components.Legend;
76
import com.github.mikephil.charting.components.Legend;
287
                        zongjia = JsonUtils.getKeyResult(info_decode, "zongjia");
289
                        zongjia = JsonUtils.getKeyResult(info_decode, "zongjia");
288
                        String park_location = JsonUtils.getKeyResult(info_decode, "park_location");
290
                        String park_location = JsonUtils.getKeyResult(info_decode, "park_location");
289
                        String own_pay = JsonUtils.getKeyResult(info_decode, "own_pay");
291
                        String own_pay = JsonUtils.getKeyResult(info_decode, "own_pay");
290
                        String locks = JsonUtils.getKeyResult(info, "locks");
292
                        String locks = JsonUtils.getKeyResult(info_decode, "locks");
291
                        ArrayList<LocksBean> locksBeans = (ArrayList<LocksBean>) JsonUtils.parseToObjectList(locks, LocksBean.class);
293
                        ArrayList<LocksBean> locksBeans = (ArrayList<LocksBean>) JsonUtils.parseToObjectList(locks, LocksBean.class);
292
                        if (detailsFragmentListener != null) {
294
                        if (detailsFragmentListener != null) {
293
                            detailsFragmentListener.updateScanCharge(own_pay);
295
                            detailsFragmentListener.updateScanCharge(own_pay);
932
         parent = (RelativeLayout) v.findViewById(R.id.parent);
934
         parent = (RelativeLayout) v.findViewById(R.id.parent);
933
         imgLayout = (RelativeLayout) v.findViewById(R.id.imgLayout);
935
         imgLayout = (RelativeLayout) v.findViewById(R.id.imgLayout);
934
         imgLock = (ImageView) v.findViewById(R.id.imgLock);
936
         imgLock = (ImageView) v.findViewById(R.id.imgLock);
937
         imgLock.setOnClickListener(this);
935
    }
938
    }
936
939
937
    @Override
940
    @Override
972
                    detailsFragmentListener.scanCharge();
975
                    detailsFragmentListener.scanCharge();
973
                }
976
                }
974
                break;
977
                break;
978
979
            case R.id.imgLock:
980
                if (MainApplication.isLogin()){
981
                    LockStatusDialog.newInstart(zhan_id).show(getChildFragmentManager());
982
                }else{
983
                    ToastUtil.showToast(requireContext(), "请先登录", Toast.LENGTH_SHORT);
984
                    startActivity(new Intent(requireContext(), LoginActivity.class));
985
                }
986
                break;
975
        }
987
        }
976
    }
988
    }
977
989

+ 46 - 0
app/src/main/java/com/electric/chargingpile/fragment/ZhanStatusFragment.java

1
package com.electric.chargingpile.fragment;
1
package com.electric.chargingpile.fragment;
2
2
3
import android.content.Intent;
3
import android.os.Bundle;
4
import android.os.Bundle;
4
import androidx.fragment.app.Fragment;
5
import androidx.fragment.app.Fragment;
5
import android.view.LayoutInflater;
6
import android.view.LayoutInflater;
7
import android.view.ViewGroup;
8
import android.view.ViewGroup;
8
import android.widget.LinearLayout;
9
import android.widget.LinearLayout;
9
import android.widget.ListView;
10
import android.widget.ListView;
11
import android.widget.TextView;
12
import android.widget.Toast;
10
13
11
import com.electric.chargingpile.R;
14
import com.electric.chargingpile.R;
15
import com.electric.chargingpile.activity.LoginActivity;
12
import com.electric.chargingpile.activity.NewZhanDetailsActivity;
16
import com.electric.chargingpile.activity.NewZhanDetailsActivity;
13
import com.electric.chargingpile.adapter.ZhuangStatusadapter;
17
import com.electric.chargingpile.adapter.ZhuangStatusadapter;
14
import com.electric.chargingpile.application.MainApplication;
18
import com.electric.chargingpile.application.MainApplication;
19
import com.electric.chargingpile.data.LocksBean;
15
import com.electric.chargingpile.data.ZhuangStatus;
20
import com.electric.chargingpile.data.ZhuangStatus;
21
import com.electric.chargingpile.util.DES3S;
16
import com.electric.chargingpile.util.JsonUtils;
22
import com.electric.chargingpile.util.JsonUtils;
23
import com.electric.chargingpile.util.ToastUtil;
24
import com.electric.chargingpile.view.LockStatusDialog;
17
import com.zhy.http.okhttp.OkHttpUtils;
25
import com.zhy.http.okhttp.OkHttpUtils;
18
import com.zhy.http.okhttp.callback.StringCallback;
26
import com.zhy.http.okhttp.callback.StringCallback;
19
27
26
    private LinearLayout ll_no_status;
34
    private LinearLayout ll_no_status;
27
    private ListView lv_status;
35
    private ListView lv_status;
28
    private ZhuangStatusadapter adapter;
36
    private ZhuangStatusadapter adapter;
37
    private TextView tvLock;
29
38
30
39
31
    @Override
40
    @Override
45
                             Bundle savedInstanceState) {
54
                             Bundle savedInstanceState) {
46
        View view = inflater.inflate(R.layout.fragment_zhan_status, null);
55
        View view = inflater.inflate(R.layout.fragment_zhan_status, null);
47
        initView(view);
56
        initView(view);
57
        requestUpData();
48
        return view;
58
        return view;
49
    }
59
    }
50
60
51
    private void initView(View v) {
61
    private void initView(View v) {
52
        lv_status = (ListView) v.findViewById(R.id.lv_status);
62
        lv_status = (ListView) v.findViewById(R.id.lv_status);
53
        ll_no_status = (LinearLayout) v.findViewById(R.id.ll_no_status);
63
        ll_no_status = (LinearLayout) v.findViewById(R.id.ll_no_status);
64
        tvLock = (TextView) v.findViewById(R.id.tvLock);
65
        tvLock.setOnClickListener(view->{
66
            if (MainApplication.isLogin()){
67
                LockStatusDialog.newInstart(NewZhanDetailsActivity.zhan_id).show(getChildFragmentManager());
68
            }else{
69
                ToastUtil.showToast(requireContext(), "请先登录", Toast.LENGTH_SHORT);
70
                startActivity(new Intent(requireContext(), LoginActivity.class));
71
            }
72
        });
54
    }
73
    }
55
74
56
    private void getZhuangStatus() {
75
    private void getZhuangStatus() {
80
        });
99
        });
81
    }
100
    }
82
101
102
    private void requestUpData(){
103
        String url = MainApplication.url + "/zhannew/basic/web/index.php/zhanlist/zhan-info2?zhan_id=" + NewZhanDetailsActivity.zhan_id + "&version=" + MainApplication.current_code;
104
        OkHttpUtils.get().url(url)
105
                .build()
106
                .connTimeOut(5000)
107
                .readTimeOut(5000)
108
                .execute(new StringCallback(){
109
110
                    @Override
111
                    public void onError(Call call, Exception e) {
112
113
                    }
114
115
                    @Override
116
                    public void onResponse(String response) {
117
                        try {
118
                            String info = JsonUtils.getKeyResult(response, "info");
119
                            String info_decode = DES3S.decode(info);
120
                            String locks = JsonUtils.getKeyResult(info_decode, "locks");
121
                            ArrayList<LocksBean> locksBeans = (ArrayList<LocksBean>) JsonUtils.parseToObjectList(locks, LocksBean.class);
122
                            tvLock.setVisibility((locksBeans != null && locksBeans.size() != 0) ? View.VISIBLE : View.GONE);
123
                        }catch (Exception e) {
124
                            e.printStackTrace();
125
                        }
126
                    }
127
                });
128
    }
83
129
84
}
130
}

+ 200 - 37
app/src/main/java/com/electric/chargingpile/view/LockStatusDialog.java

7
import android.net.Uri;
7
import android.net.Uri;
8
import android.os.Bundle;
8
import android.os.Bundle;
9
import android.text.Html;
9
import android.text.Html;
10
import android.util.Log;
10
import android.view.LayoutInflater;
11
import android.view.LayoutInflater;
11
import android.view.View;
12
import android.view.View;
12
import android.view.ViewGroup;
13
import android.view.ViewGroup;
14
import android.widget.ProgressBar;
13
import android.widget.TextView;
15
import android.widget.TextView;
16
import android.widget.Toast;
14
17
15
import androidx.annotation.NonNull;
18
import androidx.annotation.NonNull;
16
import androidx.annotation.Nullable;
19
import androidx.annotation.Nullable;
21
import androidx.recyclerview.widget.GridLayoutManager;
24
import androidx.recyclerview.widget.GridLayoutManager;
22
import androidx.recyclerview.widget.RecyclerView;
25
import androidx.recyclerview.widget.RecyclerView;
23
26
27
import com.amap.api.location.AMapLocation;
28
import com.amap.api.location.AMapLocationClient;
29
import com.amap.api.location.AMapLocationClientOption;
30
import com.amap.api.location.AMapLocationListener;
31
import com.blankj.utilcode.util.EmptyUtils;
24
import com.blankj.utilcode.util.LogUtils;
32
import com.blankj.utilcode.util.LogUtils;
25
import com.blankj.utilcode.util.ScreenUtils;
33
import com.blankj.utilcode.util.ScreenUtils;
34
import com.electric.chargingpile.BuildConfig;
26
import com.electric.chargingpile.R;
35
import com.electric.chargingpile.R;
36
import com.electric.chargingpile.activity.MainMapActivity;
37
import com.electric.chargingpile.activity.NewZhanDetailsActivity;
27
import com.electric.chargingpile.activity.ZhanDetailsNew;
38
import com.electric.chargingpile.activity.ZhanDetailsNew;
28
import com.electric.chargingpile.adapter.LockAdapter;
39
import com.electric.chargingpile.adapter.LockAdapter;
40
import com.electric.chargingpile.application.MainApplication;
41
import com.electric.chargingpile.data.LocksBean;
42
import com.electric.chargingpile.util.DES3S;
43
import com.electric.chargingpile.util.JsonUtils;
44
import com.electric.chargingpile.util.OkHttpUtil;
45
import com.electric.chargingpile.util.ToastUtil;
29
import com.google.android.material.bottomsheet.BottomSheetBehavior;
46
import com.google.android.material.bottomsheet.BottomSheetBehavior;
30
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
47
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
48
import com.google.zxing.client.android.constant.UrlConstants;
49
import com.squareup.okhttp.Request;
50
import com.zhy.http.okhttp.OkHttpUtils;
51
import com.zhy.http.okhttp.callback.StringCallback;
31
52
32
import org.jetbrains.annotations.NotNull;
53
import org.jetbrains.annotations.NotNull;
54
import org.json.JSONException;
55
import org.json.JSONObject;
33
56
57
import java.sql.Time;
58
import java.util.ArrayList;
59
60
import okhttp3.Call;
34
import pub.devrel.easypermissions.AfterPermissionGranted;
61
import pub.devrel.easypermissions.AfterPermissionGranted;
35
import pub.devrel.easypermissions.EasyPermissions;
62
import pub.devrel.easypermissions.EasyPermissions;
36
63
37
import static android.text.Html.FROM_HTML_MODE_LEGACY;
64
import static android.text.Html.FROM_HTML_MODE_LEGACY;
38
65
39
public class LockStatusDialog extends BottomSheetDialogFragment {
66
public class LockStatusDialog extends BottomSheetDialogFragment implements AMapLocationListener {
67
40
68
41
    private String licensePlate = "";
42
    private String telNum = "10086";
43
    private View.OnClickListener onClickListener;
69
    private View.OnClickListener onClickListener;
44
    private static final int RC_TELL_PERM = 124;
70
    private static final int RC_TELL_PERM = 124;
71
    private AMapLocationClient mlocationClient;
72
    private AMapLocationClientOption mLocationOption;
73
    private AMapLocation mAMapLocation;
74
    private LockAdapter mAdapter;
75
    private String zhan_id;
76
77
    private TextView tvNum;
78
    private ProgressBar progressBar;
79
    private RecyclerView recyclerView;
80
    private String info_decode;
81
45
    public void setOnClickListener(View.OnClickListener onClickListener) {
82
    public void setOnClickListener(View.OnClickListener onClickListener) {
46
        this.onClickListener = onClickListener;
83
        this.onClickListener = onClickListener;
47
    }
84
    }
48
85
49
    public String getLicensePlate() {
50
        return licensePlate;
51
    }
52
53
    public void setLicensePlate(String licensePlate) {
54
        this.licensePlate = licensePlate;
55
    }
56
86
57
    public static LockStatusDialog newInstart(){
58
        return new LockStatusDialog();
87
    public static LockStatusDialog newInstart(String zhan_id){
88
        LockStatusDialog lockStatusDialog = new LockStatusDialog();
89
        Bundle bundle = new Bundle();
90
        bundle.putString("zhan_id",zhan_id);
91
        lockStatusDialog.setArguments(bundle);
92
        return lockStatusDialog;
59
    }
93
    }
60
94
61
    @Override
95
    @Override
68
    @Override
102
    @Override
69
    public void onStart() {
103
    public void onStart() {
70
        super.onStart();
104
        super.onStart();
105
        if (mlocationClient != null && mlocationClient.isStarted()){
106
            mlocationClient.startLocation();
107
        }
71
        Dialog dialog = getDialog();
108
        Dialog dialog = getDialog();
72
        if (dialog!=null){
109
        if (dialog!=null){
73
            View bottomSheet = dialog.findViewById(com.google.android.material.R.id.design_bottom_sheet);
110
            View bottomSheet = dialog.findViewById(com.google.android.material.R.id.design_bottom_sheet);
84
        }
121
        }
85
    }
122
    }
86
123
124
    @Override
125
    public void onStop() {
126
        if (mlocationClient != null && !mlocationClient.isStarted()){
127
            mlocationClient.stopLocation();
128
        }
129
        super.onStop();
130
    }
131
87
    @Nullable
132
    @Nullable
88
    @org.jetbrains.annotations.Nullable
133
    @org.jetbrains.annotations.Nullable
89
    @Override
134
    @Override
94
    @Override
139
    @Override
95
    public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
140
    public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
96
        super.onViewCreated(view, savedInstanceState);
141
        super.onViewCreated(view, savedInstanceState);
97
        RecyclerView recyclerView = view.findViewById(R.id.recyclerView);
142
        zhan_id = getArguments() != null ? getArguments().getString("zhan_id") : "";
143
        initView(view);
144
        setUpMap();
145
    }
146
147
    private void initView(@NotNull View view) {
148
        recyclerView = view.findViewById(R.id.recyclerView);
98
        TextView tvRefresh = view.findViewById(R.id.tvRefresh);
149
        TextView tvRefresh = view.findViewById(R.id.tvRefresh);
99
        TextView tvContact = view.findViewById(R.id.tvContact);
150
        TextView tvContact = view.findViewById(R.id.tvContact);
100
        TextView tvNum = view.findViewById(R.id.tvNum);
151
        progressBar = view.findViewById(R.id.progressBar);
152
        tvNum = view.findViewById(R.id.tvNum);
101
153
102
        recyclerView.setLayoutManager( new GridLayoutManager(requireContext(),5));
154
        recyclerView.setLayoutManager( new GridLayoutManager(requireContext(),5));
103
        recyclerView.setAdapter(new LockAdapter(requireContext()));
155
        mAdapter = new LockAdapter(requireContext());
156
        mAdapter.setLockItemOnClickListner(item->{
157
            request(item.getLockNum());
158
        });
159
        recyclerView.setAdapter(mAdapter);
104
160
105
        tvNum.setText(Html.fromHtml("空 <font color='#333333'>"+6+"/</font> <font color='#A5A5A5'>"+2+"</font>",FROM_HTML_MODE_LEGACY));
161
        tvNum.setText(Html.fromHtml("空 <font color='#333333'>"+6+"/</font> <font color='#A5A5A5'>"+2+"</font>",FROM_HTML_MODE_LEGACY));
106
        tvContact.setOnClickListener(v->{
162
        tvContact.setOnClickListener(v->{
107
            //拨打电话
163
            //拨打电话
108
            tellTask();
164
            PhoneDialog.newInstart("10086").show(getChildFragmentManager());
109
        });
165
        });
110
        tvRefresh.setOnClickListener(v->{
166
        tvRefresh.setOnClickListener(v->{
111
            //刷新接口
167
            //刷新接口
168
            requestUpData();
169
        });
170
        requestUpData();
171
    }
172
173
    private void requestUpData(){
174
        progressBar.setVisibility(View.VISIBLE);
175
        recyclerView.setVisibility(View.GONE);
176
        String url = MainApplication.url + "/zhannew/basic/web/index.php/zhanlist/zhan-info2?zhan_id=" + zhan_id + "&version=" + MainApplication.current_code;
177
        OkHttpUtils.get().url(url)
178
                .build()
179
                .connTimeOut(5000)
180
                .readTimeOut(5000)
181
                .execute(new StringCallback(){
182
183
                    @Override
184
                    public void onError(Call call, Exception e) {
185
                        progressBar.setVisibility(View.GONE);
186
                        recyclerView.setVisibility(View.VISIBLE);
187
                    }
188
189
                    @Override
190
                    public void onResponse(String response) {
191
                        progressBar.setVisibility(View.GONE);
192
                        recyclerView.setVisibility(View.VISIBLE);
193
                        try {
194
                            String info = JsonUtils.getKeyResult(response, "info");
112
195
196
                            info_decode = DES3S.decode(info);
197
                            String locks = JsonUtils.getKeyResult(info_decode, "locks");
198
                            ArrayList<LocksBean> locksBeans = (ArrayList<LocksBean>) JsonUtils.parseToObjectList(locks, LocksBean.class);
199
                            mAdapter.setData(locksBeans);
200
                            int available = 0;
201
                            for (LocksBean bean: locksBeans) {
202
                                if (bean.getLockStatus() == 1){
203
                                    ++available;
204
                                }
205
                            }
206
                            tvNum.setText(Html.fromHtml("空 <font color='#333333'>"+available+"/</font> <font color='#A5A5A5'>"+mAdapter.getItemCount()+"</font>",FROM_HTML_MODE_LEGACY));
207
208
                        }catch (Exception e) {
209
                            e.printStackTrace();
210
                        }
211
                    }
212
                });
213
    }
214
215
    private void request(String lockNum){
216
        double lat = mAMapLocation == null ? 0.0: mAMapLocation.getLongitude();//经度
217
        double lng = mAMapLocation== null ? 0.0: mAMapLocation.getLatitude();//纬度
218
219
        OkHttpUtils.get().url(MainApplication.url +"/zhannew/basic/web/index.php/zhanlist/drop-lock")
220
                .addParams("stationId",JsonUtils.getKeyResult(info_decode, "zhan_id"))
221
                .addParams("LockNum",lockNum)
222
                .addParams("Lat",lat+"")
223
                .addParams("Lng",lng+"")
224
//                .addParams("stationId","101437000_269")
225
//                .addParams("LockNum","30353")
226
//                .addParams("Lat","30.2787510000000000")
227
//                .addParams("Lng","120.0488070000000000")
228
                .addParams("version", BuildConfig.VERSION_NAME)
229
                .build().connTimeOut(5000).readTimeOut(5000).execute(new StringCallback() {
230
            @Override
231
            public void onError(Call call, Exception e) {
232
                Toast.makeText(requireContext(), "网络不给力,请检查网络状态", Toast.LENGTH_SHORT).show();
233
                dismissAllowingStateLoss();
234
            }
235
236
            @Override
237
            public void onResponse(String response) {
238
                if (null != response) {
239
                    String data = JsonUtils.getKeyResult(response, "Data");
240
                    if (data == null || !data.equals("true")) {
241
                        String msg = JsonUtils.getKeyResult(response, "Msg");
242
                        ToastUtil.showToast(requireContext(), msg, Toast.LENGTH_SHORT);
243
                    }
244
                }
245
                dismissAllowingStateLoss();
246
            }
113
        });
247
        });
114
248
115
    }
249
    }
116
250
117
    @AfterPermissionGranted(RC_TELL_PERM)
118
    public void tellTask() {
119
        if (hasTellPermission()) {
120
            Intent intent = new Intent();
121
            intent.setAction("android.intent.action.CALL");
122
            intent.addCategory("android.intent.category.DEFAULT");
123
            intent.setData(Uri.parse("tel:" + telNum));
124
            startActivity(intent);
125
        } else {
126
            // Ask for one permission
127
            EasyPermissions.requestPermissions(
128
                    this,
129
                    "该功能需要开启拨号权限,是否前往开启?",
130
                    RC_TELL_PERM,
131
                    Manifest.permission.CALL_PHONE);
251
252
253
    private void setUpMap() {
254
//        //声明mLocationOption对象
255
//        AMapLocationClientOption mLocationOption = null;
256
        try {
257
            mlocationClient = new AMapLocationClient(requireContext());
258
            //初始化定位参数
259
            mLocationOption = new AMapLocationClientOption();
260
            //设置定位监听
261
            mlocationClient.setLocationListener(this);
262
            //设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式
263
            mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy);
264
            mLocationOption.setOnceLocation(true);
265
            //设置是否强制刷新WIFI,默认为强制刷新
266
            mLocationOption.setWifiActiveScan(false);
267
            //设置定位间隔,单位毫秒,默认为2000ms
268
            //        mLocationOption.setInterval(2000);
269
            //设置定位参数
270
            mlocationClient.setLocationOption(mLocationOption);
271
            // 此方法为每隔固定时间会发起一次定位请求,为了减少电量消耗或网络流量消耗,
272
            // 注意设置合适的定位时间的间隔(最小间隔支持为2000ms),并且在合适时间调用stopLocation()方法来取消定位请求
273
            // 在定位结束后,在合适的生命周期调用onDestroy()方法
274
            // 在单次定位情况下,定位无论成功与否,都无需调用stopLocation()方法移除请求,定位sdk内部会移除
275
276
            //启动定位
277
            mlocationClient.startLocation();
278
        } catch (Exception e) {
279
            e.printStackTrace();
132
        }
280
        }
133
    }
134
    private boolean hasTellPermission() {
135
        return EasyPermissions.hasPermissions(requireContext(), Manifest.permission.CALL_PHONE);
281
136
    }
282
    }
137
283
284
138
    @Override
285
    @Override
139
    public void onRequestPermissionsResult(int requestCode, @NonNull @NotNull String[] permissions, @NonNull @NotNull int[] grantResults) {
140
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
141
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
286
    public void onLocationChanged(AMapLocation aMapLocation) {
287
        if (aMapLocation != null) {
288
            if (aMapLocation != null
289
                    && aMapLocation.getErrorCode() == 0) {
290
                mAMapLocation = aMapLocation;
291
            } else {
292
                mAMapLocation = null;
293
                String errText = "定位失败," + aMapLocation.getErrorCode() + ": " + aMapLocation.getErrorInfo();
294
                Toast.makeText(requireContext(), errText, Toast.LENGTH_SHORT).show();
295
            }
296
        }
297
142
    }
298
    }
143
299
300
    @Override
301
    public void onDestroy() {
302
        if (mlocationClient!=null){
303
            mlocationClient .onDestroy();
304
        }
305
        super.onDestroy();
306
    }
144
307
145
    public void show(FragmentManager fragmentManager){
308
    public void show(FragmentManager fragmentManager){
146
        FragmentTransaction ft = fragmentManager.beginTransaction();
309
        FragmentTransaction ft = fragmentManager.beginTransaction();

+ 121 - 0
app/src/main/java/com/electric/chargingpile/view/PhoneDialog.java

1
package com.electric.chargingpile.view;
2
3
import android.Manifest;
4
import android.content.Intent;
5
import android.net.Uri;
6
import android.os.Bundle;
7
import android.util.Log;
8
import android.view.LayoutInflater;
9
import android.view.View;
10
import android.view.ViewGroup;
11
import android.widget.TextView;
12
import android.widget.Toast;
13
14
import androidx.activity.result.contract.ActivityResultContracts;
15
import androidx.annotation.NonNull;
16
import androidx.annotation.Nullable;
17
import androidx.fragment.app.DialogFragment;
18
import androidx.fragment.app.Fragment;
19
import androidx.fragment.app.FragmentManager;
20
import androidx.fragment.app.FragmentTransaction;
21
22
import com.electric.chargingpile.R;
23
import com.electric.chargingpile.util.ToastUtil;
24
import com.hjq.permissions.OnPermissionCallback;
25
import com.hjq.permissions.Permission;
26
import com.hjq.permissions.XXPermissions;
27
28
import org.jetbrains.annotations.NotNull;
29
30
import java.util.List;
31
32
33
public class PhoneDialog extends DialogFragment {
34
35
    private static final String PHONE_KEY = "phone";
36
    private static final int RC_TELL_PERM = 124;
37
    private String telNum = "";
38
39
    public static PhoneDialog newInstart(String phone){
40
        PhoneDialog phoneDialog = new PhoneDialog();
41
        final Bundle args = new Bundle();
42
        args.putString(PHONE_KEY, phone);
43
        phoneDialog.setArguments(args);
44
        return phoneDialog;
45
    }
46
47
    @Override
48
    public void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
49
        super.onCreate(savedInstanceState);
50
        setStyle(DialogFragment.STYLE_NORMAL, R.style.TransparentVideoDialogFragmentTheme);
51
52
    }
53
    @Nullable
54
    @org.jetbrains.annotations.Nullable
55
    @Override
56
    public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
57
        return LayoutInflater.from(requireContext()).inflate(R.layout.dialog_phone, container, false);
58
    }
59
60
61
    @Override
62
    public void onViewCreated(@NonNull @NotNull View view, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
63
        super.onViewCreated(view, savedInstanceState);
64
        telNum = getArguments() == null ? "" : getArguments().getString(PHONE_KEY);
65
        TextView tvPhone = view.findViewById(R.id.tvPhone);
66
        tvPhone.setText(telNum);
67
        view.findViewById(R.id.tvCancel).setOnClickListener(v->{
68
            dismissAllowingStateLoss();
69
        });
70
        view.findViewById(R.id.tvCall).setOnClickListener(v->{
71
            tellTask();
72
        });
73
    }
74
75
    public void tellTask() {
76
        boolean granted = XXPermissions.isGranted(requireContext(), Permission.CALL_PHONE);
77
        if (granted) {
78
            callPhone();
79
        } else {
80
            XXPermissions.with(this)
81
                    // 申请单个权限
82
                    .permission(Permission.CALL_PHONE)
83
                    .request(new OnPermissionCallback() {
84
                        @Override
85
                        public void onGranted(List<String> permissions, boolean all) {
86
                            callPhone();
87
                        }
88
                        @Override
89
                        public void onDenied(List<String> permissions, boolean never) {
90
                            if (never) {
91
                                ToastUtil.showToast(requireContext(),"被永久拒绝授权,请手动授予拨打电话权限", Toast.LENGTH_SHORT);
92
                                // 如果是被永久拒绝就跳转到应用权限系统设置页面
93
                                XXPermissions.startPermissionActivity(requireContext(), permissions);
94
                            } else {
95
                                ToastUtil.showToast(requireContext(),"获取拨打电话权限失败", Toast.LENGTH_SHORT);
96
                            }
97
                            dismissAllowingStateLoss();
98
                        }
99
                    });
100
        }
101
    }
102
103
    private void callPhone() {
104
        Intent intent = new Intent();
105
        intent.setAction("android.intent.action.CALL");
106
        intent.addCategory("android.intent.category.DEFAULT");
107
        intent.setData(Uri.parse("tel:" + telNum));
108
        startActivity(intent);
109
        dismissAllowingStateLoss();
110
    }
111
112
    public void show(FragmentManager fragmentManager){
113
        FragmentTransaction ft = fragmentManager.beginTransaction();
114
        Fragment prev = fragmentManager.findFragmentByTag(PhoneDialog.class.getName());
115
        if (prev != null) {
116
            ft.remove(prev);
117
        }
118
        show(fragmentManager,PhoneDialog.class.getName());
119
        fragmentManager.executePendingTransactions();
120
    }
121
}

+ 9 - 0
app/src/main/res/drawable/bg_3ec34c_hollow_radius20.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<selector xmlns:android="http://schemas.android.com/apk/res/android">
3
    <item >
4
        <shape android:shape="rectangle">
5
            <stroke android:width="1dp" android:color="#ff3ec34c" />
6
            <corners android:radius="20dp" />
7
        </shape>
8
    </item>
9
</selector>

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

936
        android:layout_alignParentBottom="true"
936
        android:layout_alignParentBottom="true"
937
        android:background="@color/white"
937
        android:background="@color/white"
938
        android:visibility="gone"
938
        android:visibility="gone"
939
        tools:visibility="visible">
939
        >
940
940
941
        <LinearLayout
941
        <LinearLayout
942
            android:layout_width="match_parent"
942
            android:layout_width="match_parent"

+ 18 - 5
app/src/main/res/layout/dialog_lock_status.xml

62
            android:textColor="@color/color_3ec34c"
62
            android:textColor="@color/color_3ec34c"
63
            android:textSize="12sp"
63
            android:textSize="12sp"
64
            />
64
            />
65
        <androidx.recyclerview.widget.RecyclerView
65
66
        <RelativeLayout
67
            android:layout_marginBottom="13dp"
66
            android:layout_marginTop="13dp"
68
            android:layout_marginTop="13dp"
67
            android:layout_width="match_parent"
68
            android:id="@+id/recyclerView"
69
            android:layout_height="0dp"
69
            android:layout_weight="1"
70
            android:layout_weight="1"
70
            android:layout_marginBottom="13dp"
71
            android:layout_height="0dp"/>
71
            android:layout_width="match_parent"
72
           >
73
            <androidx.recyclerview.widget.RecyclerView
74
                android:layout_width="match_parent"
75
                android:id="@+id/recyclerView"
76
                android:layout_height="match_parent"/>
72
77
78
            <ProgressBar
79
                android:id="@+id/progressBar"
80
                tools:visibility="visible"
81
                android:visibility="gone"
82
                android:layout_centerInParent="true"
83
                android:layout_width="wrap_content"
84
                android:layout_height="wrap_content"/>
85
        </RelativeLayout>
73
        <LinearLayout
86
        <LinearLayout
74
            android:layout_width="match_parent"
87
            android:layout_width="match_parent"
75
            android:layout_height="wrap_content">
88
            android:layout_height="wrap_content">

+ 61 - 0
app/src/main/res/layout/dialog_phone.xml

1
<?xml version="1.0" encoding="utf-8"?>
2
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    android:layout_width="match_parent"
4
    xmlns:tools="http://schemas.android.com/tools"
5
    xmlns:app="http://schemas.android.com/apk/res-auto"
6
    tools:background="#f1f1"
7
    android:layout_height="match_parent">
8
    <androidx.constraintlayout.widget.ConstraintLayout
9
        android:layout_centerInParent="true"
10
        android:background="@drawable/bg_white_radius6"
11
        android:paddingBottom="20dp"
12
        android:paddingEnd="10dp"
13
        android:paddingStart="10dp"
14
        android:paddingTop="30dp"
15
        android:layout_width="256dp"
16
        android:layout_height="wrap_content">
17
18
        <TextView
19
            android:id="@+id/tvPhone"
20
            app:layout_constraintEnd_toEndOf="parent"
21
            app:layout_constraintStart_toStartOf="parent"
22
            app:layout_constraintTop_toTopOf="parent"
23
            android:gravity="center"
24
            android:layout_width="match_parent"
25
            android:layout_height="wrap_content"
26
            tools:text="400-061-0999"
27
            android:textColor="@color/editcolor"
28
            android:textSize="20sp"
29
            />
30
31
        <TextView
32
            android:background="@drawable/bg_3ec34c_hollow_radius20"
33
            android:id="@+id/tvCancel"
34
            android:gravity="center"
35
            android:layout_marginTop="20dp"
36
            app:layout_constraintTop_toBottomOf="@+id/tvPhone"
37
            app:layout_constraintStart_toStartOf="parent"
38
            android:layout_width="0dp"
39
            android:layout_height="30dp"
40
            android:text="取消"
41
            android:textColor="@color/color_3ec34c"
42
            android:textSize="14sp"
43
            app:layout_constraintEnd_toStartOf="@+id/tvCall"
44
            />
45
46
        <TextView
47
            android:background="@drawable/bg_3ec34c_radius20"
48
            android:layout_marginStart="8dp"
49
            android:id="@+id/tvCall"
50
            android:layout_width="0dp"
51
            android:layout_height="30dp"
52
            android:layout_marginTop="20dp"
53
            android:gravity="center"
54
            android:text="呼叫"
55
            android:textColor="@color/white"
56
            android:textSize="14sp"
57
            app:layout_constraintEnd_toEndOf="parent"
58
            app:layout_constraintStart_toEndOf="@+id/tvCancel"
59
            app:layout_constraintTop_toBottomOf="@+id/tvPhone" />
60
    </androidx.constraintlayout.widget.ConstraintLayout>
61
</RelativeLayout>

+ 19 - 1
app/src/main/res/layout/fragment_zhan_status.xml

41
    </LinearLayout>
41
    </LinearLayout>
42
42
43
    <ListView
43
    <ListView
44
        android:layout_above="@+id/tvLock"
44
        android:id="@+id/lv_status"
45
        android:id="@+id/lv_status"
45
        android:layout_width="match_parent"
46
        android:layout_width="match_parent"
46
        android:layout_height="match_parent"
47
        android:layout_height="wrap_content"
47
        android:divider="@color/ui_6d"
48
        android:divider="@color/ui_6d"
48
        android:dividerHeight="0.5dp"
49
        android:dividerHeight="0.5dp"
49
        android:background="@color/white"/>
50
        android:background="@color/white"/>
50
51
52
    <TextView
53
        tools:visibility="visible"
54
        android:visibility="gone"
55
        android:gravity="center"
56
        android:background="@drawable/bg_lock_contact"
57
        android:layout_marginTop="12dp"
58
        android:layout_marginEnd="12dp"
59
        android:layout_marginStart="12dp"
60
        android:layout_marginBottom="30dp"
61
        android:layout_alignParentBottom="true"
62
        android:id="@+id/tvLock"
63
        android:layout_width="match_parent"
64
        android:layout_height="42dp"
65
        android:text="降地锁"
66
        android:textColor="@color/white"
67
        android:textSize="16sp"
68
        />
51
</RelativeLayout>
69
</RelativeLayout>

+ 2 - 2
app/src/main/res/layout/item_lock.xml

25
        app:layout_constraintStart_toStartOf="parent"
25
        app:layout_constraintStart_toStartOf="parent"
26
        app:layout_constraintBottom_toBottomOf="parent"
26
        app:layout_constraintBottom_toBottomOf="parent"
27
        app:layout_constraintTop_toTopOf="parent"
27
        app:layout_constraintTop_toTopOf="parent"
28
        android:layout_width="8dp"
29
        android:layout_height="22dp"
28
        android:layout_width="wrap_content"
29
        android:layout_height="wrap_content"
30
        android:text="1"
30
        android:text="1"
31
        android:textColor="@color/editcolor"
31
        android:textColor="@color/editcolor"
32
        android:textSize="16sp"
32
        android:textSize="16sp"

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

235
235
236
        <TextView
236
        <TextView
237
            tools:visibility="visible"
237
            tools:visibility="visible"
238
            android:visibility="visible"
238
            android:visibility="gone"
239
            android:id="@+id/tvLock"
239
            android:id="@+id/tvLock"
240
            android:layout_gravity="end|bottom"
240
            android:layout_gravity="end|bottom"
241
            android:gravity="center"
241
            android:gravity="center"

+ 2 - 2
zxing/src/main/java/com/google/zxing/client/android/constant/UrlConstants.java

1
package com.google.zxing.client.android.constant;
1
package com.google.zxing.client.android.constant;
2
2
3
public interface UrlConstants {
3
public interface UrlConstants {
4
    String HOST_URL = "http://cdz.evcharge.cc/zhannew/basic/web/index.php/";
5
//    String HOST_URL = "http://59.110.68.162/zhannew/basic/web/index.php/"; //测试链接
4
//    String HOST_URL = "http://cdz.evcharge.cc/zhannew/basic/web/index.php/";
5
    String HOST_URL = "http://59.110.68.162/zhannew/basic/web/index.php/"; //测试链接
6
6
7
    String USER_CHARGING_CHECK_URL = HOST_URL + "api/charge/check-user";
7
    String USER_CHARGING_CHECK_URL = HOST_URL + "api/charge/check-user";
8
//    String START_CHARGING_URL = HOST_URL + "api/charge/start";
8
//    String START_CHARGING_URL = HOST_URL + "api/charge/start";