任务详情页车门开锁,后备箱开锁接口更改
巡游打卡打卡完成弹窗交互优化
登录页协议查看接口更改
| | |
| | | manifestPlaceholders["APP_NAME"] = "@string/app_name_dev" |
| | | manifestPlaceholders["icon"] = "@mipmap/ic_launcher" |
| | | |
| | | buildConfigField("String", "API_HOST", "\"http://192.168.110.111:8000/\"") |
| | | buildConfigField("String", "API_HOST", "\"http://221.182.45.100:8000/\"") |
| | | buildConfigField("String", "WS_URL", "\"ws://192.168.110.34:8888/websocket\"") |
| | | } |
| | | create("local") { // 本地环境 |
| | |
| | | val id: String, |
| | | val content: String, |
| | | val type: Int, |
| | | val webType: Int = 1, |
| | | val version: String |
| | | ) |
| | |
| | | /*获取协议配置 */ |
| | | @GET("operation/maintenance-app/base/v1/loginAgreement/getLoginAgreementList") |
| | | fun getAgreeConfig(): Call<HttpResponse<List<AgreeInfo>>> |
| | | |
| | | /*获取登录协议*/ |
| | | @GET("operation/maintenance-app/base/v1/privacy/getAppContentById/{id}") |
| | | fun getLoginProtocol(@Path("id") id: Int): Call<HttpResponse<WebContentModel>> |
| | | } |
| | |
| | | |
| | | fun getUserInfo() = flow { emit(api.getUserInfo().interceptAwait()) } |
| | | |
| | | |
| | | /*获取登录协议*/ |
| | | suspend fun getLoginProtocol(id: Int) = api.getLoginProtocol(id).interceptAwait() |
| | | } |
| | |
| | | fun vehicleDispatchDeparture(@Body body: RequestBody): Call<HttpResponse<CarModel>> |
| | | |
| | | /* 车辆运维-车门解锁/后备箱解锁 */ |
| | | @POST("vehicleConvoy/maintenance-app/api/v1/vehicle/unlockByType") |
| | | @POST("vehicleConvoy/maintenance-app/api/v1/vehicle/unlockDoor") |
| | | fun unlockByType(@Body body: RequestBody): Call<HttpResponse<CarModel>> |
| | | |
| | | /* 车辆运维-车辆运维-车辆整备 */ |
| | |
| | | fun getCheckInMissionPointsList(@Path("id") id: String): Call<HttpResponse<List<CheckInMissionPointInfo>>> |
| | | |
| | | /* 巡游打卡操作 */ |
| | | @GET("maintenance/maintenance-app/api/v1/cruiseCheckInRule/saveCruiseCheckInRecord") |
| | | @POST("maintenance/maintenance-app/api/v1/cruiseCheckInRule/saveCruiseCheckInRecord") |
| | | fun saveCruiseCheckInRecord(@Body params: RequestBody): Call<HttpResponse<List<CheckInMissionPointInfo>>> |
| | | } |
| | |
| | | fun show( |
| | | context: Context, |
| | | result: CruiseCheckInOperationResult |
| | | ) { |
| | | ): MaterialDialog { |
| | | val dialog = MaterialDialog(context).apply { |
| | | customView( |
| | | R.layout.dialog_cruise_check_in_success, |
| | |
| | | dialog.show() |
| | | dialog.window?.setGravity(Gravity.CENTER) |
| | | dialog.window?.setWindowAnimations(com.xw.common.R.style.AnimLeft) |
| | | return dialog |
| | | } |
| | | } |
| | |
| | | }) { |
| | | val map = mutableMapOf<String, Any?>() |
| | | map["vehicleId"] = taskDetail.value?.vehicleId // 车辆ID |
| | | map["unlockType"] = type // 解锁类型 1车门 2后备箱 |
| | | map["latitude"] = com.xw.common.Constants.latitude |
| | | map["longitude"] = com.xw.common.Constants.longitude |
| | | map["doorType"] = if (type == 1) "door" else "trunk" // 解锁类型 1车门 2后备箱 |
| | | workRepository.unlockByType(map) |
| | | val tips = if (type == 1) "车门已解锁" else "后备箱已解锁" |
| | | ToastUtilCommon.showSuc(tips) |
| | |
| | | import android.text.TextPaint |
| | | import android.text.method.LinkMovementMethod |
| | | import android.text.style.ClickableSpan |
| | | import android.view.Gravity |
| | | import android.view.View |
| | | import androidx.core.os.bundleOf |
| | | import androidx.lifecycle.Observer |
| | |
| | | override fun onClick(widget: View) { |
| | | startActivity( |
| | | StandardDescriptionActivity::class.java, |
| | | bundleOf("type" to it.type, "webType" to it.webType) |
| | | bundleOf("type" to it.id.toInt(), "webType" to 1) |
| | | ) |
| | | } |
| | | |
| | |
| | | agreeBold = false, |
| | | agreeTextColor = R.color.gray_9 |
| | | ), |
| | | contentTextGravity = Gravity.START, |
| | | leftOperationText = "不同意", |
| | | rightOperationText = "同意", |
| | | rightOperationBlock = { |
| | |
| | | }) { |
| | | val map = mutableMapOf<String, Any?>() |
| | | map["vehicleId"] = carInfo.value?.id // 车辆ID |
| | | map["unlockType"] = type // 解锁类型 1车门 2后备箱 |
| | | map["latitude"] = com.xw.common.Constants.latitude |
| | | map["longitude"] = com.xw.common.Constants.longitude |
| | | map["doorType"] = if (type == 1) "door" else "trunk" // 解锁类型 1车门 2后备箱 |
| | | workRepository.unlockByType(map) |
| | | val tips = if (type == 1) "车门已解锁" else "后备箱已解锁" |
| | | ToastUtilCommon.showSuc(tips) |
| | |
| | | viewModel.getDesc(type) |
| | | } else { |
| | | binding.title.text = "协议内容" |
| | | viewModel.getProtocol(type) |
| | | viewModel.getLoginProtocol(type) |
| | | } |
| | | initWeb(binding.web) |
| | | binding.back.setOnClickListener { onBackPressedHandel() } |
| | |
| | | } |
| | | } |
| | | |
| | | fun getLoginProtocol(type: Int) { |
| | | launchRequest(showLoading = false) { |
| | | userRepository.getLoginProtocol(type)?.let { |
| | | data.postValue(it.content?:"") |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | //显示巡游打卡成功弹窗 |
| | | private fun showCruiseCheckInSuccessDialog(event: CruiseCheckInOperationResult) { |
| | | CruiseCheckInSuccessDialog.show(this, event) |
| | | CruiseCheckInSuccessDialog.show(this, event).apply { |
| | | setOnDismissListener { |
| | | if (viewModel.getNextPoint() == null) { |
| | | finish() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | val countNotice: MutableLiveData<String> = |
| | | MutableLiveData("${desc.value?.length ?: 0}/${maxLength.value}") |
| | | val noticeLabel: MutableLiveData<String> = MutableLiveData("最多输入${maxLength.value}字") |
| | | val pictureMax = MutableLiveData(9) |
| | | val pictureMax = MutableLiveData(6) |
| | | |
| | | //操作图片 |
| | | val operationPictures: MutableLiveData<MutableList<String>> = MutableLiveData(mutableListOf("")) |
| | |
| | | <!-- show="@{viewModel.taskDetail.status == 1}"--> |
| | | <LinearLayout |
| | | android:baselineAligned="false" |
| | | android:visibility="gone" |
| | | tools:visibility="visible" |
| | | android:layout_width="match_parent" |
| | | android:layout_height="wrap_content" |
| | | android:orientation="horizontal"> |
| | |
| | | content: CharSequence, |
| | | contentTextSize: Float = 14f, |
| | | contentTextColor: Int = R.color.gray_9, |
| | | contentTextGravity: Int = Gravity.CENTER, |
| | | leftOperationText: String? = "取消", |
| | | leftOperationTextSize: Float = 16f, |
| | | leftOperationTextColor: Int = R.color.gray_10, |
| | |
| | | tvContent.movementMethod = LinkMovementMethod.getInstance() |
| | | tvContent.setTextSize(TypedValue.COMPLEX_UNIT_SP, contentTextSize) |
| | | tvContent.setTextColor(ContextCompat.getColor(context, contentTextColor)) |
| | | tvContent.gravity = contentTextGravity |
| | | btnLeft.text = leftOperationText ?: "" |
| | | btnLeft.setTextSize(TypedValue.COMPLEX_UNIT_SP, leftOperationTextSize) |
| | | btnLeft.setTextColor(ContextCompat.getColor(context, leftOperationTextColor)) |