an rel="">
  <li> Bug修復 </li>
11
</ul>
12
<p>由谷歌翻譯翻譯。</p></body>
13
</html>

+ 0 - 201
zxing/src/main/assets/html/apache-license.txt

@ -1,201 +0,0 @@
1
                                 Apache License
2
                           Version 2.0, January 2004
3
                        http://www.apache.org/licenses/
4
5
   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
7
   1. Definitions.
8
9
      "License" shall mean the terms and conditions for use, reproduction,
10
      and distribution as defined by Sections 1 through 9 of this document.
11
12
      "Licensor" shall mean the copyright owner or entity authorized by
13
      the copyright owner that is granting the License.
14
15
      "Legal Entity" shall mean the union of the acting entity and all
16
      other entities that control, are controlled by, or are under common
17
      control with that entity. For the purposes of this definition,
18
      "control" means (i) the power, direct or indirect, to cause the
19
      direction or management of such entity, whether by contract or
20
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
      outstanding shares, or (iii) beneficial ownership of such entity.
22
23
      "You" (or "Your") shall mean an individual or Legal Entity
24
      exercising permissions granted by this License.
25
26
      "Source" form shall mean the preferred form for making modifications,
27
      including but not limited to software source code, documentation
28
      source, and configuration files.
29
30
      "Object" form shall mean any form resulting from mechanical
31
      transformation or translation of a Source form, including but
32
      not limited to compiled object code, generated documentation,
33
      and conversions to other media types.
34
35
      "Work" shall mean the work of authorship, whether in Source or
36
      Object form, made available under the License, as indicated by a
37
      copyright notice that is included in or attached to the work
38
      (an example is provided in the Appendix below).
39
40
      "Derivative Works" shall mean any work, whether in Source or Object
41
      form, that is based on (or derived from) the Work and for which the
42
      editorial revisions, annotations, elaborations, or other modifications
43
      represent, as a whole, an original work of authorship. For the purposes
44
      of this License, Derivative Works shall not include works that remain
45
      separable from, or merely link (or bind by name) to the interfaces of,
46
      the Work and Derivative Works thereof.
47
48
      "Contribution" shall mean any work of authorship, including
49
      the original version of the Work and any modifications or additions
50
      to that Work or Derivative Works thereof, that is intentionally
51
      submitted to Licensor for inclusion in the Work by the copyright owner
52
      or by an individual or Legal Entity authorized to submit on behalf of
53
      the copyright owner. For the purposes of this definition, "submitted"
54
      means any form of electronic, verbal, or written communication sent
55
      to the Licensor or its representatives, including but not limited to
56
      communication on electronic mailing lists, source code control systems,
57
      and issue tracking systems that are managed by, or on behalf of, the
58
      Licensor for the purpose of discussing and improving the Work, but
59
      excluding communication that is conspicuously marked or otherwise
60
      designated in writing by the copyright owner as "Not a Contribution."
61
62
      "Contributor" shall mean Licensor and any individual or Legal Entity
63
      on behalf of whom a Contribution has been received by Licensor and
64
      subsequently incorporated within the Work.
65
66
   2. Grant of Copyright License. Subject to the terms and conditions of
67
      this License, each Contributor hereby grants to You a perpetual,
68
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
      copyright license to reproduce, prepare Derivative Works of,
70
      publicly display, publicly perform, sublicense, and distribute the
71
      Work and such Derivative Works in Source or Object form.
72
73
   3. Grant of Patent License. Subject to the terms and conditions of
74
      this License, each Contributor hereby grants to You a perpetual,
75
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
      (except as stated in this section) patent license to make, have made,
77
      use, offer to sell, sell, import, and otherwise transfer the Work,
78
      where such license applies only to those patent claims licensable
79
      by such Contributor that are necessarily infringed by their
80
      Contribution(s) alone or by combination of their Contribution(s)
81
      with the Work to which such Contribution(s) was submitted. If You
82
      institute patent litigation against any entity (including a
83
      cross-claim or counterclaim in a lawsuit) alleging that the Work
84
      or a Contribution incorporated within the Work constitutes direct
85
      or contributory patent infringement, then any patent licenses
86
      granted to You under this License for that Work shall terminate
87
      as of the date such litigation is filed.
88
89
   4. Redistribution. You may reproduce and distribute copies of the
90
      Work or Derivative Works thereof in any medium, with or without
91
      modifications, and in Source or Object form, provided that You
92
      meet the following conditions:
93
94
      (a) You must give any other recipients of the Work or
95
          Derivative Works a copy of this License; and
96
97
      (b) You must cause any modified files to carry prominent notices
98
          stating that You changed the files; and
99
100
      (c) You must retain, in the Source form of any Derivative Works
101
          that You distribute, all copyright, patent, trademark, and
102
          attribution notices from the Source form of the Work,
103
          excluding those notices that do not pertain to any part of
104
          the Derivative Works; and
105
106
      (d) If the Work includes a "NOTICE" text file as part of its
107
          distribution, then any Derivative Works that You distribute must
108
          include a readable copy of the attribution notices contained
109
          within such NOTICE file, excluding those notices that do not
110
          pertain to any part of the Derivative Works, in at least one
111
          of the following places: within a NOTICE text file distributed
112
          as part of the Derivative Works; within the Source form or
113
          documentation, if provided along with the Derivative Works; or,
114
          within a display generated by the Derivative Works, if and
115
          wherever such third-party notices normally appear. The contents
116
          of the NOTICE file are for informational purposes only and
117
          do not modify the License. You may add Your own attribution
118
          notices within Derivative Works that You distribute, alongside
119
          or as an addendum to the NOTICE text from the Work, provided
120
          that such additional attribution notices cannot be construed
121
          as modifying the License.
122
123
      You may add Your own copyright statement to Your modifications and
124
      may provide additional or different license terms and conditions
125
      for use, reproduction, or distribution of Your modifications, or
126
      for any such Derivative Works as a whole, provided Your use,
127
      reproduction, and distribution of the Work otherwise complies with
128
      the conditions stated in this License.
129
130
   5. Submission of Contributions. Unless You explicitly state otherwise,
131
      any Contribution intentionally submitted for inclusion in the Work
132
      by You to the Licensor shall be under the terms and conditions of
133
      this License, without any additional terms or conditions.
134
      Notwithstanding the above, nothing herein shall supersede or modify
135
      the terms of any separate license agreement you may have executed
136
      with Licensor regarding such Contributions.
137
138
   6. Trademarks. This License does not grant permission to use the trade
139
      names, trademarks, service marks, or product names of the Licensor,
140
      except as required for reasonable and customary use in describing the
141
      origin of the Work and reproducing the content of the NOTICE file.
142
143
   7. Disclaimer of Warranty. Unless required by applicable law or
144
      agreed to in writing, Licensor provides the Work (and each
145
      Contributor provides its Contributions) on an "AS IS" BASIS,
146
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
      implied, including, without limitation, any warranties or conditions
148
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
      PARTICULAR PURPOSE. You are solely responsible for determining the
150
      appropriateness of using or redistributing the Work and assume any
151
      risks associated with Your exercise of permissions under this License.
152
153
   8. Limitation of Liability. In no event and under no legal theory,
154
      whether in tort (including negligence), contract, or otherwise,
155
      unless required by applicable law (such as deliberate and grossly
156
      negligent acts) or agreed to in writing, shall any Contributor be
157
      liable to You for damages, including any direct, indirect, special,
158
      incidental, or consequential damages of any character arising as a
159
      result of this License or out of the use or inability to use the
160
      Work (including but not limited to damages for loss of goodwill,
161
      work stoppage, computer failure or malfunction, or any and all
162
      other commercial damages or losses), even if such Contributor
163
      has been advised of the possibility of such damages.
164
165
   9. Accepting Warranty or Additional Liability. While redistributing
166
      the Work or Derivative Works thereof, You may choose to offer,
167
      and charge a fee for, acceptance of support, warranty, indemnity,
168
      or other liability obligations and/or rights consistent with this
169
      License. However, in accepting such obligations, You may act only
170
      on Your own behalf and on Your sole responsibility, not on behalf
171
      of any other Contributor, and only if You agree to indemnify,
172
      defend, and hold each Contributor harmless for any liability
173
      incurred by, or claims asserted against, such Contributor by reason
174
      of your accepting any such warranty or additional liability.
175
176
   END OF TERMS AND CONDITIONS
177
178
   APPENDIX: How to apply the Apache License to your work.
179
180
      To apply the Apache License to your work, attach the following
181
      boilerplate notice, with the fields enclosed by brackets "[]"
182
      replaced with your own identifying information. (Don't include
183
      the brackets!)  The text should be enclosed in the appropriate
184
      comment syntax for the file format. We also recommend that a
185
      file or class name and description of purpose be included on the
186
      same "printed page" as the copyright notice for easier
187
      identification within third-party archives.
188
189
   Copyright [yyyy] [name of copyright owner]
190
191
   Licensed under the Apache License, Version 2.0 (the "License");
192
   you may not use this file except in compliance with the License.
193
   You may obtain a copy of the License at
194
195
       http://www.apache.org/licenses/LICENSE-2.0
196
197
   Unless required by applicable law or agreed to in writing, software
198
   distributed under the License is distributed on an "AS IS" BASIS,
199
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
   See the License for the specific language governing permissions and
201
   limitations under the License.

BIN
zxing/src/main/assets/images/big-1d.png


BIN
zxing/src/main/assets/images/big-aztec.png


BIN
zxing/src/main/assets/images/big-datamatrix.png


BIN
zxing/src/main/assets/images/big-pdf417.png


BIN
zxing/src/main/assets/images/big-qr.png


BIN
zxing/src/main/assets/images/contact-results-screen.jpg


BIN
zxing/src/main/assets/images/demo-no.png


BIN
zxing/src/main/assets/images/demo-yes.png


BIN
zxing/src/main/assets/images/scan-example.png


BIN
zxing/src/main/assets/images/scan-from-phone.png


BIN
zxing/src/main/assets/images/search-book-contents.jpg


+ 0 - 28
zxing/src/main/assets/style.css

@ -1,28 +0,0 @@
1
body {
2
  background-color: #000000;
3
  color: #FFFFFF;
4
}
5
img {
6
  margin: 3px;
7
}
8
li {
9
  padding-top: 3px;
10
  padding-bottom: 3px;
11
  margin-left: -3px;
12
}
13
ul.touchable li {
14
  padding-top: 8px;
15
  padding-bottom: 8px;
16
}
17
a:link {
18
  color: #FFFFFF;
19
}
20
a:visited {
21
  color: #C0C0C0;
22
}
23
td {
24
  vertical-align: top;
25
}
26
p.imgcenter {
27
  text-align:center;
28
}

+ 93 - 95
zxing/src/main/java/com/google/zxing/client/android/CaptureActivity.java

@ -49,7 +49,6 @@ import android.widget.RelativeLayout;
49 49
import android.widget.TextView;
50 50
import android.widget.Toast;
51 51
52
import com.blankj.utilcode.util.BarUtils;
53 52
import com.blankj.utilcode.util.CacheUtils;
54 53
import com.blankj.utilcode.util.EmptyUtils;
55 54
import com.blankj.utilcode.util.LogUtils;
@ -95,11 +94,12 @@ import pub.devrel.easypermissions.EasyPermissions;
95 94
 * @author dswitkin@google.com (Daniel Switkin)
96 95
 * @author Sean Owen
97 96
 */
98
public final class CaptureActivity extends Activity implements SurfaceHolder.Callback ,EasyPermissions.PermissionCallbacks{
99
    private TextView tv_light,tv_input;
97
public final class CaptureActivity extends Activity implements SurfaceHolder.Callback,
98
        EasyPermissions.PermissionCallbacks {
99
    private TextView tv_light, tv_input;
100 100
    private LoadingDialog loadingDialog;
101
    private LinearLayout ll_light,ll_input;
102
    private ImageView iv_light,iv_back,iv_tip;
101
    private LinearLayout ll_light, ll_input;
102
    private ImageView iv_light, iv_back, iv_tip;
103 103
    private AlertDialogTwo alertDialog;
104 104
    private ArrayList<OperatorPicsBean> operatorPicBeen;
105 105
    private RelativeLayout rl_costway;
@ -125,7 +125,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
125 125
    private CaptureActivityHandler handler;
126 126
    private Result savedResultToShow;
127 127
    private ViewfinderView viewfinderView;
128
    private TextView statusView,tv_cost_type,tv_yue,tv_recharge;
128
    private TextView statusView, tv_cost_type, tv_yue, tv_recharge;
129 129
    private View resultView;
130 130
    private Result lastResult;
131 131
    private boolean hasSurface;
@ -144,7 +144,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
144 144
    private Camera camera;
145 145
    private Camera.Parameters params;
146 146
    private boolean isOpen = false;
147
    private String url="",user_id="",user_password="",user_phone="";
147
    private String url = "", user_id = "", user_password = "", user_phone = "";
148 148
    private long cha;
149 149
    private static final String numType = "1";
150 150
    private static final int checkInterface = 1;
@ -179,7 +179,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
179 179
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
180 180
        setContentView(R.layout.capture);
181 181
        activity = this;
182
        tellList = CacheUtils.getInstance().getString("tellList","");
182
        tellList = CacheUtils.getInstance().getString("tellList", "");
183 183
184 184
        alertDialog = new AlertDialogTwo(CaptureActivity.this);
185 185
@ -204,13 +204,13 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
204 204
            @Override
205 205
            public void onClick(View v) {
206 206
207
                if (!isOpen){
207
                if (!isOpen) {
208 208
//                    CameraManager.openLight();
209 209
                    cameraManager.setTorch(true);
210 210
                    iv_light.setImageResource(R.drawable.icon_light_open);
211 211
                    tv_light.setText("关闭手电筒");
212 212
                    isOpen = true;
213
                }else {
213
                } else {
214 214
//                    CameraManager.closeLight();
215 215
                    cameraManager.setTorch(false);
216 216
                    iv_light.setImageResource(R.drawable.icon_light_close);
@ -270,15 +270,15 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
270 270
271 271
    }
272 272
273
    private void getIntentData(){
273
    private void getIntentData() {
274 274
        url = getIntent().getStringExtra("url");
275 275
        user_id = getIntent().getStringExtra("user_id");
276 276
        user_password = getIntent().getStringExtra("user_password");
277 277
        user_phone = getIntent().getStringExtra("user_phone");
278 278
        LogUtils.e(user_phone);
279
        Log.e(TAG, "getIntentData: "+url );
280
        cha = getIntent().getLongExtra("cha",0);
281
        Log.e(TAG, "getIntentData: "+cha );
279
        Log.e(TAG, "getIntentData: " + url);
280
        cha = getIntent().getLongExtra("cha", 0);
281
        Log.e(TAG, "getIntentData: " + cha);
282 282
        userChargingCheck();
283 283
    }
284 284
@ -331,12 +331,12 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
331 331
332 332
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
333 333
334
    if (prefs.getBoolean(PreferencesActivity.KEY_DISABLE_AUTO_ORIENTATION, true)) {
335
        setRequestedOrientation(getCurrentOrientation());
336
    } else {
337
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); // 旋转
338
        myOrientationDetector.enable(); //启用监听
339
    }
334
        if (prefs.getBoolean(PreferencesActivity.KEY_DISABLE_AUTO_ORIENTATION, true)) {
335
            setRequestedOrientation(getCurrentOrientation());
336
        } else {
337
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR); // 旋转
338
            myOrientationDetector.enable(); //启用监听
339
        }
340 340
341 341
342 342
        resetStatusView();
@ -621,7 +621,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
621 621
    public void handleDecode(Result rawResult, Bitmap barcode, float scaleFactor) {
622 622
623 623
        inactivityTimer.onActivity();
624
        Toast.makeText(getApplicationContext(),rawResult.getText(),Toast.LENGTH_SHORT);
624
        Toast.makeText(getApplicationContext(), rawResult.getText(), Toast.LENGTH_SHORT);
625 625
        lastResult = rawResult;
626 626
        loadingDialog.show();
627 627
        startCharging(rawResult.getText());
@ -950,7 +950,6 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
950 950
    }
951 951
952 952
953
954 953
    MyOrientationDetector myOrientationDetector;
955 954
956 955
    @Override
@ -998,7 +997,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
998 997
            } else {
999 998
                orientation = -1;
1000 999
            }
1001
            if ((orientation == 90  && lastOrientation == 270) || (orientation == 270  && lastOrientation == 90)) {
1000
            if ((orientation == 90 && lastOrientation == 270) || (orientation == 270 && lastOrientation == 90)) {
1002 1001
                Log.i(TAG, "orientation:" + orientation + "lastOrientation:" + lastOrientation);
1003 1002
                Intent intent = getIntent();
1004 1003
                finish();
@ -1021,7 +1020,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1021 1020
            e.printStackTrace();
1022 1021
        }
1023 1022
        String url = UrlConstants.HOST_URL + "member/get-score?id=" + user_id +
1024
                "&phone=" +user_phone + "&password=" + URLEncoder.encode(user_password) + "&token=" + replace;
1023
                "&phone=" + user_phone + "&password=" + URLEncoder.encode(user_password) + "&token=" + replace;
1025 1024
        LogUtils.e(url);
1026 1025
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1027 1026
            @Override
@ -1052,7 +1051,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1052 1051
1053 1052
                            }
1054 1053
                        });
1055
                        if (!tellList.contains(user_phone)){
1054
                        if (!tellList.contains(user_phone)) {
1056 1055
//                            showNonSecretDialog(money,free_status);
1057 1056
                        }
1058 1057
                    } else {
@ -1070,60 +1069,60 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1070 1069
        });
1071 1070
    }
1072 1071
1073
    private void showNonSecretDialog(final String money, final String free_status){
1072
    private void showNonSecretDialog(final String money, final String free_status) {
1074 1073
        new Handler().postDelayed(new Runnable() {
1075 1074
            @Override
1076 1075
            public void run() {
1077
                    if (Float.parseFloat(money) > 3 && free_status.equals("0")) {
1078
                        boolean isDestory = true;
1079
                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
1080
                            isDestory = CaptureActivity.this.isDestroyed();
1081
                        }
1082
                        if (!CaptureActivity.this.isFinishing() && isDestory == false) {
1083
                            alertDialog.builder()
1084
                                    .setMsg("新增支付宝小额免密支付功能,开通后无需充值,直接充电,快来开通吧")
1085
                                    .setPositiveButton("去开通", new View.OnClickListener() {
1086
                                        @Override
1087
                                        public void onClick(View v) {
1088
                                            Intent intent = new Intent();
1089
                                            intent.setClassName("com.electric.chargingpile",
1090
                                                    "com.electric.chargingpile.activity.NonSecretSeettingActivity");
1091
                                            Uri uri = Uri.parse("chongdianzhuang://");
1092
                                            intent.setData(uri);
1093
                                            startActivity(intent);
1094
                                        }
1095
                                    }).setNegativeButton("忽略", new View.OnClickListener() {
1096
                                @Override
1097
                                public void onClick(View v) {
1076
                if (Float.parseFloat(money) > 3 && free_status.equals("0")) {
1077
                    boolean isDestory = true;
1078
                    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
1079
                        isDestory = CaptureActivity.this.isDestroyed();
1080
                    }
1081
                    if (!CaptureActivity.this.isFinishing() && isDestory == false) {
1082
                        alertDialog.builder()
1083
                                .setMsg("新增支付宝小额免密支付功能,开通后无需充值,直接充电,快来开通吧")
1084
                                .setPositiveButton("去开通", new View.OnClickListener() {
1085
                                    @Override
1086
                                    public void onClick(View v) {
1087
                                        Intent intent = new Intent();
1088
                                        intent.setClassName("com.electric.chargingpile",
1089
                                                "com.electric.chargingpile.activity.NonSecretSeettingActivity");
1090
                                        Uri uri = Uri.parse("chongdianzhuang://");
1091
                                        intent.setData(uri);
1092
                                        startActivity(intent);
1093
                                    }
1094
                                }).setNegativeButton("忽略", new View.OnClickListener() {
1095
                            @Override
1096
                            public void onClick(View v) {
1098 1097
1099
                                }
1100
                            }).show();
1101
                            tellList += user_phone;
1102
                            CacheUtils.getInstance().put("tellList",tellList);
1103
                        }
1098
                            }
1099
                        }).show();
1100
                        tellList += user_phone;
1101
                        CacheUtils.getInstance().put("tellList", tellList);
1104 1102
                    }
1103
                }
1105 1104
            }
1106 1105
        }, 50);
1107 1106
    }
1108 1107
1109
    private void handlingOperations(String response,int interfaceType){
1110
        LogUtils.e(interfaceType+"---"+response);
1111
        String rtnCode = JsonUtils.getKeyResult(response,"rtnCode");
1112
        String rtnMsg = JsonUtils.getKeyResult(response,"rtnMsg");
1113
        switch (rtnCode){
1108
    private void handlingOperations(String response, int interfaceType) {
1109
        LogUtils.e(interfaceType + "---" + response);
1110
        String rtnCode = JsonUtils.getKeyResult(response, "rtnCode");
1111
        String rtnMsg = JsonUtils.getKeyResult(response, "rtnMsg");
1112
        switch (rtnCode) {
1114 1113
            case "01":
1115
                if (interfaceType == startInterface){
1116
                    String data = JsonUtils.getKeyResult(response,"data");
1117
                    String orderid = JsonUtils.getKeyResult(data,"orderId");
1114
                if (interfaceType == startInterface) {
1115
                    String data = JsonUtils.getKeyResult(response, "data");
1116
                    String orderid = JsonUtils.getKeyResult(data, "orderId");
1118 1117
                    Intent intent = new Intent();
1119 1118
                    intent.setClassName("com.electric.chargingpile",
1120 1119
                            "com.electric.chargingpile.activity.TLDLoadingActivity");
1121
                    intent.putExtra(ChargingConstants.ORDERID,orderid);
1120
                    intent.putExtra(ChargingConstants.ORDERID, orderid);
1122 1121
                    startActivity(intent);
1123 1122
                }
1124 1123
                break;
1125 1124
            case "304":
1126
                if (try304Count > 1){
1125
                if (try304Count > 1) {
1127 1126
                    break;
1128 1127
                }
1129 1128
                try304Count++;
@ -1156,7 +1155,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1156 1155
                }
1157 1156
                break;
1158 1157
            case "305":
1159
                if (try305Count > 1){
1158
                if (try305Count > 1) {
1160 1159
                    break;
1161 1160
                }
1162 1161
                try305Count++;
@ -1178,7 +1177,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1178 1177
                }
1179 1178
                break;
1180 1179
            case "309":
1181
                if (try309Count > 1){
1180
                if (try309Count > 1) {
1182 1181
                    break;
1183 1182
                }
1184 1183
                try309Count++;
@ -1200,17 +1199,17 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1200 1199
                }
1201 1200
                break;
1202 1201
            case "306":
1203
                if (try306Count > 1){
1202
                if (try306Count > 1) {
1204 1203
                    break;
1205 1204
                }
1206 1205
                try306Count++;
1207 1206
                //跳转到充电详情界面
1208
                String data306 = JsonUtils.getKeyResult(response,"data");
1209
                String orderid = JsonUtils.getKeyResult(data306,"orderId");
1207
                String data306 = JsonUtils.getKeyResult(response, "data");
1208
                String orderid = JsonUtils.getKeyResult(data306, "orderId");
1210 1209
                Intent intent306 = new Intent();
1211 1210
                intent306.setClassName("com.electric.chargingpile",
1212 1211
                        "com.electric.chargingpile.activity.ChargingStatusActivity");
1213
                intent306.putExtra(ChargingConstants.ORDERID,orderid);
1212
                intent306.putExtra(ChargingConstants.ORDERID, orderid);
1214 1213
                startActivity(intent306);
1215 1214
                finish();
1216 1215
                break;
@ -1230,7 +1229,7 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1230 1229
                }
1231 1230
                break;
1232 1231
            case "311":
1233
                if (try311Count > 1){
1232
                if (try311Count > 1) {
1234 1233
                    break;
1235 1234
                }
1236 1235
                try311Count++;
@ -1253,29 +1252,29 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1253 1252
                break;
1254 1253
            case "1800":
1255 1254
                //运营商为彭辉时的操作
1256
                String data1800 = JsonUtils.getKeyResult(response,"data");
1257
                String pileId = JsonUtils.getKeyResult(data1800,"pileId");
1255
                String data1800 = JsonUtils.getKeyResult(response, "data");
1256
                String pileId = JsonUtils.getKeyResult(data1800, "pileId");
1258 1257
                Intent intent1800 = new Intent();
1259 1258
                intent1800.setClassName("com.electric.chargingpile",
1260 1259
                        "com.electric.chargingpile.activity.SelectPileActivity");
1261
                intent1800.putExtra(ChargingConstants.ORDERID,pileId);
1260
                intent1800.putExtra(ChargingConstants.ORDERID, pileId);
1262 1261
                startActivity(intent1800);
1263 1262
                break;
1264 1263
            default:
1265 1264
                new Handler().postDelayed(new Runnable() {
1266
                        public void run() {
1267
                            restartPreviewAfterDelay(0L);
1268
                        }
1269
                    }, 1500);
1270
                ToastUtil.showToast(getApplicationContext(),rtnMsg,Toast.LENGTH_SHORT);
1265
                    public void run() {
1266
                        restartPreviewAfterDelay(0L);
1267
                    }
1268
                }, 1500);
1269
                ToastUtil.showToast(getApplicationContext(), rtnMsg, Toast.LENGTH_SHORT);
1271 1270
                break;
1272 1271
        }
1273 1272
    }
1274 1273
1275
    private void userChargingCheck(){
1274
    private void userChargingCheck() {
1276 1275
        OkHttpUtils.get().url(UrlConstants.USER_CHARGING_CHECK_URL)
1277
                .addParams(ChargingConstants.USERID,user_id)
1278
                .addParams(ChargingConstants.PWD,user_password)
1276
                .addParams(ChargingConstants.USERID, user_id)
1277
                .addParams(ChargingConstants.PWD, user_password)
1279 1278
                .build().execute(new StringCallback() {
1280 1279
            @Override
1281 1280
            public void onError(Call call, Exception e) {
@ -1286,22 +1285,22 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1286 1285
            public void onResponse(String response) {
1287 1286
                LogUtils.e(response);
1288 1287
                if (EmptyUtils.isNotEmpty(response)) {
1289
                    handlingOperations(response,checkInterface);
1288
                    handlingOperations(response, checkInterface);
1290 1289
                }
1291 1290
            }
1292 1291
        });
1293 1292
    }
1294 1293
1295
    private void startCharging(String result){
1294
    private void startCharging(String result) {
1296 1295
        OkHttpUtils.get().url(UrlConstants.START_CHARGING_URL)
1297
                .addParams(ChargingConstants.FLAG,numType)
1298
                .addParams(ChargingConstants.URL,URLEncoder.encode(result))
1299
                .addParams(ChargingConstants.USERID,user_id)
1300
                .addParams(ChargingConstants.PWD,user_password)
1296
                .addParams(ChargingConstants.FLAG, numType)
1297
                .addParams(ChargingConstants.URL, URLEncoder.encode(result))
1298
                .addParams(ChargingConstants.USERID, user_id)
1299
                .addParams(ChargingConstants.PWD, user_password)
1301 1300
                .build().connTimeOut(30000).readTimeOut(30000).execute(new StringCallback() {
1302 1301
            @Override
1303 1302
            public void onError(Call call, Exception e) {
1304
                ToastUtil.showToast(getApplicationContext(),"网络异常,请检查您的网络连接", Toast.LENGTH_SHORT);
1303
                ToastUtil.showToast(getApplicationContext(), "网络异常,请检查您的网络连接", Toast.LENGTH_SHORT);
1305 1304
            }
1306 1305
1307 1306
            @Override
@ -1317,9 +1316,9 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1317 1316
        });
1318 1317
    }
1319 1318
1320
    private void dismissDialog(){
1319
    private void dismissDialog() {
1321 1320
        if (activity != null && !activity.isFinishing()) {
1322
            if (loadingDialog.isShowing()){
1321
            if (loadingDialog.isShowing()) {
1323 1322
                loadingDialog.dismiss();
1324 1323
            }
1325 1324
@ -1353,8 +1352,8 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1353 1352
        return EasyPermissions.hasPermissions(this, Manifest.permission.CALL_PHONE);
1354 1353
    }
1355 1354
1356
    private void getOperatorList(){
1357
        String url = UrlConstants.HOST_URL+"suppiler/operator-list";
1355
    private void getOperatorList() {
1356
        String url = UrlConstants.HOST_URL + "suppiler/operator-list";
1358 1357
        OkHttpUtils.get().url(url).build().execute(new StringCallback() {
1359 1358
            @Override
1360 1359
            public void onError(Call call, Exception e) {
@ -1364,8 +1363,9 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1364 1363
            @Override
1365 1364
            public void onResponse(String response) {
1366 1365
                LogUtils.e(response);
1367
                    Gson g = new Gson();
1368
                    operatorPicBeen = g.fromJson(response,new TypeToken<ArrayList<OperatorPicsBean>>(){}.getType());
1366
                Gson g = new Gson();
1367
                operatorPicBeen = g.fromJson(response, new TypeToken<ArrayList<OperatorPicsBean>>() {
1368
                }.getType());
1369 1369
            }
1370 1370
        });
1371 1371
    }
@ -1456,6 +1456,4 @@ public final class CaptureActivity extends Activity implements SurfaceHolder.Cal
1456 1456
//    }
1457 1457
1458 1458
1459
1460
1461 1459
}

cdzApp - Gogs: Go Git Service

充电桩app代码

关注者 - Gogs: Go Git Service