feat: 新增图片选择控件并修正事故签证字段
- 新增 ImageSelectNewViewHolder 和 item_image_select_new 布局,支持正方形缩略图、 加号按钮始终在末尾、详情模式隐藏加号及"暂无图片"占位 - 国际事故签证编辑页和国内进港移交页应用新图片选择控件 - 修正事故签证字段:reweight → reWeight,opName/opDate → opId/opdate Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -14,7 +14,7 @@ import com.lukouguoji.module_base.common.ConstantEvent
|
||||
import com.lukouguoji.module_base.common.DetailsPageType
|
||||
import com.lukouguoji.module_base.http.net.NetApply
|
||||
import com.lukouguoji.module_base.impl.FlowBus
|
||||
import com.lukouguoji.module_base.impl.ImageSelectViewHolder
|
||||
import com.lukouguoji.module_base.impl.ImageSelectNewViewHolder
|
||||
import com.lukouguoji.module_base.interfaces.IOnItemClickListener
|
||||
import com.lukouguoji.module_base.ktx.commonAdapter
|
||||
import com.lukouguoji.module_base.ktx.formatDate
|
||||
@@ -51,8 +51,8 @@ class IntImpAccidentVisaEditViewModel : BaseViewModel(), IOnItemClickListener {
|
||||
val dataBean = MutableLiveData(GjAccidentVisaEditBean())
|
||||
|
||||
// 图片列表
|
||||
val itemLayoutId = R.layout.item_image_select
|
||||
val itemViewHolder = ImageSelectViewHolder::class.java
|
||||
val itemLayoutId = R.layout.item_image_select_new
|
||||
val itemViewHolder = ImageSelectNewViewHolder::class.java
|
||||
var rv: RecyclerView? = null
|
||||
|
||||
// 下拉列表
|
||||
@@ -73,6 +73,8 @@ class IntImpAccidentVisaEditViewModel : BaseViewModel(), IOnItemClickListener {
|
||||
|
||||
// 是否为详情模式(只读)
|
||||
val isDetailMode = MutableLiveData(false)
|
||||
// 详情模式下无图片时显示占位提示
|
||||
val showNoImage = MutableLiveData(false)
|
||||
|
||||
fun initOnCreate(intent: Intent) {
|
||||
id = intent.getLongExtra(Constant.Key.ID, 0)
|
||||
@@ -156,6 +158,11 @@ class IntImpAccidentVisaEditViewModel : BaseViewModel(), IOnItemClickListener {
|
||||
}
|
||||
}
|
||||
rv?.commonAdapter()?.loadMore(picList)
|
||||
|
||||
// 详情模式下无图片时显示占位提示
|
||||
if (isDetailMode.value == true && picList.isEmpty()) {
|
||||
showNoImage.value = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
title='@{"复称重量"}'
|
||||
titleLength="@{6}"
|
||||
type="@{DataLayoutType.INPUT}"
|
||||
value='@={viewModel.dataBean.reweight}' />
|
||||
value='@={viewModel.dataBean.reWeight}' />
|
||||
|
||||
<com.lukouguoji.module_base.ui.weight.data.layout.PadDataLayoutNew
|
||||
android:layout_width="0dp"
|
||||
@@ -262,7 +262,7 @@
|
||||
title='@{"不正常类型"}'
|
||||
titleLength="@{6}"
|
||||
type="@{DataLayoutType.SPINNER}"
|
||||
value='@={viewModel.dataBean.problem}' />
|
||||
value='@={viewModel.dataBean.kdamage}' />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -339,8 +339,21 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="4"
|
||||
tools:listitem="@layout/item_image_select" />
|
||||
app:spanCount="6"
|
||||
tools:listitem="@layout/item_image_select_new" />
|
||||
|
||||
<!-- 详情模式下无图片时的占位提示 -->
|
||||
<TextView
|
||||
android:id="@+id/tv_no_image"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="80dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@color/white"
|
||||
android:gravity="center"
|
||||
android:text="暂无图片"
|
||||
android:textColor="@color/text_gray"
|
||||
android:textSize="14sp"
|
||||
android:visibility="@{viewModel.showNoImage ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<!-- 底部按钮(详情模式隐藏) -->
|
||||
<LinearLayout
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.opName}"
|
||||
android:text="@{bean.opId}"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
@@ -284,7 +284,7 @@
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{bean.opDate}"
|
||||
android:text="@{bean.opdate}"
|
||||
android:textSize="15sp" />
|
||||
|
||||
</androidx.appcompat.widget.LinearLayoutCompat>
|
||||
|
||||
Reference in New Issue
Block a user