Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
4ac0511f08 | |||
1d9e8baed8 |
@ -0,0 +1,41 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName ToH5Bean
|
||||
* @Author john
|
||||
* @Date 2024/9/9 10:01
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ToH5Bean implements Serializable {
|
||||
|
||||
private int id;
|
||||
private String carNumber;
|
||||
private String carId;
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getCarNumber() {
|
||||
return carNumber;
|
||||
}
|
||||
|
||||
public void setCarNumber(String carNumber) {
|
||||
this.carNumber = carNumber;
|
||||
}
|
||||
|
||||
public String getCarId() {
|
||||
return carId;
|
||||
}
|
||||
|
||||
public void setCarId(String carId) {
|
||||
this.carId = carId;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.event;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
* @version 1.0.0
|
||||
* @date 2021/10/20 14:43
|
||||
* @description:
|
||||
*/
|
||||
public class PdfResEvent {
|
||||
|
||||
private String message;
|
||||
|
||||
public PdfResEvent(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
}
|
@ -72,6 +72,15 @@ public class HuoYuanRequset{
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getAgreeOrder(),MapUtil.mapJson(map)),getToken(con),con);
|
||||
RequestUtil.start(1, HuoYunDelActivity.END,re,con,hd);
|
||||
}
|
||||
|
||||
public void confirm(String cid,String contractUrl,int wid){
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
map.put("carId",cid);
|
||||
map.put("orderId",wid);
|
||||
map.put("contractUrl",contractUrl);
|
||||
Request re = OkHttpUtil.posts(new OkDate(RequestConstant.getAgreeOrder(),MapUtil.mapJson(map)),getToken(con),con);
|
||||
RequestUtil.start(1, HuoYunDelActivity.END,re,con,hd);
|
||||
}
|
||||
//获取执行中的运单
|
||||
public void startOrder(int id){
|
||||
Map<String,Object> map=new HashMap<>();
|
||||
|
@ -552,15 +552,10 @@ public class HomeFragment extends BaseFragment {
|
||||
startActivity(in4);
|
||||
break;
|
||||
case 3:
|
||||
// Intent in5 = new Intent(con, WebActivity.class);
|
||||
// in5.putExtra("url", "https://ks.wjx.top/vm/h6Jqu8A.aspx");
|
||||
// in5.putExtra("title", "知识竞猜");
|
||||
// startActivity(in5);
|
||||
|
||||
Intent in = new Intent(getContext(), WebActivity.class);
|
||||
in.putExtra("url", "http://192.168.1.152:8080");
|
||||
in.putExtra("title", "隐私政策");
|
||||
getContext().startActivity(in);
|
||||
Intent in5 = new Intent(con, WebActivity.class);
|
||||
in5.putExtra("url", "https://ks.wjx.top/vm/h6Jqu8A.aspx");
|
||||
in5.putExtra("title", "知识竞猜");
|
||||
startActivity(in5);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -29,8 +29,10 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.arpa.hndahesudintocctmsdriver.H5Activity;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.JTT;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.ToH5Bean;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.FaceEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.HomeEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PdfResEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.ConfigParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.report.ALProcess;
|
||||
@ -154,8 +156,20 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
.asConfirm("请确认接单", "是否确定承运此运单?",
|
||||
"取消", "确认",
|
||||
() -> {
|
||||
ToH5Bean toH5Bean = new ToH5Bean();
|
||||
toH5Bean.setId(id);
|
||||
toH5Bean.setCarNumber(car.getText().toString().substring("选择车辆:".length()));
|
||||
toH5Bean.setCarId(cid);
|
||||
Log.e("--id--", "cid:" + cid + "---wid:" + id);
|
||||
hyr.confirm(cid, id);
|
||||
Intent in = new Intent(con, WebActivity.class);
|
||||
in.putExtra("url", "https://platform.test.dahehuoyun.com/contract/dist/#/contracttemplate");
|
||||
in.putExtra("id", id);
|
||||
in.putExtra("ToH5Bean",toH5Bean);
|
||||
in.putExtra("title", "合同签署");
|
||||
// startActivity(in);
|
||||
|
||||
startActivityForResult(in,1);
|
||||
|
||||
}, () -> customDialog.dismiss(), false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局
|
||||
.show();
|
||||
break;
|
||||
@ -436,6 +450,22 @@ public class HuoYunDelActivity extends BaseAppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if (resultCode == RESULT_OK&&requestCode==1){
|
||||
//签合同后接单
|
||||
// String pdfUrl = data.getStringExtra("pdfUrl");
|
||||
// hyr.confirm(cid,pdfUrl, id);
|
||||
|
||||
UiAuxiliary.homeRequest("接单");
|
||||
Intent in = new Intent(con, StartYunDanActivity.class);
|
||||
in.putExtra("id", "0");
|
||||
startActivity(in);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 接单
|
||||
* 先判断安联用户信息验证,随后接单
|
||||
|
@ -15,18 +15,26 @@ import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebSettings;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.WebViewClient;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.R;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.ToH5Bean;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.UserBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PdfResEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.parts.UserParts;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.PaxWebChromeClient;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.string.StringUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.statusbar.StateStyleUtil;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.view.BaseActivity;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author hlh
|
||||
@ -38,9 +46,12 @@ public class WebActivity extends BaseActivity {
|
||||
|
||||
private String url = "";
|
||||
private String title = "";
|
||||
private int id = -1;
|
||||
private WebView wv;
|
||||
private TextView title_tv;
|
||||
private ProgressBar progressBar;
|
||||
private PaxWebChromeClient chromeClient;
|
||||
private ToH5Bean toH5Bean;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
@ -50,11 +61,15 @@ public class WebActivity extends BaseActivity {
|
||||
con=this;
|
||||
initHardwareAccelerate();
|
||||
wv = findViewById(R.id.wv);
|
||||
progressBar = findViewById(R.id.progressBar);
|
||||
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);
|
||||
toH5Bean = (ToH5Bean)in.getSerializableExtra("ToH5Bean");
|
||||
String carNumber = toH5Bean.getCarNumber();
|
||||
id = in.getExtras().getInt("id");
|
||||
chromeClient = new PaxWebChromeClient(this,progressBar,null);
|
||||
if ("咨询建议".equals(title)) {
|
||||
initOpinion();
|
||||
} else {
|
||||
@ -208,13 +223,32 @@ public class WebActivity extends BaseActivity {
|
||||
return UserParts.getUser(con).getData().getToken();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public int getOrderId(){
|
||||
return id;
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public String getOrderinfo(){
|
||||
return new Gson().toJson(toH5Bean);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void isSuccess(){
|
||||
finish();
|
||||
}
|
||||
@JavascriptInterface
|
||||
public void isPdfSuccess(){
|
||||
Toast.makeText(con, "签署成功", Toast.LENGTH_SHORT).show();
|
||||
public void isPdfSuccess(String pdfUrl){
|
||||
// Toast.makeText(con, "签署成功", Toast.LENGTH_SHORT).show();
|
||||
// EventBus.getDefault().post(new PdfResEvent(pdfUrl));
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("pdfUrl",pdfUrl);
|
||||
setResult(RESULT_OK,intent);
|
||||
finish();
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void isFail(){
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.view.View;
|
||||
import android.webkit.PermissionRequest;
|
||||
import android.webkit.ValueCallback;
|
||||
import android.webkit.WebChromeClient;
|
||||
@ -38,12 +39,12 @@ public class PaxWebChromeClient extends WebChromeClient {
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
if (newProgress == 100) {
|
||||
//bar.setVisibility(View.INVISIBLE);
|
||||
bar.setVisibility(View.INVISIBLE);
|
||||
} else {
|
||||
// if (View.INVISIBLE == bar.getVisibility()) {
|
||||
// bar.setVisibility(View.VISIBLE);
|
||||
// }
|
||||
// bar.setProgress(newProgress);
|
||||
if (View.INVISIBLE == bar.getVisibility()) {
|
||||
bar.setVisibility(View.VISIBLE);
|
||||
}
|
||||
bar.setProgress(newProgress);
|
||||
}
|
||||
super.onProgressChanged(view, newProgress);
|
||||
}
|
||||
|
@ -3,11 +3,24 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<WebView
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_marginTop="@dimen/dp_88"
|
||||
android:id="@+id/wv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
android:layout_height="match_parent">
|
||||
<WebView
|
||||
android:id="@+id/wv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
<ProgressBar
|
||||
android:id="@+id/progressBar"
|
||||
style="?android:attr/progressBarStyleHorizontal"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="5dp"
|
||||
android:visibility="invisible"
|
||||
android:layout_alignParentTop="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
Loading…
Reference in New Issue
Block a user