用户注册以及loading优化
This commit is contained in:
parent
b69416d1a4
commit
0cef8d1da8
@ -84,7 +84,7 @@ android {
|
|||||||
//暂时填写默认值即可.
|
//暂时填写默认值即可.
|
||||||
JPUSH_CHANNEL: "developer-n"]
|
JPUSH_CHANNEL: "developer-n"]
|
||||||
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
buildConfigField("String", "OPEN_AL_URL", "\"https://oapi-staging.alct56.com\"")
|
||||||
buildConfigField("String", "BASE_URL", "\"http://app.test.dahehuoyun.com/api/\"")
|
buildConfigField("String", "BASE_URL", "\"http://platform.test.v2.dahehuoyun.com/devApi/\"")
|
||||||
buildConfigField "boolean", "isTest", "true"
|
buildConfigField "boolean", "isTest", "true"
|
||||||
//APP名称,可以在androidMainfest中引用
|
//APP名称,可以在androidMainfest中引用
|
||||||
resValue "string", "appName", "审核测试"
|
resValue "string", "appName", "审核测试"
|
||||||
|
@ -81,7 +81,6 @@
|
|||||||
android:name=".ui.LauncherActivity"
|
android:name=".ui.LauncherActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:theme="@style/Theme.Splash"
|
android:theme="@style/Theme.Splash"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden">
|
android:windowSoftInputMode="adjustPan|stateHidden">
|
||||||
@ -102,7 +101,6 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.HomeActivity"
|
android:name=".ui.HomeActivity"
|
||||||
android:configChanges="keyboardHidden|orientation|locale"
|
android:configChanges="keyboardHidden|orientation|locale"
|
||||||
android:exported="true"
|
|
||||||
android:launchMode="singleTask"
|
android:launchMode="singleTask"
|
||||||
android:screenOrientation="portrait"
|
android:screenOrientation="portrait"
|
||||||
android:windowSoftInputMode="adjustPan|stateHidden">
|
android:windowSoftInputMode="adjustPan|stateHidden">
|
||||||
|
@ -6,6 +6,7 @@ import com.dahe.gldriver.BuildConfig
|
|||||||
import com.dahe.gldriver.base.App
|
import com.dahe.gldriver.base.App
|
||||||
import com.dahe.mylibrary.CommonBaseLibrary
|
import com.dahe.mylibrary.CommonBaseLibrary
|
||||||
import com.dahe.gldriver.net.Api
|
import com.dahe.gldriver.net.Api
|
||||||
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
import com.github.gzuliyujiang.dialog.DialogConfig
|
import com.github.gzuliyujiang.dialog.DialogConfig
|
||||||
import com.github.gzuliyujiang.dialog.DialogStyle
|
import com.github.gzuliyujiang.dialog.DialogStyle
|
||||||
import java.lang.Exception
|
import java.lang.Exception
|
||||||
@ -32,7 +33,7 @@ class App : Application() {
|
|||||||
|
|
||||||
// SophixManager.getInstance().queryAndLoadNewPatch();
|
// SophixManager.getInstance().queryAndLoadNewPatch();
|
||||||
|
|
||||||
// OssServiceUtil.getInstance().init();
|
OssServiceUtil.getInstance().init();
|
||||||
|
|
||||||
// PendingIntent pendingIntent =
|
// PendingIntent pendingIntent =
|
||||||
// PendingIntent.getActivity(this, 0, new Intent(this, HomeActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
|
// PendingIntent.getActivity(this, 0, new Intent(this, HomeActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||||
|
@ -10,7 +10,7 @@ object AppConfig {
|
|||||||
const val BUGLY_APP_ID = "a5b894cef7"
|
const val BUGLY_APP_ID = "a5b894cef7"
|
||||||
const val TIME = "DA_HE_TIME"
|
const val TIME = "DA_HE_TIME"
|
||||||
const val ID = "DA_HE_ID"
|
const val ID = "DA_HE_ID"
|
||||||
const val PWD = "DA_HE_PHONE"
|
const val PHONE = "DA_HE_PHONE"
|
||||||
const val CODE = "DA_HE_PHONE"
|
const val CODE = "DA_HE_PHONE"
|
||||||
const val SUCCESS_TYPE = "DA_HE_SUCCESS_TYPE"
|
const val SUCCESS_TYPE = "DA_HE_SUCCESS_TYPE"
|
||||||
|
|
||||||
|
120
app/src/main/java/com/dahe/gldriver/bean/OcrBean.kt
Normal file
120
app/src/main/java/com/dahe/gldriver/bean/OcrBean.kt
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
package com.dahe.gldriver.bean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OcrBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/27 09:58
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
data class OcrPersonBean(
|
||||||
|
val algo_version: String,
|
||||||
|
val `data`: Data,
|
||||||
|
val height: Int,
|
||||||
|
val orgHeight: Int,
|
||||||
|
val orgWidth: Int,
|
||||||
|
val width: Int
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Data(
|
||||||
|
val face: Face,
|
||||||
|
val back: Back,
|
||||||
|
|
||||||
|
//银行卡
|
||||||
|
val bankName: String,
|
||||||
|
val cardNumber: String,
|
||||||
|
|
||||||
|
//营业执照
|
||||||
|
val creditCode: String,//信用代码
|
||||||
|
val companyName: String,//名称
|
||||||
|
val companyType: String,//类型
|
||||||
|
val businessAddress: String,
|
||||||
|
val legalPerson: String,
|
||||||
|
val businessScope: String,
|
||||||
|
val registeredCapital: String,//注册资本
|
||||||
|
val RegistrationDate: String,//成立日期2014年01月07日
|
||||||
|
val validFromDate: String,//20140107
|
||||||
|
val validToDate: String,
|
||||||
|
val issueDate: String
|
||||||
|
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
data class Back(
|
||||||
|
val `data`: DataX
|
||||||
|
)
|
||||||
|
|
||||||
|
data class Face(
|
||||||
|
val algo_version: String,
|
||||||
|
val angle: Int,
|
||||||
|
val `data`: DataX,
|
||||||
|
val ftype: Int,
|
||||||
|
val height: Int,
|
||||||
|
val orgHeight: Int,
|
||||||
|
val orgWidth: Int,
|
||||||
|
val prism_keyValueInfo: List<PrismKeyValueInfo>,
|
||||||
|
val sliceRect: SliceRect,
|
||||||
|
val width: Int,
|
||||||
|
|
||||||
|
|
||||||
|
)
|
||||||
|
|
||||||
|
data class DataX(
|
||||||
|
val address: String = "",
|
||||||
|
val birthDate: String = "",
|
||||||
|
val ethnicity: String = "",
|
||||||
|
val idNumber: String = "",
|
||||||
|
val name: String = "",
|
||||||
|
val sex: String = "",
|
||||||
|
val issueAuthority: String = "",//哈尔滨市公安局呼兰分局
|
||||||
|
val validPeriod: String = "",//2012.07.17-2032.07.17
|
||||||
|
|
||||||
|
//驾驶证
|
||||||
|
val licenseNumber: String = "",
|
||||||
|
val nationality: String = "",
|
||||||
|
val initialIssueDate: String = "",
|
||||||
|
val approvedType: String = "",
|
||||||
|
val validFromDate: String = "",
|
||||||
|
|
||||||
|
//行驶证
|
||||||
|
val issueDate: String = "",
|
||||||
|
val model: String = "",
|
||||||
|
val owner: String = "",
|
||||||
|
val licensePlateNumber: String = "",
|
||||||
|
val registrationDate: String = "",
|
||||||
|
val useNature: String = "",
|
||||||
|
val vehicleType: String = "",
|
||||||
|
val vinCode: String = "",
|
||||||
|
val recordNumber: String = "",//档案编号
|
||||||
|
val passengerCapacity: String = "",
|
||||||
|
val curbWeight: String = "",//整备质量
|
||||||
|
val totalWeight: String = "",//总质量
|
||||||
|
val permittedWeight: String = "",//核定载质量
|
||||||
|
val tractionWeight: String = "",//准牵引总质量
|
||||||
|
val overallDimension: String = "",//6915×2550×3960mm
|
||||||
|
val energySign: String = "",//能源类型
|
||||||
|
)
|
||||||
|
|
||||||
|
data class PrismKeyValueInfo(
|
||||||
|
val key: String,
|
||||||
|
val keyProb: Int,
|
||||||
|
val value: String,
|
||||||
|
val valuePos: List<ValuePo>,
|
||||||
|
val valueProb: Int
|
||||||
|
)
|
||||||
|
|
||||||
|
data class SliceRect(
|
||||||
|
val x0: Int,
|
||||||
|
val x1: Int,
|
||||||
|
val x2: Int,
|
||||||
|
val x3: Int,
|
||||||
|
val y0: Int,
|
||||||
|
val y1: Int,
|
||||||
|
val y2: Int,
|
||||||
|
val y3: Int
|
||||||
|
)
|
||||||
|
|
||||||
|
data class ValuePo(
|
||||||
|
val x: Int,
|
||||||
|
val y: Int
|
||||||
|
)
|
9
app/src/main/java/com/dahe/gldriver/bean/OssBean.kt
Normal file
9
app/src/main/java/com/dahe/gldriver/bean/OssBean.kt
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package com.dahe.gldriver.bean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OssBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/27 09:13
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
data class OssBean(var name: String, var url: String)
|
80
app/src/main/java/com/dahe/gldriver/bean/UpInfoBean.kt
Normal file
80
app/src/main/java/com/dahe/gldriver/bean/UpInfoBean.kt
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
package com.dahe.gldriver.bean
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName UpDriverInfoBean
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/27 11:09
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
data class UpPersonInfoBean(
|
||||||
|
var idcardNo: String = "",
|
||||||
|
var idcardName: String = "",
|
||||||
|
var idcardSex: String = "",
|
||||||
|
var idcardEthnicity: String = "",
|
||||||
|
var idcardEffectiveStart: String = "",
|
||||||
|
var idcardEffectiveEnd: String = "",
|
||||||
|
var idcardIsEndless: String = "",
|
||||||
|
var idcardFrontUrl: String = "",
|
||||||
|
var idcardBackUrl: String = "",
|
||||||
|
var idcardAddress: String = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传驾驶证
|
||||||
|
* */
|
||||||
|
data class UpDriverInfoBean(
|
||||||
|
var licenseNo: String = "",
|
||||||
|
var licenseType: String = "",
|
||||||
|
var licenseName: String = "",
|
||||||
|
var licenseRecordNumber: String = "",
|
||||||
|
var licenseEffectiveStart: String = "",
|
||||||
|
var licenseEffectiveEnd: String = "",
|
||||||
|
var licensePhotoFaceUrl: String = "",
|
||||||
|
var licensePhotoBackUrl: String = "",
|
||||||
|
var licenseFirstGetDate: String = "",
|
||||||
|
var licenseApproveOrganization: String = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传从业资格
|
||||||
|
* */
|
||||||
|
data class UpQualiInfoBean(
|
||||||
|
var qualificationCertificateNo: String = "",
|
||||||
|
var qualificationCertificateEffectiveEnd: String = "",
|
||||||
|
var qualificationCertificatePhotoUrl: String = "",
|
||||||
|
var qualificationCertificateExamineDate: String = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传银行卡
|
||||||
|
* */
|
||||||
|
data class UpBankInfoBean(
|
||||||
|
var driverBankcardNumber: String = "",
|
||||||
|
var driverBankcardPhotoUrl: String = "",
|
||||||
|
var driverBankcardAddress: String = ""
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 认证车队长bean
|
||||||
|
* */
|
||||||
|
data class AuthTeamBean(
|
||||||
|
var captainBankcardAddress: String="",
|
||||||
|
var captainBankcardNumber: String="",
|
||||||
|
var captainBankcardPhotoUrl: String="",
|
||||||
|
var captainType: String="",//类型(0=个人,1=企业)
|
||||||
|
var idcardAddress: String="",
|
||||||
|
var idcardBackUrl: String="",
|
||||||
|
var idcardEffectiveEnd: String="",
|
||||||
|
var idcardEffectiveStart: String="",
|
||||||
|
var idcardEthnicity: String="",
|
||||||
|
var idcardFrontUrl: String="",
|
||||||
|
var idcardIsEndless: String="",
|
||||||
|
var idcardName: String="",
|
||||||
|
var idcardNo: String="",
|
||||||
|
var idcardSex: String=""
|
||||||
|
){
|
||||||
|
constructor(captainType: String) : this()
|
||||||
|
}
|
||||||
|
|
@ -7,7 +7,7 @@ package com.dahe.glex.bean
|
|||||||
* @Description TODO
|
* @Description TODO
|
||||||
*/
|
*/
|
||||||
data class UserBean(
|
data class UserBean(
|
||||||
var token :String,
|
var access_token :String,
|
||||||
var id :String,
|
var id :String,
|
||||||
var roleId :String,
|
var roleId :String,
|
||||||
var uname :String,
|
var uname :String,
|
||||||
@ -23,5 +23,6 @@ data class UserBean(
|
|||||||
var qualificationValidity :String,
|
var qualificationValidity :String,
|
||||||
var isCar :String,
|
var isCar :String,
|
||||||
var qrcodeUrl :String,
|
var qrcodeUrl :String,
|
||||||
|
var expires_in :Int,
|
||||||
var credit :String
|
var credit :String
|
||||||
)
|
)
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
package com.dahe.gldriver.callback
|
||||||
|
|
||||||
|
import com.dahe.gldriver.bean.OcrPersonBean
|
||||||
|
import com.luck.picture.lib.entity.LocalMedia
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OnOcrPicResultListener
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/28 17:18
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
fun interface OnOcrPicResultListener {
|
||||||
|
fun onSuccResult(picPath: PicPath, result: OcrPersonBean)
|
||||||
|
}
|
||||||
|
|
||||||
|
data class PicPath(
|
||||||
|
var locPic: String, var picPath: String
|
||||||
|
)
|
@ -2,11 +2,22 @@ package com.dahe.gldriver.net
|
|||||||
|
|
||||||
import WayBill2
|
import WayBill2
|
||||||
import com.dahe.gldriver.BuildConfig
|
import com.dahe.gldriver.BuildConfig
|
||||||
|
import com.dahe.gldriver.bean.AuthTeamBean
|
||||||
|
import com.dahe.gldriver.bean.OcrPersonBean
|
||||||
|
import com.dahe.gldriver.bean.OssBean
|
||||||
|
import com.dahe.gldriver.bean.UpBankInfoBean
|
||||||
|
import com.dahe.gldriver.bean.UpDriverInfoBean
|
||||||
|
import com.dahe.gldriver.bean.UpPersonInfoBean
|
||||||
|
import com.dahe.gldriver.bean.UpQualiInfoBean
|
||||||
import com.dahe.glex.bean.*
|
import com.dahe.glex.bean.*
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
import io.reactivex.rxjava3.core.Observable
|
import io.reactivex.rxjava3.core.Observable
|
||||||
|
import okhttp3.MultipartBody
|
||||||
import retrofit2.http.Body
|
import retrofit2.http.Body
|
||||||
|
import retrofit2.http.GET
|
||||||
|
import retrofit2.http.Multipart
|
||||||
import retrofit2.http.POST
|
import retrofit2.http.POST
|
||||||
|
import retrofit2.http.Part
|
||||||
import retrofit2.http.Query
|
import retrofit2.http.Query
|
||||||
|
|
||||||
|
|
||||||
@ -27,6 +38,107 @@ interface Api {
|
|||||||
fun getExecuteWaybill(@Body bean: WayBillBean?): Observable<CommonResponseBean<WayBill2>>
|
fun getExecuteWaybill(@Body bean: WayBillBean?): Observable<CommonResponseBean<WayBill2>>
|
||||||
fun getExecuteWaybill2(@Query("waybillId") waybillId: String?): Observable<CommonResponseBean<UserBean>>
|
fun getExecuteWaybill2(@Query("waybillId") waybillId: String?): Observable<CommonResponseBean<UserBean>>
|
||||||
|
|
||||||
|
@GET(BASE_URL + "auth/driver/login")
|
||||||
|
fun login(
|
||||||
|
@Query("contactPhone") contactPhone: String,
|
||||||
|
@Query("code") code: String
|
||||||
|
): Observable<CommonResponseBean<UserBean>>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取验证码
|
||||||
|
* */
|
||||||
|
@GET(BASE_URL + "auth/driver/code")
|
||||||
|
fun getCode(@Query("contactPhone") contactPhone: String): Observable<CommonResponseBean<UserBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传到oss
|
||||||
|
* */
|
||||||
|
@Multipart
|
||||||
|
@POST(BASE_URL + "file/uploadToOss")
|
||||||
|
fun uploadToOss(
|
||||||
|
@Part file: MultipartBody.Part
|
||||||
|
): Observable<CommonResponseBean<OssBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人身份证识别
|
||||||
|
* */
|
||||||
|
@GET(BASE_URL + "ocr/aliyunOcr/recognizeIdcard")
|
||||||
|
fun recognizeIdcard(
|
||||||
|
@Query("imgUrl") imgUrl: String
|
||||||
|
): Observable<CommonResponseBean<OcrPersonBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驾驶证识别
|
||||||
|
* */
|
||||||
|
@GET(BASE_URL + "ocr/aliyunOcr/recognizeDrivingLicense")
|
||||||
|
fun recognizeDrivingLicense(
|
||||||
|
@Query("imgUrl") imgUrl: String
|
||||||
|
): Observable<CommonResponseBean<OcrPersonBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡识别
|
||||||
|
* */
|
||||||
|
@GET(BASE_URL + "ocr/aliyunOcr/recognizeBankCard")
|
||||||
|
fun recognizeBankCard(
|
||||||
|
@Query("imgUrl") imgUrl: String
|
||||||
|
): Observable<CommonResponseBean<OcrPersonBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 行驶证识别
|
||||||
|
* */
|
||||||
|
@GET(BASE_URL + "ocr/aliyunOcr/recognizeVehicleLicense")
|
||||||
|
fun recognizeVehicleLicense(
|
||||||
|
@Query("imgUrl") imgUrl: String
|
||||||
|
): Observable<CommonResponseBean<OcrPersonBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照识别
|
||||||
|
* */
|
||||||
|
@GET(BASE_URL + "ocr/aliyunOcr/recognizeBusinessLicense")
|
||||||
|
fun recognizeBusinessLicense(
|
||||||
|
@Query("imgUrl") imgUrl: String
|
||||||
|
): Observable<CommonResponseBean<OcrPersonBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息
|
||||||
|
* */
|
||||||
|
@GET(BASE_URL + "driver/driver/getUserInfo")
|
||||||
|
fun getUserInfo(): Observable<CommonResponseBean<UserBean>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机上传身份证
|
||||||
|
* */
|
||||||
|
@POST(BASE_URL + "driver/driver/setUpDriverIdCard")
|
||||||
|
fun setUpDriverIdCard(@Body carBean: UpPersonInfoBean): Observable<CommonResponseBean<String>>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机上传驾驶证
|
||||||
|
* */
|
||||||
|
@POST(BASE_URL + "driver/driver/setUpDriverLicense")
|
||||||
|
fun setUpDriverLicense(@Body driverBean: UpDriverInfoBean): Observable<CommonResponseBean<String>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机上传从业资格证
|
||||||
|
* */
|
||||||
|
@POST(BASE_URL + "driver/driver/setUpDriverQualificationCertificate")
|
||||||
|
fun setUpDriverQualificationCertificate(@Body qualiBean: UpQualiInfoBean): Observable<CommonResponseBean<String>>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机上传银行卡
|
||||||
|
* */
|
||||||
|
@POST(BASE_URL + "driver/driver/setUpDriverBankCard")
|
||||||
|
fun setUpDriverBankCard(@Body bankBean: UpBankInfoBean): Observable<CommonResponseBean<String>>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机认证成为车队长
|
||||||
|
* */
|
||||||
|
@POST(BASE_URL + "driver/driver/authenticationCaptain")
|
||||||
|
fun authenticationCaptain(@Body bankBean: AuthTeamBean): 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
|
||||||
|
@ -3,6 +3,9 @@ package com.dahe.gldriver.net
|
|||||||
import com.dahe.mylibrary.CommonBaseLibrary
|
import com.dahe.mylibrary.CommonBaseLibrary
|
||||||
import com.dahe.mylibrary.base.BaseSingNoParam
|
import com.dahe.mylibrary.base.BaseSingNoParam
|
||||||
import com.dahe.mylibrary.net.JsonInterceptor
|
import com.dahe.mylibrary.net.JsonInterceptor
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.core.ObservableTransformer
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
|
|
||||||
@ -23,11 +26,17 @@ class DataManager private constructor(){
|
|||||||
.connectTimeout(30, TimeUnit.SECONDS)
|
.connectTimeout(30, TimeUnit.SECONDS)
|
||||||
.readTimeout(30, TimeUnit.SECONDS)
|
.readTimeout(30, TimeUnit.SECONDS)
|
||||||
.writeTimeout(30, TimeUnit.SECONDS)
|
.writeTimeout(30, TimeUnit.SECONDS)
|
||||||
.addInterceptor(JsonInterceptor())
|
|
||||||
.addInterceptor(RequestHeadInterceptor())
|
.addInterceptor(RequestHeadInterceptor())
|
||||||
|
.addInterceptor(JsonInterceptor())
|
||||||
.build()) // .addNetworkInterceptor(new TokenInterceptor())
|
.build()) // .addNetworkInterceptor(new TokenInterceptor())
|
||||||
.build().create(Api::class.java)
|
.build().create(Api::class.java)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
open fun <T : Any> setThread(): ObservableTransformer<T, T>? {
|
||||||
|
return ObservableTransformer { upstream ->
|
||||||
|
upstream.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -20,11 +20,13 @@ class RequestHeadInterceptor : Interceptor {
|
|||||||
@Throws(IOException::class)
|
@Throws(IOException::class)
|
||||||
override fun intercept(chain: Interceptor.Chain): Response {
|
override fun intercept(chain: Interceptor.Chain): Response {
|
||||||
val builder: Request.Builder = chain.request().newBuilder()
|
val builder: Request.Builder = chain.request().newBuilder()
|
||||||
if (BaseSPUtils.hasUserInfo(App.app) && !TextUtils.isEmpty(SPUtils.instance.getUserInfo(App.app)?.token)) {
|
var tokken = SPUtils.instance.getUserInfo(App.app)?.access_token
|
||||||
|
|
||||||
|
if (BaseSPUtils.hasUserInfo(App.app) && !TextUtils.isEmpty(SPUtils.instance.getUserInfo(App.app)?.access_token)) {
|
||||||
|
|
||||||
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
|
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
|
||||||
builder.addHeader("Authorization",
|
builder.addHeader("Authorization",
|
||||||
"Bearer " + SPUtils.instance.getUserInfo(App.app)?.token)
|
"Bearer " + SPUtils.instance.getUserInfo(App.app)?.access_token)
|
||||||
}
|
}
|
||||||
val request: Request = builder
|
val request: Request = builder
|
||||||
.addHeader("versionCode", AppUtils.getAppVersionCode().toString() + "")
|
.addHeader("versionCode", AppUtils.getAppVersionCode().toString() + "")
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
package com.dahe.gldriver.net
|
package com.dahe.gldriver.net
|
||||||
|
|
||||||
import android.accounts.NetworkErrorException
|
import android.accounts.NetworkErrorException
|
||||||
import android.app.Activity
|
|
||||||
import android.app.ProgressDialog
|
|
||||||
import com.dahe.gldriver.utils.UserUtils.Companion.instance
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.text.TextUtils
|
import android.text.TextUtils
|
||||||
import android.view.Window
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import com.dahe.gldriver.utils.UserUtils.Companion.instance
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
import com.dahe.mylibrary.net.ResultException
|
import com.dahe.mylibrary.net.ResultException
|
||||||
|
import com.dahe.mylibrary.utils.LoadingUtils
|
||||||
import com.dahe.mylibrary.utils.ToastUtils
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
|
import com.lxj.xpopup.impl.LoadingPopupView
|
||||||
import java.net.ConnectException
|
import java.net.ConnectException
|
||||||
import java.net.SocketTimeoutException
|
import java.net.SocketTimeoutException
|
||||||
import java.net.UnknownHostException
|
import java.net.UnknownHostException
|
||||||
@ -20,21 +20,27 @@ import javax.net.ssl.SSLException
|
|||||||
* 统一的网络回调
|
* 统一的网络回调
|
||||||
*/
|
*/
|
||||||
abstract class RxHttpCallBack<T> {
|
abstract class RxHttpCallBack<T> {
|
||||||
private var dialog: ProgressDialog? = null
|
// private var dialog: ProgressDialog? = null
|
||||||
private fun initDialog(activity: Activity, dialogMessage: String) {
|
private var dialog: LoadingPopupView? = null
|
||||||
dialog = ProgressDialog(activity)
|
private fun initDialog(activity: AppCompatActivity, dialogMessage: String) {
|
||||||
dialog!!.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
// dialog = ProgressDialog(activity)
|
||||||
dialog!!.setCanceledOnTouchOutside(false)
|
// dialog!!.requestWindowFeature(Window.FEATURE_NO_TITLE)
|
||||||
dialog!!.setProgressStyle(ProgressDialog.STYLE_SPINNER)
|
// dialog!!.setCanceledOnTouchOutside(false)
|
||||||
dialog!!.setMessage(dialogMessage)
|
// dialog!!.setProgressStyle(ProgressDialog.STYLE_SPINNER)
|
||||||
|
// dialog!!.setMessage(dialogMessage)
|
||||||
|
|
||||||
|
|
||||||
|
dialog = LoadingUtils.instance.init(activity)
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(activity: Activity, dialogMessage: String?) {
|
constructor(activity: AppCompatActivity, dialogMessage: String?) {
|
||||||
initDialog(activity,
|
initDialog(
|
||||||
(if (TextUtils.isEmpty(dialogMessage)) "网络请求中......" else dialogMessage)!!)
|
activity,
|
||||||
|
(if (TextUtils.isEmpty(dialogMessage)) "网络请求中......" else dialogMessage)!!
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(activity: Activity) {
|
constructor(activity: AppCompatActivity) {
|
||||||
initDialog(activity, "网络请求中......")
|
initDialog(activity, "网络请求中......")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,13 +50,13 @@ abstract class RxHttpCallBack<T> {
|
|||||||
* 订阅成功
|
* 订阅成功
|
||||||
*/
|
*/
|
||||||
fun onStart() {
|
fun onStart() {
|
||||||
if (dialog != null && !dialog!!.isShowing) {
|
if (dialog != null && !dialog!!.isShow) {
|
||||||
dialog!!.show()
|
dialog!!.show()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onStop() {
|
fun onStop() {
|
||||||
if (dialog != null && dialog!!.isShowing) {
|
if (dialog != null && dialog!!.isShow) {
|
||||||
dialog!!.dismiss()
|
dialog!!.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -61,8 +67,8 @@ abstract class RxHttpCallBack<T> {
|
|||||||
* @param t
|
* @param t
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
fun onSuccess(t: CommonResponseBean<T>) {
|
open fun onSuccess(t: CommonResponseBean<T>) {
|
||||||
if (dialog != null && dialog!!.isShowing) {
|
if (dialog != null && dialog!!.isShow) {
|
||||||
dialog!!.dismiss()
|
dialog!!.dismiss()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,8 +79,8 @@ abstract class RxHttpCallBack<T> {
|
|||||||
* @param t
|
* @param t
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
fun onCodeError(mContext: Context?, t: CommonResponseBean<T>) {
|
open fun onCodeError(mContext: Context?, t: CommonResponseBean<T>) {
|
||||||
if (dialog != null && dialog!!.isShowing) {
|
if (dialog != null && dialog!!.isShow) {
|
||||||
dialog!!.dismiss()
|
dialog!!.dismiss()
|
||||||
}
|
}
|
||||||
if (t.code == 401) {
|
if (t.code == 401) {
|
||||||
@ -100,8 +106,8 @@ abstract class RxHttpCallBack<T> {
|
|||||||
* @param e
|
* @param e
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
fun onFailure(mContext: Context?, e: Throwable) {
|
open fun onFailure(mContext: Context?, e: Throwable) {
|
||||||
if (dialog != null && dialog!!.isShowing) {
|
if (dialog != null && dialog!!.isShow) {
|
||||||
dialog!!.dismiss()
|
dialog!!.dismiss()
|
||||||
}
|
}
|
||||||
if (e is ConnectException
|
if (e is ConnectException
|
||||||
|
25
app/src/main/java/com/dahe/gldriver/oss/OssConfigBean.java
Normal file
25
app/src/main/java/com/dahe/gldriver/oss/OssConfigBean.java
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package com.dahe.gldriver.oss;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OssConfigBean
|
||||||
|
* @Author 用户
|
||||||
|
* @Date 2021/9/30 9:11
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class OssConfigBean {
|
||||||
|
|
||||||
|
// public static final String endpoint = "oss-cn-beijing.aliyuncs.com";
|
||||||
|
public static final String endpoint = "https://oss-cn-beijing.aliyuncs.com";
|
||||||
|
public static final String region = "oss-cn-beijing";
|
||||||
|
public static final String accessKeyId = "LTAI5tSR2Ketbc32wuokWZgF";
|
||||||
|
public static final String accessKeySecret = "TuumKEyXiZ3Rdfudcir7qJZenK2wCE";
|
||||||
|
public static final String bucket = "dh-tms";
|
||||||
|
public static final String BUCKET_OBJECT = "tms/user-cert/";
|
||||||
|
public static final String BUCKET_OBJECT_TEXT = "tms/tms-test/user-cert/";
|
||||||
|
public static final String BUCKET_BASE_URL = "https://dh-tms.oss-cn-beijing.aliyuncs.com/";
|
||||||
|
public static final String BUCKET_BASE_URL_UP = "https://dahehuodongbao.com/";
|
||||||
|
public static final String ARN = "acs:ram::1864711654174879:role/aliyunactiontraildefaultrole";
|
||||||
|
//callback 测试地址
|
||||||
|
public static final String OSS_CALLBACK_URL = "http://oss-demo.aliyuncs.com:23450";
|
||||||
|
// public static final String OSS_CALLBACK_URL = "http://tms.api.test.dahehuodongbao.com:8081/sts/getsts";
|
||||||
|
}
|
352
app/src/main/java/com/dahe/gldriver/oss/OssServiceUtil.java
Normal file
352
app/src/main/java/com/dahe/gldriver/oss/OssServiceUtil.java
Normal file
@ -0,0 +1,352 @@
|
|||||||
|
package com.dahe.gldriver.oss;
|
||||||
|
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ProgressBar;
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
|
import com.alibaba.sdk.android.oss.ClientConfiguration;
|
||||||
|
import com.alibaba.sdk.android.oss.ClientException;
|
||||||
|
import com.alibaba.sdk.android.oss.OSS;
|
||||||
|
import com.alibaba.sdk.android.oss.OSSClient;
|
||||||
|
import com.alibaba.sdk.android.oss.ServiceException;
|
||||||
|
import com.alibaba.sdk.android.oss.callback.OSSCompletedCallback;
|
||||||
|
import com.alibaba.sdk.android.oss.callback.OSSProgressCallback;
|
||||||
|
import com.alibaba.sdk.android.oss.common.auth.OSSAuthCredentialsProvider;
|
||||||
|
import com.alibaba.sdk.android.oss.common.auth.OSSCredentialProvider;
|
||||||
|
import com.alibaba.sdk.android.oss.internal.OSSAsyncTask;
|
||||||
|
import com.alibaba.sdk.android.oss.model.OSSRequest;
|
||||||
|
import com.alibaba.sdk.android.oss.model.PutObjectRequest;
|
||||||
|
import com.alibaba.sdk.android.oss.model.PutObjectResult;
|
||||||
|
import com.dahe.gldriver.base.App;
|
||||||
|
import com.dahe.mylibrary.utils.LoadingUtils;
|
||||||
|
import com.lxj.xpopup.impl.LoadingPopupView;
|
||||||
|
|
||||||
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||||
|
import io.reactivex.rxjava3.core.Observable;
|
||||||
|
import io.reactivex.rxjava3.functions.Consumer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OssServiceUtil
|
||||||
|
* @Author 用户
|
||||||
|
* @Date 2021/9/29 17:53
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
public class OssServiceUtil {
|
||||||
|
|
||||||
|
private static OSS oss;
|
||||||
|
private static OSSCredentialProvider credentialProvider;
|
||||||
|
private static ClientConfiguration conf;
|
||||||
|
private String bucket;
|
||||||
|
private picResultCallback callback;//回调接口
|
||||||
|
private String path = "tms/user-cert/";
|
||||||
|
private LoadingPopupView dialog;
|
||||||
|
|
||||||
|
private OssServiceUtil() {
|
||||||
|
}
|
||||||
|
|
||||||
|
private static volatile OssServiceUtil ossUtils;
|
||||||
|
|
||||||
|
public static OssServiceUtil getInstance() {
|
||||||
|
if (ossUtils == null) {
|
||||||
|
synchronized (OssServiceUtil.class) {
|
||||||
|
if (ossUtils == null) {
|
||||||
|
ossUtils = new OssServiceUtil();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ossUtils;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initDialog(AppCompatActivity activity) {
|
||||||
|
dialog = LoadingUtils.Companion.getInstance().init(activity,"网络请求中......");
|
||||||
|
}
|
||||||
|
|
||||||
|
//初始化使用参数
|
||||||
|
public void init() {
|
||||||
|
bucket = OssConfigBean.bucket;
|
||||||
|
String stsServer = "http://platform.test.v2.dahehuoyun.com/devApi/file/aliyun/oss/getToken";
|
||||||
|
credentialProvider = new OSSAuthCredentialsProvider(stsServer);
|
||||||
|
conf = new ClientConfiguration();
|
||||||
|
conf.setConnectionTimeout(15 * 1000); // 连接超时,默认15秒
|
||||||
|
conf.setSocketTimeout(15 * 1000); // socket超时,默认15秒
|
||||||
|
conf.setMaxConcurrentRequest(5); // 最大并发请求书,默认5个
|
||||||
|
conf.setMaxErrorRetry(2); // 失败后最大重试次数,默认2次
|
||||||
|
|
||||||
|
oss = new OSSClient(App.Companion.getApp(), OssConfigBean.endpoint, credentialProvider, conf);
|
||||||
|
|
||||||
|
|
||||||
|
System.out.println("ffff");
|
||||||
|
// initDialog(activity);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResultCallBack(picResultCallback callback) {
|
||||||
|
this.callback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片以路径的方式上传
|
||||||
|
* <p>
|
||||||
|
* // * @param 图片的上传地址(更后台要)
|
||||||
|
* // * @param 图片本地地址
|
||||||
|
* // * @param 进度条
|
||||||
|
*/
|
||||||
|
public void asyncPutImage(final String localFile, final AppCompatActivity activity) {
|
||||||
|
// if (object.equals("")) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
if (activity!=null){
|
||||||
|
activity.runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
initDialog(activity);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
File file = new File(localFile);
|
||||||
|
if (!file.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Calendar instance = Calendar.getInstance();
|
||||||
|
String year = String.valueOf(instance.get(Calendar.YEAR));
|
||||||
|
String month = String.valueOf(instance.get(Calendar.MONTH) + 1);
|
||||||
|
String day = String.valueOf(instance.get(Calendar.DAY_OF_MONTH));
|
||||||
|
String name = file.getName();
|
||||||
|
// 构造上传请求
|
||||||
|
// PutObjectRequest put = new PutObjectRequest(OssConfigBean.bucket, year + "/" + month + "/" + day + name, localFile);
|
||||||
|
PutObjectRequest put = new PutObjectRequest(OssConfigBean.bucket, OssConfigBean.BUCKET_OBJECT + name, localFile);
|
||||||
|
|
||||||
|
put.setCRC64(OSSRequest.CRC64Config.YES);
|
||||||
|
String mCallbackAddress = OssConfigBean.OSS_CALLBACK_URL;
|
||||||
|
// if (mCallbackAddress != null) {
|
||||||
|
// // 传入对应的上传回调参数,这里默认使用OSS提供的公共测试回调服务器地址
|
||||||
|
// put.setCallbackParam(new HashMap<String, String>() {
|
||||||
|
// {
|
||||||
|
// put("callbackUrl", mCallbackAddress);
|
||||||
|
// //callbackBody可以自定义传入的信息
|
||||||
|
// put("callbackBody", "filename=${object}");
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
//上传后回调通知
|
||||||
|
// 异步上传时可以设置进度回调
|
||||||
|
put.setProgressCallback(new OSSProgressCallback<PutObjectRequest>() {
|
||||||
|
@Override
|
||||||
|
public void onProgress(PutObjectRequest request, long currentSize, long totalSize) {
|
||||||
|
// int progress = (int) (100 * currentSize / totalSize);
|
||||||
|
// if (mProgress != null) {
|
||||||
|
// mProgress.setProgress(progress);
|
||||||
|
// }
|
||||||
|
activity.runOnUiThread(() -> {
|
||||||
|
if (dialog != null&&!dialog.isShow()) {
|
||||||
|
dialog.show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
OSSAsyncTask task = oss.asyncPutObject(put, new OSSCompletedCallback<PutObjectRequest, PutObjectResult>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(PutObjectRequest request, final PutObjectResult result) {
|
||||||
|
activity.runOnUiThread(() -> {
|
||||||
|
if (dialog != null) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
String serverCallbackReturnBody = result.getServerCallbackReturnBody();
|
||||||
|
callback.getPicData(result, OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(PutObjectRequest request, ClientException clientExcepion, ServiceException serviceException) {
|
||||||
|
activity.runOnUiThread(() -> {
|
||||||
|
if (dialog != null) {
|
||||||
|
dialog.dismiss();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
String info = "";
|
||||||
|
// 请求异常
|
||||||
|
if (clientExcepion != null) {
|
||||||
|
// 本地异常如网络异常等
|
||||||
|
clientExcepion.printStackTrace();
|
||||||
|
info = clientExcepion.toString();
|
||||||
|
}
|
||||||
|
if (serviceException != null) {
|
||||||
|
// 服务异常
|
||||||
|
Log.e("ErrorCode", serviceException.getErrorCode());
|
||||||
|
Log.e("RequestId", serviceException.getRequestId());
|
||||||
|
Log.e("HostId", serviceException.getHostId());
|
||||||
|
Log.e("RawMessage", serviceException.getRawMessage());
|
||||||
|
info = serviceException.toString();
|
||||||
|
}
|
||||||
|
// task.cancel();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传次数
|
||||||
|
*/
|
||||||
|
int number;
|
||||||
|
/**
|
||||||
|
* 成功上传(本地文件名作为key,阿里云地址为value)
|
||||||
|
*/
|
||||||
|
List<String> success = new ArrayList<>();
|
||||||
|
/**
|
||||||
|
* 失败上传(返回失败文件的本地地址)
|
||||||
|
*/
|
||||||
|
List<String> failure = new ArrayList<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量上传图片
|
||||||
|
*
|
||||||
|
* @param localFiles
|
||||||
|
*/
|
||||||
|
public void asyncPutImages(final List<String> localFiles, PicsResultCallback callback) {
|
||||||
|
//初始化
|
||||||
|
number = 1;
|
||||||
|
success.clear();
|
||||||
|
for (int i = 0; i < localFiles.size(); i++) {
|
||||||
|
File file = new File(localFiles.get(i));
|
||||||
|
if (!file.exists()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String name = file.getName();
|
||||||
|
// 构造上传请求
|
||||||
|
PutObjectRequest put = new PutObjectRequest(OssConfigBean.bucket, OssConfigBean.BUCKET_OBJECT + name, localFiles.get(i));
|
||||||
|
|
||||||
|
put.setCRC64(OSSRequest.CRC64Config.YES);
|
||||||
|
|
||||||
|
oss.asyncPutObject(put, new OSSCompletedCallback<PutObjectRequest, PutObjectResult>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(PutObjectRequest request, final PutObjectResult result) {
|
||||||
|
|
||||||
|
String aliPath = OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name;
|
||||||
|
success.add(aliPath);
|
||||||
|
if (number == localFiles.size()) {
|
||||||
|
//返回 上传路径,以及失败的路径
|
||||||
|
callback.onOssSuccess(success, failure);
|
||||||
|
}
|
||||||
|
number++;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(PutObjectRequest request, ClientException clientExcepion, ServiceException serviceException) {
|
||||||
|
number++;
|
||||||
|
String aliPath = OssConfigBean.BUCKET_BASE_URL + OssConfigBean.BUCKET_OBJECT + name;
|
||||||
|
failure.add(aliPath);
|
||||||
|
if (number == localFiles.size()) {
|
||||||
|
callback.onOssSuccess(success, failure);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 图片以bitmap的形式上传
|
||||||
|
*
|
||||||
|
* @param object
|
||||||
|
* @param localFile
|
||||||
|
* @param mProgress
|
||||||
|
* @param img
|
||||||
|
* @param type
|
||||||
|
*/
|
||||||
|
public void asyncPutImage(String object, final Bitmap localFile, final ProgressBar mProgress, final ImageView img, String type) {
|
||||||
|
if (object.equals("")) {
|
||||||
|
Log.w("AsyncPutImage", "ObjectNull");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (localFile == null) {
|
||||||
|
Log.w("AsyncPutImage", "bitmapNull");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 构造上传请求
|
||||||
|
PutObjectRequest put = new PutObjectRequest(bucket, object, getBitmapByte(localFile));
|
||||||
|
//上传后回调通知
|
||||||
|
// 客户端在上传Object时可以指定OSS服务端在处理完上传请求后,通知您的业务服务器,在该服务器确认接收了该回调后将回调的结果返回给客户端。
|
||||||
|
put.setCallbackParam(new HashMap<String, String>() {
|
||||||
|
{
|
||||||
|
put("callbackUrl", path);
|
||||||
|
put("callbackBody",
|
||||||
|
//参数跟后台商议
|
||||||
|
"filename=${object}&size=${size}&action=${x:action}}");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
HashMap<String, String> hashMap = new HashMap<>();
|
||||||
|
hashMap.put("x:action", type);
|
||||||
|
put.setCallbackVars(hashMap);
|
||||||
|
OSSAsyncTask task = oss.asyncPutObject(put, new OSSCompletedCallback<PutObjectRequest, PutObjectResult>() {
|
||||||
|
@Override
|
||||||
|
public void onSuccess(PutObjectRequest request, final PutObjectResult result) {
|
||||||
|
|
||||||
|
Observable.just(result).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<PutObjectResult>() {
|
||||||
|
@Override
|
||||||
|
public void accept(PutObjectResult putObjectResult) throws Throwable {
|
||||||
|
callback.getPicData(result, "");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Observable.just(result).observeOn(AndroidSchedulers.mainThread()).subscribe(putObjectResult -> callback.getPicData(result, ""));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onFailure(PutObjectRequest request, ClientException clientExcepion, ServiceException serviceException) {
|
||||||
|
String info = "";
|
||||||
|
// 请求异常
|
||||||
|
if (clientExcepion != null) {
|
||||||
|
// 本地异常如网络异常等
|
||||||
|
clientExcepion.printStackTrace();
|
||||||
|
info = clientExcepion.toString();
|
||||||
|
}
|
||||||
|
if (serviceException != null) {
|
||||||
|
// 服务异常
|
||||||
|
Log.e("ErrorCode", serviceException.getErrorCode());
|
||||||
|
Log.e("RequestId", serviceException.getRequestId());
|
||||||
|
Log.e("HostId", serviceException.getHostId());
|
||||||
|
Log.e("RawMessage", serviceException.getRawMessage());
|
||||||
|
info = serviceException.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public byte[] getBitmapByte(Bitmap bitmap) {
|
||||||
|
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||||
|
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
|
||||||
|
try {
|
||||||
|
out.flush();
|
||||||
|
out.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return out.toByteArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface picResultCallback {
|
||||||
|
void getPicData(PutObjectResult data, String oldPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
public interface PicsResultCallback {
|
||||||
|
void onOssSuccess(List<String> success, List<String> failure);
|
||||||
|
}
|
||||||
|
}
|
@ -6,7 +6,9 @@ import com.dahe.gldriver.databinding.ActivityLauncherBinding
|
|||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
import com.dahe.gldriver.ui.account.LoginActivity
|
import com.dahe.gldriver.ui.account.LoginActivity
|
||||||
|
import com.dahe.gldriver.ui.account.SelectRoleActivity
|
||||||
import com.dahe.gldriver.utils.SPUtils
|
import com.dahe.gldriver.utils.SPUtils
|
||||||
|
import com.dahe.mylibrary.utils.StringUtils
|
||||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
import io.reactivex.rxjava3.core.Observable
|
import io.reactivex.rxjava3.core.Observable
|
||||||
import io.reactivex.rxjava3.disposables.Disposable
|
import io.reactivex.rxjava3.disposables.Disposable
|
||||||
@ -22,17 +24,14 @@ class LauncherActivity : BaseActivity<ActivityLauncherBinding>() {
|
|||||||
binding.llCount.setOnClickListener {
|
binding.llCount.setOnClickListener {
|
||||||
mDisposable?.dispose()
|
mDisposable?.dispose()
|
||||||
//已登录,直接跳转首页
|
//已登录,直接跳转首页
|
||||||
// val userInfo = SPUtils.getUserInfo(mContext)
|
val userInfo = SPUtils.instance.getUserInfo(mContext)
|
||||||
//
|
//
|
||||||
// if (userInfo != null && StringUtils.isNotEmpty(userInfo.token)) {
|
if (userInfo != null && StringUtils.isNotEmpty(userInfo.access_token)) {
|
||||||
// ActivityUtils.startActivity(mContext, HomeActivity::class.java,intent.extras)
|
ActivityUtils.startActivity(mContext, LoginActivity::class.java, intent.extras)
|
||||||
// } else {
|
} else {
|
||||||
// ActivityUtils.startActivity(this@LauncherActivity, LoginActivity::class.java)
|
ActivityUtils.startActivity(this@LauncherActivity, LoginActivity::class.java)
|
||||||
// }
|
}
|
||||||
// window.setFlags(
|
// ActivityUtils.startActivity(this@LauncherActivity, LoginActivity::class.java)
|
||||||
// WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
|
|
||||||
// WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
|
||||||
ActivityUtils.startActivity(this@LauncherActivity, LoginActivity::class.java)
|
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
val count = 3
|
val count = 3
|
||||||
@ -45,17 +44,19 @@ class LauncherActivity : BaseActivity<ActivityLauncherBinding>() {
|
|||||||
mDisposable?.dispose()
|
mDisposable?.dispose()
|
||||||
//已登录,直接跳转首页
|
//已登录,直接跳转首页
|
||||||
//已登录,直接跳转首页
|
//已登录,直接跳转首页
|
||||||
// val userInfo: UserBean? = SPUtils.getUserInfo(mContext)
|
val userInfo = SPUtils.instance.getUserInfo(mContext)
|
||||||
//
|
if (userInfo != null && StringUtils.isNotEmpty(userInfo.access_token)) {
|
||||||
// if (userInfo != null && !TextUtils.isEmpty(userInfo.getToken())) {
|
ActivityUtils.startActivity(
|
||||||
// ActivityUtils.startActivity(mContext, HomeActivity::class.java,intent.extras)
|
mContext,
|
||||||
// } else {
|
SelectRoleActivity::class.java,
|
||||||
// ActivityUtils.startActivity(
|
intent.extras
|
||||||
// this@LauncherActivity,
|
)
|
||||||
// LoginActivity::class.java
|
} else {
|
||||||
// )
|
ActivityUtils.startActivity(
|
||||||
//
|
this@LauncherActivity,
|
||||||
// }
|
LoginActivity::class.java
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// ActivityUtils.startActivity(
|
// ActivityUtils.startActivity(
|
||||||
// this@LauncherActivity,
|
// this@LauncherActivity,
|
||||||
|
@ -1,14 +1,22 @@
|
|||||||
package com.dahe.gldriver.ui.account
|
package com.dahe.gldriver.ui.account
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import com.dahe.gldriver.base.AppConfig
|
||||||
import com.dahe.gldriver.databinding.ActivityCodeBinding
|
import com.dahe.gldriver.databinding.ActivityCodeBinding
|
||||||
import com.dahe.gldriver.databinding.ActivityLoginBinding
|
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.utils.SPUtils
|
||||||
|
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.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
import com.dahe.mylibrary.utils.SmsTimeUtils
|
import com.google.gson.Gson
|
||||||
import kotlin.math.log
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName LoginActivity
|
* @ClassName LoginActivity
|
||||||
@ -17,23 +25,57 @@ import kotlin.math.log
|
|||||||
* @Description TODO
|
* @Description TODO
|
||||||
*/
|
*/
|
||||||
class CodeLoginActivity : BaseActivity<ActivityCodeBinding>(), View.OnClickListener {
|
class CodeLoginActivity : BaseActivity<ActivityCodeBinding>(), View.OnClickListener {
|
||||||
|
lateinit var phone: String
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
|
phone = intent.extras!!.getString(AppConfig.PHONE, "")
|
||||||
|
|
||||||
binding.tvLoginType.setOnClickListener(this)
|
binding.tvLoginType.setOnClickListener(this)
|
||||||
|
binding.ok.setOnClickListener(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
|
DataManager.getInstance().getCode(phone)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserBean>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<UserBean>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
}
|
||||||
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onClick(view: View?) {
|
override fun onClick(view: View?) {
|
||||||
super.onClick(view)
|
super.onClick(view)
|
||||||
|
when (view?.id) {
|
||||||
|
binding.tvLoginType.id -> {}
|
||||||
|
binding.ok.id -> {
|
||||||
|
// setResult(RESULT_OK, Intent().apply { putExtra(AppConfig.CODE, "2024") })
|
||||||
|
// finish()
|
||||||
|
DataManager.getInstance().login(phone, "2024")
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserBean>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<UserBean>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
SPUtils.instance.setUserInfo(mContext, Gson().toJson(t.data))
|
||||||
|
|
||||||
|
|
||||||
|
ActivityUtils.startActivity(
|
||||||
|
mContext,
|
||||||
|
SelectRoleActivity::class.java
|
||||||
|
)
|
||||||
|
finish()
|
||||||
|
ActivityUtils.finishActivity(LoginActivity::class.java)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun changeLoginType() {
|
private fun changeLoginType() {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun login(){
|
private fun login() {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,11 +1,14 @@
|
|||||||
package com.dahe.gldriver.ui.account
|
package com.dahe.gldriver.ui.account
|
||||||
|
|
||||||
|
import android.content.Intent
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
import com.dahe.gldriver.base.AppConfig
|
||||||
import com.dahe.gldriver.databinding.ActivityLoginBinding
|
import com.dahe.gldriver.databinding.ActivityLoginBinding
|
||||||
import com.dahe.gldriver.ui.HomeActivity
|
import com.dahe.gldriver.ui.HomeActivity
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName LoginActivity
|
* @ClassName LoginActivity
|
||||||
@ -72,10 +75,29 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>(), View.OnClickListener
|
|||||||
|
|
||||||
private fun login() {
|
private fun login() {
|
||||||
if ("获取验证码" == binding.ok.text) {
|
if ("获取验证码" == binding.ok.text) {
|
||||||
ActivityUtils.startActivity(mContext, CodeLoginActivity::class.java)
|
var phone = binding.etPhone.text.toString().trim()
|
||||||
}else{
|
if (phone.length == 11) {
|
||||||
|
|
||||||
|
ActivityUtils.startActivityForResult(
|
||||||
|
LoginActivity@ this,
|
||||||
|
CodeLoginActivity::class.java,
|
||||||
|
Bundle().apply { putString(AppConfig.PHONE, binding.etPhone.text.toString()) },
|
||||||
|
1
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
ToastUtils.showToast(mContext, "请输入正确手机号")
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
ActivityUtils.startActivity(mContext, SelectRoleActivity::class.java)
|
ActivityUtils.startActivity(mContext, SelectRoleActivity::class.java)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||||
|
super.onActivityResult(requestCode, resultCode, data)
|
||||||
|
if (resultCode == RESULT_OK && requestCode == 1) {
|
||||||
|
var code = data?.getStringExtra(AppConfig.CODE)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -3,7 +3,11 @@ 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.ui.account.authperson.AuthBankCardActivity
|
||||||
|
import com.dahe.gldriver.ui.account.authperson.AuthDriverActivity
|
||||||
|
import com.dahe.gldriver.ui.account.authperson.AuthDrivingActivity
|
||||||
import com.dahe.gldriver.ui.account.authperson.AuthPersonActivity
|
import com.dahe.gldriver.ui.account.authperson.AuthPersonActivity
|
||||||
|
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.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
@ -19,7 +23,8 @@ 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, AuthPersonActivity::class.java)
|
ActivityUtils.startActivity(mContext, AuthDriverActivity::class.java)
|
||||||
|
// ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
|
||||||
}
|
}
|
||||||
binding.rlCom.setOnClickListener {
|
binding.rlCom.setOnClickListener {
|
||||||
ActivityUtils.startActivity(mContext, AuthTeamActivity::class.java)
|
ActivityUtils.startActivity(mContext, AuthTeamActivity::class.java)
|
||||||
|
@ -2,11 +2,20 @@ package com.dahe.gldriver.ui.account.authperson
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
|
import com.dahe.gldriver.bean.OcrPersonBean
|
||||||
|
import com.dahe.gldriver.bean.UpBankInfoBean
|
||||||
import com.dahe.gldriver.databinding.ActivityAuthBankcardBinding
|
import com.dahe.gldriver.databinding.ActivityAuthBankcardBinding
|
||||||
|
import com.dahe.gldriver.net.BaseObserver
|
||||||
|
import com.dahe.gldriver.net.DataManager
|
||||||
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
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 com.dahe.mylibrary.utils.ImageLoader
|
import com.dahe.mylibrary.utils.ImageLoader
|
||||||
import com.dahe.mylibrary.utils.PopsUtils
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName AuthBankCardActivity
|
* @ClassName AuthBankCardActivity
|
||||||
@ -15,22 +24,75 @@ import com.dahe.mylibrary.utils.PopsUtils
|
|||||||
* @Description TODO
|
* @Description TODO
|
||||||
*/
|
*/
|
||||||
class AuthBankCardActivity : BaseActivity<ActivityAuthBankcardBinding>() {
|
class AuthBankCardActivity : BaseActivity<ActivityAuthBankcardBinding>() {
|
||||||
|
private var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
|
||||||
|
|
||||||
|
private var bankInfo = UpBankInfoBean()
|
||||||
|
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("实名认证", true)
|
setTitleBar("实名认证", true)
|
||||||
|
|
||||||
binding.run {
|
binding.run {
|
||||||
btnOk.setOnClickListener {
|
btnOk.setOnClickListener {
|
||||||
ActivityUtils.startActivity(mContext, AuthFaceActivity::class.java)
|
subMit()
|
||||||
}
|
}
|
||||||
ivFront.setOnClickListener {
|
ivFront.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
selBankPic()
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun selBankPic() {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(mContext) { it ->
|
||||||
|
var data = it[0]
|
||||||
|
ossServiceUtil.asyncPutImage(data.realPath, this@AuthBankCardActivity)
|
||||||
|
ossServiceUtil.setResultCallBack { data, oldPath ->
|
||||||
|
DataManager.getInstance().recognizeBankCard(oldPath)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
BaseObserver(mContext,
|
||||||
|
object : RxHttpCallBack<OcrPersonBean>(this) {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
t.data.data?.run {
|
||||||
|
bankInfo.driverBankcardPhotoUrl = oldPath
|
||||||
|
|
||||||
|
binding.let {
|
||||||
|
it.etId.setText(cardNumber)
|
||||||
|
it.tvBankName.text = bankName
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ImageLoader.getInstance().loadRoundImage(mContext, data.realPath, 12, binding.ivFront)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun subMit() {
|
||||||
|
bankInfo.run {
|
||||||
|
|
||||||
|
bankInfo.driverBankcardNumber = binding.etId.text.toString()
|
||||||
|
bankInfo.driverBankcardAddress = binding.tvBankName.text.toString()
|
||||||
|
|
||||||
|
DataManager.getInstance().setUpDriverBankCard(this)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<String>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
ActivityUtils.startActivity(mContext, AuthFaceActivity::class.java)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,13 +1,27 @@
|
|||||||
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.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.DataManager
|
||||||
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
|
import com.dahe.gldriver.utils.OcrUtils
|
||||||
import com.dahe.mylibrary.utils.PickerUtils
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
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 com.dahe.mylibrary.utils.ImageLoader
|
import com.dahe.mylibrary.utils.ImageLoader
|
||||||
import com.dahe.mylibrary.utils.PopsUtils
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName AuthRoleActivity
|
* @ClassName AuthRoleActivity
|
||||||
@ -16,13 +30,18 @@ import com.dahe.mylibrary.utils.PopsUtils
|
|||||||
* @Description 驾驶证认证
|
* @Description 驾驶证认证
|
||||||
*/
|
*/
|
||||||
class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
||||||
|
|
||||||
|
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
|
||||||
|
|
||||||
|
var driverInfoBean: UpDriverInfoBean = UpDriverInfoBean()
|
||||||
|
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("实名认证", true)
|
setTitleBar("实名认证", true)
|
||||||
|
|
||||||
binding.run {
|
binding.run {
|
||||||
btnOk.setOnClickListener {
|
btnOk.setOnClickListener {
|
||||||
ActivityUtils.startActivity(mContext, AuthQualificationActivity::class.java)
|
subMit()
|
||||||
}
|
}
|
||||||
|
|
||||||
tvStart.run {
|
tvStart.run {
|
||||||
@ -41,27 +60,19 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tvCarType.run {
|
tvCarType.setOnClickListener {
|
||||||
setOnClickListener {
|
PickerUtils.getInstance()
|
||||||
PickerUtils.getInstance()
|
.showSelectCarType(this@AuthDriverActivity, "选择准驾车型") { _, item ->
|
||||||
.showSelectCarType(this@AuthDriverActivity, "选择准驾车型") { _, item ->
|
tvCarType.text = item.toString()
|
||||||
this.text = item.toString()
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ivFront.setOnClickListener {
|
ivFront.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
selFrontPic()
|
||||||
var data = it[0]
|
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext,data.path,12,ivFront)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ivBack.setOnClickListener {
|
ivBack.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
selBackPic()
|
||||||
var data = it[0]
|
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext,data.path,12,ivBack)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -69,4 +80,144 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun subMit() {
|
||||||
|
binding.run {
|
||||||
|
driverInfoBean.run {
|
||||||
|
licenseNo = etId.text.toString()
|
||||||
|
licenseType = tvCarType.text.toString()
|
||||||
|
licenseEffectiveStart = tvStart.text.toString()
|
||||||
|
licenseEffectiveEnd = tvEnd.text.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
DataManager.getInstance().setUpDriverLicense(driverInfoBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<String>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
ActivityUtils.startActivity(
|
||||||
|
mContext,
|
||||||
|
AuthQualificationActivity::class.java
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun selFrontPic() {
|
||||||
|
OcrUtils.getInstance().ocrDriver(mContext, this@AuthDriverActivity) { picPath, result ->
|
||||||
|
result.data.face?.data.let {
|
||||||
|
ImageLoader.getInstance().loadRoundImage(mContext, picPath, 12, binding.ivFront)
|
||||||
|
driverInfoBean.licensePhotoFaceUrl = picPath.picPath
|
||||||
|
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 ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 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() {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
|
var data = it[0]
|
||||||
|
ossServiceUtil.asyncPutImage(data.realPath, this@AuthDriverActivity)
|
||||||
|
ossServiceUtil.setResultCallBack { data, oldPath ->
|
||||||
|
run {
|
||||||
|
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.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)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -2,11 +2,19 @@ package com.dahe.gldriver.ui.account.authperson
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
|
import com.dahe.gldriver.bean.OcrPersonBean
|
||||||
import com.dahe.gldriver.databinding.ActivityAuthDrivingBinding
|
import com.dahe.gldriver.databinding.ActivityAuthDrivingBinding
|
||||||
|
import com.dahe.gldriver.net.BaseObserver
|
||||||
|
import com.dahe.gldriver.net.DataManager
|
||||||
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
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 com.dahe.mylibrary.utils.ImageLoader
|
import com.dahe.mylibrary.utils.ImageLoader
|
||||||
import com.dahe.mylibrary.utils.PopsUtils
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName AuthRoleActivity
|
* @ClassName AuthRoleActivity
|
||||||
@ -15,6 +23,8 @@ import com.dahe.mylibrary.utils.PopsUtils
|
|||||||
* @Description 行驶证认证
|
* @Description 行驶证认证
|
||||||
*/
|
*/
|
||||||
class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
||||||
|
|
||||||
|
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("实名认证", true)
|
setTitleBar("实名认证", true)
|
||||||
@ -23,15 +33,17 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
|||||||
}
|
}
|
||||||
binding.run {
|
binding.run {
|
||||||
ivFront.setOnClickListener {
|
ivFront.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
selFrontPic()
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
// PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
}
|
// ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
ivBack.setOnClickListener {
|
ivBack.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
selBackPic()
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBack)
|
// PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
}
|
// ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBack)
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
ivCar.setOnClickListener {
|
ivCar.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
@ -43,4 +55,88 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
|||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun selFrontPic() {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
|
var data = it[0]
|
||||||
|
ossServiceUtil.asyncPutImage(data.realPath, this@AuthDrivingActivity)
|
||||||
|
ossServiceUtil.setResultCallBack { data, oldPath ->
|
||||||
|
DataManager.getInstance().recognizeVehicleLicense(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 {
|
||||||
|
binding.run {
|
||||||
|
etCarNum.setText(it.licensePlateNumber)
|
||||||
|
etOwner.setText(it.owner)
|
||||||
|
etUseNature.setText(it.useNature)
|
||||||
|
etCurbWeight.setText(it.curbWeight)
|
||||||
|
etPermittedWeight.setText(it.permittedWeight)
|
||||||
|
tvCarType.text = it.vehicleType
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 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() {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
|
var data = it[0]
|
||||||
|
ossServiceUtil.asyncPutImage(data.realPath, this@AuthDrivingActivity)
|
||||||
|
ossServiceUtil.setResultCallBack { data, oldPath ->
|
||||||
|
run {
|
||||||
|
DataManager.getInstance().recognizeVehicleLicense(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.back?.data.let {
|
||||||
|
// driverInfoBean.licensePhotoBackUrl = oldPath
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
ImageLoader.getInstance().loadRoundImage(mContext, data.realPath, 12, binding.ivBack)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -2,13 +2,28 @@ package com.dahe.gldriver.ui.account.authperson
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
|
import com.dahe.gldriver.bean.OcrPersonBean
|
||||||
|
import com.dahe.gldriver.bean.OssBean
|
||||||
|
import com.dahe.gldriver.bean.UpPersonInfoBean
|
||||||
import com.dahe.gldriver.databinding.ActivityAuthPersonBinding
|
import com.dahe.gldriver.databinding.ActivityAuthPersonBinding
|
||||||
import com.dahe.mylibrary.utils.PickerUtils
|
import com.dahe.gldriver.net.BaseObserver
|
||||||
|
import com.dahe.gldriver.net.DataManager
|
||||||
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
|
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.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.PickerUtils
|
||||||
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.functions.Function
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
|
import okhttp3.MultipartBody
|
||||||
|
import okhttp3.RequestBody.Companion.asRequestBody
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName AuthRoleActivity
|
* @ClassName AuthRoleActivity
|
||||||
@ -17,19 +32,43 @@ import com.dahe.mylibrary.utils.ToastUtils
|
|||||||
* @Description 身份证认证
|
* @Description 身份证认证
|
||||||
*/
|
*/
|
||||||
class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||||
|
|
||||||
|
|
||||||
|
lateinit var ossServiceUtil: OssServiceUtil
|
||||||
|
|
||||||
|
var perInfoBean: UpPersonInfoBean = UpPersonInfoBean()
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("实名认证", true)
|
setTitleBar("实名认证", true)
|
||||||
|
|
||||||
|
ossServiceUtil = OssServiceUtil.getInstance()
|
||||||
binding.run {
|
binding.run {
|
||||||
|
var inBinding = this
|
||||||
btnOk.setOnClickListener {
|
btnOk.setOnClickListener {
|
||||||
ActivityUtils.startActivity(mContext, AuthDriverActivity::class.java)
|
|
||||||
|
perInfoBean.run {
|
||||||
|
idcardNo = inBinding.etId.toString()
|
||||||
|
idcardName = inBinding.etName.toString()
|
||||||
|
idcardEffectiveStart = inBinding.tvStart.toString()
|
||||||
|
idcardEffectiveEnd = inBinding.tvEnd.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
DataManager.getInstance().setUpDriverIdCard(perInfoBean)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<String>(){
|
||||||
|
override fun onSuccess(t: CommonResponseBean<String>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
println("lijiaaaaa")
|
||||||
|
ActivityUtils.startActivity(mContext, AuthDriverActivity::class.java)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
tvStart.run {
|
tvStart.run {
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthPersonActivity,"有效起始日期") { year, month, day ->
|
.showDate(this@AuthPersonActivity, "有效起始日期") { year, month, day ->
|
||||||
this.text = "$year-$month-$day"
|
this.text = "$year-$month-$day"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,26 +76,127 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
|||||||
tvEnd.run {
|
tvEnd.run {
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthPersonActivity,"有效结束日期") { year, month, day ->
|
.showDate(this@AuthPersonActivity, "有效结束日期") { year, month, day ->
|
||||||
this.text = "$year-$month-$day"
|
this.text = "$year-$month-$day"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ivFront.setOnClickListener {
|
ivFront.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
var data = it[0]
|
var data = it[0]
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext,data.path,12,ivFront)
|
|
||||||
|
val path: String
|
||||||
|
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 {
|
||||||
|
perInfoBean.run {
|
||||||
|
idcardNo = idNumber
|
||||||
|
idcardName = name
|
||||||
|
idcardSex = if (sex == "男") "0" else "1"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
binding.run {
|
||||||
|
etName.setText(it?.name)
|
||||||
|
etId.setText(it?.idNumber)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
// ossServiceUtil.asyncPutImage(path, null)
|
||||||
|
// ossServiceUtil.setResultCallBack { data, oldPath ->
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ivBack.setOnClickListener {
|
ivBack.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
var data = it[0]
|
var data = it[0]
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext,data.path,12,ivBack)
|
|
||||||
|
|
||||||
|
val path: String
|
||||||
|
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, ivBack)
|
||||||
|
|
||||||
|
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.idcardBackUrl = 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.back?.let {
|
||||||
|
if (it.data.validPeriod?.contains("-") == true) {
|
||||||
|
val split = it.data.validPeriod.split("-")
|
||||||
|
binding.run {
|
||||||
|
tvStart.text = split[0]
|
||||||
|
tvEnd.text =
|
||||||
|
if (split.size == 2) split[1] else ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
|
@ -2,12 +2,20 @@ package com.dahe.gldriver.ui.account.authperson
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
|
import com.dahe.gldriver.bean.UpQualiInfoBean
|
||||||
import com.dahe.gldriver.databinding.ActivityAuthQualificationBinding
|
import com.dahe.gldriver.databinding.ActivityAuthQualificationBinding
|
||||||
|
import com.dahe.gldriver.net.BaseObserver
|
||||||
|
import com.dahe.gldriver.net.DataManager
|
||||||
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
import com.dahe.mylibrary.utils.PickerUtils
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
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 com.dahe.mylibrary.utils.ImageLoader
|
import com.dahe.mylibrary.utils.ImageLoader
|
||||||
import com.dahe.mylibrary.utils.PopsUtils
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName AuthQualificationActivity
|
* @ClassName AuthQualificationActivity
|
||||||
@ -16,26 +24,38 @@ import com.dahe.mylibrary.utils.PopsUtils
|
|||||||
* @Description 从业资格证认证
|
* @Description 从业资格证认证
|
||||||
*/
|
*/
|
||||||
class AuthQualificationActivity : BaseActivity<ActivityAuthQualificationBinding>() {
|
class AuthQualificationActivity : BaseActivity<ActivityAuthQualificationBinding>() {
|
||||||
|
|
||||||
|
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
|
||||||
|
var upQuaInfo = UpQualiInfoBean()
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("实名认证", true)
|
setTitleBar("实名认证", true)
|
||||||
binding.btnOk.setOnClickListener {
|
binding.btnOk.setOnClickListener {
|
||||||
ActivityUtils.startActivity(mContext, AuthBankCardActivity::class.java)
|
subMit()
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.run {
|
binding.run {
|
||||||
tvDate.run {
|
tvDate.run {
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthQualificationActivity,"选择有效期至") { year, month, day ->
|
.showDate(
|
||||||
|
this@AuthQualificationActivity,
|
||||||
|
"选择有效期至"
|
||||||
|
) { year, month, day ->
|
||||||
this.text = "$year-$month-$day"
|
this.text = "$year-$month-$day"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ivFront.setOnClickListener {
|
ivFront.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext){
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext,it[0].path,12,ivFront)
|
var data = it[0]
|
||||||
|
ossServiceUtil.asyncPutImage(data.realPath, this@AuthQualificationActivity)
|
||||||
|
ossServiceUtil.setResultCallBack { data, oldPath ->
|
||||||
|
upQuaInfo.qualificationCertificatePhotoUrl = oldPath
|
||||||
|
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -43,4 +63,21 @@ class AuthQualificationActivity : BaseActivity<ActivityAuthQualificationBinding>
|
|||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun subMit() {
|
||||||
|
upQuaInfo.run {
|
||||||
|
qualificationCertificateNo = binding.etId.text.toString()
|
||||||
|
qualificationCertificateEffectiveEnd = binding.tvDate.text.toString()
|
||||||
|
|
||||||
|
DataManager.getInstance().setUpDriverQualificationCertificate(upQuaInfo)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<String>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
ActivityUtils.startActivity(mContext, AuthBankCardActivity::class.java)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -2,7 +2,9 @@ package com.dahe.gldriver.ui.account.authperson
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
|
import com.dahe.gldriver.bean.UpQualiInfoBean
|
||||||
import com.dahe.gldriver.databinding.ActivityAuthRoadBinding
|
import com.dahe.gldriver.databinding.ActivityAuthRoadBinding
|
||||||
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
import com.dahe.gldriver.ui.account.SelectRoleActivity
|
import com.dahe.gldriver.ui.account.SelectRoleActivity
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
@ -18,6 +20,9 @@ import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener
|
|||||||
* @Description 道路运输许可证认证
|
* @Description 道路运输许可证认证
|
||||||
*/
|
*/
|
||||||
class AuthRoadActivity : BaseActivity<ActivityAuthRoadBinding>() {
|
class AuthRoadActivity : BaseActivity<ActivityAuthRoadBinding>() {
|
||||||
|
|
||||||
|
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
|
||||||
|
var upQuaInfo = UpQualiInfoBean()
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("实名认证",true)
|
setTitleBar("实名认证",true)
|
||||||
|
@ -2,14 +2,30 @@ package com.dahe.gldriver.ui.account.authteam
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.ImageView
|
|
||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
|
import com.dahe.gldriver.bean.AuthTeamBean
|
||||||
|
import com.dahe.gldriver.bean.OcrPersonBean
|
||||||
|
import com.dahe.gldriver.bean.UpPersonInfoBean
|
||||||
|
import com.dahe.gldriver.callback.PicPath
|
||||||
import com.dahe.gldriver.databinding.ActivityAuthTeamBinding
|
import com.dahe.gldriver.databinding.ActivityAuthTeamBinding
|
||||||
|
import com.dahe.gldriver.net.BaseObserver
|
||||||
|
import com.dahe.gldriver.net.DataManager
|
||||||
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
|
import com.dahe.gldriver.utils.OcrUtils
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
import com.dahe.mylibrary.utils.ImageLoader
|
import com.dahe.mylibrary.utils.ImageLoader
|
||||||
|
import com.dahe.mylibrary.utils.LoadingUtils
|
||||||
|
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.ToastUtils
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
import okhttp3.MediaType.Companion.toMediaTypeOrNull
|
||||||
|
import okhttp3.MultipartBody
|
||||||
|
import okhttp3.RequestBody.Companion.asRequestBody
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName AuthTeamActivity
|
* @ClassName AuthTeamActivity
|
||||||
@ -18,61 +34,159 @@ import com.dahe.mylibrary.utils.ToastUtils
|
|||||||
* @Description 个人车队认证
|
* @Description 个人车队认证
|
||||||
*/
|
*/
|
||||||
class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickListener {
|
class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickListener {
|
||||||
private var checkTeamType = 0 //0代表运输公司,1代表个人车队
|
private var checkTeamType = 0 //1代表运输公司,0代表个人车队
|
||||||
|
|
||||||
|
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
|
||||||
|
|
||||||
|
var upComInfoBean: AuthTeamBean = AuthTeamBean("1")//公司车队
|
||||||
|
var upPerInfoBean: AuthTeamBean = AuthTeamBean("0")//个人车队
|
||||||
|
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("身份认证", true)
|
setTitleBar("身份认证", true)
|
||||||
|
|
||||||
binding.run {
|
binding.run {
|
||||||
rgTeam.setOnCheckedChangeListener { _, i ->
|
rgTeam.setOnCheckedChangeListener { _, i ->
|
||||||
changeTeamType(if (i == binding.rbCom.id) 0 else 1)
|
changeTeamType(if (i == binding.rbCom.id) 1 else 0)
|
||||||
}
|
}
|
||||||
|
//营业执照选择。ocr识别
|
||||||
ivBusiness.setOnClickListener {
|
ivBusiness.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
OcrUtils.getInstance()
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBusiness)
|
.ocrBusinessCard(mContext, this@AuthTeamActivity) { picPath, result ->
|
||||||
}
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, picPath.locPic, 12, ivBusiness)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//运输公司 本人身份证
|
//运输公司 本人身份证
|
||||||
ivPerFront.setOnClickListener {
|
ivComFront.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
OcrUtils.getInstance()
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivPerFront)
|
.ocrPerson(mContext, this@AuthTeamActivity) { picPath, result ->
|
||||||
}
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, picPath.locPic, 12, ivComFront)
|
||||||
|
result.data.face?.data?.run {
|
||||||
|
etName.setText(name)
|
||||||
|
etId.setText(idNumber)
|
||||||
|
upComInfoBean.run {
|
||||||
|
idcardNo = idNumber
|
||||||
|
idcardName = name
|
||||||
|
idcardSex = if (sex == "男") "1" else "2"
|
||||||
|
idcardEthnicity = ethnicity
|
||||||
|
idcardFrontUrl = picPath.picPath
|
||||||
|
idcardAddress = address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ivPerBack.setOnClickListener {
|
ivComBack.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
OcrUtils.getInstance()
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivPerBack)
|
.ocrPerson(mContext, this@AuthTeamActivity) { picPath, result ->
|
||||||
}
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, picPath.locPic, 12, ivComBack)
|
||||||
|
result.data.back?.data?.run {
|
||||||
|
if (validPeriod.contains("-")) {
|
||||||
|
val split = validPeriod.split("-")
|
||||||
|
tvStart.text = split[0]
|
||||||
|
tvEnd.text = if (split.size == 2) split[1] else ""
|
||||||
|
upComInfoBean.run {
|
||||||
|
idcardEffectiveStart = split[0]
|
||||||
|
idcardEffectiveEnd = if (split.size == 2) split[1] else ""
|
||||||
|
idcardBackUrl = picPath.picPath
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//个人车队 本人身份证
|
//个人车队 本人身份证
|
||||||
ivFront.setOnClickListener {
|
ivFront.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
OcrUtils.getInstance()
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
|
.ocrPerson(mContext, this@AuthTeamActivity) { picPath, result ->
|
||||||
}
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, picPath.locPic, 12, ivFront)
|
||||||
|
result.data.face?.data?.run {
|
||||||
|
etPerName.setText(name)
|
||||||
|
etPerId.setText(idNumber)
|
||||||
|
|
||||||
|
upPerInfoBean.run {
|
||||||
|
idcardNo = idNumber
|
||||||
|
idcardName = name
|
||||||
|
idcardSex = if (sex == "男") "1" else "2"
|
||||||
|
idcardEthnicity = ethnicity
|
||||||
|
idcardFrontUrl = picPath.picPath
|
||||||
|
idcardAddress = address
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//个人车队 本人身份证
|
||||||
|
ivBack.setOnClickListener {
|
||||||
|
OcrUtils.getInstance()
|
||||||
|
.ocrPerson(mContext, this@AuthTeamActivity) { picPath, result ->
|
||||||
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, picPath.locPic, 12, ivBack)
|
||||||
|
result.data.back?.data?.run {
|
||||||
|
if (validPeriod.contains("-")) {
|
||||||
|
val split = validPeriod.split("-")
|
||||||
|
tvPerStart.text = split[0]
|
||||||
|
tvPerEnd.text = if (split.size == 2) split[1] else ""
|
||||||
|
|
||||||
|
upPerInfoBean.run {
|
||||||
|
idcardEffectiveStart = split[0]
|
||||||
|
idcardEffectiveEnd = if (split.size == 2) split[1] else ""
|
||||||
|
idcardBackUrl = picPath.picPath
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 个人银行卡
|
||||||
|
*/
|
||||||
ivBank.setOnClickListener {
|
ivBank.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
OcrUtils.getInstance()
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBank)
|
.ocrBankCard(mContext, this@AuthTeamActivity) { picPath, result ->
|
||||||
}
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, picPath.locPic, 12, ivBank)
|
||||||
|
result.data.run {
|
||||||
|
etPerBankId.setText(cardNumber)
|
||||||
|
tvPerBankName.setText(bankName)
|
||||||
|
upPerInfoBean.run {
|
||||||
|
captainBankcardNumber = cardNumber
|
||||||
|
captainBankcardPhotoUrl = picPath.picPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
//道路运输许可证
|
||||||
ivBank.setOnClickListener {
|
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBank)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ivRoad.setOnClickListener {
|
ivRoad.setOnClickListener {
|
||||||
PopsUtils.getInstance().showSimSelPic(mContext) {
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivRoad)
|
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivRoad)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//公司银行卡
|
||||||
|
ivComBank.setOnClickListener {
|
||||||
|
OcrUtils.getInstance()
|
||||||
|
.ocrBankCard(mContext, this@AuthTeamActivity) { picPath, result ->
|
||||||
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, picPath.locPic, 12, ivComBank)
|
||||||
|
result.data?.run {
|
||||||
|
binding.let {
|
||||||
|
it.etComBankId.setText(cardNumber)
|
||||||
|
it.etComBankName.setText(bankName)
|
||||||
|
}
|
||||||
|
upComInfoBean.run {
|
||||||
|
captainBankcardNumber = cardNumber
|
||||||
|
captainBankcardPhotoUrl = picPath.picPath
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tvComDate.setOnClickListener {
|
tvComDate.setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthTeamActivity, "请选择有效期至") { year, month, day ->
|
.showDate(this@AuthTeamActivity, "请选择有效期至") { year, month, day ->
|
||||||
@ -80,14 +194,15 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tvPerDate.setOnClickListener {
|
tvPerStart.setOnClickListener {
|
||||||
PickerUtils.getInstance()
|
PickerUtils.getInstance()
|
||||||
.showDate(this@AuthTeamActivity, "请选择有效期至") { year, month, day ->
|
.showDate(this@AuthTeamActivity, "请选择有效期至") { year, month, day ->
|
||||||
tvPerDate.text = "$year-$month-$day"
|
tvPerStart.text = "$year-$month-$day"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
btnOk.setOnClickListener(this@AuthTeamActivity)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
@ -95,7 +210,7 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
|
|||||||
|
|
||||||
private fun changeTeamType(type: Int) {
|
private fun changeTeamType(type: Int) {
|
||||||
checkTeamType = type
|
checkTeamType = type
|
||||||
if (0 == checkTeamType) {
|
if (1 == checkTeamType) {
|
||||||
binding.llCom.visibility = View.VISIBLE
|
binding.llCom.visibility = View.VISIBLE
|
||||||
binding.llPerson.visibility = View.GONE
|
binding.llPerson.visibility = View.GONE
|
||||||
} else {
|
} else {
|
||||||
@ -106,9 +221,106 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
|
|||||||
|
|
||||||
override fun onClick(view: View?) {
|
override fun onClick(view: View?) {
|
||||||
super.onClick(view)
|
super.onClick(view)
|
||||||
// when(view?.id){
|
when (view?.id) {
|
||||||
// binding.llCom.id->{}
|
binding.btnOk.id -> {
|
||||||
// }
|
DataManager.getInstance()
|
||||||
|
.authenticationCaptain(if (checkTeamType == 1) upComInfoBean else upPerInfoBean)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>(this) {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<String>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
binding.ivBusiness.id -> {}
|
||||||
|
binding.ivComFront.id -> {}
|
||||||
|
binding.ivComBack.id -> {}
|
||||||
|
binding.ivComBank.id -> {}
|
||||||
|
binding.tvComDate.id -> {}
|
||||||
|
binding.tvPerStart.id -> {}
|
||||||
|
binding.ivFront.id -> {}
|
||||||
|
binding.ivBack.id -> {}
|
||||||
|
binding.ivBank.id -> {}
|
||||||
|
binding.ivRoad.id -> {}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun subMit() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun selBankPic(picType: Int = 0) {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(mContext) { it ->
|
||||||
|
ossServiceUtil.run {
|
||||||
|
asyncPutImage(it[0].realPath, this@AuthTeamActivity)
|
||||||
|
setResultCallBack { data, oldPath ->
|
||||||
|
DataManager.getInstance().recognizeBankCard(oldPath)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
BaseObserver(mContext,
|
||||||
|
object : RxHttpCallBack<OcrPersonBean>(this@AuthTeamActivity) {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
t.data.data?.run {
|
||||||
|
// bankInfo.driverBankcardPhotoUrl = oldPath
|
||||||
|
|
||||||
|
binding.let {
|
||||||
|
it.etComBankId.setText(cardNumber)
|
||||||
|
it.etComBankName.setText(bankName)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImageLoader.getInstance()
|
||||||
|
.loadRoundImage(mContext, it[0].realPath, 12, binding.ivComBank)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun selPerPic() {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(mContext) {
|
||||||
|
|
||||||
|
ImageLoader.getInstance().loadRoundImage(mContext, it[0].realPath, 12, binding.ivFront)
|
||||||
|
|
||||||
|
ossServiceUtil.run {
|
||||||
|
asyncPutImage(it[0].realPath, this@AuthTeamActivity)
|
||||||
|
setResultCallBack { data, oldPath ->
|
||||||
|
DataManager.getInstance().recognizeIdcard(oldPath)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
BaseObserver(mContext,
|
||||||
|
object : RxHttpCallBack<OcrPersonBean>(this@AuthTeamActivity) {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
t.data.data.face?.data.let {
|
||||||
|
it?.run {
|
||||||
|
// perInfoBean.run {
|
||||||
|
// idcardNo = idNumber
|
||||||
|
// idcardName = name
|
||||||
|
// idcardSex = if (sex == "男") "1" else "2"
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
binding.run {
|
||||||
|
etName.setText(it?.idNumber)
|
||||||
|
etId.setText(it?.name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
143
app/src/main/java/com/dahe/gldriver/utils/OcrUtils.kt
Normal file
143
app/src/main/java/com/dahe/gldriver/utils/OcrUtils.kt
Normal file
@ -0,0 +1,143 @@
|
|||||||
|
package com.dahe.gldriver.utils
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import com.dahe.gldriver.bean.OcrPersonBean
|
||||||
|
import com.dahe.gldriver.callback.OnOcrPicResultListener
|
||||||
|
import com.dahe.gldriver.callback.PicPath
|
||||||
|
import com.dahe.gldriver.net.BaseObserver
|
||||||
|
import com.dahe.gldriver.net.DataManager
|
||||||
|
import com.dahe.gldriver.net.RxHttpCallBack
|
||||||
|
import com.dahe.gldriver.oss.OssServiceUtil
|
||||||
|
import com.dahe.mylibrary.base.SingletonNoPHolder
|
||||||
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
|
import com.dahe.mylibrary.utils.PopsUtils
|
||||||
|
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||||
|
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName OcrUtils
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/28 17:11
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
class OcrUtils private constructor() {
|
||||||
|
|
||||||
|
companion object : SingletonNoPHolder<OcrUtils>(::OcrUtils)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 身份证识别
|
||||||
|
* */
|
||||||
|
fun ocrPerson(context: Context, activity: AppCompatActivity, listener: OnOcrPicResultListener) {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(context) { result ->
|
||||||
|
//上传oss得到图片地址
|
||||||
|
OssServiceUtil.getInstance().run {
|
||||||
|
asyncPutImage(result[0].realPath, activity)
|
||||||
|
setResultCallBack { data, oldPath ->
|
||||||
|
DataManager.getInstance().recognizeIdcard(oldPath)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(context, object : RxHttpCallBack<OcrPersonBean>(activity) {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
t.data?.let {
|
||||||
|
listener.onSuccResult(
|
||||||
|
PicPath(result[0].realPath, oldPath), it
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 驾驶证ocr识别
|
||||||
|
* */
|
||||||
|
fun ocrDriver(context: Context, activity: AppCompatActivity, listener: OnOcrPicResultListener) {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(context) {result->
|
||||||
|
//上传oss得到图片地址
|
||||||
|
OssServiceUtil.getInstance().run {
|
||||||
|
asyncPutImage(result[0].realPath, activity)
|
||||||
|
setResultCallBack { data, oldPath ->
|
||||||
|
DataManager.getInstance().recognizeDrivingLicense(oldPath)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
BaseObserver(
|
||||||
|
context,
|
||||||
|
object : RxHttpCallBack<OcrPersonBean>(activity) {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
t.data?.let { listener.onSuccResult(PicPath(result[0].realPath, oldPath), it) }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 银行卡ocr识别
|
||||||
|
* */
|
||||||
|
fun ocrBankCard(
|
||||||
|
context: Context,
|
||||||
|
activity: AppCompatActivity,
|
||||||
|
listener: OnOcrPicResultListener
|
||||||
|
) {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(context) {result->
|
||||||
|
//上传oss得到图片地址
|
||||||
|
OssServiceUtil.getInstance().run {
|
||||||
|
asyncPutImage(result[0].realPath, activity)
|
||||||
|
setResultCallBack { data, oldPath ->
|
||||||
|
DataManager.getInstance().recognizeBankCard(oldPath)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
BaseObserver(
|
||||||
|
context,
|
||||||
|
object : RxHttpCallBack<OcrPersonBean>(activity) {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
t.data?.let { listener.onSuccResult(PicPath(result[0].realPath, oldPath), it) }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营业执照ocr识别
|
||||||
|
* */
|
||||||
|
fun ocrBusinessCard(
|
||||||
|
context: Context,
|
||||||
|
activity: AppCompatActivity,
|
||||||
|
listener: OnOcrPicResultListener
|
||||||
|
) {
|
||||||
|
PopsUtils.getInstance().showSimSelPic(context) {result->
|
||||||
|
//上传oss得到图片地址
|
||||||
|
OssServiceUtil.getInstance().run {
|
||||||
|
asyncPutImage(result[0].realPath, activity)
|
||||||
|
setResultCallBack { data, oldPath ->
|
||||||
|
DataManager.getInstance().recognizeBusinessLicense(oldPath)
|
||||||
|
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(
|
||||||
|
BaseObserver(
|
||||||
|
context,
|
||||||
|
object : RxHttpCallBack<OcrPersonBean>(activity) {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
t.data?.let { listener.onSuccResult(PicPath(result[0].realPath, oldPath), it) }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -17,7 +17,7 @@ class UserUtils private constructor(){
|
|||||||
if (null== SPUtils.instance.getUserInfo(context))
|
if (null== SPUtils.instance.getUserInfo(context))
|
||||||
return
|
return
|
||||||
// PushAgent.getInstance(context).deleteAlias(SPUtils.getUserInfo(context).userInfo.userId,"uid"){ b, s -> }
|
// PushAgent.getInstance(context).deleteAlias(SPUtils.getUserInfo(context).userInfo.userId,"uid"){ b, s -> }
|
||||||
BaseSPUtils.cleanUserInfo(context)
|
// BaseSPUtils.cleanUserInfo(context)
|
||||||
// val intent = Intent(context, LauncherActivity::class.java)
|
// val intent = Intent(context, LauncherActivity::class.java)
|
||||||
// intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
|
// intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
|
||||||
// context.startActivity(intent)
|
// context.startActivity(intent)
|
||||||
|
@ -96,6 +96,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etId"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
@ -124,6 +125,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tvBankName"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginLeft="@dimen/dp_8"
|
android:layout_marginLeft="@dimen/dp_8"
|
||||||
android:layout_marginBottom="@dimen/dp_22"
|
android:layout_marginBottom="@dimen/dp_22"
|
||||||
android:background="@drawable/driver_front"/>
|
android:background="@drawable/driver_front" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivBack"
|
android:id="@+id/ivBack"
|
||||||
@ -67,7 +67,7 @@
|
|||||||
android:layout_alignParentBottom="true"
|
android:layout_alignParentBottom="true"
|
||||||
android:layout_marginRight="@dimen/dp_8"
|
android:layout_marginRight="@dimen/dp_8"
|
||||||
android:layout_marginBottom="@dimen/dp_22"
|
android:layout_marginBottom="@dimen/dp_22"
|
||||||
android:background="@drawable/driver_back"/>
|
android:background="@drawable/driver_back" />
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
@ -113,15 +113,18 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etName"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
tools:text="王海生"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:background="@drawable/shape_phone_bg"
|
android:background="@drawable/shape_phone_bg"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
android:paddingLeft="@dimen/dp_10"
|
android:paddingLeft="@dimen/dp_10"
|
||||||
android:textSize="@dimen/sp_15"></EditText>
|
android:paddingRight="@dimen/dp_6"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="王海生"></EditText>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -131,24 +134,27 @@
|
|||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:drawableLeft="@drawable/start"
|
|
||||||
android:drawablePadding="@dimen/dp_2"
|
|
||||||
android:layout_width="@dimen/dp_70"
|
android:layout_width="@dimen/dp_70"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@drawable/start"
|
||||||
|
android:drawablePadding="@dimen/dp_2"
|
||||||
android:text="驾驶证号"
|
android:text="驾驶证号"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etId"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
tools:text="412826196205220056"
|
|
||||||
android:background="@drawable/shape_phone_bg"
|
android:background="@drawable/shape_phone_bg"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
android:paddingLeft="@dimen/dp_10"
|
android:paddingLeft="@dimen/dp_10"
|
||||||
|
android:paddingRight="@dimen/dp_6"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_15"></EditText>
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="412826196205220056"></EditText>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -166,18 +172,19 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvCarType"
|
android:id="@+id/tvCarType"
|
||||||
android:drawableRight="@drawable/right_gray"
|
|
||||||
android:drawablePadding="@dimen/dp_6"
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
tools:text="B1"
|
android:drawableRight="@drawable/right_gray"
|
||||||
android:textColor="@color/black"
|
android:drawablePadding="@dimen/dp_6"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
android:paddingLeft="@dimen/dp_10"
|
android:paddingLeft="@dimen/dp_10"
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="B1"></TextView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -193,19 +200,20 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvStart"
|
android:id="@+id/tvStart"
|
||||||
android:drawableRight="@drawable/right_gray"
|
|
||||||
android:drawablePadding="@dimen/dp_6"
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
tools:text="2020-05-23"
|
android:drawableRight="@drawable/right_gray"
|
||||||
|
android:drawablePadding="@dimen/dp_6"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
android:hint="请选择起始日期"
|
android:hint="请选择起始日期"
|
||||||
android:textColor="@color/black"
|
|
||||||
android:paddingLeft="@dimen/dp_10"
|
android:paddingLeft="@dimen/dp_10"
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="2020-05-23"></TextView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@ -221,18 +229,18 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvEnd"
|
android:id="@+id/tvEnd"
|
||||||
android:drawableRight="@drawable/right_gray"
|
|
||||||
android:drawablePadding="@dimen/dp_6"
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
tools:text="2020-05-23"
|
android:drawableRight="@drawable/right_gray"
|
||||||
|
android:drawablePadding="@dimen/dp_6"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
android:hint="请选择结束日期"
|
android:hint="请选择结束日期"
|
||||||
android:textColor="@color/black"
|
|
||||||
android:paddingLeft="@dimen/dp_10"
|
android:paddingLeft="@dimen/dp_10"
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="2020-05-23"></TextView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
@ -240,11 +248,10 @@
|
|||||||
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:background="@color/white"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
></View>
|
android:background="@color/white"></View>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -23,192 +23,317 @@
|
|||||||
android:textColor="#FF5F20"
|
android:textColor="#FF5F20"
|
||||||
android:textSize="@dimen/sp_14"></TextView>
|
android:textSize="@dimen/sp_14"></TextView>
|
||||||
|
|
||||||
|
<androidx.core.widget.NestedScrollView
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:id="@+id/cdPerson"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/dp_174"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
|
||||||
android:layout_marginTop="@dimen/dp_30"
|
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
|
||||||
app:cardBackgroundColor="@color/white"
|
|
||||||
app:cardCornerRadius="@dimen/dp_8">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="center_horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="@dimen/dp_14"
|
|
||||||
android:layout_marginTop="@dimen/dp_16"
|
|
||||||
android:text="上传行驶证(必填)"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="@dimen/sp_16"></TextView>
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/ivFront"
|
|
||||||
android:layout_width="@dimen/dp_155"
|
|
||||||
android:layout_height="@dimen/dp_97"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginLeft="@dimen/dp_8"
|
|
||||||
android:layout_marginBottom="@dimen/dp_22"
|
|
||||||
android:background="@drawable/driving_front"></ImageView>
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/ivBack"
|
|
||||||
android:layout_width="@dimen/dp_155"
|
|
||||||
android:layout_height="@dimen/dp_97"
|
|
||||||
android:layout_alignParentRight="true"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginRight="@dimen/dp_8"
|
|
||||||
android:layout_marginBottom="@dimen/dp_22"
|
|
||||||
android:background="@drawable/driving_back"></ImageView>
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/dp_174"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
|
||||||
android:layout_marginTop="@dimen/dp_12"
|
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
|
||||||
app:cardBackgroundColor="@color/white"
|
|
||||||
app:cardCornerRadius="@dimen/dp_8">
|
|
||||||
|
|
||||||
<RelativeLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:layout_gravity="center_horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="@dimen/dp_14"
|
|
||||||
android:layout_marginTop="@dimen/dp_16"
|
|
||||||
android:text="车辆照片(选填)"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="@dimen/sp_16"></TextView>
|
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/ivCar"
|
|
||||||
android:layout_width="@dimen/dp_155"
|
|
||||||
android:layout_height="@dimen/dp_97"
|
|
||||||
android:layout_alignParentBottom="true"
|
|
||||||
android:layout_marginLeft="@dimen/dp_12"
|
|
||||||
android:layout_marginBottom="@dimen/dp_22"
|
|
||||||
android:layout_centerHorizontal="true"
|
|
||||||
android:background="@drawable/car_photo"></ImageView>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_weight="1"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:fillViewport="true">
|
||||||
android:layout_marginTop="@dimen/dp_12"
|
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
|
||||||
app:cardBackgroundColor="@color/white"
|
|
||||||
app:cardCornerRadius="@dimen/dp_8">
|
|
||||||
|
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:orientation="vertical">
|
||||||
android:layout_marginLeft="@dimen/dp_14"
|
|
||||||
android:layout_marginRight="@dimen/dp_14"
|
|
||||||
android:paddingBottom="@dimen/dp_18">
|
|
||||||
|
|
||||||
<TextView
|
<androidx.cardview.widget.CardView
|
||||||
|
android:id="@+id/cdPerson"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_174"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_30"
|
||||||
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="@dimen/dp_8">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center_horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:text="上传行驶证(必填)"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16"></TextView>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivFront"
|
||||||
|
android:layout_width="@dimen/dp_155"
|
||||||
|
android:layout_height="@dimen/dp_97"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginLeft="@dimen/dp_8"
|
||||||
|
android:layout_marginBottom="@dimen/dp_22"
|
||||||
|
android:background="@drawable/driving_front"></ImageView>
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivBack"
|
||||||
|
android:layout_width="@dimen/dp_155"
|
||||||
|
android:layout_height="@dimen/dp_97"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_marginRight="@dimen/dp_8"
|
||||||
|
android:layout_marginBottom="@dimen/dp_22"
|
||||||
|
android:background="@drawable/driving_back"></ImageView>
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="@dimen/dp_174"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="@dimen/dp_8">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center_horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:text="车辆照片(选填)"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16"></TextView>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivCar"
|
||||||
|
android:layout_width="@dimen/dp_155"
|
||||||
|
android:layout_height="@dimen/dp_97"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:layout_marginLeft="@dimen/dp_12"
|
||||||
|
android:layout_marginBottom="@dimen/dp_22"
|
||||||
|
android:background="@drawable/car_photo"></ImageView>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_12"
|
||||||
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="@dimen/dp_8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
|
android:layout_marginRight="@dimen/dp_14"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="@dimen/dp_18">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:text="确认主要信息"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16"></TextView>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_20"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="@dimen/dp_70"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@drawable/start"
|
||||||
|
android:drawablePadding="@dimen/dp_2"
|
||||||
|
android:text="车牌号"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etCarNum"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入车牌号"
|
||||||
|
android:paddingRight="@dimen/dp_10"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="王海生"></EditText>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="@dimen/dp_70"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@drawable/start"
|
||||||
|
android:drawablePadding="@dimen/dp_2"
|
||||||
|
android:text="车辆类型"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCarType"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:drawableRight="@drawable/right_gray"
|
||||||
|
android:drawablePadding="@dimen/dp_6"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="重型栏板半挂车"
|
||||||
|
android:paddingLeft="@dimen/dp_10"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="@dimen/dp_100"
|
||||||
|
android:text="车辆所有人"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etOwner"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入车辆所有人"
|
||||||
|
android:paddingRight="@dimen/dp_10"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="王海生"></EditText>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="@dimen/dp_100"
|
||||||
|
android:text="使用性质"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etUseNature"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入车辆使用性质"
|
||||||
|
android:paddingRight="@dimen/dp_10"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="王海生"></EditText>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="@dimen/dp_120"
|
||||||
|
android:text="整备质量(kg)"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etCurbWeight"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入整备质量"
|
||||||
|
android:paddingRight="@dimen/dp_10"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="王海生"></EditText>
|
||||||
|
</LinearLayout>
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxWidth="@dimen/dp_150"
|
||||||
|
android:text="核定载重质量(kg)"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etPermittedWeight"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入核定载质量"
|
||||||
|
android:paddingRight="@dimen/dp_10"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="王海生"></EditText>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<View
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_16"
|
android:layout_marginTop="@dimen/dp_10" />
|
||||||
android:text="确认主要信息"
|
</LinearLayout>
|
||||||
android:textColor="@color/black"
|
</androidx.core.widget.NestedScrollView>
|
||||||
android:textSize="@dimen/sp_16"></TextView>
|
|
||||||
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/dp_54"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:drawableLeft="@drawable/start"
|
|
||||||
android:drawablePadding="@dimen/dp_2"
|
|
||||||
android:layout_width="@dimen/dp_70"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="车牌号"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
|
||||||
|
|
||||||
<EditText
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="@dimen/dp_34"
|
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
|
||||||
android:layout_weight="1"
|
|
||||||
tools:text="王海生"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:background="@drawable/shape_phone_bg"
|
|
||||||
android:paddingRight="@dimen/dp_10"
|
|
||||||
android:textSize="@dimen/sp_15"></EditText>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="@dimen/dp_104"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="@dimen/dp_70"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:drawableLeft="@drawable/start"
|
|
||||||
android:drawablePadding="@dimen/dp_2"
|
|
||||||
android:text="车辆类型"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="0dp"
|
|
||||||
android:layout_height="@dimen/dp_34"
|
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
|
||||||
android:layout_weight="1"
|
|
||||||
android:drawableRight="@drawable/right_gray"
|
|
||||||
android:drawablePadding="@dimen/dp_6"
|
|
||||||
android:gravity="right|center_vertical"
|
|
||||||
android:hint="重型栏板半挂车"
|
|
||||||
android:paddingLeft="@dimen/dp_10"
|
|
||||||
android:textColor="@color/black"
|
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
|
||||||
</androidx.cardview.widget.CardView>
|
|
||||||
|
|
||||||
|
|
||||||
<View
|
|
||||||
android:background="@color/white"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="0dp"
|
|
||||||
android:layout_weight="1"
|
|
||||||
></View>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="@dimen/dp_70"
|
android:layout_height="@dimen/dp_70"
|
||||||
|
@ -115,6 +115,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etName"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
@ -144,6 +145,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etId"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
@ -96,6 +96,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etId"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
@ -52,9 +52,9 @@
|
|||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/dp_40"
|
android:layout_height="@dimen/dp_40"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:checked="true"
|
|
||||||
android:background="@drawable/select_auth_team"
|
android:background="@drawable/select_auth_team"
|
||||||
android:button="@null"
|
android:button="@null"
|
||||||
|
android:checked="true"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:text="运输公司"
|
android:text="运输公司"
|
||||||
android:textColor="@drawable/select_auth_team_text"
|
android:textColor="@drawable/select_auth_team_text"
|
||||||
@ -66,11 +66,11 @@
|
|||||||
android:layout_height="@dimen/dp_40"
|
android:layout_height="@dimen/dp_40"
|
||||||
android:layout_marginLeft="@dimen/dp_12"
|
android:layout_marginLeft="@dimen/dp_12"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:checked="false"
|
|
||||||
android:background="@drawable/select_auth_team"
|
android:background="@drawable/select_auth_team"
|
||||||
android:text="个人车队"
|
|
||||||
android:gravity="center"
|
|
||||||
android:button="@null"
|
android:button="@null"
|
||||||
|
android:checked="false"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="个人车队"
|
||||||
android:textColor="@drawable/select_auth_team_text"
|
android:textColor="@drawable/select_auth_team_text"
|
||||||
android:textSize="@dimen/sp_15" />
|
android:textSize="@dimen/sp_15" />
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
@ -224,11 +224,106 @@
|
|||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
<androidx.cardview.widget.CardView
|
<androidx.cardview.widget.CardView
|
||||||
android:layout_marginTop="@dimen/dp_14"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginLeft="@dimen/dp_15"
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_15"
|
||||||
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
|
app:cardBackgroundColor="@color/white"
|
||||||
|
app:cardCornerRadius="@dimen/dp_8">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingBottom="@dimen/dp_16">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
|
android:layout_marginTop="@dimen/dp_16"
|
||||||
|
android:text="上传公司账户"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_16"></TextView>
|
||||||
|
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivComBank"
|
||||||
|
android:layout_width="@dimen/dp_155"
|
||||||
|
android:layout_height="@dimen/dp_97"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginTop="@dimen/dp_20"
|
||||||
|
android:background="@drawable/bank_card"></ImageView>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
|
android:layout_marginTop="@dimen/dp_26"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="@dimen/dp_90"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="银行卡号"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etComBankId"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_marginRight="@dimen/dp_8"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入银行卡号"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></EditText>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="@dimen/dp_70"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="开户银行"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etComBankName"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_marginRight="@dimen/dp_8"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请输入开户银行"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></EditText>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
|
<androidx.cardview.widget.CardView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:layout_marginLeft="@dimen/dp_15"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
android:layout_marginRight="@dimen/dp_15"
|
android:layout_marginRight="@dimen/dp_15"
|
||||||
app:cardBackgroundColor="@color/white"
|
app:cardBackgroundColor="@color/white"
|
||||||
app:cardCornerRadius="@dimen/dp_8">
|
app:cardCornerRadius="@dimen/dp_8">
|
||||||
@ -255,19 +350,19 @@
|
|||||||
android:layout_marginTop="@dimen/dp_20">
|
android:layout_marginTop="@dimen/dp_20">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivPerFront"
|
android:id="@+id/ivComFront"
|
||||||
android:layout_width="@dimen/dp_155"
|
android:layout_width="@dimen/dp_155"
|
||||||
android:layout_height="@dimen/dp_97"
|
android:layout_height="@dimen/dp_97"
|
||||||
android:layout_marginLeft="@dimen/dp_8"
|
android:layout_marginLeft="@dimen/dp_8"
|
||||||
android:background="@drawable/person_front"/>
|
android:background="@drawable/person_front" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/ivPerBack"
|
android:id="@+id/ivComBack"
|
||||||
android:layout_width="@dimen/dp_155"
|
android:layout_width="@dimen/dp_155"
|
||||||
android:layout_height="@dimen/dp_97"
|
android:layout_height="@dimen/dp_97"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:layout_marginRight="@dimen/dp_8"
|
android:layout_marginRight="@dimen/dp_8"
|
||||||
android:background="@drawable/person_back"/>
|
android:background="@drawable/person_back" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
|
||||||
@ -288,6 +383,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etName"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
@ -318,6 +414,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etId"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
@ -331,6 +428,7 @@
|
|||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/llStart"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="@dimen/dp_14"
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
@ -338,28 +436,63 @@
|
|||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="@dimen/dp_70"
|
android:layout_width="@dimen/dp_100"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:drawableLeft="@drawable/start"
|
android:drawableLeft="@drawable/start"
|
||||||
android:drawablePadding="@dimen/dp_2"
|
android:drawablePadding="@dimen/dp_2"
|
||||||
android:text="有效期限"
|
android:text="有效开始日期"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tvStart"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
android:layout_marginRight="@dimen/dp_8"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/shape_phone_bg"
|
android:background="@drawable/shape_phone_bg"
|
||||||
android:gravity="right|center_vertical"
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择开始日期"
|
||||||
android:paddingLeft="@dimen/dp_10"
|
android:paddingLeft="@dimen/dp_10"
|
||||||
android:paddingRight="@dimen/dp_10"
|
android:paddingRight="@dimen/dp_10"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_15"
|
android:textSize="@dimen/sp_15"
|
||||||
tools:text="1990-05-24 至 2020-05-23"/>
|
tools:text="1990-05-24"></TextView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_below="@+id/llStart"
|
||||||
|
android:layout_marginLeft="@dimen/dp_14"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="@dimen/dp_100"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@drawable/start"
|
||||||
|
android:drawablePadding="@dimen/dp_2"
|
||||||
|
android:text="有效结束日期"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvEnd"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/shape_phone_bg"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择结束日期"
|
||||||
|
android:paddingLeft="@dimen/dp_10"
|
||||||
|
android:paddingRight="@dimen/dp_10"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="1990-05-24"></TextView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
|
|
||||||
@ -421,13 +554,14 @@
|
|||||||
android:layout_marginBottom="@dimen/dp_22"
|
android:layout_marginBottom="@dimen/dp_22"
|
||||||
android:background="@drawable/person_back"></ImageView>
|
android:background="@drawable/person_back"></ImageView>
|
||||||
|
|
||||||
<RelativeLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@+id/ivFront"
|
android:layout_below="@+id/ivFront"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginLeft="@dimen/dp_8"
|
android:layout_marginLeft="@dimen/dp_8"
|
||||||
android:layout_marginRight="@dimen/dp_8"
|
android:layout_marginRight="@dimen/dp_8"
|
||||||
|
android:orientation="vertical"
|
||||||
android:paddingBottom="@dimen/dp_18">
|
android:paddingBottom="@dimen/dp_18">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -445,6 +579,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etPerName"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
@ -461,7 +596,7 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_50"
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
@ -474,6 +609,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etPerId"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
@ -490,34 +626,66 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="@dimen/dp_100"
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="@dimen/dp_70"
|
android:layout_width="@dimen/dp_100"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:drawableLeft="@drawable/start"
|
android:drawableLeft="@drawable/start"
|
||||||
android:drawablePadding="@dimen/dp_2"
|
android:drawablePadding="@dimen/dp_2"
|
||||||
android:text="有效期限"
|
android:text="有效开始日期"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvPerDate"
|
android:id="@+id/tvPerStart"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:background="@drawable/shape_phone_bg"
|
android:background="@drawable/shape_phone_bg"
|
||||||
android:gravity="right|center_vertical"
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择开始日期"
|
||||||
android:paddingLeft="@dimen/dp_10"
|
android:paddingLeft="@dimen/dp_10"
|
||||||
android:paddingRight="@dimen/dp_10"
|
android:paddingRight="@dimen/dp_10"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_15"
|
android:textSize="@dimen/sp_15"
|
||||||
tools:text="1990-05-24 至 2020-05-23"></TextView>
|
tools:text="1990-05-24"></TextView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="@dimen/dp_14"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="@dimen/dp_100"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:drawableLeft="@drawable/start"
|
||||||
|
android:drawablePadding="@dimen/dp_2"
|
||||||
|
android:text="有效结束日期"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvPerEnd"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="@dimen/dp_34"
|
||||||
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@drawable/shape_phone_bg"
|
||||||
|
android:gravity="right|center_vertical"
|
||||||
|
android:hint="请选择结束日期"
|
||||||
|
android:paddingLeft="@dimen/dp_10"
|
||||||
|
android:paddingRight="@dimen/dp_10"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/sp_15"
|
||||||
|
tools:text="1990-05-24"></TextView>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</androidx.cardview.widget.CardView>
|
</androidx.cardview.widget.CardView>
|
||||||
@ -550,11 +718,11 @@
|
|||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
android:id="@+id/ivBank"
|
||||||
android:layout_width="@dimen/dp_155"
|
android:layout_width="@dimen/dp_155"
|
||||||
android:layout_height="@dimen/dp_97"
|
android:layout_height="@dimen/dp_97"
|
||||||
android:layout_gravity="center_horizontal"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_marginTop="@dimen/dp_20"
|
android:layout_marginTop="@dimen/dp_20"
|
||||||
android:id="@+id/ivBank"
|
|
||||||
android:background="@drawable/bank_card"></ImageView>
|
android:background="@drawable/bank_card"></ImageView>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -572,6 +740,7 @@
|
|||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<EditText
|
<EditText
|
||||||
|
android:id="@+id/etPerBankId"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
@ -599,16 +768,18 @@
|
|||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></TextView>
|
||||||
|
|
||||||
<TextView
|
<EditText
|
||||||
|
android:id="@+id/tvPerBankName"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
android:layout_height="@dimen/dp_34"
|
android:layout_height="@dimen/dp_34"
|
||||||
android:layout_marginLeft="@dimen/dp_10"
|
android:layout_marginLeft="@dimen/dp_10"
|
||||||
android:layout_marginRight="@dimen/dp_8"
|
android:layout_marginRight="@dimen/dp_8"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
android:background="@null"
|
||||||
android:gravity="right|center_vertical"
|
android:gravity="right|center_vertical"
|
||||||
android:hint="请选择开户行"
|
android:hint="请选择开户行"
|
||||||
android:textColor="@color/black"
|
android:textColor="@color/black"
|
||||||
android:textSize="@dimen/sp_15"></TextView>
|
android:textSize="@dimen/sp_15"></EditText>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -67,6 +67,7 @@
|
|||||||
android:layout_height="@dimen/dp_45"
|
android:layout_height="@dimen/dp_45"
|
||||||
android:background="@drawable/shape_phone_bg"
|
android:background="@drawable/shape_phone_bg"
|
||||||
android:hint="请输入手机号"
|
android:hint="请输入手机号"
|
||||||
|
android:inputType="phone"
|
||||||
android:paddingLeft="@dimen/dp_20"></EditText>
|
android:paddingLeft="@dimen/dp_20"></EditText>
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +106,6 @@
|
|||||||
android:padding="@dimen/dp_7">
|
android:padding="@dimen/dp_7">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/cb"
|
android:id="@+id/cb"
|
||||||
android:layout_width="@dimen/dp_18"
|
android:layout_width="@dimen/dp_18"
|
||||||
|
@ -111,6 +111,7 @@ dependencies {
|
|||||||
// exclude(module: 'alicloud-android-utdid')
|
// exclude(module: 'alicloud-android-utdid')
|
||||||
// exclude(module: 'alicloud-android-utils')
|
// exclude(module: 'alicloud-android-utils')
|
||||||
// }
|
// }
|
||||||
api 'com.aliyun.dpa:oss-android-sdk:2.9.5'
|
// api 'com.aliyun.dpa:oss-android-sdk:2.9.5'
|
||||||
|
api 'com.aliyun.dpa:oss-android-sdk:2.9.13'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,6 @@ import android.os.Bundle;
|
|||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.RelativeLayout;
|
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.ColorRes;
|
import androidx.annotation.ColorRes;
|
||||||
@ -24,9 +22,10 @@ import androidx.viewbinding.ViewBinding;
|
|||||||
import com.dahe.mylibrary.R;
|
import com.dahe.mylibrary.R;
|
||||||
import com.dahe.mylibrary.callback.RefreshCallBack;
|
import com.dahe.mylibrary.callback.RefreshCallBack;
|
||||||
import com.dahe.mylibrary.utils.BarUtils;
|
import com.dahe.mylibrary.utils.BarUtils;
|
||||||
import com.dahe.mylibrary.utils.ConvertUtils;
|
import com.dahe.mylibrary.utils.LoadingUtils;
|
||||||
import com.dahe.mylibrary.utils.StatusBar;
|
import com.dahe.mylibrary.utils.StatusBar;
|
||||||
import com.dahe.mylibrary.utils.ToastUtils;
|
import com.dahe.mylibrary.utils.ToastUtils;
|
||||||
|
import com.lxj.xpopup.impl.LoadingPopupView;
|
||||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||||
import com.scwang.smart.refresh.layout.api.RefreshLayout;
|
import com.scwang.smart.refresh.layout.api.RefreshLayout;
|
||||||
import com.scwang.smart.refresh.layout.constant.RefreshState;
|
import com.scwang.smart.refresh.layout.constant.RefreshState;
|
||||||
@ -189,7 +188,7 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
|
|||||||
((TextView) findViewById(R.id.common_toolBar_title)).setTextColor(isWhite ? getColor(R.color.colorWhite) : getColor(R.color.black));
|
((TextView) findViewById(R.id.common_toolBar_title)).setTextColor(isWhite ? getColor(R.color.colorWhite) : getColor(R.color.black));
|
||||||
((TextView) findViewById(R.id.common_toolBar_title)).setText(title);
|
((TextView) findViewById(R.id.common_toolBar_title)).setText(title);
|
||||||
}
|
}
|
||||||
if (isWhite){
|
if (isWhite) {
|
||||||
StatusBar.cancelLightStatusBar(this);//图标文字白色
|
StatusBar.cancelLightStatusBar(this);//图标文字白色
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +229,7 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
|
|||||||
// llContent.setLayoutParams(closeLayoutParams);
|
// llContent.setLayoutParams(closeLayoutParams);
|
||||||
|
|
||||||
|
|
||||||
llContent.setPadding(0,BarUtils.getStatusBarHeight(),0,0);
|
llContent.setPadding(0, BarUtils.getStatusBarHeight(), 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void initView(Bundle savedInstanceState);
|
protected abstract void initView(Bundle savedInstanceState);
|
||||||
@ -255,6 +254,7 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
|
|||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
//释放持有,防止泄露
|
//释放持有,防止泄露
|
||||||
binding = null;
|
binding = null;
|
||||||
|
LoadingUtils.Companion.getInstance().dissLoading();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -334,5 +334,16 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
|
|||||||
super.onPause();
|
super.onPause();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoadingPopupView loadingPopup;
|
||||||
|
|
||||||
|
public void showLoading() {
|
||||||
|
// LoadingUtils3.Companion.getInstance(this).showLoading("网络请求中......");
|
||||||
|
LoadingUtils.Companion.getInstance().showLoading(this,"网络请求中......");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void dissLoading() {
|
||||||
|
// LoadingUtils3.Companion.getInstance(this).dissLoading();
|
||||||
|
LoadingUtils.Companion.getInstance().dissLoading();
|
||||||
|
}
|
||||||
}
|
}
|
@ -12,6 +12,8 @@ import org.json.JSONObject;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
|
import kotlin.Pair;
|
||||||
|
import okhttp3.Headers;
|
||||||
import okhttp3.Interceptor;
|
import okhttp3.Interceptor;
|
||||||
import okhttp3.MediaType;
|
import okhttp3.MediaType;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
|
@ -50,7 +50,7 @@ class PopNorBottomPic(
|
|||||||
// .setCameraInterceptListener(getCustomCameraEvent())//自定义相机
|
// .setCameraInterceptListener(getCustomCameraEvent())//自定义相机
|
||||||
// .setRecordAudioInterceptListener(MainActivity.MeOnRecordAudioInterceptListener())//录音回调事件
|
// .setRecordAudioInterceptListener(MainActivity.MeOnRecordAudioInterceptListener())//录音回调事件
|
||||||
// .setCropEngine(ImageFileCropEngine())//裁剪
|
// .setCropEngine(ImageFileCropEngine())//裁剪
|
||||||
.setCompressEngine(ImageFileCompressEngine())//压缩
|
// .setCompressEngine(ImageFileCompressEngine())//压缩
|
||||||
|
|
||||||
// .setSelectLimitTipsListener(MainActivity.MeOnSelectLimitTipsListener())//拦截自定义提示
|
// .setSelectLimitTipsListener(MainActivity.MeOnSelectLimitTipsListener())//拦截自定义提示
|
||||||
// .setAddBitmapWatermarkListener(getAddBitmapWatermarkListener())//给图片添加水印
|
// .setAddBitmapWatermarkListener(getAddBitmapWatermarkListener())//给图片添加水印
|
||||||
|
@ -51,13 +51,25 @@ public class ActivityUtils {
|
|||||||
*/
|
*/
|
||||||
public static void startPushActivity(@NonNull Context context, @NonNull Class<?> clz, Bundle bundle) {
|
public static void startPushActivity(@NonNull Context context, @NonNull Class<?> clz, Bundle bundle) {
|
||||||
Intent intent = new Intent(context, clz);
|
Intent intent = new Intent(context, clz);
|
||||||
if (null != bundle){
|
if (null != bundle) {
|
||||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
intent.putExtras(bundle);
|
intent.putExtras(bundle);
|
||||||
}
|
}
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启动Activity
|
||||||
|
*
|
||||||
|
* @param context
|
||||||
|
* @param clz
|
||||||
|
*/
|
||||||
|
public static void startHomeActivity(@NonNull Context context, @NonNull Class<?> clz) {
|
||||||
|
Intent intent = new Intent(context, clz);
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK & Intent.FLAG_ACTIVITY_CLEAR_TASK);
|
||||||
|
context.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 启动Activity
|
* 启动Activity
|
||||||
*
|
*
|
||||||
@ -265,7 +277,7 @@ public class ActivityUtils {
|
|||||||
finishActivity(aActivity);
|
finishActivity(aActivity);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}else{
|
} else {
|
||||||
finishActivity(aActivity);
|
finishActivity(aActivity);
|
||||||
}
|
}
|
||||||
// finishActivity(aActivity);
|
// finishActivity(aActivity);
|
||||||
@ -310,6 +322,21 @@ public class ActivityUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清除除本activity之外所有的activity
|
||||||
|
*
|
||||||
|
* @param clz 本activity的类名
|
||||||
|
*/
|
||||||
|
public static void finishOtherActivitiesToNew(Context context,@NonNull final Class<?> clz) {
|
||||||
|
List<Activity> activities = CommonBaseLibrary.activityList;
|
||||||
|
for (Activity activity : activities) {
|
||||||
|
if (!activity.getClass().equals(clz)) {
|
||||||
|
finishActivity(activity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
startActivity(context,clz);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结束所有activity
|
* 结束所有activity
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.dahe.mylibrary.utils
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import com.lxj.xpopup.XPopup
|
||||||
|
import com.lxj.xpopup.impl.LoadingPopupView
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName LoadingUtils
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/29 11:10
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
class LoadingUtils private constructor() {
|
||||||
|
var loadingPopup: LoadingPopupView? = null
|
||||||
|
lateinit var activity: AppCompatActivity
|
||||||
|
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
val instance = Holder.holder
|
||||||
|
}
|
||||||
|
|
||||||
|
object Holder {
|
||||||
|
val holder = LoadingUtils()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun init(activity: AppCompatActivity, message: String = "网络请求中......"): LoadingPopupView? {
|
||||||
|
loadingPopup = XPopup.Builder(activity)
|
||||||
|
.dismissOnBackPressed(false)
|
||||||
|
.isLightNavigationBar(true)
|
||||||
|
.asLoading(message, LoadingPopupView.Style.ProgressBar)
|
||||||
|
|
||||||
|
return loadingPopup
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showLoading(activity: AppCompatActivity, message: String = "网络请求中......") {
|
||||||
|
if (!activity.isDestroyed)
|
||||||
|
loadingPopup = XPopup.Builder(activity)
|
||||||
|
.dismissOnBackPressed(true)
|
||||||
|
.isLightNavigationBar(true)
|
||||||
|
.asLoading(message, LoadingPopupView.Style.ProgressBar)
|
||||||
|
.show() as LoadingPopupView
|
||||||
|
}
|
||||||
|
|
||||||
|
fun dissLoading() {
|
||||||
|
if (loadingPopup != null && loadingPopup!!.isShow) {
|
||||||
|
loadingPopup!!.dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun isShow() = loadingPopup?.isShow
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.dahe.mylibrary.utils
|
||||||
|
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import com.dahe.mylibrary.base.SingletonHolder
|
||||||
|
import com.lxj.xpopup.XPopup
|
||||||
|
import com.lxj.xpopup.impl.LoadingPopupView
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ClassName LoadingUtils
|
||||||
|
* @Author john
|
||||||
|
* @Date 2024/2/29 11:10
|
||||||
|
* @Description TODO
|
||||||
|
*/
|
||||||
|
class LoadingUtils3 private constructor(activity: AppCompatActivity) {
|
||||||
|
var loadingPopup: LoadingPopupView? = null
|
||||||
|
lateinit var activity: AppCompatActivity
|
||||||
|
|
||||||
|
companion object : SingletonHolder<LoadingUtils3, AppCompatActivity>(::LoadingUtils3)
|
||||||
|
|
||||||
|
init {
|
||||||
|
this.activity = activity
|
||||||
|
}
|
||||||
|
|
||||||
|
fun init(message: String = "网络请求中......"): LoadingPopupView? {
|
||||||
|
if (loadingPopup == null) {
|
||||||
|
loadingPopup = XPopup.Builder(activity)
|
||||||
|
.dismissOnBackPressed(false)
|
||||||
|
.isLightNavigationBar(true)
|
||||||
|
.asLoading(message, LoadingPopupView.Style.ProgressBar)
|
||||||
|
}
|
||||||
|
|
||||||
|
return loadingPopup
|
||||||
|
}
|
||||||
|
|
||||||
|
fun showLoading(message: String = "网络请求中......") {
|
||||||
|
loadingPopup = XPopup.Builder(activity)
|
||||||
|
.dismissOnBackPressed(false)
|
||||||
|
.isLightNavigationBar(true)
|
||||||
|
.asLoading(message, LoadingPopupView.Style.ProgressBar)
|
||||||
|
.show() as LoadingPopupView
|
||||||
|
}
|
||||||
|
|
||||||
|
fun dissLoading() {
|
||||||
|
if (loadingPopup != null && loadingPopup!!.isShow) {
|
||||||
|
loadingPopup!!.dismiss()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun isShow() = loadingPopup?.isShow
|
||||||
|
|
||||||
|
}
|
@ -2,7 +2,6 @@ package com.dahe.mylibrary.utils
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.dahe.mylibrary.adapter.GridImageAdapter
|
import com.dahe.mylibrary.adapter.GridImageAdapter
|
||||||
import com.dahe.mylibrary.base.SingletonHolder
|
|
||||||
import com.dahe.mylibrary.base.SingletonNoPHolder
|
import com.dahe.mylibrary.base.SingletonNoPHolder
|
||||||
import com.dahe.mylibrary.callback.OnPicResultListener
|
import com.dahe.mylibrary.callback.OnPicResultListener
|
||||||
import com.dahe.mylibrary.pop.PopBottomPic
|
import com.dahe.mylibrary.pop.PopBottomPic
|
||||||
|
Loading…
Reference in New Issue
Block a user