feat: 国际进港舱单详情页面
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.lukouguoji.gjj.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.alibaba.android.arouter.facade.annotation.Route
|
||||
import com.lukouguoji.gjj.R
|
||||
import com.lukouguoji.gjj.databinding.ActivityIntImpManifestDetailsBinding
|
||||
import com.lukouguoji.gjj.viewModel.IntImpManifestDetailsViewModel
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.bean.GjjManifest
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
import com.lukouguoji.module_base.router.ARouterConstants
|
||||
|
||||
/**
|
||||
* 国际进港舱单详情
|
||||
*/
|
||||
@Route(path = ARouterConstants.ACTIVITY_URL_INT_IMP_MANIFEST_DETAILS)
|
||||
class IntImpManifestDetailsActivity :
|
||||
BaseBindingActivity<ActivityIntImpManifestDetailsBinding, IntImpManifestDetailsViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_int_imp_manifest_details
|
||||
override fun viewModelClass() = IntImpManifestDetailsViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("进港舱单详情")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.initOnCreated(intent)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, manifest: GjjManifest) {
|
||||
val starter = Intent(context, IntImpManifestDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.DATA, manifest)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,9 @@ class IntImpManifestViewHolder(view: View) :
|
||||
binding.rvSub.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
// 整卡点击 - 跳转详情页
|
||||
notifyItemClick(position, binding.llContent)
|
||||
|
||||
// 编辑按钮点击
|
||||
binding.btnEdit.setOnClickListener {
|
||||
clickListener?.onItemClick(position, 101) // 101=编辑
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.lukouguoji.gjj.viewModel
|
||||
|
||||
import android.content.Intent
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import com.lukouguoji.module_base.base.BaseViewModel
|
||||
import com.lukouguoji.module_base.bean.GjjManifest
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
|
||||
/**
|
||||
* 国际进港舱单详情 ViewModel
|
||||
*/
|
||||
class IntImpManifestDetailsViewModel : BaseViewModel() {
|
||||
|
||||
// 舱单数据
|
||||
val dataBean = MutableLiveData(GjjManifest())
|
||||
|
||||
/**
|
||||
* 初始化数据(从列表项携带的数据)
|
||||
*/
|
||||
fun initOnCreated(intent: Intent) {
|
||||
val manifest = intent.getSerializableExtra(Constant.Key.DATA) as? GjjManifest
|
||||
if (manifest != null) {
|
||||
dataBean.value = manifest
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -258,7 +258,7 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Item点击处理(侧滑按钮)
|
||||
* Item点击处理(侧滑按钮 + 列表项点击)
|
||||
*/
|
||||
override fun onItemClick(position: Int, type: Int) {
|
||||
val bean = pageModel.rv?.commonAdapter()?.getItem(position) as? GjjManifest ?: return
|
||||
@@ -280,6 +280,12 @@ class IntImpManifestViewModel : BasePageViewModel() {
|
||||
// 展开 - 加载分单数据
|
||||
loadHaWbList(bean)
|
||||
}
|
||||
else -> {
|
||||
// 列表项点击 - 跳转详情页
|
||||
com.lukouguoji.gjj.activity.IntImpManifestDetailsActivity.start(
|
||||
getTopActivity(), bean
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user