Merge branch 'master' into newlj
This commit is contained in:
commit
0b2d42c090
@ -2,6 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.arpa.hndahesudintocctmsdriver">
|
||||
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<!-- 白名单 -->
|
||||
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
|
||||
@ -71,14 +72,14 @@
|
||||
android:configChanges="orientation|keyboardHidden|screenSize"
|
||||
android:exported="true"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" ></activity>
|
||||
android:screenOrientation="portrait"></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.WithdrawalActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderAllActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@ -93,11 +94,11 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.PhotoCarActivity"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.VehicleAuthActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.ShangChuangImgActivity"
|
||||
android:screenOrientation="portrait">
|
||||
@ -156,13 +157,13 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.GetShangChuanActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AuthQualificationActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.OrderListActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.HuoYunDelActivity"
|
||||
android:screenOrientation="portrait">
|
||||
@ -175,14 +176,14 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.auth.AddCarSuccActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.LoginActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.login.WelcomeActivity"
|
||||
android:exported="true"
|
||||
@ -206,10 +207,10 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.VideoReleaseActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.WebPDFActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.StartYunDanActivity"
|
||||
android:screenOrientation="portrait">
|
||||
@ -217,17 +218,21 @@
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.drivercircle.HomePageActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.alert.VehicleChoiceActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.home.shangchuan.OrderComplaintActivity"
|
||||
android:screenOrientation="portrait"/>
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.ui.web.WebKfActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@ -237,7 +242,7 @@
|
||||
<activity
|
||||
android:name=".ui.news.NewActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
android:windowSoftInputMode="stateAlwaysHidden" />
|
||||
|
||||
<service
|
||||
android:name="com.arpa.hndahesudintocctmsdriver.service.TrackService"
|
||||
@ -280,7 +285,7 @@
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="${GAODEKEY}" />
|
||||
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
|
||||
<!-- android:value="702eaa84675618b8eb69298d9fd42ca3" />-->
|
||||
|
||||
<service android:name="com.amap.api.location.APSService"></service>
|
||||
|
||||
@ -376,10 +381,11 @@
|
||||
|
||||
<activity
|
||||
android:name=".H5Activity"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask">
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
@ -397,10 +403,11 @@
|
||||
|
||||
<activity
|
||||
android:name=".H5Activity2"
|
||||
android:screenOrientation="portrait"
|
||||
android:launchMode="singleTask">
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
|
||||
|
@ -41,6 +41,7 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.cuspop.SimCenterPop;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.UserRequset;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.MainActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.UiAuxiliary;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity;
|
||||
@ -249,7 +250,7 @@ public class H5Activity extends AppCompatActivity {
|
||||
Uri uri = Uri.parse(url);
|
||||
Log.e("test", "要加载的地址:" + uri.getScheme() + " " + url + " ");
|
||||
if (uri.getScheme().equals("http") || uri.getScheme().equals("https")) {
|
||||
if (isGoCar&&url.startsWith("http://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")){
|
||||
if (isGoCar&&url.startsWith("https://agreement.dahehuoyun.com/#/1ba5c216/912f4c9587/5eb5184653/6ef9")){
|
||||
isOk = true;
|
||||
view.loadUrl(url);
|
||||
new MessageUtils().showSimCenPop(ctx, "个人信息上传成功,请添加车辆信息!", "去添加",() -> {
|
||||
|
@ -99,10 +99,19 @@ public class CarInfoBean2 implements Serializable {
|
||||
private String threeImageStatus;
|
||||
private String towAuality;
|
||||
private String trailer;
|
||||
private String trailerId;
|
||||
private String type;
|
||||
private String vehicleAxis;
|
||||
private String vehicleNumber;
|
||||
|
||||
public String getTrailerId() {
|
||||
return trailerId;
|
||||
}
|
||||
|
||||
public void setTrailerId(String trailerId) {
|
||||
this.trailerId = trailerId;
|
||||
}
|
||||
|
||||
public String getAllAuality() {
|
||||
return allAuality;
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebActivity;
|
||||
@ -68,7 +69,7 @@ public class AgreementAlert extends CenterPopupView {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
//用户服务协议点击事件
|
||||
Intent in=new Intent(getContext(), WebActivity.class);
|
||||
Intent in=new Intent(getContext(), WebOnlyOneActivity.class);
|
||||
in.putExtra("url",url2);
|
||||
in.putExtra("title","用户服务协议");
|
||||
getContext().startActivity(in);
|
||||
@ -87,7 +88,7 @@ public class AgreementAlert extends CenterPopupView {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
//用户服务协议点击事件
|
||||
Intent in=new Intent(getContext(), WebActivity.class);
|
||||
Intent in=new Intent(getContext(), WebOnlyOneActivity.class);
|
||||
in.putExtra("url",url);
|
||||
in.putExtra("title","隐私政策");
|
||||
getContext().startActivity(in);
|
||||
|
@ -143,7 +143,6 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
}, 3000);
|
||||
}
|
||||
} else {
|
||||
finish();
|
||||
if (isOverCar) {//从业资格证=》道路运输许可证
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
@ -154,6 +153,7 @@ public class AuthQualificationActivity extends BaseAppCompatActivity {
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,11 +1,13 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.auth;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
@ -35,6 +37,7 @@ import com.arpa.hndahesudintocctmsdriver.event.VehicleEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.wallet.UpBankActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.MessageUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PickerUtils;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PicturlUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.map.MapUtil;
|
||||
import com.bumptech.glide.Glide;
|
||||
@ -85,6 +88,8 @@ import com.arpa.hndahesudintocctmsdriver.util.view.BaseAppCompatActivity;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseRecyclerView;
|
||||
import com.lxj.xpopup.photoview.PhotoView;
|
||||
import com.lxj.xpopup.util.SmartGlideImageLoader;
|
||||
import com.lxj.xpopup.util.XPermission;
|
||||
import com.permissionx.guolindev.PermissionX;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
@ -120,6 +125,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
private int[] typeImgTwo = {R.mipmap.id_back, R.mipmap.license_back, R.mipmap.vehicle_license_back, R.mipmap.vehicle_license_back};
|
||||
private int index = 0;
|
||||
private String carExistCarId = "";
|
||||
private String trailerId = "";
|
||||
private DicBean.DataDTO curColor, curEnergy;
|
||||
private TextView zj_name, zjimg_name, zjimg2_name, zj_name2, zj_name3;
|
||||
private TextView name1, name2, name3, name4, value5, value6;
|
||||
@ -209,8 +215,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
key = true;
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -221,12 +225,25 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
Intent intent = new Intent(this, H5Activity.class);
|
||||
intent.putExtra("url", (String) bb.getData());
|
||||
intent.putExtra("view_file", false);
|
||||
intent.putExtra("title", "人脸识别");
|
||||
intent.putExtra("isGoCar", true);
|
||||
startActivity(intent);
|
||||
PermissionX.init(this)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
Intent intent = new Intent(this, H5Activity.class);
|
||||
intent.putExtra("url", (String) bb.getData());
|
||||
intent.putExtra("view_file", false);
|
||||
intent.putExtra("title", "人脸识别");
|
||||
intent.putExtra("isGoCar", true);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
act.startActivity(intent);
|
||||
});
|
||||
}
|
||||
});
|
||||
// EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
@ -280,22 +297,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
con.startActivity(in);
|
||||
}
|
||||
finish();
|
||||
// if ("1".equals(needUpQCPhoto)) {
|
||||
// //现逻辑:上传行驶证信息后 判断是否跳转从业资格证
|
||||
// Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
// in.putExtra("type", "0");
|
||||
// in.putExtra("isOverCar", false);
|
||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
// startActivity(in);
|
||||
// } else {
|
||||
// //原逻辑:上传行驶证信息后 跳转车辆照片页面
|
||||
// Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
// in.putExtra("type", 0);
|
||||
// in.putExtra("carId", String.valueOf(czb.getData().getCarId()));
|
||||
// con.startActivity(in);
|
||||
// }
|
||||
|
||||
|
||||
} else {
|
||||
Toast.makeText(con, czb.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -311,7 +312,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
String needUpQCPhoto = bb.getData().getNeedUpQCPhoto();
|
||||
String needUpRLPhoto = bb.getData().getNeedUpRLPhoto();//是否需要上传道路运输证到
|
||||
Toast.makeText(con, "挂车信息保存成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
|
||||
VehicleEvent ve = new VehicleEvent("挂");
|
||||
EventBus.getDefault().post(ve);
|
||||
|
||||
@ -335,6 +336,8 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
}
|
||||
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(con, "挂车信息保存失败", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -459,12 +462,25 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
Log.e("url", CacheGroup.cacheList.get("authUrl"));
|
||||
BaseBean bb = gson.fromJson(CacheGroup.cacheList.get("authUrl"), BaseBean.class);
|
||||
if (bb.getCode() == 200) {
|
||||
Intent intent = new Intent(this, H5Activity.class);
|
||||
intent.putExtra("url", (String) bb.getData());
|
||||
intent.putExtra("view_file", false);
|
||||
intent.putExtra("title", "人脸识别");
|
||||
intent.putExtra("isGoCar", true);
|
||||
startActivity(intent);
|
||||
PermissionX.init(this)
|
||||
.permissions(Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.CAMERA)
|
||||
.request((allGranted, grantedList, deniedList) -> {
|
||||
if (allGranted) {
|
||||
Intent intent = new Intent(this, H5Activity.class);
|
||||
intent.putExtra("url", (String) bb.getData());
|
||||
intent.putExtra("view_file", false);
|
||||
intent.putExtra("title", "人脸识别");
|
||||
intent.putExtra("isGoCar", true);
|
||||
startActivity(intent);
|
||||
} else {
|
||||
new MessageUtils().showSimCenPop(act, "缺少相机,媒体权限,将无法为您提供服务,去开启!", "取消", "确认", () -> {
|
||||
Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||
Uri uri = Uri.fromParts("package", getPackageName(), null);
|
||||
intent.setData(uri);
|
||||
act.startActivity(intent);
|
||||
});
|
||||
}
|
||||
});
|
||||
// EsignSdk.getInstance().startH5Activity(act, StringUtil.isNull(String.valueOf(bb.getData()), ""));
|
||||
} else {
|
||||
Toast.makeText(con, bb.getMsg(), Toast.LENGTH_LONG).show();
|
||||
@ -476,6 +492,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (bb.getCode() == 200 && bb.getData() != null) {
|
||||
if (!TextUtils.isEmpty(bb.getData().getCarId())) {
|
||||
carExistCarId = bb.getData().getCarId();
|
||||
trailerId = bb.getData().getTrailerId();
|
||||
value1.setEnabled(false);
|
||||
value2.setEnabled(false);
|
||||
value3.setEnabled(false);
|
||||
@ -497,16 +514,25 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (bb.getCode() == 200) {
|
||||
VehicleEvent ve = new VehicleEvent(String.valueOf(carExistCarId));
|
||||
EventBus.getDefault().postSticky(ve);
|
||||
finish();
|
||||
if (("0".equals(trailerId) || TextUtils.isEmpty(trailerId)) && value2.getText().toString().contains("牵")) {
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 3);
|
||||
in.putExtra("carId", carExistCarId);
|
||||
startActivity(in);
|
||||
finish();
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
|
||||
ToastUtils.showToast(con, bb.getMsg());
|
||||
}else{
|
||||
} else {
|
||||
ToastUtils.showToast(con, bb.getMsg());
|
||||
}
|
||||
CacheGroup.cacheList.remove("bindCarInfo");
|
||||
} else {
|
||||
pathOrcRes();
|
||||
//重复代码?
|
||||
initView(null);
|
||||
// initView(null);
|
||||
if (!(CacheGroup.cacheList.get(TYPE_NAME_BANK[2]) != null || CacheGroup.cacheList.get(TYPE_NAME_BANK[3]) != null)) {
|
||||
initData();
|
||||
}
|
||||
@ -611,6 +637,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
default:
|
||||
break;
|
||||
}
|
||||
initView(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -915,27 +942,29 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
case 0:
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[0]) != null) {
|
||||
ocb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[0]), OCRCardBean.class);
|
||||
ImageLoader.getInstance().loadImage(con, path, img1, typeImgOne[index]);
|
||||
if (ocb.getCode() == 200 && ocb.getData() != null) {
|
||||
// url1 = ocb.getData().getUrl();
|
||||
value1.setText(ocb.getData().getName());
|
||||
value2.setText(ocb.getData().getIdcard());
|
||||
value3.setText(ocb.getData().getAddress());
|
||||
Glide.with(con).load(path).into(img1);
|
||||
// Glide.with(con).load(path).into(img1);
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[0]);
|
||||
}
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME_BANK[0]) != null) {
|
||||
ocbb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME_BANK[0]), OCRCardBackBean.class);
|
||||
ImageLoader.getInstance().loadImage(con, path, img2, typeImgTwo[index]);
|
||||
if (ocbb.getCode() == 200 && ocbb.getData() != null) {
|
||||
value4.setText(ocbb.getData().getValidTo());
|
||||
Glide.with(con).load(path).into(img2);
|
||||
// Glide.with(con).load(path).into(img2);
|
||||
startTime = ocbb.getData().getValidFrom();
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME_BANK[0]);
|
||||
}
|
||||
@ -944,6 +973,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[1]) != null) {
|
||||
odl = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[1]), OCRDrivingLicenseBean.class);
|
||||
ImageLoader.getInstance().loadImage(con, path, img1, typeImgOne[index]);
|
||||
if (odl.getCode() == 200 && odl.getData() != null) {
|
||||
OCRDrivingLicenseBean.DataDTO od = odl.getData();
|
||||
// url1 = odl.getData().getUrl();
|
||||
@ -952,20 +982,22 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
value2.setText(StringUtil.isNull(od.getFirstGetDocDate(), "识别异常"));
|
||||
value3.setText(StringUtil.isNull(od.getQuasiDriveType(), "识别异常"));
|
||||
value4.setText(StringUtil.isNull(od.getEndDate(), "识别异常"));
|
||||
Glide.with(con).load(path).into(img1);
|
||||
|
||||
// Glide.with(con).load(path).into(img1);
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[1]);
|
||||
}
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME_BANK[1]) != null) {
|
||||
odlb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME_BANK[1]), OCRDrivingLicenseBackBean.class);
|
||||
ImageLoader.getInstance().loadImage(con, path, img2, typeImgTwo[index]);
|
||||
if (odlb.getCode() == 200 && odlb.getData() != null) {
|
||||
Glide.with(con).load(path).into(img2);
|
||||
// Glide.with(con).load(path).into(img2);
|
||||
//自动调取提交功能,实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME_BANK[1]);
|
||||
}
|
||||
@ -976,16 +1008,17 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME[2]) != null) {
|
||||
Log.e("olb", CacheGroup.cacheList.get(TYPE_NAME[2]));
|
||||
olb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME[2]), OCRVehicleLicenseBean.class);
|
||||
if (2==index&&olb.getData().getVclN().contains("挂")){
|
||||
Toast.makeText(con,"该证件为挂车,请上传行驶证证件",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (3==index&&!olb.getData().getVclN().contains("挂")){
|
||||
Toast.makeText(con,"未识别到挂车相关信息,请上传挂车行驶证证件",Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
ImageLoader.getInstance().loadImage(con, path, img1, typeImgOne[index]);
|
||||
if (olb.getCode() == 200 && olb.getData() != null) {
|
||||
if (2 == index && olb.getData().getVclN().contains("挂")) {
|
||||
Toast.makeText(con, "该证件为挂车,请上传行驶证证件", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
|
||||
if (3 == index && !olb.getData().getVclN().contains("挂")) {
|
||||
Toast.makeText(con, "未识别到挂车相关信息,请上传挂车行驶证证件", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
carExistCarId = "";
|
||||
value1.setEnabled(true);
|
||||
value2.setEnabled(true);
|
||||
@ -1000,27 +1033,30 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
value4.setText(olb.getData().getVin());
|
||||
// fontId = olb.getData().getId();
|
||||
// Glide.with(con).load(url1).into(img1);
|
||||
Glide.with(con).load(path).into(img1);
|
||||
// Glide.with(con).load(path).into(img1);
|
||||
|
||||
oCrcarId = olb.getData().getCarId() + "";
|
||||
if (!TextUtils.isEmpty(olb.getData().getVclN())&&!olb.getData().getVclN().contains("挂"))
|
||||
if (!TextUtils.isEmpty(olb.getData().getVclN()) && !olb.getData().getVclN().contains("挂"))
|
||||
new AuthRequest().getCarInfo(con, hd, olb.getData().getVclN());
|
||||
Log.e("-cardId-", oCrcarId);
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME[2]);
|
||||
}
|
||||
if (CacheGroup.cacheList.get(TYPE_NAME_BANK[2]) != null) {
|
||||
oblb = gson.fromJson(CacheGroup.cacheList.get(TYPE_NAME_BANK[2]), OCRVehicleBackLicenseBean.class);
|
||||
ImageLoader.getInstance().loadImage(con, path, img2, typeImgTwo[index]);
|
||||
if (oblb.getCode() == 200 && oblb.getData() != null) {
|
||||
// url2 = oblb.getData().getUrl();
|
||||
// backId = oblb.getData().getId();
|
||||
// Glide.with(con).load(url2).into(img2);
|
||||
Glide.with(con).load(path).into(img2);
|
||||
|
||||
// Glide.with(con).load(path).into(img2);
|
||||
//自动调取提交功能,实现页面自动跳转实现页面自动跳转
|
||||
subimt();
|
||||
} else {
|
||||
Toast.makeText(con, "识别失败", Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(con, "识别失败请重新上传", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
CacheGroup.cacheList.remove(TYPE_NAME_BANK[2]);
|
||||
}
|
||||
@ -1119,8 +1155,18 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
switch (index) {
|
||||
case 0:
|
||||
if (ocb != null && ocbb != null) {
|
||||
if (ocb.getData() == null) {
|
||||
ToastUtils.showToast(con, "主页照片识别失败,请重新上传");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ocbb == null || ocbb.getData() == null) {
|
||||
ToastUtils.showToast(con, "副页照片识别失败,请重新上传");
|
||||
return;
|
||||
}
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
|
||||
IDInputBean ib = new IDInputBean();
|
||||
ib.setIdcarName(str1);
|
||||
ib.setIdcard(str2);
|
||||
@ -1143,8 +1189,20 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
//olb
|
||||
//{"档案编号","初次领证日期","准驾车型","有效期限(止)"},
|
||||
if (odl != null && odlb != null) {
|
||||
|
||||
if (odl.getData() == null) {
|
||||
ToastUtils.showToast(con, "主页照片识别失败,请重新上传");
|
||||
return;
|
||||
}
|
||||
|
||||
if (odlb == null || odlb.getData() == null) {
|
||||
ToastUtils.showToast(con, "副页照片识别失败,请重新上传");
|
||||
return;
|
||||
}
|
||||
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
|
||||
Log.e("ocr", new Gson().toJson(odl));
|
||||
LicenseInputBean iib = new LicenseInputBean();
|
||||
iib.setArchivesName(odlb.getData().getFileNumber());
|
||||
@ -1182,6 +1240,17 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
// Toast.makeText(con, "请完善内容", Toast.LENGTH_SHORT).show();
|
||||
// return;
|
||||
// }
|
||||
if (olb.getData() == null) {
|
||||
ToastUtils.showToast(con, "主页照片识别失败,请重新上传");
|
||||
return;
|
||||
}
|
||||
|
||||
if (oblb == null || oblb.getData() == null) {
|
||||
ToastUtils.showToast(con, "副页照片识别失败,请重新上传");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
HashMap<String, Object> map = new HashMap<>();
|
||||
@ -1194,6 +1263,7 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
// map.put("ownerName", str3);
|
||||
// map.put("vin", str4);//车辆识别代号
|
||||
|
||||
|
||||
String carLong = "";
|
||||
String carWidth = "";
|
||||
String carHeight = "";
|
||||
@ -1288,10 +1358,15 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
break;
|
||||
case 3:
|
||||
if (olb != null || (cdb != null && cdb.getRes() == 1)) {
|
||||
// if (curEnergy==null){
|
||||
// Toast.makeText(con,"请完善内容",Toast.LENGTH_SHORT).show();
|
||||
// return;
|
||||
// }
|
||||
if (olb.getData() == null) {
|
||||
ToastUtils.showToast(con, "主页照片识别失败,请重新上传");
|
||||
return;
|
||||
}
|
||||
|
||||
if (oblb == null || oblb.getData() == null) {
|
||||
ToastUtils.showToast(con, "副页照片识别失败,请重新上传");
|
||||
return;
|
||||
}
|
||||
customDialog = new CustomDialog(con, "网络请求中...");
|
||||
customDialog.show();
|
||||
// Map<String, Object> map = new HashMap<>();
|
||||
@ -1328,7 +1403,6 @@ public class CertificatesActivity extends BaseAppCompatActivity {
|
||||
// map.put("fileNumber", oblb.getData().getRecordId());//档案编号
|
||||
// map.put("towAuality", oblb.getData().getVclDrwTn());//准牵引总质量
|
||||
|
||||
|
||||
String carLong = "";
|
||||
String carWidth = "";
|
||||
String carHeight = "";
|
||||
|
@ -186,11 +186,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
Log.e("is", CacheGroup.cacheList.get("saveCarRegisterNo"));
|
||||
IsAuthDriverAuthQualificationBean ib = gson.fromJson(CacheGroup.cacheList.get("saveCarRegisterNo"), IsAuthDriverAuthQualificationBean.class);
|
||||
if (ib.getCode() == 200) {
|
||||
finish();
|
||||
Intent in = new Intent(con, PhotoCarActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
in.putExtra("carId", carId);
|
||||
con.startActivity(in);
|
||||
finish();
|
||||
} else {
|
||||
Toast.makeText(con, ib.getMsg(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
@ -204,12 +204,11 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
//判断是否需要跳转挂车行驶证页面
|
||||
if (!"".equals(carId) && cdb.getData() != null) {
|
||||
if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && !TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,并且传过挂车直接结束
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
} else if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,没传过挂车,到挂车页面
|
||||
finish();
|
||||
} else if (cdb.getData().getIsTrailer() == 1 && cdb.getData().getTrailerResVo() != null && TextUtils.isEmpty(cdb.getData().getTrailerResVo().getCarNumber())) {//需要挂车,没传过挂车,到挂车页面
|
||||
Intent in = new Intent(con, CertificatesActivity.class);
|
||||
in.putExtra("index", 3);
|
||||
in.putExtra("carId", carId);
|
||||
@ -217,6 +216,7 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
in.putExtra("cheData", new Gson().toJson(cdb));
|
||||
}
|
||||
startActivity(in);
|
||||
finish();
|
||||
} else if (cdb.getData().getIsTrailer() == 0) {//不需要挂车
|
||||
if ("1".equals(cdb.getData().getNeedUpQCPhoto())) {//需要从业资格证
|
||||
Intent in = new Intent(con, AuthQualificationActivity.class);
|
||||
@ -225,10 +225,10 @@ public class PhotoCarActivity extends BaseAppCompatActivity implements View.OnCl
|
||||
in.putExtra("isOverCar", false);
|
||||
startActivity(in);
|
||||
} else {
|
||||
finish();
|
||||
Intent in = new Intent(con, AddCarSuccActivity.class);
|
||||
in.putExtra("type", 3);
|
||||
con.startActivity(in);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -31,6 +31,7 @@ import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.web.WebOnlyOneActivity;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.google.gson.Gson;
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
@ -157,7 +158,7 @@ public class LoginActivity extends BaseActivity {
|
||||
|
||||
ConfigBean cb = ConfigParts.getConfigParts(con);
|
||||
if (cb != null) {
|
||||
url1 = cb.getData().getUserUrl();
|
||||
url1 = "https://agreement.dahehuoyun.com/#/user";
|
||||
url2 = "https://agreement.dahehuoyun.com/currency/#/";
|
||||
}
|
||||
TextView tv_content = findViewById(R.id.tv_content);
|
||||
@ -171,7 +172,7 @@ public class LoginActivity extends BaseActivity {
|
||||
public void onClick(View widget) {
|
||||
Log.e("-用户服务协议-", url1);
|
||||
//用户服务协议点击事件
|
||||
Intent in = new Intent(con, WebActivity.class);
|
||||
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||
in.putExtra("title", "用户服务协议");
|
||||
in.putExtra("url", url1);
|
||||
startActivity(in);
|
||||
@ -191,7 +192,7 @@ public class LoginActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onClick(View widget) {
|
||||
//隐私协议点击事件
|
||||
Intent in = new Intent(con, WebActivity.class);
|
||||
Intent in = new Intent(con, WebOnlyOneActivity.class);
|
||||
in.putExtra("title", "隐私政策");
|
||||
in.putExtra("url", url2);
|
||||
startActivity(in);
|
||||
|
@ -140,8 +140,8 @@ public class WelcomeActivity extends BaseAppCompatActivity {
|
||||
new XPopup.Builder(con)
|
||||
.dismissOnBackPressed(false)
|
||||
.dismissOnTouchOutside(false)
|
||||
.asCustom(new AgreementAlert(con, "http://agreement.dahehuoyun.com/currency/#/",
|
||||
"http://agreement.dahehuoyun.com/rule/serviceAgreement/dist/index.html#/", hd))
|
||||
.asCustom(new AgreementAlert(con, "https://agreement.dahehuoyun.com/currency/#/",
|
||||
"https://agreement.dahehuoyun.com/#/user", hd))
|
||||
.show();
|
||||
}
|
||||
Glide.with(con)
|
||||
|
@ -282,13 +282,24 @@ public class MyFragment extends BaseFragment {
|
||||
if (!"".equals(userBean.getData().getHeadportraitUrl())) {
|
||||
Glide.with(con).load(userBean.getData().getHeadportraitUrl()).into(img_head);
|
||||
}
|
||||
if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
|
||||
auth_box.setVisibility(View.GONE);
|
||||
no_auth.setVisibility(View.GONE);
|
||||
} else {
|
||||
auth_box.setVisibility(View.GONE);
|
||||
no_auth.setVisibility(View.VISIBLE);
|
||||
|
||||
if (userBean!=null){
|
||||
if ("0".equals(userBean.getData().getRealAuthentication())){
|
||||
no_auth.setVisibility(View.VISIBLE);
|
||||
}else{
|
||||
if (100003 != userBean.getData().getAuditStatus()){
|
||||
no_auth.setBackgroundResource(R.mipmap.icon_auth_wsh);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if (userBean != null && 100003 == userBean.getData().getAuditStatus()) {
|
||||
// auth_box.setVisibility(View.GONE);
|
||||
// no_auth.setVisibility(View.GONE);
|
||||
// } else {
|
||||
// auth_box.setVisibility(View.GONE);
|
||||
// no_auth.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,227 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.ui.web;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.net.http.SslError;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.SslErrorHandler;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PaxWebChromeClient;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/8/6 16:48
|
||||
* @description:访问webview的activity
|
||||
*/
|
||||
public class WebOnlyOneActivity extends BaseActivity {
|
||||
|
||||
private String url = "";
|
||||
private String title = "";
|
||||
private WebView wv;
|
||||
private TextView title_tv;
|
||||
private PaxWebChromeClient chromeClient;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
StateStyleUtil.stateTextColor(this);
|
||||
setContentView(R.layout.activity_web);
|
||||
con = this;
|
||||
initHardwareAccelerate();
|
||||
wv = findViewById(R.id.wv);
|
||||
title_tv = findViewById(R.id.title);
|
||||
Intent in = getIntent();
|
||||
url = in.getExtras().getString("url");
|
||||
title = in.getExtras().getString("title");
|
||||
chromeClient = new PaxWebChromeClient(this, null, null);
|
||||
if ("咨询建议".equals(title)) {
|
||||
initOpinion();
|
||||
} else {
|
||||
initView(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void initHardwareAccelerate() {
|
||||
try {
|
||||
if (Integer.parseInt(Build.VERSION.SDK) >= 11) {
|
||||
getWindow()
|
||||
.setFlags(
|
||||
android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
|
||||
android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint({"JavascriptInterface", "SetJavaScriptEnabled"})
|
||||
@Override
|
||||
public void initView(Object obj) {
|
||||
super.initView(obj);
|
||||
WebSettings webSettings = wv.getSettings();
|
||||
//设置网页有缓存的时候也继续读取新的地址
|
||||
webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE);
|
||||
webSettings.setJavaScriptEnabled(true);
|
||||
webSettings.setDomStorageEnabled(true);
|
||||
webSettings.setDefaultTextEncodingName("utf-8");
|
||||
// 特别注意:5.1以上默认禁止了https和http混用,以下方式是开启
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
webSettings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
|
||||
}
|
||||
|
||||
wv.addJavascriptInterface(new JavaScriptObject(con), "webObj");
|
||||
//PaxWebChromeClient chromeClient=new PaxWebChromeClient();
|
||||
//WebView加载web资源
|
||||
//覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为,使网页用WebView打开
|
||||
wv.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
return super.shouldOverrideUrlLoading(view, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url1) {
|
||||
//返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器
|
||||
Log.d("test", "webactivity..url:" + url);
|
||||
// if(!url.startsWith("http"))
|
||||
// {
|
||||
// Log.d("test","非http开头..url:"+url);
|
||||
// Intent intent = new Intent(Intent.ACTION_VIEW,Uri.parse(url));
|
||||
// boolean isInstall = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size()>0;
|
||||
// Log.d("test","是否安装要跳转的app:"+isInstall);
|
||||
// if(isInstall)
|
||||
// {
|
||||
// startActivity(intent);
|
||||
// finish();
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
if (!url1.equals(url))
|
||||
return true;
|
||||
wv.loadUrl(url1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
super.onReceivedSslError(view, handler, error);
|
||||
handler.proceed();
|
||||
}
|
||||
});
|
||||
wv.setWebChromeClient(chromeClient);
|
||||
wv.loadUrl(url);
|
||||
title_tv.setText(title);
|
||||
}
|
||||
|
||||
public void initOpinion() {
|
||||
if (findViewById(R.id.return_btn) != null) {
|
||||
findViewById(R.id.return_btn).setOnClickListener(v -> {
|
||||
finish();
|
||||
});
|
||||
}
|
||||
title_tv.setText(title);
|
||||
UserBean ub = UserParts.getUser(con);
|
||||
wv.getSettings().setJavaScriptEnabled(true);
|
||||
wv.getSettings().setDomStorageEnabled(true); // 这个要加上
|
||||
String openid = ub.getData().getUname(); // 用户的openid
|
||||
String nickname = StringUtil.isNull(ub.getData().getRname(), "游客"); // 用户的nickname
|
||||
String headimgurl = StringUtil.isNull(ub.getData().getHeadportraitUrl(), ""); // 用户的头像url
|
||||
|
||||
/* 获得 webview url,请注意url单词是product而不是products,products是旧版本的参数,用错地址将不能成功提交 */
|
||||
String url = "https://support.qq.com/products/335639"; // 把1221数字换成你的产品ID,否则会不成功
|
||||
/* 准备post参数 */
|
||||
String postData = "nickname=" + nickname + "&avatar=" + headimgurl + "&openid=" + openid;
|
||||
wv.postUrl(url, postData.getBytes());
|
||||
wv.setWebChromeClient(chromeClient);
|
||||
wv.setWebViewClient(new WebViewClient() {
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
return super.shouldOverrideUrlLoading(view, request);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
//返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) {
|
||||
super.onReceivedSslError(view, handler, error);
|
||||
handler.proceed();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
|
||||
chromeClient.onActivityResult(requestCode, resultCode, data);
|
||||
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
||||
public class JavaScriptObject {
|
||||
|
||||
Context mContxt;
|
||||
|
||||
public JavaScriptObject(Context mContxt) {
|
||||
this.mContxt = mContxt;
|
||||
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void getName() {
|
||||
Log.e("eeee-", "name");
|
||||
Toast.makeText(con, "hello", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public String getUserToken() {
|
||||
// Log.e("-token-",UserParts.getUser(con).getData().getToken());
|
||||
// return "woshitoken-androidfasdf";
|
||||
return UserParts.getUser(con).getData().getToken();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void isSuccess() {
|
||||
finish();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void isPdfSuccess() {
|
||||
Toast.makeText(con, "签署成功", Toast.LENGTH_SHORT).show();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -80,7 +80,7 @@
|
||||
android:layout_marginLeft="@dimen/dp_14"
|
||||
android:layout_width="@dimen/dp_143"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:src="@mipmap/icon_auth_new"/>
|
||||
android:background="@mipmap/icon_auth_new"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
BIN
app/src/main/res/mipmap-hdpi/icon_auth_wsh.png
Normal file
BIN
app/src/main/res/mipmap-hdpi/icon_auth_wsh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 49 KiB |
Loading…
Reference in New Issue
Block a user