feat: 国际进出港 5 个列表页侧滑新增海关回执查看
原始舱单、进港理货、出港运抵、出港装载、出港理货主单卡片 新增侧滑「回执」按钮,调用各模块 getResponse 接口后跳转 module_base 共用的只读回执页。请求同时传 prefix、no 与 wbNo,回执优先取 data、为空再取 msg,兼容后端实际返回; 回执为空时提示「暂无海关回执」不跳转。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -346,6 +346,9 @@ interface Constant {
|
|||||||
|
|
||||||
// 数据
|
// 数据
|
||||||
const val DATA = "data"
|
const val DATA = "data"
|
||||||
|
|
||||||
|
// 页面标题
|
||||||
|
const val TITLE = "title"
|
||||||
const val POSITION = "position"
|
const val POSITION = "position"
|
||||||
|
|
||||||
// 单号
|
// 单号
|
||||||
|
|||||||
@@ -148,6 +148,14 @@ interface Api {
|
|||||||
@POST
|
@POST
|
||||||
suspend fun singleStringPost(@Url url: String): BaseResultBean<String>
|
suspend fun singleStringPost(@Url url: String): BaseResultBean<String>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取海关回执(国际进港原始舱单/进港理货/出港运抵/出港装载/出港理货 共用)
|
||||||
|
* url:XXX/getResponse,body 传 prefix、no 与拼接的 wbNo(后端实测按 prefix + no 匹配),
|
||||||
|
* 回执文本实测在 msg 字段、data 为 null,取值见 CustomsResponseKtx.showCustomsResponse
|
||||||
|
*/
|
||||||
|
@POST
|
||||||
|
suspend fun getCustomsResponse(@Url url: String, @Body data: RequestBody): BaseResultBean<String>
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
suspend fun anyGetForId(@Url url: String, @Query("id") id: String): BaseResultBean<Any>
|
suspend fun anyGetForId(@Url url: String, @Query("id") id: String): BaseResultBean<Any>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.lukouguoji.module_base.ktx
|
||||||
|
|
||||||
|
import com.lukouguoji.module_base.base.BaseViewModel
|
||||||
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
|
import com.lukouguoji.module_base.ui.page.customs.CustomsResponseActivity
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 海关回执接口地址(各页面对应各自模块的 getResponse)
|
||||||
|
*/
|
||||||
|
object CustomsResponseUrl {
|
||||||
|
const val INT_IMP_AIR_MANIFEST = "IntImpAirManifest/getResponse" // 国际进港原始舱单
|
||||||
|
const val INT_IMP_TALLY = "IntImpTally/getResponse" // 国际进港理货
|
||||||
|
const val INT_EXP_ARRIVE = "IntExpArrive/getResponse" // 国际出港运抵
|
||||||
|
const val INT_EXP_LOAD = "IntExpLoad/getResponse" // 国际出港装载
|
||||||
|
const val INT_EXP_TALLY = "IntExpTally/getResponse" // 国际出港理货
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表项侧滑「回执」按钮的 onItemClick type
|
||||||
|
* 现有取值为 0/1/2、101~103、1000~3000 及 view id,9001 与之均不冲突
|
||||||
|
*/
|
||||||
|
const val ITEM_CLICK_TYPE_CUSTOMS_RESPONSE = 9001
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询海关回执并跳转只读详情页
|
||||||
|
* - 带 Loading 调用 [url],本期只查主单,不传 hno
|
||||||
|
* - 请求体同时传 prefix、no 与拼接后的 wbNo:测试环境实测后端按 prefix + no 匹配,
|
||||||
|
* 只传 wbNo 会查不到(与文档「运单号必填」描述不一致)
|
||||||
|
* - 回执文本实测放在 msg 字段(data 恒为 null),这里优先取 data、为空再取 msg,兼容两种返回
|
||||||
|
* - 回执为空时提示「暂无海关回执」,不跳转
|
||||||
|
* - 接口失败由 launchLoadingCollect 默认 Toast 错误信息
|
||||||
|
*/
|
||||||
|
fun BaseViewModel.showCustomsResponse(url: String, prefix: String?, no: String?, title: String) {
|
||||||
|
if (prefix.isNullOrEmpty() || no.isNullOrEmpty()) {
|
||||||
|
showToast("运单号为空")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
val params = mapOf(
|
||||||
|
"wbNo" to prefix + no,
|
||||||
|
"prefix" to prefix,
|
||||||
|
"no" to no
|
||||||
|
).toRequestBody()
|
||||||
|
launchLoadingCollect({ NetApply.api.getCustomsResponse(url, params) }) {
|
||||||
|
onSuccess = { result ->
|
||||||
|
val content = result.data?.ifEmpty { null } ?: result.msg ?: ""
|
||||||
|
if (content.isEmpty()) {
|
||||||
|
showToast("暂无海关回执")
|
||||||
|
} else {
|
||||||
|
CustomsResponseActivity.start(getTopActivity(), title, content)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.lukouguoji.module_base.ui.page.customs
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.os.Bundle
|
||||||
|
import com.lukouguoji.module_base.R
|
||||||
|
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||||
|
import com.lukouguoji.module_base.common.Constant
|
||||||
|
import com.lukouguoji.module_base.databinding.ActivityCustomsResponseBinding
|
||||||
|
import com.lukouguoji.module_base.impl.EmptyViewModel
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 海关回执详情页(只读)
|
||||||
|
* 回执文本由 Intent 传入,页面内不调接口;UI 参照国际进港电报详情页
|
||||||
|
*/
|
||||||
|
class CustomsResponseActivity :
|
||||||
|
BaseBindingActivity<ActivityCustomsResponseBinding, EmptyViewModel>() {
|
||||||
|
|
||||||
|
override fun layoutId() = R.layout.activity_customs_response
|
||||||
|
|
||||||
|
override fun viewModelClass() = EmptyViewModel::class.java
|
||||||
|
|
||||||
|
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||||
|
setBackArrow(intent.getStringExtra(Constant.Key.TITLE) ?: "海关回执")
|
||||||
|
|
||||||
|
binding.etContent.apply {
|
||||||
|
setText(intent.getStringExtra(Constant.Key.DATA) ?: "")
|
||||||
|
// 只读:不可输入、无光标,但仍可长按选择复制
|
||||||
|
keyListener = null
|
||||||
|
isFocusable = false
|
||||||
|
isFocusableInTouchMode = false
|
||||||
|
isCursorVisible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun start(context: Context, title: String, content: String) {
|
||||||
|
context.startActivity(
|
||||||
|
Intent(context, CustomsResponseActivity::class.java)
|
||||||
|
.putExtra(Constant.Key.TITLE, title)
|
||||||
|
.putExtra(Constant.Key.DATA, content)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -34,6 +34,13 @@
|
|||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:screenOrientation="userLandscape" />
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
|
<!-- 海关回执(只读) -->
|
||||||
|
<activity
|
||||||
|
android:name=".ui.page.customs.CustomsResponseActivity"
|
||||||
|
android:configChanges="orientation|keyboardHidden"
|
||||||
|
android:exported="false"
|
||||||
|
android:screenOrientation="userLandscape" />
|
||||||
|
|
||||||
<!-- 屏幕适配 -->
|
<!-- 屏幕适配 -->
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="design_width_in_dp"
|
android:name="design_width_in_dp"
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<data />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/color_f2"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 标题栏 -->
|
||||||
|
<include layout="@layout/title_tool_bar" />
|
||||||
|
|
||||||
|
<!-- 回执内容区域(只读,可滚动、可长按复制) -->
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/etContent"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:layout_margin="20dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:gravity="top|start"
|
||||||
|
android:inputType="textMultiLine"
|
||||||
|
android:lineSpacingExtra="4dp"
|
||||||
|
android:overScrollMode="always"
|
||||||
|
android:padding="20dp"
|
||||||
|
android:scrollbars="vertical"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="16sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</layout>
|
||||||
@@ -9,6 +9,7 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
|||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
import com.lukouguoji.module_base.bean.GjcMaWb
|
||||||
import com.lukouguoji.module_base.ktx.refresh
|
import com.lukouguoji.module_base.ktx.refresh
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际出港-出港运抵 列表项ViewHolder
|
* 国际出港-出港运抵 列表项ViewHolder
|
||||||
@@ -22,6 +23,12 @@ class IntExpArriveViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
|
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||||
|
binding.btnResponse.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||||
|
}
|
||||||
|
|
||||||
// 添加图标点击事件 - 切换选择状态
|
// 添加图标点击事件 - 切换选择状态
|
||||||
binding.ivIcon.setOnClickListener {
|
binding.ivIcon.setOnClickListener {
|
||||||
bean.checked.set(!bean.checked.get())
|
bean.checked.set(!bean.checked.get())
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.lukouguoji.module_base.base.BaseViewHolder
|
|||||||
import com.lukouguoji.module_base.common.ConstantEvent
|
import com.lukouguoji.module_base.common.ConstantEvent
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.bean.GjcExportLoad
|
import com.lukouguoji.module_base.bean.GjcExportLoad
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际出港-出港装载 列表项ViewHolder
|
* 国际出港-出港装载 列表项ViewHolder
|
||||||
@@ -19,6 +20,12 @@ class IntExpLoadViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
|
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||||
|
binding.btnResponse.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||||
|
}
|
||||||
|
|
||||||
// 添加图标点击事件 - 切换选择状态
|
// 添加图标点击事件 - 切换选择状态
|
||||||
binding.ivIcon.setOnClickListener {
|
binding.ivIcon.setOnClickListener {
|
||||||
// 反转checked状态
|
// 反转checked状态
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
|||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
import com.lukouguoji.module_base.bean.GjcMaWb
|
||||||
import com.lukouguoji.module_base.ktx.refresh
|
import com.lukouguoji.module_base.ktx.refresh
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际出港-出港理货 ViewHolder
|
* 国际出港-出港理货 ViewHolder
|
||||||
@@ -22,6 +23,12 @@ class IntExpTallyViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
|
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||||
|
binding.btnResponse.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||||
|
}
|
||||||
|
|
||||||
// 图标点击切换选择状态(主单和分单独立,互不干扰)
|
// 图标点击切换选择状态(主单和分单独立,互不干扰)
|
||||||
binding.ivIcon.setOnClickListener {
|
binding.ivIcon.setOnClickListener {
|
||||||
bean.checked.set(!bean.checked.get())
|
bean.checked.set(!bean.checked.get())
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
|||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
|
import com.lukouguoji.module_base.ktx.CustomsResponseUrl
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
|
import com.lukouguoji.module_base.ktx.showCustomsResponse
|
||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
@@ -344,4 +347,14 @@ class IntExpArriveViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表项点击分发:侧滑「回执」按钮 → 查询海关回执并跳转只读详情页
|
||||||
|
*/
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? GjcMaWb ?: return
|
||||||
|
if (type == ITEM_CLICK_TYPE_CUSTOMS_RESPONSE) {
|
||||||
|
showCustomsResponse(CustomsResponseUrl.INT_EXP_ARRIVE, bean.prefix, bean.no, "出港运抵回执")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
|||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
|
import com.lukouguoji.module_base.ktx.CustomsResponseUrl
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
|
import com.lukouguoji.module_base.ktx.showCustomsResponse
|
||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.noNull
|
import com.lukouguoji.module_base.ktx.noNull
|
||||||
@@ -310,4 +313,14 @@ class IntExpLoadViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表项点击分发:侧滑「回执」按钮 → 查询海关回执并跳转只读详情页
|
||||||
|
*/
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? GjcExportLoad ?: return
|
||||||
|
if (type == ITEM_CLICK_TYPE_CUSTOMS_RESPONSE) {
|
||||||
|
showCustomsResponse(CustomsResponseUrl.INT_EXP_LOAD, bean.prefix, bean.no, "出港装载回执")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
|||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
|
import com.lukouguoji.module_base.ktx.CustomsResponseUrl
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
|
import com.lukouguoji.module_base.ktx.showCustomsResponse
|
||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
@@ -386,4 +389,14 @@ class IntExpTallyViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表项点击分发:侧滑「回执」按钮 → 查询海关回执并跳转只读详情页
|
||||||
|
*/
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? GjcMaWb ?: return
|
||||||
|
if (type == ITEM_CLICK_TYPE_CUSTOMS_RESPONSE) {
|
||||||
|
showCustomsResponse(CustomsResponseUrl.INT_EXP_TALLY, bean.prefix, bean.no, "出港理货回执")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,12 @@
|
|||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 侧滑布局:白色卡片(含展开按钮)+ 侧滑菜单 -->
|
||||||
|
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
|
||||||
|
android:id="@+id/swipe_menu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<!-- 白色卡片 -->
|
<!-- 白色卡片 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -353,6 +359,23 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 侧滑菜单区 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 回执按钮 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btnResponse"
|
||||||
|
style="@style/tv_item_action"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:text="回执" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
|
||||||
|
|
||||||
<!-- 子订单列表容器(白色圆角卡片,圆角同主单) -->
|
<!-- 子订单列表容器(白色圆角卡片,圆角同主单) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
visible="@{bean.showMore}"
|
visible="@{bean.showMore}"
|
||||||
|
|||||||
@@ -20,6 +20,18 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginHorizontal="10dp"
|
android:layout_marginHorizontal="10dp"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 侧滑布局:白色卡片 + 侧滑菜单 -->
|
||||||
|
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
|
||||||
|
android:id="@+id/swipe_menu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
<!-- 白色卡片 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
android:background="@drawable/bg_white_radius_8"
|
android:background="@drawable/bg_white_radius_8"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
@@ -300,4 +312,23 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 侧滑菜单区 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 回执按钮 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btnResponse"
|
||||||
|
style="@style/tv_item_action"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:text="回执" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</layout>
|
</layout>
|
||||||
|
|||||||
@@ -7,6 +7,12 @@
|
|||||||
</data>
|
</data>
|
||||||
<!-- 主列表项容器 -->
|
<!-- 主列表项容器 -->
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="10dp" android:layout_marginTop="10dp" android:orientation="vertical">
|
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginHorizontal="10dp" android:layout_marginTop="10dp" android:orientation="vertical">
|
||||||
|
<!-- 侧滑布局:白色卡片(含展开按钮)+ 侧滑菜单 -->
|
||||||
|
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
|
||||||
|
android:id="@+id/swipe_menu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<!-- 白色卡片主要内容区域 -->
|
<!-- 白色卡片主要内容区域 -->
|
||||||
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/bg_white_radius_8" android:orientation="vertical">
|
<LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@drawable/bg_white_radius_8" android:orientation="vertical">
|
||||||
<!-- 主要内容区域 -->
|
<!-- 主要内容区域 -->
|
||||||
@@ -83,6 +89,23 @@
|
|||||||
android:scaleType="center"
|
android:scaleType="center"
|
||||||
android:src="@mipmap/img_down" />
|
android:src="@mipmap/img_down" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 侧滑菜单区 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 回执按钮 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btnResponse"
|
||||||
|
style="@style/tv_item_action"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:text="回执" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
|
||||||
<!-- 子订单列表容器(在白色卡片外面) -->
|
<!-- 子订单列表容器(在白色卡片外面) -->
|
||||||
<LinearLayout visible="@{bean.showMore}" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:background="@drawable/bg_white_radius_8" android:orientation="vertical" android:visibility="gone">
|
<LinearLayout visible="@{bean.showMore}" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:background="@drawable/bg_white_radius_8" android:orientation="vertical" android:visibility="gone">
|
||||||
<!-- 暂无数据提示 -->
|
<!-- 暂无数据提示 -->
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
|||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.bean.GjjAirManifest
|
import com.lukouguoji.module_base.bean.GjjAirManifest
|
||||||
import com.lukouguoji.module_base.ktx.refresh
|
import com.lukouguoji.module_base.ktx.refresh
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 国际进港原始舱单 ViewHolder
|
* 国际进港原始舱单 ViewHolder
|
||||||
@@ -25,6 +26,12 @@ class IntArrAirManifestViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
|
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||||
|
binding.btnResponse.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||||
|
}
|
||||||
|
|
||||||
// 整卡点击 - 跳转详情页
|
// 整卡点击 - 跳转详情页
|
||||||
notifyItemClick(position, binding.ll)
|
notifyItemClick(position, binding.ll)
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import com.google.gson.Gson
|
|||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.refresh
|
import com.lukouguoji.module_base.ktx.refresh
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
import com.lukouguoji.module_base.ktx.toRequestBody
|
import com.lukouguoji.module_base.ktx.toRequestBody
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,6 +28,12 @@ class IntImpTallyViewHolder(view: View) :
|
|||||||
binding.position = position
|
binding.position = position
|
||||||
binding.executePendingBindings()
|
binding.executePendingBindings()
|
||||||
|
|
||||||
|
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||||
|
binding.btnResponse.setOnClickListener {
|
||||||
|
binding.swipeMenu.quickClose()
|
||||||
|
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||||
|
}
|
||||||
|
|
||||||
// 选中图标点击 - 切换选择状态(独立选择,不联动分单)
|
// 选中图标点击 - 切换选择状态(独立选择,不联动分单)
|
||||||
binding.ivIcon.setOnClickListener {
|
binding.ivIcon.setOnClickListener {
|
||||||
bean.checked.set(!bean.checked.get())
|
bean.checked.set(!bean.checked.get())
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ import com.lukouguoji.gjj.dialog.IntImpTallyResetDialogModel
|
|||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
|
import com.lukouguoji.module_base.ktx.CustomsResponseUrl
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
|
import com.lukouguoji.module_base.ktx.showCustomsResponse
|
||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
@@ -293,10 +296,19 @@ class IntArrAirManifestViewModel : BasePageViewModel() {
|
|||||||
// 获取主单数据
|
// 获取主单数据
|
||||||
val manifest = airManifest.maWb ?: return
|
val manifest = airManifest.maWb ?: return
|
||||||
|
|
||||||
// 跳转到详情页
|
when (type) {
|
||||||
com.lukouguoji.gjj.activity.IntArrAirManifestDetailsActivity.start(
|
// 侧滑「回执」按钮:查询海关回执并跳转只读详情页
|
||||||
|
ITEM_CLICK_TYPE_CUSTOMS_RESPONSE -> showCustomsResponse(
|
||||||
|
CustomsResponseUrl.INT_IMP_AIR_MANIFEST,
|
||||||
|
manifest.prefix,
|
||||||
|
manifest.no,
|
||||||
|
"原始舱单回执"
|
||||||
|
)
|
||||||
|
// 整卡点击(type 为 view id):跳转到详情页
|
||||||
|
else -> com.lukouguoji.gjj.activity.IntArrAirManifestDetailsActivity.start(
|
||||||
getTopActivity(),
|
getTopActivity(),
|
||||||
manifest
|
manifest
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
|||||||
import com.lukouguoji.module_base.http.net.NetApply
|
import com.lukouguoji.module_base.http.net.NetApply
|
||||||
import com.lukouguoji.module_base.impl.FlowBus
|
import com.lukouguoji.module_base.impl.FlowBus
|
||||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||||
|
import com.lukouguoji.module_base.ktx.CustomsResponseUrl
|
||||||
|
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||||
|
import com.lukouguoji.module_base.ktx.showCustomsResponse
|
||||||
import com.lukouguoji.module_base.ktx.launchCollect
|
import com.lukouguoji.module_base.ktx.launchCollect
|
||||||
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
import com.lukouguoji.module_base.ktx.launchLoadingCollect
|
||||||
import com.lukouguoji.module_base.ktx.showToast
|
import com.lukouguoji.module_base.ktx.showToast
|
||||||
@@ -289,4 +292,14 @@ class IntImpTallyViewModel : BasePageViewModel() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表项点击分发:侧滑「回执」按钮 → 查询海关回执并跳转只读详情页
|
||||||
|
*/
|
||||||
|
override fun onItemClick(position: Int, type: Int) {
|
||||||
|
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? GjjImportTally ?: return
|
||||||
|
if (type == ITEM_CLICK_TYPE_CUSTOMS_RESPONSE) {
|
||||||
|
showCustomsResponse(CustomsResponseUrl.INT_IMP_TALLY, bean.prefix, bean.no, "进港理货回执")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,12 @@
|
|||||||
android:layout_marginVertical="5dp"
|
android:layout_marginVertical="5dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 侧滑布局:白色卡片(含展开按钮)+ 侧滑菜单 -->
|
||||||
|
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
|
||||||
|
android:id="@+id/swipe_menu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<!-- 白色卡片(包含内容区域 + 展开按钮,统一圆角) -->
|
<!-- 白色卡片(包含内容区域 + 展开按钮,统一圆角) -->
|
||||||
<androidx.appcompat.widget.LinearLayoutCompat
|
<androidx.appcompat.widget.LinearLayoutCompat
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -323,6 +329,23 @@
|
|||||||
|
|
||||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||||
|
|
||||||
|
<!-- 侧滑菜单区 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 回执按钮 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btnResponse"
|
||||||
|
style="@style/tv_item_action"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:text="回执" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
|
||||||
|
|
||||||
<!-- 分单子列表容器(淡绿色背景) -->
|
<!-- 分单子列表容器(淡绿色背景) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
visible="@{bean.showMore}"
|
visible="@{bean.showMore}"
|
||||||
|
|||||||
@@ -24,6 +24,12 @@
|
|||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<!-- 侧滑布局:白色卡片(含展开按钮)+ 侧滑菜单 -->
|
||||||
|
<com.mcxtzhang.swipemenulib.SwipeMenuLayout
|
||||||
|
android:id="@+id/swipe_menu"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
<!-- 白色卡片主要内容区域 -->
|
<!-- 白色卡片主要内容区域 -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -339,6 +345,23 @@
|
|||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
<!-- 侧滑菜单区 -->
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<!-- 回执按钮 -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/btnResponse"
|
||||||
|
style="@style/tv_item_action"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:text="回执" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</com.mcxtzhang.swipemenulib.SwipeMenuLayout>
|
||||||
|
|
||||||
<!-- 分单子列表容器(在白色卡片外面) -->
|
<!-- 分单子列表容器(在白色卡片外面) -->
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
visible="@{bean.showMore}"
|
visible="@{bean.showMore}"
|
||||||
|
|||||||
Reference in New Issue
Block a user