135
    private boolean hasTellPermission() {
136
        return EasyPermissions.hasPermissions(requireContext(), Manifest.permission.CALL_PHONE);
137
    }
138
139
    @Override
140
    public void onRequestPermissionsResult(int requestCode, @NonNull @NotNull String[] permissions, @NonNull @NotNull int[] grantResults) {
141
        super.onRequestPermissionsResult(requestCode, permissions, grantResults);
142
        EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this);
143
    }
144
145
146
    public void show(FragmentManager fragmentManager){
147
        FragmentTransaction ft = fragmentManager.beginTransaction();
148
        Fragment prev = fragmentManager.findFragmentByTag(LockStatusDialog.class.getName());
149
        if (prev != null) {
150
            ft.remove(prev);
151
        }
152
        show(fragmentManager,LockStatusDialog.class.getName());
153
        fragmentManager.executePendingTransactions();
154
    }
155
156
}

BIN
app/src/main/res/drawable-xxhdpi/ic_lock.png


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

@ -0,0 +1,9 @@
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
            <solid android:color="@color/white" />
6
            <corners android:topLeftRadius="20dp" android:topRightRadius="20dp" android:bottomLeftRadius="0dp" android:bottomRightRadius="0dp" />
7
        </shape>
8
    </item>
9
</selector>

+ 10 - 0
app/src/main/res/drawable/bg_lock_contact.xml

@ -0,0 +1,10 @@
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
            <solid  android:color="@color/color_3ec34c" />
6
            <corners android:radius="6dp" />
7
        </shape>
8
    </item>
9
10
</selector>

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

@ -0,0 +1,9 @@
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
            <solid android:color="@color/color_3ec34c" />
6
            <corners android:radius="4dp" />
7
        </shape>
8
    </item>
9
</selector>

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

@ -0,0 +1,9 @@
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="@color/color_3ec34c" />
6
            <corners android:radius="6dp" />
7
        </shape>
8
    </item>
9
</selector>

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

@ -936,7 +936,7 @@
936 936
        android:layout_alignParentBottom="true"
937 937
        android:background="@color/white"
938 938
        android:visibility="gone"
939
        tools:visibility="gone">
939
        tools:visibility="visible">
940 940
941 941
        <LinearLayout
942 942
            android:layout_width="match_parent"
@ -1143,6 +1143,16 @@
1143 1143
                    android:text="免费停车"
1144 1144
                    android:textColor="#828282"
1145 1145
                    android:textSize="11dp" />
1146
                <TextView
1147
                    android:id="@+id/tvFloorLock"
1148
                    android:layout_width="34dp"
1149
                    android:layout_height="18dp"
1150
                    android:layout_marginLeft="5dp"
1151
                    android:background="@drawable/label_round_border"
1152
                    android:gravity="center"
1153
                    android:text="地锁"
1154
                    android:textColor="#828282"
1155
                    android:textSize="11dp" />
1146 1156
1147 1157
                <TextView
1148 1158
                    android:id="@+id/fenshi_info_textview"

+ 102 - 0
app/src/main/res/layout/dialog_lock_status.xml

@ -0,0 +1,102 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3
    xmlns:tools="http://schemas.android.com/tools"
4
    android:layout_width="match_parent"
5
    xmlns:app="http://schemas.android.com/apk/res-auto"
6
    tools:background="#f1f1"
7
    android:layout_height="match_parent">
8
    <LinearLayout
9
        android:orientation="vertical"
10
        android:background="@drawable/bg_dialog_lock_status"
11
        android:layout_width="match_parent"
12
        android:paddingTop="20dp"
13
        android:paddingStart="12dp"
14
        android:paddingEnd="12dp"
15
        android:paddingBottom="30dp"
16
        android:layout_height="match_parent">
17
        <TextView
18
            app:layout_constraintEnd_toEndOf="parent"
19
            app:layout_constraintStart_toStartOf="parent"
20
            app:layout_constraintTop_toTopOf="parent"
21
            android:layout_width="match_parent"
22
            android:layout_height="wrap_content"
23
            android:text="降地锁"
24
            android:textStyle="bold"
25
            android:gravity="center"
26
            android:textColor="@color/color_0e0e0e"
27
            android:textSize="16sp"
28
            />
29
30
        <LinearLayout
31
            android:layout_marginTop="31dp"
32
            android:layout_width="match_parent"
33
            android:layout_height="wrap_content">
34
            <TextView
35
                app:layout_constraintStart_toStartOf="parent"
36
                android:layout_width="0dp"
37
                android:layout_weight="1"
38
                android:layout_height="wrap_content"
39
                android:text="请选择地锁编号"
40
                android:textColor="@color/editcolor"
41
                android:textSize="14sp"
42
                />
43
44
            <TextView
45
                android:id="@+id/tvNum"
46
                android:drawablePadding="3dp"
47
                tools:text="空6/6"
48
                android:textColor="@color/editcolor"
49
                android:textSize="12sp"
50
                android:layout_width="wrap_content"
51
                android:layout_height="wrap_content"
52
                android:drawableStart="@drawable/ic_lock"
53
                />
54
        </LinearLayout>
55
        <TextView
56
            android:layout_marginTop="10dp"
57
            app:layout_constraintStart_toStartOf="parent"
58
            app:layout_constraintTop_toBottomOf="@+id/tvLockCode"
59
            android:layout_width="wrap_content"
60
            android:layout_height="wrap_content"
61
            android:text="非法损坏地锁将追究赔偿"
62
            android:textColor="@color/color_3ec34c"
63
            android:textSize="12sp"
64
            />
65
        <androidx.recyclerview.widget.RecyclerView
66
            android:layout_marginTop="13dp"
67
            android:layout_width="match_parent"
68
            android:id="@+id/recyclerView"
69
            android:layout_weight="1"
70
            android:layout_marginBottom="13dp"
71
            android:layout_height="0dp"/>
72
73
        <LinearLayout
74
            android:layout_width="match_parent"
75
            android:layout_height="wrap_content">
76
            <TextView
77
                android:layout_weight="1"
78
                android:id="@+id/tvRefresh"
79
                android:layout_width="0dp"
80
                android:layout_height="42dp"
81
                android:layout_marginTop="5dp"
82
                android:gravity="center"
83
                android:text="刷新"
84
                android:textColor="@color/color_3ec34c"
85
                android:textSize="16sp"
86
                android:background="@drawable/bg_lock_refresh" />
87
            <TextView
88
                android:layout_weight="1.5"
89
                android:background="@drawable/bg_lock_contact"
90
                android:layout_marginStart="10dp"
91
                android:id="@+id/tvContact"
92
                android:gravity="center"
93
                android:layout_marginTop="5dp"
94
                android:layout_width="0dp"
95
                android:layout_height="42dp"
96
                android:text="联系客服"
97
                android:textColor="@color/white"
98
                android:textSize="16sp"
99
                />
100
        </LinearLayout>
101
    </LinearLayout>
102
</LinearLayout>

+ 34 - 0
app/src/main/res/layout/item_lock.xml

@ -0,0 +1,34 @@
1
<?xml version="1.0" encoding="utf-8"?>
2
<androidx.constraintlayout.widget.ConstraintLayout 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="#f1f"
7
    android:background="#f1f1"
8
    android:layout_marginTop="5dp"
9
    android:layout_height="match_parent">
10
    <TextView
11
        android:id="@+id/tvStatus"
12
        android:gravity="center"
13
        app:layout_constraintTop_toTopOf="parent"
14
        app:layout_constraintEnd_toEndOf="parent"
15
        android:layout_width="29dp"
16
        android:layout_height="17dp"
17
        android:text="空闲"
18
        android:textColor="@color/white"
19
        android:textSize="12sp"
20
        />
21
22
    <TextView
23
        android:id="@+id/tvOrder"
24
        app:layout_constraintEnd_toEndOf="parent"
25
        app:layout_constraintStart_toStartOf="parent"
26
        app:layout_constraintBottom_toBottomOf="parent"
27
        app:layout_constraintTop_toTopOf="parent"
28
        android:layout_width="8dp"
29
        android:layout_height="22dp"
30
        android:text="1"
31
        android:textColor="@color/editcolor"
32
        android:textSize="16sp"
33
        />
34
</androidx.constraintlayout.widget.ConstraintLayout>

+ 34 - 13
app/src/main/res/layout/recommend_charging_station_item.xml

@ -211,20 +211,43 @@
211 211
                android:textSize="11dp" />
212 212
        </LinearLayout>
213 213
    </LinearLayout>
214
    <TextView
215
        android:ellipsize="end"
216
        android:lines="1"
217
        android:visibility="gone"
218
        android:id="@+id/parkingFee"
214
    <LinearLayout
215
        android:layout_marginBottom="5dp"
219 216
        android:layout_marginEnd="15dp"
220 217
        android:layout_marginTop="15dp"
221 218
        android:layout_marginStart="15dp"
222
        android:layout_width="wrap_content"
223
        android:layout_height="wrap_content"
224
        tools:text="停车费:以实际收费为准"
225
        android:textColor="@color/color_ffe32727"
226
        android:textSize="13sp"
227
        />
219
        android:layout_width="match_parent"
220
        android:layout_height="wrap_content">
221
        <TextView
222
            android:gravity="bottom"
223
            android:ellipsize="end"
224
            android:lines="1"
225
            tools:visibility="visible"
226
            android:visibility="gone"
227
            android:id="@+id/parkingFee"
228
            android:layout_width="0dp"
229
            android:layout_weight="1"
230
            android:layout_height="match_parent"
231
            tools:text="停车费:以实际收费为准"
232
            android:textColor="@color/color_ffe32727"
233
            android:textSize="13sp"
234
            />
235
236
        <TextView
237
            tools:visibility="visible"
238
            android:visibility="visible"
239
            android:id="@+id/tvLock"
240
            android:layout_gravity="end|bottom"
241
            android:gravity="center"
242
            android:layout_width="49dp"
243
            android:layout_height="24dp"
244
            android:text="降地锁"
245
            android:background="@drawable/bg_lock_recommend"
246
            android:textColor="@color/white"
247
            android:textSize="12sp"
248
            />
249
250
    </LinearLayout>
228 251
    <LinearLayout
229 252
        android:layout_width="match_parent"
230 253
        android:layout_height="wrap_content"
@ -236,7 +259,6 @@
236 259
            android:id="@+id/payment_method"
237 260
            android:layout_width="0dp"
238 261
            android:layout_height="wrap_content"
239
            android:layout_marginTop="20dp"
240 262
            android:layout_weight="1"
241 263
            android:ellipsize="end"
242 264
            android:lines="1"
@ -249,7 +271,6 @@
249 271
            android:id="@+id/recommend_nav"
250 272
            android:layout_width="50dp"
251 273
            android:layout_height="24dp"
252
            android:layout_marginTop="20dp"
253 274
            android:background="@drawable/recommend_btn_normal"
254 275
            android:text="导航"
255 276
            android:textColor="#83d287"

+ 2 - 0
app/src/main/res/values/styles.xml

@ -380,4 +380,6 @@
380 380
    <style name="SquareCheckboxTheme" parent="@android:style/Widget.CompoundButton.CheckBox">
381 381
        <item name="android:button">@drawable/bg_car_owner_check</item>
382 382
    </style>
383

384

383 385
</resources>

立即邀请开发完成 · b0ac816a0c - Gogs: Go Git Service
Pārlūkot izejas kodu

立即邀请开发完成

huyuguo 5 gadi atpakaļ
vecāks
revīzija
b0ac816a0c

+ 0 - 1
app/src/main/AndroidManifest.xml

@ -150,7 +150,6 @@
150 150
            android:name=".wxapi.WXEntryActivity"
151 151
            android:configChanges="keyboardHidden|orientation|screenSize"
152 152
            android:exported="true"
153
            android:screenOrientation="portrait"
154 153
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
155 154
        <activity
156 155
            android:name=".wxapi.WXPayEntryActivity"

+ 37 - 11
app/src/main/java/com/electric/chargingpile/activity/MyWebViewActivity.java

@ -23,6 +23,7 @@ import android.provider.MediaStore;
23 23
import androidx.annotation.NonNull;
24 24
import androidx.core.content.FileProvider;
25 25
26
import android.text.TextUtils;
26 27
import android.util.Log;
27 28
import android.view.KeyEvent;
28 29
import android.view.View;
@ -111,6 +112,7 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
111 112
    private final static int FILE_CHOOSER_RESULT_CODE = 128;  // 图片
112 113
    private final static int FILE_CAMERA_RESULT_CODE = 129; // 拍照
113 114
    private String cameraFilePath;  // 拍照图片路径
115
    private boolean loginToShare;
114 116
115 117
    @Override
116 118
    protected void onCreate(Bundle savedInstanceState) {
@ -174,6 +176,10 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
174 176
            } else {
175 177
                mUrl = mUrl + "?version_code=" + BuildConfig.VERSION_CODE + "&from=cdz&system=android";
176 178
            }
179
            if (MainApplication.isLogin()) {
180
                mUrl = mUrl + "&phone=" + MainApplication.userPhone;
181
            }
182
177 183
            webView.loadUrl(mUrl);
178 184
        }
179 185
    }
@ -182,7 +188,7 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
182 188
    @JavascriptInterface
183 189
    public void showminiprogram(final String user_name, String path, int type) {
184 190
        if (Util.isWxAppInstalledAndSupported(MyWebViewActivity.this)) {
185
            IWXAPI api = WXAPIFactory.createWXAPI(MyWebViewActivity.this,getResources().getString(R.string.wx_app_key));
191
            IWXAPI api = WXAPIFactory.createWXAPI(MyWebViewActivity.this, getResources().getString(R.string.wx_app_key));
186 192
            WXLaunchMiniProgram.Req req = new WXLaunchMiniProgram.Req();
187 193
            req.userName = user_name;
188 194
            req.path = path;
@ -194,6 +200,18 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
194 200
    }
195 201
196 202
    @JavascriptInterface
203
    public void welfareshare(final String shareUrl) {
204
        if (TextUtils.isEmpty(shareUrl)) {
205
            loginToShare = true;
206
            startActivity(new Intent(getApplicationContext(), LoginActivity.class));
207
            ToastUtil.showToast(getApplicationContext(), "请先登录", Toast.LENGTH_SHORT);
208
        } else {
209
            loginToShare = false;
210
            showSimpleBottomSheetGrid(shareUrl);
211
        }
212
    }
213
214
    @JavascriptInterface
197 215
    public void showsharebtn(final String show) {
198 216
        runOnUiThread(new Runnable() {
199 217
            @Override
@ -322,10 +340,10 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
322 340
    }
323 341
324 342
    private void btnToShare() {
325
        showSimpleBottomSheetGrid();
343
        showSimpleBottomSheetGrid(shareUrl);
326 344
    }
327 345
328
    private void showSimpleBottomSheetGrid() {
346
    private void showSimpleBottomSheetGrid(final String shareUrl) {
329 347
        final int TAG_SHARE_WECHAT_FRIEND = 0;
330 348
        final int TAG_SHARE_WECHAT_MOMENT = 1;
331 349
        final int TAG_SHARE_QQ = 2;
@ -340,13 +358,13 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
340 358
                        int tag = (int) itemView.getTag();
341 359
                        switch (tag) {
342 360
                            case TAG_SHARE_WECHAT_FRIEND:
343
                                share(Wechat.NAME);
361
                                share(Wechat.NAME, shareUrl);
344 362
                                break;
345 363
                            case TAG_SHARE_WECHAT_MOMENT:
346
                                share(WechatMoments.NAME);
364
                                share(WechatMoments.NAME, shareUrl);
347 365
                                break;
348 366
                            case TAG_SHARE_QQ:
349
                                share(QQ.NAME);
367
                                share(QQ.NAME, shareUrl);
350 368
                                break;
351 369
                        }
352 370
                    }
@ -383,7 +401,7 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
383 401
        build.show();
384 402
    }
385 403
386
    private void share(final String name) {
404
    private void share(final String name, final String shareUrl) {
387 405
        Platform.ShareParams paramsToShare = new Platform.ShareParams();
388 406
        paramsToShare.setText(shareContext);
389 407
        paramsToShare.setTitle(shareTitle);
@ -441,7 +459,7 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
441 459
442 460
    @JavascriptInterface
443 461
    public void gotoshare() {
444
        showSimpleBottomSheetGrid();
462
        showSimpleBottomSheetGrid(shareUrl);
445 463
    }
446 464
447 465
@ -913,6 +931,15 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
913 931
                break;
914 932
            }
915 933
        }
934
935
        if (null != mUrl && !"".equals(mUrl) && loginToShare) {
936
            if (!mUrl.contains("&phone=")) {
937
                if (MainApplication.isLogin()) {
938
                    mUrl = mUrl + "&phone=" + MainApplication.userPhone;
939
                    webView.loadUrl(mUrl);
940
                }
941
            }
942
        }
916 943
    }
917 944
918 945
    private void skipShopCenter() {
@ -1070,7 +1097,7 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
1070 1097
                //当用户登录成功后,需要重新请求一次服务端,带上currentUrl。
1071 1098
                //用该方法中的webview变量加载请求链接。
1072 1099
                //服务端收到请求后在生成免登录url时,将currentUrl放入redirect参数,通知客户端302跳转到新生成的免登录URL。
1073
                new android.app.AlertDialog.Builder(webView.getContext())
1100
                new AlertDialog.Builder(webView.getContext())
1074 1101
                        .setTitle("跳转登录")
1075 1102
                        .setMessage("跳转到登录页面?")
1076 1103
                        .setPositiveButton("是", new DialogInterface.OnClickListener() {
@ -1092,7 +1119,7 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
1092 1119
             */
1093 1120
            public void onCopyCode(WebView webView, String code) {
1094 1121
                //当未登录的用户点击去登录时,会调用此处代码。
1095
                new android.app.AlertDialog.Builder(webView.getContext())
1122
                new AlertDialog.Builder(webView.getContext())
1096 1123
                        .setTitle("复制券码")
1097 1124
                        .setMessage("已复制,券码为:" + code)
1098 1125
                        .setPositiveButton("是", null)
@ -1262,7 +1289,6 @@ public class MyWebViewActivity extends Activity implements PlatformActionListene
1262 1289
        public void onGeolocationPermissionsShowPrompt(String origin,
1263 1290
                                                       GeolocationPermissions.Callback callback) {
1264 1291
            callback.invoke(origin, true, false);
1265
            // TODO Auto-generated method stub
1266 1292
            super.onGeolocationPermissionsShowPrompt(origin, callback);
1267 1293
        }
1268 1294