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:
@@ -9,6 +9,7 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
||||
import com.lukouguoji.module_base.ktx.refresh
|
||||
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||
|
||||
/**
|
||||
* 国际出港-出港运抵 列表项ViewHolder
|
||||
@@ -22,6 +23,12 @@ class IntExpArriveViewHolder(view: View) :
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||
binding.btnResponse.setOnClickListener {
|
||||
binding.swipeMenu.quickClose()
|
||||
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||
}
|
||||
|
||||
// 添加图标点击事件 - 切换选择状态
|
||||
binding.ivIcon.setOnClickListener {
|
||||
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.impl.FlowBus
|
||||
import com.lukouguoji.module_base.bean.GjcExportLoad
|
||||
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||
|
||||
/**
|
||||
* 国际出港-出港装载 列表项ViewHolder
|
||||
@@ -19,6 +20,12 @@ class IntExpLoadViewHolder(view: View) :
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||
binding.btnResponse.setOnClickListener {
|
||||
binding.swipeMenu.quickClose()
|
||||
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||
}
|
||||
|
||||
// 添加图标点击事件 - 切换选择状态
|
||||
binding.ivIcon.setOnClickListener {
|
||||
// 反转checked状态
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.bean.GjcMaWb
|
||||
import com.lukouguoji.module_base.ktx.refresh
|
||||
import com.lukouguoji.module_base.ktx.ITEM_CLICK_TYPE_CUSTOMS_RESPONSE
|
||||
|
||||
/**
|
||||
* 国际出港-出港理货 ViewHolder
|
||||
@@ -22,6 +23,12 @@ class IntExpTallyViewHolder(view: View) :
|
||||
binding.position = position
|
||||
binding.executePendingBindings()
|
||||
|
||||
// 侧滑菜单 - 回执按钮(关闭侧滑后分发到 ViewModel)
|
||||
binding.btnResponse.setOnClickListener {
|
||||
binding.swipeMenu.quickClose()
|
||||
clickListener?.onItemClick(position, ITEM_CLICK_TYPE_CUSTOMS_RESPONSE)
|
||||
}
|
||||
|
||||
// 图标点击切换选择状态(主单和分单独立,互不干扰)
|
||||
binding.ivIcon.setOnClickListener {
|
||||
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.impl.FlowBus
|
||||
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.launchLoadingCollect
|
||||
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.impl.FlowBus
|
||||
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.launchLoadingCollect
|
||||
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.impl.FlowBus
|
||||
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.launchLoadingCollect
|
||||
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: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"
|
||||
@@ -353,6 +359,23 @@
|
||||
|
||||
</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}"
|
||||
|
||||
@@ -20,11 +20,23 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/bg_white_radius_8"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="20dp"
|
||||
android:paddingHorizontal="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:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingVertical="20dp"
|
||||
android:paddingHorizontal="10dp">
|
||||
<!-- 选中图标 (飞机图标,根据选择状态切换图片) -->
|
||||
<ImageView
|
||||
android:id="@+id/iv_icon"
|
||||
@@ -298,6 +310,25 @@
|
||||
|
||||
</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>
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
</data>
|
||||
<!-- 主列表项容器 -->
|
||||
<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">
|
||||
<!-- 主要内容区域 -->
|
||||
@@ -83,6 +89,23 @@
|
||||
android:scaleType="center"
|
||||
android:src="@mipmap/img_down" />
|
||||
</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">
|
||||
<!-- 暂无数据提示 -->
|
||||
|
||||
Reference in New Issue
Block a user