feat: 国际进港理货报告详情页面
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.lukouguoji.gjj.activity
|
||||
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import com.lukouguoji.gjj.R
|
||||
import com.lukouguoji.gjj.databinding.ActivityIntImpTallyDetailsBinding
|
||||
import com.lukouguoji.gjj.viewModel.IntImpTallyDetailsViewModel
|
||||
import com.lukouguoji.module_base.base.BaseBindingActivity
|
||||
import com.lukouguoji.module_base.bean.GjjImportTally
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
|
||||
/**
|
||||
* 国际进港理货报告详情
|
||||
*/
|
||||
class IntImpTallyDetailsActivity :
|
||||
BaseBindingActivity<ActivityIntImpTallyDetailsBinding, IntImpTallyDetailsViewModel>() {
|
||||
|
||||
override fun layoutId() = R.layout.activity_int_imp_tally_details
|
||||
override fun viewModelClass() = IntImpTallyDetailsViewModel::class.java
|
||||
|
||||
override fun initOnCreate(savedInstanceState: Bundle?) {
|
||||
setBackArrow("理货报告详情")
|
||||
binding.viewModel = viewModel
|
||||
viewModel.initOnCreated(intent)
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun start(context: Context, tally: GjjImportTally) {
|
||||
val starter = Intent(context, IntImpTallyDetailsActivity::class.java)
|
||||
.putExtra(Constant.Key.DATA, tally)
|
||||
context.startActivity(starter)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.lukouguoji.gjj.holder
|
||||
import android.view.View
|
||||
import com.lukouguoji.gjj.R
|
||||
import com.lukouguoji.gjj.databinding.ItemIntImpTallyBinding
|
||||
import com.lukouguoji.gjj.activity.IntImpTallyDetailsActivity
|
||||
import com.lukouguoji.module_base.adapter.setCommonAdapter
|
||||
import com.lukouguoji.module_base.base.BaseViewHolder
|
||||
import com.lukouguoji.module_base.bean.GjjImportTally
|
||||
@@ -38,6 +39,11 @@ class IntImpTallyViewHolder(view: View) :
|
||||
binding.rvSub.adapter?.notifyDataSetChanged()
|
||||
}
|
||||
|
||||
// 整个内容区域点击 - 跳转到详情页
|
||||
binding.llContent.setOnClickListener {
|
||||
IntImpTallyDetailsActivity.start(it.context, bean)
|
||||
}
|
||||
|
||||
// 展开按钮点击事件
|
||||
binding.ivShow.setOnClickListener {
|
||||
if (bean.haWbList != null) {
|
||||
|
||||
@@ -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.GjjImportTally
|
||||
import com.lukouguoji.module_base.common.Constant
|
||||
|
||||
/**
|
||||
* 国际进港理货报告详情 ViewModel
|
||||
*/
|
||||
class IntImpTallyDetailsViewModel : BaseViewModel() {
|
||||
|
||||
// 理货数据
|
||||
val dataBean = MutableLiveData(GjjImportTally())
|
||||
|
||||
/**
|
||||
* 初始化数据(从列表项携带的数据)
|
||||
*/
|
||||
fun initOnCreated(intent: Intent) {
|
||||
val tally = intent.getSerializableExtra(Constant.Key.DATA) as? GjjImportTally
|
||||
if (tally != null) {
|
||||
dataBean.value = tally
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user