车队长接口对接
This commit is contained in:
parent
0cef8d1da8
commit
b04c49c22e
@ -3,7 +3,20 @@
|
|||||||
<component name="deploymentTargetDropDown">
|
<component name="deploymentTargetDropDown">
|
||||||
<value>
|
<value>
|
||||||
<entry key="app">
|
<entry key="app">
|
||||||
<State />
|
<State>
|
||||||
|
<targetSelectedWithDropDown>
|
||||||
|
<Target>
|
||||||
|
<type value="QUICK_BOOT_TARGET" />
|
||||||
|
<deviceKey>
|
||||||
|
<Key>
|
||||||
|
<type value="VIRTUAL_DEVICE_PATH" />
|
||||||
|
<value value="C:\Users\用户\.android\avd\Pixel_2_API_30.avd" />
|
||||||
|
</Key>
|
||||||
|
</deviceKey>
|
||||||
|
</Target>
|
||||||
|
</targetSelectedWithDropDown>
|
||||||
|
<timeTargetWasSelectedWithDropDown value="2024-02-29T08:36:21.502896400Z" />
|
||||||
|
</State>
|
||||||
</entry>
|
</entry>
|
||||||
</value>
|
</value>
|
||||||
</component>
|
</component>
|
||||||
|
@ -117,7 +117,6 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.account.CodeLoginActivity"
|
android:name=".ui.account.CodeLoginActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
|
|
||||||
@ -139,44 +138,37 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.account.authperson.AuthDriverActivity"
|
android:name=".ui.account.authperson.AuthDriverActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.account.authperson.AuthQualificationActivity"
|
android:name=".ui.account.authperson.AuthQualificationActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.account.authperson.AuthBankCardActivity"
|
android:name=".ui.account.authperson.AuthBankCardActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.account.authperson.AuthFaceActivity"
|
android:name=".ui.account.authperson.AuthFaceActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.account.authperson.AuthDrivingActivity"
|
android:name=".ui.account.authperson.AuthDrivingActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.account.authperson.AuthRoadActivity"
|
android:name=".ui.account.authperson.AuthRoadActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.account.authteam.AuthTeamActivity"
|
android:name=".ui.account.authteam.AuthTeamActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<!-- 司机车辆认证相关end -->
|
<!-- 司机车辆认证相关end -->
|
||||||
@ -185,7 +177,6 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.waybill.activity.WaybillDetailActivity"
|
android:name=".ui.waybill.activity.WaybillDetailActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
<activity
|
<activity
|
||||||
@ -246,8 +237,6 @@
|
|||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 我的相关end -->
|
<!-- 我的相关end -->
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
package com.dahe.glex.bean
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName TextBean
|
|
||||||
* @Author 用户
|
|
||||||
* @Date 2023/9/21 11:08
|
|
||||||
* @Description TODO
|
|
||||||
*/
|
|
||||||
data class CommListBean(
|
|
||||||
val list: MutableList<OrderBean>,
|
|
||||||
val num: Int,
|
|
||||||
val totalFreight: String
|
|
||||||
)
|
|
@ -7,20 +7,41 @@ package com.dahe.glex.bean
|
|||||||
* @Description TODO
|
* @Description TODO
|
||||||
*/
|
*/
|
||||||
data class OrderBean(
|
data class OrderBean(
|
||||||
var orderId: String,
|
val avatar: String,
|
||||||
var waybillId: String,
|
val distance: String,
|
||||||
var orderNum: String,
|
val driverFreight: Double,
|
||||||
var waybillNum: String,
|
val goodsList: List<Goods>,
|
||||||
var orderTime: String,
|
val loadingArea: String,
|
||||||
var totalFreight: String,
|
val loadingAreaCode: String,
|
||||||
var dispatchType : Int,
|
val loadingCity: String,
|
||||||
var effectiveTime: String,
|
val loadingCityCode: String,
|
||||||
var sendPut: String,
|
val loadingDeadline: String,
|
||||||
var distance: String,
|
val loadingProvince: String,
|
||||||
var loadingAddress: String,
|
val loadingProvinceCode: String,
|
||||||
var receiverAddress: String,
|
val orderId: String,
|
||||||
var waybillStatus: Int,
|
val orderNum: String,
|
||||||
var evaluation: Int,
|
val orderStatus: Int,
|
||||||
var complaint: Int,
|
val orderType: String,
|
||||||
var multipleScore: String,
|
val passingPointsNum: String,
|
||||||
|
val realCompanyName: String,
|
||||||
|
val receiverArea: String,
|
||||||
|
val receiverAreaCode: String,
|
||||||
|
val receiverCity: String,
|
||||||
|
val receiverCityCode: String,
|
||||||
|
val receiverProvince: String,
|
||||||
|
val receiverProvinceCode: String,
|
||||||
|
val requirement: String,
|
||||||
|
val shipperCreditRating: String,
|
||||||
|
val shipperPositiveReviewRate: String,
|
||||||
|
val shipperTransactionVolume: String,
|
||||||
|
val vehicleLength: String,
|
||||||
|
val vehicleType: String
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Goods(
|
||||||
|
val goodCube: String,
|
||||||
|
val goodItemGrossWeight: String,
|
||||||
|
val goodName: String,
|
||||||
|
val goodNum: String,
|
||||||
|
val orderGoodsId: String
|
||||||
)
|
)
|
@ -73,8 +73,17 @@ data class AuthTeamBean(
|
|||||||
var idcardIsEndless: String="",
|
var idcardIsEndless: String="",
|
||||||
var idcardName: String="",
|
var idcardName: String="",
|
||||||
var idcardNo: String="",
|
var idcardNo: String="",
|
||||||
|
var roadLicensePhotoUrl: String="",
|
||||||
|
var roadLicense: String="",
|
||||||
|
var roadLicenseValidity: String="",
|
||||||
|
var businessLicensePhoneUrl: String="",
|
||||||
|
var businessLicenseCreditCode: String="",
|
||||||
|
var businessLicenseEffectiveStart: String="",
|
||||||
|
var businessLicenseEffectiveEnd: String="",
|
||||||
var idcardSex: String=""
|
var idcardSex: String=""
|
||||||
){
|
){
|
||||||
constructor(captainType: String) : this()
|
constructor(captainType: String) : this(){
|
||||||
|
this.captainType = captainType
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
package com.dahe.gldriver.net
|
package com.dahe.gldriver.net
|
||||||
|
|
||||||
import WayBill2
|
|
||||||
import com.dahe.gldriver.BuildConfig
|
import com.dahe.gldriver.BuildConfig
|
||||||
import com.dahe.gldriver.bean.AuthTeamBean
|
import com.dahe.gldriver.bean.AuthTeamBean
|
||||||
import com.dahe.gldriver.bean.OcrPersonBean
|
import com.dahe.gldriver.bean.OcrPersonBean
|
||||||
@ -22,22 +20,13 @@ import retrofit2.http.Query
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Administrator on 2018/8/8 0008.
|
* Created by Administrator on 2024/01/8 0008.
|
||||||
*/
|
*/
|
||||||
interface Api {
|
interface Api {
|
||||||
/*-------------------登录----------------------------*/
|
/*-------------------登录----------------------------*/
|
||||||
@POST(BASE_URL + "common/register")
|
@POST(BASE_URL + "common/register")
|
||||||
fun log(@Body logBean: LogBean?): Observable<CommonResponseBean<UserBean>>
|
fun log(@Body logBean: LogBean?): Observable<CommonResponseBean<UserBean>>
|
||||||
|
|
||||||
//运单列表
|
|
||||||
@POST(BASE_URL + "app/driver/waybill/listV2")
|
|
||||||
fun orderList(@Body bean: RefreshBean?): Observable<CommonResponseBean<CommListBean>>
|
|
||||||
|
|
||||||
//获取正在执行的运单/运单详情
|
|
||||||
@POST(BASE_URL + "app/driver/waybill/getExecuteWaybill")
|
|
||||||
fun getExecuteWaybill(@Body bean: WayBillBean?): Observable<CommonResponseBean<WayBill2>>
|
|
||||||
fun getExecuteWaybill2(@Query("waybillId") waybillId: String?): Observable<CommonResponseBean<UserBean>>
|
|
||||||
|
|
||||||
@GET(BASE_URL + "auth/driver/login")
|
@GET(BASE_URL + "auth/driver/login")
|
||||||
fun login(
|
fun login(
|
||||||
@Query("contactPhone") contactPhone: String,
|
@Query("contactPhone") contactPhone: String,
|
||||||
@ -139,6 +128,13 @@ interface Api {
|
|||||||
fun authenticationCaptain(@Body bankBean: AuthTeamBean): Observable<CommonResponseBean<String>>
|
fun authenticationCaptain(@Body bankBean: AuthTeamBean): Observable<CommonResponseBean<String>>
|
||||||
|
|
||||||
|
|
||||||
|
@GET(BASE_URL + "driver/order/list")
|
||||||
|
fun orderList(): Observable<CommonResponseBean<MutableList<OrderBean>>>
|
||||||
|
|
||||||
|
|
||||||
|
@GET(BASE_URL + "driver/driver/setUpDriverRole")
|
||||||
|
fun setUpDriverRole(@Query("role") role: String): Observable<CommonResponseBean<String>>
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
// String BASE_URL = "https://tmstest.dahehuoyun.com/";
|
// String BASE_URL = "https://tmstest.dahehuoyun.com/";
|
||||||
const val BASE_URL = BuildConfig.BASE_URL
|
const val BASE_URL = BuildConfig.BASE_URL
|
||||||
|
@ -22,7 +22,7 @@ import javax.net.ssl.SSLException
|
|||||||
abstract class RxHttpCallBack<T> {
|
abstract class RxHttpCallBack<T> {
|
||||||
// private var dialog: ProgressDialog? = null
|
// private var dialog: ProgressDialog? = null
|
||||||
private var dialog: LoadingPopupView? = null
|
private var dialog: LoadingPopupView? = null
|
||||||
private fun initDialog(activity: AppCompatActivity, dialogMessage: String) {
|
private fun initDialog(activity: AppCompatActivity?, dialogMessage: String) {
|
||||||
// dialog = ProgressDialog(activity)
|
// dialog = ProgressDialog(activity)
|
||||||
// dialog!!.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
// dialog!!.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||||
// dialog!!.setCanceledOnTouchOutside(false)
|
// dialog!!.setCanceledOnTouchOutside(false)
|
||||||
@ -30,7 +30,7 @@ abstract class RxHttpCallBack<T> {
|
|||||||
// dialog!!.setMessage(dialogMessage)
|
// dialog!!.setMessage(dialogMessage)
|
||||||
|
|
||||||
|
|
||||||
dialog = LoadingUtils.instance.init(activity)
|
dialog = activity?.let { LoadingUtils.instance.init(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(activity: AppCompatActivity, dialogMessage: String?) {
|
constructor(activity: AppCompatActivity, dialogMessage: String?) {
|
||||||
@ -40,7 +40,7 @@ abstract class RxHttpCallBack<T> {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(activity: AppCompatActivity) {
|
constructor(activity: AppCompatActivity?) {
|
||||||
initDialog(activity, "网络请求中......")
|
initDialog(activity, "网络请求中......")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,10 +84,6 @@ public class OssServiceUtil {
|
|||||||
conf.setMaxErrorRetry(2); // 失败后最大重试次数,默认2次
|
conf.setMaxErrorRetry(2); // 失败后最大重试次数,默认2次
|
||||||
|
|
||||||
oss = new OSSClient(App.Companion.getApp(), OssConfigBean.endpoint, credentialProvider, conf);
|
oss = new OSSClient(App.Companion.getApp(), OssConfigBean.endpoint, credentialProvider, conf);
|
||||||
|
|
||||||
|
|
||||||
System.out.println("ffff");
|
|
||||||
// initDialog(activity);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setResultCallBack(picResultCallback callback) {
|
public void setResultCallBack(picResultCallback callback) {
|
||||||
@ -151,6 +147,7 @@ public class OssServiceUtil {
|
|||||||
// if (mProgress != null) {
|
// if (mProgress != null) {
|
||||||
// mProgress.setProgress(progress);
|
// mProgress.setProgress(progress);
|
||||||
// }
|
// }
|
||||||
|
if (activity != null) {
|
||||||
activity.runOnUiThread(() -> {
|
activity.runOnUiThread(() -> {
|
||||||
if (dialog != null && !dialog.isShow()) {
|
if (dialog != null && !dialog.isShow()) {
|
||||||
dialog.show();
|
dialog.show();
|
||||||
@ -158,16 +155,20 @@ public class OssServiceUtil {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
OSSAsyncTask task = oss.asyncPutObject(put, new OSSCompletedCallback<PutObjectRequest, PutObjectResult>() {
|
OSSAsyncTask task = oss.asyncPutObject(put, new OSSCompletedCallback<PutObjectRequest, PutObjectResult>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(PutObjectRequest request, final PutObjectResult result) {
|
public void onSuccess(PutObjectRequest request, final PutObjectResult result) {
|
||||||
|
if (activity != null) {
|
||||||
activity.runOnUiThread(() -> {
|
activity.runOnUiThread(() -> {
|
||||||
if (dialog != null) {
|
if (dialog != null) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
String serverCallbackReturnBody = result.getServerCallbackReturnBody();
|
String serverCallbackReturnBody = result.getServerCallbackReturnBody();
|
||||||
callback.getPicData(result, OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name);
|
callback.getPicData(result, OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name);
|
||||||
@ -175,11 +176,14 @@ public class OssServiceUtil {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onFailure(PutObjectRequest request, ClientException clientExcepion, ServiceException serviceException) {
|
public void onFailure(PutObjectRequest request, ClientException clientExcepion, ServiceException serviceException) {
|
||||||
|
if (activity != null) {
|
||||||
activity.runOnUiThread(() -> {
|
activity.runOnUiThread(() -> {
|
||||||
if (dialog != null) {
|
if (dialog != null) {
|
||||||
dialog.dismiss();
|
dialog.dismiss();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}
|
||||||
String info = "";
|
String info = "";
|
||||||
// 请求异常
|
// 请求异常
|
||||||
if (clientExcepion != null) {
|
if (clientExcepion != null) {
|
||||||
@ -201,7 +205,6 @@ public class OssServiceUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传次数
|
* 上传次数
|
||||||
*/
|
*/
|
||||||
|
@ -18,6 +18,8 @@ import com.dahe.mylibrary.base.BaseActivity
|
|||||||
import com.flyco.tablayout.listener.CustomTabEntity
|
import com.flyco.tablayout.listener.CustomTabEntity
|
||||||
import com.flyco.tablayout.listener.OnTabSelectListener
|
import com.flyco.tablayout.listener.OnTabSelectListener
|
||||||
import com.permissionx.guolindev.PermissionX
|
import com.permissionx.guolindev.PermissionX
|
||||||
|
import java.util.Timer
|
||||||
|
import java.util.TimerTask
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName HomeActivity
|
* @ClassName HomeActivity
|
||||||
@ -86,6 +88,24 @@ class HomeActivity: BaseActivity<ActivityHomeBinding>(), OnTabSelectListener,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private var mBackKeyPressed = false
|
||||||
|
override fun onBackPressed() {
|
||||||
|
if (!mBackKeyPressed) {
|
||||||
|
showToast("再按一次退出程序")
|
||||||
|
mBackKeyPressed = true
|
||||||
|
Timer().schedule(object : TimerTask() {
|
||||||
|
override fun run() {
|
||||||
|
mBackKeyPressed = false
|
||||||
|
}
|
||||||
|
}, 2000)
|
||||||
|
} else {
|
||||||
|
canCelToast()
|
||||||
|
moveTaskToBack(true)
|
||||||
|
// finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override fun onTabSelect(position: Int) {
|
override fun onTabSelect(position: Int) {
|
||||||
binding.homeNoScrollViewPager.setCurrentItem(position)
|
binding.homeNoScrollViewPager.setCurrentItem(position)
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,9 @@ package com.dahe.gldriver.ui.account
|
|||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
import com.dahe.gldriver.databinding.ActivitySelectRoleBinding
|
import com.dahe.gldriver.databinding.ActivitySelectRoleBinding
|
||||||
|
import com.dahe.gldriver.net.BaseObserver
|
||||||
|
import com.dahe.gldriver.net.DataManager
|
||||||
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
import com.dahe.gldriver.ui.account.authperson.AuthBankCardActivity
|
import com.dahe.gldriver.ui.account.authperson.AuthBankCardActivity
|
||||||
import com.dahe.gldriver.ui.account.authperson.AuthDriverActivity
|
import com.dahe.gldriver.ui.account.authperson.AuthDriverActivity
|
||||||
import com.dahe.gldriver.ui.account.authperson.AuthDrivingActivity
|
import com.dahe.gldriver.ui.account.authperson.AuthDrivingActivity
|
||||||
@ -10,7 +13,10 @@ import com.dahe.gldriver.ui.account.authperson.AuthPersonActivity
|
|||||||
import com.dahe.gldriver.ui.account.authperson.AuthQualificationActivity
|
import com.dahe.gldriver.ui.account.authperson.AuthQualificationActivity
|
||||||
import com.dahe.gldriver.ui.account.authteam.AuthTeamActivity
|
import com.dahe.gldriver.ui.account.authteam.AuthTeamActivity
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName AuthRoleActivity
|
* @ClassName AuthRoleActivity
|
||||||
@ -23,10 +29,31 @@ class SelectRoleActivity : BaseActivity<ActivitySelectRoleBinding>() {
|
|||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("选择角色", true)
|
setTitleBar("选择角色", true)
|
||||||
binding.rlPerson.setOnClickListener {
|
binding.rlPerson.setOnClickListener {
|
||||||
ActivityUtils.startActivity(mContext, AuthDriverActivity::class.java)
|
|
||||||
|
|
||||||
|
ActivityUtils.startActivity(mContext, AuthDrivingActivity::class.java)
|
||||||
|
|
||||||
|
// DataManager.getInstance().setUpDriverRole("0")
|
||||||
|
// .subscribeOn(Schedulers.io())
|
||||||
|
// .observeOn(AndroidSchedulers.mainThread())
|
||||||
|
// .subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>(this) {
|
||||||
|
// override fun onSuccess(t: CommonResponseBean<String>) {
|
||||||
|
// super.onSuccess(t)
|
||||||
|
// ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
|
||||||
|
// }
|
||||||
|
// }))
|
||||||
|
|
||||||
// ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
|
// ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
|
||||||
}
|
}
|
||||||
binding.rlCom.setOnClickListener {
|
binding.rlCom.setOnClickListener {
|
||||||
|
DataManager.getInstance().setUpDriverRole("1")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>(this) {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<String>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
}
|
||||||
|
}))
|
||||||
ActivityUtils.startActivity(mContext, AuthTeamActivity::class.java)
|
ActivityUtils.startActivity(mContext, AuthTeamActivity::class.java)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ class AuthBankCardActivity : BaseActivity<ActivityAuthBankcardBinding>() {
|
|||||||
object : RxHttpCallBack<OcrPersonBean>(this) {
|
object : RxHttpCallBack<OcrPersonBean>(this) {
|
||||||
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
t.data.data?.run {
|
t.data?.data?.run {
|
||||||
bankInfo.driverBankcardPhotoUrl = oldPath
|
bankInfo.driverBankcardPhotoUrl = oldPath
|
||||||
|
|
||||||
binding.let {
|
binding.let {
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
package com.dahe.gldriver.ui.account.authperson
|
package com.dahe.gldriver.ui.account.authperson
|
||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
|
||||||
import androidx.core.widget.ContentLoadingProgressBar
|
|
||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
import com.dahe.gldriver.bean.OcrPersonBean
|
import com.dahe.gldriver.bean.OcrPersonBean
|
||||||
import com.dahe.gldriver.bean.UpDriverInfoBean
|
import com.dahe.gldriver.bean.UpDriverInfoBean
|
||||||
import com.dahe.gldriver.bean.UpPersonInfoBean
|
|
||||||
import com.dahe.gldriver.callback.OnOcrPicResultListener
|
|
||||||
import com.dahe.gldriver.databinding.ActivityAuthDriverBinding
|
import com.dahe.gldriver.databinding.ActivityAuthDriverBinding
|
||||||
import com.dahe.gldriver.net.BaseObserver
|
import com.dahe.gldriver.net.BaseObserver
|
||||||
import com.dahe.gldriver.net.DataManager
|
import com.dahe.gldriver.net.DataManager
|
||||||
@ -20,6 +16,8 @@ import com.dahe.mylibrary.net.CommonResponseBean
|
|||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
import com.dahe.mylibrary.utils.ImageLoader
|
import com.dahe.mylibrary.utils.ImageLoader
|
||||||
import com.dahe.mylibrary.utils.PopsUtils
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import com.dahe.mylibrary.utils.TimeUtil
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
@ -47,16 +45,16 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
tvStart.run {
|
tvStart.run {
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthDriverActivity, "有效起始日期") { year, month, day ->
|
.showDate(this@AuthDriverActivity, "有效起始日期") { date ->
|
||||||
this.text = "$year-$month-$day"
|
this.text = date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tvEnd.run {
|
tvEnd.run {
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthDriverActivity, "有效结束日期") { year, month, day ->
|
.showDate(this@AuthDriverActivity, "有效结束日期") { date ->
|
||||||
this.text = "$year-$month-$day"
|
this.text = date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,6 +87,13 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
licenseEffectiveStart = tvStart.text.toString()
|
licenseEffectiveStart = tvStart.text.toString()
|
||||||
licenseEffectiveEnd = tvEnd.text.toString()
|
licenseEffectiveEnd = tvEnd.text.toString()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
if (driverInfoBean.licenseNo.isNullOrBlank() || driverInfoBean.licensePhotoBackUrl.isNullOrBlank()) {
|
||||||
|
ToastUtils.showToast(mContext, "请完善信息")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
DataManager.getInstance().setUpDriverLicense(driverInfoBean)
|
DataManager.getInstance().setUpDriverLicense(driverInfoBean)
|
||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
@ -102,13 +107,15 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun selFrontPic() {
|
private fun selFrontPic() {
|
||||||
OcrUtils.getInstance().ocrDriver(mContext, this@AuthDriverActivity) { picPath, result ->
|
|
||||||
|
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||||
result.data.face?.data.let {
|
result.data.face?.data.let {
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, picPath, 12, binding.ivFront)
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivFront)
|
||||||
driverInfoBean.licensePhotoFaceUrl = picPath.picPath
|
driverInfoBean.licensePhotoFaceUrl = picPath.picPath
|
||||||
it?.run {
|
it?.run {
|
||||||
driverInfoBean.run {
|
driverInfoBean.run {
|
||||||
@ -131,93 +138,18 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// PopsUtils.getInstance().showSimSelPic(mContext) {
|
|
||||||
// var data = it[0]
|
|
||||||
// ossServiceUtil.asyncPutImage(data.realPath, this@AuthDriverActivity)
|
|
||||||
// ossServiceUtil.setResultCallBack { data, oldPath ->
|
|
||||||
// DataManager.getInstance().recognizeDrivingLicense(oldPath)
|
|
||||||
// .subscribeOn(Schedulers.io())
|
|
||||||
// .observeOn(AndroidSchedulers.mainThread())
|
|
||||||
// .subscribe(
|
|
||||||
// BaseObserver(mContext,
|
|
||||||
// object : RxHttpCallBack<OcrPersonBean>() {
|
|
||||||
// override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
|
||||||
// super.onSuccess(t)
|
|
||||||
// t.data.data.face?.data.let {
|
|
||||||
// driverInfoBean.licensePhotoFaceUrl = oldPath
|
|
||||||
// it?.run {
|
|
||||||
// driverInfoBean.run {
|
|
||||||
// licenseApproveOrganization =
|
|
||||||
// issueAuthority //发证机关
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// binding.run {
|
|
||||||
// etName.setText(it.name)
|
|
||||||
// etId.setText(it.licenseNumber)
|
|
||||||
// tvCarType.text = it.approvedType
|
|
||||||
// if (validPeriod.contains("至")) {
|
|
||||||
// val split = validPeriod.split("至")
|
|
||||||
// tvStart.text = split[0]
|
|
||||||
// tvEnd.text =
|
|
||||||
// if (split.size == 2) split[1] else ""
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// )
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// ImageLoader.getInstance().loadRoundImage(mContext, data.realPath, 12, binding.ivFront)
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun selBackPic() {
|
private fun selBackPic() {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
|
||||||
var data = it[0]
|
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||||
ossServiceUtil.asyncPutImage(data.realPath, this@AuthDriverActivity)
|
result.data.back?.data.let {
|
||||||
ossServiceUtil.setResultCallBack { data, oldPath ->
|
ImageLoader.getInstance()
|
||||||
run {
|
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
|
||||||
DataManager.getInstance().recognizeDrivingLicense(oldPath)
|
driverInfoBean.licensePhotoBackUrl = picPath.picPath
|
||||||
.subscribeOn(Schedulers.io())
|
ToastUtils.showToast(mContext, "驾驶证副页上传成功")
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(
|
|
||||||
BaseObserver(mContext,
|
|
||||||
object : RxHttpCallBack<OcrPersonBean>() {
|
|
||||||
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
|
||||||
super.onSuccess(t)
|
|
||||||
t.data.data.back?.data.let {
|
|
||||||
driverInfoBean.licensePhotoBackUrl = oldPath
|
|
||||||
// it?.run {
|
|
||||||
// driverInfoBean.run {
|
|
||||||
// licenseApproveOrganization =
|
|
||||||
// issueAuthority //发证机关
|
|
||||||
// }
|
|
||||||
// binding.run {
|
|
||||||
// etName.setText(it.name)
|
|
||||||
// etId.setText(it.licenseNumber)
|
|
||||||
// tvCarType.text = it.approvedType
|
|
||||||
// if (validPeriod.contains("至")) {
|
|
||||||
// val split = validPeriod.split("至")
|
|
||||||
// tvStart.text = split[0]
|
|
||||||
// tvEnd.text =
|
|
||||||
// if (split.size == 2) split[1] else ""
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, data.realPath, 12, binding.ivBack)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,6 +10,7 @@ import com.dahe.gldriver.net.BaseObserver
|
|||||||
import com.dahe.gldriver.net.DataManager
|
import com.dahe.gldriver.net.DataManager
|
||||||
import com.dahe.gldriver.net.RxHttpCallBack
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
import com.dahe.gldriver.oss.OssServiceUtil
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
|
import com.dahe.gldriver.utils.OcrUtils
|
||||||
import com.dahe.glex.bean.UserBean
|
import com.dahe.glex.bean.UserBean
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
@ -17,6 +18,7 @@ import com.dahe.mylibrary.utils.ActivityUtils
|
|||||||
import com.dahe.mylibrary.utils.ImageLoader
|
import com.dahe.mylibrary.utils.ImageLoader
|
||||||
import com.dahe.mylibrary.utils.PickerUtils
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
import com.dahe.mylibrary.utils.PopsUtils
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import com.dahe.mylibrary.utils.TimeUtil
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.rxjava3.functions.Function
|
import io.reactivex.rxjava3.functions.Function
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
@ -47,10 +49,10 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
|||||||
btnOk.setOnClickListener {
|
btnOk.setOnClickListener {
|
||||||
|
|
||||||
perInfoBean.run {
|
perInfoBean.run {
|
||||||
idcardNo = inBinding.etId.toString()
|
idcardNo = inBinding.etId.text.toString()
|
||||||
idcardName = inBinding.etName.toString()
|
idcardName = inBinding.etName.text.toString()
|
||||||
idcardEffectiveStart = inBinding.tvStart.toString()
|
idcardEffectiveStart = inBinding.tvStart.text.toString()
|
||||||
idcardEffectiveEnd = inBinding.tvEnd.toString()
|
idcardEffectiveEnd = inBinding.tvEnd.text.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
DataManager.getInstance().setUpDriverIdCard(perInfoBean)
|
DataManager.getInstance().setUpDriverIdCard(perInfoBean)
|
||||||
@ -58,7 +60,6 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
|||||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<String>(){
|
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<String>(){
|
||||||
override fun onSuccess(t: CommonResponseBean<String>) {
|
override fun onSuccess(t: CommonResponseBean<String>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
println("lijiaaaaa")
|
|
||||||
ActivityUtils.startActivity(mContext, AuthDriverActivity::class.java)
|
ActivityUtils.startActivity(mContext, AuthDriverActivity::class.java)
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
@ -68,59 +69,30 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
|||||||
tvStart.run {
|
tvStart.run {
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthPersonActivity, "有效起始日期") { year, month, day ->
|
.showDate(this@AuthPersonActivity, "有效起始日期") { date ->
|
||||||
this.text = "$year-$month-$day"
|
this.text = date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tvEnd.run {
|
tvEnd.run {
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthPersonActivity, "有效结束日期") { year, month, day ->
|
.showDate(this@AuthPersonActivity, "有效结束日期") { date ->
|
||||||
this.text = "$year-$month-$day"
|
this.text = date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ivFront.setOnClickListener {
|
ivFront.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
OcrUtils.getInstance().ocrPerson(mContext,this@AuthPersonActivity){picPath,result->
|
||||||
var data = it[0]
|
ImageLoader.getInstance().loadRoundImage(mContext, picPath.locPic, 12, ivFront)
|
||||||
|
perInfoBean.idcardFrontUrl = picPath.picPath
|
||||||
val path: String
|
result.data.face?.data.let {
|
||||||
if (data.isCut && !data.isCompressed) {
|
|
||||||
// 裁剪过
|
|
||||||
path = data.cutPath
|
|
||||||
} else if (data.isCompressed || (data.isCut && data.isCompressed)) {
|
|
||||||
// 压缩过,或者裁剪同时压缩过,以最终压缩过图片为准
|
|
||||||
path = data.compressPath
|
|
||||||
} else {
|
|
||||||
// 原图
|
|
||||||
path = data.path
|
|
||||||
}
|
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, data.realPath, 12, ivFront)
|
|
||||||
|
|
||||||
val file = File(data.realPath)
|
|
||||||
val filePic: MultipartBody.Part = MultipartBody.Part.createFormData(
|
|
||||||
"file",
|
|
||||||
file.getName(),
|
|
||||||
file.asRequestBody("multipart/form-data".toMediaTypeOrNull())
|
|
||||||
)
|
|
||||||
|
|
||||||
DataManager.getInstance().uploadToOss(filePic).flatMap {
|
|
||||||
perInfoBean.idcardFrontUrl = it.data.url
|
|
||||||
DataManager.getInstance().recognizeIdcard(it.data.url)
|
|
||||||
}.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(
|
|
||||||
BaseObserver(
|
|
||||||
mContext,
|
|
||||||
object : RxHttpCallBack<OcrPersonBean>(this@AuthPersonActivity) {
|
|
||||||
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
|
||||||
super.onSuccess(t)
|
|
||||||
t.data.data.face?.data.let {
|
|
||||||
it?.run {
|
it?.run {
|
||||||
perInfoBean.run {
|
perInfoBean.run {
|
||||||
idcardNo = idNumber
|
idcardNo = idNumber
|
||||||
idcardName = name
|
idcardName = name
|
||||||
|
idcardEthnicity = ethnicity
|
||||||
idcardSex = if (sex == "男") "0" else "1"
|
idcardSex = if (sex == "男") "0" else "1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,18 +102,6 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
// ossServiceUtil.asyncPutImage(path, null)
|
|
||||||
// ossServiceUtil.setResultCallBack { data, oldPath ->
|
|
||||||
// {
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ivBack.setOnClickListener {
|
ivBack.setOnClickListener {
|
||||||
@ -183,9 +143,9 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
|||||||
if (it.data.validPeriod?.contains("-") == true) {
|
if (it.data.validPeriod?.contains("-") == true) {
|
||||||
val split = it.data.validPeriod.split("-")
|
val split = it.data.validPeriod.split("-")
|
||||||
binding.run {
|
binding.run {
|
||||||
tvStart.text = split[0]
|
tvStart.text = TimeUtil.changeDateFormat(split[0])
|
||||||
tvEnd.text =
|
tvEnd.text =
|
||||||
if (split.size == 2) split[1] else ""
|
if (split.size == 2) TimeUtil.changeDateFormat(split[1]) else ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,11 +38,11 @@ class AuthQualificationActivity : BaseActivity<ActivityAuthQualificationBinding>
|
|||||||
tvDate.run {
|
tvDate.run {
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(
|
.showDateSim(
|
||||||
this@AuthQualificationActivity,
|
this@AuthQualificationActivity,
|
||||||
"选择有效期至"
|
"选择有效期至"
|
||||||
) { year, month, day ->
|
) { date ->
|
||||||
this.text = "$year-$month-$day"
|
this.text = date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -53,7 +53,11 @@ class AuthQualificationActivity : BaseActivity<ActivityAuthQualificationBinding>
|
|||||||
ossServiceUtil.asyncPutImage(data.realPath, this@AuthQualificationActivity)
|
ossServiceUtil.asyncPutImage(data.realPath, this@AuthQualificationActivity)
|
||||||
ossServiceUtil.setResultCallBack { data, oldPath ->
|
ossServiceUtil.setResultCallBack { data, oldPath ->
|
||||||
upQuaInfo.qualificationCertificatePhotoUrl = oldPath
|
upQuaInfo.qualificationCertificatePhotoUrl = oldPath
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
runOnUiThread {
|
||||||
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, it[0].realPath, 12, ivFront)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class AuthRoadActivity : BaseActivity<ActivityAuthRoadBinding>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tvDate.setOnClickListener {
|
tvDate.setOnClickListener {
|
||||||
PickerUtils.getInstance().showDate(this@AuthRoadActivity){ year, month, day ->
|
PickerUtils.getInstance().showDate(this@AuthRoadActivity){ date ->
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ import com.dahe.mylibrary.utils.LoadingUtils
|
|||||||
import com.dahe.mylibrary.utils.LoadingUtils3
|
import com.dahe.mylibrary.utils.LoadingUtils3
|
||||||
import com.dahe.mylibrary.utils.PickerUtils
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
import com.dahe.mylibrary.utils.PopsUtils
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import com.dahe.mylibrary.utils.TimeUtil
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
@ -34,7 +35,9 @@ import java.io.File
|
|||||||
* @Description 个人车队认证
|
* @Description 个人车队认证
|
||||||
*/
|
*/
|
||||||
class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickListener {
|
class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickListener {
|
||||||
private var checkTeamType = 0 //1代表运输公司,0代表个人车队
|
private var checkTeamType = 1 //1代表运输公司,0代表个人车队
|
||||||
|
|
||||||
|
var fff : MutableList<String> = mutableListOf("sdfsdf","asdfasdf")
|
||||||
|
|
||||||
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
|
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
|
||||||
|
|
||||||
@ -52,6 +55,13 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
|
|||||||
ivBusiness.setOnClickListener {
|
ivBusiness.setOnClickListener {
|
||||||
OcrUtils.getInstance()
|
OcrUtils.getInstance()
|
||||||
.ocrBusinessCard(mContext, this@AuthTeamActivity) { picPath, result ->
|
.ocrBusinessCard(mContext, this@AuthTeamActivity) { picPath, result ->
|
||||||
|
upComInfoBean.businessLicensePhoneUrl = picPath.picPath
|
||||||
|
|
||||||
|
result.data?.run {
|
||||||
|
upComInfoBean.businessLicenseCreditCode = creditCode
|
||||||
|
upComInfoBean.businessLicenseEffectiveStart= TimeUtil.changeDateNoneFormat(validFromDate)
|
||||||
|
upComInfoBean.businessLicenseEffectiveEnd=TimeUtil.changeDateNoneFormat(validToDate)
|
||||||
|
}
|
||||||
ImageLoader.getInstance()
|
ImageLoader.getInstance()
|
||||||
.loadRoundImage(mContext, picPath.locPic, 12, ivBusiness)
|
.loadRoundImage(mContext, picPath.locPic, 12, ivBusiness)
|
||||||
}
|
}
|
||||||
@ -86,13 +96,12 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
|
|||||||
result.data.back?.data?.run {
|
result.data.back?.data?.run {
|
||||||
if (validPeriod.contains("-")) {
|
if (validPeriod.contains("-")) {
|
||||||
val split = validPeriod.split("-")
|
val split = validPeriod.split("-")
|
||||||
tvStart.text = split[0]
|
tvStart.text = TimeUtil.changeDateFormat(split[0])
|
||||||
tvEnd.text = if (split.size == 2) split[1] else ""
|
tvEnd.text = if (split.size == 2) TimeUtil.changeDateFormat(split[1]) else ""
|
||||||
upComInfoBean.run {
|
upComInfoBean.run {
|
||||||
idcardEffectiveStart = split[0]
|
// idcardEffectiveStart = TimeUtil.changeDateFormat(split[0])
|
||||||
idcardEffectiveEnd = if (split.size == 2) split[1] else ""
|
// idcardEffectiveEnd = if (split.size == 2) TimeUtil.changeDateFormat(split[1]) else ""
|
||||||
idcardBackUrl = picPath.picPath
|
idcardBackUrl = picPath.picPath
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,14 +138,13 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
|
|||||||
result.data.back?.data?.run {
|
result.data.back?.data?.run {
|
||||||
if (validPeriod.contains("-")) {
|
if (validPeriod.contains("-")) {
|
||||||
val split = validPeriod.split("-")
|
val split = validPeriod.split("-")
|
||||||
tvPerStart.text = split[0]
|
tvPerStart.text = TimeUtil.changeDateFormat(split[0])
|
||||||
tvPerEnd.text = if (split.size == 2) split[1] else ""
|
tvPerEnd.text = if (split.size == 2) TimeUtil.changeDateFormat(split[1]) else ""
|
||||||
|
|
||||||
upPerInfoBean.run {
|
upPerInfoBean.run {
|
||||||
idcardEffectiveStart = split[0]
|
idcardEffectiveStart = tvPerStart.text.toString()
|
||||||
idcardEffectiveEnd = if (split.size == 2) split[1] else ""
|
idcardEffectiveEnd = tvPerEnd.text.toString()
|
||||||
idcardBackUrl = picPath.picPath
|
idcardBackUrl = picPath.picPath
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -164,7 +172,8 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
|
|||||||
//道路运输许可证
|
//道路运输许可证
|
||||||
ivRoad.setOnClickListener {
|
ivRoad.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivRoad)
|
// upComInfoBean.roadLicensePhotoUrl = it[0].realPath
|
||||||
|
ImageLoader.getInstance().loadRoundImage(mContext, it[0].realPath, 12, ivRoad)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,15 +198,15 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
|
|||||||
|
|
||||||
tvComDate.setOnClickListener {
|
tvComDate.setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthTeamActivity, "请选择有效期至") { year, month, day ->
|
.showDate(this@AuthTeamActivity, "请选择有效期至") { date->
|
||||||
tvComDate.text = "$year-$month-$day"
|
tvComDate.text = date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tvPerStart.setOnClickListener {
|
tvPerStart.setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthTeamActivity, "请选择有效期至") { year, month, day ->
|
.showDate(this@AuthTeamActivity, "请选择有效期至") { date ->
|
||||||
tvPerStart.text = "$year-$month-$day"
|
tvPerStart.text = date
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,18 +8,26 @@ import com.chad.library.adapter4.BaseQuickAdapter
|
|||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
import com.dahe.gldriver.adapter.GridItemAdapter
|
import com.dahe.gldriver.adapter.GridItemAdapter
|
||||||
import com.dahe.gldriver.adapter.WaybillAdapter
|
import com.dahe.gldriver.adapter.WaybillAdapter
|
||||||
|
import com.dahe.gldriver.bean.AuthTeamBean
|
||||||
import com.dahe.gldriver.bean.GridBean
|
import com.dahe.gldriver.bean.GridBean
|
||||||
import com.dahe.gldriver.databinding.FragmentHomeBinding
|
import com.dahe.gldriver.databinding.FragmentHomeBinding
|
||||||
|
import com.dahe.gldriver.net.BaseObserver
|
||||||
|
import com.dahe.gldriver.net.DataManager
|
||||||
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
import com.dahe.gldriver.ui.HomeActivity
|
import com.dahe.gldriver.ui.HomeActivity
|
||||||
import com.dahe.gldriver.ui.waybill.activity.WaybillDetailActivity
|
import com.dahe.gldriver.ui.waybill.activity.WaybillDetailActivity
|
||||||
|
import com.dahe.glex.bean.OrderBean
|
||||||
import com.dahe.glex.bean.WayBillBean
|
import com.dahe.glex.bean.WayBillBean
|
||||||
import com.dahe.mylibrary.base.BaseFragment
|
import com.dahe.mylibrary.base.BaseFragment
|
||||||
import com.dahe.mylibrary.callback.RefreshCallBack
|
import com.dahe.mylibrary.callback.RefreshCallBack
|
||||||
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
|
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
import com.dahe.mylibrary.utils.ConvertUtils
|
import com.dahe.mylibrary.utils.ConvertUtils
|
||||||
import com.dahe.mylibrary.utils.ToastUtils
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
import com.flyco.tablayout.listener.OnTabSelectListener
|
import com.flyco.tablayout.listener.OnTabSelectListener
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
import okhttp3.internal.wait
|
import okhttp3.internal.wait
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,6 +61,14 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
|
|||||||
|
|
||||||
binding.tvMar.isSelected = true
|
binding.tvMar.isSelected = true
|
||||||
|
|
||||||
|
DataManager.getInstance().orderList()
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<MutableList<OrderBean>>(){
|
||||||
|
override fun onSuccess(t: CommonResponseBean<MutableList<OrderBean>>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,8 +11,9 @@ import com.dahe.gldriver.net.RxHttpCallBack
|
|||||||
import com.dahe.gldriver.oss.OssServiceUtil
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
import com.dahe.mylibrary.base.SingletonNoPHolder
|
import com.dahe.mylibrary.base.SingletonNoPHolder
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
import com.dahe.mylibrary.utils.PickerUtils
|
import com.dahe.mylibrary.utils.LoadingUtils
|
||||||
import com.dahe.mylibrary.utils.PopsUtils
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
@ -32,21 +33,38 @@ class OcrUtils private constructor() {
|
|||||||
* */
|
* */
|
||||||
fun ocrPerson(context: Context, activity: AppCompatActivity, listener: OnOcrPicResultListener) {
|
fun ocrPerson(context: Context, activity: AppCompatActivity, listener: OnOcrPicResultListener) {
|
||||||
PopsUtils.getInstance().showSimSelPic(context) { result ->
|
PopsUtils.getInstance().showSimSelPic(context) { result ->
|
||||||
|
LoadingUtils.instance.showLoading(activity)
|
||||||
//上传oss得到图片地址
|
//上传oss得到图片地址
|
||||||
OssServiceUtil.getInstance().run {
|
OssServiceUtil.getInstance().run {
|
||||||
asyncPutImage(result[0].realPath, activity)
|
asyncPutImage(result[0].realPath, null)
|
||||||
setResultCallBack { data, oldPath ->
|
setResultCallBack { data, oldPath ->
|
||||||
DataManager.getInstance().recognizeIdcard(oldPath)
|
DataManager.getInstance().recognizeIdcard(oldPath)
|
||||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(BaseObserver(context, object : RxHttpCallBack<OcrPersonBean>(activity) {
|
.subscribe(BaseObserver(context, object : RxHttpCallBack<OcrPersonBean>() {
|
||||||
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
|
LoadingUtils.instance.dissLoading()
|
||||||
t.data?.let {
|
t.data?.let {
|
||||||
listener.onSuccResult(
|
listener.onSuccResult(
|
||||||
PicPath(result[0].realPath, oldPath), it
|
PicPath(result[0].realPath, oldPath), it
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onCodeError(
|
||||||
|
mContext: Context?,
|
||||||
|
t: CommonResponseBean<OcrPersonBean>
|
||||||
|
) {
|
||||||
|
// super.onCodeError(mContext, t)
|
||||||
|
LoadingUtils.instance.dissLoading()
|
||||||
|
if (t.code == 500) {
|
||||||
|
if (t.msg.contains("code: 400, The image type does not match the API operation")) {
|
||||||
|
ToastUtils.showToast(mContext, "图片识别失败,请重新上传")
|
||||||
|
} else {
|
||||||
|
ToastUtils.showToast(mContext, t.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -58,19 +76,46 @@ class OcrUtils private constructor() {
|
|||||||
* */
|
* */
|
||||||
fun ocrDriver(context: Context, activity: AppCompatActivity, listener: OnOcrPicResultListener) {
|
fun ocrDriver(context: Context, activity: AppCompatActivity, listener: OnOcrPicResultListener) {
|
||||||
PopsUtils.getInstance().showSimSelPic(context) { result ->
|
PopsUtils.getInstance().showSimSelPic(context) { result ->
|
||||||
|
LoadingUtils.instance.showLoading(activity)
|
||||||
//上传oss得到图片地址
|
//上传oss得到图片地址
|
||||||
OssServiceUtil.getInstance().run {
|
OssServiceUtil.getInstance().run {
|
||||||
asyncPutImage(result[0].realPath, activity)
|
asyncPutImage(result[0].realPath, null)
|
||||||
setResultCallBack { data, oldPath ->
|
setResultCallBack { data, oldPath ->
|
||||||
DataManager.getInstance().recognizeDrivingLicense(oldPath)
|
DataManager.getInstance().recognizeDrivingLicense(oldPath)
|
||||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
.subscribe(
|
.subscribe(
|
||||||
BaseObserver(
|
BaseObserver(
|
||||||
context,
|
context,
|
||||||
object : RxHttpCallBack<OcrPersonBean>(activity) {
|
object : RxHttpCallBack<OcrPersonBean>() {
|
||||||
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
t.data?.let { listener.onSuccResult(PicPath(result[0].realPath, oldPath), it) }
|
LoadingUtils.instance.dissLoading()
|
||||||
|
t.data?.let {
|
||||||
|
listener.onSuccResult(
|
||||||
|
PicPath(
|
||||||
|
result[0].realPath,
|
||||||
|
oldPath
|
||||||
|
), it
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCodeError(
|
||||||
|
mContext: Context?,
|
||||||
|
t: CommonResponseBean<OcrPersonBean>
|
||||||
|
) {
|
||||||
|
// super.onCodeError(mContext, t)
|
||||||
|
LoadingUtils.instance.dissLoading()
|
||||||
|
if (t.code == 500) {
|
||||||
|
if (t.msg.contains("code: 400, The image type does not match the API operation")) {
|
||||||
|
ToastUtils.showToast(
|
||||||
|
mContext,
|
||||||
|
"图片识别失败,请重新上传"
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
ToastUtils.showToast(mContext, t.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@ -101,7 +146,32 @@ class OcrUtils private constructor() {
|
|||||||
object : RxHttpCallBack<OcrPersonBean>(activity) {
|
object : RxHttpCallBack<OcrPersonBean>(activity) {
|
||||||
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
t.data?.let { listener.onSuccResult(PicPath(result[0].realPath, oldPath), it) }
|
t.data?.let {
|
||||||
|
listener.onSuccResult(
|
||||||
|
PicPath(
|
||||||
|
result[0].realPath,
|
||||||
|
oldPath
|
||||||
|
), it
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCodeError(
|
||||||
|
mContext: Context?,
|
||||||
|
t: CommonResponseBean<OcrPersonBean>
|
||||||
|
) {
|
||||||
|
// super.onCodeError(mContext, t)
|
||||||
|
LoadingUtils.instance.dissLoading()
|
||||||
|
if (t.code == 500) {
|
||||||
|
if (t.msg.contains("code: 400, The image type does not match the API operation")) {
|
||||||
|
ToastUtils.showToast(
|
||||||
|
mContext,
|
||||||
|
"图片识别失败,请重新上传"
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
ToastUtils.showToast(mContext, t.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@ -132,7 +202,32 @@ class OcrUtils private constructor() {
|
|||||||
object : RxHttpCallBack<OcrPersonBean>(activity) {
|
object : RxHttpCallBack<OcrPersonBean>(activity) {
|
||||||
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
t.data?.let { listener.onSuccResult(PicPath(result[0].realPath, oldPath), it) }
|
t.data?.let {
|
||||||
|
listener.onSuccResult(
|
||||||
|
PicPath(
|
||||||
|
result[0].realPath,
|
||||||
|
oldPath
|
||||||
|
), it
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onCodeError(
|
||||||
|
mContext: Context?,
|
||||||
|
t: CommonResponseBean<OcrPersonBean>
|
||||||
|
) {
|
||||||
|
// super.onCodeError(mContext, t)
|
||||||
|
LoadingUtils.instance.dissLoading()
|
||||||
|
if (t.code == 500) {
|
||||||
|
if (t.msg.contains("code: 400, The image type does not match the API operation")) {
|
||||||
|
ToastUtils.showToast(
|
||||||
|
mContext,
|
||||||
|
"图片识别失败,请重新上传"
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
ToastUtils.showToast(mContext, t.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.dahe.mylibrary.callback
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OnMyDatePickedListener
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/3/1 10:26
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
fun interface OnMyDatePickedListener {
|
||||||
|
fun onDatePicked(date: String)
|
||||||
|
}
|
@ -11,9 +11,9 @@ public class CommonResponseBean<T> implements Serializable {
|
|||||||
private int code;
|
private int code;
|
||||||
private String info;
|
private String info;
|
||||||
private String msg;
|
private String msg;
|
||||||
private String url;
|
|
||||||
private int res;
|
private int res;
|
||||||
private String fileName;
|
private int total;
|
||||||
|
|
||||||
private boolean success;
|
private boolean success;
|
||||||
|
|
||||||
public int getRes() {
|
public int getRes() {
|
||||||
@ -64,19 +64,12 @@ public class CommonResponseBean<T> implements Serializable {
|
|||||||
this.success = success;
|
this.success = success;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUrl() {
|
|
||||||
return url;
|
public int getTotal() {
|
||||||
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUrl(String url) {
|
public void setTotal(int total) {
|
||||||
this.url = url;
|
this.total = total;
|
||||||
}
|
|
||||||
|
|
||||||
public String getFileName() {
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFileName(String fileName) {
|
|
||||||
this.fileName = fileName;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,14 +49,14 @@ public class JsonInterceptor implements Interceptor {
|
|||||||
JSONObject jsonObject = new JSONObject(responseBodyStr);
|
JSONObject jsonObject = new JSONObject(responseBodyStr);
|
||||||
String str = jsonObject.optString("data");
|
String str = jsonObject.optString("data");
|
||||||
int code = jsonObject.optInt("code");
|
int code = jsonObject.optInt("code");
|
||||||
if (-1 == code) {
|
// if (-1 == code) {
|
||||||
jsonObject.put("data", new JSONObject());
|
// jsonObject.put("data", new JSONObject());
|
||||||
throw new ResultException();
|
// throw new ResultException();
|
||||||
} else {
|
// } else {
|
||||||
if (TextUtils.isEmpty(str)) {
|
// if (TextUtils.isEmpty(str)) {
|
||||||
jsonObject.put("data", new JSONObject());
|
// jsonObject.put("data", new JSONObject());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
String data = jsonObject.toString();
|
String data = jsonObject.toString();
|
||||||
responseBody = ResponseBody.create(MediaType.parse("application/json; charset=utf-8"), data);
|
responseBody = ResponseBody.create(MediaType.parse("application/json; charset=utf-8"), data);
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.dahe.mylibrary.utils
|
package com.dahe.mylibrary.utils
|
||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import com.dahe.mylibrary.R
|
||||||
import com.lxj.xpopup.XPopup
|
import com.lxj.xpopup.XPopup
|
||||||
import com.lxj.xpopup.impl.LoadingPopupView
|
import com.lxj.xpopup.impl.LoadingPopupView
|
||||||
|
|
||||||
@ -28,7 +29,7 @@ class LoadingUtils private constructor() {
|
|||||||
loadingPopup = XPopup.Builder(activity)
|
loadingPopup = XPopup.Builder(activity)
|
||||||
.dismissOnBackPressed(false)
|
.dismissOnBackPressed(false)
|
||||||
.isLightNavigationBar(true)
|
.isLightNavigationBar(true)
|
||||||
.asLoading(message, LoadingPopupView.Style.ProgressBar)
|
.asLoading(message, LoadingPopupView.Style.Spinner)
|
||||||
|
|
||||||
return loadingPopup
|
return loadingPopup
|
||||||
}
|
}
|
||||||
@ -38,7 +39,8 @@ class LoadingUtils private constructor() {
|
|||||||
loadingPopup = XPopup.Builder(activity)
|
loadingPopup = XPopup.Builder(activity)
|
||||||
.dismissOnBackPressed(true)
|
.dismissOnBackPressed(true)
|
||||||
.isLightNavigationBar(true)
|
.isLightNavigationBar(true)
|
||||||
.asLoading(message, LoadingPopupView.Style.ProgressBar)
|
// .asLoading(message, R.layout.custom_loading_popup,LoadingPopupView.Style.Spinner)
|
||||||
|
.asLoading(message, LoadingPopupView.Style.Spinner)
|
||||||
.show() as LoadingPopupView
|
.show() as LoadingPopupView
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,8 +2,11 @@ package com.dahe.mylibrary.utils
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatActivity
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
import com.dahe.mylibrary.base.SingletonNoPHolder
|
import com.dahe.mylibrary.base.SingletonNoPHolder
|
||||||
|
import com.dahe.mylibrary.callback.OnMyDatePickedListener
|
||||||
import com.github.gzuliyujiang.wheelpicker.BirthdayPicker
|
import com.github.gzuliyujiang.wheelpicker.BirthdayPicker
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.DatePicker
|
||||||
import com.github.gzuliyujiang.wheelpicker.OptionPicker
|
import com.github.gzuliyujiang.wheelpicker.OptionPicker
|
||||||
|
import com.github.gzuliyujiang.wheelpicker.annotation.DateMode
|
||||||
import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener
|
import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener
|
||||||
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener
|
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener
|
||||||
import com.github.gzuliyujiang.wheelpicker.entity.DateEntity
|
import com.github.gzuliyujiang.wheelpicker.entity.DateEntity
|
||||||
@ -30,17 +33,46 @@ class PickerUtils private constructor() {
|
|||||||
activity: AppCompatActivity,
|
activity: AppCompatActivity,
|
||||||
title: String = "",
|
title: String = "",
|
||||||
dateEntity: DateEntity = DateEntity.today(),
|
dateEntity: DateEntity = DateEntity.today(),
|
||||||
listener: OnDatePickedListener
|
listener: OnMyDatePickedListener
|
||||||
) {
|
) {
|
||||||
val picker = BirthdayPicker(activity)
|
val picker = BirthdayPicker(activity)
|
||||||
picker.setTitle(title)
|
picker.setTitle(title)
|
||||||
|
picker.setDefaultValue(1991, 11, 11)
|
||||||
picker.setDefaultValue(dateEntity.year, dateEntity.month, dateEntity.day)
|
picker.setDefaultValue(dateEntity.year, dateEntity.month, dateEntity.day)
|
||||||
picker.setOnDatePickedListener(listener)
|
picker.setOnDatePickedListener { year, month, day ->
|
||||||
|
if (listener != null)
|
||||||
|
listener.onDatePicked("$year-${if (month <= 9) "0${month}" else month}-${if (day <= 9) "0${day}" else day}")
|
||||||
|
}
|
||||||
picker.wheelLayout.setResetWhenLinkage(false)
|
picker.wheelLayout.setResetWhenLinkage(false)
|
||||||
picker.show()
|
picker.show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO
|
||||||
|
* 底部弹出日期选择
|
||||||
|
* @param activity
|
||||||
|
* @param title 日期选择title
|
||||||
|
* @param listener
|
||||||
|
*/
|
||||||
|
fun showDateSim(
|
||||||
|
activity: AppCompatActivity,
|
||||||
|
title: String = "",
|
||||||
|
listener: OnMyDatePickedListener
|
||||||
|
) {
|
||||||
|
val picker = DatePicker(activity)
|
||||||
|
picker.setTitle(title)
|
||||||
|
val wheelLayout = picker.wheelLayout
|
||||||
|
wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY)
|
||||||
|
wheelLayout.setDateLabel("年", "月", "日")
|
||||||
|
picker.setOnDatePickedListener { year, month, day ->
|
||||||
|
listener.onDatePicked("$year-${if (month <= 9) "0${month}" else month}-${if (day <= 9) "0${day}" else day}")
|
||||||
|
|
||||||
|
}
|
||||||
|
picker.show()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择驾驶证类型
|
* 选择驾驶证类型
|
||||||
* @param activity
|
* @param activity
|
||||||
|
@ -177,6 +177,9 @@ public final class TimeUtil {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
private static final DateFormat DEFAULT_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
private static final DateFormat DEFAULT_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault());
|
||||||
|
private static final DateFormat DEFAULT_FORMAT_DATE = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
|
||||||
|
private static final DateFormat DEFAULT_FORMAT_DATE_POINT = new SimpleDateFormat("yyyy.MM.dd", Locale.getDefault());
|
||||||
|
private static final DateFormat DEFAULT_FORMAT_DATE_NONE = new SimpleDateFormat("yyyyMMdd", Locale.getDefault());
|
||||||
private static final DateFormat DEFAULT_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZSS:SS", Locale.getDefault());
|
private static final DateFormat DEFAULT_FORMAT2 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZSS:SS", Locale.getDefault());
|
||||||
private static final DateFormat DEFAULT_FORMAT3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault());
|
private static final DateFormat DEFAULT_FORMAT3 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ", Locale.getDefault());
|
||||||
|
|
||||||
@ -638,6 +641,24 @@ public final class TimeUtil {
|
|||||||
return getFitTimeSpan(getNowString(format), time, format, precision);
|
return getFitTimeSpan(getNowString(format), time, format, precision);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String changeDateFormat(String date) {
|
||||||
|
long l = string2Millis(date,DEFAULT_FORMAT_DATE_POINT);
|
||||||
|
if (l != -1) {
|
||||||
|
return millis2String(l, DEFAULT_FORMAT_DATE);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static String changeDateNoneFormat(String date) {
|
||||||
|
long l = string2Millis(date,DEFAULT_FORMAT_DATE_NONE);
|
||||||
|
if (l != -1) {
|
||||||
|
return millis2String(l, DEFAULT_FORMAT_DATE);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取合适型与当前时间的差
|
* 获取合适型与当前时间的差
|
||||||
*
|
*
|
||||||
|
16
mylibrary/src/main/res/layout/custom_loading_popup.xml
Normal file
16
mylibrary/src/main/res/layout/custom_loading_popup.xml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:padding="40dp"
|
||||||
|
android:background="#EED3CFCF"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ProgressBar
|
||||||
|
android:indeterminate="false"
|
||||||
|
android:indeterminateTintMode="src_atop"
|
||||||
|
android:indeterminateTint="#FFFFFF"
|
||||||
|
android:layout_width="35dp"
|
||||||
|
android:layout_height="35dp"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<color name="colorPrimary">#28B950</color>
|
<color name="colorPrimary">#FFFFFF</color>
|
||||||
<color name="colorPrimaryDark">#28B950</color>
|
<color name="colorPrimaryDark">#FFFFFF</color>
|
||||||
<color name="colorAccent">#D81B60</color>
|
<color name="colorAccent">#D81B60</color>
|
||||||
|
|
||||||
<color name="colorWhite">#FFFFFFFF</color>
|
<color name="colorWhite">#FFFFFFFF</color>
|
||||||
|
Loading…
Reference in New Issue
Block a user