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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user