fix(gjc): 出港移库编辑拆分交接图片与补充信息卡片,补上图片删除

- 交接图片单独成卡:橙色表头 + 三列虚线加号槽位,与国内进港移库「异常照片」一致;
  其下新增「补充信息」卡片(表头底色 #F3F4F6)承载备注录入
- 删除不了图片:选图组件长按回调 onItemClick(rl) 以显示删除角标,ViewModel 只处理了
  点角标删除,角标永远出不来;补上长按切换(详情态不可删,平板共用一并生效)
- 公共选图格子 item_image_select_new 拆双变体:平板原样移到 layout-sw600dp/,
  手机版改为灰色虚线框 + 灰色加号(国内移库拍照页同步统一)

表头文字颜色暂用深色(Bug 单写白字,白字在 #F3F4F6 上不可读),待确认。

Refs: 禅道 Bug #632

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
YANG JIANKUAN
2026-10-14 20:21:50 -07:00
parent 36d74c3f0d
commit 2996e670e0
5 changed files with 124 additions and 29 deletions

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- 手机版详情卡片表头:#F3F4F6 浅灰底 + 顶部 12dp 圆角(出港移库编辑-补充信息卡片) -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/phone_bg" />
<corners
android:topLeftRadius="12dp"
android:topRightRadius="12dp" />
</shape>

View File

@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
<data>
<variable
name="bean"
type="com.lukouguoji.module_base.bean.FileBean" />
</data>
<RelativeLayout
android:id="@+id/rl"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_margin="5dp"
android:background="@{bean.path.length() == 0 ? @color/color_f2 : @color/white}">
<ImageView
visible="@{bean.path.length() == 0}"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_centerInParent="true"
android:src="@drawable/img_add" />
<ImageView
android:id="@+id/iv"
loadImage="@{bean.path}"
visible="@{bean.path}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop" />
<View
visible="@{bean.canDelete}"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black_tran10" />
<ImageView
android:id="@+id/iv_delete"
visible="@{bean.canDelete}"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_centerInParent="true"
android:src="@drawable/img_delete_red" />
</RelativeLayout>
</layout>

View File

@@ -1,4 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!--
手机版选图格子(平板版在 layout-sw600dp/,两者变量与 id 一致,共用 ImageSelectNewViewHolder)。
加号槽位与进港移库「异常照片」一致:灰色虚线框 + 灰色加号;已选图片长按出删除角标。
-->
<layout xmlns:android="http://schemas.android.com/apk/res/android"> <layout xmlns:android="http://schemas.android.com/apk/res/android">
<data> <data>
@@ -12,15 +16,17 @@
android:id="@+id/rl" android:id="@+id/rl"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_margin="5dp" android:layout_margin="6dp"
android:background="@{bean.path.length() == 0 ? @color/color_f2 : @color/white}"> android:background="@drawable/bg_phone_photo_add">
<ImageView <TextView
visible="@{bean.path.length() == 0}" visible="@{bean.path.length() == 0}"
android:layout_width="50dp" android:layout_width="wrap_content"
android:layout_height="50dp" android:layout_height="wrap_content"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:src="@drawable/img_add" /> android:text="+"
android:textColor="@color/phone_text_hint"
android:textSize="24sp" />
<ImageView <ImageView
android:id="@+id/iv" android:id="@+id/iv"

View File

@@ -178,11 +178,18 @@ class IntExpMoveEditViewModel : BaseViewModel(), IOnItemClickListener {
* 处理图片删除点击事件 * 处理图片删除点击事件
*/ */
override fun onItemClick(position: Int, type: Int) { override fun onItemClick(position: Int, type: Int) {
if (type == R.id.iv_delete) {
val adapter = rvImages?.commonAdapter() ?: return val adapter = rvImages?.commonAdapter() ?: return
if (position < adapter.items.size) { if (position >= adapter.items.size) return
adapter.removeItem(position) when (type) {
} // 长按已选图片:切换删除角标(Bug #632:原先未处理长按,角标出不来导致无法删除)
R.id.rl -> {
val bean = adapter.getItem(position) as? FileBean ?: return
if (bean.path.isNotEmpty() && pageType.value != DetailsPageType.Details) {
bean.canDelete.set(!bean.canDelete.get())
}
}
R.id.iv_delete -> adapter.removeItem(position)
} }
} }
} }

View File

@@ -235,43 +235,35 @@
</LinearLayout> </LinearLayout>
<!-- ==================== 卡片三:备注 + 交接图片(编辑态可改) ==================== --> <!-- ==================== 卡片三:交接图片(Bug #632:样式与进港移库「异常照片」一致——橙色表头 + 三列虚线加号槽位,长按图片出删除角标) ==================== -->
<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="16dp" android:layout_marginTop="16dp"
android:background="@drawable/bg_phone_card" android:background="@drawable/bg_phone_card"
android:orientation="vertical" android:orientation="vertical">
android:paddingHorizontal="16dp"
android:paddingBottom="12dp">
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
enable="@{viewModel.pageType != DetailsPageType.Details}"
hint='@{"请输入备注"}'
title='@{"备注"}'
type="@{viewModel.pageType == DetailsPageType.Details ? PhoneFormRowType.TEXT : PhoneFormRowType.INPUT}"
value="@={viewModel.remark}" />
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="12dp" android:background="@drawable/bg_phone_card_header_orange"
android:paddingHorizontal="16dp"
android:paddingVertical="10dp"
android:text="交接图片" android:text="交接图片"
android:textColor="@color/phone_text_label" android:textColor="@color/white"
android:textSize="15sp" /> android:textSize="15sp"
android:textStyle="bold" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_images" android:id="@+id/rv_images"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:overScrollMode="never" android:overScrollMode="never"
android:padding="10dp"
itemLayoutId="@{viewModel.imageItemLayoutId}" itemLayoutId="@{viewModel.imageItemLayoutId}"
viewHolder="@{viewModel.imageItemViewHolder}" viewHolder="@{viewModel.imageItemViewHolder}"
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager" app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
app:spanCount="4" /> app:spanCount="3" />
<!-- 详情模式下无图片时的占位提示 --> <!-- 详情模式下无图片时的占位提示 -->
<TextView <TextView
@@ -286,6 +278,39 @@
</LinearLayout> </LinearLayout>
<!-- ==================== 卡片四:补充信息(Bug #632:备注录入与保存,表头底色 #F3F4F6) ==================== -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@drawable/bg_phone_card"
android:orientation="vertical">
<!-- 表头文字色:Bug 单写的是白色,但白字在 #F3F4F6 上不可读,暂用标题深色,待确认 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_phone_card_header_gray"
android:paddingHorizontal="16dp"
android:paddingVertical="10dp"
android:text="补充信息"
android:textColor="@color/phone_text_title"
android:textSize="15sp"
android:textStyle="bold" />
<com.lukouguoji.module_base.ui.weight.phone.PhoneFormRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingHorizontal="16dp"
android:paddingBottom="4dp"
enable="@{viewModel.pageType != DetailsPageType.Details}"
hint='@{"请输入备注"}'
title='@{"备注"}'
type="@{viewModel.pageType == DetailsPageType.Details ? PhoneFormRowType.TEXT : PhoneFormRowType.INPUT}"
value="@={viewModel.remark}" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>